diff --git a/.gitignore b/.gitignore index eac3b1ae59..ce44cb80f1 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,6 @@ out.* out .parcel-cache esbuilddir -*.jsb \ No newline at end of file +*.jsb +parceldist +esbuilddir \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 2c71a000d9..453fdbecb5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -59,13 +59,26 @@ "program": "${workspaceFolder}/build/debug/macos-x86_64/esdev", "args": [ "./src/index.tsx", - "--resolve=dev", - "--jsb", + "--resolve=lazy", "--public-url=http://localhost:9000/" ], "cwd": "${workspaceFolder}/demos/simple-react", "console": "internalConsole" }, + + { + "type": "lldb", + "request": "launch", + "name": "Demo Build .jsb", + "program": "${workspaceFolder}/build/debug/macos-x86_64/esdev", + "args": [ + "./src/index.tsx", + "--public-url=http://localhost:9000/", + "--new-jsb" + ], + "cwd": "${workspaceFolder}/demos/simple-react", + "console": "internalConsole" + }, { "type": "lldb", "request": "launch", diff --git a/demos/simple-react/esbuilddir/index.js b/demos/simple-react/esbuilddir/index.js index a6190a1623..c3deb64ab9 100644 --- a/demos/simple-react/esbuilddir/index.js +++ b/demos/simple-react/esbuilddir/index.js @@ -6,14 +6,19 @@ var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); - var __commonJS = (cb, mod) => function __require() { + var __require = (x) => { + if (typeof require !== "undefined") + return require(x); + throw new Error('Dynamic require of "' + x + '" is not supported'); + }; + var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __reExport = (target, module, desc) => { if (module && typeof module === "object" || typeof module === "function") { - for (let key of __getOwnPropNames(module)) - if (!__hasOwnProp.call(target, key) && key !== "default") - __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable }); + for (let key2 of __getOwnPropNames(module)) + if (!__hasOwnProp.call(target, key2) && key2 !== "default") + __defProp(target, key2, { get: () => module[key2], enumerable: !(desc = __getOwnPropDesc(module, key2)) || desc.enumerable }); } return target; }; @@ -72,9 +77,9 @@ var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; + for (var key2 in from) { + if (hasOwnProperty.call(from, key2)) { + to[key2] = from[key2]; } } if (getOwnPropertySymbols) { @@ -203,34 +208,34 @@ { ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; } - function warn(format) { + function warn(format3) { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } - printWarning("warn", format, args); + printWarning("warn", format3, args); } } - function error(format) { + function error(format3) { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } - printWarning("error", format, args); + printWarning("error", format3, args); } } - function printWarning(level, format, args) { + function printWarning(level, format3, args) { { var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame2.getStackAddendum(); if (stack !== "") { - format += "%s"; + format3 += "%s"; args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { return "" + item; }); - argsWithFormat.unshift("Warning: " + format); + argsWithFormat.unshift("Warning: " + format3); Function.prototype.apply.call(console[level], console, argsWithFormat); } } @@ -265,14 +270,14 @@ { Object.freeze(emptyObject); } - function Component(props, context, updater) { + function Component14(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } - Component.prototype.isReactComponent = {}; - Component.prototype.setState = function(partialState, callback) { + Component14.prototype.isReactComponent = {}; + Component14.prototype.setState = function(partialState, callback) { if (!(typeof partialState === "object" || typeof partialState === "function" || partialState == null)) { { throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); @@ -280,7 +285,7 @@ } this.updater.enqueueSetState(this, partialState, callback, "setState"); }; - Component.prototype.forceUpdate = function(callback) { + Component14.prototype.forceUpdate = function(callback) { this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); }; { @@ -289,7 +294,7 @@ replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."] }; var defineDeprecationWarning = function(methodName, info) { - Object.defineProperty(Component.prototype, methodName, { + Object.defineProperty(Component14.prototype, methodName, { get: function() { warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]); return void 0; @@ -304,7 +309,7 @@ } function ComponentDummy() { } - ComponentDummy.prototype = Component.prototype; + ComponentDummy.prototype = Component14.prototype; function PureComponent(props, context, updater) { this.props = props; this.context = context; @@ -313,9 +318,9 @@ } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); pureComponentPrototype.constructor = PureComponent; - _assign(pureComponentPrototype, Component.prototype); + _assign(pureComponentPrototype, Component14.prototype); pureComponentPrototype.isPureReactComponent = true; - function createRef() { + function createRef8() { var refObject = { current: null }; @@ -328,25 +333,25 @@ var functionName = innerType.displayName || innerType.name || ""; return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); } - function getContextName(type) { - return type.displayName || "Context"; + function getContextName(type2) { + return type2.displayName || "Context"; } - function getComponentName(type) { - if (type == null) { + function getComponentName(type2) { + if (type2 == null) { return null; } { - if (typeof type.tag === "number") { + if (typeof type2.tag === "number") { error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."); } } - if (typeof type === "function") { - return type.displayName || type.name || null; + if (typeof type2 === "function") { + return type2.displayName || type2.name || null; } - if (typeof type === "string") { - return type; + if (typeof type2 === "string") { + return type2; } - switch (type) { + switch (type2) { case exports.Fragment: return "Fragment"; case REACT_PORTAL_TYPE: @@ -360,22 +365,22 @@ case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } - if (typeof type === "object") { - switch (type.$$typeof) { + if (typeof type2 === "object") { + switch (type2.$$typeof) { case REACT_CONTEXT_TYPE: - var context = type; + var context = type2; return getContextName(context) + ".Consumer"; case REACT_PROVIDER_TYPE: - var provider = type; + var provider = type2; return getContextName(provider._context) + ".Provider"; case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, "ForwardRef"); + return getWrappedName(type2, type2.render, "ForwardRef"); case REACT_MEMO_TYPE: - return getComponentName(type.type); + return getComponentName(type2.type); case REACT_BLOCK_TYPE: - return getComponentName(type._render); + return getComponentName(type2._render); case REACT_LAZY_TYPE: { - var lazyComponent = type; + var lazyComponent = type2; var payload = lazyComponent._payload; var init = lazyComponent._init; try { @@ -462,11 +467,11 @@ } } } - var ReactElement = function(type, key, ref, self, source, owner, props) { + var ReactElement = function(type2, key2, ref, self2, source, owner, props) { var element = { $$typeof: REACT_ELEMENT_TYPE, - type, - key, + type: type2, + key: key2, ref, props, _owner: owner @@ -483,7 +488,7 @@ configurable: false, enumerable: false, writable: false, - value: self + value: self2 }); Object.defineProperty(element, "_source", { configurable: false, @@ -498,12 +503,12 @@ } return element; }; - function createElement(type, config, children) { + function createElement79(type2, config, children) { var propName; var props = {}; - var key = null; + var key2 = null; var ref = null; - var self = null; + var self2 = null; var source = null; if (config != null) { if (hasValidRef(config)) { @@ -513,9 +518,9 @@ } } if (hasValidKey(config)) { - key = "" + config.key; + key2 = "" + config.key; } - self = config.__self === void 0 ? null : config.__self; + self2 = config.__self === void 0 ? null : config.__self; source = config.__source === void 0 ? null : config.__source; for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { @@ -538,8 +543,8 @@ } props.children = childArray; } - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; + if (type2 && type2.defaultProps) { + var defaultProps = type2.defaultProps; for (propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; @@ -547,9 +552,9 @@ } } { - if (key || ref) { - var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type; - if (key) { + if (key2 || ref) { + var displayName = typeof type2 === "function" ? type2.displayName || type2.name || "Unknown" : type2; + if (key2) { defineKeyPropWarningGetter(props, displayName); } if (ref) { @@ -557,13 +562,13 @@ } } } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); + return ReactElement(type2, key2, ref, self2, source, ReactCurrentOwner.current, props); } function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; } - function cloneElement(element, config, children) { + function cloneElement7(element, config, children) { if (!!(element === null || element === void 0)) { { throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); @@ -571,9 +576,9 @@ } var propName; var props = _assign({}, element.props); - var key = element.key; + var key2 = element.key; var ref = element.ref; - var self = element._self; + var self2 = element._self; var source = element._source; var owner = element._owner; if (config != null) { @@ -582,7 +587,7 @@ owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { - key = "" + config.key; + key2 = "" + config.key; } var defaultProps; if (element.type && element.type.defaultProps) { @@ -608,20 +613,20 @@ } props.children = childArray; } - return ReactElement(element.type, key, ref, self, source, owner, props); + return ReactElement(element.type, key2, ref, self2, source, owner, props); } - function isValidElement(object) { - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + function isValidElement6(object3) { + return typeof object3 === "object" && object3 !== null && object3.$$typeof === REACT_ELEMENT_TYPE; } var SEPARATOR = "."; var SUBSEPARATOR = ":"; - function escape(key) { + function escape(key2) { var escapeRegex = /[=:]/g; var escaperLookup = { "=": "=0", ":": "=2" }; - var escapedString = key.replace(escapeRegex, function(match) { + var escapedString = key2.replace(escapeRegex, function(match) { return escaperLookup[match]; }); return "$" + escapedString; @@ -631,22 +636,22 @@ function escapeUserProvidedKey(text) { return text.replace(userProvidedKeyEscapeRegex, "$&/"); } - function getElementKey(element, index) { + function getElementKey(element, index2) { if (typeof element === "object" && element !== null && element.key != null) { return escape("" + element.key); } - return index.toString(36); + return index2.toString(36); } - function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { - var type = typeof children; - if (type === "undefined" || type === "boolean") { + function mapIntoArray(children, array3, escapedPrefix, nameSoFar, callback) { + var type2 = typeof children; + if (type2 === "undefined" || type2 === "boolean") { children = null; } var invokeCallback = false; if (children === null) { invokeCallback = true; } else { - switch (type) { + switch (type2) { case "string": case "number": invokeCallback = true; @@ -668,14 +673,14 @@ if (childKey != null) { escapedChildKey = escapeUserProvidedKey(childKey) + "/"; } - mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) { + mapIntoArray(mappedChild, array3, escapedChildKey, "", function(c) { return c; }); } else if (mappedChild != null) { - if (isValidElement(mappedChild)) { + if (isValidElement6(mappedChild)) { mappedChild = cloneAndReplaceKey(mappedChild, escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey("" + mappedChild.key) + "/" : "") + childKey); } - array.push(mappedChild); + array3.push(mappedChild); } return 1; } @@ -687,7 +692,7 @@ for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getElementKey(child, i); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + subtreeCount += mapIntoArray(child, array3, escapedPrefix, nextName, callback); } } else { var iteratorFn = getIteratorFn(children); @@ -707,9 +712,9 @@ while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getElementKey(child, ii++); - subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); + subtreeCount += mapIntoArray(child, array3, escapedPrefix, nextName, callback); } - } else if (type === "object") { + } else if (type2 === "object") { var childrenString = "" + children; { { @@ -743,20 +748,20 @@ forEachFunc.apply(this, arguments); }, forEachContext); } - function toArray(children) { + function toArray5(children) { return mapChildren(children, function(child) { return child; }) || []; } function onlyChild(children) { - if (!isValidElement(children)) { + if (!isValidElement6(children)) { { throw Error("React.Children.only expected to receive a single React element child."); } } return children; } - function createContext(defaultValue, calculateChangedBits) { + function createContext10(defaultValue, calculateChangedBits) { if (calculateChangedBits === void 0) { calculateChangedBits = null; } else { @@ -935,7 +940,7 @@ } return lazyType; } - function forwardRef(render) { + function forwardRef23(render) { { if (render != null && render.$$typeof === REACT_MEMO_TYPE) { error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."); @@ -975,29 +980,29 @@ return elementType; } var enableScopeAPI = false; - function isValidElementType(type) { - if (typeof type === "string" || typeof type === "function") { + function isValidElementType(type2) { + if (typeof type2 === "string" || typeof type2 === "function") { return true; } - if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) { + if (type2 === exports.Fragment || type2 === exports.Profiler || type2 === REACT_DEBUG_TRACING_MODE_TYPE || type2 === exports.StrictMode || type2 === exports.Suspense || type2 === REACT_SUSPENSE_LIST_TYPE || type2 === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI) { return true; } - if (typeof type === "object" && type !== null) { - if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) { + if (typeof type2 === "object" && type2 !== null) { + if (type2.$$typeof === REACT_LAZY_TYPE || type2.$$typeof === REACT_MEMO_TYPE || type2.$$typeof === REACT_PROVIDER_TYPE || type2.$$typeof === REACT_CONTEXT_TYPE || type2.$$typeof === REACT_FORWARD_REF_TYPE || type2.$$typeof === REACT_FUNDAMENTAL_TYPE || type2.$$typeof === REACT_BLOCK_TYPE || type2[0] === REACT_SERVER_BLOCK_TYPE) { return true; } } return false; } - function memo(type, compare) { + function memo(type2, compare) { { - if (!isValidElementType(type)) { - error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type); + if (!isValidElementType(type2)) { + error("memo: The first argument must be a component. Instead received: %s", type2 === null ? "null" : typeof type2); } } var elementType = { $$typeof: REACT_MEMO_TYPE, - type, + type: type2, compare: compare === void 0 ? null : compare }; { @@ -1010,8 +1015,8 @@ }, set: function(name) { ownName = name; - if (type.displayName == null) { - type.displayName = name; + if (type2.displayName == null) { + type2.displayName = name; } } }); @@ -1027,24 +1032,24 @@ } return dispatcher; } - function useContext(Context, unstable_observedBits) { + function useContext28(Context2, unstable_observedBits) { var dispatcher = resolveDispatcher(); { if (unstable_observedBits !== void 0) { error("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s", unstable_observedBits, typeof unstable_observedBits === "number" && Array.isArray(arguments[2]) ? "\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://reactjs.org/link/rules-of-hooks" : ""); } - if (Context._context !== void 0) { - var realContext = Context._context; - if (realContext.Consumer === Context) { + if (Context2._context !== void 0) { + var realContext = Context2._context; + if (realContext.Consumer === Context2) { error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"); - } else if (realContext.Provider === Context) { + } else if (realContext.Provider === Context2) { error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?"); } } } - return dispatcher.useContext(Context, unstable_observedBits); + return dispatcher.useContext(Context2, unstable_observedBits); } - function useState(initialState) { + function useState21(initialState) { var dispatcher = resolveDispatcher(); return dispatcher.useState(initialState); } @@ -1052,27 +1057,27 @@ var dispatcher = resolveDispatcher(); return dispatcher.useReducer(reducer, initialArg, init); } - function useRef(initialValue) { + function useRef31(initialValue) { var dispatcher = resolveDispatcher(); return dispatcher.useRef(initialValue); } - function useEffect(create, deps) { + function useEffect23(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useEffect(create, deps); } - function useLayoutEffect(create, deps) { + function useLayoutEffect3(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useLayoutEffect(create, deps); } - function useCallback(callback, deps) { + function useCallback5(callback, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useCallback(callback, deps); } - function useMemo(create, deps) { + function useMemo9(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useMemo(create, deps); } - function useImperativeHandle(ref, create, deps) { + function useImperativeHandle5(ref, create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useImperativeHandle(ref, create, deps); } @@ -1286,38 +1291,38 @@ return describeNativeComponentFrame(fn, false); } } - function shouldConstruct(Component2) { - var prototype = Component2.prototype; + function shouldConstruct(Component15) { + var prototype = Component15.prototype; return !!(prototype && prototype.isReactComponent); } - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - if (type == null) { + function describeUnknownElementTypeFrameInDEV(type2, source, ownerFn) { + if (type2 == null) { return ""; } - if (typeof type === "function") { + if (typeof type2 === "function") { { - return describeNativeComponentFrame(type, shouldConstruct(type)); + return describeNativeComponentFrame(type2, shouldConstruct(type2)); } } - if (typeof type === "string") { - return describeBuiltInComponentFrame(type); + if (typeof type2 === "string") { + return describeBuiltInComponentFrame(type2); } - switch (type) { + switch (type2) { case exports.Suspense: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); } - if (typeof type === "object") { - switch (type.$$typeof) { + if (typeof type2 === "object") { + switch (type2.$$typeof) { case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); + return describeFunctionComponentFrame(type2.render); case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + return describeUnknownElementTypeFrameInDEV(type2.type, source, ownerFn); case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); + return describeFunctionComponentFrame(type2._render); case REACT_LAZY_TYPE: { - var lazyComponent = type; + var lazyComponent = type2; var payload = lazyComponent._payload; var init = lazyComponent._init; try { @@ -1449,11 +1454,11 @@ if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; - if (isValidElement(child)) { + if (isValidElement6(child)) { validateExplicitKey(child, parentType); } } - } else if (isValidElement(node)) { + } else if (isValidElement6(node)) { if (node._store) { node._store.validated = true; } @@ -1464,7 +1469,7 @@ var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { - if (isValidElement(step.value)) { + if (isValidElement6(step.value)) { validateExplicitKey(step.value, parentType); } } @@ -1474,27 +1479,27 @@ } function validatePropTypes(element) { { - var type = element.type; - if (type === null || type === void 0 || typeof type === "string") { + var type2 = element.type; + if (type2 === null || type2 === void 0 || typeof type2 === "string") { return; } var propTypes; - if (typeof type === "function") { - propTypes = type.propTypes; - } else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MEMO_TYPE)) { - propTypes = type.propTypes; + if (typeof type2 === "function") { + propTypes = type2.propTypes; + } else if (typeof type2 === "object" && (type2.$$typeof === REACT_FORWARD_REF_TYPE || type2.$$typeof === REACT_MEMO_TYPE)) { + propTypes = type2.propTypes; } else { return; } if (propTypes) { - var name = getComponentName(type); + var name = getComponentName(type2); checkPropTypes(propTypes, element.props, "prop", name, element); - } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) { + } else if (type2.PropTypes !== void 0 && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; - var _name = getComponentName(type); + var _name = getComponentName(type2); error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown"); } - if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) { + if (typeof type2.getDefaultProps === "function" && !type2.getDefaultProps.isReactClassApproved) { error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } @@ -1503,10 +1508,10 @@ { var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key !== "children" && key !== "key") { + var key2 = keys[i]; + if (key2 !== "children" && key2 !== "key") { setCurrentlyValidatingElement$1(fragment); - error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key); + error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key2); setCurrentlyValidatingElement$1(null); break; } @@ -1518,11 +1523,11 @@ } } } - function createElementWithValidation(type, props, children) { - var validType = isValidElementType(type); + function createElementWithValidation(type2, props, children) { + var validType = isValidElementType(type2); if (!validType) { var info = ""; - if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) { + if (type2 === void 0 || typeof type2 === "object" && type2 !== null && Object.keys(type2).length === 0) { info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendumForProps(props); @@ -1532,30 +1537,30 @@ info += getDeclarationErrorAddendum(); } var typeString; - if (type === null) { + if (type2 === null) { typeString = "null"; - } else if (Array.isArray(type)) { + } else if (Array.isArray(type2)) { typeString = "array"; - } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) { - typeString = "<" + (getComponentName(type.type) || "Unknown") + " />"; + } else if (type2 !== void 0 && type2.$$typeof === REACT_ELEMENT_TYPE) { + typeString = "<" + (getComponentName(type2.type) || "Unknown") + " />"; info = " Did you accidentally export a JSX literal instead of a component?"; } else { - typeString = typeof type; + typeString = typeof type2; } { error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); } } - var element = createElement.apply(this, arguments); + var element = createElement79.apply(this, arguments); if (element == null) { return element; } if (validType) { for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], type); + validateChildKeys(arguments[i], type2); } } - if (type === exports.Fragment) { + if (type2 === exports.Fragment) { validateFragmentProps(element); } else { validatePropTypes(element); @@ -1563,9 +1568,9 @@ return element; } var didWarnAboutDeprecatedCreateFactory = false; - function createFactoryWithValidation(type) { - var validatedFactory = createElementWithValidation.bind(null, type); - validatedFactory.type = type; + function createFactoryWithValidation(type2) { + var validatedFactory = createElementWithValidation.bind(null, type2); + validatedFactory.type = type2; { if (!didWarnAboutDeprecatedCreateFactory) { didWarnAboutDeprecatedCreateFactory = true; @@ -1576,16 +1581,16 @@ get: function() { warn("Factory.type is deprecated. Access the class directly before passing it to createFactory."); Object.defineProperty(this, "type", { - value: type + value: type2 }); - return type; + return type2; } }); } return validatedFactory; } function cloneElementWithValidation(element, props, children) { - var newElement = cloneElement.apply(this, arguments); + var newElement = cloneElement7.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } @@ -1603,36 +1608,36 @@ var createElement$1 = createElementWithValidation; var cloneElement$1 = cloneElementWithValidation; var createFactory = createFactoryWithValidation; - var Children = { + var Children5 = { map: mapChildren, forEach: forEachChildren, count: countChildren, - toArray, + toArray: toArray5, only: onlyChild }; - exports.Children = Children; - exports.Component = Component; + exports.Children = Children5; + exports.Component = Component14; exports.PureComponent = PureComponent; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; exports.cloneElement = cloneElement$1; - exports.createContext = createContext; + exports.createContext = createContext10; exports.createElement = createElement$1; exports.createFactory = createFactory; - exports.createRef = createRef; - exports.forwardRef = forwardRef; - exports.isValidElement = isValidElement; + exports.createRef = createRef8; + exports.forwardRef = forwardRef23; + exports.isValidElement = isValidElement6; exports.lazy = lazy; exports.memo = memo; - exports.useCallback = useCallback; - exports.useContext = useContext; + exports.useCallback = useCallback5; + exports.useContext = useContext28; exports.useDebugValue = useDebugValue; - exports.useEffect = useEffect; - exports.useImperativeHandle = useImperativeHandle; - exports.useLayoutEffect = useLayoutEffect; - exports.useMemo = useMemo; + exports.useEffect = useEffect23; + exports.useImperativeHandle = useImperativeHandle5; + exports.useLayoutEffect = useLayoutEffect3; + exports.useMemo = useMemo9; exports.useReducer = useReducer; - exports.useRef = useRef; - exports.useState = useState; + exports.useRef = useRef31; + exports.useState = useState21; exports.version = ReactVersion; })(); } @@ -1716,12 +1721,12 @@ var _setTimeout = window.setTimeout; var _clearTimeout = window.clearTimeout; if (typeof console !== "undefined") { - var requestAnimationFrame = window.requestAnimationFrame; - var cancelAnimationFrame = window.cancelAnimationFrame; - if (typeof requestAnimationFrame !== "function") { + var requestAnimationFrame2 = window.requestAnimationFrame; + var cancelAnimationFrame2 = window.cancelAnimationFrame; + if (typeof requestAnimationFrame2 !== "function") { console["error"]("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"); } - if (typeof cancelAnimationFrame !== "function") { + if (typeof cancelAnimationFrame2 !== "function") { console["error"]("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"); } } @@ -1790,9 +1795,9 @@ }; } function push(heap, node) { - var index = heap.length; + var index2 = heap.length; heap.push(node); - siftUp(heap, node, index); + siftUp(heap, node, index2); } function peek(heap) { var first = heap[0]; @@ -1812,41 +1817,41 @@ } } function siftUp(heap, node, i) { - var index = i; + var index2 = i; while (true) { - var parentIndex = index - 1 >>> 1; + var parentIndex = index2 - 1 >>> 1; var parent = heap[parentIndex]; if (parent !== void 0 && compare(parent, node) > 0) { heap[parentIndex] = node; - heap[index] = parent; - index = parentIndex; + heap[index2] = parent; + index2 = parentIndex; } else { return; } } } function siftDown(heap, node, i) { - var index = i; + var index2 = i; var length = heap.length; - while (index < length) { - var leftIndex = (index + 1) * 2 - 1; + while (index2 < length) { + var leftIndex = (index2 + 1) * 2 - 1; var left = heap[leftIndex]; var rightIndex = leftIndex + 1; var right = heap[rightIndex]; if (left !== void 0 && compare(left, node) < 0) { if (right !== void 0 && compare(right, left) < 0) { - heap[index] = right; + heap[index2] = right; heap[rightIndex] = node; - index = rightIndex; + index2 = rightIndex; } else { - heap[index] = left; + heap[index2] = left; heap[leftIndex] = node; - index = leftIndex; + index2 = leftIndex; } } else if (right !== void 0 && compare(right, node) < 0) { - heap[index] = right; + heap[index2] = right; heap[rightIndex] = node; - index = rightIndex; + index2 = rightIndex; } else { return; } @@ -2263,7 +2268,7 @@ } } } - wrapped.cancel = function cancel() { + wrapped.cancel = function cancel2() { subscriber = exports.__subscriberRef.current; try { if (subscriber !== null) { @@ -2440,43 +2445,43 @@ if (true) { (function() { "use strict"; - var React3 = require_react(); + var React106 = require_react(); var _assign = require_object_assign(); var Scheduler = require_scheduler(); var tracing = require_tracing(); - var ReactSharedInternals = React3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - function warn(format) { + var ReactSharedInternals = React106.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function warn(format3) { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } - printWarning("warn", format, args); + printWarning("warn", format3, args); } } - function error(format) { + function error(format3) { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } - printWarning("error", format, args); + printWarning("error", format3, args); } } - function printWarning(level, format, args) { + function printWarning(level, format3, args) { { var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame2.getStackAddendum(); if (stack !== "") { - format += "%s"; + format3 += "%s"; args = args.concat([stack]); } var argsWithFormat = args.map(function(item) { return "" + item; }); - argsWithFormat.unshift("Warning: " + format); + argsWithFormat.unshift("Warning: " + format3); Function.prototype.apply.call(console[level], console, argsWithFormat); } } - if (!React3) { + if (!React106) { { throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM."); } @@ -2488,7 +2493,7 @@ var HostPortal = 4; var HostComponent = 5; var HostText = 6; - var Fragment = 7; + var Fragment7 = 7; var Mode = 8; var ContextConsumer = 9; var ContextProvider = 10; @@ -2629,13 +2634,13 @@ function getPropertyInfo(name) { return properties.hasOwnProperty(name) ? properties[name] : null; } - function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; + function PropertyInfoRecord(name, type2, mustUseProperty, attributeName, attributeNamespace, sanitizeURL2, removeEmptyString) { + this.acceptsBooleans = type2 === BOOLEANISH_STRING || type2 === BOOLEAN || type2 === OVERLOADED_BOOLEAN; this.attributeName = attributeName; this.attributeNamespace = attributeNamespace; this.mustUseProperty = mustUseProperty; this.propertyName = name; - this.type = type; + this.type = type2; this.sanitizeURL = sanitizeURL2; this.removeEmptyString = removeEmptyString; } @@ -2826,11 +2831,11 @@ }); var 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; var didWarn = false; - function sanitizeURL(url) { + function sanitizeURL(url2) { { - if (!didWarn && isJavaScriptProtocol.test(url)) { + if (!didWarn && isJavaScriptProtocol.test(url2)) { didWarn = true; - error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url)); + error("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(url2)); } } } @@ -2919,8 +2924,8 @@ if (mustUseProperty) { var propertyName = propertyInfo.propertyName; if (value === null) { - var type = propertyInfo.type; - node[propertyName] = type === BOOLEAN ? false : ""; + var type2 = propertyInfo.type; + node[propertyName] = type2 === BOOLEAN ? false : ""; } else { node[propertyName] = value; } @@ -3213,38 +3218,38 @@ return describeNativeComponentFrame(fn, false); } } - function shouldConstruct(Component) { - var prototype = Component.prototype; + function shouldConstruct(Component14) { + var prototype = Component14.prototype; return !!(prototype && prototype.isReactComponent); } - function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { - if (type == null) { + function describeUnknownElementTypeFrameInDEV(type2, source, ownerFn) { + if (type2 == null) { return ""; } - if (typeof type === "function") { + if (typeof type2 === "function") { { - return describeNativeComponentFrame(type, shouldConstruct(type)); + return describeNativeComponentFrame(type2, shouldConstruct(type2)); } } - if (typeof type === "string") { - return describeBuiltInComponentFrame(type); + if (typeof type2 === "string") { + return describeBuiltInComponentFrame(type2); } - switch (type) { + switch (type2) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); } - if (typeof type === "object") { - switch (type.$$typeof) { + if (typeof type2 === "object") { + switch (type2.$$typeof) { case REACT_FORWARD_REF_TYPE: - return describeFunctionComponentFrame(type.render); + return describeFunctionComponentFrame(type2.render); case REACT_MEMO_TYPE: - return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); + return describeUnknownElementTypeFrameInDEV(type2.type, source, ownerFn); case REACT_BLOCK_TYPE: - return describeFunctionComponentFrame(type._render); + return describeFunctionComponentFrame(type2._render); case REACT_LAZY_TYPE: { - var lazyComponent = type; + var lazyComponent = type2; var payload = lazyComponent._payload; var init = lazyComponent._init; try { @@ -3299,25 +3304,25 @@ var functionName = innerType.displayName || innerType.name || ""; return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName); } - function getContextName(type) { - return type.displayName || "Context"; + function getContextName(type2) { + return type2.displayName || "Context"; } - function getComponentName(type) { - if (type == null) { + function getComponentName(type2) { + if (type2 == null) { return null; } { - if (typeof type.tag === "number") { + if (typeof type2.tag === "number") { error("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."); } } - if (typeof type === "function") { - return type.displayName || type.name || null; + if (typeof type2 === "function") { + return type2.displayName || type2.name || null; } - if (typeof type === "string") { - return type; + if (typeof type2 === "string") { + return type2; } - switch (type) { + switch (type2) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PORTAL_TYPE: @@ -3331,22 +3336,22 @@ case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; } - if (typeof type === "object") { - switch (type.$$typeof) { + if (typeof type2 === "object") { + switch (type2.$$typeof) { case REACT_CONTEXT_TYPE: - var context = type; + var context = type2; return getContextName(context) + ".Consumer"; case REACT_PROVIDER_TYPE: - var provider = type; + var provider = type2; return getContextName(provider._context) + ".Provider"; case REACT_FORWARD_REF_TYPE: - return getWrappedName(type, type.render, "ForwardRef"); + return getWrappedName(type2, type2.render, "ForwardRef"); case REACT_MEMO_TYPE: - return getComponentName(type.type); + return getComponentName(type2.type); case REACT_BLOCK_TYPE: - return getComponentName(type._render); + return getComponentName(type2._render); case REACT_LAZY_TYPE: { - var lazyComponent = type; + var lazyComponent = type2; var payload = lazyComponent._payload; var init = lazyComponent._init; try { @@ -3441,9 +3446,9 @@ } } function isCheckable(elem) { - var type = elem.type; + var type2 = elem.type; var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === "input" && (type === "checkbox" || type === "radio"); + return nodeName && nodeName.toLowerCase() === "input" && (type2 === "checkbox" || type2 === "radio"); } function getTracker(node) { return node._valueTracker; @@ -3470,15 +3475,15 @@ if (node.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") { return; } - var get2 = descriptor.get, set2 = descriptor.set; + var get3 = descriptor.get, set3 = descriptor.set; Object.defineProperty(node, valueField, { configurable: true, get: function() { - return get2.call(this); + return get3.call(this); }, set: function(value) { currentValue = "" + value; - set2.call(this, value); + set3.call(this, value); } }); Object.defineProperty(node, valueField, { @@ -3592,16 +3597,16 @@ } updateChecked(element, props); var value = getToStringValue(props.value); - var type = props.type; + var type2 = props.type; if (value != null) { - if (type === "number") { + if (type2 === "number") { if (value === 0 && node.value === "" || node.value != value) { node.value = toString(value); } } else if (node.value !== toString(value)) { node.value = toString(value); } - } else if (type === "submit" || type === "reset") { + } else if (type2 === "submit" || type2 === "reset") { node.removeAttribute("value"); return; } @@ -3621,8 +3626,8 @@ function postMountWrapper(element, props, isHydrating2) { var node = element; if (props.hasOwnProperty("value") || props.hasOwnProperty("defaultValue")) { - var type = props.type; - var isButton = type === "submit" || type === "reset"; + var type2 = props.type; + var isButton = type2 === "submit" || type2 === "reset"; if (isButton && (props.value === void 0 || props.value === null)) { return; } @@ -3679,8 +3684,8 @@ } } } - function setDefaultValue(node, type, value) { - if (type !== "number" || getActiveElement(node.ownerDocument) !== node) { + function setDefaultValue(node, type2, value) { + if (type2 !== "number" || getActiveElement(node.ownerDocument) !== node) { if (value == null) { node.defaultValue = toString(node._wrapperState.initialValue); } else if (node.defaultValue !== toString(value)) { @@ -3692,7 +3697,7 @@ var didWarnInvalidChild = false; function flattenChildren(children) { var content = ""; - React3.Children.forEach(children, function(child) { + React106.Children.forEach(children, function(child) { if (child == null) { return; } @@ -3703,7 +3708,7 @@ function validateProps(element, props) { { if (typeof props.children === "object" && props.children !== null) { - React3.Children.forEach(props.children, function(child) { + React106.Children.forEach(props.children, function(child) { if (child == null) { return; } @@ -3952,8 +3957,8 @@ mathml: MATH_NAMESPACE, svg: SVG_NAMESPACE }; - function getIntrinsicNamespace(type) { - switch (type) { + function getIntrinsicNamespace(type2) { + switch (type2) { case "svg": return SVG_NAMESPACE; case "math": @@ -3962,11 +3967,11 @@ return HTML_NAMESPACE; } } - function getChildNamespace(parentNamespace, type) { + function getChildNamespace(parentNamespace, type2) { if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) { - return getIntrinsicNamespace(type); + return getIntrinsicNamespace(type2); } - if (parentNamespace === SVG_NAMESPACE && type === "foreignObject") { + if (parentNamespace === SVG_NAMESPACE && type2 === "foreignObject") { return HTML_NAMESPACE; } return parentNamespace; @@ -4108,8 +4113,8 @@ strokeOpacity: true, strokeWidth: true }; - function prefixKey(prefix2, key) { - return prefix2 + key.charAt(0).toUpperCase() + key.substring(1); + function prefixKey(prefix2, key2) { + return prefix2 + key2.charAt(0).toUpperCase() + key2.substring(1); } var prefixes = ["Webkit", "ms", "Moz", "O"]; Object.keys(isUnitlessNumber).forEach(function(prop) { @@ -4143,8 +4148,8 @@ var warnedStyleValues = {}; var warnedForNaNValue = false; var warnedForInfinityValue = false; - var camelize = function(string) { - return string.replace(hyphenPattern, function(_, character) { + var camelize = function(string2) { + return string2.replace(hyphenPattern, function(_, character) { return character.toUpperCase(); }); }; @@ -4221,7 +4226,7 @@ } } function setValueForStyles(node, styles) { - var style2 = node.style; + var style3 = node.style; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; @@ -4237,9 +4242,9 @@ styleName = "cssFloat"; } if (isCustomProperty) { - style2.setProperty(styleName, styleValue); + style3.setProperty(styleName, styleValue); } else { - style2[styleName] = styleValue; + style3[styleName] = styleValue; } } } @@ -4248,10 +4253,10 @@ } function expandShorthandMap(styles) { var expanded = {}; - for (var key in styles) { - var longhands = shorthandToLonghand[key] || [key]; + for (var key2 in styles) { + var longhands = shorthandToLonghand[key2] || [key2]; for (var i = 0; i < longhands.length; i++) { - expanded[longhands[i]] = key; + expanded[longhands[i]] = key2; } } return expanded; @@ -4264,9 +4269,9 @@ var expandedUpdates = expandShorthandMap(styleUpdates); var expandedStyles = expandShorthandMap(nextStyles); var warnedAbout = {}; - for (var key in expandedUpdates) { - var originalKey = expandedUpdates[key]; - var correctOriginalKey = expandedStyles[key]; + for (var key2 in expandedUpdates) { + var originalKey = expandedUpdates[key2]; + var correctOriginalKey = expandedStyles[key2]; if (correctOriginalKey && originalKey !== correctOriginalKey) { var warningKey = originalKey + "," + correctOriginalKey; if (warnedAbout[warningKey]) { @@ -4925,43 +4930,43 @@ } return true; } - function warnInvalidARIAProps(type, props) { + function warnInvalidARIAProps(type2, props) { { var invalidProps = []; - for (var key in props) { - var isValid = validateProperty(type, key); + for (var key2 in props) { + var isValid = validateProperty(type2, key2); if (!isValid) { - invalidProps.push(key); + invalidProps.push(key2); } } var unknownPropString = invalidProps.map(function(prop) { return "`" + prop + "`"; }).join(", "); if (invalidProps.length === 1) { - error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type); + error("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type2); } else if (invalidProps.length > 1) { - error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type); + error("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", unknownPropString, type2); } } } - function validateProperties(type, props) { - if (isCustomComponent(type, props)) { + function validateProperties(type2, props) { + if (isCustomComponent(type2, props)) { return; } - warnInvalidARIAProps(type, props); + warnInvalidARIAProps(type2, props); } var didWarnValueNull = false; - function validateProperties$1(type, props) { + function validateProperties$1(type2, props) { { - if (type !== "input" && type !== "textarea" && type !== "select") { + if (type2 !== "input" && type2 !== "textarea" && type2 !== "select") { return; } if (props != null && props.value === null && !didWarnValueNull) { didWarnValueNull = true; - if (type === "select" && props.multiple) { - 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); + if (type2 === "select" && props.multiple) { + 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.", type2); } else { - error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type); + error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", type2); } } } @@ -5069,30 +5074,30 @@ return true; }; } - var warnUnknownProperties = function(type, props, eventRegistry) { + var warnUnknownProperties = function(type2, props, eventRegistry) { { var unknownProps = []; - for (var key in props) { - var isValid = validateProperty$1(type, key, props[key], eventRegistry); + for (var key2 in props) { + var isValid = validateProperty$1(type2, key2, props[key2], eventRegistry); if (!isValid) { - unknownProps.push(key); + unknownProps.push(key2); } } var unknownPropString = unknownProps.map(function(prop) { return "`" + prop + "`"; }).join(", "); if (unknownProps.length === 1) { - 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://reactjs.org/link/attribute-behavior ", unknownPropString, type); + 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://reactjs.org/link/attribute-behavior ", unknownPropString, type2); } else if (unknownProps.length > 1) { - 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://reactjs.org/link/attribute-behavior ", unknownPropString, type); + 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://reactjs.org/link/attribute-behavior ", unknownPropString, type2); } } }; - function validateProperties$2(type, props, eventRegistry) { - if (isCustomComponent(type, props)) { + function validateProperties$2(type2, props, eventRegistry) { + if (isCustomComponent(type2, props)) { return; } - warnUnknownProperties(type, props, eventRegistry); + warnUnknownProperties(type2, props, eventRegistry); } var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1; var IS_NON_DELEGATED = 1 << 1; @@ -5227,7 +5232,7 @@ function isInteractive(tag) { return tag === "button" || tag === "input" || tag === "select" || tag === "textarea"; } - function shouldPreventMouseEvent(name, type, props) { + function shouldPreventMouseEvent(name, type2, props) { switch (name) { case "onClick": case "onClickCapture": @@ -5240,7 +5245,7 @@ case "onMouseUp": case "onMouseUpCapture": case "onMouseEnter": - return !!(props.disabled && isInteractive(type)); + return !!(props.disabled && isInteractive(type2)); default: return false; } @@ -5409,14 +5414,14 @@ } } } - function get(key) { - return key._reactInternals; + function get2(key2) { + return key2._reactInternals; } - function has(key) { - return key._reactInternals !== void 0; + function has(key2) { + return key2._reactInternals !== void 0; } - function set(key, value) { - key._reactInternals = value; + function set2(key2, value) { + key2._reactInternals = value; } var NoFlags = 0; var PerformedWork = 1; @@ -5494,7 +5499,7 @@ instance._warnedAboutRefsInRender = true; } } - var fiber = get(component); + var fiber = get2(component); if (!fiber) { return false; } @@ -5883,9 +5888,9 @@ } return true; } - function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) { + function attemptReplayContinuousQueuedEventInMap(queuedEvent, key2, map) { if (attemptReplayContinuousQueuedEvent(queuedEvent)) { - map.delete(key); + map.delete(key2); } } function replayUnblockedEvents() { @@ -5979,50 +5984,50 @@ var DiscreteEvent = 0; var UserBlockingEvent = 1; var ContinuousEvent = 2; - function makePrefixMap(styleProp, eventName) { + function makePrefixMap2(styleProp, eventName) { var prefixes2 = {}; prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase(); prefixes2["Webkit" + styleProp] = "webkit" + eventName; prefixes2["Moz" + styleProp] = "moz" + eventName; return prefixes2; } - var vendorPrefixes = { - animationend: makePrefixMap("Animation", "AnimationEnd"), - animationiteration: makePrefixMap("Animation", "AnimationIteration"), - animationstart: makePrefixMap("Animation", "AnimationStart"), - transitionend: makePrefixMap("Transition", "TransitionEnd") + var vendorPrefixes2 = { + animationend: makePrefixMap2("Animation", "AnimationEnd"), + animationiteration: makePrefixMap2("Animation", "AnimationIteration"), + animationstart: makePrefixMap2("Animation", "AnimationStart"), + transitionend: makePrefixMap2("Transition", "TransitionEnd") }; - var prefixedEventNames = {}; - var style = {}; + var prefixedEventNames2 = {}; + var style2 = {}; if (canUseDOM) { - style = document.createElement("div").style; + style2 = document.createElement("div").style; if (!("AnimationEvent" in window)) { - delete vendorPrefixes.animationend.animation; - delete vendorPrefixes.animationiteration.animation; - delete vendorPrefixes.animationstart.animation; + delete vendorPrefixes2.animationend.animation; + delete vendorPrefixes2.animationiteration.animation; + delete vendorPrefixes2.animationstart.animation; } if (!("TransitionEvent" in window)) { - delete vendorPrefixes.transitionend.transition; + delete vendorPrefixes2.transitionend.transition; } } - function getVendorPrefixedEventName(eventName) { - if (prefixedEventNames[eventName]) { - return prefixedEventNames[eventName]; - } else if (!vendorPrefixes[eventName]) { + function getVendorPrefixedEventName2(eventName) { + if (prefixedEventNames2[eventName]) { + return prefixedEventNames2[eventName]; + } else if (!vendorPrefixes2[eventName]) { return eventName; } - var prefixMap = vendorPrefixes[eventName]; + var prefixMap = vendorPrefixes2[eventName]; for (var styleProp in prefixMap) { - if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { - return prefixedEventNames[eventName] = prefixMap[styleProp]; + if (prefixMap.hasOwnProperty(styleProp) && styleProp in style2) { + return prefixedEventNames2[eventName] = prefixMap[styleProp]; } } return eventName; } - var ANIMATION_END = getVendorPrefixedEventName("animationend"); - var ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"); - var ANIMATION_START = getVendorPrefixedEventName("animationstart"); - var TRANSITION_END = getVendorPrefixedEventName("transitionend"); + var ANIMATION_END = getVendorPrefixedEventName2("animationend"); + var ANIMATION_ITERATION = getVendorPrefixedEventName2("animationiteration"); + var ANIMATION_START = getVendorPrefixedEventName2("animationstart"); + var TRANSITION_END = getVendorPrefixedEventName2("transitionend"); var topLevelEventsToReactNames = new Map(); var eventPriorities = new Map(); var discreteEventPairsForSimpleEventPlugin = [ @@ -6356,9 +6361,9 @@ var entanglements = root2.entanglements; var lanes = nextLanes & entangledLanes; while (lanes > 0) { - var index2 = pickArbitraryLaneIndex(lanes); - var lane = 1 << index2; - nextLanes |= entanglements[index2]; + var index3 = pickArbitraryLaneIndex(lanes); + var lane = 1 << index3; + nextLanes |= entanglements[index3]; lanes &= ~lane; } } @@ -6368,9 +6373,9 @@ var eventTimes = root2.eventTimes; var mostRecentEventTime = NoTimestamp; while (lanes > 0) { - var index2 = pickArbitraryLaneIndex(lanes); - var lane = 1 << index2; - var eventTime = eventTimes[index2]; + var index3 = pickArbitraryLaneIndex(lanes); + var lane = 1 << index3; + var eventTime = eventTimes[index3]; if (eventTime > mostRecentEventTime) { mostRecentEventTime = eventTime; } @@ -6396,12 +6401,12 @@ var expirationTimes = root2.expirationTimes; var lanes = pendingLanes; while (lanes > 0) { - var index2 = pickArbitraryLaneIndex(lanes); - var lane = 1 << index2; - var expirationTime = expirationTimes[index2]; + var index3 = pickArbitraryLaneIndex(lanes); + var lane = 1 << index3; + var expirationTime = expirationTimes[index3]; if (expirationTime === NoTimestamp) { if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) { - expirationTimes[index2] = computeExpirationTime(lane, currentTime); + expirationTimes[index3] = computeExpirationTime(lane, currentTime); } } else if (expirationTime <= currentTime) { root2.expiredLanes |= lane; @@ -6500,8 +6505,8 @@ return lanes & -lanes; } function getLowestPriorityLane(lanes) { - var index2 = 31 - clz32(lanes); - return index2 < 0 ? NoLanes : 1 << index2; + var index3 = 31 - clz32(lanes); + return index3 < 0 ? NoLanes : 1 << index3; } function getEqualOrHigherPriorityLanes(lanes) { return (getLowestPriorityLane(lanes) << 1) - 1; @@ -6518,14 +6523,14 @@ function includesSomeLane(a, b) { return (a & b) !== NoLanes; } - function isSubsetOfLanes(set2, subset) { - return (set2 & subset) === subset; + function isSubsetOfLanes(set3, subset) { + return (set3 & subset) === subset; } function mergeLanes(a, b) { return a | b; } - function removeLanes(set2, subset) { - return set2 & ~subset; + function removeLanes(set3, subset) { + return set3 & ~subset; } function laneToLanes(lane) { return lane; @@ -6546,8 +6551,8 @@ root2.suspendedLanes &= higherPriorityLanes; root2.pingedLanes &= higherPriorityLanes; var eventTimes = root2.eventTimes; - var index2 = laneToIndex(updateLane); - eventTimes[index2] = eventTime; + var index3 = laneToIndex(updateLane); + eventTimes[index3] = eventTime; } function markRootSuspended(root2, suspendedLanes) { root2.suspendedLanes |= suspendedLanes; @@ -6555,9 +6560,9 @@ var expirationTimes = root2.expirationTimes; var lanes = suspendedLanes; while (lanes > 0) { - var index2 = pickArbitraryLaneIndex(lanes); - var lane = 1 << index2; - expirationTimes[index2] = NoTimestamp; + var index3 = pickArbitraryLaneIndex(lanes); + var lane = 1 << index3; + expirationTimes[index3] = NoTimestamp; lanes &= ~lane; } } @@ -6586,11 +6591,11 @@ var expirationTimes = root2.expirationTimes; var lanes = noLongerPendingLanes; while (lanes > 0) { - var index2 = pickArbitraryLaneIndex(lanes); - var lane = 1 << index2; - entanglements[index2] = NoLanes; - eventTimes[index2] = NoTimestamp; - expirationTimes[index2] = NoTimestamp; + var index3 = pickArbitraryLaneIndex(lanes); + var lane = 1 << index3; + entanglements[index3] = NoLanes; + eventTimes[index3] = NoTimestamp; + expirationTimes[index3] = NoTimestamp; lanes &= ~lane; } } @@ -6599,9 +6604,9 @@ var entanglements = root2.entanglements; var lanes = entangledLanes; while (lanes > 0) { - var index2 = pickArbitraryLaneIndex(lanes); - var lane = 1 << index2; - entanglements[index2] |= entangledLanes; + var index3 = pickArbitraryLaneIndex(lanes); + var lane = 1 << index3; + entanglements[index3] |= entangledLanes; lanes &= ~lane; } } @@ -6812,9 +6817,9 @@ if (!Interface.hasOwnProperty(_propName)) { continue; } - var normalize = Interface[_propName]; - if (normalize) { - this[_propName] = normalize(nativeEvent); + var normalize2 = Interface[_propName]; + if (normalize2) { + this[_propName] = normalize2(nativeEvent); } else { this[_propName] = nativeEvent[_propName]; } @@ -7004,9 +7009,9 @@ }; function getEventKey(nativeEvent) { if (nativeEvent.key) { - var key = normalizeKey[nativeEvent.key] || nativeEvent.key; - if (key !== "Unidentified") { - return key; + var key2 = normalizeKey[nativeEvent.key] || nativeEvent.key; + if (key2 !== "Unidentified") { + return key2; } } if (nativeEvent.type === "keypress") { @@ -7533,7 +7538,7 @@ } var objectIs = typeof Object.is === "function" ? Object.is : is; var hasOwnProperty$2 = Object.prototype.hasOwnProperty; - function shallowEqual(objA, objB) { + function shallowEqual2(objA, objB) { if (objectIs(objA, objB)) { return true; } @@ -7566,17 +7571,17 @@ node = node.parentNode; } } - function getNodeForCharacterOffset(root2, offset) { + function getNodeForCharacterOffset(root2, offset2) { var node = getLeafNode(root2); var nodeStart = 0; var nodeEnd = 0; while (node) { if (node.nodeType === TEXT_NODE) { nodeEnd = nodeStart + node.textContent.length; - if (nodeStart <= offset && nodeEnd >= offset) { + if (nodeStart <= offset2 && nodeEnd >= offset2) { return { node, - offset: offset - nodeStart + offset: offset2 - nodeStart }; } nodeStart = nodeEnd; @@ -7674,15 +7679,15 @@ if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) { return; } - var range = doc.createRange(); - range.setStart(startMarker.node, startMarker.offset); + var range2 = doc.createRange(); + range2.setStart(startMarker.node, startMarker.offset); selection.removeAllRanges(); if (start > end) { - selection.addRange(range); + selection.addRange(range2); selection.extend(endMarker.node, endMarker.offset); } else { - range.setEnd(endMarker.node, endMarker.offset); - selection.addRange(range); + range2.setEnd(endMarker.node, endMarker.offset); + selection.addRange(range2); } } } @@ -7831,7 +7836,7 @@ return; } var currentSelection = getSelection$1(activeElement$1); - if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { + if (!lastSelection || !shallowEqual2(lastSelection, currentSelection)) { lastSelection = currentSelection; var listeners = accumulateTwoPhaseListeners(activeElementInst$1, "onSelect"); if (listeners.length > 0) { @@ -7996,9 +8001,9 @@ var mediaEventTypes = ["abort", "canplay", "canplaythrough", "durationchange", "emptied", "encrypted", "ended", "error", "loadeddata", "loadedmetadata", "loadstart", "pause", "play", "playing", "progress", "ratechange", "seeked", "seeking", "stalled", "suspend", "timeupdate", "volumechange", "waiting"]; var nonDelegatedEvents = new Set(["cancel", "close", "invalid", "load", "scroll", "toggle"].concat(mediaEventTypes)); function executeDispatch(event, listener, currentTarget) { - var type = event.type || "unknown-event"; + var type2 = event.type || "unknown-event"; event.currentTarget = currentTarget; - invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event); + invokeGuardedCallbackAndCatchFirstError(type2, listener, void 0, event); event.currentTarget = null; } function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) { @@ -8214,7 +8219,7 @@ } return listeners; } - function getParent(inst) { + function getParent3(inst) { if (inst === null) { return null; } @@ -8230,19 +8235,19 @@ var nodeA = instA; var nodeB = instB; var depthA = 0; - for (var tempA = nodeA; tempA; tempA = getParent(tempA)) { + for (var tempA = nodeA; tempA; tempA = getParent3(tempA)) { depthA++; } var depthB = 0; - for (var tempB = nodeB; tempB; tempB = getParent(tempB)) { + for (var tempB = nodeB; tempB; tempB = getParent3(tempB)) { depthB++; } while (depthA - depthB > 0) { - nodeA = getParent(nodeA); + nodeA = getParent3(nodeA); depthA--; } while (depthB - depthA > 0) { - nodeB = getParent(nodeB); + nodeB = getParent3(nodeB); depthB--; } var depth = depthA; @@ -8250,8 +8255,8 @@ if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) { return nodeA; } - nodeA = getParent(nodeA); - nodeB = getParent(nodeB); + nodeA = getParent3(nodeA); + nodeB = getParent3(nodeB); } return null; } @@ -8326,10 +8331,10 @@ dialog: true, webview: true }; - validatePropertiesInDevelopment = function(type, props) { - validateProperties(type, props); - validateProperties$1(type, props); - validateProperties$2(type, props, { + validatePropertiesInDevelopment = function(type2, props) { + validateProperties(type2, props); + validateProperties$1(type2, props); + validateProperties$2(type2, props, { registrationNameDependencies, possibleRegistrationNames }); @@ -8370,11 +8375,11 @@ return; } didWarnInvalidHydration = true; - var names = []; + var names2 = []; attributeNames.forEach(function(name) { - names.push(name); + names2.push(name); }); - error("Extra attributes from the server: %s", names); + error("Extra attributes from the server: %s", names2); }; warnForInvalidEventListener = function(registrationName, listener) { if (listener === false) { @@ -8392,10 +8397,10 @@ function getOwnerDocumentFromRootContainer(rootContainerElement) { return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; } - function noop() { + function noop2() { } function trapClickOnNonInteractiveElement(node) { - node.onclick = noop; + node.onclick = noop2; } function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) { for (var propKey in nextProps) { @@ -8457,33 +8462,33 @@ } } } - function createElement(type, props, rootContainerElement, parentNamespace) { + function createElement79(type2, props, rootContainerElement, parentNamespace) { var isCustomComponentTag; var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement); var domElement; var namespaceURI = parentNamespace; if (namespaceURI === HTML_NAMESPACE$1) { - namespaceURI = getIntrinsicNamespace(type); + namespaceURI = getIntrinsicNamespace(type2); } if (namespaceURI === HTML_NAMESPACE$1) { { - isCustomComponentTag = isCustomComponent(type, props); - if (!isCustomComponentTag && type !== type.toLowerCase()) { - error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type); + isCustomComponentTag = isCustomComponent(type2, props); + if (!isCustomComponentTag && type2 !== type2.toLowerCase()) { + error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", type2); } } - if (type === "script") { + if (type2 === "script") { var div = ownerDocument.createElement("div"); div.innerHTML = ""; var firstChild = div.firstChild; domElement = div.removeChild(firstChild); } else if (typeof props.is === "string") { - domElement = ownerDocument.createElement(type, { + domElement = ownerDocument.createElement(type2, { is: props.is }); } else { - domElement = ownerDocument.createElement(type); - if (type === "select") { + domElement = ownerDocument.createElement(type2); + if (type2 === "select") { var node = domElement; if (props.multiple) { node.multiple = true; @@ -8493,13 +8498,13 @@ } } } else { - domElement = ownerDocument.createElementNS(namespaceURI, type); + domElement = ownerDocument.createElementNS(namespaceURI, type2); } { if (namespaceURI === HTML_NAMESPACE$1) { - if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) { - warnedUnknownTags[type] = true; - 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); + if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type2)) { + warnedUnknownTags[type2] = true; + error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.", type2); } } } @@ -9256,8 +9261,8 @@ var STYLE$1 = "style"; var eventsEnabled = null; var selectionInformation = null; - function shouldAutoFocusHostComponent(type, props) { - switch (type) { + function shouldAutoFocusHostComponent(type2, props) { + switch (type2) { case "button": case "input": case "select": @@ -9267,13 +9272,13 @@ return false; } function getRootHostContext(rootContainerInstance) { - var type; + var type2; var namespace; var nodeType = rootContainerInstance.nodeType; switch (nodeType) { case DOCUMENT_NODE: case DOCUMENT_FRAGMENT_NODE: { - type = nodeType === DOCUMENT_NODE ? "#document" : "#fragment"; + type2 = nodeType === DOCUMENT_NODE ? "#document" : "#fragment"; var root2 = rootContainerInstance.documentElement; namespace = root2 ? root2.namespaceURI : getChildNamespace(null, ""); break; @@ -9281,13 +9286,13 @@ default: { var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance; var ownNamespace = container.namespaceURI || null; - type = container.tagName; - namespace = getChildNamespace(ownNamespace, type); + type2 = container.tagName; + namespace = getChildNamespace(ownNamespace, type2); break; } } { - var validatedTag = type.toLowerCase(); + var validatedTag = type2.toLowerCase(); var ancestorInfo = updatedAncestorInfo(null, validatedTag); return { namespace, @@ -9295,11 +9300,11 @@ }; } } - function getChildHostContext(parentHostContext, type, rootContainerInstance) { + function getChildHostContext(parentHostContext, type2, rootContainerInstance) { { var parentHostContextDev = parentHostContext; - var namespace = getChildNamespace(parentHostContextDev.namespace, type); - var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type); + var namespace = getChildNamespace(parentHostContextDev.namespace, type2); + var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type2); return { namespace, ancestorInfo @@ -9322,19 +9327,19 @@ eventsEnabled = null; selectionInformation = null; } - function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { + function createInstance(type2, props, rootContainerInstance, hostContext, internalInstanceHandle) { var parentNamespace; { var hostContextDev = hostContext; - validateDOMNesting(type, null, hostContextDev.ancestorInfo); + validateDOMNesting(type2, null, hostContextDev.ancestorInfo); if (typeof props.children === "string" || typeof props.children === "number") { - var string = "" + props.children; - var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); - validateDOMNesting(null, string, ownAncestorInfo); + var string2 = "" + props.children; + var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type2); + validateDOMNesting(null, string2, ownAncestorInfo); } parentNamespace = hostContextDev.namespace; } - var domElement = createElement(type, props, rootContainerInstance, parentNamespace); + var domElement = createElement79(type2, props, rootContainerInstance, parentNamespace); precacheFiberNode(internalInstanceHandle, domElement); updateFiberProps(domElement, props); return domElement; @@ -9342,23 +9347,23 @@ function appendInitialChild(parentInstance, child) { parentInstance.appendChild(child); } - function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) { - setInitialProperties(domElement, type, props, rootContainerInstance); - return shouldAutoFocusHostComponent(type, props); + function finalizeInitialChildren(domElement, type2, props, rootContainerInstance, hostContext) { + setInitialProperties(domElement, type2, props, rootContainerInstance); + return shouldAutoFocusHostComponent(type2, props); } - function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) { + function prepareUpdate(domElement, type2, oldProps, newProps, rootContainerInstance, hostContext) { { var hostContextDev = hostContext; if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === "string" || typeof newProps.children === "number")) { - var string = "" + newProps.children; - var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); - validateDOMNesting(null, string, ownAncestorInfo); + var string2 = "" + newProps.children; + var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type2); + validateDOMNesting(null, string2, ownAncestorInfo); } } - return diffProperties(domElement, type, oldProps, newProps); + return diffProperties(domElement, type2, oldProps, newProps); } - function shouldSetTextContent(type, props) { - return type === "textarea" || type === "option" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null; + function shouldSetTextContent(type2, props) { + return type2 === "textarea" || type2 === "option" || type2 === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null; } function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { { @@ -9372,14 +9377,14 @@ var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0; var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0; var noTimeout = -1; - function commitMount(domElement, type, newProps, internalInstanceHandle) { - if (shouldAutoFocusHostComponent(type, newProps)) { + function commitMount(domElement, type2, newProps, internalInstanceHandle) { + if (shouldAutoFocusHostComponent(type2, newProps)) { domElement.focus(); } } - function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) { + function commitUpdate(domElement, updatePayload, type2, oldProps, newProps, internalInstanceHandle) { updateFiberProps(domElement, newProps); - updateProperties(domElement, updatePayload, type, oldProps, newProps); + updateProperties(domElement, updatePayload, type2, oldProps, newProps); } function resetTextContent(domElement) { setTextContent(domElement, ""); @@ -9426,11 +9431,11 @@ } function hideInstance(instance) { instance = instance; - var style2 = instance.style; - if (typeof style2.setProperty === "function") { - style2.setProperty("display", "none", "important"); + var style3 = instance.style; + if (typeof style3.setProperty === "function") { + style3.setProperty("display", "none", "important"); } else { - style2.display = "none"; + style3.display = "none"; } } function hideTextInstance(textInstance) { @@ -9455,8 +9460,8 @@ } } } - function canHydrateInstance(instance, type, props) { - if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) { + function canHydrateInstance(instance, type2, props) { + if (instance.nodeType !== ELEMENT_NODE || type2.toLowerCase() !== instance.nodeName.toLowerCase()) { return null; } return instance; @@ -9488,7 +9493,7 @@ function getFirstHydratableChild(parentInstance) { return getNextHydratable(parentInstance.firstChild); } - function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) { + function hydrateInstance(instance, type2, props, rootContainerInstance, hostContext, internalInstanceHandle) { precacheFiberNode(internalInstanceHandle, instance); updateFiberProps(instance, props); var parentNamespace; @@ -9496,7 +9501,7 @@ var hostContextDev = hostContext; parentNamespace = hostContextDev.namespace; } - return diffHydratedProperties(instance, type, props, parentNamespace); + return diffHydratedProperties(instance, type2, props, parentNamespace); } function hydrateTextInstance(textInstance, text, internalInstanceHandle) { precacheFiberNode(internalInstanceHandle, textInstance); @@ -9580,9 +9585,9 @@ } } } - function didNotFindHydratableContainerInstance(parentContainer, type, props) { + function didNotFindHydratableContainerInstance(parentContainer, type2, props) { { - warnForInsertedHydratedElement(parentContainer, type); + warnForInsertedHydratedElement(parentContainer, type2); } } function didNotFindHydratableContainerTextInstance(parentContainer, text) { @@ -9590,9 +9595,9 @@ warnForInsertedHydratedText(parentContainer, text); } } - function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) { + function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type2, props) { if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { - warnForInsertedHydratedElement(parentInstance, type); + warnForInsertedHydratedElement(parentInstance, type2); } } function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) { @@ -9606,15 +9611,15 @@ } var clientId = 0; function makeClientIdInDEV(warnOnAccessInDEV) { - var id = "r:" + (clientId++).toString(36); + var id2 = "r:" + (clientId++).toString(36); return { toString: function() { warnOnAccessInDEV(); - return id; + return id2; }, valueOf: function() { warnOnAccessInDEV(); - return id; + return id2; } }; } @@ -9760,36 +9765,36 @@ { fiberStack = []; } - var index = -1; + var index2 = -1; function createCursor(defaultValue) { return { current: defaultValue }; } function pop(cursor, fiber) { - if (index < 0) { + if (index2 < 0) { { error("Unexpected pop."); } return; } { - if (fiber !== fiberStack[index]) { + if (fiber !== fiberStack[index2]) { error("Unexpected Fiber popped."); } } - cursor.current = valueStack[index]; - valueStack[index] = null; + cursor.current = valueStack[index2]; + valueStack[index2] = null; { - fiberStack[index] = null; + fiberStack[index2] = null; } - index--; + index2--; } function push(cursor, value, fiber) { - index++; - valueStack[index] = cursor.current; + index2++; + valueStack[index2] = cursor.current; { - fiberStack[index] = fiber; + fiberStack[index2] = fiber; } cursor.current = value; } @@ -9804,9 +9809,9 @@ var contextStackCursor = createCursor(emptyContextObject); var didPerformWorkStackCursor = createCursor(false); var previousContext = emptyContextObject; - function getUnmaskedContext(workInProgress2, Component, didPushOwnContextIfProvider) { + function getUnmaskedContext(workInProgress2, Component14, didPushOwnContextIfProvider) { { - if (didPushOwnContextIfProvider && isContextProvider(Component)) { + if (didPushOwnContextIfProvider && isContextProvider(Component14)) { return previousContext; } return contextStackCursor.current; @@ -9821,8 +9826,8 @@ } function getMaskedContext(workInProgress2, unmaskedContext) { { - var type = workInProgress2.type; - var contextTypes = type.contextTypes; + var type2 = workInProgress2.type; + var contextTypes = type2.contextTypes; if (!contextTypes) { return emptyContextObject; } @@ -9831,11 +9836,11 @@ return instance.__reactInternalMemoizedMaskedChildContext; } var context = {}; - for (var key in contextTypes) { - context[key] = unmaskedContext[key]; + for (var key2 in contextTypes) { + context[key2] = unmaskedContext[key2]; } { - var name = getComponentName(type) || "Unknown"; + var name = getComponentName(type2) || "Unknown"; checkPropTypes(contextTypes, context, "context", name); } if (instance) { @@ -9849,9 +9854,9 @@ return didPerformWorkStackCursor.current; } } - function isContextProvider(type) { + function isContextProvider(type2) { { - var childContextTypes = type.childContextTypes; + var childContextTypes = type2.childContextTypes; return childContextTypes !== null && childContextTypes !== void 0; } } @@ -9878,13 +9883,13 @@ push(didPerformWorkStackCursor, didChange, fiber); } } - function processChildContext(fiber, type, parentContext) { + function processChildContext(fiber, type2, parentContext) { { var instance = fiber.stateNode; - var childContextTypes = type.childContextTypes; + var childContextTypes = type2.childContextTypes; if (typeof instance.getChildContext !== "function") { { - var componentName = getComponentName(type) || "Unknown"; + var componentName = getComponentName(type2) || "Unknown"; if (!warnedAboutMissingGetChildContext[componentName]) { warnedAboutMissingGetChildContext[componentName] = true; error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName); @@ -9896,12 +9901,12 @@ for (var contextKey in childContext) { if (!(contextKey in childContextTypes)) { { - throw Error((getComponentName(type) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); + throw Error((getComponentName(type2) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); } } } { - var name = getComponentName(type) || "Unknown"; + var name = getComponentName(type2) || "Unknown"; checkPropTypes(childContextTypes, childContext, "child context", name); } return _assign({}, parentContext, childContext); @@ -9917,7 +9922,7 @@ return true; } } - function invalidateContextProvider(workInProgress2, type, didChange) { + function invalidateContextProvider(workInProgress2, type2, didChange) { { var instance = workInProgress2.stateNode; if (!instance) { @@ -9926,7 +9931,7 @@ } } if (didChange) { - var mergedContext = processChildContext(workInProgress2, type, previousContext); + var mergedContext = processChildContext(workInProgress2, type2, previousContext); instance.__reactInternalMemoizedMergedChildContext = mergedContext; pop(didPerformWorkStackCursor, workInProgress2); pop(contextStackCursor, workInProgress2); @@ -9951,8 +9956,8 @@ case HostRoot: return node.stateNode.context; case ClassComponent: { - var Component = node.type; - if (isContextProvider(Component)) { + var Component14 = node.type; + if (isContextProvider(Component14)) { return node.stateNode.__reactInternalMemoizedMergedChildContext; } break; @@ -10067,7 +10072,7 @@ var immediateQueueCallbackNode = null; var isFlushingSyncQueue = false; var initialTimeMs$1 = Scheduler_now$1(); - var now = initialTimeMs$1 < 1e4 ? Scheduler_now$1 : function() { + var now2 = initialTimeMs$1 < 1e4 ? Scheduler_now$1 : function() { return Scheduler_now$1() - initialTimeMs$1; }; function getCurrentPriorityLevel() { @@ -10203,12 +10208,12 @@ } return maybeStrictRoot; }; - var setToSortedString = function(set2) { - var array = []; - set2.forEach(function(value) { - array.push(value); + var setToSortedString = function(set3) { + var array3 = []; + set3.forEach(function(value) { + array3.push(value); }); - return array.sort().join(", "); + return array3.sort().join(", "); }; var pendingComponentWillMountWarnings = []; var pendingUNSAFE_ComponentWillMountWarnings = []; @@ -10364,10 +10369,10 @@ pendingLegacyContextWarning = new Map(); }; } - function resolveDefaultProps(Component, baseProps) { - if (Component && Component.defaultProps) { + function resolveDefaultProps(Component14, baseProps) { + if (Component14 && Component14.defaultProps) { var props = _assign({}, baseProps); - var defaultProps = Component.defaultProps; + var defaultProps = Component14.defaultProps; for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; @@ -10594,14 +10599,14 @@ var queue = workInProgress2.updateQueue; var currentQueue = current2.updateQueue; if (queue === currentQueue) { - var clone = { + var clone2 = { baseState: currentQueue.baseState, firstBaseUpdate: currentQueue.firstBaseUpdate, lastBaseUpdate: currentQueue.lastBaseUpdate, shared: currentQueue.shared, effects: currentQueue.effects }; - workInProgress2.updateQueue = clone; + workInProgress2.updateQueue = clone2; } } function createUpdate(eventTime, lane) { @@ -10648,7 +10653,7 @@ if (firstBaseUpdate !== null) { var update = firstBaseUpdate; do { - var clone = { + var clone2 = { eventTime: update.eventTime, lane: update.lane, tag: update.tag, @@ -10657,10 +10662,10 @@ next: null }; if (newLast === null) { - newFirst = newLast = clone; + newFirst = newLast = clone2; } else { - newLast.next = clone; - newLast = clone; + newLast.next = clone2; + newLast = clone2; } update = update.next; } while (update !== null); @@ -10798,7 +10803,7 @@ var updateLane = update.lane; var updateEventTime = update.eventTime; if (!isSubsetOfLanes(renderLanes2, updateLane)) { - var clone = { + var clone2 = { eventTime: updateEventTime, lane: updateLane, tag: update.tag, @@ -10807,10 +10812,10 @@ next: null }; if (newLastBaseUpdate === null) { - newFirstBaseUpdate = newLastBaseUpdate = clone; + newFirstBaseUpdate = newLastBaseUpdate = clone2; newBaseState = newState; } else { - newLastBaseUpdate = newLastBaseUpdate.next = clone; + newLastBaseUpdate = newLastBaseUpdate.next = clone2; } newLanes = mergeLanes(newLanes, updateLane); } else { @@ -10896,7 +10901,7 @@ } var fakeInternalInstance = {}; var isArray = Array.isArray; - var emptyRefsObject = new React3.Component().refs; + var emptyRefsObject = new React106.Component().refs; var didWarnAboutStateAssignmentForComponent; var didWarnAboutUninitializedState; var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; @@ -10921,15 +10926,15 @@ if (callback === null || typeof callback === "function") { return; } - var key = callerName + "_" + callback; - if (!didWarnOnInvalidCallback.has(key)) { - didWarnOnInvalidCallback.add(key); + var key2 = callerName + "_" + callback; + if (!didWarnOnInvalidCallback.has(key2)) { + didWarnOnInvalidCallback.add(key2); error("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", callerName, callback); } }; - warnOnUndefinedDerivedState = function(type, partialState) { + warnOnUndefinedDerivedState = function(type2, partialState) { if (partialState === void 0) { - var componentName = getComponentName(type) || "Component"; + var componentName = getComponentName(type2) || "Component"; if (!didWarnAboutUndefinedDerivedState.has(componentName)) { didWarnAboutUndefinedDerivedState.add(componentName); error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", componentName); @@ -10974,7 +10979,7 @@ var classComponentUpdater = { isMounted, enqueueSetState: function(inst, payload, callback) { - var fiber = get(inst); + var fiber = get2(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); @@ -10989,7 +10994,7 @@ scheduleUpdateOnFiber(fiber, lane, eventTime); }, enqueueReplaceState: function(inst, payload, callback) { - var fiber = get(inst); + var fiber = get2(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); @@ -11005,7 +11010,7 @@ scheduleUpdateOnFiber(fiber, lane, eventTime); }, enqueueForceUpdate: function(inst, callback) { - var fiber = get(inst); + var fiber = get2(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); @@ -11042,7 +11047,7 @@ return shouldUpdate; } if (ctor.prototype && ctor.prototype.isPureReactComponent) { - return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); + return !shallowEqual2(oldProps, newProps) || !shallowEqual2(oldState, newState); } return true; } @@ -11129,7 +11134,7 @@ function adoptClassInstance(workInProgress2, instance) { instance.updater = classComponentUpdater; workInProgress2.stateNode = instance; - set(instance, workInProgress2); + set2(instance, workInProgress2); { instance._reactInternalInstance = fakeInternalInstance; } @@ -11601,10 +11606,10 @@ return existingChildren; } function useFiber(fiber, pendingProps) { - var clone = createWorkInProgress(fiber, pendingProps); - clone.index = 0; - clone.sibling = null; - return clone; + var clone2 = createWorkInProgress(fiber, pendingProps); + clone2.index = 0; + clone2.sibling = null; + return clone2; } function placeChild(newFiber, lastPlacedIndex, newIndex) { newFiber.index = newIndex; @@ -11671,9 +11676,9 @@ return existing; } } - function updateFragment2(returnFiber, current2, fragment, lanes, key) { - if (current2 === null || current2.tag !== Fragment) { - var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key); + function updateFragment2(returnFiber, current2, fragment, lanes, key2) { + if (current2 === null || current2.tag !== Fragment7) { + var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key2); created.return = returnFiber; return created; } else { @@ -11717,9 +11722,9 @@ return null; } function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = oldFiber !== null ? oldFiber.key : null; + var key2 = oldFiber !== null ? oldFiber.key : null; if (typeof newChild === "string" || typeof newChild === "number") { - if (key !== null) { + if (key2 !== null) { return null; } return updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); @@ -11727,9 +11732,9 @@ if (typeof newChild === "object" && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { - if (newChild.key === key) { + if (newChild.key === key2) { if (newChild.type === REACT_FRAGMENT_TYPE) { - return updateFragment2(returnFiber, oldFiber, newChild.props.children, lanes, key); + return updateFragment2(returnFiber, oldFiber, newChild.props.children, lanes, key2); } return updateElement(returnFiber, oldFiber, newChild, lanes); } else { @@ -11737,7 +11742,7 @@ } } case REACT_PORTAL_TYPE: { - if (newChild.key === key) { + if (newChild.key === key2) { return updatePortal(returnFiber, oldFiber, newChild, lanes); } else { return null; @@ -11745,7 +11750,7 @@ } } if (isArray$1(newChild) || getIteratorFn(newChild)) { - if (key !== null) { + if (key2 !== null) { return null; } return updateFragment2(returnFiber, oldFiber, newChild, lanes, null); @@ -11800,20 +11805,20 @@ case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: warnForMissingKey(child, returnFiber); - var key = child.key; - if (typeof key !== "string") { + var key2 = child.key; + if (typeof key2 !== "string") { break; } if (knownKeys === null) { knownKeys = new Set(); - knownKeys.add(key); + knownKeys.add(key2); break; } - if (!knownKeys.has(key)) { - knownKeys.add(key); + if (!knownKeys.has(key2)) { + knownKeys.add(key2); break; } - error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key); + 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.", key2); break; } } @@ -12035,12 +12040,12 @@ return created; } function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) { - var key = element.key; + var key2 = element.key; var child = currentFirstChild; while (child !== null) { - if (child.key === key) { + if (child.key === key2) { switch (child.tag) { - case Fragment: { + case Fragment7: { if (element.type === REACT_FRAGMENT_TYPE) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, element.props.children); @@ -12088,10 +12093,10 @@ } } function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) { - var key = portal.key; + var key2 = portal.key; var child = currentFirstChild; while (child !== null) { - if (child.key === key) { + if (child.key === key2) { if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, portal.children || []); @@ -12115,8 +12120,8 @@ if (isUnkeyedTopLevelFragment) { newChild = newChild.props.children; } - var isObject = typeof newChild === "object" && newChild !== null; - if (isObject) { + var isObject2 = typeof newChild === "object" && newChild !== null; + if (isObject2) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes)); @@ -12133,7 +12138,7 @@ if (getIteratorFn(newChild)) { return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); } - if (isObject) { + if (isObject2) { throwOnInvalidObjectType(returnFiber, newChild); } { @@ -12368,9 +12373,9 @@ var parentContainer = returnFiber.stateNode.containerInfo; switch (fiber.tag) { case HostComponent: - var type = fiber.type; + var type2 = fiber.type; var props = fiber.pendingProps; - didNotFindHydratableContainerInstance(parentContainer, type); + didNotFindHydratableContainerInstance(parentContainer, type2); break; case HostText: var text = fiber.pendingProps; @@ -12407,9 +12412,9 @@ function tryHydrate(fiber, nextInstance) { switch (fiber.tag) { case HostComponent: { - var type = fiber.type; + var type2 = fiber.type; var props = fiber.pendingProps; - var instance = canHydrateInstance(nextInstance, type); + var instance = canHydrateInstance(nextInstance, type2); if (instance !== null) { fiber.stateNode = instance; return true; @@ -12519,8 +12524,8 @@ isHydrating = true; return false; } - var type = fiber.type; - if (fiber.tag !== HostComponent || type !== "head" && type !== "body" && !shouldSetTextContent(type, fiber.memoizedProps)) { + var type2 = fiber.type; + if (fiber.tag !== HostComponent || type2 !== "head" && type2 !== "body" && !shouldSetTextContent(type2, fiber.memoizedProps)) { var nextInstance = nextHydratableInstance; while (nextInstance) { deleteHydratableInstance(fiber, nextInstance); @@ -12683,7 +12688,7 @@ } return true; } - function renderWithHooks(current2, workInProgress2, Component, props, secondArg, nextRenderLanes) { + function renderWithHooks(current2, workInProgress2, Component14, props, secondArg, nextRenderLanes) { renderLanes = nextRenderLanes; currentlyRenderingFiber$1 = workInProgress2; { @@ -12703,7 +12708,7 @@ ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; } } - var children = Component(props, secondArg); + var children = Component14(props, secondArg); if (didScheduleRenderPhaseUpdateDuringThisPass) { var numberOfReRenders = 0; do { @@ -12724,7 +12729,7 @@ hookTypesUpdateIndexDev = -1; } ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV; - children = Component(props, secondArg); + children = Component14(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); } ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; @@ -12901,7 +12906,7 @@ do { var updateLane = update.lane; if (!isSubsetOfLanes(renderLanes, updateLane)) { - var clone = { + var clone2 = { lane: updateLane, action: update.action, eagerReducer: update.eagerReducer, @@ -12909,10 +12914,10 @@ next: null }; if (newBaseQueueLast === null) { - newBaseQueueFirst = newBaseQueueLast = clone; + newBaseQueueFirst = newBaseQueueLast = clone2; newBaseState = newState; } else { - newBaseQueueLast = newBaseQueueLast.next = clone; + newBaseQueueLast = newBaseQueueLast.next = clone2; } currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane); markSkippedUpdateLanes(updateLane); @@ -13136,11 +13141,11 @@ function rerenderState(initialState) { return rerenderReducer(basicStateReducer); } - function pushEffect(tag, create, destroy, deps) { + function pushEffect(tag, create, destroy3, deps) { var effect = { tag, create, - destroy, + destroy: destroy3, deps, next: null }; @@ -13186,20 +13191,20 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = updateWorkInProgressHook(); var nextDeps = deps === void 0 ? null : deps; - var destroy = void 0; + var destroy3 = void 0; if (currentHook !== null) { var prevEffect = currentHook.memoizedState; - destroy = prevEffect.destroy; + destroy3 = prevEffect.destroy; if (nextDeps !== null) { var prevDeps = prevEffect.deps; if (areHookInputsEqual(nextDeps, prevDeps)) { - pushEffect(hookFlags, create, destroy, nextDeps); + pushEffect(hookFlags, create, destroy3, nextDeps); return; } } } currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps); + hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy3, nextDeps); } function mountEffect(create, deps) { { @@ -13311,12 +13316,12 @@ return nextValue; } function mountDeferredValue(value) { - var _mountState = mountState(value), prevValue = _mountState[0], setValue = _mountState[1]; + var _mountState = mountState(value), prevValue = _mountState[0], setValue2 = _mountState[1]; mountEffect(function() { var prevTransition = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = 1; try { - setValue(value); + setValue2(value); } finally { ReactCurrentBatchConfig$1.transition = prevTransition; } @@ -13324,12 +13329,12 @@ return prevValue; } function updateDeferredValue(value) { - var _updateState = updateState(), prevValue = _updateState[0], setValue = _updateState[1]; + var _updateState = updateState(), prevValue = _updateState[0], setValue2 = _updateState[1]; updateEffect(function() { var prevTransition = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = 1; try { - setValue(value); + setValue2(value); } finally { ReactCurrentBatchConfig$1.transition = prevTransition; } @@ -13337,12 +13342,12 @@ return prevValue; } function rerenderDeferredValue(value) { - var _rerenderState = rerenderState(), prevValue = _rerenderState[0], setValue = _rerenderState[1]; + var _rerenderState = rerenderState(), prevValue = _rerenderState[0], setValue2 = _rerenderState[1]; updateEffect(function() { var prevTransition = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = 1; try { - setValue(value); + setValue2(value); } finally { ReactCurrentBatchConfig$1.transition = prevTransition; } @@ -13421,15 +13426,15 @@ } } }; - var id = makeOpaqueHydratingObject(readValue); - var setId = mountState(id)[1]; + var id2 = makeOpaqueHydratingObject(readValue); + var setId = mountState(id2)[1]; if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) { currentlyRenderingFiber$1.flags |= Update | Passive; pushEffect(HasEffect | Passive$1, function() { setId(makeId()); }, void 0, null); } - return id; + return id2; } else { var _id = makeId(); mountState(_id); @@ -13437,12 +13442,12 @@ } } function updateOpaqueIdentifier() { - var id = updateState()[0]; - return id; + var id2 = updateState()[0]; + return id2; } function rerenderOpaqueIdentifier() { - var id = rerenderState()[0]; - return id; + var id2 = rerenderState()[0]; + return id2; } function dispatchAction(fiber, queue, action) { { @@ -14311,16 +14316,16 @@ workInProgress2.child = reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2); workInProgress2.child = reconcileChildFibers(workInProgress2, null, nextChildren, renderLanes2); } - function updateForwardRef(current2, workInProgress2, Component, nextProps, renderLanes2) { + function updateForwardRef(current2, workInProgress2, Component14, nextProps, renderLanes2) { { if (workInProgress2.type !== workInProgress2.elementType) { - var innerPropTypes = Component.propTypes; + var innerPropTypes = Component14.propTypes; if (innerPropTypes) { - checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component)); + checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component14)); } } } - var render2 = Component.render; + var render2 = Component14.render; var ref = workInProgress2.ref; var nextChildren; prepareToReadContext(workInProgress2, renderLanes2); @@ -14346,35 +14351,35 @@ reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2); return workInProgress2.child; } - function updateMemoComponent(current2, workInProgress2, Component, nextProps, updateLanes, renderLanes2) { + function updateMemoComponent(current2, workInProgress2, Component14, nextProps, updateLanes, renderLanes2) { if (current2 === null) { - var type = Component.type; - if (isSimpleFunctionComponent(type) && Component.compare === null && Component.defaultProps === void 0) { - var resolvedType = type; + var type2 = Component14.type; + if (isSimpleFunctionComponent(type2) && Component14.compare === null && Component14.defaultProps === void 0) { + var resolvedType = type2; { - resolvedType = resolveFunctionForHotReloading(type); + resolvedType = resolveFunctionForHotReloading(type2); } workInProgress2.tag = SimpleMemoComponent; workInProgress2.type = resolvedType; { - validateFunctionComponentInDev(workInProgress2, type); + validateFunctionComponentInDev(workInProgress2, type2); } return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, updateLanes, renderLanes2); } { - var innerPropTypes = type.propTypes; + var innerPropTypes = type2.propTypes; if (innerPropTypes) { - checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(type)); + checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(type2)); } } - var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2); + var child = createFiberFromTypeAndProps(Component14.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2); child.ref = workInProgress2.ref; child.return = workInProgress2; workInProgress2.child = child; return child; } { - var _type = Component.type; + var _type = Component14.type; var _innerPropTypes = _type.propTypes; if (_innerPropTypes) { checkPropTypes(_innerPropTypes, nextProps, "prop", getComponentName(_type)); @@ -14383,8 +14388,8 @@ var currentChild = current2.child; if (!includesSomeLane(updateLanes, renderLanes2)) { var prevProps = currentChild.memoizedProps; - var compare = Component.compare; - compare = compare !== null ? compare : shallowEqual; + var compare = Component14.compare; + compare = compare !== null ? compare : shallowEqual2; if (compare(prevProps, nextProps) && current2.ref === workInProgress2.ref) { return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2); } @@ -14396,7 +14401,7 @@ workInProgress2.child = newChild; return newChild; } - function updateSimpleMemoComponent(current2, workInProgress2, Component, nextProps, updateLanes, renderLanes2) { + function updateSimpleMemoComponent(current2, workInProgress2, Component14, nextProps, updateLanes, renderLanes2) { { if (workInProgress2.type !== workInProgress2.elementType) { var outerMemoType = workInProgress2.elementType; @@ -14418,7 +14423,7 @@ } if (current2 !== null) { var prevProps = current2.memoizedProps; - if (shallowEqual(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type) { + if (shallowEqual2(prevProps, nextProps) && current2.ref === workInProgress2.ref && workInProgress2.type === current2.type) { didReceiveUpdate = false; if (!includesSomeLane(renderLanes2, updateLanes)) { workInProgress2.lanes = current2.lanes; @@ -14428,7 +14433,7 @@ } } } - return updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2); + return updateFunctionComponent(current2, workInProgress2, Component14, nextProps, renderLanes2); } function updateOffscreenComponent(current2, workInProgress2, renderLanes2) { var nextProps = workInProgress2.pendingProps; @@ -14509,18 +14514,18 @@ workInProgress2.flags |= Ref; } } - function updateFunctionComponent(current2, workInProgress2, Component, nextProps, renderLanes2) { + function updateFunctionComponent(current2, workInProgress2, Component14, nextProps, renderLanes2) { { if (workInProgress2.type !== workInProgress2.elementType) { - var innerPropTypes = Component.propTypes; + var innerPropTypes = Component14.propTypes; if (innerPropTypes) { - checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component)); + checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component14)); } } } var context; { - var unmaskedContext = getUnmaskedContext(workInProgress2, Component, true); + var unmaskedContext = getUnmaskedContext(workInProgress2, Component14, true); context = getMaskedContext(workInProgress2, unmaskedContext); } var nextChildren; @@ -14528,11 +14533,11 @@ { ReactCurrentOwner$1.current = workInProgress2; setIsRendering(true); - nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2); + nextChildren = renderWithHooks(current2, workInProgress2, Component14, nextProps, context, renderLanes2); if (workInProgress2.mode & StrictMode) { disableLogs(); try { - nextChildren = renderWithHooks(current2, workInProgress2, Component, nextProps, context, renderLanes2); + nextChildren = renderWithHooks(current2, workInProgress2, Component14, nextProps, context, renderLanes2); } finally { reenableLogs(); } @@ -14547,17 +14552,17 @@ reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2); return workInProgress2.child; } - function updateClassComponent(current2, workInProgress2, Component, nextProps, renderLanes2) { + function updateClassComponent(current2, workInProgress2, Component14, nextProps, renderLanes2) { { if (workInProgress2.type !== workInProgress2.elementType) { - var innerPropTypes = Component.propTypes; + var innerPropTypes = Component14.propTypes; if (innerPropTypes) { - checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component)); + checkPropTypes(innerPropTypes, nextProps, "prop", getComponentName(Component14)); } } } var hasContext; - if (isContextProvider(Component)) { + if (isContextProvider(Component14)) { hasContext = true; pushContextProvider(workInProgress2); } else { @@ -14572,15 +14577,15 @@ workInProgress2.alternate = null; workInProgress2.flags |= Placement; } - constructClassInstance(workInProgress2, Component, nextProps); - mountClassInstance(workInProgress2, Component, nextProps, renderLanes2); + constructClassInstance(workInProgress2, Component14, nextProps); + mountClassInstance(workInProgress2, Component14, nextProps, renderLanes2); shouldUpdate = true; } else if (current2 === null) { - shouldUpdate = resumeMountClassInstance(workInProgress2, Component, nextProps, renderLanes2); + shouldUpdate = resumeMountClassInstance(workInProgress2, Component14, nextProps, renderLanes2); } else { - shouldUpdate = updateClassInstance(current2, workInProgress2, Component, nextProps, renderLanes2); + shouldUpdate = updateClassInstance(current2, workInProgress2, Component14, nextProps, renderLanes2); } - var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2); + var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component14, shouldUpdate, hasContext, renderLanes2); { var inst = workInProgress2.stateNode; if (shouldUpdate && inst.props !== nextProps) { @@ -14592,19 +14597,19 @@ } return nextUnitOfWork; } - function finishClassComponent(current2, workInProgress2, Component, shouldUpdate, hasContext, renderLanes2) { + function finishClassComponent(current2, workInProgress2, Component14, shouldUpdate, hasContext, renderLanes2) { markRef(current2, workInProgress2); var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags; if (!shouldUpdate && !didCaptureError) { if (hasContext) { - invalidateContextProvider(workInProgress2, Component, false); + invalidateContextProvider(workInProgress2, Component14, false); } return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2); } var instance = workInProgress2.stateNode; ReactCurrentOwner$1.current = workInProgress2; var nextChildren; - if (didCaptureError && typeof Component.getDerivedStateFromError !== "function") { + if (didCaptureError && typeof Component14.getDerivedStateFromError !== "function") { nextChildren = null; { stopProfilerTimerIfRunning(); @@ -14632,7 +14637,7 @@ } workInProgress2.memoizedState = instance.state; if (hasContext) { - invalidateContextProvider(workInProgress2, Component, true); + invalidateContextProvider(workInProgress2, Component14, true); } return workInProgress2.child; } @@ -14694,14 +14699,14 @@ if (current2 === null) { tryToClaimNextHydratableInstance(workInProgress2); } - var type = workInProgress2.type; + var type2 = workInProgress2.type; var nextProps = workInProgress2.pendingProps; var prevProps = current2 !== null ? current2.memoizedProps : null; var nextChildren = nextProps.children; - var isDirectTextChild = shouldSetTextContent(type, nextProps); + var isDirectTextChild = shouldSetTextContent(type2, nextProps); if (isDirectTextChild) { nextChildren = null; - } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) { + } else if (prevProps !== null && shouldSetTextContent(type2, prevProps)) { workInProgress2.flags |= ContentReset; } markRef(current2, workInProgress2); @@ -14724,60 +14729,60 @@ var lazyComponent = elementType; var payload = lazyComponent._payload; var init = lazyComponent._init; - var Component = init(payload); - workInProgress2.type = Component; - var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component); - var resolvedProps = resolveDefaultProps(Component, props); + var Component14 = init(payload); + workInProgress2.type = Component14; + var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component14); + var resolvedProps = resolveDefaultProps(Component14, props); var child; switch (resolvedTag) { case FunctionComponent: { { - validateFunctionComponentInDev(workInProgress2, Component); - workInProgress2.type = Component = resolveFunctionForHotReloading(Component); + validateFunctionComponentInDev(workInProgress2, Component14); + workInProgress2.type = Component14 = resolveFunctionForHotReloading(Component14); } - child = updateFunctionComponent(null, workInProgress2, Component, resolvedProps, renderLanes2); + child = updateFunctionComponent(null, workInProgress2, Component14, resolvedProps, renderLanes2); return child; } case ClassComponent: { { - workInProgress2.type = Component = resolveClassForHotReloading(Component); + workInProgress2.type = Component14 = resolveClassForHotReloading(Component14); } - child = updateClassComponent(null, workInProgress2, Component, resolvedProps, renderLanes2); + child = updateClassComponent(null, workInProgress2, Component14, resolvedProps, renderLanes2); return child; } case ForwardRef: { { - workInProgress2.type = Component = resolveForwardRefForHotReloading(Component); + workInProgress2.type = Component14 = resolveForwardRefForHotReloading(Component14); } - child = updateForwardRef(null, workInProgress2, Component, resolvedProps, renderLanes2); + child = updateForwardRef(null, workInProgress2, Component14, resolvedProps, renderLanes2); return child; } case MemoComponent: { { if (workInProgress2.type !== workInProgress2.elementType) { - var outerPropTypes = Component.propTypes; + var outerPropTypes = Component14.propTypes; if (outerPropTypes) { - checkPropTypes(outerPropTypes, resolvedProps, "prop", getComponentName(Component)); + checkPropTypes(outerPropTypes, resolvedProps, "prop", getComponentName(Component14)); } } } - child = updateMemoComponent(null, workInProgress2, Component, resolveDefaultProps(Component.type, resolvedProps), updateLanes, renderLanes2); + child = updateMemoComponent(null, workInProgress2, Component14, resolveDefaultProps(Component14.type, resolvedProps), updateLanes, renderLanes2); return child; } } var hint = ""; { - if (Component !== null && typeof Component === "object" && Component.$$typeof === REACT_LAZY_TYPE) { + if (Component14 !== null && typeof Component14 === "object" && Component14.$$typeof === REACT_LAZY_TYPE) { hint = " Did you wrap a component in React.lazy() more than once?"; } } { { - throw Error("Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint); + throw Error("Element type is invalid. Received a promise that resolves to: " + Component14 + ". Lazy element type must resolve to a class or function." + hint); } } } - function mountIncompleteClassComponent(_current, workInProgress2, Component, nextProps, renderLanes2) { + function mountIncompleteClassComponent(_current, workInProgress2, Component14, nextProps, renderLanes2) { if (_current !== null) { _current.alternate = null; workInProgress2.alternate = null; @@ -14785,18 +14790,18 @@ } workInProgress2.tag = ClassComponent; var hasContext; - if (isContextProvider(Component)) { + if (isContextProvider(Component14)) { hasContext = true; pushContextProvider(workInProgress2); } else { hasContext = false; } prepareToReadContext(workInProgress2, renderLanes2); - constructClassInstance(workInProgress2, Component, nextProps); - mountClassInstance(workInProgress2, Component, nextProps, renderLanes2); - return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2); + constructClassInstance(workInProgress2, Component14, nextProps); + mountClassInstance(workInProgress2, Component14, nextProps, renderLanes2); + return finishClassComponent(null, workInProgress2, Component14, true, hasContext, renderLanes2); } - function mountIndeterminateComponent(_current, workInProgress2, Component, renderLanes2) { + function mountIndeterminateComponent(_current, workInProgress2, Component14, renderLanes2) { if (_current !== null) { _current.alternate = null; workInProgress2.alternate = null; @@ -14805,14 +14810,14 @@ var props = workInProgress2.pendingProps; var context; { - var unmaskedContext = getUnmaskedContext(workInProgress2, Component, false); + var unmaskedContext = getUnmaskedContext(workInProgress2, Component14, false); context = getMaskedContext(workInProgress2, unmaskedContext); } prepareToReadContext(workInProgress2, renderLanes2); var value; { - if (Component.prototype && typeof Component.prototype.render === "function") { - var componentName = getComponentName(Component) || "Unknown"; + if (Component14.prototype && typeof Component14.prototype.render === "function") { + var componentName = getComponentName(Component14) || "Unknown"; if (!didWarnAboutBadClass[componentName]) { error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName); didWarnAboutBadClass[componentName] = true; @@ -14823,13 +14828,13 @@ } setIsRendering(true); ReactCurrentOwner$1.current = workInProgress2; - value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2); + value = renderWithHooks(null, workInProgress2, Component14, props, context, renderLanes2); setIsRendering(false); } workInProgress2.flags |= PerformedWork; { if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) { - var _componentName = getComponentName(Component) || "Unknown"; + var _componentName = getComponentName(Component14) || "Unknown"; if (!didWarnAboutModulePatternComponent[_componentName]) { error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName); didWarnAboutModulePatternComponent[_componentName] = true; @@ -14838,7 +14843,7 @@ } if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) { { - var _componentName2 = getComponentName(Component) || "Unknown"; + var _componentName2 = getComponentName(Component14) || "Unknown"; if (!didWarnAboutModulePatternComponent[_componentName2]) { error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2); didWarnAboutModulePatternComponent[_componentName2] = true; @@ -14848,7 +14853,7 @@ workInProgress2.memoizedState = null; workInProgress2.updateQueue = null; var hasContext = false; - if (isContextProvider(Component)) { + if (isContextProvider(Component14)) { hasContext = true; pushContextProvider(workInProgress2); } else { @@ -14856,20 +14861,20 @@ } workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null; initializeUpdateQueue(workInProgress2); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; + var getDerivedStateFromProps = Component14.getDerivedStateFromProps; if (typeof getDerivedStateFromProps === "function") { - applyDerivedStateFromProps(workInProgress2, Component, getDerivedStateFromProps, props); + applyDerivedStateFromProps(workInProgress2, Component14, getDerivedStateFromProps, props); } adoptClassInstance(workInProgress2, value); - mountClassInstance(workInProgress2, Component, props, renderLanes2); - return finishClassComponent(null, workInProgress2, Component, true, hasContext, renderLanes2); + mountClassInstance(workInProgress2, Component14, props, renderLanes2); + return finishClassComponent(null, workInProgress2, Component14, true, hasContext, renderLanes2); } else { workInProgress2.tag = FunctionComponent; { if (workInProgress2.mode & StrictMode) { disableLogs(); try { - value = renderWithHooks(null, workInProgress2, Component, props, context, renderLanes2); + value = renderWithHooks(null, workInProgress2, Component14, props, context, renderLanes2); } finally { reenableLogs(); } @@ -14877,16 +14882,16 @@ } reconcileChildren(null, workInProgress2, value, renderLanes2); { - validateFunctionComponentInDev(workInProgress2, Component); + validateFunctionComponentInDev(workInProgress2, Component14); } return workInProgress2.child; } } - function validateFunctionComponentInDev(workInProgress2, Component) { + function validateFunctionComponentInDev(workInProgress2, Component14) { { - if (Component) { - if (Component.childContextTypes) { - error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component"); + if (Component14) { + if (Component14.childContextTypes) { + error("%s(...): childContextTypes cannot be defined on a function component.", Component14.displayName || Component14.name || "Component"); } } if (workInProgress2.ref !== null) { @@ -14905,15 +14910,15 @@ error("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", info); } } - if (typeof Component.getDerivedStateFromProps === "function") { - var _componentName3 = getComponentName(Component) || "Unknown"; + if (typeof Component14.getDerivedStateFromProps === "function") { + var _componentName3 = getComponentName(Component14) || "Unknown"; if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) { error("%s: Function components do not support getDerivedStateFromProps.", _componentName3); didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true; } } - if (typeof Component.contextType === "object" && Component.contextType !== null) { - var _componentName4 = getComponentName(Component) || "Unknown"; + if (typeof Component14.contextType === "object" && Component14.contextType !== null) { + var _componentName4 = getComponentName(Component14) || "Unknown"; if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { error("%s: Function components do not support contextType.", _componentName4); didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; @@ -15229,13 +15234,13 @@ } } } - function validateSuspenseListNestedChild(childSlot, index2) { + function validateSuspenseListNestedChild(childSlot, index3) { { var isArray2 = Array.isArray(childSlot); var isIterable = !isArray2 && typeof getIteratorFn(childSlot) === "function"; if (isArray2 || isIterable) { - var type = isArray2 ? "array" : "iterable"; - error("A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", type, index2, type); + var type2 = isArray2 ? "array" : "iterable"; + error("A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", type2, index3, type2); return false; } } @@ -15522,8 +15527,8 @@ pushHostContext(workInProgress2); break; case ClassComponent: { - var Component = workInProgress2.type; - if (isContextProvider(Component)) { + var Component14 = workInProgress2.type; + if (isContextProvider(Component14)) { pushContextProvider(workInProgress2); } break; @@ -15639,12 +15644,12 @@ case HostPortal: return updatePortalComponent(current2, workInProgress2, renderLanes2); case ForwardRef: { - var type = workInProgress2.type; + var type2 = workInProgress2.type; var _unresolvedProps2 = workInProgress2.pendingProps; - var _resolvedProps2 = workInProgress2.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); - return updateForwardRef(current2, workInProgress2, type, _resolvedProps2, renderLanes2); + var _resolvedProps2 = workInProgress2.elementType === type2 ? _unresolvedProps2 : resolveDefaultProps(type2, _unresolvedProps2); + return updateForwardRef(current2, workInProgress2, type2, _resolvedProps2, renderLanes2); } - case Fragment: + case Fragment7: return updateFragment(current2, workInProgress2, renderLanes2); case Mode: return updateMode(current2, workInProgress2, renderLanes2); @@ -15714,7 +15719,7 @@ var updateHostComponent$1; var updateHostText$1; { - appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) { + appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden2) { var node = workInProgress2.child; while (node !== null) { if (node.tag === HostComponent || node.tag === HostText) { @@ -15741,14 +15746,14 @@ }; updateHostContainer = function(workInProgress2) { }; - updateHostComponent$1 = function(current2, workInProgress2, type, newProps, rootContainerInstance) { + updateHostComponent$1 = function(current2, workInProgress2, type2, newProps, rootContainerInstance) { var oldProps = current2.memoizedProps; if (oldProps === newProps) { return; } var instance = workInProgress2.stateNode; var currentHostContext = getHostContext(); - var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); + var updatePayload = prepareUpdate(instance, type2, oldProps, newProps, rootContainerInstance, currentHostContext); workInProgress2.updateQueue = updatePayload; if (updatePayload) { markUpdate(workInProgress2); @@ -15811,15 +15816,15 @@ case SimpleMemoComponent: case FunctionComponent: case ForwardRef: - case Fragment: + case Fragment7: case Mode: case Profiler: case ContextConsumer: case MemoComponent: return null; case ClassComponent: { - var Component = workInProgress2.type; - if (isContextProvider(Component)) { + var Component14 = workInProgress2.type; + if (isContextProvider(Component14)) { popContext(workInProgress2); } return null; @@ -15847,9 +15852,9 @@ case HostComponent: { popHostContext(workInProgress2); var rootContainerInstance = getRootHostContainer(); - var type = workInProgress2.type; + var type2 = workInProgress2.type; if (current2 !== null && workInProgress2.stateNode != null) { - updateHostComponent$1(current2, workInProgress2, type, newProps, rootContainerInstance); + updateHostComponent$1(current2, workInProgress2, type2, newProps, rootContainerInstance); if (current2.ref !== workInProgress2.ref) { markRef$1(workInProgress2); } @@ -15869,10 +15874,10 @@ markUpdate(workInProgress2); } } else { - var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress2); + var instance = createInstance(type2, newProps, rootContainerInstance, currentHostContext, workInProgress2); appendAllChildren(instance, workInProgress2, false, false); workInProgress2.stateNode = instance; - if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) { + if (finalizeInitialChildren(instance, type2, newProps, rootContainerInstance)) { markUpdate(workInProgress2); } } @@ -15997,7 +16002,7 @@ row = row.sibling; } } - if (renderState.tail !== null && now() > getRenderTargetTime()) { + if (renderState.tail !== null && now2() > getRenderTargetTime()) { workInProgress2.flags |= DidCapture; didSuspendAlready = true; cutOffTailIfNeeded(renderState, false); @@ -16028,7 +16033,7 @@ } return null; } - } else if (now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane) { + } else if (now2() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane) { workInProgress2.flags |= DidCapture; didSuspendAlready = true; cutOffTailIfNeeded(renderState, false); @@ -16056,7 +16061,7 @@ renderState.rendering = next; renderState.tail = next.sibling; renderState.lastEffect = workInProgress2.lastEffect; - renderState.renderingStartTime = now(); + renderState.renderingStartTime = now2(); next.sibling = null; var suspenseContext = suspenseStackCursor.current; if (didSuspendAlready) { @@ -16101,8 +16106,8 @@ function unwindWork(workInProgress2, renderLanes2) { switch (workInProgress2.tag) { case ClassComponent: { - var Component = workInProgress2.type; - if (isContextProvider(Component)) { + var Component14 = workInProgress2.type; + if (isContextProvider(Component14)) { popContext(workInProgress2); } var flags = workInProgress2.flags; @@ -16443,9 +16448,9 @@ } } } - function safelyCallDestroy(current2, destroy) { + function safelyCallDestroy(current2, destroy3) { { - invokeGuardedCallback(null, destroy, null); + invokeGuardedCallback(null, destroy3, null); if (hasCaughtError()) { var error2 = clearCaughtError(); captureCommitPhaseError(current2, error2); @@ -16518,10 +16523,10 @@ var effect = firstEffect; do { if ((effect.tag & tag) === tag) { - var destroy = effect.destroy; + var destroy3 = effect.destroy; effect.destroy = void 0; - if (destroy !== void 0) { - destroy(); + if (destroy3 !== void 0) { + destroy3(); } } effect = effect.next; @@ -16539,15 +16544,15 @@ var create = effect.create; effect.destroy = create(); { - var destroy = effect.destroy; - if (destroy !== void 0 && typeof destroy !== "function") { + var destroy3 = effect.destroy; + if (destroy3 !== void 0 && typeof destroy3 !== "function") { var addendum = void 0; - if (destroy === null) { + if (destroy3 === null) { addendum = " You returned null. If your effect does not require clean up, return undefined (or nothing)."; - } else if (typeof destroy.then === "function") { + } else if (typeof destroy3.then === "function") { addendum = "\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\nuseEffect(() => {\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://reactjs.org/link/hooks-data-fetching"; } else { - addendum = " You returned: " + destroy; + addendum = " You returned: " + destroy3; } error("An effect function must not return anything besides a function, which is used for clean-up.%s", addendum); } @@ -16657,9 +16662,9 @@ case HostComponent: { var _instance2 = finishedWork.stateNode; if (current2 === null && finishedWork.flags & Update) { - var type = finishedWork.type; + var type2 = finishedWork.type; var props = finishedWork.memoizedProps; - commitMount(_instance2, type, props); + commitMount(_instance2, type2, props); } return; } @@ -16700,20 +16705,20 @@ } } } - function hideOrUnhideAllChildren(finishedWork, isHidden) { + function hideOrUnhideAllChildren(finishedWork, isHidden2) { { var node = finishedWork; while (true) { if (node.tag === HostComponent) { var instance = node.stateNode; - if (isHidden) { + if (isHidden2) { hideInstance(instance); } else { unhideInstance(node.stateNode, node.memoizedProps); } } else if (node.tag === HostText) { var _instance3 = node.stateNode; - if (isHidden) { + if (isHidden2) { hideTextInstance(_instance3); } else { unhideTextInstance(_instance3, node.memoizedProps); @@ -16788,13 +16793,13 @@ var firstEffect = lastEffect.next; var effect = firstEffect; do { - var _effect2 = effect, destroy = _effect2.destroy, tag = _effect2.tag; - if (destroy !== void 0) { + var _effect2 = effect, destroy3 = _effect2.destroy, tag = _effect2.tag; + if (destroy3 !== void 0) { if ((tag & Passive$1) !== NoFlags$1) { enqueuePendingPassiveHookEffectUnmount(current2, effect); } else { { - safelyCallDestroy(current2, destroy); + safelyCallDestroy(current2, destroy3); } } } @@ -17102,11 +17107,11 @@ if (instance != null) { var newProps = finishedWork.memoizedProps; var oldProps = current2 !== null ? current2.memoizedProps : newProps; - var type = finishedWork.type; + var type2 = finishedWork.type; var updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; if (updatePayload !== null) { - commitUpdate(instance, updatePayload, type, oldProps, newProps); + commitUpdate(instance, updatePayload, type2, oldProps, newProps); } } return; @@ -17157,8 +17162,8 @@ case OffscreenComponent: case LegacyHiddenComponent: { var newState = finishedWork.memoizedState; - var isHidden = newState !== null; - hideOrUnhideAllChildren(finishedWork, isHidden); + var isHidden2 = newState !== null; + hideOrUnhideAllChildren(finishedWork, isHidden2); return; } } @@ -17283,7 +17288,7 @@ var workInProgressRootRenderTargetTime = Infinity; var RENDER_TIMEOUT_MS = 500; function resetRenderTimer() { - workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS; + workInProgressRootRenderTargetTime = now2() + RENDER_TIMEOUT_MS; } function getRenderTargetTime() { return workInProgressRootRenderTargetTime; @@ -17316,12 +17321,12 @@ } function requestEventTime() { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { - return now(); + return now2(); } if (currentEventTime !== NoTimestamp) { return currentEventTime; } - currentEventTime = now(); + currentEventTime = now2(); return currentEventTime; } function requestUpdateLane(fiber) { @@ -17512,7 +17517,7 @@ var fatalError = workInProgressRootFatalError; prepareFreshStack(root2, NoLanes); markRootSuspended$1(root2, lanes); - ensureRootIsScheduled(root2, now()); + ensureRootIsScheduled(root2, now2()); throw fatalError; } var finishedWork = root2.current.alternate; @@ -17520,7 +17525,7 @@ root2.finishedLanes = lanes; finishConcurrentRender(root2, exitStatus, lanes); } - ensureRootIsScheduled(root2, now()); + ensureRootIsScheduled(root2, now2()); if (root2.callbackNode === originalCallbackNode) { return performConcurrentWorkOnRoot.bind(null, root2); } @@ -17543,7 +17548,7 @@ case RootSuspended: { markRootSuspended$1(root2, lanes); if (includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) { - var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); + var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now2(); if (msUntilTimeout > 10) { var nextLanes = getNextLanes(root2, NoLanes); if (nextLanes !== NoLanes) { @@ -17570,7 +17575,7 @@ if (!shouldForceFlushFallbacksInDEV()) { var mostRecentEventTime = getMostRecentEventTime(root2, lanes); var eventTimeMs = mostRecentEventTime; - var timeElapsedMs = now() - eventTimeMs; + var timeElapsedMs = now2() - eventTimeMs; var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; if (_msUntilTimeout > 10) { root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2), _msUntilTimeout); @@ -17633,14 +17638,14 @@ var fatalError = workInProgressRootFatalError; prepareFreshStack(root2, NoLanes); markRootSuspended$1(root2, lanes); - ensureRootIsScheduled(root2, now()); + ensureRootIsScheduled(root2, now2()); throw fatalError; } var finishedWork = root2.current.alternate; root2.finishedWork = finishedWork; root2.finishedLanes = lanes; commitRoot(root2); - ensureRootIsScheduled(root2, now()); + ensureRootIsScheduled(root2, now2()); return null; } function flushDiscreteUpdates() { @@ -17661,7 +17666,7 @@ rootsWithPendingDiscreteUpdates = null; roots.forEach(function(root2) { markDiscreteUpdatesExpired(root2); - ensureRootIsScheduled(root2, now()); + ensureRootIsScheduled(root2, now2()); }); } flushSyncCallbackQueue(); @@ -17839,7 +17844,7 @@ } } function markCommitTimeOfFallback() { - globalMostRecentFallbackTime = now(); + globalMostRecentFallbackTime = now2(); } function markSkippedUpdateLanes(lane) { workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes); @@ -18247,7 +18252,7 @@ { onCommitRoot$1(); } - ensureRootIsScheduled(root2, now()); + ensureRootIsScheduled(root2, now2()); if (hasUncaughtError) { hasUncaughtError = false; var _error3 = firstUncaughtError; @@ -18425,7 +18430,7 @@ for (var i = 0; i < unmountEffects.length; i += 2) { var _effect = unmountEffects[i]; var fiber = unmountEffects[i + 1]; - var destroy = _effect.destroy; + var destroy3 = _effect.destroy; _effect.destroy = void 0; { fiber.flags &= ~PassiveUnmountPendingDev; @@ -18434,11 +18439,11 @@ alternate.flags &= ~PassiveUnmountPendingDev; } } - if (typeof destroy === "function") { + if (typeof destroy3 === "function") { { setCurrentFiber(fiber); { - invokeGuardedCallback(null, destroy, null); + invokeGuardedCallback(null, destroy3, null); } if (hasCaughtError()) { if (!(fiber !== null)) { @@ -18570,7 +18575,7 @@ var eventTime = requestEventTime(); markRootPinged(root2, pingedLanes); if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) { - if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) { + if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now2() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) { prepareFreshStack(root2, NoLanes); } else { workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes); @@ -18930,42 +18935,42 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); resolveFamily = handler; } }; - function resolveFunctionForHotReloading(type) { + function resolveFunctionForHotReloading(type2) { { if (resolveFamily === null) { - return type; + return type2; } - var family = resolveFamily(type); + var family = resolveFamily(type2); if (family === void 0) { - return type; + return type2; } return family.current; } } - function resolveClassForHotReloading(type) { - return resolveFunctionForHotReloading(type); + function resolveClassForHotReloading(type2) { + return resolveFunctionForHotReloading(type2); } - function resolveForwardRefForHotReloading(type) { + function resolveForwardRefForHotReloading(type2) { { if (resolveFamily === null) { - return type; + return type2; } - var family = resolveFamily(type); + var family = resolveFamily(type2); if (family === void 0) { - if (type !== null && type !== void 0 && typeof type.render === "function") { - var currentRender = resolveFunctionForHotReloading(type.render); - if (type.render !== currentRender) { + if (type2 !== null && type2 !== void 0 && typeof type2.render === "function") { + var currentRender = resolveFunctionForHotReloading(type2.render); + if (type2.render !== currentRender) { var syntheticType = { $$typeof: REACT_FORWARD_REF_TYPE, render: currentRender }; - if (type.displayName !== void 0) { - syntheticType.displayName = type.displayName; + if (type2.displayName !== void 0) { + syntheticType.displayName = type2.displayName; } return syntheticType; } } - return type; + return type2; } return family.current; } @@ -19062,16 +19067,16 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); }; function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) { { - var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; + var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type2 = fiber.type; var candidateType = null; switch (tag) { case FunctionComponent: case SimpleMemoComponent: case ClassComponent: - candidateType = type; + candidateType = type2; break; case ForwardRef: - candidateType = type.render; + candidateType = type2.render; break; } if (resolveFamily === null) { @@ -19115,30 +19120,30 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); var findHostInstancesForRefresh = function(root2, families) { { var hostInstances = new Set(); - var types = new Set(families.map(function(family) { + var types2 = new Set(families.map(function(family) { return family.current; })); - findHostInstancesForMatchingFibersRecursively(root2.current, types, hostInstances); + findHostInstancesForMatchingFibersRecursively(root2.current, types2, hostInstances); return hostInstances; } }; - function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) { + function findHostInstancesForMatchingFibersRecursively(fiber, types2, hostInstances) { { - var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; + var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type2 = fiber.type; var candidateType = null; switch (tag) { case FunctionComponent: case SimpleMemoComponent: case ClassComponent: - candidateType = type; + candidateType = type2; break; case ForwardRef: - candidateType = type.render; + candidateType = type2.render; break; } var didMatch = false; if (candidateType !== null) { - if (types.has(candidateType)) { + if (types2.has(candidateType)) { didMatch = true; } } @@ -19146,11 +19151,11 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); findHostInstancesForFiberShallowly(fiber, hostInstances); } else { if (child !== null) { - findHostInstancesForMatchingFibersRecursively(child, types, hostInstances); + findHostInstancesForMatchingFibersRecursively(child, types2, hostInstances); } } if (sibling !== null) { - findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances); + findHostInstancesForMatchingFibersRecursively(sibling, types2, hostInstances); } } } @@ -19220,9 +19225,9 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } } var debugCounter = 1; - function FiberNode(tag, pendingProps, key, mode) { + function FiberNode(tag, pendingProps, key2, mode) { this.tag = tag; - this.key = key; + this.key = key2; this.elementType = null; this.type = null; this.stateNode = null; @@ -19265,21 +19270,21 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } } } - var createFiber = function(tag, pendingProps, key, mode) { - return new FiberNode(tag, pendingProps, key, mode); + var createFiber = function(tag, pendingProps, key2, mode) { + return new FiberNode(tag, pendingProps, key2, mode); }; - function shouldConstruct$1(Component) { - var prototype = Component.prototype; + function shouldConstruct$1(Component14) { + var prototype = Component14.prototype; return !!(prototype && prototype.isReactComponent); } - function isSimpleFunctionComponent(type) { - return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0; + function isSimpleFunctionComponent(type2) { + return typeof type2 === "function" && !shouldConstruct$1(type2) && type2.defaultProps === void 0; } - function resolveLazyComponentTag(Component) { - if (typeof Component === "function") { - return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent; - } else if (Component !== void 0 && Component !== null) { - var $$typeof = Component.$$typeof; + function resolveLazyComponentTag(Component14) { + if (typeof Component14 === "function") { + return shouldConstruct$1(Component14) ? ClassComponent : FunctionComponent; + } else if (Component14 !== void 0 && Component14 !== null) { + var $$typeof = Component14.$$typeof; if ($$typeof === REACT_FORWARD_REF_TYPE) { return ForwardRef; } @@ -19405,11 +19410,11 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } return createFiber(HostRoot, null, null, mode); } - function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) { + function createFiberFromTypeAndProps(type2, key2, pendingProps, owner, mode, lanes) { var fiberTag = IndeterminateComponent; - var resolvedType = type; - if (typeof type === "function") { - if (shouldConstruct$1(type)) { + var resolvedType = type2; + if (typeof type2 === "function") { + if (shouldConstruct$1(type2)) { fiberTag = ClassComponent; { resolvedType = resolveClassForHotReloading(resolvedType); @@ -19419,13 +19424,13 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); resolvedType = resolveFunctionForHotReloading(resolvedType); } } - } else if (typeof type === "string") { + } else if (typeof type2 === "string") { fiberTag = HostComponent; } else { getTag: - switch (type) { + switch (type2) { case REACT_FRAGMENT_TYPE: - return createFiberFromFragment(pendingProps.children, mode, lanes, key); + return createFiberFromFragment(pendingProps.children, mode, lanes, key2); case REACT_DEBUG_TRACING_MODE_TYPE: fiberTag = Mode; mode |= DebugTracingMode; @@ -19435,19 +19440,19 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); mode |= StrictMode; break; case REACT_PROFILER_TYPE: - return createFiberFromProfiler(pendingProps, mode, lanes, key); + return createFiberFromProfiler(pendingProps, mode, lanes, key2); case REACT_SUSPENSE_TYPE: - return createFiberFromSuspense(pendingProps, mode, lanes, key); + return createFiberFromSuspense(pendingProps, mode, lanes, key2); case REACT_SUSPENSE_LIST_TYPE: - return createFiberFromSuspenseList(pendingProps, mode, lanes, key); + return createFiberFromSuspenseList(pendingProps, mode, lanes, key2); case REACT_OFFSCREEN_TYPE: - return createFiberFromOffscreen(pendingProps, mode, lanes, key); + return createFiberFromOffscreen(pendingProps, mode, lanes, key2); case REACT_LEGACY_HIDDEN_TYPE: - return createFiberFromLegacyHidden(pendingProps, mode, lanes, key); + return createFiberFromLegacyHidden(pendingProps, mode, lanes, key2); case REACT_SCOPE_TYPE: default: { - if (typeof type === "object" && type !== null) { - switch (type.$$typeof) { + if (typeof type2 === "object" && type2 !== null) { + switch (type2.$$typeof) { case REACT_PROVIDER_TYPE: fiberTag = ContextProvider; break getTag; @@ -19474,7 +19479,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } var info = ""; { - if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) { + if (type2 === void 0 || typeof type2 === "object" && type2 !== null && Object.keys(type2).length === 0) { info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; } var ownerName = owner ? getComponentName(owner.type) : null; @@ -19484,14 +19489,14 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } { { - throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info); + throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type2 == null ? type2 : typeof type2) + "." + info); } } } } } - var fiber = createFiber(fiberTag, pendingProps, key, mode); - fiber.elementType = type; + var fiber = createFiber(fiberTag, pendingProps, key2, mode); + fiber.elementType = type2; fiber.type = resolvedType; fiber.lanes = lanes; { @@ -19504,28 +19509,28 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); { owner = element._owner; } - var type = element.type; - var key = element.key; + var type2 = element.type; + var key2 = element.key; var pendingProps = element.props; - var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes); + var fiber = createFiberFromTypeAndProps(type2, key2, pendingProps, owner, mode, lanes); { fiber._debugSource = element._source; fiber._debugOwner = element._owner; } return fiber; } - function createFiberFromFragment(elements, mode, lanes, key) { - var fiber = createFiber(Fragment, elements, key, mode); + function createFiberFromFragment(elements, mode, lanes, key2) { + var fiber = createFiber(Fragment7, elements, key2, mode); fiber.lanes = lanes; return fiber; } - function createFiberFromProfiler(pendingProps, mode, lanes, key) { + function createFiberFromProfiler(pendingProps, mode, lanes, key2) { { if (typeof pendingProps.id !== "string") { error('Profiler must specify an "id" as a prop'); } } - var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); + var fiber = createFiber(Profiler, pendingProps, key2, mode | ProfileMode); fiber.elementType = REACT_PROFILER_TYPE; fiber.type = REACT_PROFILER_TYPE; fiber.lanes = lanes; @@ -19537,15 +19542,15 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } return fiber; } - function createFiberFromSuspense(pendingProps, mode, lanes, key) { - var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); + function createFiberFromSuspense(pendingProps, mode, lanes, key2) { + var fiber = createFiber(SuspenseComponent, pendingProps, key2, mode); fiber.type = REACT_SUSPENSE_TYPE; fiber.elementType = REACT_SUSPENSE_TYPE; fiber.lanes = lanes; return fiber; } - function createFiberFromSuspenseList(pendingProps, mode, lanes, key) { - var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode); + function createFiberFromSuspenseList(pendingProps, mode, lanes, key2) { + var fiber = createFiber(SuspenseListComponent, pendingProps, key2, mode); { fiber.type = REACT_SUSPENSE_LIST_TYPE; } @@ -19553,8 +19558,8 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); fiber.lanes = lanes; return fiber; } - function createFiberFromOffscreen(pendingProps, mode, lanes, key) { - var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); + function createFiberFromOffscreen(pendingProps, mode, lanes, key2) { + var fiber = createFiber(OffscreenComponent, pendingProps, key2, mode); { fiber.type = REACT_OFFSCREEN_TYPE; } @@ -19562,8 +19567,8 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); fiber.lanes = lanes; return fiber; } - function createFiberFromLegacyHidden(pendingProps, mode, lanes, key) { - var fiber = createFiber(LegacyHiddenComponent, pendingProps, key, mode); + function createFiberFromLegacyHidden(pendingProps, mode, lanes, key2) { + var fiber = createFiber(LegacyHiddenComponent, pendingProps, key2, mode); { fiber.type = REACT_LEGACY_HIDDEN_TYPE; } @@ -19696,10 +19701,10 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } } function createPortal(children, containerInfo, implementation) { - var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; + var key2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; return { $$typeof: REACT_PORTAL_TYPE, - key: key == null ? null : "" + key, + key: key2 == null ? null : "" + key2, children, containerInfo, implementation @@ -19715,19 +19720,19 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); if (!parentComponent) { return emptyContextObject; } - var fiber = get(parentComponent); + var fiber = get2(parentComponent); var parentContext = findCurrentUnmaskedContext(fiber); if (fiber.tag === ClassComponent) { - var Component = fiber.type; - if (isContextProvider(Component)) { - return processChildContext(fiber, Component, parentContext); + var Component14 = fiber.type; + if (isContextProvider(Component14)) { + return processChildContext(fiber, Component14, parentContext); } } return parentContext; } function findHostInstanceWithWarning(component, methodName) { { - var fiber = get(component); + var fiber = get2(component); if (fiber === void 0) { if (typeof component.render === "function") { { @@ -19900,28 +19905,28 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); var scheduleUpdate = null; var setSuspenseHandler = null; { - var copyWithDeleteImpl = function(obj, path, index2) { - var key = path[index2]; + var copyWithDeleteImpl = function(obj, path, index3) { + var key2 = path[index3]; var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); - if (index2 + 1 === path.length) { + if (index3 + 1 === path.length) { if (Array.isArray(updated)) { - updated.splice(key, 1); + updated.splice(key2, 1); } else { - delete updated[key]; + delete updated[key2]; } return updated; } - updated[key] = copyWithDeleteImpl(obj[key], path, index2 + 1); + updated[key2] = copyWithDeleteImpl(obj[key2], path, index3 + 1); return updated; }; var copyWithDelete = function(obj, path) { return copyWithDeleteImpl(obj, path, 0); }; - var copyWithRenameImpl = function(obj, oldPath, newPath, index2) { - var oldKey = oldPath[index2]; + var copyWithRenameImpl = function(obj, oldPath, newPath, index3) { + var oldKey = oldPath[index3]; var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); - if (index2 + 1 === oldPath.length) { - var newKey = newPath[index2]; + if (index3 + 1 === oldPath.length) { + var newKey = newPath[index3]; updated[newKey] = updated[oldKey]; if (Array.isArray(updated)) { updated.splice(oldKey, 1); @@ -19929,7 +19934,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); delete updated[oldKey]; } } else { - updated[oldKey] = copyWithRenameImpl(obj[oldKey], oldPath, newPath, index2 + 1); + updated[oldKey] = copyWithRenameImpl(obj[oldKey], oldPath, newPath, index3 + 1); } return updated; }; @@ -19947,28 +19952,28 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } return copyWithRenameImpl(obj, oldPath, newPath, 0); }; - var copyWithSetImpl = function(obj, path, index2, value) { - if (index2 >= path.length) { + var copyWithSetImpl = function(obj, path, index3, value) { + if (index3 >= path.length) { return value; } - var key = path[index2]; + var key2 = path[index3]; var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); - updated[key] = copyWithSetImpl(obj[key], path, index2 + 1, value); + updated[key2] = copyWithSetImpl(obj[key2], path, index3 + 1, value); return updated; }; var copyWithSet = function(obj, path, value) { return copyWithSetImpl(obj, path, 0, value); }; - var findHook = function(fiber, id) { + var findHook = function(fiber, id2) { var currentHook2 = fiber.memoizedState; - while (currentHook2 !== null && id > 0) { + while (currentHook2 !== null && id2 > 0) { currentHook2 = currentHook2.next; - id--; + id2--; } return currentHook2; }; - overrideHookState = function(fiber, id, path, value) { - var hook = findHook(fiber, id); + overrideHookState = function(fiber, id2, path, value) { + var hook = findHook(fiber, id2); if (hook !== null) { var newState = copyWithSet(hook.memoizedState, path, value); hook.memoizedState = newState; @@ -19977,8 +19982,8 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; - overrideHookStateDeletePath = function(fiber, id, path) { - var hook = findHook(fiber, id); + overrideHookStateDeletePath = function(fiber, id2, path) { + var hook = findHook(fiber, id2); if (hook !== null) { var newState = copyWithDelete(hook.memoizedState, path); hook.memoizedState = newState; @@ -19987,8 +19992,8 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp); } }; - overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) { - var hook = findHook(fiber, id); + overrideHookStateRenamePath = function(fiber, id2, oldPath, newPath) { + var hook = findHook(fiber, id2); if (hook !== null) { var newState = copyWithRename(hook.memoizedState, oldPath, newPath); hook.memoizedState = newState; @@ -20166,12 +20171,12 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); function legacyCreateRootFromDOMContainer(container, forceHydrate) { var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); if (!shouldHydrate) { - var warned = false; + var warned2 = false; var rootSibling; while (rootSibling = container.lastChild) { { - if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) { - warned = true; + if (!warned2 && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) { + warned2 = true; error("render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup."); } } @@ -20228,7 +20233,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } return getPublicRootInstance(fiberRoot); } - function findDOMNode(componentOrElement) { + function findDOMNode2(componentOrElement) { { var owner = ReactCurrentOwner$3.current; if (owner !== null && owner.stateNode !== null) { @@ -20342,26 +20347,26 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); setRestoreImplementation(restoreControlledState$3); setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1); function createPortal$1(children, container) { - var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; + var key2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; if (!isValidContainer(container)) { { throw Error("Target container is not a DOM element."); } } - return createPortal(children, container, null, key); + return createPortal(children, container, null, key2); } function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback); } function unstable_createPortal(children, container) { - var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; + var key2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; { if (!didWarnAboutUnstableCreatePortal) { didWarnAboutUnstableCreatePortal = true; warn('The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 18+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.'); } } - return createPortal$1(children, container, key); + return createPortal$1(children, container, key2); } var Internals = { Events: [ @@ -20392,7 +20397,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = createPortal$1; - exports.findDOMNode = findDOMNode; + exports.findDOMNode = findDOMNode2; exports.flushSync = flushSync; exports.hydrate = hydrate; exports.render = render; @@ -20419,8 +20424,4433 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); } }); + // node_modules/classnames/index.js + var require_classnames = __commonJS({ + "node_modules/classnames/index.js"(exports, module) { + (function() { + "use strict"; + var hasOwn = {}.hasOwnProperty; + function classNames28() { + var classes = []; + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) + continue; + var argType = typeof arg; + if (argType === "string" || argType === "number") { + classes.push(arg); + } else if (Array.isArray(arg)) { + if (arg.length) { + var inner = classNames28.apply(null, arg); + if (inner) { + classes.push(inner); + } + } + } else if (argType === "object") { + if (arg.toString === Object.prototype.toString) { + for (var key2 in arg) { + if (hasOwn.call(arg, key2) && arg[key2]) { + classes.push(key2); + } + } + } else { + classes.push(arg.toString()); + } + } + } + return classes.join(" "); + } + if (typeof module !== "undefined" && module.exports) { + classNames28.default = classNames28; + module.exports = classNames28; + } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) { + define("classnames", [], function() { + return classNames28; + }); + } else { + window.classNames = classNames28; + } + })(); + } + }); + + // node_modules/react-is/cjs/react-is.development.js + var require_react_is_development = __commonJS({ + "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 ? Symbol.for("react.element") : 60103; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; + var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; + var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; + var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; + var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; + var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; + function isValidElementType(type2) { + return typeof type2 === "string" || typeof type2 === "function" || type2 === REACT_FRAGMENT_TYPE || type2 === REACT_CONCURRENT_MODE_TYPE || type2 === REACT_PROFILER_TYPE || type2 === REACT_STRICT_MODE_TYPE || type2 === REACT_SUSPENSE_TYPE || type2 === REACT_SUSPENSE_LIST_TYPE || typeof type2 === "object" && type2 !== null && (type2.$$typeof === REACT_LAZY_TYPE || type2.$$typeof === REACT_MEMO_TYPE || type2.$$typeof === REACT_PROVIDER_TYPE || type2.$$typeof === REACT_CONTEXT_TYPE || type2.$$typeof === REACT_FORWARD_REF_TYPE || type2.$$typeof === REACT_FUNDAMENTAL_TYPE || type2.$$typeof === REACT_RESPONDER_TYPE || type2.$$typeof === REACT_SCOPE_TYPE || type2.$$typeof === REACT_BLOCK_TYPE); + } + function typeOf(object3) { + if (typeof object3 === "object" && object3 !== null) { + var $$typeof = object3.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type2 = object3.type; + switch (type2) { + 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 type2; + default: + var $$typeofType = type2 && type2.$$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 ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment7 = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal2 = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; + function isAsyncMode(object3) { + { + 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(object3) || typeOf(object3) === REACT_ASYNC_MODE_TYPE; + } + function isConcurrentMode(object3) { + return typeOf(object3) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object3) { + return typeOf(object3) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object3) { + return typeOf(object3) === REACT_PROVIDER_TYPE; + } + function isElement(object3) { + return typeof object3 === "object" && object3 !== null && object3.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object3) { + return typeOf(object3) === REACT_FORWARD_REF_TYPE; + } + function isFragment2(object3) { + return typeOf(object3) === REACT_FRAGMENT_TYPE; + } + function isLazy(object3) { + return typeOf(object3) === REACT_LAZY_TYPE; + } + function isMemo2(object3) { + return typeOf(object3) === REACT_MEMO_TYPE; + } + function isPortal(object3) { + return typeOf(object3) === REACT_PORTAL_TYPE; + } + function isProfiler(object3) { + return typeOf(object3) === REACT_PROFILER_TYPE; + } + function isStrictMode(object3) { + return typeOf(object3) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object3) { + return typeOf(object3) === REACT_SUSPENSE_TYPE; + } + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element2; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment7; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal2; + 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 = isFragment2; + exports.isLazy = isLazy; + exports.isMemo = isMemo2; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; + })(); + } + } + }); + + // node_modules/react-is/index.js + var require_react_is = __commonJS({ + "node_modules/react-is/index.js"(exports, module) { + "use strict"; + if (false) { + module.exports = null; + } else { + module.exports = require_react_is_development(); + } + } + }); + + // node_modules/regenerator-runtime/runtime.js + var require_runtime = __commonJS({ + "node_modules/regenerator-runtime/runtime.js"(exports, module) { + var runtime = function(exports2) { + "use strict"; + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined2; + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + function define3(obj, key2, value) { + Object.defineProperty(obj, key2, { + value, + enumerable: true, + configurable: true, + writable: true + }); + return obj[key2]; + } + try { + define3({}, ""); + } catch (err) { + define3 = function(obj, key2, value) { + return obj[key2] = value; + }; + } + function wrap(innerFn, outerFn, self2, tryLocsList) { + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context2(tryLocsList || []); + generator._invoke = makeInvokeMethod(innerFn, self2, context); + return generator; + } + exports2.wrap = wrap; + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + var ContinueSentinel = {}; + function Generator() { + } + function GeneratorFunction() { + } + function GeneratorFunctionPrototype() { + } + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function() { + return this; + }; + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + IteratorPrototype = NativeIteratorPrototype; + } + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = define3(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method3) { + define3(prototype, method3, function(arg) { + return this._invoke(method3, arg); + }); + }); + } + exports2.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; + }; + exports2.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + define3(genFun, toStringTagSymbol, "GeneratorFunction"); + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + exports2.awrap = function(arg) { + return { __await: arg }; + }; + function AsyncIterator(generator, PromiseImpl) { + function invoke(method3, arg, resolve, reject) { + var record = tryCatch(generator[method3], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && typeof value === "object" && hasOwn.call(value, "__await")) { + return PromiseImpl.resolve(value.__await).then(function(value2) { + invoke("next", value2, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + return PromiseImpl.resolve(value).then(function(unwrapped) { + result.value = unwrapped; + resolve(result); + }, function(error) { + return invoke("throw", error, resolve, reject); + }); + } + } + var previousPromise; + function enqueue(method3, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function(resolve, reject) { + invoke(method3, arg, resolve, reject); + }); + } + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + this._invoke = enqueue; + } + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function() { + return this; + }; + exports2.AsyncIterator = AsyncIterator; + exports2.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) { + if (PromiseImpl === void 0) + PromiseImpl = Promise; + var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl); + return exports2.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + function makeInvokeMethod(innerFn, self2, context) { + var state = GenStateSuspendedStart; + return function invoke(method3, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + if (state === GenStateCompleted) { + if (method3 === "throw") { + throw arg; + } + return doneResult(); + } + context.method = method3; + context.arg = arg; + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) + continue; + return delegateResult; + } + } + if (context.method === "next") { + context.sent = context._sent = context.arg; + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + context.dispatchException(context.arg); + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + state = GenStateExecuting; + var record = tryCatch(innerFn, self2, context); + if (record.type === "normal") { + state = context.done ? GenStateCompleted : GenStateSuspendedYield; + if (record.arg === ContinueSentinel) { + continue; + } + return { + value: record.arg, + done: context.done + }; + } else if (record.type === "throw") { + state = GenStateCompleted; + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + function maybeInvokeDelegate(delegate, context) { + var method3 = delegate.iterator[context.method]; + if (method3 === undefined2) { + context.delegate = null; + if (context.method === "throw") { + if (delegate.iterator["return"]) { + context.method = "return"; + context.arg = undefined2; + maybeInvokeDelegate(delegate, context); + if (context.method === "throw") { + return ContinueSentinel; + } + } + context.method = "throw"; + context.arg = new TypeError("The iterator does not provide a 'throw' method"); + } + return ContinueSentinel; + } + var record = tryCatch(method3, delegate.iterator, context.arg); + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + var info = record.arg; + if (!info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined2; + } + } else { + return info; + } + context.delegate = null; + return ContinueSentinel; + } + defineIteratorMethods(Gp); + define3(Gp, toStringTagSymbol, "Generator"); + Gp[iteratorSymbol] = function() { + return this; + }; + Gp.toString = function() { + return "[object Generator]"; + }; + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + if (1 in locs) { + entry.catchLoc = locs[1]; + } + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + this.tryEntries.push(entry); + } + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + function Context2(tryLocsList) { + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + exports2.keys = function(object3) { + var keys = []; + for (var key2 in object3) { + keys.push(key2); + } + keys.reverse(); + return function next() { + while (keys.length) { + var key3 = keys.pop(); + if (key3 in object3) { + next.value = key3; + next.done = false; + return next; + } + } + next.done = true; + return next; + }; + }; + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + if (typeof iterable.next === "function") { + return iterable; + } + if (!isNaN(iterable.length)) { + var i = -1, next = function next2() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next2.value = iterable[i]; + next2.done = false; + return next2; + } + } + next2.value = undefined2; + next2.done = true; + return next2; + }; + return next.next = next; + } + } + return { next: doneResult }; + } + exports2.values = values; + function doneResult() { + return { value: undefined2, done: true }; + } + Context2.prototype = { + constructor: Context2, + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = this._sent = undefined2; + this.done = false; + this.delegate = null; + this.method = "next"; + this.arg = undefined2; + this.tryEntries.forEach(resetTryEntry); + if (!skipTempReset) { + for (var name in this) { + if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { + this[name] = undefined2; + } + } + } + }, + stop: function() { + this.done = true; + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + return this.rval; + }, + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + if (caught) { + context.method = "next"; + context.arg = undefined2; + } + return !!caught; + } + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + if (entry.tryLoc === "root") { + return handle("end"); + } + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + abrupt: function(type2, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + if (finallyEntry && (type2 === "break" || type2 === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { + finallyEntry = null; + } + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type2; + record.arg = arg; + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + return this.complete(record); + }, + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + if (record.type === "break" || record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + return ContinueSentinel; + }, + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName, + nextLoc + }; + if (this.method === "next") { + this.arg = undefined2; + } + return ContinueSentinel; + } + }; + return exports2; + }(typeof module === "object" ? module.exports : {}); + try { + regeneratorRuntime = runtime; + } catch (accidentalStrictMode) { + Function("r", "regeneratorRuntime = r")(runtime); + } + } + }); + + // node_modules/@babel/runtime/regenerator/index.js + var require_regenerator = __commonJS({ + "node_modules/@babel/runtime/regenerator/index.js"(exports, module) { + module.exports = require_runtime(); + } + }); + + // node_modules/shallowequal/index.js + var require_shallowequal = __commonJS({ + "node_modules/shallowequal/index.js"(exports, module) { + module.exports = function shallowEqual2(objA, objB, compare, compareContext) { + var ret = compare ? compare.call(compareContext, objA, objB) : void 0; + if (ret !== void 0) { + return !!ret; + } + if (objA === objB) { + return true; + } + if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) { + return false; + } + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); + if (keysA.length !== keysB.length) { + return false; + } + var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); + for (var idx = 0; idx < keysA.length; idx++) { + var key2 = keysA[idx]; + if (!bHasOwnProperty(key2)) { + return false; + } + var valueA = objA[key2]; + var valueB = objB[key2]; + ret = compare ? compare.call(compareContext, valueA, valueB, key2) : void 0; + if (ret === false || ret === void 0 && valueA !== valueB) { + return false; + } + } + return true; + }; + } + }); + + // node_modules/moment/moment.js + var require_moment = __commonJS({ + "node_modules/moment/moment.js"(exports, module) { + (function(global2, factory) { + typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.moment = factory(); + })(exports, function() { + "use strict"; + var hookCallback; + function hooks() { + return hookCallback.apply(null, arguments); + } + function setHookCallback(callback) { + hookCallback = callback; + } + function isArray(input) { + return input instanceof Array || Object.prototype.toString.call(input) === "[object Array]"; + } + function isObject2(input) { + return input != null && Object.prototype.toString.call(input) === "[object Object]"; + } + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + function isObjectEmpty(obj) { + if (Object.getOwnPropertyNames) { + return Object.getOwnPropertyNames(obj).length === 0; + } else { + var k; + for (k in obj) { + if (hasOwnProp(obj, k)) { + return false; + } + } + return true; + } + } + function isUndefined(input) { + return input === void 0; + } + function isNumber(input) { + return typeof input === "number" || Object.prototype.toString.call(input) === "[object Number]"; + } + function isDate(input) { + return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]"; + } + function map(arr, fn) { + var res = [], i; + for (i = 0; i < arr.length; ++i) { + res.push(fn(arr[i], i)); + } + return res; + } + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; + } + } + if (hasOwnProp(b, "toString")) { + a.toString = b.toString; + } + if (hasOwnProp(b, "valueOf")) { + a.valueOf = b.valueOf; + } + return a; + } + function createUTC(input, format4, locale5, strict) { + return createLocalOrUTC(input, format4, locale5, strict, true).utc(); + } + function defaultParsingFlags() { + return { + empty: false, + unusedTokens: [], + unusedInput: [], + overflow: -2, + charsLeftOver: 0, + nullInput: false, + invalidEra: null, + invalidMonth: null, + invalidFormat: false, + userInvalidated: false, + iso: false, + parsedDateParts: [], + era: null, + meridiem: null, + rfc2822: false, + weekdayMismatch: false + }; + } + function getParsingFlags(m) { + if (m._pf == null) { + m._pf = defaultParsingFlags(); + } + return m._pf; + } + var some; + if (Array.prototype.some) { + some = Array.prototype.some; + } else { + some = function(fun) { + var t = Object(this), len = t.length >>> 0, i; + for (i = 0; i < len; i++) { + if (i in t && fun.call(this, t[i], i, t)) { + return true; + } + } + return false; + }; + } + function isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m), parsedParts = some.call(flags.parsedDateParts, function(i) { + return i != null; + }), isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts); + if (m._strict) { + isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0; + } + if (Object.isFrozen == null || !Object.isFrozen(m)) { + m._isValid = isNowValid; + } else { + return isNowValid; + } + } + return m._isValid; + } + function createInvalid(flags) { + var m = createUTC(NaN); + if (flags != null) { + extend(getParsingFlags(m), flags); + } else { + getParsingFlags(m).userInvalidated = true; + } + return m; + } + var momentProperties = hooks.momentProperties = [], updateInProgress = false; + function copyConfig(to2, from2) { + var i, prop, val; + if (!isUndefined(from2._isAMomentObject)) { + to2._isAMomentObject = from2._isAMomentObject; + } + if (!isUndefined(from2._i)) { + to2._i = from2._i; + } + if (!isUndefined(from2._f)) { + to2._f = from2._f; + } + if (!isUndefined(from2._l)) { + to2._l = from2._l; + } + if (!isUndefined(from2._strict)) { + to2._strict = from2._strict; + } + if (!isUndefined(from2._tzm)) { + to2._tzm = from2._tzm; + } + if (!isUndefined(from2._isUTC)) { + to2._isUTC = from2._isUTC; + } + if (!isUndefined(from2._offset)) { + to2._offset = from2._offset; + } + if (!isUndefined(from2._pf)) { + to2._pf = getParsingFlags(from2); + } + if (!isUndefined(from2._locale)) { + to2._locale = from2._locale; + } + if (momentProperties.length > 0) { + for (i = 0; i < momentProperties.length; i++) { + prop = momentProperties[i]; + val = from2[prop]; + if (!isUndefined(val)) { + to2[prop] = val; + } + } + } + return to2; + } + function Moment(config) { + copyConfig(this, config); + this._d = new Date(config._d != null ? config._d.getTime() : NaN); + if (!this.isValid()) { + this._d = new Date(NaN); + } + if (updateInProgress === false) { + updateInProgress = true; + hooks.updateOffset(this); + updateInProgress = false; + } + } + function isMoment(obj) { + return obj instanceof Moment || obj != null && obj._isAMomentObject != null; + } + function warn(msg) { + if (hooks.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) { + console.warn("Deprecation warning: " + msg); + } + } + function deprecate(msg, fn) { + var firstTime = true; + return extend(function() { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(null, msg); + } + if (firstTime) { + var args = [], arg, i, key2; + for (i = 0; i < arguments.length; i++) { + arg = ""; + if (typeof arguments[i] === "object") { + arg += "\n[" + i + "] "; + for (key2 in arguments[0]) { + if (hasOwnProp(arguments[0], key2)) { + arg += key2 + ": " + arguments[0][key2] + ", "; + } + } + arg = arg.slice(0, -2); + } else { + arg = arguments[i]; + } + args.push(arg); + } + warn(msg + "\nArguments: " + Array.prototype.slice.call(args).join("") + "\n" + new Error().stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + var deprecations = {}; + function deprecateSimple(name, msg) { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(name, msg); + } + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + hooks.suppressDeprecationWarnings = false; + hooks.deprecationHandler = null; + function isFunction(input) { + return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]"; + } + function set2(config) { + var prop, i; + for (i in config) { + if (hasOwnProp(config, i)) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this["_" + i] = prop; + } + } + } + this._config = config; + this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source); + } + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject2(parentConfig[prop]) && isObject2(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + for (prop in parentConfig) { + if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject2(parentConfig[prop])) { + res[prop] = extend({}, res[prop]); + } + } + return res; + } + function Locale(config) { + if (config != null) { + this.set(config); + } + } + var keys; + if (Object.keys) { + keys = Object.keys; + } else { + keys = function(obj) { + var i, res = []; + for (i in obj) { + if (hasOwnProp(obj, i)) { + res.push(i); + } + } + return res; + }; + } + var defaultCalendar = { + sameDay: "[Today at] LT", + nextDay: "[Tomorrow at] LT", + nextWeek: "dddd [at] LT", + lastDay: "[Yesterday at] LT", + lastWeek: "[Last] dddd [at] LT", + sameElse: "L" + }; + function calendar(key2, mom, now3) { + var output = this._calendar[key2] || this._calendar["sameElse"]; + return isFunction(output) ? output.call(mom, now3) : output; + } + function zeroFill(number3, targetLength, forceSign) { + var absNumber = "" + Math.abs(number3), zerosToFill = targetLength - absNumber.length, sign2 = number3 >= 0; + return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; + } + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; + function addFormatToken(token2, padded, ordinal2, callback) { + var func = callback; + if (typeof callback === "string") { + func = function() { + return this[callback](); + }; + } + if (token2) { + formatTokenFunctions[token2] = func; + } + if (padded) { + formatTokenFunctions[padded[0]] = function() { + return zeroFill(func.apply(this, arguments), padded[1], padded[2]); + }; + } + if (ordinal2) { + formatTokenFunctions[ordinal2] = function() { + return this.localeData().ordinal(func.apply(this, arguments), token2); + }; + } + } + function removeFormattingTokens(input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|\]$/g, ""); + } + return input.replace(/\\/g, ""); + } + function makeFormatFunction(format4) { + var array3 = format4.match(formattingTokens), i, length; + for (i = 0, length = array3.length; i < length; i++) { + if (formatTokenFunctions[array3[i]]) { + array3[i] = formatTokenFunctions[array3[i]]; + } else { + array3[i] = removeFormattingTokens(array3[i]); + } + } + return function(mom) { + var output = "", i2; + for (i2 = 0; i2 < length; i2++) { + output += isFunction(array3[i2]) ? array3[i2].call(mom, format4) : array3[i2]; + } + return output; + }; + } + function formatMoment(m, format4) { + if (!m.isValid()) { + return m.localeData().invalidDate(); + } + format4 = expandFormat(format4, m.localeData()); + formatFunctions[format4] = formatFunctions[format4] || makeFormatFunction(format4); + return formatFunctions[format4](m); + } + function expandFormat(format4, locale5) { + var i = 5; + function replaceLongDateFormatTokens(input) { + return locale5.longDateFormat(input) || input; + } + localFormattingTokens.lastIndex = 0; + while (i >= 0 && localFormattingTokens.test(format4)) { + format4 = format4.replace(localFormattingTokens, replaceLongDateFormatTokens); + localFormattingTokens.lastIndex = 0; + i -= 1; + } + return format4; + } + var defaultLongDateFormat = { + LTS: "h:mm:ss A", + LT: "h:mm A", + L: "MM/DD/YYYY", + LL: "MMMM D, YYYY", + LLL: "MMMM D, YYYY h:mm A", + LLLL: "dddd, MMMM D, YYYY h:mm A" + }; + function longDateFormat(key2) { + var format4 = this._longDateFormat[key2], formatUpper = this._longDateFormat[key2.toUpperCase()]; + if (format4 || !formatUpper) { + return format4; + } + this._longDateFormat[key2] = formatUpper.match(formattingTokens).map(function(tok) { + if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") { + return tok.slice(1); + } + return tok; + }).join(""); + return this._longDateFormat[key2]; + } + var defaultInvalidDate = "Invalid date"; + function invalidDate() { + return this._invalidDate; + } + var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/; + function ordinal(number3) { + return this._ordinal.replace("%d", number3); + } + var defaultRelativeTime = { + future: "in %s", + past: "%s ago", + s: "a few seconds", + ss: "%d seconds", + m: "a minute", + mm: "%d minutes", + h: "an hour", + hh: "%d hours", + d: "a day", + dd: "%d days", + w: "a week", + ww: "%d weeks", + M: "a month", + MM: "%d months", + y: "a year", + yy: "%d years" + }; + function relativeTime(number3, withoutSuffix, string2, isFuture) { + var output = this._relativeTime[string2]; + return isFunction(output) ? output(number3, withoutSuffix, string2, isFuture) : output.replace(/%d/i, number3); + } + function pastFuture(diff2, output) { + var format4 = this._relativeTime[diff2 > 0 ? "future" : "past"]; + return isFunction(format4) ? format4(output) : format4.replace(/%s/i, output); + } + var aliases = {}; + function addUnitAlias(unit, shorthand) { + var lowerCase = unit.toLowerCase(); + aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit; + } + function normalizeUnits(units) { + return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0; + } + function normalizeObjectUnits(inputObject) { + var normalizedInput = {}, normalizedProp, prop; + for (prop in inputObject) { + if (hasOwnProp(inputObject, prop)) { + normalizedProp = normalizeUnits(prop); + if (normalizedProp) { + normalizedInput[normalizedProp] = inputObject[prop]; + } + } + } + return normalizedInput; + } + var priorities = {}; + function addUnitPriority(unit, priority) { + priorities[unit] = priority; + } + function getPrioritizedUnits(unitsObj) { + var units = [], u; + for (u in unitsObj) { + if (hasOwnProp(unitsObj, u)) { + units.push({ unit: u, priority: priorities[u] }); + } + } + units.sort(function(a, b) { + return a.priority - b.priority; + }); + return units; + } + function isLeapYear(year) { + return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; + } + function absFloor(number3) { + if (number3 < 0) { + return Math.ceil(number3) || 0; + } else { + return Math.floor(number3); + } + } + function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, value = 0; + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + return value; + } + function makeGetSet(unit, keepTime) { + return function(value) { + if (value != null) { + set$1(this, unit, value); + hooks.updateOffset(this, keepTime); + return this; + } else { + return get2(this, unit); + } + }; + } + function get2(mom, unit) { + return mom.isValid() ? mom._d["get" + (mom._isUTC ? "UTC" : "") + unit]() : NaN; + } + function set$1(mom, unit, value) { + if (mom.isValid() && !isNaN(value)) { + if (unit === "FullYear" && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { + value = toInt(value); + mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value, mom.month(), daysInMonth(value, mom.month())); + } else { + mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value); + } + } + } + function stringGet(units) { + units = normalizeUnits(units); + if (isFunction(this[units])) { + return this[units](); + } + return this; + } + function stringSet(units, value) { + if (typeof units === "object") { + units = normalizeObjectUnits(units); + var prioritized = getPrioritizedUnits(units), i; + for (i = 0; i < prioritized.length; i++) { + this[prioritized[i].unit](units[prioritized[i].unit]); + } + } else { + units = normalizeUnits(units); + if (isFunction(this[units])) { + return this[units](value); + } + } + return this; + } + var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, regexes; + regexes = {}; + function addRegexToken(token2, regex, strictRegex) { + regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) { + return isStrict && strictRegex ? strictRegex : regex; + }; + } + function getParseRegexForToken(token2, config) { + if (!hasOwnProp(regexes, token2)) { + return new RegExp(unescapeFormat(token2)); + } + return regexes[token2](config._strict, config._locale); + } + function unescapeFormat(s) { + return regexEscape(s.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + })); + } + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); + } + var tokens = {}; + function addParseToken(token2, callback) { + var i, func = callback; + if (typeof token2 === "string") { + token2 = [token2]; + } + if (isNumber(callback)) { + func = function(input, array3) { + array3[callback] = toInt(input); + }; + } + for (i = 0; i < token2.length; i++) { + tokens[token2[i]] = func; + } + } + function addWeekParseToken(token2, callback) { + addParseToken(token2, function(input, array3, config, token3) { + config._w = config._w || {}; + callback(input, config._w, config, token3); + }); + } + function addTimeToArrayFromToken(token2, input, config) { + if (input != null && hasOwnProp(tokens, token2)) { + tokens[token2](input, config._a, config, token2); + } + } + var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; + function mod(n, x) { + return (n % x + x) % x; + } + var indexOf; + if (Array.prototype.indexOf) { + indexOf = Array.prototype.indexOf; + } else { + indexOf = function(o) { + var i; + for (i = 0; i < this.length; ++i) { + if (this[i] === o) { + return i; + } + } + return -1; + }; + } + function daysInMonth(year, month) { + if (isNaN(year) || isNaN(month)) { + return NaN; + } + var modMonth = mod(month, 12); + year += (month - modMonth) / 12; + return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2; + } + addFormatToken("M", ["MM", 2], "Mo", function() { + return this.month() + 1; + }); + addFormatToken("MMM", 0, 0, function(format4) { + return this.localeData().monthsShort(this, format4); + }); + addFormatToken("MMMM", 0, 0, function(format4) { + return this.localeData().months(this, format4); + }); + addUnitAlias("month", "M"); + addUnitPriority("month", 8); + addRegexToken("M", match1to2); + addRegexToken("MM", match1to2, match2); + addRegexToken("MMM", function(isStrict, locale5) { + return locale5.monthsShortRegex(isStrict); + }); + addRegexToken("MMMM", function(isStrict, locale5) { + return locale5.monthsRegex(isStrict); + }); + addParseToken(["M", "MM"], function(input, array3) { + array3[MONTH] = toInt(input) - 1; + }); + addParseToken(["MMM", "MMMM"], function(input, array3, config, token2) { + var month = config._locale.monthsParse(input, token2, config._strict); + if (month != null) { + array3[MONTH] = month; + } else { + getParsingFlags(config).invalidMonth = input; + } + }); + var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; + function localeMonths(m, format4) { + if (!m) { + return isArray(this._months) ? this._months : this._months["standalone"]; + } + return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format4) ? "format" : "standalone"][m.month()]; + } + function localeMonthsShort(m, format4) { + if (!m) { + return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort["standalone"]; + } + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format4) ? "format" : "standalone"][m.month()]; + } + function handleStrictParse(monthName, format4, strict) { + var i, ii, mom, llc = monthName.toLocaleLowerCase(); + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + for (i = 0; i < 12; ++i) { + mom = createUTC([2e3, i]); + this._shortMonthsParse[i] = this.monthsShort(mom, "").toLocaleLowerCase(); + this._longMonthsParse[i] = this.months(mom, "").toLocaleLowerCase(); + } + } + if (strict) { + if (format4 === "MMM") { + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format4 === "MMM") { + ii = indexOf.call(this._shortMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } + } + function localeMonthsParse(monthName, format4, strict) { + var i, mom, regex; + if (this._monthsParseExact) { + return handleStrictParse.call(this, monthName, format4, strict); + } + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + } + for (i = 0; i < 12; i++) { + mom = createUTC([2e3, i]); + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp("^" + this.months(mom, "").replace(".", "") + "$", "i"); + this._shortMonthsParse[i] = new RegExp("^" + this.monthsShort(mom, "").replace(".", "") + "$", "i"); + } + if (!strict && !this._monthsParse[i]) { + regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, ""); + this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i"); + } + if (strict && format4 === "MMMM" && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format4 === "MMM" && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { + return i; + } + } + } + function setMonth2(mom, value) { + var dayOfMonth; + if (!mom.isValid()) { + return mom; + } + if (typeof value === "string") { + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + if (!isNumber(value)) { + return mom; + } + } + } + dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); + mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth); + return mom; + } + function getSetMonth(value) { + if (value != null) { + setMonth2(this, value); + hooks.updateOffset(this, true); + return this; + } else { + return get2(this, "Month"); + } + } + function getDaysInMonth() { + return daysInMonth(this.year(), this.month()); + } + function monthsShortRegex(isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, "_monthsRegex")) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + if (!hasOwnProp(this, "_monthsShortRegex")) { + this._monthsShortRegex = defaultMonthsShortRegex; + } + return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + function monthsRegex(isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, "_monthsRegex")) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + if (!hasOwnProp(this, "_monthsRegex")) { + this._monthsRegex = defaultMonthsRegex; + } + return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; + } + } + function computeMonthsParse() { + function cmpLenRev(a, b) { + return b.length - a.length; + } + var shortPieces = [], longPieces = [], mixedPieces = [], i, mom; + for (i = 0; i < 12; i++) { + mom = createUTC([2e3, i]); + shortPieces.push(this.monthsShort(mom, "")); + longPieces.push(this.months(mom, "")); + mixedPieces.push(this.months(mom, "")); + mixedPieces.push(this.monthsShort(mom, "")); + } + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + } + for (i = 0; i < 24; i++) { + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i"); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp("^(" + longPieces.join("|") + ")", "i"); + this._monthsShortStrictRegex = new RegExp("^(" + shortPieces.join("|") + ")", "i"); + } + addFormatToken("Y", 0, 0, function() { + var y = this.year(); + return y <= 9999 ? zeroFill(y, 4) : "+" + y; + }); + addFormatToken(0, ["YY", 2], 0, function() { + return this.year() % 100; + }); + addFormatToken(0, ["YYYY", 4], 0, "year"); + addFormatToken(0, ["YYYYY", 5], 0, "year"); + addFormatToken(0, ["YYYYYY", 6, true], 0, "year"); + addUnitAlias("year", "y"); + addUnitPriority("year", 1); + addRegexToken("Y", matchSigned); + addRegexToken("YY", match1to2, match2); + addRegexToken("YYYY", match1to4, match4); + addRegexToken("YYYYY", match1to6, match6); + addRegexToken("YYYYYY", match1to6, match6); + addParseToken(["YYYYY", "YYYYYY"], YEAR); + addParseToken("YYYY", function(input, array3) { + array3[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken("YY", function(input, array3) { + array3[YEAR] = hooks.parseTwoDigitYear(input); + }); + addParseToken("Y", function(input, array3) { + array3[YEAR] = parseInt(input, 10); + }); + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + hooks.parseTwoDigitYear = function(input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3); + }; + var getSetYear = makeGetSet("FullYear", true); + function getIsLeapYear() { + return isLeapYear(this.year()); + } + function createDate(y, m, d, h, M, s, ms) { + var date3; + if (y < 100 && y >= 0) { + date3 = new Date(y + 400, m, d, h, M, s, ms); + if (isFinite(date3.getFullYear())) { + date3.setFullYear(y); + } + } else { + date3 = new Date(y, m, d, h, M, s, ms); + } + return date3; + } + function createUTCDate(y) { + var date3, args; + if (y < 100 && y >= 0) { + args = Array.prototype.slice.call(arguments); + args[0] = y + 400; + date3 = new Date(Date.UTC.apply(null, args)); + if (isFinite(date3.getUTCFullYear())) { + date3.setUTCFullYear(y); + } + } else { + date3 = new Date(Date.UTC.apply(null, arguments)); + } + return date3; + } + function firstWeekOffset(year, dow, doy) { + var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + return -fwdlw + fwd - 1; + } + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; + } + return { + year: resYear, + dayOfYear: resDayOfYear + }; + } + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + return { + week: resWeek, + year: resYear + }; + } + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; + } + addFormatToken("w", ["ww", 2], "wo", "week"); + addFormatToken("W", ["WW", 2], "Wo", "isoWeek"); + addUnitAlias("week", "w"); + addUnitAlias("isoWeek", "W"); + addUnitPriority("week", 5); + addUnitPriority("isoWeek", 5); + addRegexToken("w", match1to2); + addRegexToken("ww", match1to2, match2); + addRegexToken("W", match1to2); + addRegexToken("WW", match1to2, match2); + addWeekParseToken(["w", "ww", "W", "WW"], function(input, week, config, token2) { + week[token2.substr(0, 1)] = toInt(input); + }); + function localeWeek(mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + var defaultLocaleWeek = { + dow: 0, + doy: 6 + }; + function localeFirstDayOfWeek() { + return this._week.dow; + } + function localeFirstDayOfYear() { + return this._week.doy; + } + function getSetWeek(input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, "d"); + } + function getSetISOWeek(input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, "d"); + } + addFormatToken("d", 0, "do", "day"); + addFormatToken("dd", 0, 0, function(format4) { + return this.localeData().weekdaysMin(this, format4); + }); + addFormatToken("ddd", 0, 0, function(format4) { + return this.localeData().weekdaysShort(this, format4); + }); + addFormatToken("dddd", 0, 0, function(format4) { + return this.localeData().weekdays(this, format4); + }); + addFormatToken("e", 0, 0, "weekday"); + addFormatToken("E", 0, 0, "isoWeekday"); + addUnitAlias("day", "d"); + addUnitAlias("weekday", "e"); + addUnitAlias("isoWeekday", "E"); + addUnitPriority("day", 11); + addUnitPriority("weekday", 11); + addUnitPriority("isoWeekday", 11); + addRegexToken("d", match1to2); + addRegexToken("e", match1to2); + addRegexToken("E", match1to2); + addRegexToken("dd", function(isStrict, locale5) { + return locale5.weekdaysMinRegex(isStrict); + }); + addRegexToken("ddd", function(isStrict, locale5) { + return locale5.weekdaysShortRegex(isStrict); + }); + addRegexToken("dddd", function(isStrict, locale5) { + return locale5.weekdaysRegex(isStrict); + }); + addWeekParseToken(["dd", "ddd", "dddd"], function(input, week, config, token2) { + var weekday = config._locale.weekdaysParse(input, token2, config._strict); + if (weekday != null) { + week.d = weekday; + } else { + getParsingFlags(config).invalidWeekday = input; + } + }); + addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) { + week[token2] = toInt(input); + }); + function parseWeekday(input, locale5) { + if (typeof input !== "string") { + return input; + } + if (!isNaN(input)) { + return parseInt(input, 10); + } + input = locale5.weekdaysParse(input); + if (typeof input === "number") { + return input; + } + return null; + } + function parseIsoWeekday(input, locale5) { + if (typeof input === "string") { + return locale5.weekdaysParse(input) % 7 || 7; + } + return isNaN(input) ? null : input; + } + function shiftWeekdays(ws, n) { + return ws.slice(n, 7).concat(ws.slice(0, n)); + } + var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; + function localeWeekdays(m, format4) { + var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format4) ? "format" : "standalone"]; + return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; + } + function localeWeekdaysShort(m) { + return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; + } + function localeWeekdaysMin(m) { + return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; + } + function handleStrictParse$1(weekdayName, format4, strict) { + var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._shortWeekdaysParse = []; + this._minWeekdaysParse = []; + for (i = 0; i < 7; ++i) { + mom = createUTC([2e3, 1]).day(i); + this._minWeekdaysParse[i] = this.weekdaysMin(mom, "").toLocaleLowerCase(); + this._shortWeekdaysParse[i] = this.weekdaysShort(mom, "").toLocaleLowerCase(); + this._weekdaysParse[i] = this.weekdays(mom, "").toLocaleLowerCase(); + } + } + if (strict) { + if (format4 === "dddd") { + ii = indexOf.call(this._weekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format4 === "ddd") { + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format4 === "dddd") { + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format4 === "ddd") { + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } + } + function localeWeekdaysParse(weekdayName, format4, strict) { + var i, mom, regex; + if (this._weekdaysParseExact) { + return handleStrictParse$1.call(this, weekdayName, format4, strict); + } + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } + for (i = 0; i < 7; i++) { + mom = createUTC([2e3, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp("^" + this.weekdays(mom, "").replace(".", "\\.?") + "$", "i"); + this._shortWeekdaysParse[i] = new RegExp("^" + this.weekdaysShort(mom, "").replace(".", "\\.?") + "$", "i"); + this._minWeekdaysParse[i] = new RegExp("^" + this.weekdaysMin(mom, "").replace(".", "\\.?") + "$", "i"); + } + if (!this._weekdaysParse[i]) { + regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, ""); + this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i"); + } + if (strict && format4 === "dddd" && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format4 === "ddd" && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format4 === "dd" && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { + return i; + } + } + } + function getSetDayOfWeek(input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + if (input != null) { + input = parseWeekday(input, this.localeData()); + return this.add(input - day, "d"); + } else { + return day; + } + } + function getSetLocaleDayOfWeek(input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, "d"); + } + function getSetISODayOfWeek(input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + if (input != null) { + var weekday = parseIsoWeekday(input, this.localeData()); + return this.day(this.day() % 7 ? weekday : weekday - 7); + } else { + return this.day() || 7; + } + } + function weekdaysRegex(isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, "_weekdaysRegex")) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysStrictRegex; + } else { + return this._weekdaysRegex; + } + } else { + if (!hasOwnProp(this, "_weekdaysRegex")) { + this._weekdaysRegex = defaultWeekdaysRegex; + } + return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; + } + } + function weekdaysShortRegex(isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, "_weekdaysRegex")) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysShortStrictRegex; + } else { + return this._weekdaysShortRegex; + } + } else { + if (!hasOwnProp(this, "_weekdaysShortRegex")) { + this._weekdaysShortRegex = defaultWeekdaysShortRegex; + } + return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; + } + } + function weekdaysMinRegex(isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, "_weekdaysRegex")) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysMinStrictRegex; + } else { + return this._weekdaysMinRegex; + } + } else { + if (!hasOwnProp(this, "_weekdaysMinRegex")) { + this._weekdaysMinRegex = defaultWeekdaysMinRegex; + } + return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; + } + } + function computeWeekdaysParse() { + function cmpLenRev(a, b) { + return b.length - a.length; + } + var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; + for (i = 0; i < 7; i++) { + mom = createUTC([2e3, 1]).day(i); + minp = regexEscape(this.weekdaysMin(mom, "")); + shortp = regexEscape(this.weekdaysShort(mom, "")); + longp = regexEscape(this.weekdays(mom, "")); + minPieces.push(minp); + shortPieces.push(shortp); + longPieces.push(longp); + mixedPieces.push(minp); + mixedPieces.push(shortp); + mixedPieces.push(longp); + } + minPieces.sort(cmpLenRev); + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + this._weekdaysRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i"); + this._weekdaysShortRegex = this._weekdaysRegex; + this._weekdaysMinRegex = this._weekdaysRegex; + this._weekdaysStrictRegex = new RegExp("^(" + longPieces.join("|") + ")", "i"); + this._weekdaysShortStrictRegex = new RegExp("^(" + shortPieces.join("|") + ")", "i"); + this._weekdaysMinStrictRegex = new RegExp("^(" + minPieces.join("|") + ")", "i"); + } + function hFormat() { + return this.hours() % 12 || 12; + } + function kFormat() { + return this.hours() || 24; + } + addFormatToken("H", ["HH", 2], 0, "hour"); + addFormatToken("h", ["hh", 2], 0, hFormat); + addFormatToken("k", ["kk", 2], 0, kFormat); + addFormatToken("hmm", 0, 0, function() { + return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + addFormatToken("hmmss", 0, 0, function() { + return "" + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); + }); + addFormatToken("Hmm", 0, 0, function() { + return "" + this.hours() + zeroFill(this.minutes(), 2); + }); + addFormatToken("Hmmss", 0, 0, function() { + return "" + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); + }); + function meridiem(token2, lowercase) { + addFormatToken(token2, 0, 0, function() { + return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); + }); + } + meridiem("a", true); + meridiem("A", false); + addUnitAlias("hour", "h"); + addUnitPriority("hour", 13); + function matchMeridiem(isStrict, locale5) { + return locale5._meridiemParse; + } + addRegexToken("a", matchMeridiem); + addRegexToken("A", matchMeridiem); + addRegexToken("H", match1to2); + addRegexToken("h", match1to2); + addRegexToken("k", match1to2); + addRegexToken("HH", match1to2, match2); + addRegexToken("hh", match1to2, match2); + addRegexToken("kk", match1to2, match2); + addRegexToken("hmm", match3to4); + addRegexToken("hmmss", match5to6); + addRegexToken("Hmm", match3to4); + addRegexToken("Hmmss", match5to6); + addParseToken(["H", "HH"], HOUR); + addParseToken(["k", "kk"], function(input, array3, config) { + var kInput = toInt(input); + array3[HOUR] = kInput === 24 ? 0 : kInput; + }); + addParseToken(["a", "A"], function(input, array3, config) { + config._isPm = config._locale.isPM(input); + config._meridiem = input; + }); + addParseToken(["h", "hh"], function(input, array3, config) { + array3[HOUR] = toInt(input); + getParsingFlags(config).bigHour = true; + }); + addParseToken("hmm", function(input, array3, config) { + var pos = input.length - 2; + array3[HOUR] = toInt(input.substr(0, pos)); + array3[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken("hmmss", function(input, array3, config) { + var pos1 = input.length - 4, pos2 = input.length - 2; + array3[HOUR] = toInt(input.substr(0, pos1)); + array3[MINUTE] = toInt(input.substr(pos1, 2)); + array3[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken("Hmm", function(input, array3, config) { + var pos = input.length - 2; + array3[HOUR] = toInt(input.substr(0, pos)); + array3[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken("Hmmss", function(input, array3, config) { + var pos1 = input.length - 4, pos2 = input.length - 2; + array3[HOUR] = toInt(input.substr(0, pos1)); + array3[MINUTE] = toInt(input.substr(pos1, 2)); + array3[SECOND] = toInt(input.substr(pos2)); + }); + function localeIsPM(input) { + return (input + "").toLowerCase().charAt(0) === "p"; + } + var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, getSetHour = makeGetSet("Hours", true); + function localeMeridiem(hours2, minutes2, isLower) { + if (hours2 > 11) { + return isLower ? "pm" : "PM"; + } else { + return isLower ? "am" : "AM"; + } + } + var baseConfig = { + calendar: defaultCalendar, + longDateFormat: defaultLongDateFormat, + invalidDate: defaultInvalidDate, + ordinal: defaultOrdinal, + dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, + relativeTime: defaultRelativeTime, + months: defaultLocaleMonths, + monthsShort: defaultLocaleMonthsShort, + week: defaultLocaleWeek, + weekdays: defaultLocaleWeekdays, + weekdaysMin: defaultLocaleWeekdaysMin, + weekdaysShort: defaultLocaleWeekdaysShort, + meridiemParse: defaultLocaleMeridiemParse + }; + var locales = {}, localeFamilies = {}, globalLocale; + function commonPrefix(arr1, arr2) { + var i, minl = Math.min(arr1.length, arr2.length); + for (i = 0; i < minl; i += 1) { + if (arr1[i] !== arr2[i]) { + return i; + } + } + return minl; + } + function normalizeLocale(key2) { + return key2 ? key2.toLowerCase().replace("_", "-") : key2; + } + function chooseLocale(names2) { + var i = 0, j, next, locale5, split; + while (i < names2.length) { + split = normalizeLocale(names2[i]).split("-"); + j = split.length; + next = normalizeLocale(names2[i + 1]); + next = next ? next.split("-") : null; + while (j > 0) { + locale5 = loadLocale(split.slice(0, j).join("-")); + if (locale5) { + return locale5; + } + if (next && next.length >= j && commonPrefix(split, next) >= j - 1) { + break; + } + j--; + } + i++; + } + return globalLocale; + } + function loadLocale(name) { + var oldLocale = null, aliasedRequire; + if (locales[name] === void 0 && typeof module !== "undefined" && module && module.exports) { + try { + oldLocale = globalLocale._abbr; + aliasedRequire = __require; + aliasedRequire("./locale/" + name); + getSetGlobalLocale(oldLocale); + } catch (e) { + locales[name] = null; + } + } + return locales[name]; + } + function getSetGlobalLocale(key2, values) { + var data; + if (key2) { + if (isUndefined(values)) { + data = getLocale(key2); + } else { + data = defineLocale(key2, values); + } + if (data) { + globalLocale = data; + } else { + if (typeof console !== "undefined" && console.warn) { + console.warn("Locale " + key2 + " not found. Did you forget to load it?"); + } + } + } + return globalLocale._abbr; + } + function defineLocale(name, config) { + if (config !== null) { + var locale5, parentConfig = baseConfig; + config.abbr = name; + if (locales[name] != null) { + deprecateSimple("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."); + parentConfig = locales[name]._config; + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + parentConfig = locales[config.parentLocale]._config; + } else { + locale5 = loadLocale(config.parentLocale); + if (locale5 != null) { + parentConfig = locale5._config; + } else { + if (!localeFamilies[config.parentLocale]) { + localeFamilies[config.parentLocale] = []; + } + localeFamilies[config.parentLocale].push({ + name, + config + }); + return null; + } + } + } + locales[name] = new Locale(mergeConfigs(parentConfig, config)); + if (localeFamilies[name]) { + localeFamilies[name].forEach(function(x) { + defineLocale(x.name, x.config); + }); + } + getSetGlobalLocale(name); + return locales[name]; + } else { + delete locales[name]; + return null; + } + } + function updateLocale(name, config) { + if (config != null) { + var locale5, tmpLocale, parentConfig = baseConfig; + if (locales[name] != null && locales[name].parentLocale != null) { + locales[name].set(mergeConfigs(locales[name]._config, config)); + } else { + tmpLocale = loadLocale(name); + if (tmpLocale != null) { + parentConfig = tmpLocale._config; + } + config = mergeConfigs(parentConfig, config); + if (tmpLocale == null) { + config.abbr = name; + } + locale5 = new Locale(config); + locale5.parentLocale = locales[name]; + locales[name] = locale5; + } + getSetGlobalLocale(name); + } else { + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + if (name === getSetGlobalLocale()) { + getSetGlobalLocale(name); + } + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + function getLocale(key2) { + var locale5; + if (key2 && key2._locale && key2._locale._abbr) { + key2 = key2._locale._abbr; + } + if (!key2) { + return globalLocale; + } + if (!isArray(key2)) { + locale5 = loadLocale(key2); + if (locale5) { + return locale5; + } + key2 = [key2]; + } + return chooseLocale(key2); + } + function listLocales() { + return keys(locales); + } + function checkOverflow(m) { + var overflow, a = m._a; + if (a && getParsingFlags(m).overflow === -2) { + overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; + if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { + overflow = DATE; + } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } + getParsingFlags(m).overflow = overflow; + } + return m; + } + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [ + ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/], + ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/], + ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/], + ["GGGG-[W]WW", /\d{4}-W\d\d/, false], + ["YYYY-DDD", /\d{4}-\d{3}/], + ["YYYY-MM", /\d{4}-\d\d/, false], + ["YYYYYYMMDD", /[+-]\d{10}/], + ["YYYYMMDD", /\d{8}/], + ["GGGG[W]WWE", /\d{4}W\d{3}/], + ["GGGG[W]WW", /\d{4}W\d{2}/, false], + ["YYYYDDD", /\d{7}/], + ["YYYYMM", /\d{6}/, false], + ["YYYY", /\d{4}/, false] + ], isoTimes = [ + ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/], + ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/], + ["HH:mm:ss", /\d\d:\d\d:\d\d/], + ["HH:mm", /\d\d:\d\d/], + ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/], + ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/], + ["HHmmss", /\d\d\d\d\d\d/], + ["HHmm", /\d\d\d\d/], + ["HH", /\d\d/] + ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = { + UT: 0, + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + function configFromISO(config) { + var i, l, string2 = config._i, match = extendedIsoRegex.exec(string2) || basicIsoRegex.exec(string2), allowTime, dateFormat, timeFormat, tzFormat; + if (match) { + getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; + break; + } + } + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + timeFormat = (match[2] || " ") + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; + } + } + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; + } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = "Z"; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || "") + (tzFormat || ""); + configFromStringAndFormat(config); + } else { + config._isValid = false; + } + } + function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = [ + untruncateYear(yearStr), + defaultLocaleMonthsShort.indexOf(monthStr), + parseInt(dayStr, 10), + parseInt(hourStr, 10), + parseInt(minuteStr, 10) + ]; + if (secondStr) { + result.push(parseInt(secondStr, 10)); + } + return result; + } + function untruncateYear(yearStr) { + var year = parseInt(yearStr, 10); + if (year <= 49) { + return 2e3 + year; + } else if (year <= 999) { + return 1900 + year; + } + return year; + } + function preprocessRFC2822(s) { + return s.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, ""); + } + function checkWeekday(weekdayStr, parsedInput, config) { + if (weekdayStr) { + var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); + if (weekdayProvided !== weekdayActual) { + getParsingFlags(config).weekdayMismatch = true; + config._isValid = false; + return false; + } + } + return true; + } + function calculateOffset(obsOffset, militaryOffset, numOffset) { + if (obsOffset) { + return obsOffsets[obsOffset]; + } else if (militaryOffset) { + return 0; + } else { + var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100; + return h * 60 + m; + } + } + function configFromRFC2822(config) { + var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray; + if (match) { + parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); + if (!checkWeekday(match[1], parsedArray, config)) { + return; + } + config._a = parsedArray; + config._tzm = calculateOffset(match[8], match[9], match[10]); + config._d = createUTCDate.apply(null, config._a); + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + getParsingFlags(config).rfc2822 = true; + } else { + config._isValid = false; + } + } + function configFromString(config) { + var matched = aspNetJsonRegex.exec(config._i); + if (matched !== null) { + config._d = new Date(+matched[1]); + return; + } + configFromISO(config); + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } + configFromRFC2822(config); + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } + if (config._strict) { + config._isValid = false; + } else { + hooks.createFromInputFallback(config); + } + } + hooks.createFromInputFallback = deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function(config) { + config._d = new Date(config._i + (config._useUTC ? " UTC" : "")); + }); + function defaults(a, b, c) { + if (a != null) { + return a; + } + if (b != null) { + return b; + } + return c; + } + function currentDateArray(config) { + var nowValue = new Date(hooks.now()); + if (config._useUTC) { + return [ + nowValue.getUTCFullYear(), + nowValue.getUTCMonth(), + nowValue.getUTCDate() + ]; + } + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; + } + function configFromArray(config) { + var i, date3, input = [], currentDate, expectedWeekday, yearToUse; + if (config._d) { + return; + } + currentDate = currentDateArray(config); + if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { + dayOfYearFromWeekInfo(config); + } + if (config._dayOfYear != null) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { + getParsingFlags(config)._overflowDayOfYear = true; + } + date3 = createUTCDate(yearToUse, 0, config._dayOfYear); + config._a[MONTH] = date3.getUTCMonth(); + config._a[DATE] = date3.getUTCDate(); + } + for (i = 0; i < 3 && config._a[i] == null; ++i) { + config._a[i] = input[i] = currentDate[i]; + } + for (; i < 7; i++) { + config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i]; + } + if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } + config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); + if (config._tzm != null) { + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + } + if (config._nextDay) { + config._a[HOUR] = 24; + } + if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) { + getParsingFlags(config).weekdayMismatch = true; + } + } + function dayOfYearFromWeekInfo(config) { + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; + w = config._w; + if (w.GG != null || w.W != null || w.E != null) { + dow = 1; + doy = 4; + weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); + week = defaults(w.W, 1); + weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } + } else { + dow = config._locale._week.dow; + doy = config._locale._week.doy; + curWeek = weekOfYear(createLocal(), dow, doy); + weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); + week = defaults(w.w, curWeek.week); + if (w.d != null) { + weekday = w.d; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; + } + } else if (w.e != null) { + weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + weekday = dow; + } + } + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + } + hooks.ISO_8601 = function() { + }; + hooks.RFC_2822 = function() { + }; + function configFromStringAndFormat(config) { + if (config._f === hooks.ISO_8601) { + configFromISO(config); + return; + } + if (config._f === hooks.RFC_2822) { + configFromRFC2822(config); + return; + } + config._a = []; + getParsingFlags(config).empty = true; + var string2 = "" + config._i, i, parsedInput, tokens2, token2, skipped, stringLength = string2.length, totalParsedInputLength = 0, era; + tokens2 = expandFormat(config._f, config._locale).match(formattingTokens) || []; + for (i = 0; i < tokens2.length; i++) { + token2 = tokens2[i]; + parsedInput = (string2.match(getParseRegexForToken(token2, config)) || [])[0]; + if (parsedInput) { + skipped = string2.substr(0, string2.indexOf(parsedInput)); + if (skipped.length > 0) { + getParsingFlags(config).unusedInput.push(skipped); + } + string2 = string2.slice(string2.indexOf(parsedInput) + parsedInput.length); + totalParsedInputLength += parsedInput.length; + } + if (formatTokenFunctions[token2]) { + if (parsedInput) { + getParsingFlags(config).empty = false; + } else { + getParsingFlags(config).unusedTokens.push(token2); + } + addTimeToArrayFromToken(token2, parsedInput, config); + } else if (config._strict && !parsedInput) { + getParsingFlags(config).unusedTokens.push(token2); + } + } + getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; + if (string2.length > 0) { + getParsingFlags(config).unusedInput.push(string2); + } + if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) { + getParsingFlags(config).bigHour = void 0; + } + getParsingFlags(config).parsedDateParts = config._a.slice(0); + getParsingFlags(config).meridiem = config._meridiem; + config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); + era = getParsingFlags(config).era; + if (era !== null) { + config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); + } + configFromArray(config); + checkOverflow(config); + } + function meridiemFixWrap(locale5, hour, meridiem2) { + var isPm; + if (meridiem2 == null) { + return hour; + } + if (locale5.meridiemHour != null) { + return locale5.meridiemHour(hour, meridiem2); + } else if (locale5.isPM != null) { + isPm = locale5.isPM(meridiem2); + if (isPm && hour < 12) { + hour += 12; + } + if (!isPm && hour === 12) { + hour = 0; + } + return hour; + } else { + return hour; + } + } + function configFromStringAndArray(config) { + var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false; + if (config._f.length === 0) { + getParsingFlags(config).invalidFormat = true; + config._d = new Date(NaN); + return; + } + for (i = 0; i < config._f.length; i++) { + currentScore = 0; + validFormatFound = false; + tempConfig = copyConfig({}, config); + if (config._useUTC != null) { + tempConfig._useUTC = config._useUTC; + } + tempConfig._f = config._f[i]; + configFromStringAndFormat(tempConfig); + if (isValid(tempConfig)) { + validFormatFound = true; + } + currentScore += getParsingFlags(tempConfig).charsLeftOver; + currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; + getParsingFlags(tempConfig).score = currentScore; + if (!bestFormatIsValid) { + if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + if (validFormatFound) { + bestFormatIsValid = true; + } + } + } else { + if (currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + } + } + } + extend(config, bestMoment || tempConfig); + } + function configFromObject(config) { + if (config._d) { + return; + } + var i = normalizeObjectUnits(config._i), dayOrDate = i.day === void 0 ? i.date : i.day; + config._a = map([i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function(obj) { + return obj && parseInt(obj, 10); + }); + configFromArray(config); + } + function createFromConfig(config) { + var res = new Moment(checkOverflow(prepareConfig(config))); + if (res._nextDay) { + res.add(1, "d"); + res._nextDay = void 0; + } + return res; + } + function prepareConfig(config) { + var input = config._i, format4 = config._f; + config._locale = config._locale || getLocale(config._l); + if (input === null || format4 === void 0 && input === "") { + return createInvalid({ nullInput: true }); + } + if (typeof input === "string") { + config._i = input = config._locale.preparse(input); + } + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isDate(input)) { + config._d = input; + } else if (isArray(format4)) { + configFromStringAndArray(config); + } else if (format4) { + configFromStringAndFormat(config); + } else { + configFromInput(config); + } + if (!isValid(config)) { + config._d = null; + } + return config; + } + function configFromInput(config) { + var input = config._i; + if (isUndefined(input)) { + config._d = new Date(hooks.now()); + } else if (isDate(input)) { + config._d = new Date(input.valueOf()); + } else if (typeof input === "string") { + configFromString(config); + } else if (isArray(input)) { + config._a = map(input.slice(0), function(obj) { + return parseInt(obj, 10); + }); + configFromArray(config); + } else if (isObject2(input)) { + configFromObject(config); + } else if (isNumber(input)) { + config._d = new Date(input); + } else { + hooks.createFromInputFallback(config); + } + } + function createLocalOrUTC(input, format4, locale5, strict, isUTC) { + var c = {}; + if (format4 === true || format4 === false) { + strict = format4; + format4 = void 0; + } + if (locale5 === true || locale5 === false) { + strict = locale5; + locale5 = void 0; + } + if (isObject2(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) { + input = void 0; + } + c._isAMomentObject = true; + c._useUTC = c._isUTC = isUTC; + c._l = locale5; + c._i = input; + c._f = format4; + c._strict = strict; + return createFromConfig(c); + } + function createLocal(input, format4, locale5, strict) { + return createLocalOrUTC(input, format4, locale5, strict, false); + } + var prototypeMin = deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function() { + var other = createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return createInvalid(); + } + }), prototypeMax = deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function() { + var other = createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return createInvalid(); + } + }); + function pickBy(fn, moments) { + var res, i; + if (moments.length === 1 && isArray(moments[0])) { + moments = moments[0]; + } + if (!moments.length) { + return createLocal(); + } + res = moments[0]; + for (i = 1; i < moments.length; ++i) { + if (!moments[i].isValid() || moments[i][fn](res)) { + res = moments[i]; + } + } + return res; + } + function min() { + var args = [].slice.call(arguments, 0); + return pickBy("isBefore", args); + } + function max() { + var args = [].slice.call(arguments, 0); + return pickBy("isAfter", args); + } + var now2 = function() { + return Date.now ? Date.now() : +new Date(); + }; + var ordering = [ + "year", + "quarter", + "month", + "week", + "day", + "hour", + "minute", + "second", + "millisecond" + ]; + function isDurationValid(m) { + var key2, unitHasDecimal = false, i; + for (key2 in m) { + if (hasOwnProp(m, key2) && !(indexOf.call(ordering, key2) !== -1 && (m[key2] == null || !isNaN(m[key2])))) { + return false; + } + } + for (i = 0; i < ordering.length; ++i) { + if (m[ordering[i]]) { + if (unitHasDecimal) { + return false; + } + if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { + unitHasDecimal = true; + } + } + } + return true; + } + function isValid$1() { + return this._isValid; + } + function createInvalid$1() { + return createDuration(NaN); + } + function Duration(duration) { + var normalizedInput = normalizeObjectUnits(duration), years2 = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months2 = normalizedInput.month || 0, weeks2 = normalizedInput.week || normalizedInput.isoWeek || 0, days2 = normalizedInput.day || 0, hours2 = normalizedInput.hour || 0, minutes2 = normalizedInput.minute || 0, seconds2 = normalizedInput.second || 0, milliseconds2 = normalizedInput.millisecond || 0; + this._isValid = isDurationValid(normalizedInput); + this._milliseconds = +milliseconds2 + seconds2 * 1e3 + minutes2 * 6e4 + hours2 * 1e3 * 60 * 60; + this._days = +days2 + weeks2 * 7; + this._months = +months2 + quarters * 3 + years2 * 12; + this._data = {}; + this._locale = getLocale(); + this._bubble(); + } + function isDuration(obj) { + return obj instanceof Duration; + } + function absRound(number3) { + if (number3 < 0) { + return Math.round(-1 * number3) * -1; + } else { + return Math.round(number3); + } + } + function compareArrays(array1, array22, dontConvert) { + var len = Math.min(array1.length, array22.length), lengthDiff = Math.abs(array1.length - array22.length), diffs = 0, i; + for (i = 0; i < len; i++) { + if (dontConvert && array1[i] !== array22[i] || !dontConvert && toInt(array1[i]) !== toInt(array22[i])) { + diffs++; + } + } + return diffs + lengthDiff; + } + function offset2(token2, separator) { + addFormatToken(token2, 0, 0, function() { + var offset3 = this.utcOffset(), sign2 = "+"; + if (offset3 < 0) { + offset3 = -offset3; + sign2 = "-"; + } + return sign2 + zeroFill(~~(offset3 / 60), 2) + separator + zeroFill(~~offset3 % 60, 2); + }); + } + offset2("Z", ":"); + offset2("ZZ", ""); + addRegexToken("Z", matchShortOffset); + addRegexToken("ZZ", matchShortOffset); + addParseToken(["Z", "ZZ"], function(input, array3, config) { + config._useUTC = true; + config._tzm = offsetFromString(matchShortOffset, input); + }); + var chunkOffset = /([\+\-]|\d\d)/gi; + function offsetFromString(matcher, string2) { + var matches = (string2 || "").match(matcher), chunk, parts, minutes2; + if (matches === null) { + return null; + } + chunk = matches[matches.length - 1] || []; + parts = (chunk + "").match(chunkOffset) || ["-", 0, 0]; + minutes2 = +(parts[1] * 60) + toInt(parts[2]); + return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2; + } + function cloneWithOffset(input, model) { + var res, diff2; + if (model._isUTC) { + res = model.clone(); + diff2 = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); + res._d.setTime(res._d.valueOf() + diff2); + hooks.updateOffset(res, false); + return res; + } else { + return createLocal(input).local(); + } + } + function getDateOffset(m) { + return -Math.round(m._d.getTimezoneOffset()); + } + hooks.updateOffset = function() { + }; + function getSetOffset(input, keepLocalTime, keepMinutes) { + var offset3 = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } + if (input != null) { + if (typeof input === "string") { + input = offsetFromString(matchShortOffset, input); + if (input === null) { + return this; + } + } else if (Math.abs(input) < 16 && !keepMinutes) { + input = input * 60; + } + if (!this._isUTC && keepLocalTime) { + localAdjust = getDateOffset(this); + } + this._offset = input; + this._isUTC = true; + if (localAdjust != null) { + this.add(localAdjust, "m"); + } + if (offset3 !== input) { + if (!keepLocalTime || this._changeInProgress) { + addSubtract(this, createDuration(input - offset3, "m"), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + hooks.updateOffset(this, true); + this._changeInProgress = null; + } + } + return this; + } else { + return this._isUTC ? offset3 : getDateOffset(this); + } + } + function getSetZone(input, keepLocalTime) { + if (input != null) { + if (typeof input !== "string") { + input = -input; + } + this.utcOffset(input, keepLocalTime); + return this; + } else { + return -this.utcOffset(); + } + } + function setOffsetToUTC(keepLocalTime) { + return this.utcOffset(0, keepLocalTime); + } + function setOffsetToLocal(keepLocalTime) { + if (this._isUTC) { + this.utcOffset(0, keepLocalTime); + this._isUTC = false; + if (keepLocalTime) { + this.subtract(getDateOffset(this), "m"); + } + } + return this; + } + function setOffsetToParsedOffset() { + if (this._tzm != null) { + this.utcOffset(this._tzm, false, true); + } else if (typeof this._i === "string") { + var tZone = offsetFromString(matchOffset, this._i); + if (tZone != null) { + this.utcOffset(tZone); + } else { + this.utcOffset(0, true); + } + } + return this; + } + function hasAlignedHourOffset(input) { + if (!this.isValid()) { + return false; + } + input = input ? createLocal(input).utcOffset() : 0; + return (this.utcOffset() - input) % 60 === 0; + } + function isDaylightSavingTime() { + return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset(); + } + function isDaylightSavingTimeShifted() { + if (!isUndefined(this._isDSTShifted)) { + return this._isDSTShifted; + } + var c = {}, other; + copyConfig(c, this); + c = prepareConfig(c); + if (c._a) { + other = c._isUTC ? createUTC(c._a) : createLocal(c._a); + this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; + } else { + this._isDSTShifted = false; + } + return this._isDSTShifted; + } + function isLocal() { + return this.isValid() ? !this._isUTC : false; + } + function isUtcOffset() { + return this.isValid() ? this._isUTC : false; + } + function isUtc() { + return this.isValid() ? this._isUTC && this._offset === 0 : false; + } + var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; + function createDuration(input, key2) { + var duration = input, match = null, sign2, ret, diffRes; + if (isDuration(input)) { + duration = { + ms: input._milliseconds, + d: input._days, + M: input._months + }; + } else if (isNumber(input) || !isNaN(+input)) { + duration = {}; + if (key2) { + duration[key2] = +input; + } else { + duration.milliseconds = +input; + } + } else if (match = aspNetRegex.exec(input)) { + sign2 = match[1] === "-" ? -1 : 1; + duration = { + y: 0, + d: toInt(match[DATE]) * sign2, + h: toInt(match[HOUR]) * sign2, + m: toInt(match[MINUTE]) * sign2, + s: toInt(match[SECOND]) * sign2, + ms: toInt(absRound(match[MILLISECOND] * 1e3)) * sign2 + }; + } else if (match = isoRegex.exec(input)) { + sign2 = match[1] === "-" ? -1 : 1; + duration = { + y: parseIso(match[2], sign2), + M: parseIso(match[3], sign2), + w: parseIso(match[4], sign2), + d: parseIso(match[5], sign2), + h: parseIso(match[6], sign2), + m: parseIso(match[7], sign2), + s: parseIso(match[8], sign2) + }; + } else if (duration == null) { + duration = {}; + } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) { + diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); + duration = {}; + duration.ms = diffRes.milliseconds; + duration.M = diffRes.months; + } + ret = new Duration(duration); + if (isDuration(input) && hasOwnProp(input, "_locale")) { + ret._locale = input._locale; + } + if (isDuration(input) && hasOwnProp(input, "_isValid")) { + ret._isValid = input._isValid; + } + return ret; + } + createDuration.fn = Duration.prototype; + createDuration.invalid = createInvalid$1; + function parseIso(inp, sign2) { + var res = inp && parseFloat(inp.replace(",", ".")); + return (isNaN(res) ? 0 : res) * sign2; + } + function positiveMomentsDifference(base, other) { + var res = {}; + res.months = other.month() - base.month() + (other.year() - base.year()) * 12; + if (base.clone().add(res.months, "M").isAfter(other)) { + --res.months; + } + res.milliseconds = +other - +base.clone().add(res.months, "M"); + return res; + } + function momentsDifference(base, other) { + var res; + if (!(base.isValid() && other.isValid())) { + return { milliseconds: 0, months: 0 }; + } + other = cloneWithOffset(other, base); + if (base.isBefore(other)) { + res = positiveMomentsDifference(base, other); + } else { + res = positiveMomentsDifference(other, base); + res.milliseconds = -res.milliseconds; + res.months = -res.months; + } + return res; + } + function createAdder(direction, name) { + return function(val, period) { + var dur, tmp; + if (period !== null && !isNaN(+period)) { + deprecateSimple(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."); + tmp = val; + val = period; + period = tmp; + } + dur = createDuration(val, period); + addSubtract(this, dur, direction); + return this; + }; + } + function addSubtract(mom, duration, isAdding, updateOffset) { + var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months); + if (!mom.isValid()) { + return; + } + updateOffset = updateOffset == null ? true : updateOffset; + if (months2) { + setMonth2(mom, get2(mom, "Month") + months2 * isAdding); + } + if (days2) { + set$1(mom, "Date", get2(mom, "Date") + days2 * isAdding); + } + if (milliseconds2) { + mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding); + } + if (updateOffset) { + hooks.updateOffset(mom, days2 || months2); + } + } + var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract"); + function isString2(input) { + return typeof input === "string" || input instanceof String; + } + function isMomentInput(input) { + return isMoment(input) || isDate(input) || isString2(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === void 0; + } + function isMomentInputObject(input) { + var objectTest = isObject2(input) && !isObjectEmpty(input), propertyTest = false, properties = [ + "years", + "year", + "y", + "months", + "month", + "M", + "days", + "day", + "d", + "dates", + "date", + "D", + "hours", + "hour", + "h", + "minutes", + "minute", + "m", + "seconds", + "second", + "s", + "milliseconds", + "millisecond", + "ms" + ], i, property; + for (i = 0; i < properties.length; i += 1) { + property = properties[i]; + propertyTest = propertyTest || hasOwnProp(input, property); + } + return objectTest && propertyTest; + } + function isNumberOrStringArray(input) { + var arrayTest = isArray(input), dataTypeTest = false; + if (arrayTest) { + dataTypeTest = input.filter(function(item) { + return !isNumber(item) && isString2(input); + }).length === 0; + } + return arrayTest && dataTypeTest; + } + function isCalendarSpec(input) { + var objectTest = isObject2(input) && !isObjectEmpty(input), propertyTest = false, properties = [ + "sameDay", + "nextDay", + "lastDay", + "nextWeek", + "lastWeek", + "sameElse" + ], i, property; + for (i = 0; i < properties.length; i += 1) { + property = properties[i]; + propertyTest = propertyTest || hasOwnProp(input, property); + } + return objectTest && propertyTest; + } + function getCalendarFormat(myMoment, now3) { + var diff2 = myMoment.diff(now3, "days", true); + return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse"; + } + function calendar$1(time, formats) { + if (arguments.length === 1) { + if (!arguments[0]) { + time = void 0; + formats = void 0; + } else if (isMomentInput(arguments[0])) { + time = arguments[0]; + formats = void 0; + } else if (isCalendarSpec(arguments[0])) { + formats = arguments[0]; + time = void 0; + } + } + var now3 = time || createLocal(), sod = cloneWithOffset(now3, this).startOf("day"), format4 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format4]) ? formats[format4].call(this, now3) : formats[format4]); + return this.format(output || this.localeData().calendar(format4, this, createLocal(now3))); + } + function clone2() { + return new Moment(this); + } + function isAfter2(input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units) || "millisecond"; + if (units === "millisecond") { + return this.valueOf() > localInput.valueOf(); + } else { + return localInput.valueOf() < this.clone().startOf(units).valueOf(); + } + } + function isBefore(input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units) || "millisecond"; + if (units === "millisecond") { + return this.valueOf() < localInput.valueOf(); + } else { + return this.clone().endOf(units).valueOf() < localInput.valueOf(); + } + } + function isBetween(from2, to2, units, inclusivity) { + var localFrom = isMoment(from2) ? from2 : createLocal(from2), localTo = isMoment(to2) ? to2 : createLocal(to2); + if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { + return false; + } + inclusivity = inclusivity || "()"; + return (inclusivity[0] === "(" ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ")" ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); + } + function isSame(input, units) { + var localInput = isMoment(input) ? input : createLocal(input), inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units) || "millisecond"; + if (units === "millisecond") { + return this.valueOf() === localInput.valueOf(); + } else { + inputMs = localInput.valueOf(); + return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); + } + } + function isSameOrAfter(input, units) { + return this.isSame(input, units) || this.isAfter(input, units); + } + function isSameOrBefore(input, units) { + return this.isSame(input, units) || this.isBefore(input, units); + } + function diff(input, units, asFloat) { + var that, zoneDelta, output; + if (!this.isValid()) { + return NaN; + } + that = cloneWithOffset(input, this); + if (!that.isValid()) { + return NaN; + } + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); + switch (units) { + case "year": + output = monthDiff(this, that) / 12; + break; + case "month": + output = monthDiff(this, that); + break; + case "quarter": + output = monthDiff(this, that) / 3; + break; + case "second": + output = (this - that) / 1e3; + break; + case "minute": + output = (this - that) / 6e4; + break; + case "hour": + output = (this - that) / 36e5; + break; + case "day": + output = (this - that - zoneDelta) / 864e5; + break; + case "week": + output = (this - that - zoneDelta) / 6048e5; + break; + default: + output = this - that; + } + return asFloat ? output : absFloor(output); + } + function monthDiff(a, b) { + if (a.date() < b.date()) { + return -monthDiff(b, a); + } + var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), anchor = a.clone().add(wholeMonthDiff, "months"), anchor2, adjust; + if (b - anchor < 0) { + anchor2 = a.clone().add(wholeMonthDiff - 1, "months"); + adjust = (b - anchor) / (anchor - anchor2); + } else { + anchor2 = a.clone().add(wholeMonthDiff + 1, "months"); + adjust = (b - anchor) / (anchor2 - anchor); + } + return -(wholeMonthDiff + adjust) || 0; + } + hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ"; + hooks.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]"; + function toString() { + return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); + } + function toISOString(keepOffset) { + if (!this.isValid()) { + return null; + } + var utc = keepOffset !== true, m = utc ? this.clone().utc() : this; + if (m.year() < 0 || m.year() > 9999) { + return formatMoment(m, utc ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"); + } + if (isFunction(Date.prototype.toISOString)) { + if (utc) { + return this.toDate().toISOString(); + } else { + return new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", formatMoment(m, "Z")); + } + } + return formatMoment(m, utc ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"); + } + function inspect() { + if (!this.isValid()) { + return "moment.invalid(/* " + this._i + " */)"; + } + var func = "moment", zone = "", prefix, year, datetime, suffix; + if (!this.isLocal()) { + func = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone"; + zone = "Z"; + } + prefix = "[" + func + '("]'; + year = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY"; + datetime = "-MM-DD[T]HH:mm:ss.SSS"; + suffix = zone + '[")]'; + return this.format(prefix + year + datetime + suffix); + } + function format3(inputString) { + if (!inputString) { + inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; + } + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } + function from(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + function fromNow(withoutSuffix) { + return this.from(createLocal(), withoutSuffix); + } + function to(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ from: this, to: time }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + function toNow(withoutSuffix) { + return this.to(createLocal(), withoutSuffix); + } + function locale4(key2) { + var newLocaleData; + if (key2 === void 0) { + return this._locale._abbr; + } else { + newLocaleData = getLocale(key2); + if (newLocaleData != null) { + this._locale = newLocaleData; + } + return this; + } + } + var lang = deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function(key2) { + if (key2 === void 0) { + return this.localeData(); + } else { + return this.locale(key2); + } + }); + function localeData() { + return this._locale; + } + var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; + function mod$1(dividend, divisor) { + return (dividend % divisor + divisor) % divisor; + } + function localStartOfDate(y, m, d) { + if (y < 100 && y >= 0) { + return new Date(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return new Date(y, m, d).valueOf(); + } + } + function utcStartOfDate(y, m, d) { + if (y < 100 && y >= 0) { + return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return Date.UTC(y, m, d); + } + } + function startOf(units) { + var time, startOfDate; + units = normalizeUnits(units); + if (units === void 0 || units === "millisecond" || !this.isValid()) { + return this; + } + startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + switch (units) { + case "year": + time = startOfDate(this.year(), 0, 1); + break; + case "quarter": + time = startOfDate(this.year(), this.month() - this.month() % 3, 1); + break; + case "month": + time = startOfDate(this.year(), this.month(), 1); + break; + case "week": + time = startOfDate(this.year(), this.month(), this.date() - this.weekday()); + break; + case "isoWeek": + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); + break; + case "day": + case "date": + time = startOfDate(this.year(), this.month(), this.date()); + break; + case "hour": + time = this._d.valueOf(); + time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR); + break; + case "minute": + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_MINUTE); + break; + case "second": + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_SECOND); + break; + } + this._d.setTime(time); + hooks.updateOffset(this, true); + return this; + } + function endOf(units) { + var time, startOfDate; + units = normalizeUnits(units); + if (units === void 0 || units === "millisecond" || !this.isValid()) { + return this; + } + startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + switch (units) { + case "year": + time = startOfDate(this.year() + 1, 0, 1) - 1; + break; + case "quarter": + time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; + break; + case "month": + time = startOfDate(this.year(), this.month() + 1, 1) - 1; + break; + case "week": + time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; + break; + case "isoWeek": + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; + break; + case "day": + case "date": + time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; + break; + case "hour": + time = this._d.valueOf(); + time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1; + break; + case "minute": + time = this._d.valueOf(); + time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; + break; + case "second": + time = this._d.valueOf(); + time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; + break; + } + this._d.setTime(time); + hooks.updateOffset(this, true); + return this; + } + function valueOf() { + return this._d.valueOf() - (this._offset || 0) * 6e4; + } + function unix() { + return Math.floor(this.valueOf() / 1e3); + } + function toDate() { + return new Date(this.valueOf()); + } + function toArray5() { + var m = this; + return [ + m.year(), + m.month(), + m.date(), + m.hour(), + m.minute(), + m.second(), + m.millisecond() + ]; + } + function toObject() { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; + } + function toJSON() { + return this.isValid() ? this.toISOString() : null; + } + function isValid$2() { + return isValid(this); + } + function parsingFlags() { + return extend({}, getParsingFlags(this)); + } + function invalidAt() { + return getParsingFlags(this).overflow; + } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + addFormatToken("N", 0, 0, "eraAbbr"); + addFormatToken("NN", 0, 0, "eraAbbr"); + addFormatToken("NNN", 0, 0, "eraAbbr"); + addFormatToken("NNNN", 0, 0, "eraName"); + addFormatToken("NNNNN", 0, 0, "eraNarrow"); + addFormatToken("y", ["y", 1], "yo", "eraYear"); + addFormatToken("y", ["yy", 2], 0, "eraYear"); + addFormatToken("y", ["yyy", 3], 0, "eraYear"); + addFormatToken("y", ["yyyy", 4], 0, "eraYear"); + addRegexToken("N", matchEraAbbr); + addRegexToken("NN", matchEraAbbr); + addRegexToken("NNN", matchEraAbbr); + addRegexToken("NNNN", matchEraName); + addRegexToken("NNNNN", matchEraNarrow); + addParseToken(["N", "NN", "NNN", "NNNN", "NNNNN"], function(input, array3, config, token2) { + var era = config._locale.erasParse(input, token2, config._strict); + if (era) { + getParsingFlags(config).era = era; + } else { + getParsingFlags(config).invalidEra = input; + } + }); + addRegexToken("y", matchUnsigned); + addRegexToken("yy", matchUnsigned); + addRegexToken("yyy", matchUnsigned); + addRegexToken("yyyy", matchUnsigned); + addRegexToken("yo", matchEraYearOrdinal); + addParseToken(["y", "yy", "yyy", "yyyy"], YEAR); + addParseToken(["yo"], function(input, array3, config, token2) { + var match; + if (config._locale._eraYearOrdinalRegex) { + match = input.match(config._locale._eraYearOrdinalRegex); + } + if (config._locale.eraYearOrdinalParse) { + array3[YEAR] = config._locale.eraYearOrdinalParse(input, match); + } else { + array3[YEAR] = parseInt(input, 10); + } + }); + function localeEras(m, format4) { + var i, l, date3, eras = this._eras || getLocale("en")._eras; + for (i = 0, l = eras.length; i < l; ++i) { + switch (typeof eras[i].since) { + case "string": + date3 = hooks(eras[i].since).startOf("day"); + eras[i].since = date3.valueOf(); + break; + } + switch (typeof eras[i].until) { + case "undefined": + eras[i].until = Infinity; + break; + case "string": + date3 = hooks(eras[i].until).startOf("day").valueOf(); + eras[i].until = date3.valueOf(); + break; + } + } + return eras; + } + function localeErasParse(eraName, format4, strict) { + var i, l, eras = this.eras(), name, abbr, narrow; + eraName = eraName.toUpperCase(); + for (i = 0, l = eras.length; i < l; ++i) { + name = eras[i].name.toUpperCase(); + abbr = eras[i].abbr.toUpperCase(); + narrow = eras[i].narrow.toUpperCase(); + if (strict) { + switch (format4) { + case "N": + case "NN": + case "NNN": + if (abbr === eraName) { + return eras[i]; + } + break; + case "NNNN": + if (name === eraName) { + return eras[i]; + } + break; + case "NNNNN": + if (narrow === eraName) { + return eras[i]; + } + break; + } + } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { + return eras[i]; + } + } + } + function localeErasConvertYear(era, year) { + var dir = era.since <= era.until ? 1 : -1; + if (year === void 0) { + return hooks(era.since).year(); + } else { + return hooks(era.since).year() + (year - era.offset) * dir; + } + } + function getEraName() { + var i, l, val, eras = this.localeData().eras(); + for (i = 0, l = eras.length; i < l; ++i) { + val = this.clone().startOf("day").valueOf(); + if (eras[i].since <= val && val <= eras[i].until) { + return eras[i].name; + } + if (eras[i].until <= val && val <= eras[i].since) { + return eras[i].name; + } + } + return ""; + } + function getEraNarrow() { + var i, l, val, eras = this.localeData().eras(); + for (i = 0, l = eras.length; i < l; ++i) { + val = this.clone().startOf("day").valueOf(); + if (eras[i].since <= val && val <= eras[i].until) { + return eras[i].narrow; + } + if (eras[i].until <= val && val <= eras[i].since) { + return eras[i].narrow; + } + } + return ""; + } + function getEraAbbr() { + var i, l, val, eras = this.localeData().eras(); + for (i = 0, l = eras.length; i < l; ++i) { + val = this.clone().startOf("day").valueOf(); + if (eras[i].since <= val && val <= eras[i].until) { + return eras[i].abbr; + } + if (eras[i].until <= val && val <= eras[i].since) { + return eras[i].abbr; + } + } + return ""; + } + function getEraYear() { + var i, l, dir, val, eras = this.localeData().eras(); + for (i = 0, l = eras.length; i < l; ++i) { + dir = eras[i].since <= eras[i].until ? 1 : -1; + val = this.clone().startOf("day").valueOf(); + if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) { + return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset; + } + } + return this.year(); + } + function erasNameRegex(isStrict) { + if (!hasOwnProp(this, "_erasNameRegex")) { + computeErasParse.call(this); + } + return isStrict ? this._erasNameRegex : this._erasRegex; + } + function erasAbbrRegex(isStrict) { + if (!hasOwnProp(this, "_erasAbbrRegex")) { + computeErasParse.call(this); + } + return isStrict ? this._erasAbbrRegex : this._erasRegex; + } + function erasNarrowRegex(isStrict) { + if (!hasOwnProp(this, "_erasNarrowRegex")) { + computeErasParse.call(this); + } + return isStrict ? this._erasNarrowRegex : this._erasRegex; + } + function matchEraAbbr(isStrict, locale5) { + return locale5.erasAbbrRegex(isStrict); + } + function matchEraName(isStrict, locale5) { + return locale5.erasNameRegex(isStrict); + } + function matchEraNarrow(isStrict, locale5) { + return locale5.erasNarrowRegex(isStrict); + } + function matchEraYearOrdinal(isStrict, locale5) { + return locale5._eraYearOrdinalRegex || matchUnsigned; + } + function computeErasParse() { + var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, eras = this.eras(); + for (i = 0, l = eras.length; i < l; ++i) { + namePieces.push(regexEscape(eras[i].name)); + abbrPieces.push(regexEscape(eras[i].abbr)); + narrowPieces.push(regexEscape(eras[i].narrow)); + mixedPieces.push(regexEscape(eras[i].name)); + mixedPieces.push(regexEscape(eras[i].abbr)); + mixedPieces.push(regexEscape(eras[i].narrow)); + } + this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i"); + this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i"); + this._erasAbbrRegex = new RegExp("^(" + abbrPieces.join("|") + ")", "i"); + this._erasNarrowRegex = new RegExp("^(" + narrowPieces.join("|") + ")", "i"); + } + addFormatToken(0, ["gg", 2], 0, function() { + return this.weekYear() % 100; + }); + addFormatToken(0, ["GG", 2], 0, function() { + return this.isoWeekYear() % 100; + }); + function addWeekYearFormatToken(token2, getter) { + addFormatToken(0, [token2, token2.length], 0, getter); + } + addWeekYearFormatToken("gggg", "weekYear"); + addWeekYearFormatToken("ggggg", "weekYear"); + addWeekYearFormatToken("GGGG", "isoWeekYear"); + addWeekYearFormatToken("GGGGG", "isoWeekYear"); + addUnitAlias("weekYear", "gg"); + addUnitAlias("isoWeekYear", "GG"); + addUnitPriority("weekYear", 1); + addUnitPriority("isoWeekYear", 1); + addRegexToken("G", matchSigned); + addRegexToken("g", matchSigned); + addRegexToken("GG", match1to2, match2); + addRegexToken("gg", match1to2, match2); + addRegexToken("GGGG", match1to4, match4); + addRegexToken("gggg", match1to4, match4); + addRegexToken("GGGGG", match1to6, match6); + addRegexToken("ggggg", match1to6, match6); + addWeekParseToken(["gggg", "ggggg", "GGGG", "GGGGG"], function(input, week, config, token2) { + week[token2.substr(0, 2)] = toInt(input); + }); + addWeekParseToken(["gg", "GG"], function(input, week, config, token2) { + week[token2] = hooks.parseTwoDigitYear(input); + }); + function getSetWeekYear(input) { + return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy); + } + function getSetISOWeekYear(input) { + return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4); + } + function getISOWeeksInYear() { + return weeksInYear(this.year(), 1, 4); + } + function getISOWeeksInISOWeekYear() { + return weeksInYear(this.isoWeekYear(), 1, 4); + } + function getWeeksInYear() { + var weekInfo = this.localeData()._week; + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + function getWeeksInWeekYear() { + var weekInfo = this.localeData()._week; + return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); + } + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date3 = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + this.year(date3.getUTCFullYear()); + this.month(date3.getUTCMonth()); + this.date(date3.getUTCDate()); + return this; + } + addFormatToken("Q", 0, "Qo", "quarter"); + addUnitAlias("quarter", "Q"); + addUnitPriority("quarter", 7); + addRegexToken("Q", match1); + addParseToken("Q", function(input, array3) { + array3[MONTH] = (toInt(input) - 1) * 3; + }); + function getSetQuarter(input) { + return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); + } + addFormatToken("D", ["DD", 2], "Do", "date"); + addUnitAlias("date", "D"); + addUnitPriority("date", 9); + addRegexToken("D", match1to2); + addRegexToken("DD", match1to2, match2); + addRegexToken("Do", function(isStrict, locale5) { + return isStrict ? locale5._dayOfMonthOrdinalParse || locale5._ordinalParse : locale5._dayOfMonthOrdinalParseLenient; + }); + addParseToken(["D", "DD"], DATE); + addParseToken("Do", function(input, array3) { + array3[DATE] = toInt(input.match(match1to2)[0]); + }); + var getSetDayOfMonth = makeGetSet("Date", true); + addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear"); + addUnitAlias("dayOfYear", "DDD"); + addUnitPriority("dayOfYear", 4); + addRegexToken("DDD", match1to3); + addRegexToken("DDDD", match3); + addParseToken(["DDD", "DDDD"], function(input, array3, config) { + config._dayOfYear = toInt(input); + }); + function getSetDayOfYear(input) { + var dayOfYear = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; + return input == null ? dayOfYear : this.add(input - dayOfYear, "d"); + } + addFormatToken("m", ["mm", 2], 0, "minute"); + addUnitAlias("minute", "m"); + addUnitPriority("minute", 14); + addRegexToken("m", match1to2); + addRegexToken("mm", match1to2, match2); + addParseToken(["m", "mm"], MINUTE); + var getSetMinute = makeGetSet("Minutes", false); + addFormatToken("s", ["ss", 2], 0, "second"); + addUnitAlias("second", "s"); + addUnitPriority("second", 15); + addRegexToken("s", match1to2); + addRegexToken("ss", match1to2, match2); + addParseToken(["s", "ss"], SECOND); + var getSetSecond = makeGetSet("Seconds", false); + addFormatToken("S", 0, 0, function() { + return ~~(this.millisecond() / 100); + }); + addFormatToken(0, ["SS", 2], 0, function() { + return ~~(this.millisecond() / 10); + }); + addFormatToken(0, ["SSS", 3], 0, "millisecond"); + addFormatToken(0, ["SSSS", 4], 0, function() { + return this.millisecond() * 10; + }); + addFormatToken(0, ["SSSSS", 5], 0, function() { + return this.millisecond() * 100; + }); + addFormatToken(0, ["SSSSSS", 6], 0, function() { + return this.millisecond() * 1e3; + }); + addFormatToken(0, ["SSSSSSS", 7], 0, function() { + return this.millisecond() * 1e4; + }); + addFormatToken(0, ["SSSSSSSS", 8], 0, function() { + return this.millisecond() * 1e5; + }); + addFormatToken(0, ["SSSSSSSSS", 9], 0, function() { + return this.millisecond() * 1e6; + }); + addUnitAlias("millisecond", "ms"); + addUnitPriority("millisecond", 16); + addRegexToken("S", match1to3, match1); + addRegexToken("SS", match1to3, match2); + addRegexToken("SSS", match1to3, match3); + var token, getSetMillisecond; + for (token = "SSSS"; token.length <= 9; token += "S") { + addRegexToken(token, matchUnsigned); + } + function parseMs(input, array3) { + array3[MILLISECOND] = toInt(("0." + input) * 1e3); + } + for (token = "S"; token.length <= 9; token += "S") { + addParseToken(token, parseMs); + } + getSetMillisecond = makeGetSet("Milliseconds", false); + addFormatToken("z", 0, 0, "zoneAbbr"); + addFormatToken("zz", 0, 0, "zoneName"); + function getZoneAbbr() { + return this._isUTC ? "UTC" : ""; + } + function getZoneName() { + return this._isUTC ? "Coordinated Universal Time" : ""; + } + var proto = Moment.prototype; + proto.add = add; + proto.calendar = calendar$1; + proto.clone = clone2; + proto.diff = diff; + proto.endOf = endOf; + proto.format = format3; + proto.from = from; + proto.fromNow = fromNow; + proto.to = to; + proto.toNow = toNow; + proto.get = stringGet; + proto.invalidAt = invalidAt; + proto.isAfter = isAfter2; + proto.isBefore = isBefore; + proto.isBetween = isBetween; + proto.isSame = isSame; + proto.isSameOrAfter = isSameOrAfter; + proto.isSameOrBefore = isSameOrBefore; + proto.isValid = isValid$2; + proto.lang = lang; + proto.locale = locale4; + proto.localeData = localeData; + proto.max = prototypeMax; + proto.min = prototypeMin; + proto.parsingFlags = parsingFlags; + proto.set = stringSet; + proto.startOf = startOf; + proto.subtract = subtract; + proto.toArray = toArray5; + proto.toObject = toObject; + proto.toDate = toDate; + proto.toISOString = toISOString; + proto.inspect = inspect; + if (typeof Symbol !== "undefined" && Symbol.for != null) { + proto[Symbol.for("nodejs.util.inspect.custom")] = function() { + return "Moment<" + this.format() + ">"; + }; + } + proto.toJSON = toJSON; + proto.toString = toString; + proto.unix = unix; + proto.valueOf = valueOf; + proto.creationData = creationData; + proto.eraName = getEraName; + proto.eraNarrow = getEraNarrow; + proto.eraAbbr = getEraAbbr; + proto.eraYear = getEraYear; + proto.year = getSetYear; + proto.isLeapYear = getIsLeapYear; + proto.weekYear = getSetWeekYear; + proto.isoWeekYear = getSetISOWeekYear; + proto.quarter = proto.quarters = getSetQuarter; + proto.month = getSetMonth; + proto.daysInMonth = getDaysInMonth; + proto.week = proto.weeks = getSetWeek; + proto.isoWeek = proto.isoWeeks = getSetISOWeek; + proto.weeksInYear = getWeeksInYear; + proto.weeksInWeekYear = getWeeksInWeekYear; + proto.isoWeeksInYear = getISOWeeksInYear; + proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; + proto.date = getSetDayOfMonth; + proto.day = proto.days = getSetDayOfWeek; + proto.weekday = getSetLocaleDayOfWeek; + proto.isoWeekday = getSetISODayOfWeek; + proto.dayOfYear = getSetDayOfYear; + proto.hour = proto.hours = getSetHour; + proto.minute = proto.minutes = getSetMinute; + proto.second = proto.seconds = getSetSecond; + proto.millisecond = proto.milliseconds = getSetMillisecond; + proto.utcOffset = getSetOffset; + proto.utc = setOffsetToUTC; + proto.local = setOffsetToLocal; + proto.parseZone = setOffsetToParsedOffset; + proto.hasAlignedHourOffset = hasAlignedHourOffset; + proto.isDST = isDaylightSavingTime; + proto.isLocal = isLocal; + proto.isUtcOffset = isUtcOffset; + proto.isUtc = isUtc; + proto.isUTC = isUtc; + proto.zoneAbbr = getZoneAbbr; + proto.zoneName = getZoneName; + proto.dates = deprecate("dates accessor is deprecated. Use date instead.", getSetDayOfMonth); + proto.months = deprecate("months accessor is deprecated. Use month instead", getSetMonth); + proto.years = deprecate("years accessor is deprecated. Use year instead", getSetYear); + proto.zone = deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", getSetZone); + proto.isDSTShifted = deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", isDaylightSavingTimeShifted); + function createUnix(input) { + return createLocal(input * 1e3); + } + function createInZone() { + return createLocal.apply(null, arguments).parseZone(); + } + function preParsePostFormat(string2) { + return string2; + } + var proto$1 = Locale.prototype; + proto$1.calendar = calendar; + proto$1.longDateFormat = longDateFormat; + proto$1.invalidDate = invalidDate; + proto$1.ordinal = ordinal; + proto$1.preparse = preParsePostFormat; + proto$1.postformat = preParsePostFormat; + proto$1.relativeTime = relativeTime; + proto$1.pastFuture = pastFuture; + proto$1.set = set2; + proto$1.eras = localeEras; + proto$1.erasParse = localeErasParse; + proto$1.erasConvertYear = localeErasConvertYear; + proto$1.erasAbbrRegex = erasAbbrRegex; + proto$1.erasNameRegex = erasNameRegex; + proto$1.erasNarrowRegex = erasNarrowRegex; + proto$1.months = localeMonths; + proto$1.monthsShort = localeMonthsShort; + proto$1.monthsParse = localeMonthsParse; + proto$1.monthsRegex = monthsRegex; + proto$1.monthsShortRegex = monthsShortRegex; + proto$1.week = localeWeek; + proto$1.firstDayOfYear = localeFirstDayOfYear; + proto$1.firstDayOfWeek = localeFirstDayOfWeek; + proto$1.weekdays = localeWeekdays; + proto$1.weekdaysMin = localeWeekdaysMin; + proto$1.weekdaysShort = localeWeekdaysShort; + proto$1.weekdaysParse = localeWeekdaysParse; + proto$1.weekdaysRegex = weekdaysRegex; + proto$1.weekdaysShortRegex = weekdaysShortRegex; + proto$1.weekdaysMinRegex = weekdaysMinRegex; + proto$1.isPM = localeIsPM; + proto$1.meridiem = localeMeridiem; + function get$1(format4, index2, field, setter) { + var locale5 = getLocale(), utc = createUTC().set(setter, index2); + return locale5[field](utc, format4); + } + function listMonthsImpl(format4, index2, field) { + if (isNumber(format4)) { + index2 = format4; + format4 = void 0; + } + format4 = format4 || ""; + if (index2 != null) { + return get$1(format4, index2, field, "month"); + } + var i, out = []; + for (i = 0; i < 12; i++) { + out[i] = get$1(format4, i, field, "month"); + } + return out; + } + function listWeekdaysImpl(localeSorted, format4, index2, field) { + if (typeof localeSorted === "boolean") { + if (isNumber(format4)) { + index2 = format4; + format4 = void 0; + } + format4 = format4 || ""; + } else { + format4 = localeSorted; + index2 = format4; + localeSorted = false; + if (isNumber(format4)) { + index2 = format4; + format4 = void 0; + } + format4 = format4 || ""; + } + var locale5 = getLocale(), shift = localeSorted ? locale5._week.dow : 0, i, out = []; + if (index2 != null) { + return get$1(format4, (index2 + shift) % 7, field, "day"); + } + for (i = 0; i < 7; i++) { + out[i] = get$1(format4, (i + shift) % 7, field, "day"); + } + return out; + } + function listMonths(format4, index2) { + return listMonthsImpl(format4, index2, "months"); + } + function listMonthsShort(format4, index2) { + return listMonthsImpl(format4, index2, "monthsShort"); + } + function listWeekdays(localeSorted, format4, index2) { + return listWeekdaysImpl(localeSorted, format4, index2, "weekdays"); + } + function listWeekdaysShort(localeSorted, format4, index2) { + return listWeekdaysImpl(localeSorted, format4, index2, "weekdaysShort"); + } + function listWeekdaysMin(localeSorted, format4, index2) { + return listWeekdaysImpl(localeSorted, format4, index2, "weekdaysMin"); + } + getSetGlobalLocale("en", { + eras: [ + { + since: "0001-01-01", + until: Infinity, + offset: 1, + name: "Anno Domini", + narrow: "AD", + abbr: "AD" + }, + { + since: "0000-12-31", + until: -Infinity, + offset: 1, + name: "Before Christ", + narrow: "BC", + abbr: "BC" + } + ], + dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, + ordinal: function(number3) { + var b = number3 % 10, output = toInt(number3 % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th"; + return number3 + output; + } + }); + hooks.lang = deprecate("moment.lang is deprecated. Use moment.locale instead.", getSetGlobalLocale); + hooks.langData = deprecate("moment.langData is deprecated. Use moment.localeData instead.", getLocale); + var mathAbs = Math.abs; + function abs() { + var data = this._data; + this._milliseconds = mathAbs(this._milliseconds); + this._days = mathAbs(this._days); + this._months = mathAbs(this._months); + data.milliseconds = mathAbs(data.milliseconds); + data.seconds = mathAbs(data.seconds); + data.minutes = mathAbs(data.minutes); + data.hours = mathAbs(data.hours); + data.months = mathAbs(data.months); + data.years = mathAbs(data.years); + return this; + } + function addSubtract$1(duration, input, value, direction) { + var other = createDuration(input, value); + duration._milliseconds += direction * other._milliseconds; + duration._days += direction * other._days; + duration._months += direction * other._months; + return duration._bubble(); + } + function add$1(input, value) { + return addSubtract$1(this, input, value, 1); + } + function subtract$1(input, value) { + return addSubtract$1(this, input, value, -1); + } + function absCeil(number3) { + if (number3 < 0) { + return Math.floor(number3); + } else { + return Math.ceil(number3); + } + } + function bubble() { + var milliseconds2 = this._milliseconds, days2 = this._days, months2 = this._months, data = this._data, seconds2, minutes2, hours2, years2, monthsFromDays; + if (!(milliseconds2 >= 0 && days2 >= 0 && months2 >= 0 || milliseconds2 <= 0 && days2 <= 0 && months2 <= 0)) { + milliseconds2 += absCeil(monthsToDays(months2) + days2) * 864e5; + days2 = 0; + months2 = 0; + } + data.milliseconds = milliseconds2 % 1e3; + seconds2 = absFloor(milliseconds2 / 1e3); + data.seconds = seconds2 % 60; + minutes2 = absFloor(seconds2 / 60); + data.minutes = minutes2 % 60; + hours2 = absFloor(minutes2 / 60); + data.hours = hours2 % 24; + days2 += absFloor(hours2 / 24); + monthsFromDays = absFloor(daysToMonths(days2)); + months2 += monthsFromDays; + days2 -= absCeil(monthsToDays(monthsFromDays)); + years2 = absFloor(months2 / 12); + months2 %= 12; + data.days = days2; + data.months = months2; + data.years = years2; + return this; + } + function daysToMonths(days2) { + return days2 * 4800 / 146097; + } + function monthsToDays(months2) { + return months2 * 146097 / 4800; + } + function as(units) { + if (!this.isValid()) { + return NaN; + } + var days2, months2, milliseconds2 = this._milliseconds; + units = normalizeUnits(units); + if (units === "month" || units === "quarter" || units === "year") { + days2 = this._days + milliseconds2 / 864e5; + months2 = this._months + daysToMonths(days2); + switch (units) { + case "month": + return months2; + case "quarter": + return months2 / 3; + case "year": + return months2 / 12; + } + } else { + days2 = this._days + Math.round(monthsToDays(this._months)); + switch (units) { + case "week": + return days2 / 7 + milliseconds2 / 6048e5; + case "day": + return days2 + milliseconds2 / 864e5; + case "hour": + return days2 * 24 + milliseconds2 / 36e5; + case "minute": + return days2 * 1440 + milliseconds2 / 6e4; + case "second": + return days2 * 86400 + milliseconds2 / 1e3; + case "millisecond": + return Math.floor(days2 * 864e5) + milliseconds2; + default: + throw new Error("Unknown unit " + units); + } + } + } + function valueOf$1() { + if (!this.isValid()) { + return NaN; + } + return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6; + } + function makeAs(alias) { + return function() { + return this.as(alias); + }; + } + var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"); + function clone$1() { + return createDuration(this); + } + function get$2(units) { + units = normalizeUnits(units); + return this.isValid() ? this[units + "s"]() : NaN; + } + function makeGetter(name) { + return function() { + return this.isValid() ? this._data[name] : NaN; + }; + } + var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years"); + function weeks() { + return absFloor(this.days() / 7); + } + var round = Math.round, thresholds = { + ss: 44, + s: 45, + m: 45, + h: 22, + d: 26, + w: null, + M: 11 + }; + function substituteTimeAgo(string2, number3, withoutSuffix, isFuture, locale5) { + return locale5.relativeTime(number3 || 1, !!withoutSuffix, string2, isFuture); + } + function relativeTime$1(posNegDuration, withoutSuffix, thresholds2, locale5) { + var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2]; + if (thresholds2.w != null) { + a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2]; + } + a = a || months2 <= 1 && ["M"] || months2 < thresholds2.M && ["MM", months2] || years2 <= 1 && ["y"] || ["yy", years2]; + a[2] = withoutSuffix; + a[3] = +posNegDuration > 0; + a[4] = locale5; + return substituteTimeAgo.apply(null, a); + } + function getSetRelativeTimeRounding(roundingFunction) { + if (roundingFunction === void 0) { + return round; + } + if (typeof roundingFunction === "function") { + round = roundingFunction; + return true; + } + return false; + } + function getSetRelativeTimeThreshold(threshold, limit) { + if (thresholds[threshold] === void 0) { + return false; + } + if (limit === void 0) { + return thresholds[threshold]; + } + thresholds[threshold] = limit; + if (threshold === "s") { + thresholds.ss = limit - 1; + } + return true; + } + function humanize(argWithSuffix, argThresholds) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + var withSuffix = false, th = thresholds, locale5, output; + if (typeof argWithSuffix === "object") { + argThresholds = argWithSuffix; + argWithSuffix = false; + } + if (typeof argWithSuffix === "boolean") { + withSuffix = argWithSuffix; + } + if (typeof argThresholds === "object") { + th = Object.assign({}, thresholds, argThresholds); + if (argThresholds.s != null && argThresholds.ss == null) { + th.ss = argThresholds.s - 1; + } + } + locale5 = this.localeData(); + output = relativeTime$1(this, !withSuffix, th, locale5); + if (withSuffix) { + output = locale5.pastFuture(+this, output); + } + return locale5.postformat(output); + } + var abs$1 = Math.abs; + function sign(x) { + return (x > 0) - (x < 0) || +x; + } + function toISOString$1() { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + var seconds2 = abs$1(this._milliseconds) / 1e3, days2 = abs$1(this._days), months2 = abs$1(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign; + if (!total) { + return "P0D"; + } + minutes2 = absFloor(seconds2 / 60); + hours2 = absFloor(minutes2 / 60); + seconds2 %= 60; + minutes2 %= 60; + years2 = absFloor(months2 / 12); + months2 %= 12; + s = seconds2 ? seconds2.toFixed(3).replace(/\.?0+$/, "") : ""; + totalSign = total < 0 ? "-" : ""; + ymSign = sign(this._months) !== sign(total) ? "-" : ""; + daysSign = sign(this._days) !== sign(total) ? "-" : ""; + hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : ""; + return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : ""); + } + var proto$2 = Duration.prototype; + proto$2.isValid = isValid$1; + proto$2.abs = abs; + proto$2.add = add$1; + proto$2.subtract = subtract$1; + proto$2.as = as; + proto$2.asMilliseconds = asMilliseconds; + proto$2.asSeconds = asSeconds; + proto$2.asMinutes = asMinutes; + proto$2.asHours = asHours; + proto$2.asDays = asDays; + proto$2.asWeeks = asWeeks; + proto$2.asMonths = asMonths; + proto$2.asQuarters = asQuarters; + proto$2.asYears = asYears; + proto$2.valueOf = valueOf$1; + proto$2._bubble = bubble; + proto$2.clone = clone$1; + proto$2.get = get$2; + proto$2.milliseconds = milliseconds; + proto$2.seconds = seconds; + proto$2.minutes = minutes; + proto$2.hours = hours; + proto$2.days = days; + proto$2.weeks = weeks; + proto$2.months = months; + proto$2.years = years; + proto$2.humanize = humanize; + proto$2.toISOString = toISOString$1; + proto$2.toString = toISOString$1; + proto$2.toJSON = toISOString$1; + proto$2.locale = locale4; + proto$2.localeData = localeData; + proto$2.toIsoString = deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", toISOString$1); + proto$2.lang = lang; + addFormatToken("X", 0, 0, "unix"); + addFormatToken("x", 0, 0, "valueOf"); + addRegexToken("x", matchSigned); + addRegexToken("X", matchTimestamp); + addParseToken("X", function(input, array3, config) { + config._d = new Date(parseFloat(input) * 1e3); + }); + addParseToken("x", function(input, array3, config) { + config._d = new Date(toInt(input)); + }); + hooks.version = "2.29.1"; + setHookCallback(createLocal); + hooks.fn = proto; + hooks.min = min; + hooks.max = max; + hooks.now = now2; + hooks.utc = createUTC; + hooks.unix = createUnix; + hooks.months = listMonths; + hooks.isDate = isDate; + hooks.locale = getSetGlobalLocale; + hooks.invalid = createInvalid; + hooks.duration = createDuration; + hooks.isMoment = isMoment; + hooks.weekdays = listWeekdays; + hooks.parseZone = createInZone; + hooks.localeData = getLocale; + hooks.isDuration = isDuration; + hooks.monthsShort = listMonthsShort; + hooks.weekdaysMin = listWeekdaysMin; + hooks.defineLocale = defineLocale; + hooks.updateLocale = updateLocale; + hooks.locales = listLocales; + hooks.weekdaysShort = listWeekdaysShort; + hooks.normalizeUnits = normalizeUnits; + hooks.relativeTimeRounding = getSetRelativeTimeRounding; + hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; + hooks.calendarFormat = getCalendarFormat; + hooks.prototype = proto; + hooks.HTML5_FMT = { + DATETIME_LOCAL: "YYYY-MM-DDTHH:mm", + DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss", + DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS", + DATE: "YYYY-MM-DD", + TIME: "HH:mm", + TIME_SECONDS: "HH:mm:ss", + TIME_MS: "HH:mm:ss.SSS", + WEEK: "GGGG-[W]WW", + MONTH: "YYYY-MM" + }; + return hooks; + }); + } + }); + // src/index.tsx - var import_react_dom = __toModule(require_react_dom()); + var import_react_dom7 = __toModule(require_react_dom()); // src/components/button.tsx var import_react = __toModule(require_react()); @@ -20431,17 +24861,14050 @@ For more info, visit https://reactjs.org/link/mock-scheduler`); className: "Button-label" }, label, "111")); + // node_modules/@babel/runtime/helpers/esm/extends.js + function _extends() { + _extends = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key2 in source) { + if (Object.prototype.hasOwnProperty.call(source, key2)) { + target[key2] = source[key2]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + + // node_modules/@babel/runtime/helpers/esm/defineProperty.js + function _defineProperty(obj, key2, value) { + if (key2 in obj) { + Object.defineProperty(obj, key2, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key2] = value; + } + return obj; + } + + // node_modules/@babel/runtime/helpers/esm/classCallCheck.js + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + // node_modules/@babel/runtime/helpers/esm/createClass.js + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + return Constructor; + } + + // node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf3(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf(o, p); + } + + // node_modules/@babel/runtime/helpers/esm/inherits.js + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) + _setPrototypeOf(subClass, superClass); + } + + // node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf(o); + } + + // node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + + // node_modules/@babel/runtime/helpers/esm/typeof.js + function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof3(obj2) { + return typeof obj2; + }; + } else { + _typeof = function _typeof3(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof(obj); + } + + // node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js + function _assertThisInitialized(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + + // node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js + function _possibleConstructorReturn(self2, call2) { + if (call2 && (_typeof(call2) === "object" || typeof call2 === "function")) { + return call2; + } + return _assertThisInitialized(self2); + } + + // node_modules/@babel/runtime/helpers/esm/createSuper.js + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; + } + + // node_modules/rc-util/es/omit.js + function ownKeys(object3, enumerableOnly) { + var keys = Object.keys(object3); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object3); + if (enumerableOnly) + symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object3, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function(key2) { + _defineProperty(target, key2, source[key2]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function(key2) { + Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2)); + }); + } + } + return target; + } + function omit(obj, fields) { + var clone2 = _objectSpread({}, obj); + if (Array.isArray(fields)) { + fields.forEach(function(key2) { + delete clone2[key2]; + }); + } + return clone2; + } + + // node_modules/@babel/runtime/helpers/esm/objectSpread2.js + function ownKeys2(object3, enumerableOnly) { + var keys = Object.keys(object3); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object3); + if (enumerableOnly) { + symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object3, sym).enumerable; + }); + } + keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys2(Object(source), true).forEach(function(key2) { + _defineProperty(target, key2, source[key2]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys2(Object(source)).forEach(function(key2) { + Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2)); + }); + } + } + return target; + } + + // node_modules/rc-util/es/Dom/findDOMNode.js + var import_react_dom = __toModule(require_react_dom()); + function findDOMNode(node) { + if (node instanceof HTMLElement) { + return node; + } + return import_react_dom.default.findDOMNode(node); + } + + // node_modules/rc-util/es/Children/toArray.js + var import_react2 = __toModule(require_react()); + var import_react_is = __toModule(require_react_is()); + function toArray(children) { + var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var ret = []; + import_react2.default.Children.forEach(children, function(child) { + if ((child === void 0 || child === null) && !option.keepEmpty) { + return; + } + if (Array.isArray(child)) { + ret = ret.concat(toArray(child)); + } else if ((0, import_react_is.isFragment)(child) && child.props) { + ret = ret.concat(toArray(child.props.children, option)); + } else { + ret.push(child); + } + }); + return ret; + } + + // node_modules/rc-util/es/warning.js + var warned = {}; + function warning(valid, message) { + if (!valid && console !== void 0) { + console.error("Warning: ".concat(message)); + } + } + function note(valid, message) { + if (!valid && console !== void 0) { + console.warn("Note: ".concat(message)); + } + } + function call(method3, valid, message) { + if (!valid && !warned[message]) { + method3(false, message); + warned[message] = true; + } + } + function warningOnce(valid, message) { + call(warning, valid, message); + } + function noteOnce(valid, message) { + call(note, valid, message); + } + var warning_default = warningOnce; + + // node_modules/rc-util/es/ref.js + var import_react_is2 = __toModule(require_react_is()); + function fillRef(ref, node) { + if (typeof ref === "function") { + ref(node); + } else if (_typeof(ref) === "object" && ref && "current" in ref) { + ref.current = node; + } + } + function composeRef() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + return function(node) { + refs.forEach(function(ref) { + fillRef(ref, node); + }); + }; + } + function supportRef(nodeOrComponent) { + var _type$prototype, _nodeOrComponent$prot; + var type2 = (0, import_react_is2.isMemo)(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type; + if (typeof type2 === "function" && !((_type$prototype = type2.prototype) === null || _type$prototype === void 0 ? void 0 : _type$prototype.render)) { + return false; + } + if (typeof nodeOrComponent === "function" && !((_nodeOrComponent$prot = nodeOrComponent.prototype) === null || _nodeOrComponent$prot === void 0 ? void 0 : _nodeOrComponent$prot.render)) { + return false; + } + return true; + } + + // node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js + var MapShim = function() { + if (typeof Map !== "undefined") { + return Map; + } + function getIndex(arr, key2) { + var result = -1; + arr.some(function(entry, index2) { + if (entry[0] === key2) { + result = index2; + return true; + } + return false; + }); + return result; + } + return function() { + function class_1() { + this.__entries__ = []; + } + Object.defineProperty(class_1.prototype, "size", { + get: function() { + return this.__entries__.length; + }, + enumerable: true, + configurable: true + }); + class_1.prototype.get = function(key2) { + var index2 = getIndex(this.__entries__, key2); + var entry = this.__entries__[index2]; + return entry && entry[1]; + }; + class_1.prototype.set = function(key2, value) { + var index2 = getIndex(this.__entries__, key2); + if (~index2) { + this.__entries__[index2][1] = value; + } else { + this.__entries__.push([key2, value]); + } + }; + class_1.prototype.delete = function(key2) { + var entries = this.__entries__; + var index2 = getIndex(entries, key2); + if (~index2) { + entries.splice(index2, 1); + } + }; + class_1.prototype.has = function(key2) { + return !!~getIndex(this.__entries__, key2); + }; + class_1.prototype.clear = function() { + this.__entries__.splice(0); + }; + class_1.prototype.forEach = function(callback, ctx) { + if (ctx === void 0) { + ctx = null; + } + for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) { + var entry = _a[_i]; + callback.call(ctx, entry[1], entry[0]); + } + }; + return class_1; + }(); + }(); + var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document; + var global$1 = function() { + if (typeof global !== "undefined" && global.Math === Math) { + return global; + } + if (typeof self !== "undefined" && self.Math === Math) { + return self; + } + if (typeof window !== "undefined" && window.Math === Math) { + return window; + } + return Function("return this")(); + }(); + var requestAnimationFrame$1 = function() { + if (typeof requestAnimationFrame === "function") { + return requestAnimationFrame.bind(global$1); + } + return function(callback) { + return setTimeout(function() { + return callback(Date.now()); + }, 1e3 / 60); + }; + }(); + var trailingTimeout = 2; + function throttle(callback, delay) { + var leadingCall = false, trailingCall = false, lastCallTime = 0; + function resolvePending() { + if (leadingCall) { + leadingCall = false; + callback(); + } + if (trailingCall) { + proxy(); + } + } + function timeoutCallback() { + requestAnimationFrame$1(resolvePending); + } + function proxy() { + var timeStamp = Date.now(); + if (leadingCall) { + if (timeStamp - lastCallTime < trailingTimeout) { + return; + } + trailingCall = true; + } else { + leadingCall = true; + trailingCall = false; + setTimeout(timeoutCallback, delay); + } + lastCallTime = timeStamp; + } + return proxy; + } + var REFRESH_DELAY = 20; + var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"]; + var mutationObserverSupported = typeof MutationObserver !== "undefined"; + var ResizeObserverController = function() { + function ResizeObserverController2() { + this.connected_ = false; + this.mutationEventsAdded_ = false; + this.mutationsObserver_ = null; + this.observers_ = []; + this.onTransitionEnd_ = this.onTransitionEnd_.bind(this); + this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY); + } + ResizeObserverController2.prototype.addObserver = function(observer) { + if (!~this.observers_.indexOf(observer)) { + this.observers_.push(observer); + } + if (!this.connected_) { + this.connect_(); + } + }; + ResizeObserverController2.prototype.removeObserver = function(observer) { + var observers2 = this.observers_; + var index2 = observers2.indexOf(observer); + if (~index2) { + observers2.splice(index2, 1); + } + if (!observers2.length && this.connected_) { + this.disconnect_(); + } + }; + ResizeObserverController2.prototype.refresh = function() { + var changesDetected = this.updateObservers_(); + if (changesDetected) { + this.refresh(); + } + }; + ResizeObserverController2.prototype.updateObservers_ = function() { + var activeObservers = this.observers_.filter(function(observer) { + return observer.gatherActive(), observer.hasActive(); + }); + activeObservers.forEach(function(observer) { + return observer.broadcastActive(); + }); + return activeObservers.length > 0; + }; + ResizeObserverController2.prototype.connect_ = function() { + if (!isBrowser || this.connected_) { + return; + } + document.addEventListener("transitionend", this.onTransitionEnd_); + window.addEventListener("resize", this.refresh); + if (mutationObserverSupported) { + this.mutationsObserver_ = new MutationObserver(this.refresh); + this.mutationsObserver_.observe(document, { + attributes: true, + childList: true, + characterData: true, + subtree: true + }); + } else { + document.addEventListener("DOMSubtreeModified", this.refresh); + this.mutationEventsAdded_ = true; + } + this.connected_ = true; + }; + ResizeObserverController2.prototype.disconnect_ = function() { + if (!isBrowser || !this.connected_) { + return; + } + document.removeEventListener("transitionend", this.onTransitionEnd_); + window.removeEventListener("resize", this.refresh); + if (this.mutationsObserver_) { + this.mutationsObserver_.disconnect(); + } + if (this.mutationEventsAdded_) { + document.removeEventListener("DOMSubtreeModified", this.refresh); + } + this.mutationsObserver_ = null; + this.mutationEventsAdded_ = false; + this.connected_ = false; + }; + ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) { + var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b; + var isReflowProperty = transitionKeys.some(function(key2) { + return !!~propertyName.indexOf(key2); + }); + if (isReflowProperty) { + this.refresh(); + } + }; + ResizeObserverController2.getInstance = function() { + if (!this.instance_) { + this.instance_ = new ResizeObserverController2(); + } + return this.instance_; + }; + ResizeObserverController2.instance_ = null; + return ResizeObserverController2; + }(); + var defineConfigurable = function(target, props) { + for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) { + var key2 = _a[_i]; + Object.defineProperty(target, key2, { + value: props[key2], + enumerable: false, + writable: false, + configurable: true + }); + } + return target; + }; + var getWindowOf = function(target) { + var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; + return ownerGlobal || global$1; + }; + var emptyRect = createRectInit(0, 0, 0, 0); + function toFloat(value) { + return parseFloat(value) || 0; + } + function getBordersSize(styles) { + var positions = []; + for (var _i = 1; _i < arguments.length; _i++) { + positions[_i - 1] = arguments[_i]; + } + return positions.reduce(function(size, position) { + var value = styles["border-" + position + "-width"]; + return size + toFloat(value); + }, 0); + } + function getPaddings(styles) { + var positions = ["top", "right", "bottom", "left"]; + var paddings = {}; + for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { + var position = positions_1[_i]; + var value = styles["padding-" + position]; + paddings[position] = toFloat(value); + } + return paddings; + } + function getSVGContentRect(target) { + var bbox = target.getBBox(); + return createRectInit(0, 0, bbox.width, bbox.height); + } + function getHTMLElementContentRect(target) { + var clientWidth = target.clientWidth, clientHeight = target.clientHeight; + if (!clientWidth && !clientHeight) { + return emptyRect; + } + var styles = getWindowOf(target).getComputedStyle(target); + var paddings = getPaddings(styles); + var horizPad = paddings.left + paddings.right; + var vertPad = paddings.top + paddings.bottom; + var width = toFloat(styles.width), height = toFloat(styles.height); + if (styles.boxSizing === "border-box") { + if (Math.round(width + horizPad) !== clientWidth) { + width -= getBordersSize(styles, "left", "right") + horizPad; + } + if (Math.round(height + vertPad) !== clientHeight) { + height -= getBordersSize(styles, "top", "bottom") + vertPad; + } + } + if (!isDocumentElement(target)) { + var vertScrollbar = Math.round(width + horizPad) - clientWidth; + var horizScrollbar = Math.round(height + vertPad) - clientHeight; + if (Math.abs(vertScrollbar) !== 1) { + width -= vertScrollbar; + } + if (Math.abs(horizScrollbar) !== 1) { + height -= horizScrollbar; + } + } + return createRectInit(paddings.left, paddings.top, width, height); + } + var isSVGGraphicsElement = function() { + if (typeof SVGGraphicsElement !== "undefined") { + return function(target) { + return target instanceof getWindowOf(target).SVGGraphicsElement; + }; + } + return function(target) { + return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function"; + }; + }(); + function isDocumentElement(target) { + return target === getWindowOf(target).document.documentElement; + } + function getContentRect(target) { + if (!isBrowser) { + return emptyRect; + } + if (isSVGGraphicsElement(target)) { + return getSVGContentRect(target); + } + return getHTMLElementContentRect(target); + } + function createReadOnlyRect(_a) { + var x = _a.x, y = _a.y, width = _a.width, height = _a.height; + var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object; + var rect = Object.create(Constr.prototype); + defineConfigurable(rect, { + x, + y, + width, + height, + top: y, + right: x + width, + bottom: height + y, + left: x + }); + return rect; + } + function createRectInit(x, y, width, height) { + return { x, y, width, height }; + } + var ResizeObservation = function() { + function ResizeObservation2(target) { + this.broadcastWidth = 0; + this.broadcastHeight = 0; + this.contentRect_ = createRectInit(0, 0, 0, 0); + this.target = target; + } + ResizeObservation2.prototype.isActive = function() { + var rect = getContentRect(this.target); + this.contentRect_ = rect; + return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight; + }; + ResizeObservation2.prototype.broadcastRect = function() { + var rect = this.contentRect_; + this.broadcastWidth = rect.width; + this.broadcastHeight = rect.height; + return rect; + }; + return ResizeObservation2; + }(); + var ResizeObserverEntry = function() { + function ResizeObserverEntry2(target, rectInit) { + var contentRect = createReadOnlyRect(rectInit); + defineConfigurable(this, { target, contentRect }); + } + return ResizeObserverEntry2; + }(); + var ResizeObserverSPI = function() { + function ResizeObserverSPI2(callback, controller, callbackCtx) { + this.activeObservations_ = []; + this.observations_ = new MapShim(); + if (typeof callback !== "function") { + throw new TypeError("The callback provided as parameter 1 is not a function."); + } + this.callback_ = callback; + this.controller_ = controller; + this.callbackCtx_ = callbackCtx; + } + ResizeObserverSPI2.prototype.observe = function(target) { + if (!arguments.length) { + throw new TypeError("1 argument required, but only 0 present."); + } + if (typeof Element === "undefined" || !(Element instanceof Object)) { + return; + } + if (!(target instanceof getWindowOf(target).Element)) { + throw new TypeError('parameter 1 is not of type "Element".'); + } + var observations = this.observations_; + if (observations.has(target)) { + return; + } + observations.set(target, new ResizeObservation(target)); + this.controller_.addObserver(this); + this.controller_.refresh(); + }; + ResizeObserverSPI2.prototype.unobserve = function(target) { + if (!arguments.length) { + throw new TypeError("1 argument required, but only 0 present."); + } + if (typeof Element === "undefined" || !(Element instanceof Object)) { + return; + } + if (!(target instanceof getWindowOf(target).Element)) { + throw new TypeError('parameter 1 is not of type "Element".'); + } + var observations = this.observations_; + if (!observations.has(target)) { + return; + } + observations.delete(target); + if (!observations.size) { + this.controller_.removeObserver(this); + } + }; + ResizeObserverSPI2.prototype.disconnect = function() { + this.clearActive(); + this.observations_.clear(); + this.controller_.removeObserver(this); + }; + ResizeObserverSPI2.prototype.gatherActive = function() { + var _this = this; + this.clearActive(); + this.observations_.forEach(function(observation) { + if (observation.isActive()) { + _this.activeObservations_.push(observation); + } + }); + }; + ResizeObserverSPI2.prototype.broadcastActive = function() { + if (!this.hasActive()) { + return; + } + var ctx = this.callbackCtx_; + var entries = this.activeObservations_.map(function(observation) { + return new ResizeObserverEntry(observation.target, observation.broadcastRect()); + }); + this.callback_.call(ctx, entries, ctx); + this.clearActive(); + }; + ResizeObserverSPI2.prototype.clearActive = function() { + this.activeObservations_.splice(0); + }; + ResizeObserverSPI2.prototype.hasActive = function() { + return this.activeObservations_.length > 0; + }; + return ResizeObserverSPI2; + }(); + var observers = typeof WeakMap !== "undefined" ? new WeakMap() : new MapShim(); + var ResizeObserver = function() { + function ResizeObserver2(callback) { + if (!(this instanceof ResizeObserver2)) { + throw new TypeError("Cannot call a class as a function."); + } + if (!arguments.length) { + throw new TypeError("1 argument required, but only 0 present."); + } + var controller = ResizeObserverController.getInstance(); + var observer = new ResizeObserverSPI(callback, controller, this); + observers.set(this, observer); + } + return ResizeObserver2; + }(); + [ + "observe", + "unobserve", + "disconnect" + ].forEach(function(method3) { + ResizeObserver.prototype[method3] = function() { + var _a; + return (_a = observers.get(this))[method3].apply(_a, arguments); + }; + }); + var index = function() { + if (typeof global$1.ResizeObserver !== "undefined") { + return global$1.ResizeObserver; + } + return ResizeObserver; + }(); + var ResizeObserver_es_default = index; + + // node_modules/antd/es/config-provider/index.js + var React47 = __toModule(require_react()); + + // node_modules/@ant-design/icons/es/components/Context.js + var import_react3 = __toModule(require_react()); + var IconContext = /* @__PURE__ */ (0, import_react3.createContext)({}); + var Context_default = IconContext; + + // node_modules/rc-field-form/es/index.js + var React11 = __toModule(require_react()); + + // node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) + return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key2, i; + for (i = 0; i < sourceKeys.length; i++) { + key2 = sourceKeys[i]; + if (excluded.indexOf(key2) >= 0) + continue; + target[key2] = source[key2]; + } + return target; + } + + // node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + function _objectWithoutProperties(source, excluded) { + if (source == null) + return {}; + var target = _objectWithoutPropertiesLoose(source, excluded); + var key2, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key2 = sourceSymbolKeys[i]; + if (excluded.indexOf(key2) >= 0) + continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key2)) + continue; + target[key2] = source[key2]; + } + } + return target; + } + + // node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + return arr2; + } + + // node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); + } + + // node_modules/@babel/runtime/helpers/esm/iterableToArray.js + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); + } + + // node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js + function _unsupportedIterableToArray(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray(o, minLen); + } + + // node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + // node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + + // node_modules/rc-field-form/es/Field.js + var React6 = __toModule(require_react()); + + // node_modules/rc-field-form/es/FieldContext.js + var React4 = __toModule(require_react()); + var HOOK_MARK = "RC_FORM_INTERNAL_HOOKS"; + var warningFunc = function warningFunc2() { + warning_default(false, "Can not find FormContext. Please make sure you wrap Field under Form."); + }; + var Context = /* @__PURE__ */ React4.createContext({ + getFieldValue: warningFunc, + getFieldsValue: warningFunc, + getFieldError: warningFunc, + getFieldsError: warningFunc, + isFieldsTouched: warningFunc, + isFieldTouched: warningFunc, + isFieldValidating: warningFunc, + isFieldsValidating: warningFunc, + resetFields: warningFunc, + setFields: warningFunc, + setFieldsValue: warningFunc, + validateFields: warningFunc, + submit: warningFunc, + getInternalHooks: function getInternalHooks() { + warningFunc(); + return { + dispatch: warningFunc, + initEntityValue: warningFunc, + registerField: warningFunc, + useSubscribe: warningFunc, + setInitialValues: warningFunc, + setCallbacks: warningFunc, + getFields: warningFunc, + setValidateMessages: warningFunc, + setPreserve: warningFunc + }; + } + }); + var FieldContext_default = Context; + + // node_modules/rc-field-form/es/utils/typeUtil.js + function toArray2(value) { + if (value === void 0 || value === null) { + return []; + } + return Array.isArray(value) ? value : [value]; + } + + // node_modules/rc-field-form/es/utils/validateUtil.js + var import_regenerator = __toModule(require_regenerator()); + + // node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key2, arg) { + try { + var info = gen[key2](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function() { + var self2 = this, args = arguments; + return new Promise(function(resolve, reject) { + var gen = fn.apply(self2, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(void 0); + }); + }; + } + + // node_modules/async-validator/dist-web/index.js + function _extends2() { + _extends2 = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key2 in source) { + if (Object.prototype.hasOwnProperty.call(source, key2)) { + target[key2] = source[key2]; + } + } + } + return target; + }; + return _extends2.apply(this, arguments); + } + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf2(subClass, superClass); + } + function _getPrototypeOf2(o) { + _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o2) { + return o2.__proto__ || Object.getPrototypeOf(o2); + }; + return _getPrototypeOf2(o); + } + function _setPrototypeOf2(o, p) { + _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o2, p2) { + o2.__proto__ = p2; + return o2; + }; + return _setPrototypeOf2(o, p); + } + function _isNativeReflectConstruct2() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct2()) { + _construct = Reflect.construct; + } else { + _construct = function _construct2(Parent2, args2, Class2) { + var a = [null]; + a.push.apply(a, args2); + var Constructor = Function.bind.apply(Parent2, a); + var instance = new Constructor(); + if (Class2) + _setPrototypeOf2(instance, Class2.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } + function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : void 0; + _wrapNativeSuper = function _wrapNativeSuper2(Class2) { + if (Class2 === null || !_isNativeFunction(Class2)) + return Class2; + if (typeof Class2 !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class2)) + return _cache.get(Class2); + _cache.set(Class2, Wrapper); + } + function Wrapper() { + return _construct(Class2, arguments, _getPrototypeOf2(this).constructor); + } + Wrapper.prototype = Object.create(Class2.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf2(Wrapper, Class2); + }; + return _wrapNativeSuper(Class); + } + var formatRegExp = /%[sdj%]/g; + var warning2 = function warning3() { + }; + if (typeof process !== "undefined" && process.env && true && typeof window !== "undefined" && typeof document !== "undefined") { + warning2 = function warning5(type2, errors) { + if (typeof console !== "undefined" && console.warn) { + if (errors.every(function(e) { + return typeof e === "string"; + })) { + console.warn(type2, errors); + } + } + }; + } + function convertFieldsError(errors) { + if (!errors || !errors.length) + return null; + var fields = {}; + errors.forEach(function(error) { + var field = error.field; + fields[field] = fields[field] || []; + fields[field].push(error); + }); + return fields; + } + function format() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var i = 1; + var f = args[0]; + var len = args.length; + if (typeof f === "function") { + return f.apply(null, args.slice(1)); + } + if (typeof f === "string") { + var str = String(f).replace(formatRegExp, function(x) { + if (x === "%%") { + return "%"; + } + if (i >= len) { + return x; + } + switch (x) { + case "%s": + return String(args[i++]); + case "%d": + return Number(args[i++]); + case "%j": + try { + return JSON.stringify(args[i++]); + } catch (_) { + return "[Circular]"; + } + break; + default: + return x; + } + }); + return str; + } + return f; + } + function isNativeStringType(type2) { + return type2 === "string" || type2 === "url" || type2 === "hex" || type2 === "email" || type2 === "date" || type2 === "pattern"; + } + function isEmptyValue(value, type2) { + if (value === void 0 || value === null) { + return true; + } + if (type2 === "array" && Array.isArray(value) && !value.length) { + return true; + } + if (isNativeStringType(type2) && typeof value === "string" && !value) { + return true; + } + return false; + } + function asyncParallelArray(arr, func, callback) { + var results = []; + var total = 0; + var arrLength = arr.length; + function count(errors) { + results.push.apply(results, errors); + total++; + if (total === arrLength) { + callback(results); + } + } + arr.forEach(function(a) { + func(a, count); + }); + } + function asyncSerialArray(arr, func, callback) { + var index2 = 0; + var arrLength = arr.length; + function next(errors) { + if (errors && errors.length) { + callback(errors); + return; + } + var original = index2; + index2 = index2 + 1; + if (original < arrLength) { + func(arr[original], next); + } else { + callback([]); + } + } + next([]); + } + function flattenObjArr(objArr) { + var ret = []; + Object.keys(objArr).forEach(function(k) { + ret.push.apply(ret, objArr[k]); + }); + return ret; + } + var AsyncValidationError = /* @__PURE__ */ function(_Error) { + _inheritsLoose(AsyncValidationError2, _Error); + function AsyncValidationError2(errors, fields) { + var _this; + _this = _Error.call(this, "Async Validation Error") || this; + _this.errors = errors; + _this.fields = fields; + return _this; + } + return AsyncValidationError2; + }(/* @__PURE__ */ _wrapNativeSuper(Error)); + function asyncMap(objArr, option, func, callback) { + if (option.first) { + var _pending = new Promise(function(resolve, reject) { + var next = function next2(errors) { + callback(errors); + return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(); + }; + var flattenArr = flattenObjArr(objArr); + asyncSerialArray(flattenArr, func, next); + }); + _pending["catch"](function(e) { + return e; + }); + return _pending; + } + var firstFields = option.firstFields || []; + if (firstFields === true) { + firstFields = Object.keys(objArr); + } + var objArrKeys = Object.keys(objArr); + var objArrLength = objArrKeys.length; + var total = 0; + var results = []; + var pending = new Promise(function(resolve, reject) { + var next = function next2(errors) { + results.push.apply(results, errors); + total++; + if (total === objArrLength) { + callback(results); + return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(); + } + }; + if (!objArrKeys.length) { + callback(results); + resolve(); + } + objArrKeys.forEach(function(key2) { + var arr = objArr[key2]; + if (firstFields.indexOf(key2) !== -1) { + asyncSerialArray(arr, func, next); + } else { + asyncParallelArray(arr, func, next); + } + }); + }); + pending["catch"](function(e) { + return e; + }); + return pending; + } + function complementError(rule) { + return function(oe) { + if (oe && oe.message) { + oe.field = oe.field || rule.fullField; + return oe; + } + return { + message: typeof oe === "function" ? oe() : oe, + field: oe.field || rule.fullField + }; + }; + } + function deepMerge(target, source) { + if (source) { + for (var s in source) { + if (source.hasOwnProperty(s)) { + var value = source[s]; + if (typeof value === "object" && typeof target[s] === "object") { + target[s] = _extends2({}, target[s], value); + } else { + target[s] = value; + } + } + } + } + return target; + } + function required(rule, value, source, errors, options, type2) { + if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type2 || rule.type))) { + errors.push(format(options.messages.required, rule.fullField)); + } + } + function whitespace(rule, value, source, errors, options) { + if (/^\s+$/.test(value) || value === "") { + errors.push(format(options.messages.whitespace, rule.fullField)); + } + } + var pattern = { + email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, + url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"), + hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i + }; + var types = { + integer: function integer(value) { + return types.number(value) && parseInt(value, 10) === value; + }, + "float": function float(value) { + return types.number(value) && !types.integer(value); + }, + array: function array(value) { + return Array.isArray(value); + }, + regexp: function regexp(value) { + if (value instanceof RegExp) { + return true; + } + try { + return !!new RegExp(value); + } catch (e) { + return false; + } + }, + date: function date(value) { + return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime()); + }, + number: function number(value) { + if (isNaN(value)) { + return false; + } + return typeof value === "number"; + }, + object: function object(value) { + return typeof value === "object" && !types.array(value); + }, + method: function method(value) { + return typeof value === "function"; + }, + email: function email(value) { + return typeof value === "string" && !!value.match(pattern.email) && value.length < 255; + }, + url: function url(value) { + return typeof value === "string" && !!value.match(pattern.url); + }, + hex: function hex(value) { + return typeof value === "string" && !!value.match(pattern.hex); + } + }; + function type(rule, value, source, errors, options) { + if (rule.required && value === void 0) { + required(rule, value, source, errors, options); + return; + } + var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"]; + var ruleType = rule.type; + if (custom.indexOf(ruleType) > -1) { + if (!types[ruleType](value)) { + errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); + } + } else if (ruleType && typeof value !== rule.type) { + errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type)); + } + } + function range(rule, value, source, errors, options) { + var len = typeof rule.len === "number"; + var min = typeof rule.min === "number"; + var max = typeof rule.max === "number"; + var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + var val = value; + var key2 = null; + var num = typeof value === "number"; + var str = typeof value === "string"; + var arr = Array.isArray(value); + if (num) { + key2 = "number"; + } else if (str) { + key2 = "string"; + } else if (arr) { + key2 = "array"; + } + if (!key2) { + return false; + } + if (arr) { + val = value.length; + } + if (str) { + val = value.replace(spRegexp, "_").length; + } + if (len) { + if (val !== rule.len) { + errors.push(format(options.messages[key2].len, rule.fullField, rule.len)); + } + } else if (min && !max && val < rule.min) { + errors.push(format(options.messages[key2].min, rule.fullField, rule.min)); + } else if (max && !min && val > rule.max) { + errors.push(format(options.messages[key2].max, rule.fullField, rule.max)); + } else if (min && max && (val < rule.min || val > rule.max)) { + errors.push(format(options.messages[key2].range, rule.fullField, rule.min, rule.max)); + } + } + var ENUM = "enum"; + function enumerable(rule, value, source, errors, options) { + rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : []; + if (rule[ENUM].indexOf(value) === -1) { + errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(", "))); + } + } + function pattern$1(rule, value, source, errors, options) { + if (rule.pattern) { + if (rule.pattern instanceof RegExp) { + rule.pattern.lastIndex = 0; + if (!rule.pattern.test(value)) { + errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); + } + } else if (typeof rule.pattern === "string") { + var _pattern = new RegExp(rule.pattern); + if (!_pattern.test(value)) { + errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern)); + } + } + } + } + var rules = { + required, + whitespace, + type, + range, + "enum": enumerable, + pattern: pattern$1 + }; + function string(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value, "string") && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options, "string"); + if (!isEmptyValue(value, "string")) { + rules.type(rule, value, source, errors, options); + rules.range(rule, value, source, errors, options); + rules.pattern(rule, value, source, errors, options); + if (rule.whitespace === true) { + rules.whitespace(rule, value, source, errors, options); + } + } + } + callback(errors); + } + function method2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (value !== void 0) { + rules.type(rule, value, source, errors, options); + } + } + callback(errors); + } + function number2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (value === "") { + value = void 0; + } + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (value !== void 0) { + rules.type(rule, value, source, errors, options); + rules.range(rule, value, source, errors, options); + } + } + callback(errors); + } + function _boolean(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (value !== void 0) { + rules.type(rule, value, source, errors, options); + } + } + callback(errors); + } + function regexp2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (!isEmptyValue(value)) { + rules.type(rule, value, source, errors, options); + } + } + callback(errors); + } + function integer2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (value !== void 0) { + rules.type(rule, value, source, errors, options); + rules.range(rule, value, source, errors, options); + } + } + callback(errors); + } + function floatFn(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (value !== void 0) { + rules.type(rule, value, source, errors, options); + rules.range(rule, value, source, errors, options); + } + } + callback(errors); + } + function array2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if ((value === void 0 || value === null) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options, "array"); + if (value !== void 0 && value !== null) { + rules.type(rule, value, source, errors, options); + rules.range(rule, value, source, errors, options); + } + } + callback(errors); + } + function object2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (value !== void 0) { + rules.type(rule, value, source, errors, options); + } + } + callback(errors); + } + var ENUM$1 = "enum"; + function enumerable$1(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (value !== void 0) { + rules[ENUM$1](rule, value, source, errors, options); + } + } + callback(errors); + } + function pattern$2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value, "string") && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (!isEmptyValue(value, "string")) { + rules.pattern(rule, value, source, errors, options); + } + } + callback(errors); + } + function date2(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value, "date") && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + if (!isEmptyValue(value, "date")) { + var dateObject; + if (value instanceof Date) { + dateObject = value; + } else { + dateObject = new Date(value); + } + rules.type(rule, dateObject, source, errors, options); + if (dateObject) { + rules.range(rule, dateObject.getTime(), source, errors, options); + } + } + } + callback(errors); + } + function required$1(rule, value, callback, source, options) { + var errors = []; + var type2 = Array.isArray(value) ? "array" : typeof value; + rules.required(rule, value, source, errors, options, type2); + callback(errors); + } + function type$1(rule, value, callback, source, options) { + var ruleType = rule.type; + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value, ruleType) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options, ruleType); + if (!isEmptyValue(value, ruleType)) { + rules.type(rule, value, source, errors, options); + } + } + callback(errors); + } + function any(rule, value, callback, source, options) { + var errors = []; + var validate2 = rule.required || !rule.required && source.hasOwnProperty(rule.field); + if (validate2) { + if (isEmptyValue(value) && !rule.required) { + return callback(); + } + rules.required(rule, value, source, errors, options); + } + callback(errors); + } + var validators = { + string, + method: method2, + number: number2, + "boolean": _boolean, + regexp: regexp2, + integer: integer2, + "float": floatFn, + array: array2, + object: object2, + "enum": enumerable$1, + pattern: pattern$2, + date: date2, + url: type$1, + hex: type$1, + email: type$1, + required: required$1, + any + }; + function newMessages() { + return { + "default": "Validation error on field %s", + required: "%s is required", + "enum": "%s must be one of %s", + whitespace: "%s cannot be empty", + date: { + format: "%s date %s is invalid for format %s", + parse: "%s date could not be parsed, %s is invalid ", + invalid: "%s date %s is invalid" + }, + types: { + string: "%s is not a %s", + method: "%s is not a %s (function)", + array: "%s is not an %s", + object: "%s is not an %s", + number: "%s is not a %s", + date: "%s is not a %s", + "boolean": "%s is not a %s", + integer: "%s is not an %s", + "float": "%s is not a %s", + regexp: "%s is not a valid %s", + email: "%s is not a valid %s", + url: "%s is not a valid %s", + hex: "%s is not a valid %s" + }, + string: { + len: "%s must be exactly %s characters", + min: "%s must be at least %s characters", + max: "%s cannot be longer than %s characters", + range: "%s must be between %s and %s characters" + }, + number: { + len: "%s must equal %s", + min: "%s cannot be less than %s", + max: "%s cannot be greater than %s", + range: "%s must be between %s and %s" + }, + array: { + len: "%s must be exactly %s in length", + min: "%s cannot be less than %s in length", + max: "%s cannot be greater than %s in length", + range: "%s must be between %s and %s in length" + }, + pattern: { + mismatch: "%s value %s does not match pattern %s" + }, + clone: function clone2() { + var cloned = JSON.parse(JSON.stringify(this)); + cloned.clone = this.clone; + return cloned; + } + }; + } + var messages = newMessages(); + function Schema(descriptor) { + this.rules = null; + this._messages = messages; + this.define(descriptor); + } + Schema.prototype = { + messages: function messages2(_messages) { + if (_messages) { + this._messages = deepMerge(newMessages(), _messages); + } + return this._messages; + }, + define: function define2(rules2) { + if (!rules2) { + throw new Error("Cannot configure a schema with no rules"); + } + if (typeof rules2 !== "object" || Array.isArray(rules2)) { + throw new Error("Rules must be an object"); + } + this.rules = {}; + var z; + var item; + for (z in rules2) { + if (rules2.hasOwnProperty(z)) { + item = rules2[z]; + this.rules[z] = Array.isArray(item) ? item : [item]; + } + } + }, + validate: function validate(source_, o, oc) { + var _this = this; + if (o === void 0) { + o = {}; + } + if (oc === void 0) { + oc = function oc2() { + }; + } + var source = source_; + var options = o; + var callback = oc; + if (typeof options === "function") { + callback = options; + options = {}; + } + if (!this.rules || Object.keys(this.rules).length === 0) { + if (callback) { + callback(); + } + return Promise.resolve(); + } + function complete(results) { + var i; + var errors = []; + var fields = {}; + function add(e) { + if (Array.isArray(e)) { + var _errors; + errors = (_errors = errors).concat.apply(_errors, e); + } else { + errors.push(e); + } + } + for (i = 0; i < results.length; i++) { + add(results[i]); + } + if (!errors.length) { + errors = null; + fields = null; + } else { + fields = convertFieldsError(errors); + } + callback(errors, fields); + } + if (options.messages) { + var messages$1 = this.messages(); + if (messages$1 === messages) { + messages$1 = newMessages(); + } + deepMerge(messages$1, options.messages); + options.messages = messages$1; + } else { + options.messages = this.messages(); + } + var arr; + var value; + var series = {}; + var keys = options.keys || Object.keys(this.rules); + keys.forEach(function(z) { + arr = _this.rules[z]; + value = source[z]; + arr.forEach(function(r) { + var rule = r; + if (typeof rule.transform === "function") { + if (source === source_) { + source = _extends2({}, source); + } + value = source[z] = rule.transform(value); + } + if (typeof rule === "function") { + rule = { + validator: rule + }; + } else { + rule = _extends2({}, rule); + } + rule.validator = _this.getValidationMethod(rule); + rule.field = z; + rule.fullField = rule.fullField || z; + rule.type = _this.getType(rule); + if (!rule.validator) { + return; + } + series[z] = series[z] || []; + series[z].push({ + rule, + value, + source, + field: z + }); + }); + }); + var errorFields = {}; + return asyncMap(series, options, function(data, doIt) { + var rule = data.rule; + var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object"); + deep = deep && (rule.required || !rule.required && data.value); + rule.field = data.field; + function addFullfield(key2, schema) { + return _extends2({}, schema, { + fullField: rule.fullField + "." + key2 + }); + } + function cb(e) { + if (e === void 0) { + e = []; + } + var errors = e; + if (!Array.isArray(errors)) { + errors = [errors]; + } + if (!options.suppressWarning && errors.length) { + Schema.warning("async-validator:", errors); + } + if (errors.length && rule.message !== void 0) { + errors = [].concat(rule.message); + } + errors = errors.map(complementError(rule)); + if (options.first && errors.length) { + errorFields[rule.field] = 1; + return doIt(errors); + } + if (!deep) { + doIt(errors); + } else { + if (rule.required && !data.value) { + if (rule.message !== void 0) { + errors = [].concat(rule.message).map(complementError(rule)); + } else if (options.error) { + errors = [options.error(rule, format(options.messages.required, rule.field))]; + } + return doIt(errors); + } + var fieldsSchema = {}; + if (rule.defaultField) { + for (var k in data.value) { + if (data.value.hasOwnProperty(k)) { + fieldsSchema[k] = rule.defaultField; + } + } + } + fieldsSchema = _extends2({}, fieldsSchema, data.rule.fields); + for (var f in fieldsSchema) { + if (fieldsSchema.hasOwnProperty(f)) { + var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]]; + fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f)); + } + } + var schema = new Schema(fieldsSchema); + schema.messages(options.messages); + if (data.rule.options) { + data.rule.options.messages = options.messages; + data.rule.options.error = options.error; + } + schema.validate(data.value, data.rule.options || options, function(errs) { + var finalErrors = []; + if (errors && errors.length) { + finalErrors.push.apply(finalErrors, errors); + } + if (errs && errs.length) { + finalErrors.push.apply(finalErrors, errs); + } + doIt(finalErrors.length ? finalErrors : null); + }); + } + } + var res; + if (rule.asyncValidator) { + res = rule.asyncValidator(rule, data.value, cb, data.source, options); + } else if (rule.validator) { + res = rule.validator(rule, data.value, cb, data.source, options); + if (res === true) { + cb(); + } else if (res === false) { + cb(rule.message || rule.field + " fails"); + } else if (res instanceof Array) { + cb(res); + } else if (res instanceof Error) { + cb(res.message); + } + } + if (res && res.then) { + res.then(function() { + return cb(); + }, function(e) { + return cb(e); + }); + } + }, function(results) { + complete(results); + }); + }, + getType: function getType(rule) { + if (rule.type === void 0 && rule.pattern instanceof RegExp) { + rule.type = "pattern"; + } + if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) { + throw new Error(format("Unknown rule type %s", rule.type)); + } + return rule.type || "string"; + }, + getValidationMethod: function getValidationMethod(rule) { + if (typeof rule.validator === "function") { + return rule.validator; + } + var keys = Object.keys(rule); + var messageIndex = keys.indexOf("message"); + if (messageIndex !== -1) { + keys.splice(messageIndex, 1); + } + if (keys.length === 1 && keys[0] === "required") { + return validators.required; + } + return validators[this.getType(rule)] || false; + } + }; + Schema.register = function register(type2, validator) { + if (typeof validator !== "function") { + throw new Error("Cannot register a validator by type, validator is not a function"); + } + validators[type2] = validator; + }; + Schema.warning = warning2; + Schema.messages = messages; + Schema.validators = validators; + var dist_web_default = Schema; + + // node_modules/rc-field-form/es/utils/validateUtil.js + var React5 = __toModule(require_react()); + + // node_modules/rc-util/es/utils/get.js + function get(entity, path) { + var current = entity; + for (var i = 0; i < path.length; i += 1) { + if (current === null || current === void 0) { + return void 0; + } + current = current[path[i]]; + } + return current; + } + + // node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) + return arr; + } + + // node_modules/@babel/runtime/helpers/esm/nonIterableRest.js + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + // node_modules/@babel/runtime/helpers/esm/toArray.js + function _toArray(arr) { + return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); + } + + // node_modules/rc-util/es/utils/set.js + function ownKeys3(object3, enumerableOnly) { + var keys = Object.keys(object3); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object3); + if (enumerableOnly) + symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object3, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread3(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys3(Object(source), true).forEach(function(key2) { + _defineProperty(target, key2, source[key2]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys3(Object(source)).forEach(function(key2) { + Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2)); + }); + } + } + return target; + } + function internalSet(entity, paths, value, removeIfUndefined) { + if (!paths.length) { + return value; + } + var _paths = _toArray(paths), path = _paths[0], restPath = _paths.slice(1); + var clone2; + if (!entity && typeof path === "number") { + clone2 = []; + } else if (Array.isArray(entity)) { + clone2 = _toConsumableArray(entity); + } else { + clone2 = _objectSpread3({}, entity); + } + if (removeIfUndefined && value === void 0 && restPath.length === 1) { + delete clone2[path][restPath[0]]; + } else { + clone2[path] = internalSet(clone2[path], restPath, value, removeIfUndefined); + } + return clone2; + } + function set(entity, paths, value) { + var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; + if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) { + return entity; + } + return internalSet(entity, paths, value, removeIfUndefined); + } + + // node_modules/rc-field-form/es/utils/valueUtil.js + function getNamePath(path) { + return toArray2(path); + } + function getValue(store, namePath) { + var value = get(store, namePath); + return value; + } + function setValue(store, namePath, value) { + var removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; + var newStore = set(store, namePath, value, removeIfUndefined); + return newStore; + } + function cloneByNamePathList(store, namePathList) { + var newStore = {}; + namePathList.forEach(function(namePath) { + var value = getValue(store, namePath); + newStore = setValue(newStore, namePath, value); + }); + return newStore; + } + function containsNamePath(namePathList, namePath) { + return namePathList && namePathList.some(function(path) { + return matchNamePath(path, namePath); + }); + } + function isObject(obj) { + return _typeof(obj) === "object" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype; + } + function internalSetValues(store, values) { + var newStore = Array.isArray(store) ? _toConsumableArray(store) : _objectSpread2({}, store); + if (!values) { + return newStore; + } + Object.keys(values).forEach(function(key2) { + var prevValue = newStore[key2]; + var value = values[key2]; + var recursive = isObject(prevValue) && isObject(value); + newStore[key2] = recursive ? internalSetValues(prevValue, value || {}) : value; + }); + return newStore; + } + function setValues(store) { + for (var _len = arguments.length, restValues = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + restValues[_key - 1] = arguments[_key]; + } + return restValues.reduce(function(current, newStore) { + return internalSetValues(current, newStore); + }, store); + } + function matchNamePath(namePath, changedNamePath) { + if (!namePath || !changedNamePath || namePath.length !== changedNamePath.length) { + return false; + } + return namePath.every(function(nameUnit, i) { + return changedNamePath[i] === nameUnit; + }); + } + function isSimilar(source, target) { + if (source === target) { + return true; + } + if (!source && target || source && !target) { + return false; + } + if (!source || !target || _typeof(source) !== "object" || _typeof(target) !== "object") { + return false; + } + var sourceKeys = Object.keys(source); + var targetKeys = Object.keys(target); + var keys = new Set([].concat(_toConsumableArray(sourceKeys), _toConsumableArray(targetKeys))); + return _toConsumableArray(keys).every(function(key2) { + var sourceValue = source[key2]; + var targetValue = target[key2]; + if (typeof sourceValue === "function" && typeof targetValue === "function") { + return true; + } + return sourceValue === targetValue; + }); + } + function defaultGetValueFromEvent(valuePropName) { + var event = arguments.length <= 1 ? void 0 : arguments[1]; + if (event && event.target && valuePropName in event.target) { + return event.target[valuePropName]; + } + return event; + } + function move(array3, moveIndex, toIndex) { + var length = array3.length; + if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) { + return array3; + } + var item = array3[moveIndex]; + var diff = moveIndex - toIndex; + if (diff > 0) { + return [].concat(_toConsumableArray(array3.slice(0, toIndex)), [item], _toConsumableArray(array3.slice(toIndex, moveIndex)), _toConsumableArray(array3.slice(moveIndex + 1, length))); + } + if (diff < 0) { + return [].concat(_toConsumableArray(array3.slice(0, moveIndex)), _toConsumableArray(array3.slice(moveIndex + 1, toIndex + 1)), [item], _toConsumableArray(array3.slice(toIndex + 1, length))); + } + return array3; + } + + // node_modules/rc-field-form/es/utils/messages.js + var typeTemplate = "'${name}' is not a valid ${type}"; + var defaultValidateMessages = { + default: "Validation error on field '${name}'", + required: "'${name}' is required", + enum: "'${name}' must be one of [${enum}]", + whitespace: "'${name}' cannot be empty", + date: { + format: "'${name}' is invalid for format date", + parse: "'${name}' could not be parsed as date", + invalid: "'${name}' is invalid date" + }, + types: { + string: typeTemplate, + method: typeTemplate, + array: typeTemplate, + object: typeTemplate, + number: typeTemplate, + date: typeTemplate, + boolean: typeTemplate, + integer: typeTemplate, + float: typeTemplate, + regexp: typeTemplate, + email: typeTemplate, + url: typeTemplate, + hex: typeTemplate + }, + string: { + len: "'${name}' must be exactly ${len} characters", + min: "'${name}' must be at least ${min} characters", + max: "'${name}' cannot be longer than ${max} characters", + range: "'${name}' must be between ${min} and ${max} characters" + }, + number: { + len: "'${name}' must equal ${len}", + min: "'${name}' cannot be less than ${min}", + max: "'${name}' cannot be greater than ${max}", + range: "'${name}' must be between ${min} and ${max}" + }, + array: { + len: "'${name}' must be exactly ${len} in length", + min: "'${name}' cannot be less than ${min} in length", + max: "'${name}' cannot be greater than ${max} in length", + range: "'${name}' must be between ${min} and ${max} in length" + }, + pattern: { + mismatch: "'${name}' does not match pattern ${pattern}" + } + }; + + // node_modules/rc-field-form/es/utils/validateUtil.js + var AsyncValidator = dist_web_default; + function replaceMessage(template, kv) { + return template.replace(/\$\{\w+\}/g, function(str) { + var key2 = str.slice(2, -1); + return kv[key2]; + }); + } + function convertMessages(messages3, name, rule, messageVariables) { + var kv = _objectSpread2(_objectSpread2({}, rule), {}, { + name, + enum: (rule.enum || []).join(", ") + }); + var replaceFunc = function replaceFunc2(template, additionalKV) { + return function() { + return replaceMessage(template, _objectSpread2(_objectSpread2({}, kv), additionalKV)); + }; + }; + function fillTemplate(source) { + var target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + Object.keys(source).forEach(function(ruleName) { + var value = source[ruleName]; + if (typeof value === "string") { + target[ruleName] = replaceFunc(value, messageVariables); + } else if (value && _typeof(value) === "object") { + target[ruleName] = {}; + fillTemplate(value, target[ruleName]); + } else { + target[ruleName] = value; + } + }); + return target; + } + return fillTemplate(setValues({}, defaultValidateMessages, messages3)); + } + function validateRule(_x, _x2, _x3, _x4, _x5) { + return _validateRule.apply(this, arguments); + } + function _validateRule() { + _validateRule = _asyncToGenerator(/* @__PURE__ */ import_regenerator.default.mark(function _callee2(name, value, rule, options, messageVariables) { + var cloneRule, subRuleField, validator, messages3, result, subResults; + return import_regenerator.default.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + cloneRule = _objectSpread2({}, rule); + subRuleField = null; + if (cloneRule && cloneRule.type === "array" && cloneRule.defaultField) { + subRuleField = cloneRule.defaultField; + delete cloneRule.defaultField; + } + validator = new AsyncValidator(_defineProperty({}, name, [cloneRule])); + messages3 = convertMessages(options.validateMessages, name, cloneRule, messageVariables); + validator.messages(messages3); + result = []; + _context2.prev = 7; + _context2.next = 10; + return Promise.resolve(validator.validate(_defineProperty({}, name, value), _objectSpread2({}, options))); + case 10: + _context2.next = 15; + break; + case 12: + _context2.prev = 12; + _context2.t0 = _context2["catch"](7); + if (_context2.t0.errors) { + result = _context2.t0.errors.map(function(_ref2, index2) { + var message = _ref2.message; + return /* @__PURE__ */ React5.isValidElement(message) ? /* @__PURE__ */ React5.cloneElement(message, { + key: "error_".concat(index2) + }) : message; + }); + } else { + console.error(_context2.t0); + result = [messages3.default()]; + } + case 15: + if (!(!result.length && subRuleField)) { + _context2.next = 20; + break; + } + _context2.next = 18; + return Promise.all(value.map(function(subValue, i) { + return validateRule("".concat(name, ".").concat(i), subValue, subRuleField, options, messageVariables); + })); + case 18: + subResults = _context2.sent; + return _context2.abrupt("return", subResults.reduce(function(prev, errors) { + return [].concat(_toConsumableArray(prev), _toConsumableArray(errors)); + }, [])); + case 20: + return _context2.abrupt("return", result); + case 21: + case "end": + return _context2.stop(); + } + } + }, _callee2, null, [[7, 12]]); + })); + return _validateRule.apply(this, arguments); + } + function validateRules(namePath, value, rules2, options, validateFirst, messageVariables) { + var name = namePath.join("."); + var filledRules = rules2.map(function(currentRule) { + var originValidatorFunc = currentRule.validator; + if (!originValidatorFunc) { + return currentRule; + } + return _objectSpread2(_objectSpread2({}, currentRule), {}, { + validator: function validator(rule, val, callback) { + var hasPromise = false; + var wrappedCallback = function wrappedCallback2() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + Promise.resolve().then(function() { + warning_default(!hasPromise, "Your validator function has already return a promise. `callback` will be ignored."); + if (!hasPromise) { + callback.apply(void 0, args); + } + }); + }; + var promise = originValidatorFunc(rule, val, wrappedCallback); + hasPromise = promise && typeof promise.then === "function" && typeof promise.catch === "function"; + warning_default(hasPromise, "`callback` is deprecated. Please return a promise instead."); + if (hasPromise) { + promise.then(function() { + callback(); + }).catch(function(err) { + callback(err || " "); + }); + } + } + }); + }); + var summaryPromise; + if (validateFirst === true) { + summaryPromise = new Promise(/* @__PURE__ */ function() { + var _ref = _asyncToGenerator(/* @__PURE__ */ import_regenerator.default.mark(function _callee(resolve, reject) { + var i, errors; + return import_regenerator.default.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + i = 0; + case 1: + if (!(i < filledRules.length)) { + _context.next = 11; + break; + } + _context.next = 4; + return validateRule(name, value, filledRules[i], options, messageVariables); + case 4: + errors = _context.sent; + if (!errors.length) { + _context.next = 8; + break; + } + reject(errors); + return _context.abrupt("return"); + case 8: + i += 1; + _context.next = 1; + break; + case 11: + resolve([]); + case 12: + case "end": + return _context.stop(); + } + } + }, _callee); + })); + return function(_x6, _x7) { + return _ref.apply(this, arguments); + }; + }()); + } else { + var rulePromises = filledRules.map(function(rule) { + return validateRule(name, value, rule, options, messageVariables); + }); + summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then(function(errors) { + if (!errors.length) { + return []; + } + return Promise.reject(errors); + }); + } + summaryPromise.catch(function(e) { + return e; + }); + return summaryPromise; + } + function finishOnAllFailed(_x8) { + return _finishOnAllFailed.apply(this, arguments); + } + function _finishOnAllFailed() { + _finishOnAllFailed = _asyncToGenerator(/* @__PURE__ */ import_regenerator.default.mark(function _callee3(rulePromises) { + return import_regenerator.default.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", Promise.all(rulePromises).then(function(errorsList) { + var _ref3; + var errors = (_ref3 = []).concat.apply(_ref3, _toConsumableArray(errorsList)); + return errors; + })); + case 1: + case "end": + return _context3.stop(); + } + } + }, _callee3); + })); + return _finishOnAllFailed.apply(this, arguments); + } + function finishOnFirstFailed(_x9) { + return _finishOnFirstFailed.apply(this, arguments); + } + function _finishOnFirstFailed() { + _finishOnFirstFailed = _asyncToGenerator(/* @__PURE__ */ import_regenerator.default.mark(function _callee4(rulePromises) { + var count; + return import_regenerator.default.wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + count = 0; + return _context4.abrupt("return", new Promise(function(resolve) { + rulePromises.forEach(function(promise) { + promise.then(function(errors) { + if (errors.length) { + resolve(errors); + } + count += 1; + if (count === rulePromises.length) { + resolve([]); + } + }); + }); + })); + case 2: + case "end": + return _context4.stop(); + } + } + }, _callee4); + })); + return _finishOnFirstFailed.apply(this, arguments); + } + + // node_modules/rc-field-form/es/Field.js + function requireUpdate(shouldUpdate, prev, next, prevValue, nextValue, info) { + if (typeof shouldUpdate === "function") { + return shouldUpdate(prev, next, "source" in info ? { + source: info.source + } : {}); + } + return prevValue !== nextValue; + } + var Field = /* @__PURE__ */ function(_React$Component) { + _inherits(Field2, _React$Component); + var _super = _createSuper(Field2); + function Field2(props) { + var _this; + _classCallCheck(this, Field2); + _this = _super.call(this, props); + _this.state = { + resetCount: 0 + }; + _this.cancelRegisterFunc = null; + _this.mounted = false; + _this.touched = false; + _this.dirty = false; + _this.validatePromise = null; + _this.errors = []; + _this.cancelRegister = function() { + var _this$props = _this.props, preserve = _this$props.preserve, isListField = _this$props.isListField, name = _this$props.name; + if (_this.cancelRegisterFunc) { + _this.cancelRegisterFunc(isListField, preserve, getNamePath(name)); + } + _this.cancelRegisterFunc = null; + }; + _this.getNamePath = function() { + var _this$props2 = _this.props, name = _this$props2.name, fieldContext = _this$props2.fieldContext; + var _fieldContext$prefixN = fieldContext.prefixName, prefixName = _fieldContext$prefixN === void 0 ? [] : _fieldContext$prefixN; + return name !== void 0 ? [].concat(_toConsumableArray(prefixName), _toConsumableArray(name)) : []; + }; + _this.getRules = function() { + var _this$props3 = _this.props, _this$props3$rules = _this$props3.rules, rules2 = _this$props3$rules === void 0 ? [] : _this$props3$rules, fieldContext = _this$props3.fieldContext; + return rules2.map(function(rule) { + if (typeof rule === "function") { + return rule(fieldContext); + } + return rule; + }); + }; + _this.refresh = function() { + if (!_this.mounted) + return; + _this.setState(function(_ref) { + var resetCount = _ref.resetCount; + return { + resetCount: resetCount + 1 + }; + }); + }; + _this.onStoreChange = function(prevStore, namePathList, info) { + var _this$props4 = _this.props, shouldUpdate = _this$props4.shouldUpdate, _this$props4$dependen = _this$props4.dependencies, dependencies = _this$props4$dependen === void 0 ? [] : _this$props4$dependen, onReset = _this$props4.onReset; + var store = info.store; + var namePath = _this.getNamePath(); + var prevValue = _this.getValue(prevStore); + var curValue = _this.getValue(store); + var namePathMatch = namePathList && containsNamePath(namePathList, namePath); + if (info.type === "valueUpdate" && info.source === "external" && prevValue !== curValue) { + _this.touched = true; + _this.dirty = true; + _this.validatePromise = null; + _this.errors = []; + } + switch (info.type) { + case "reset": + if (!namePathList || namePathMatch) { + _this.touched = false; + _this.dirty = false; + _this.validatePromise = null; + _this.errors = []; + if (onReset) { + onReset(); + } + _this.refresh(); + return; + } + break; + case "setField": { + if (namePathMatch) { + var data = info.data; + if ("touched" in data) { + _this.touched = data.touched; + } + if ("validating" in data && !("originRCField" in data)) { + _this.validatePromise = data.validating ? Promise.resolve([]) : null; + } + if ("errors" in data) { + _this.errors = data.errors || []; + } + _this.dirty = true; + _this.reRender(); + return; + } + if (shouldUpdate && !namePath.length && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) { + _this.reRender(); + return; + } + break; + } + case "dependenciesUpdate": { + var dependencyList = dependencies.map(getNamePath); + if (dependencyList.some(function(dependency) { + return containsNamePath(info.relatedFields, dependency); + })) { + _this.reRender(); + return; + } + break; + } + default: + if (namePathMatch || (!dependencies.length || namePath.length || shouldUpdate) && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) { + _this.reRender(); + return; + } + break; + } + if (shouldUpdate === true) { + _this.reRender(); + } + }; + _this.validateRules = function(options) { + var namePath = _this.getNamePath(); + var currentValue = _this.getValue(); + var rootPromise = Promise.resolve().then(function() { + if (!_this.mounted) { + return []; + } + var _this$props5 = _this.props, _this$props5$validate = _this$props5.validateFirst, validateFirst = _this$props5$validate === void 0 ? false : _this$props5$validate, messageVariables = _this$props5.messageVariables; + var _ref2 = options || {}, triggerName = _ref2.triggerName; + var filteredRules = _this.getRules(); + if (triggerName) { + filteredRules = filteredRules.filter(function(rule) { + var validateTrigger = rule.validateTrigger; + if (!validateTrigger) { + return true; + } + var triggerList = toArray2(validateTrigger); + return triggerList.includes(triggerName); + }); + } + var promise = validateRules(namePath, currentValue, filteredRules, options, validateFirst, messageVariables); + promise.catch(function(e) { + return e; + }).then(function() { + var errors = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; + if (_this.validatePromise === rootPromise) { + _this.validatePromise = null; + _this.errors = errors; + _this.reRender(); + } + }); + return promise; + }); + _this.validatePromise = rootPromise; + _this.dirty = true; + _this.errors = []; + _this.reRender(); + return rootPromise; + }; + _this.isFieldValidating = function() { + return !!_this.validatePromise; + }; + _this.isFieldTouched = function() { + return _this.touched; + }; + _this.isFieldDirty = function() { + return _this.dirty; + }; + _this.getErrors = function() { + return _this.errors; + }; + _this.isListField = function() { + return _this.props.isListField; + }; + _this.isList = function() { + return _this.props.isList; + }; + _this.isPreserve = function() { + return _this.props.preserve; + }; + _this.getMeta = function() { + _this.prevValidating = _this.isFieldValidating(); + var meta = { + touched: _this.isFieldTouched(), + validating: _this.prevValidating, + errors: _this.errors, + name: _this.getNamePath() + }; + return meta; + }; + _this.getOnlyChild = function(children) { + if (typeof children === "function") { + var meta = _this.getMeta(); + return _objectSpread2(_objectSpread2({}, _this.getOnlyChild(children(_this.getControlled(), meta, _this.props.fieldContext))), {}, { + isFunction: true + }); + } + var childList = toArray(children); + if (childList.length !== 1 || !/* @__PURE__ */ React6.isValidElement(childList[0])) { + return { + child: childList, + isFunction: false + }; + } + return { + child: childList[0], + isFunction: false + }; + }; + _this.getValue = function(store) { + var getFieldsValue = _this.props.fieldContext.getFieldsValue; + var namePath = _this.getNamePath(); + return getValue(store || getFieldsValue(true), namePath); + }; + _this.getControlled = function() { + var childProps = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var _this$props6 = _this.props, trigger = _this$props6.trigger, validateTrigger = _this$props6.validateTrigger, getValueFromEvent = _this$props6.getValueFromEvent, normalize2 = _this$props6.normalize, valuePropName = _this$props6.valuePropName, getValueProps = _this$props6.getValueProps, fieldContext = _this$props6.fieldContext; + var mergedValidateTrigger = validateTrigger !== void 0 ? validateTrigger : fieldContext.validateTrigger; + var namePath = _this.getNamePath(); + var getInternalHooks3 = fieldContext.getInternalHooks, getFieldsValue = fieldContext.getFieldsValue; + var _getInternalHooks = getInternalHooks3(HOOK_MARK), dispatch = _getInternalHooks.dispatch; + var value = _this.getValue(); + var mergedGetValueProps = getValueProps || function(val) { + return _defineProperty({}, valuePropName, val); + }; + var originTriggerFunc = childProps[trigger]; + var control = _objectSpread2(_objectSpread2({}, childProps), mergedGetValueProps(value)); + control[trigger] = function() { + _this.touched = true; + _this.dirty = true; + var newValue; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (getValueFromEvent) { + newValue = getValueFromEvent.apply(void 0, args); + } else { + newValue = defaultGetValueFromEvent.apply(void 0, [valuePropName].concat(args)); + } + if (normalize2) { + newValue = normalize2(newValue, value, getFieldsValue(true)); + } + dispatch({ + type: "updateValue", + namePath, + value: newValue + }); + if (originTriggerFunc) { + originTriggerFunc.apply(void 0, args); + } + }; + var validateTriggerList = toArray2(mergedValidateTrigger || []); + validateTriggerList.forEach(function(triggerName) { + var originTrigger = control[triggerName]; + control[triggerName] = function() { + if (originTrigger) { + originTrigger.apply(void 0, arguments); + } + var rules2 = _this.props.rules; + if (rules2 && rules2.length) { + dispatch({ + type: "validateField", + namePath, + triggerName + }); + } + }; + }); + return control; + }; + if (props.fieldContext) { + var getInternalHooks2 = props.fieldContext.getInternalHooks; + var _getInternalHooks2 = getInternalHooks2(HOOK_MARK), initEntityValue = _getInternalHooks2.initEntityValue; + initEntityValue(_assertThisInitialized(_this)); + } + return _this; + } + _createClass(Field2, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this$props7 = this.props, shouldUpdate = _this$props7.shouldUpdate, fieldContext = _this$props7.fieldContext; + this.mounted = true; + if (fieldContext) { + var getInternalHooks2 = fieldContext.getInternalHooks; + var _getInternalHooks3 = getInternalHooks2(HOOK_MARK), registerField = _getInternalHooks3.registerField; + this.cancelRegisterFunc = registerField(this); + } + if (shouldUpdate === true) { + this.reRender(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.cancelRegister(); + this.mounted = false; + } + }, { + key: "reRender", + value: function reRender() { + if (!this.mounted) + return; + this.forceUpdate(); + } + }, { + key: "render", + value: function render() { + var resetCount = this.state.resetCount; + var children = this.props.children; + var _this$getOnlyChild = this.getOnlyChild(children), child = _this$getOnlyChild.child, isFunction = _this$getOnlyChild.isFunction; + var returnChildNode; + if (isFunction) { + returnChildNode = child; + } else if (/* @__PURE__ */ React6.isValidElement(child)) { + returnChildNode = /* @__PURE__ */ React6.cloneElement(child, this.getControlled(child.props)); + } else { + warning_default(!child, "`children` of Field is not validate ReactElement."); + returnChildNode = child; + } + return /* @__PURE__ */ React6.createElement(React6.Fragment, { + key: resetCount + }, returnChildNode); + } + }]); + return Field2; + }(React6.Component); + Field.contextType = FieldContext_default; + Field.defaultProps = { + trigger: "onChange", + valuePropName: "value" + }; + function WrapperField(_ref4) { + var name = _ref4.name, restProps = _objectWithoutProperties(_ref4, ["name"]); + var fieldContext = React6.useContext(FieldContext_default); + var namePath = name !== void 0 ? getNamePath(name) : void 0; + var key2 = "keep"; + if (!restProps.isListField) { + key2 = "_".concat((namePath || []).join("_")); + } + if (restProps.preserve === false && restProps.isListField && namePath.length <= 1) { + warning_default(false, "`preserve` should not apply on Form.List fields."); + } + return /* @__PURE__ */ React6.createElement(Field, _extends({ + key: key2, + name: namePath + }, restProps, { + fieldContext + })); + } + var Field_default = WrapperField; + + // node_modules/rc-field-form/es/List.js + var React7 = __toModule(require_react()); + var List = function List2(_ref) { + var name = _ref.name, initialValue = _ref.initialValue, children = _ref.children, rules2 = _ref.rules, validateTrigger = _ref.validateTrigger; + var context = React7.useContext(FieldContext_default); + var keyRef = React7.useRef({ + keys: [], + id: 0 + }); + var keyManager = keyRef.current; + if (typeof children !== "function") { + warning_default(false, "Form.List only accepts function as children."); + return null; + } + var parentPrefixName = getNamePath(context.prefixName) || []; + var prefixName = [].concat(_toConsumableArray(parentPrefixName), _toConsumableArray(getNamePath(name))); + var shouldUpdate = function shouldUpdate2(prevValue, nextValue, _ref2) { + var source = _ref2.source; + if (source === "internal") { + return false; + } + return prevValue !== nextValue; + }; + return /* @__PURE__ */ React7.createElement(FieldContext_default.Provider, { + value: _objectSpread2(_objectSpread2({}, context), {}, { + prefixName + }) + }, /* @__PURE__ */ React7.createElement(Field_default, { + name: [], + shouldUpdate, + rules: rules2, + validateTrigger, + initialValue, + isList: true + }, function(_ref3, meta) { + var _ref3$value = _ref3.value, value = _ref3$value === void 0 ? [] : _ref3$value, onChange = _ref3.onChange; + var getFieldValue = context.getFieldValue; + var getNewValue = function getNewValue2() { + var values = getFieldValue(prefixName || []); + return values || []; + }; + var operations = { + add: function add(defaultValue, index2) { + var newValue = getNewValue(); + if (index2 >= 0 && index2 <= newValue.length) { + keyManager.keys = [].concat(_toConsumableArray(keyManager.keys.slice(0, index2)), [keyManager.id], _toConsumableArray(keyManager.keys.slice(index2))); + onChange([].concat(_toConsumableArray(newValue.slice(0, index2)), [defaultValue], _toConsumableArray(newValue.slice(index2)))); + } else { + if (index2 < 0 || index2 > newValue.length) { + warning_default(false, "The second parameter of the add function should be a valid positive number."); + } + keyManager.keys = [].concat(_toConsumableArray(keyManager.keys), [keyManager.id]); + onChange([].concat(_toConsumableArray(newValue), [defaultValue])); + } + keyManager.id += 1; + }, + remove: function remove(index2) { + var newValue = getNewValue(); + var indexSet = new Set(Array.isArray(index2) ? index2 : [index2]); + if (indexSet.size <= 0) { + return; + } + keyManager.keys = keyManager.keys.filter(function(_, keysIndex) { + return !indexSet.has(keysIndex); + }); + onChange(newValue.filter(function(_, valueIndex) { + return !indexSet.has(valueIndex); + })); + }, + move: function move2(from, to) { + if (from === to) { + return; + } + var newValue = getNewValue(); + if (from < 0 || from >= newValue.length || to < 0 || to >= newValue.length) { + return; + } + keyManager.keys = move(keyManager.keys, from, to); + onChange(move(newValue, from, to)); + } + }; + var listValue = value || []; + if (!Array.isArray(listValue)) { + listValue = []; + if (true) { + warning_default(false, "Current value of '".concat(prefixName.join(" > "), "' is not an array type.")); + } + } + return children(listValue.map(function(__, index2) { + var key2 = keyManager.keys[index2]; + if (key2 === void 0) { + keyManager.keys[index2] = keyManager.id; + key2 = keyManager.keys[index2]; + keyManager.id += 1; + } + return { + name: index2, + key: key2, + isListField: true + }; + }), operations, meta); + })); + }; + var List_default = List; + + // node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js + function _iterableToArrayLimit(arr, i) { + var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); + if (_i == null) + return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) + break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) + _i["return"](); + } finally { + if (_d) + throw _e; + } + } + return _arr; + } + + // node_modules/@babel/runtime/helpers/esm/slicedToArray.js + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + + // node_modules/rc-field-form/es/useForm.js + var React8 = __toModule(require_react()); + + // node_modules/rc-field-form/es/utils/asyncUtil.js + function allPromiseFinish(promiseList) { + var hasError = false; + var count = promiseList.length; + var results = []; + if (!promiseList.length) { + return Promise.resolve([]); + } + return new Promise(function(resolve, reject) { + promiseList.forEach(function(promise, index2) { + promise.catch(function(e) { + hasError = true; + return e; + }).then(function(result) { + count -= 1; + results[index2] = result; + if (count > 0) { + return; + } + if (hasError) { + reject(results); + } + resolve(results); + }); + }); + }); + } + + // node_modules/rc-field-form/es/utils/NameMap.js + var SPLIT = "__@field_split__"; + function normalize(namePath) { + return namePath.map(function(cell) { + return "".concat(_typeof(cell), ":").concat(cell); + }).join(SPLIT); + } + var NameMap = /* @__PURE__ */ function() { + function NameMap2() { + _classCallCheck(this, NameMap2); + this.kvs = new Map(); + } + _createClass(NameMap2, [{ + key: "set", + value: function set2(key2, value) { + this.kvs.set(normalize(key2), value); + } + }, { + key: "get", + value: function get2(key2) { + return this.kvs.get(normalize(key2)); + } + }, { + key: "update", + value: function update(key2, updater) { + var origin = this.get(key2); + var next = updater(origin); + if (!next) { + this.delete(key2); + } else { + this.set(key2, next); + } + } + }, { + key: "delete", + value: function _delete(key2) { + this.kvs.delete(normalize(key2)); + } + }, { + key: "map", + value: function map(callback) { + return _toConsumableArray(this.kvs.entries()).map(function(_ref) { + var _ref2 = _slicedToArray(_ref, 2), key2 = _ref2[0], value = _ref2[1]; + var cells = key2.split(SPLIT); + return callback({ + key: cells.map(function(cell) { + var _cell$match = cell.match(/^([^:]*):(.*)$/), _cell$match2 = _slicedToArray(_cell$match, 3), type2 = _cell$match2[1], unit = _cell$match2[2]; + return type2 === "number" ? Number(unit) : unit; + }), + value + }); + }); + } + }, { + key: "toJSON", + value: function toJSON() { + var json = {}; + this.map(function(_ref3) { + var key2 = _ref3.key, value = _ref3.value; + json[key2.join(".")] = value; + return null; + }); + return json; + } + }]); + return NameMap2; + }(); + var NameMap_default = NameMap; + + // node_modules/rc-field-form/es/useForm.js + var FormStore = function FormStore2(forceRootUpdate) { + var _this = this; + _classCallCheck(this, FormStore2); + this.formHooked = false; + this.subscribable = true; + this.store = {}; + this.fieldEntities = []; + this.initialValues = {}; + this.callbacks = {}; + this.validateMessages = null; + this.preserve = null; + this.lastValidatePromise = null; + this.getForm = function() { + return { + getFieldValue: _this.getFieldValue, + getFieldsValue: _this.getFieldsValue, + getFieldError: _this.getFieldError, + getFieldsError: _this.getFieldsError, + isFieldsTouched: _this.isFieldsTouched, + isFieldTouched: _this.isFieldTouched, + isFieldValidating: _this.isFieldValidating, + isFieldsValidating: _this.isFieldsValidating, + resetFields: _this.resetFields, + setFields: _this.setFields, + setFieldsValue: _this.setFieldsValue, + validateFields: _this.validateFields, + submit: _this.submit, + getInternalHooks: _this.getInternalHooks + }; + }; + this.getInternalHooks = function(key2) { + if (key2 === HOOK_MARK) { + _this.formHooked = true; + return { + dispatch: _this.dispatch, + initEntityValue: _this.initEntityValue, + registerField: _this.registerField, + useSubscribe: _this.useSubscribe, + setInitialValues: _this.setInitialValues, + setCallbacks: _this.setCallbacks, + setValidateMessages: _this.setValidateMessages, + getFields: _this.getFields, + setPreserve: _this.setPreserve + }; + } + warning_default(false, "`getInternalHooks` is internal usage. Should not call directly."); + return null; + }; + this.useSubscribe = function(subscribable) { + _this.subscribable = subscribable; + }; + this.setInitialValues = function(initialValues, init) { + _this.initialValues = initialValues || {}; + if (init) { + _this.store = setValues({}, initialValues, _this.store); + } + }; + this.getInitialValue = function(namePath) { + return getValue(_this.initialValues, namePath); + }; + this.setCallbacks = function(callbacks) { + _this.callbacks = callbacks; + }; + this.setValidateMessages = function(validateMessages) { + _this.validateMessages = validateMessages; + }; + this.setPreserve = function(preserve) { + _this.preserve = preserve; + }; + this.timeoutId = null; + this.warningUnhooked = function() { + if (!_this.timeoutId && typeof window !== "undefined") { + _this.timeoutId = setTimeout(function() { + _this.timeoutId = null; + if (!_this.formHooked) { + warning_default(false, "Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?"); + } + }); + } + }; + this.getFieldEntities = function() { + var pure = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + if (!pure) { + return _this.fieldEntities; + } + return _this.fieldEntities.filter(function(field) { + return field.getNamePath().length; + }); + }; + this.getFieldsMap = function() { + var pure = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var cache = new NameMap_default(); + _this.getFieldEntities(pure).forEach(function(field) { + var namePath = field.getNamePath(); + cache.set(namePath, field); + }); + return cache; + }; + this.getFieldEntitiesForNamePathList = function(nameList) { + if (!nameList) { + return _this.getFieldEntities(true); + } + var cache = _this.getFieldsMap(true); + return nameList.map(function(name) { + var namePath = getNamePath(name); + return cache.get(namePath) || { + INVALIDATE_NAME_PATH: getNamePath(name) + }; + }); + }; + this.getFieldsValue = function(nameList, filterFunc) { + _this.warningUnhooked(); + if (nameList === true && !filterFunc) { + return _this.store; + } + var fieldEntities = _this.getFieldEntitiesForNamePathList(Array.isArray(nameList) ? nameList : null); + var filteredNameList = []; + fieldEntities.forEach(function(entity) { + var _entity$isListField; + var namePath = "INVALIDATE_NAME_PATH" in entity ? entity.INVALIDATE_NAME_PATH : entity.getNamePath(); + if (!nameList && ((_entity$isListField = entity.isListField) === null || _entity$isListField === void 0 ? void 0 : _entity$isListField.call(entity))) { + return; + } + if (!filterFunc) { + filteredNameList.push(namePath); + } else { + var meta = "getMeta" in entity ? entity.getMeta() : null; + if (filterFunc(meta)) { + filteredNameList.push(namePath); + } + } + }); + return cloneByNamePathList(_this.store, filteredNameList.map(getNamePath)); + }; + this.getFieldValue = function(name) { + _this.warningUnhooked(); + var namePath = getNamePath(name); + return getValue(_this.store, namePath); + }; + this.getFieldsError = function(nameList) { + _this.warningUnhooked(); + var fieldEntities = _this.getFieldEntitiesForNamePathList(nameList); + return fieldEntities.map(function(entity, index2) { + if (entity && !("INVALIDATE_NAME_PATH" in entity)) { + return { + name: entity.getNamePath(), + errors: entity.getErrors() + }; + } + return { + name: getNamePath(nameList[index2]), + errors: [] + }; + }); + }; + this.getFieldError = function(name) { + _this.warningUnhooked(); + var namePath = getNamePath(name); + var fieldError = _this.getFieldsError([namePath])[0]; + return fieldError.errors; + }; + this.isFieldsTouched = function() { + _this.warningUnhooked(); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + var arg0 = args[0], arg1 = args[1]; + var namePathList; + var isAllFieldsTouched = false; + if (args.length === 0) { + namePathList = null; + } else if (args.length === 1) { + if (Array.isArray(arg0)) { + namePathList = arg0.map(getNamePath); + isAllFieldsTouched = false; + } else { + namePathList = null; + isAllFieldsTouched = arg0; + } + } else { + namePathList = arg0.map(getNamePath); + isAllFieldsTouched = arg1; + } + var fieldEntities = _this.getFieldEntities(true); + var isFieldTouched = function isFieldTouched2(field) { + return field.isFieldTouched(); + }; + if (!namePathList) { + return isAllFieldsTouched ? fieldEntities.every(isFieldTouched) : fieldEntities.some(isFieldTouched); + } + var map = new NameMap_default(); + namePathList.forEach(function(shortNamePath) { + map.set(shortNamePath, []); + }); + fieldEntities.forEach(function(field) { + var fieldNamePath = field.getNamePath(); + namePathList.forEach(function(shortNamePath) { + if (shortNamePath.every(function(nameUnit, i) { + return fieldNamePath[i] === nameUnit; + })) { + map.update(shortNamePath, function(list) { + return [].concat(_toConsumableArray(list), [field]); + }); + } + }); + }); + var isNamePathListTouched = function isNamePathListTouched2(entities) { + return entities.some(isFieldTouched); + }; + var namePathListEntities = map.map(function(_ref) { + var value = _ref.value; + return value; + }); + return isAllFieldsTouched ? namePathListEntities.every(isNamePathListTouched) : namePathListEntities.some(isNamePathListTouched); + }; + this.isFieldTouched = function(name) { + _this.warningUnhooked(); + return _this.isFieldsTouched([name]); + }; + this.isFieldsValidating = function(nameList) { + _this.warningUnhooked(); + var fieldEntities = _this.getFieldEntities(); + if (!nameList) { + return fieldEntities.some(function(testField) { + return testField.isFieldValidating(); + }); + } + var namePathList = nameList.map(getNamePath); + return fieldEntities.some(function(testField) { + var fieldNamePath = testField.getNamePath(); + return containsNamePath(namePathList, fieldNamePath) && testField.isFieldValidating(); + }); + }; + this.isFieldValidating = function(name) { + _this.warningUnhooked(); + return _this.isFieldsValidating([name]); + }; + this.resetWithFieldInitialValue = function() { + var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + var cache = new NameMap_default(); + var fieldEntities = _this.getFieldEntities(true); + fieldEntities.forEach(function(field) { + var initialValue = field.props.initialValue; + var namePath = field.getNamePath(); + if (initialValue !== void 0) { + var records = cache.get(namePath) || new Set(); + records.add({ + entity: field, + value: initialValue + }); + cache.set(namePath, records); + } + }); + var resetWithFields = function resetWithFields2(entities) { + entities.forEach(function(field) { + var initialValue = field.props.initialValue; + if (initialValue !== void 0) { + var namePath = field.getNamePath(); + var formInitialValue = _this.getInitialValue(namePath); + if (formInitialValue !== void 0) { + warning_default(false, "Form already set 'initialValues' with path '".concat(namePath.join("."), "'. Field can not overwrite it.")); + } else { + var records = cache.get(namePath); + if (records && records.size > 1) { + warning_default(false, "Multiple Field with path '".concat(namePath.join("."), "' set 'initialValue'. Can not decide which one to pick.")); + } else if (records) { + var originValue = _this.getFieldValue(namePath); + if (!info.skipExist || originValue === void 0) { + _this.store = setValue(_this.store, namePath, _toConsumableArray(records)[0].value); + } + } + } + } + }); + }; + var requiredFieldEntities; + if (info.entities) { + requiredFieldEntities = info.entities; + } else if (info.namePathList) { + requiredFieldEntities = []; + info.namePathList.forEach(function(namePath) { + var records = cache.get(namePath); + if (records) { + var _requiredFieldEntitie; + (_requiredFieldEntitie = requiredFieldEntities).push.apply(_requiredFieldEntitie, _toConsumableArray(_toConsumableArray(records).map(function(r) { + return r.entity; + }))); + } + }); + } else { + requiredFieldEntities = fieldEntities; + } + resetWithFields(requiredFieldEntities); + }; + this.resetFields = function(nameList) { + _this.warningUnhooked(); + var prevStore = _this.store; + if (!nameList) { + _this.store = setValues({}, _this.initialValues); + _this.resetWithFieldInitialValue(); + _this.notifyObservers(prevStore, null, { + type: "reset" + }); + return; + } + var namePathList = nameList.map(getNamePath); + namePathList.forEach(function(namePath) { + var initialValue = _this.getInitialValue(namePath); + _this.store = setValue(_this.store, namePath, initialValue); + }); + _this.resetWithFieldInitialValue({ + namePathList + }); + _this.notifyObservers(prevStore, namePathList, { + type: "reset" + }); + }; + this.setFields = function(fields) { + _this.warningUnhooked(); + var prevStore = _this.store; + fields.forEach(function(fieldData) { + var name = fieldData.name, errors = fieldData.errors, data = _objectWithoutProperties(fieldData, ["name", "errors"]); + var namePath = getNamePath(name); + if ("value" in data) { + _this.store = setValue(_this.store, namePath, data.value); + } + _this.notifyObservers(prevStore, [namePath], { + type: "setField", + data: fieldData + }); + }); + }; + this.getFields = function() { + var entities = _this.getFieldEntities(true); + var fields = entities.map(function(field) { + var namePath = field.getNamePath(); + var meta = field.getMeta(); + var fieldData = _objectSpread2(_objectSpread2({}, meta), {}, { + name: namePath, + value: _this.getFieldValue(namePath) + }); + Object.defineProperty(fieldData, "originRCField", { + value: true + }); + return fieldData; + }); + return fields; + }; + this.initEntityValue = function(entity) { + var initialValue = entity.props.initialValue; + if (initialValue !== void 0) { + var namePath = entity.getNamePath(); + var prevValue = getValue(_this.store, namePath); + if (prevValue === void 0) { + _this.store = setValue(_this.store, namePath, initialValue); + } + } + }; + this.registerField = function(entity) { + _this.fieldEntities.push(entity); + if (entity.props.initialValue !== void 0) { + var prevStore = _this.store; + _this.resetWithFieldInitialValue({ + entities: [entity], + skipExist: true + }); + _this.notifyObservers(prevStore, [entity.getNamePath()], { + type: "valueUpdate", + source: "internal" + }); + } + return function(isListField, preserve) { + var subNamePath = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; + _this.fieldEntities = _this.fieldEntities.filter(function(item) { + return item !== entity; + }); + var mergedPreserve = preserve !== void 0 ? preserve : _this.preserve; + if (mergedPreserve === false && (!isListField || subNamePath.length > 1)) { + var namePath = entity.getNamePath(); + var defaultValue = isListField ? void 0 : getValue(_this.initialValues, namePath); + if (namePath.length && _this.getFieldValue(namePath) !== defaultValue && _this.fieldEntities.every(function(field) { + return !matchNamePath(field.getNamePath(), namePath); + })) { + _this.store = setValue(_this.store, namePath, defaultValue, true); + } + } + }; + }; + this.dispatch = function(action) { + switch (action.type) { + case "updateValue": { + var namePath = action.namePath, value = action.value; + _this.updateValue(namePath, value); + break; + } + case "validateField": { + var _namePath = action.namePath, triggerName = action.triggerName; + _this.validateFields([_namePath], { + triggerName + }); + break; + } + default: + } + }; + this.notifyObservers = function(prevStore, namePathList, info) { + if (_this.subscribable) { + var mergedInfo = _objectSpread2(_objectSpread2({}, info), {}, { + store: _this.getFieldsValue(true) + }); + _this.getFieldEntities().forEach(function(_ref2) { + var onStoreChange = _ref2.onStoreChange; + onStoreChange(prevStore, namePathList, mergedInfo); + }); + } else { + _this.forceRootUpdate(); + } + }; + this.updateValue = function(name, value) { + var namePath = getNamePath(name); + var prevStore = _this.store; + _this.store = setValue(_this.store, namePath, value); + _this.notifyObservers(prevStore, [namePath], { + type: "valueUpdate", + source: "internal" + }); + var childrenFields = _this.getDependencyChildrenFields(namePath); + if (childrenFields.length) { + _this.validateFields(childrenFields); + } + _this.notifyObservers(prevStore, childrenFields, { + type: "dependenciesUpdate", + relatedFields: [namePath].concat(_toConsumableArray(childrenFields)) + }); + var onValuesChange = _this.callbacks.onValuesChange; + if (onValuesChange) { + var changedValues = cloneByNamePathList(_this.store, [namePath]); + onValuesChange(changedValues, _this.getFieldsValue()); + } + _this.triggerOnFieldsChange([namePath].concat(_toConsumableArray(childrenFields))); + }; + this.setFieldsValue = function(store) { + _this.warningUnhooked(); + var prevStore = _this.store; + if (store) { + _this.store = setValues(_this.store, store); + } + _this.notifyObservers(prevStore, null, { + type: "valueUpdate", + source: "external" + }); + }; + this.getDependencyChildrenFields = function(rootNamePath) { + var children = new Set(); + var childrenFields = []; + var dependencies2fields = new NameMap_default(); + _this.getFieldEntities().forEach(function(field) { + var dependencies = field.props.dependencies; + (dependencies || []).forEach(function(dependency) { + var dependencyNamePath = getNamePath(dependency); + dependencies2fields.update(dependencyNamePath, function() { + var fields = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Set(); + fields.add(field); + return fields; + }); + }); + }); + var fillChildren = function fillChildren2(namePath) { + var fields = dependencies2fields.get(namePath) || new Set(); + fields.forEach(function(field) { + if (!children.has(field)) { + children.add(field); + var fieldNamePath = field.getNamePath(); + if (field.isFieldDirty() && fieldNamePath.length) { + childrenFields.push(fieldNamePath); + fillChildren2(fieldNamePath); + } + } + }); + }; + fillChildren(rootNamePath); + return childrenFields; + }; + this.triggerOnFieldsChange = function(namePathList, filedErrors) { + var onFieldsChange = _this.callbacks.onFieldsChange; + if (onFieldsChange) { + var fields = _this.getFields(); + if (filedErrors) { + var cache = new NameMap_default(); + filedErrors.forEach(function(_ref3) { + var name = _ref3.name, errors = _ref3.errors; + cache.set(name, errors); + }); + fields.forEach(function(field) { + field.errors = cache.get(field.name) || field.errors; + }); + } + var changedFields = fields.filter(function(_ref4) { + var fieldName = _ref4.name; + return containsNamePath(namePathList, fieldName); + }); + onFieldsChange(changedFields, fields); + } + }; + this.validateFields = function(nameList, options) { + _this.warningUnhooked(); + var provideNameList = !!nameList; + var namePathList = provideNameList ? nameList.map(getNamePath) : []; + var promiseList = []; + _this.getFieldEntities(true).forEach(function(field) { + if (!provideNameList) { + namePathList.push(field.getNamePath()); + } + if ((options === null || options === void 0 ? void 0 : options.recursive) && provideNameList) { + var namePath = field.getNamePath(); + if (namePath.every(function(nameUnit, i) { + return nameList[i] === nameUnit || nameList[i] === void 0; + })) { + namePathList.push(namePath); + } + } + if (!field.props.rules || !field.props.rules.length) { + return; + } + var fieldNamePath = field.getNamePath(); + if (!provideNameList || containsNamePath(namePathList, fieldNamePath)) { + var promise = field.validateRules(_objectSpread2({ + validateMessages: _objectSpread2(_objectSpread2({}, defaultValidateMessages), _this.validateMessages) + }, options)); + promiseList.push(promise.then(function() { + return { + name: fieldNamePath, + errors: [] + }; + }).catch(function(errors) { + return Promise.reject({ + name: fieldNamePath, + errors + }); + })); + } + }); + var summaryPromise = allPromiseFinish(promiseList); + _this.lastValidatePromise = summaryPromise; + summaryPromise.catch(function(results) { + return results; + }).then(function(results) { + var resultNamePathList = results.map(function(_ref5) { + var name = _ref5.name; + return name; + }); + _this.notifyObservers(_this.store, resultNamePathList, { + type: "validateFinish" + }); + _this.triggerOnFieldsChange(resultNamePathList, results); + }); + var returnPromise = summaryPromise.then(function() { + if (_this.lastValidatePromise === summaryPromise) { + return Promise.resolve(_this.getFieldsValue(namePathList)); + } + return Promise.reject([]); + }).catch(function(results) { + var errorList = results.filter(function(result) { + return result && result.errors.length; + }); + return Promise.reject({ + values: _this.getFieldsValue(namePathList), + errorFields: errorList, + outOfDate: _this.lastValidatePromise !== summaryPromise + }); + }); + returnPromise.catch(function(e) { + return e; + }); + return returnPromise; + }; + this.submit = function() { + _this.warningUnhooked(); + _this.validateFields().then(function(values) { + var onFinish = _this.callbacks.onFinish; + if (onFinish) { + try { + onFinish(values); + } catch (err) { + console.error(err); + } + } + }).catch(function(e) { + var onFinishFailed = _this.callbacks.onFinishFailed; + if (onFinishFailed) { + onFinishFailed(e); + } + }); + }; + this.forceRootUpdate = forceRootUpdate; + }; + function useForm(form) { + var formRef = React8.useRef(); + var _React$useState = React8.useState({}), _React$useState2 = _slicedToArray(_React$useState, 2), forceUpdate = _React$useState2[1]; + if (!formRef.current) { + if (form) { + formRef.current = form; + } else { + var forceReRender = function forceReRender2() { + forceUpdate({}); + }; + var formStore = new FormStore(forceReRender); + formRef.current = formStore.getForm(); + } + } + return [formRef.current]; + } + var useForm_default = useForm; + + // node_modules/rc-field-form/es/Form.js + var React10 = __toModule(require_react()); + + // node_modules/rc-field-form/es/FormContext.js + var React9 = __toModule(require_react()); + var FormContext = /* @__PURE__ */ React9.createContext({ + triggerFormChange: function triggerFormChange() { + }, + triggerFormFinish: function triggerFormFinish() { + }, + registerForm: function registerForm() { + }, + unregisterForm: function unregisterForm() { + } + }); + var FormProvider = function FormProvider2(_ref) { + var validateMessages = _ref.validateMessages, onFormChange = _ref.onFormChange, onFormFinish = _ref.onFormFinish, children = _ref.children; + var formContext = React9.useContext(FormContext); + var formsRef = React9.useRef({}); + return /* @__PURE__ */ React9.createElement(FormContext.Provider, { + value: _objectSpread2(_objectSpread2({}, formContext), {}, { + validateMessages: _objectSpread2(_objectSpread2({}, formContext.validateMessages), validateMessages), + triggerFormChange: function triggerFormChange2(name, changedFields) { + if (onFormChange) { + onFormChange(name, { + changedFields, + forms: formsRef.current + }); + } + formContext.triggerFormChange(name, changedFields); + }, + triggerFormFinish: function triggerFormFinish2(name, values) { + if (onFormFinish) { + onFormFinish(name, { + values, + forms: formsRef.current + }); + } + formContext.triggerFormFinish(name, values); + }, + registerForm: function registerForm2(name, form) { + if (name) { + formsRef.current = _objectSpread2(_objectSpread2({}, formsRef.current), {}, _defineProperty({}, name, form)); + } + formContext.registerForm(name, form); + }, + unregisterForm: function unregisterForm2(name) { + var newForms = _objectSpread2({}, formsRef.current); + delete newForms[name]; + formsRef.current = newForms; + formContext.unregisterForm(name); + } + }) + }, children); + }; + var FormContext_default = FormContext; + + // node_modules/rc-field-form/es/Form.js + var Form = function Form2(_ref, ref) { + var name = _ref.name, initialValues = _ref.initialValues, fields = _ref.fields, form = _ref.form, preserve = _ref.preserve, children = _ref.children, _ref$component = _ref.component, Component14 = _ref$component === void 0 ? "form" : _ref$component, validateMessages = _ref.validateMessages, _ref$validateTrigger = _ref.validateTrigger, validateTrigger = _ref$validateTrigger === void 0 ? "onChange" : _ref$validateTrigger, onValuesChange = _ref.onValuesChange, _onFieldsChange = _ref.onFieldsChange, _onFinish = _ref.onFinish, onFinishFailed = _ref.onFinishFailed, restProps = _objectWithoutProperties(_ref, ["name", "initialValues", "fields", "form", "preserve", "children", "component", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed"]); + var formContext = React10.useContext(FormContext_default); + var _useForm = useForm_default(form), _useForm2 = _slicedToArray(_useForm, 1), formInstance = _useForm2[0]; + var _formInstance$getInte = formInstance.getInternalHooks(HOOK_MARK), useSubscribe = _formInstance$getInte.useSubscribe, setInitialValues = _formInstance$getInte.setInitialValues, setCallbacks = _formInstance$getInte.setCallbacks, setValidateMessages = _formInstance$getInte.setValidateMessages, setPreserve = _formInstance$getInte.setPreserve; + React10.useImperativeHandle(ref, function() { + return formInstance; + }); + React10.useEffect(function() { + formContext.registerForm(name, formInstance); + return function() { + formContext.unregisterForm(name); + }; + }, [formContext, formInstance, name]); + setValidateMessages(_objectSpread2(_objectSpread2({}, formContext.validateMessages), validateMessages)); + setCallbacks({ + onValuesChange, + onFieldsChange: function onFieldsChange(changedFields) { + formContext.triggerFormChange(name, changedFields); + if (_onFieldsChange) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + _onFieldsChange.apply(void 0, [changedFields].concat(rest)); + } + }, + onFinish: function onFinish(values2) { + formContext.triggerFormFinish(name, values2); + if (_onFinish) { + _onFinish(values2); + } + }, + onFinishFailed + }); + setPreserve(preserve); + var mountRef = React10.useRef(null); + setInitialValues(initialValues, !mountRef.current); + if (!mountRef.current) { + mountRef.current = true; + } + var childrenNode = children; + var childrenRenderProps = typeof children === "function"; + if (childrenRenderProps) { + var values = formInstance.getFieldsValue(true); + childrenNode = children(values, formInstance); + } + useSubscribe(!childrenRenderProps); + var prevFieldsRef = React10.useRef(); + React10.useEffect(function() { + if (!isSimilar(prevFieldsRef.current || [], fields || [])) { + formInstance.setFields(fields || []); + } + prevFieldsRef.current = fields; + }, [fields, formInstance]); + var formContextValue = React10.useMemo(function() { + return _objectSpread2(_objectSpread2({}, formInstance), {}, { + validateTrigger + }); + }, [formInstance, validateTrigger]); + var wrapperNode = /* @__PURE__ */ React10.createElement(FieldContext_default.Provider, { + value: formContextValue + }, childrenNode); + if (Component14 === false) { + return wrapperNode; + } + return /* @__PURE__ */ React10.createElement(Component14, _extends({}, restProps, { + onSubmit: function onSubmit(event) { + event.preventDefault(); + event.stopPropagation(); + formInstance.submit(); + }, + onReset: function onReset(event) { + var _restProps$onReset; + event.preventDefault(); + formInstance.resetFields(); + (_restProps$onReset = restProps.onReset) === null || _restProps$onReset === void 0 ? void 0 : _restProps$onReset.call(restProps, event); + } + }), wrapperNode); + }; + var Form_default = Form; + + // node_modules/rc-field-form/es/index.js + var InternalForm = /* @__PURE__ */ React11.forwardRef(Form_default); + var RefForm = InternalForm; + RefForm.FormProvider = FormProvider; + RefForm.Field = Field_default; + RefForm.List = List_default; + RefForm.useForm = useForm_default; + + // node_modules/rc-util/es/hooks/useMemo.js + var React12 = __toModule(require_react()); + function useMemo2(getValue4, condition, shouldUpdate) { + var cacheRef = React12.useRef({}); + if (!("value" in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) { + cacheRef.current.value = getValue4(); + cacheRef.current.condition = condition; + } + return cacheRef.current.value; + } + + // node_modules/antd/es/locale-provider/index.js + var React13 = __toModule(require_react()); + + // node_modules/antd/es/_util/devWarning.js + var devWarning_default = function(valid, component, message) { + warning_default(valid, "[antd: ".concat(component, "] ").concat(message)); + }; + + // node_modules/rc-pagination/es/locale/en_US.js + var en_US_default = { + items_per_page: "/ page", + jump_to: "Go to", + jump_to_confirm: "confirm", + page: "", + prev_page: "Previous Page", + next_page: "Next Page", + prev_5: "Previous 5 Pages", + next_5: "Next 5 Pages", + prev_3: "Previous 3 Pages", + next_3: "Next 3 Pages" + }; + + // node_modules/rc-picker/es/locale/en_US.js + var locale = { + locale: "en_US", + today: "Today", + now: "Now", + backToToday: "Back to today", + ok: "Ok", + clear: "Clear", + month: "Month", + year: "Year", + timeSelect: "select time", + dateSelect: "select date", + weekSelect: "Choose a week", + monthSelect: "Choose a month", + yearSelect: "Choose a year", + decadeSelect: "Choose a decade", + yearFormat: "YYYY", + dateFormat: "M/D/YYYY", + dayFormat: "D", + dateTimeFormat: "M/D/YYYY HH:mm:ss", + monthBeforeYear: true, + previousMonth: "Previous month (PageUp)", + nextMonth: "Next month (PageDown)", + previousYear: "Last year (Control + left)", + nextYear: "Next year (Control + right)", + previousDecade: "Last decade", + nextDecade: "Next decade", + previousCentury: "Last century", + nextCentury: "Next century" + }; + var en_US_default2 = locale; + + // node_modules/antd/es/time-picker/locale/en_US.js + var locale2 = { + placeholder: "Select time", + rangePlaceholder: ["Start time", "End time"] + }; + var en_US_default3 = locale2; + + // node_modules/antd/es/date-picker/locale/en_US.js + var locale3 = { + lang: _extends({ + placeholder: "Select date", + yearPlaceholder: "Select year", + quarterPlaceholder: "Select quarter", + monthPlaceholder: "Select month", + weekPlaceholder: "Select week", + rangePlaceholder: ["Start date", "End date"], + rangeYearPlaceholder: ["Start year", "End year"], + rangeMonthPlaceholder: ["Start month", "End month"], + rangeWeekPlaceholder: ["Start week", "End week"] + }, en_US_default2), + timePickerLocale: _extends({}, en_US_default3) + }; + var en_US_default4 = locale3; + + // node_modules/antd/es/calendar/locale/en_US.js + var en_US_default5 = en_US_default4; + + // node_modules/antd/es/locale/default.js + var typeTemplate2 = "${label} is not a valid ${type}"; + var localeValues = { + locale: "en", + Pagination: en_US_default, + DatePicker: en_US_default4, + TimePicker: en_US_default3, + Calendar: en_US_default5, + global: { + placeholder: "Please select" + }, + Table: { + filterTitle: "Filter menu", + filterConfirm: "OK", + filterReset: "Reset", + filterEmptyText: "No filters", + emptyText: "No data", + selectAll: "Select current page", + selectInvert: "Invert current page", + selectNone: "Clear all data", + selectionAll: "Select all data", + sortTitle: "Sort", + expand: "Expand row", + collapse: "Collapse row", + triggerDesc: "Click to sort descending", + triggerAsc: "Click to sort ascending", + cancelSort: "Click to cancel sorting" + }, + Modal: { + okText: "OK", + cancelText: "Cancel", + justOkText: "OK" + }, + Popconfirm: { + okText: "OK", + cancelText: "Cancel" + }, + Transfer: { + titles: ["", ""], + searchPlaceholder: "Search here", + itemUnit: "item", + itemsUnit: "items", + remove: "Remove", + selectCurrent: "Select current page", + removeCurrent: "Remove current page", + selectAll: "Select all data", + removeAll: "Remove all data", + selectInvert: "Invert current page" + }, + Upload: { + uploading: "Uploading...", + removeFile: "Remove file", + uploadError: "Upload error", + previewFile: "Preview file", + downloadFile: "Download file" + }, + Empty: { + description: "No Data" + }, + Icon: { + icon: "icon" + }, + Text: { + edit: "Edit", + copy: "Copy", + copied: "Copied", + expand: "Expand" + }, + PageHeader: { + back: "Back" + }, + Form: { + optional: "(optional)", + defaultValidateMessages: { + "default": "Field validation error for ${label}", + required: "Please enter ${label}", + "enum": "${label} must be one of [${enum}]", + whitespace: "${label} cannot be a blank character", + date: { + format: "${label} date format is invalid", + parse: "${label} cannot be converted to a date", + invalid: "${label} is an invalid date" + }, + types: { + string: typeTemplate2, + method: typeTemplate2, + array: typeTemplate2, + object: typeTemplate2, + number: typeTemplate2, + date: typeTemplate2, + "boolean": typeTemplate2, + integer: typeTemplate2, + "float": typeTemplate2, + regexp: typeTemplate2, + email: typeTemplate2, + url: typeTemplate2, + hex: typeTemplate2 + }, + string: { + len: "${label} must be ${len} characters", + min: "${label} must be at least ${min} characters", + max: "${label} must be up to ${max} characters", + range: "${label} must be between ${min}-${max} characters" + }, + number: { + len: "${label} must be equal to ${len}", + min: "${label} must be minimum ${min}", + max: "${label} must be maximum ${max}", + range: "${label} must be between ${min}-${max}" + }, + array: { + len: "Must be ${len} ${label}", + min: "At least ${min} ${label}", + max: "At most ${max} ${label}", + range: "The amount of ${label} must be between ${min}-${max}" + }, + pattern: { + mismatch: "${label} does not match the pattern ${pattern}" + } + } + }, + Image: { + preview: "Preview" + } + }; + var default_default = localeValues; + + // node_modules/antd/es/modal/locale.js + var runtimeLocale = _extends({}, default_default.Modal); + function changeConfirmLocale(newLocale) { + if (newLocale) { + runtimeLocale = _extends(_extends({}, runtimeLocale), newLocale); + } else { + runtimeLocale = _extends({}, default_default.Modal); + } + } + + // node_modules/antd/es/locale-provider/context.js + var import_react4 = __toModule(require_react()); + var LocaleContext = /* @__PURE__ */ (0, import_react4.createContext)(void 0); + var context_default = LocaleContext; + + // node_modules/antd/es/locale-provider/index.js + var ANT_MARK = "internalMark"; + var LocaleProvider = /* @__PURE__ */ function(_React$Component) { + _inherits(LocaleProvider2, _React$Component); + var _super = _createSuper(LocaleProvider2); + function LocaleProvider2(props) { + var _this; + _classCallCheck(this, LocaleProvider2); + _this = _super.call(this, props); + changeConfirmLocale(props.locale && props.locale.Modal); + devWarning_default(props._ANT_MARK__ === ANT_MARK, "LocaleProvider", "`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale"); + return _this; + } + _createClass(LocaleProvider2, [{ + key: "componentDidMount", + value: function componentDidMount() { + changeConfirmLocale(this.props.locale && this.props.locale.Modal); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var locale4 = this.props.locale; + if (prevProps.locale !== locale4) { + changeConfirmLocale(locale4 && locale4.Modal); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + changeConfirmLocale(); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, locale4 = _this$props.locale, children = _this$props.children; + return /* @__PURE__ */ React13.createElement(context_default.Provider, { + value: _extends(_extends({}, locale4), { + exist: true + }) + }, children); + } + }]); + return LocaleProvider2; + }(React13.Component); + LocaleProvider.defaultProps = { + locale: {} + }; + + // node_modules/antd/es/locale-provider/LocaleReceiver.js + var React14 = __toModule(require_react()); + + // node_modules/antd/es/locale-provider/default.js + var default_default2 = default_default; + + // node_modules/antd/es/locale-provider/LocaleReceiver.js + var LocaleReceiver = /* @__PURE__ */ function(_React$Component) { + _inherits(LocaleReceiver2, _React$Component); + var _super = _createSuper(LocaleReceiver2); + function LocaleReceiver2() { + _classCallCheck(this, LocaleReceiver2); + return _super.apply(this, arguments); + } + _createClass(LocaleReceiver2, [{ + key: "getLocale", + value: function getLocale() { + var _this$props = this.props, componentName = _this$props.componentName, defaultLocale = _this$props.defaultLocale; + var locale4 = defaultLocale || default_default2[componentName || "global"]; + var antLocale = this.context; + var localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; + return _extends(_extends({}, typeof locale4 === "function" ? locale4() : locale4), localeFromContext || {}); + } + }, { + key: "getLocaleCode", + value: function getLocaleCode() { + var antLocale = this.context; + var localeCode = antLocale && antLocale.locale; + if (antLocale && antLocale.exist && !localeCode) { + return default_default2.locale; + } + return localeCode; + } + }, { + key: "render", + value: function render() { + return this.props.children(this.getLocale(), this.getLocaleCode(), this.context); + } + }]); + return LocaleReceiver2; + }(React14.Component); + LocaleReceiver.defaultProps = { + componentName: "global" + }; + LocaleReceiver.contextType = context_default; + + // node_modules/antd/es/config-provider/context.js + var React19 = __toModule(require_react()); + + // node_modules/antd/es/config-provider/renderEmpty.js + var React18 = __toModule(require_react()); + + // node_modules/antd/es/empty/index.js + var React17 = __toModule(require_react()); + var import_classnames = __toModule(require_classnames()); + + // node_modules/antd/es/empty/empty.js + var React15 = __toModule(require_react()); + var Empty = function Empty2() { + var _React$useContext = React15.useContext(ConfigContext), getPrefixCls = _React$useContext.getPrefixCls; + var prefixCls = getPrefixCls("empty-img-default"); + return /* @__PURE__ */ React15.createElement("svg", { + className: prefixCls, + width: "184", + height: "152", + viewBox: "0 0 184 152", + xmlns: "http://www.w3.org/2000/svg" + }, /* @__PURE__ */ React15.createElement("g", { + fill: "none", + fillRule: "evenodd" + }, /* @__PURE__ */ React15.createElement("g", { + transform: "translate(24 31.67)" + }, /* @__PURE__ */ React15.createElement("ellipse", { + className: "".concat(prefixCls, "-ellipse"), + cx: "67.797", + cy: "106.89", + rx: "67.797", + ry: "12.668" + }), /* @__PURE__ */ React15.createElement("path", { + className: "".concat(prefixCls, "-path-1"), + d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z" + }), /* @__PURE__ */ React15.createElement("path", { + className: "".concat(prefixCls, "-path-2"), + d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z", + transform: "translate(13.56)" + }), /* @__PURE__ */ React15.createElement("path", { + className: "".concat(prefixCls, "-path-3"), + d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z" + }), /* @__PURE__ */ React15.createElement("path", { + className: "".concat(prefixCls, "-path-4"), + d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z" + })), /* @__PURE__ */ React15.createElement("path", { + className: "".concat(prefixCls, "-path-5"), + d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z" + }), /* @__PURE__ */ React15.createElement("g", { + className: "".concat(prefixCls, "-g"), + transform: "translate(149.65 15.383)" + }, /* @__PURE__ */ React15.createElement("ellipse", { + cx: "20.654", + cy: "3.167", + rx: "2.849", + ry: "2.815" + }), /* @__PURE__ */ React15.createElement("path", { + d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z" + })))); + }; + var empty_default = Empty; + + // node_modules/antd/es/empty/simple.js + var React16 = __toModule(require_react()); + var Simple = function Simple2() { + var _React$useContext = React16.useContext(ConfigContext), getPrefixCls = _React$useContext.getPrefixCls; + var prefixCls = getPrefixCls("empty-img-simple"); + return /* @__PURE__ */ React16.createElement("svg", { + className: prefixCls, + width: "64", + height: "41", + viewBox: "0 0 64 41", + xmlns: "http://www.w3.org/2000/svg" + }, /* @__PURE__ */ React16.createElement("g", { + transform: "translate(0 1)", + fill: "none", + fillRule: "evenodd" + }, /* @__PURE__ */ React16.createElement("ellipse", { + className: "".concat(prefixCls, "-ellipse"), + cx: "32", + cy: "33", + rx: "32", + ry: "7" + }), /* @__PURE__ */ React16.createElement("g", { + className: "".concat(prefixCls, "-g"), + fillRule: "nonzero" + }, /* @__PURE__ */ React16.createElement("path", { + d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" + }), /* @__PURE__ */ React16.createElement("path", { + d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", + className: "".concat(prefixCls, "-path") + })))); + }; + var simple_default = Simple; + + // node_modules/antd/es/empty/index.js + var __rest = function(s, e) { + var t = {}; + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + } + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + var defaultEmptyImg = /* @__PURE__ */ React17.createElement(empty_default, null); + var simpleEmptyImg = /* @__PURE__ */ React17.createElement(simple_default, null); + var Empty3 = function Empty4(_a) { + var className = _a.className, customizePrefixCls = _a.prefixCls, _a$image = _a.image, image = _a$image === void 0 ? defaultEmptyImg : _a$image, description = _a.description, children = _a.children, imageStyle = _a.imageStyle, restProps = __rest(_a, ["className", "prefixCls", "image", "description", "children", "imageStyle"]); + var _React$useContext = React17.useContext(ConfigContext), getPrefixCls = _React$useContext.getPrefixCls, direction = _React$useContext.direction; + return /* @__PURE__ */ React17.createElement(LocaleReceiver, { + componentName: "Empty" + }, function(locale4) { + var _classNames; + var prefixCls = getPrefixCls("empty", customizePrefixCls); + var des = typeof description !== "undefined" ? description : locale4.description; + var alt = typeof des === "string" ? des : "empty"; + var imageNode = null; + if (typeof image === "string") { + imageNode = /* @__PURE__ */ React17.createElement("img", { + alt, + src: image + }); + } else { + imageNode = image; + } + return /* @__PURE__ */ React17.createElement("div", _extends({ + className: (0, import_classnames.default)(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-normal"), image === simpleEmptyImg), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === "rtl"), _classNames), className) + }, restProps), /* @__PURE__ */ React17.createElement("div", { + className: "".concat(prefixCls, "-image"), + style: imageStyle + }, imageNode), des && /* @__PURE__ */ React17.createElement("div", { + className: "".concat(prefixCls, "-description") + }, des), children && /* @__PURE__ */ React17.createElement("div", { + className: "".concat(prefixCls, "-footer") + }, children)); + }); + }; + Empty3.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg; + Empty3.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg; + var empty_default2 = Empty3; + + // node_modules/antd/es/config-provider/renderEmpty.js + var renderEmpty = function renderEmpty2(componentName) { + return /* @__PURE__ */ React18.createElement(ConfigConsumer, null, function(_ref) { + var getPrefixCls = _ref.getPrefixCls; + var prefix = getPrefixCls("empty"); + switch (componentName) { + case "Table": + case "List": + return /* @__PURE__ */ React18.createElement(empty_default2, { + image: empty_default2.PRESENTED_IMAGE_SIMPLE + }); + case "Select": + case "TreeSelect": + case "Cascader": + case "Transfer": + case "Mentions": + return /* @__PURE__ */ React18.createElement(empty_default2, { + image: empty_default2.PRESENTED_IMAGE_SIMPLE, + className: "".concat(prefix, "-small") + }); + default: + return /* @__PURE__ */ React18.createElement(empty_default2, null); + } + }); + }; + var renderEmpty_default = renderEmpty; + + // node_modules/antd/es/config-provider/context.js + var defaultGetPrefixCls = function defaultGetPrefixCls2(suffixCls, customizePrefixCls) { + if (customizePrefixCls) + return customizePrefixCls; + return suffixCls ? "ant-".concat(suffixCls) : "ant"; + }; + var ConfigContext = /* @__PURE__ */ React19.createContext({ + getPrefixCls: defaultGetPrefixCls, + renderEmpty: renderEmpty_default + }); + var ConfigConsumer = ConfigContext.Consumer; + + // node_modules/antd/es/config-provider/SizeContext.js + var React20 = __toModule(require_react()); + var SizeContext = /* @__PURE__ */ React20.createContext(void 0); + var SizeContextProvider = function SizeContextProvider2(_ref) { + var children = _ref.children, size = _ref.size; + return /* @__PURE__ */ React20.createElement(SizeContext.Consumer, null, function(originSize) { + return /* @__PURE__ */ React20.createElement(SizeContext.Provider, { + value: size || originSize + }, children); + }); + }; + var SizeContext_default = SizeContext; + + // node_modules/antd/es/message/index.js + var React39 = __toModule(require_react()); + var import_classnames6 = __toModule(require_classnames()); + + // node_modules/rc-notification/es/Notification.js + var React30 = __toModule(require_react()); + var import_react11 = __toModule(require_react()); + var import_react_dom3 = __toModule(require_react_dom()); + var import_classnames4 = __toModule(require_classnames()); + + // node_modules/rc-motion/es/CSSMotion.js + var React26 = __toModule(require_react()); + var import_react9 = __toModule(require_react()); + var import_classnames2 = __toModule(require_classnames()); + + // node_modules/rc-util/es/Dom/canUseDom.js + function canUseDom() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); + } + + // node_modules/rc-motion/es/util/motion.js + function makePrefixMap(styleProp, eventName) { + var prefixes = {}; + prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); + prefixes["Webkit".concat(styleProp)] = "webkit".concat(eventName); + prefixes["Moz".concat(styleProp)] = "moz".concat(eventName); + prefixes["ms".concat(styleProp)] = "MS".concat(eventName); + prefixes["O".concat(styleProp)] = "o".concat(eventName.toLowerCase()); + return prefixes; + } + function getVendorPrefixes(domSupport, win) { + var prefixes = { + animationend: makePrefixMap("Animation", "AnimationEnd"), + transitionend: makePrefixMap("Transition", "TransitionEnd") + }; + if (domSupport) { + if (!("AnimationEvent" in win)) { + delete prefixes.animationend.animation; + } + if (!("TransitionEvent" in win)) { + delete prefixes.transitionend.transition; + } + } + return prefixes; + } + var vendorPrefixes = getVendorPrefixes(canUseDom(), typeof window !== "undefined" ? window : {}); + var style = {}; + if (canUseDom()) { + _document$createEleme = document.createElement("div"); + style = _document$createEleme.style; + } + var _document$createEleme; + var prefixedEventNames = {}; + function getVendorPrefixedEventName(eventName) { + if (prefixedEventNames[eventName]) { + return prefixedEventNames[eventName]; + } + var prefixMap = vendorPrefixes[eventName]; + if (prefixMap) { + var stylePropList = Object.keys(prefixMap); + var len = stylePropList.length; + for (var i = 0; i < len; i += 1) { + var styleProp = stylePropList[i]; + if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) { + prefixedEventNames[eventName] = prefixMap[styleProp]; + return prefixedEventNames[eventName]; + } + } + } + return ""; + } + var internalAnimationEndName = getVendorPrefixedEventName("animationend"); + var internalTransitionEndName = getVendorPrefixedEventName("transitionend"); + var supportTransition = !!(internalAnimationEndName && internalTransitionEndName); + var animationEndName = internalAnimationEndName || "animationend"; + var transitionEndName = internalTransitionEndName || "transitionend"; + function getTransitionName(transitionName2, transitionType) { + if (!transitionName2) + return null; + if (_typeof(transitionName2) === "object") { + var type2 = transitionType.replace(/-\w/g, function(match) { + return match[1].toUpperCase(); + }); + return transitionName2[type2]; + } + return "".concat(transitionName2, "-").concat(transitionType); + } + + // node_modules/rc-motion/es/interface.js + var STATUS_NONE = "none"; + var STATUS_APPEAR = "appear"; + var STATUS_ENTER = "enter"; + var STATUS_LEAVE = "leave"; + var STEP_NONE = "none"; + var STEP_PREPARE = "prepare"; + var STEP_START = "start"; + var STEP_ACTIVE = "active"; + var STEP_ACTIVATED = "end"; + + // node_modules/rc-motion/es/hooks/useStatus.js + var React24 = __toModule(require_react()); + var import_react8 = __toModule(require_react()); + + // node_modules/rc-motion/es/hooks/useState.js + var import_react5 = __toModule(require_react()); + function useMountStatus(defaultValue) { + var destroyRef = (0, import_react5.useRef)(false); + var _useState = (0, import_react5.useState)(defaultValue), _useState2 = _slicedToArray(_useState, 2), val = _useState2[0], setVal = _useState2[1]; + function setValue2(next) { + if (!destroyRef.current) { + setVal(next); + } + } + (0, import_react5.useEffect)(function() { + return function() { + destroyRef.current = true; + }; + }, []); + return [val, setValue2]; + } + + // node_modules/rc-motion/es/hooks/useIsomorphicLayoutEffect.js + var import_react6 = __toModule(require_react()); + var useIsomorphicLayoutEffect = canUseDom() ? import_react6.useLayoutEffect : import_react6.useEffect; + var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect; + + // node_modules/rc-motion/es/hooks/useStepQueue.js + var React22 = __toModule(require_react()); + + // node_modules/rc-motion/es/hooks/useNextFrame.js + var React21 = __toModule(require_react()); + + // node_modules/rc-util/es/raf.js + var raf = function raf2(callback) { + return +setTimeout(callback, 16); + }; + var caf = function caf2(num) { + return clearTimeout(num); + }; + if (typeof window !== "undefined" && "requestAnimationFrame" in window) { + raf = function raf3(callback) { + return window.requestAnimationFrame(callback); + }; + caf = function caf3(handle) { + return window.cancelAnimationFrame(handle); + }; + } + var rafUUID = 0; + var rafIds = new Map(); + function cleanup(id2) { + rafIds.delete(id2); + } + function wrapperRaf(callback) { + var times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1; + rafUUID += 1; + var id2 = rafUUID; + function callRef(leftTimes) { + if (leftTimes === 0) { + cleanup(id2); + callback(); + } else { + var realId = raf(function() { + callRef(leftTimes - 1); + }); + rafIds.set(id2, realId); + } + } + callRef(times); + return id2; + } + wrapperRaf.cancel = function(id2) { + var realId = rafIds.get(id2); + cleanup(realId); + return caf(realId); + }; + + // node_modules/rc-motion/es/hooks/useNextFrame.js + var useNextFrame_default = function() { + var nextFrameRef = React21.useRef(null); + function cancelNextFrame() { + wrapperRaf.cancel(nextFrameRef.current); + } + function nextFrame(callback) { + var delay = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2; + cancelNextFrame(); + var nextFrameId = wrapperRaf(function() { + if (delay <= 1) { + callback({ + isCanceled: function isCanceled() { + return nextFrameId !== nextFrameRef.current; + } + }); + } else { + nextFrame(callback, delay - 1); + } + }); + nextFrameRef.current = nextFrameId; + } + React21.useEffect(function() { + return function() { + cancelNextFrame(); + }; + }, []); + return [nextFrame, cancelNextFrame]; + }; + + // node_modules/rc-motion/es/hooks/useStepQueue.js + var STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED]; + var SkipStep = false; + var DoStep = true; + function isActive(step) { + return step === STEP_ACTIVE || step === STEP_ACTIVATED; + } + var useStepQueue_default = function(status, callback) { + var _React$useState = React22.useState(STEP_NONE), _React$useState2 = _slicedToArray(_React$useState, 2), step = _React$useState2[0], setStep = _React$useState2[1]; + var _useNextFrame = useNextFrame_default(), _useNextFrame2 = _slicedToArray(_useNextFrame, 2), nextFrame = _useNextFrame2[0], cancelNextFrame = _useNextFrame2[1]; + function startQueue() { + setStep(STEP_PREPARE); + } + useIsomorphicLayoutEffect_default(function() { + if (step !== STEP_NONE && step !== STEP_ACTIVATED) { + var index2 = STEP_QUEUE.indexOf(step); + var nextStep = STEP_QUEUE[index2 + 1]; + var result = callback(step); + if (result === SkipStep) { + setStep(nextStep); + } else { + nextFrame(function(info) { + function doNext() { + if (info.isCanceled()) + return; + setStep(nextStep); + } + if (result === true) { + doNext(); + } else { + Promise.resolve(result).then(doNext); + } + }); + } + } + }, [status, step]); + React22.useEffect(function() { + return function() { + cancelNextFrame(); + }; + }, []); + return [startQueue, step]; + }; + + // node_modules/rc-motion/es/hooks/useDomMotionEvents.js + var React23 = __toModule(require_react()); + var import_react7 = __toModule(require_react()); + var useDomMotionEvents_default = function(callback) { + var cacheElementRef = (0, import_react7.useRef)(); + var callbackRef = (0, import_react7.useRef)(callback); + callbackRef.current = callback; + var onInternalMotionEnd = React23.useCallback(function(event) { + callbackRef.current(event); + }, []); + function removeMotionEvents(element) { + if (element) { + element.removeEventListener(transitionEndName, onInternalMotionEnd); + element.removeEventListener(animationEndName, onInternalMotionEnd); + } + } + function patchMotionEvents(element) { + if (cacheElementRef.current && cacheElementRef.current !== element) { + removeMotionEvents(cacheElementRef.current); + } + if (element && element !== cacheElementRef.current) { + element.addEventListener(transitionEndName, onInternalMotionEnd); + element.addEventListener(animationEndName, onInternalMotionEnd); + cacheElementRef.current = element; + } + } + React23.useEffect(function() { + return function() { + removeMotionEvents(cacheElementRef.current); + }; + }, []); + return [patchMotionEvents, removeMotionEvents]; + }; + + // node_modules/rc-motion/es/hooks/useStatus.js + function useStatus(supportMotion, visible, getElement2, _ref) { + var _ref$motionEnter = _ref.motionEnter, motionEnter = _ref$motionEnter === void 0 ? true : _ref$motionEnter, _ref$motionAppear = _ref.motionAppear, motionAppear = _ref$motionAppear === void 0 ? true : _ref$motionAppear, _ref$motionLeave = _ref.motionLeave, motionLeave = _ref$motionLeave === void 0 ? true : _ref$motionLeave, motionDeadline = _ref.motionDeadline, motionLeaveImmediately = _ref.motionLeaveImmediately, onAppearPrepare = _ref.onAppearPrepare, onEnterPrepare = _ref.onEnterPrepare, onLeavePrepare = _ref.onLeavePrepare, onAppearStart = _ref.onAppearStart, onEnterStart = _ref.onEnterStart, onLeaveStart = _ref.onLeaveStart, onAppearActive = _ref.onAppearActive, onEnterActive = _ref.onEnterActive, onLeaveActive = _ref.onLeaveActive, onAppearEnd = _ref.onAppearEnd, onEnterEnd = _ref.onEnterEnd, onLeaveEnd = _ref.onLeaveEnd, onVisibleChanged = _ref.onVisibleChanged; + var _useState = useMountStatus(), _useState2 = _slicedToArray(_useState, 2), asyncVisible = _useState2[0], setAsyncVisible = _useState2[1]; + var _useState3 = useMountStatus(STATUS_NONE), _useState4 = _slicedToArray(_useState3, 2), status = _useState4[0], setStatus = _useState4[1]; + var _useState5 = useMountStatus(null), _useState6 = _slicedToArray(_useState5, 2), style2 = _useState6[0], setStyle = _useState6[1]; + var mountedRef = (0, import_react8.useRef)(false); + var deadlineRef = (0, import_react8.useRef)(null); + var destroyedRef = (0, import_react8.useRef)(false); + var cacheElementRef = (0, import_react8.useRef)(null); + function getDomElement() { + var element = getElement2(); + return element || cacheElementRef.current; + } + var activeRef = (0, import_react8.useRef)(false); + function onInternalMotionEnd(event) { + var element = getDomElement(); + if (event && !event.deadline && event.target !== element) { + return; + } + var canEnd; + if (status === STATUS_APPEAR && activeRef.current) { + canEnd = onAppearEnd === null || onAppearEnd === void 0 ? void 0 : onAppearEnd(element, event); + } else if (status === STATUS_ENTER && activeRef.current) { + canEnd = onEnterEnd === null || onEnterEnd === void 0 ? void 0 : onEnterEnd(element, event); + } else if (status === STATUS_LEAVE && activeRef.current) { + canEnd = onLeaveEnd === null || onLeaveEnd === void 0 ? void 0 : onLeaveEnd(element, event); + } + if (canEnd !== false && !destroyedRef.current) { + setStatus(STATUS_NONE); + setStyle(null); + } + } + var _useDomMotionEvents = useDomMotionEvents_default(onInternalMotionEnd), _useDomMotionEvents2 = _slicedToArray(_useDomMotionEvents, 1), patchMotionEvents = _useDomMotionEvents2[0]; + var eventHandlers = React24.useMemo(function() { + var _ref2, _ref3, _ref4; + switch (status) { + case "appear": + return _ref2 = {}, _defineProperty(_ref2, STEP_PREPARE, onAppearPrepare), _defineProperty(_ref2, STEP_START, onAppearStart), _defineProperty(_ref2, STEP_ACTIVE, onAppearActive), _ref2; + case "enter": + return _ref3 = {}, _defineProperty(_ref3, STEP_PREPARE, onEnterPrepare), _defineProperty(_ref3, STEP_START, onEnterStart), _defineProperty(_ref3, STEP_ACTIVE, onEnterActive), _ref3; + case "leave": + return _ref4 = {}, _defineProperty(_ref4, STEP_PREPARE, onLeavePrepare), _defineProperty(_ref4, STEP_START, onLeaveStart), _defineProperty(_ref4, STEP_ACTIVE, onLeaveActive), _ref4; + default: + return {}; + } + }, [status]); + var _useStepQueue = useStepQueue_default(status, function(newStep) { + if (newStep === STEP_PREPARE) { + var onPrepare = eventHandlers[STEP_PREPARE]; + if (!onPrepare) { + return SkipStep; + } + return onPrepare(getDomElement()); + } + if (step in eventHandlers) { + var _eventHandlers$step; + setStyle(((_eventHandlers$step = eventHandlers[step]) === null || _eventHandlers$step === void 0 ? void 0 : _eventHandlers$step.call(eventHandlers, getDomElement(), null)) || null); + } + if (step === STEP_ACTIVE) { + patchMotionEvents(getDomElement()); + if (motionDeadline > 0) { + clearTimeout(deadlineRef.current); + deadlineRef.current = setTimeout(function() { + onInternalMotionEnd({ + deadline: true + }); + }, motionDeadline); + } + } + return DoStep; + }), _useStepQueue2 = _slicedToArray(_useStepQueue, 2), startStep = _useStepQueue2[0], step = _useStepQueue2[1]; + var active = isActive(step); + activeRef.current = active; + useIsomorphicLayoutEffect_default(function() { + setAsyncVisible(visible); + var isMounted = mountedRef.current; + mountedRef.current = true; + if (!supportMotion) { + return; + } + var nextStatus; + if (!isMounted && visible && motionAppear) { + nextStatus = STATUS_APPEAR; + } + if (isMounted && visible && motionEnter) { + nextStatus = STATUS_ENTER; + } + if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) { + nextStatus = STATUS_LEAVE; + } + if (nextStatus) { + setStatus(nextStatus); + startStep(); + } + }, [visible]); + (0, import_react8.useEffect)(function() { + if (status === STATUS_APPEAR && !motionAppear || status === STATUS_ENTER && !motionEnter || status === STATUS_LEAVE && !motionLeave) { + setStatus(STATUS_NONE); + } + }, [motionAppear, motionEnter, motionLeave]); + (0, import_react8.useEffect)(function() { + return function() { + clearTimeout(deadlineRef.current); + destroyedRef.current = true; + }; + }, []); + (0, import_react8.useEffect)(function() { + if (asyncVisible !== void 0 && status === STATUS_NONE) { + onVisibleChanged === null || onVisibleChanged === void 0 ? void 0 : onVisibleChanged(asyncVisible); + } + }, [asyncVisible, status]); + var mergedStyle = style2; + if (eventHandlers[STEP_PREPARE] && step === STEP_START) { + mergedStyle = _objectSpread2({ + transition: "none" + }, mergedStyle); + } + return [status, step, mergedStyle, asyncVisible !== null && asyncVisible !== void 0 ? asyncVisible : visible]; + } + + // node_modules/rc-motion/es/DomWrapper.js + var React25 = __toModule(require_react()); + var DomWrapper = /* @__PURE__ */ function(_React$Component) { + _inherits(DomWrapper2, _React$Component); + var _super = _createSuper(DomWrapper2); + function DomWrapper2() { + _classCallCheck(this, DomWrapper2); + return _super.apply(this, arguments); + } + _createClass(DomWrapper2, [{ + key: "render", + value: function render() { + return this.props.children; + } + }]); + return DomWrapper2; + }(React25.Component); + var DomWrapper_default = DomWrapper; + + // node_modules/rc-motion/es/CSSMotion.js + function genCSSMotion(config) { + var transitionSupport = config; + if (_typeof(config) === "object") { + transitionSupport = config.transitionSupport; + } + function isSupportTransition(props) { + return !!(props.motionName && transitionSupport); + } + var CSSMotion = /* @__PURE__ */ React26.forwardRef(function(props, ref) { + var _props$visible = props.visible, visible = _props$visible === void 0 ? true : _props$visible, _props$removeOnLeave = props.removeOnLeave, removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave, forceRender = props.forceRender, children = props.children, motionName = props.motionName, leavedClassName = props.leavedClassName, eventProps = props.eventProps; + var supportMotion = isSupportTransition(props); + var nodeRef = (0, import_react9.useRef)(); + var wrapperNodeRef = (0, import_react9.useRef)(); + function getDomElement() { + try { + return findDOMNode(nodeRef.current || wrapperNodeRef.current); + } catch (e) { + return null; + } + } + var _useStatus = useStatus(supportMotion, visible, getDomElement, props), _useStatus2 = _slicedToArray(_useStatus, 4), status = _useStatus2[0], statusStep = _useStatus2[1], statusStyle = _useStatus2[2], mergedVisible = _useStatus2[3]; + var renderedRef = React26.useRef(mergedVisible); + if (mergedVisible) { + renderedRef.current = true; + } + var originRef = (0, import_react9.useRef)(ref); + originRef.current = ref; + var setNodeRef = React26.useCallback(function(node) { + nodeRef.current = node; + fillRef(originRef.current, node); + }, []); + var motionChildren; + var mergedProps = _objectSpread2(_objectSpread2({}, eventProps), {}, { + visible + }); + if (!children) { + motionChildren = null; + } else if (status === STATUS_NONE || !isSupportTransition(props)) { + if (mergedVisible) { + motionChildren = children(_objectSpread2({}, mergedProps), setNodeRef); + } else if (!removeOnLeave && renderedRef.current) { + motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, { + className: leavedClassName + }), setNodeRef); + } else if (forceRender) { + motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, { + style: { + display: "none" + } + }), setNodeRef); + } else { + motionChildren = null; + } + } else { + var _classNames; + var statusSuffix; + if (statusStep === STEP_PREPARE) { + statusSuffix = "prepare"; + } else if (isActive(statusStep)) { + statusSuffix = "active"; + } else if (statusStep === STEP_START) { + statusSuffix = "start"; + } + motionChildren = children(_objectSpread2(_objectSpread2({}, mergedProps), {}, { + className: (0, import_classnames2.default)(getTransitionName(motionName, status), (_classNames = {}, _defineProperty(_classNames, getTransitionName(motionName, "".concat(status, "-").concat(statusSuffix)), statusSuffix), _defineProperty(_classNames, motionName, typeof motionName === "string"), _classNames)), + style: statusStyle + }), setNodeRef); + } + return /* @__PURE__ */ React26.createElement(DomWrapper_default, { + ref: wrapperNodeRef + }, motionChildren); + }); + CSSMotion.displayName = "CSSMotion"; + return CSSMotion; + } + var CSSMotion_default = genCSSMotion(supportTransition); + + // node_modules/rc-motion/es/CSSMotionList.js + var React27 = __toModule(require_react()); + + // node_modules/rc-motion/es/util/diff.js + var STATUS_ADD = "add"; + var STATUS_KEEP = "keep"; + var STATUS_REMOVE = "remove"; + var STATUS_REMOVED = "removed"; + function wrapKeyToObject(key2) { + var keyObj; + if (key2 && _typeof(key2) === "object" && "key" in key2) { + keyObj = key2; + } else { + keyObj = { + key: key2 + }; + } + return _objectSpread2(_objectSpread2({}, keyObj), {}, { + key: String(keyObj.key) + }); + } + function parseKeys() { + var keys = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; + return keys.map(wrapKeyToObject); + } + function diffKeys() { + var prevKeys = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; + var currentKeys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; + var list = []; + var currentIndex = 0; + var currentLen = currentKeys.length; + var prevKeyObjects = parseKeys(prevKeys); + var currentKeyObjects = parseKeys(currentKeys); + prevKeyObjects.forEach(function(keyObj) { + var hit = false; + for (var i = currentIndex; i < currentLen; i += 1) { + var currentKeyObj = currentKeyObjects[i]; + if (currentKeyObj.key === keyObj.key) { + if (currentIndex < i) { + list = list.concat(currentKeyObjects.slice(currentIndex, i).map(function(obj) { + return _objectSpread2(_objectSpread2({}, obj), {}, { + status: STATUS_ADD + }); + })); + currentIndex = i; + } + list.push(_objectSpread2(_objectSpread2({}, currentKeyObj), {}, { + status: STATUS_KEEP + })); + currentIndex += 1; + hit = true; + break; + } + } + if (!hit) { + list.push(_objectSpread2(_objectSpread2({}, keyObj), {}, { + status: STATUS_REMOVE + })); + } + }); + if (currentIndex < currentLen) { + list = list.concat(currentKeyObjects.slice(currentIndex).map(function(obj) { + return _objectSpread2(_objectSpread2({}, obj), {}, { + status: STATUS_ADD + }); + })); + } + var keys = {}; + list.forEach(function(_ref) { + var key2 = _ref.key; + keys[key2] = (keys[key2] || 0) + 1; + }); + var duplicatedKeys = Object.keys(keys).filter(function(key2) { + return keys[key2] > 1; + }); + duplicatedKeys.forEach(function(matchKey) { + list = list.filter(function(_ref2) { + var key2 = _ref2.key, status = _ref2.status; + return key2 !== matchKey || status !== STATUS_REMOVE; + }); + list.forEach(function(node) { + if (node.key === matchKey) { + node.status = STATUS_KEEP; + } + }); + }); + return list; + } + + // node_modules/rc-motion/es/CSSMotionList.js + var MOTION_PROP_NAMES = ["eventProps", "visible", "children", "motionName", "motionAppear", "motionEnter", "motionLeave", "motionLeaveImmediately", "motionDeadline", "removeOnLeave", "leavedClassName", "onAppearStart", "onAppearActive", "onAppearEnd", "onEnterStart", "onEnterActive", "onEnterEnd", "onLeaveStart", "onLeaveActive", "onLeaveEnd"]; + function genCSSMotionList(transitionSupport) { + var CSSMotion = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : CSSMotion_default; + var CSSMotionList = /* @__PURE__ */ function(_React$Component) { + _inherits(CSSMotionList2, _React$Component); + var _super = _createSuper(CSSMotionList2); + function CSSMotionList2() { + var _this; + _classCallCheck(this, CSSMotionList2); + _this = _super.apply(this, arguments); + _this.state = { + keyEntities: [] + }; + _this.removeKey = function(removeKey) { + _this.setState(function(_ref) { + var keyEntities = _ref.keyEntities; + return { + keyEntities: keyEntities.map(function(entity) { + if (entity.key !== removeKey) + return entity; + return _objectSpread2(_objectSpread2({}, entity), {}, { + status: STATUS_REMOVED + }); + }) + }; + }); + }; + return _this; + } + _createClass(CSSMotionList2, [{ + key: "render", + value: function render() { + var _this2 = this; + var keyEntities = this.state.keyEntities; + var _this$props = this.props, component = _this$props.component, children = _this$props.children, _onVisibleChanged = _this$props.onVisibleChanged, restProps = _objectWithoutProperties(_this$props, ["component", "children", "onVisibleChanged"]); + var Component14 = component || React27.Fragment; + var motionProps = {}; + MOTION_PROP_NAMES.forEach(function(prop) { + motionProps[prop] = restProps[prop]; + delete restProps[prop]; + }); + delete restProps.keys; + return /* @__PURE__ */ React27.createElement(Component14, restProps, keyEntities.map(function(_ref2) { + var status = _ref2.status, eventProps = _objectWithoutProperties(_ref2, ["status"]); + var visible = status === STATUS_ADD || status === STATUS_KEEP; + return /* @__PURE__ */ React27.createElement(CSSMotion, _extends({}, motionProps, { + key: eventProps.key, + visible, + eventProps, + onVisibleChanged: function onVisibleChanged(changedVisible) { + _onVisibleChanged === null || _onVisibleChanged === void 0 ? void 0 : _onVisibleChanged(changedVisible, { + key: eventProps.key + }); + if (!changedVisible) { + _this2.removeKey(eventProps.key); + } + } + }), children); + })); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(_ref3, _ref4) { + var keys = _ref3.keys; + var keyEntities = _ref4.keyEntities; + var parsedKeyObjects = parseKeys(keys); + var mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects); + return { + keyEntities: mixedKeyEntities.filter(function(entity) { + var prevEntity = keyEntities.find(function(_ref5) { + var key2 = _ref5.key; + return entity.key === key2; + }); + if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) { + return false; + } + return true; + }) + }; + } + }]); + return CSSMotionList2; + }(React27.Component); + CSSMotionList.defaultProps = { + component: "div" + }; + return CSSMotionList; + } + var CSSMotionList_default = genCSSMotionList(supportTransition); + + // node_modules/rc-motion/es/index.js + var es_default = CSSMotion_default; + + // node_modules/rc-notification/es/Notice.js + var React28 = __toModule(require_react()); + var import_react10 = __toModule(require_react()); + var import_react_dom2 = __toModule(require_react_dom()); + var import_classnames3 = __toModule(require_classnames()); + var Notice = /* @__PURE__ */ function(_Component) { + _inherits(Notice2, _Component); + var _super = _createSuper(Notice2); + function Notice2() { + var _this; + _classCallCheck(this, Notice2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _this.closeTimer = null; + _this.close = function(e) { + if (e) { + e.stopPropagation(); + } + _this.clearCloseTimer(); + var _this$props = _this.props, onClose2 = _this$props.onClose, noticeKey = _this$props.noticeKey; + if (onClose2) { + onClose2(noticeKey); + } + }; + _this.startCloseTimer = function() { + if (_this.props.duration) { + _this.closeTimer = window.setTimeout(function() { + _this.close(); + }, _this.props.duration * 1e3); + } + }; + _this.clearCloseTimer = function() { + if (_this.closeTimer) { + clearTimeout(_this.closeTimer); + _this.closeTimer = null; + } + }; + return _this; + } + _createClass(Notice2, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.startCloseTimer(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (this.props.duration !== prevProps.duration || this.props.updateMark !== prevProps.updateMark || this.props.visible !== prevProps.visible && this.props.visible) { + this.restartCloseTimer(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.clearCloseTimer(); + } + }, { + key: "restartCloseTimer", + value: function restartCloseTimer() { + this.clearCloseTimer(); + this.startCloseTimer(); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + var _this$props2 = this.props, prefixCls = _this$props2.prefixCls, className = _this$props2.className, closable = _this$props2.closable, closeIcon = _this$props2.closeIcon, style2 = _this$props2.style, onClick = _this$props2.onClick, children = _this$props2.children, holder = _this$props2.holder; + var componentClass = "".concat(prefixCls, "-notice"); + var dataOrAriaAttributeProps = Object.keys(this.props).reduce(function(acc, key2) { + if (key2.substr(0, 5) === "data-" || key2.substr(0, 5) === "aria-" || key2 === "role") { + acc[key2] = _this2.props[key2]; + } + return acc; + }, {}); + var node = /* @__PURE__ */ React28.createElement("div", _extends({ + className: (0, import_classnames3.default)(componentClass, className, _defineProperty({}, "".concat(componentClass, "-closable"), closable)), + style: style2, + onMouseEnter: this.clearCloseTimer, + onMouseLeave: this.startCloseTimer, + onClick + }, dataOrAriaAttributeProps), /* @__PURE__ */ React28.createElement("div", { + className: "".concat(componentClass, "-content") + }, children), closable ? /* @__PURE__ */ React28.createElement("a", { + tabIndex: 0, + onClick: this.close, + className: "".concat(componentClass, "-close") + }, closeIcon || /* @__PURE__ */ React28.createElement("span", { + className: "".concat(componentClass, "-close-x") + })) : null); + if (holder) { + return /* @__PURE__ */ import_react_dom2.default.createPortal(node, holder); + } + return node; + } + }]); + return Notice2; + }(import_react10.Component); + Notice.defaultProps = { + onClose: function onClose() { + }, + duration: 1.5 + }; + + // node_modules/rc-notification/es/useNotification.js + var React29 = __toModule(require_react()); + function useNotification(notificationInstance2) { + var createdRef = React29.useRef({}); + var _React$useState = React29.useState([]), _React$useState2 = _slicedToArray(_React$useState, 2), elements = _React$useState2[0], setElements = _React$useState2[1]; + function notify(noticeProps) { + var firstMount = true; + notificationInstance2.add(noticeProps, function(div, props) { + var key2 = props.key; + if (div && (!createdRef.current[key2] || firstMount)) { + var noticeEle = /* @__PURE__ */ React29.createElement(Notice, _extends({}, props, { + holder: div + })); + createdRef.current[key2] = noticeEle; + setElements(function(originElements) { + var index2 = originElements.findIndex(function(ele) { + return ele.key === props.key; + }); + if (index2 === -1) { + return [].concat(_toConsumableArray(originElements), [noticeEle]); + } + var cloneList = _toConsumableArray(originElements); + cloneList[index2] = noticeEle; + return cloneList; + }); + } + firstMount = false; + }); + } + return [notify, /* @__PURE__ */ React29.createElement(React29.Fragment, null, elements)]; + } + + // node_modules/rc-notification/es/Notification.js + var seed = 0; + var now = Date.now(); + function getUuid() { + var id2 = seed; + seed += 1; + return "rcNotification_".concat(now, "_").concat(id2); + } + var Notification = /* @__PURE__ */ function(_Component) { + _inherits(Notification2, _Component); + var _super = _createSuper(Notification2); + function Notification2() { + var _this; + _classCallCheck(this, Notification2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + notices: [] + }; + _this.hookRefs = new Map(); + _this.add = function(originNotice, holderCallback) { + var key2 = originNotice.key || getUuid(); + var notice3 = _objectSpread2(_objectSpread2({}, originNotice), {}, { + key: key2 + }); + var maxCount2 = _this.props.maxCount; + _this.setState(function(previousState) { + var notices = previousState.notices; + var noticeIndex = notices.map(function(v) { + return v.notice.key; + }).indexOf(key2); + var updatedNotices = notices.concat(); + if (noticeIndex !== -1) { + updatedNotices.splice(noticeIndex, 1, { + notice: notice3, + holderCallback + }); + } else { + if (maxCount2 && notices.length >= maxCount2) { + notice3.key = updatedNotices[0].notice.key; + notice3.updateMark = getUuid(); + notice3.userPassKey = key2; + updatedNotices.shift(); + } + updatedNotices.push({ + notice: notice3, + holderCallback + }); + } + return { + notices: updatedNotices + }; + }); + }; + _this.remove = function(removeKey) { + _this.setState(function(_ref) { + var notices = _ref.notices; + return { + notices: notices.filter(function(_ref2) { + var _ref2$notice = _ref2.notice, key2 = _ref2$notice.key, userPassKey = _ref2$notice.userPassKey; + var mergedKey = userPassKey || key2; + return mergedKey !== removeKey; + }) + }; + }); + }; + _this.noticePropsMap = {}; + return _this; + } + _createClass(Notification2, [{ + key: "getTransitionName", + value: function getTransitionName3() { + var _this$props = this.props, prefixCls = _this$props.prefixCls, animation = _this$props.animation; + var transitionName2 = this.props.transitionName; + if (!transitionName2 && animation) { + transitionName2 = "".concat(prefixCls, "-").concat(animation); + } + return transitionName2; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + var notices = this.state.notices; + var _this$props2 = this.props, prefixCls = _this$props2.prefixCls, className = _this$props2.className, closeIcon = _this$props2.closeIcon, style2 = _this$props2.style; + var noticeKeys = []; + notices.forEach(function(_ref3, index2) { + var notice3 = _ref3.notice, holderCallback = _ref3.holderCallback; + var updateMark = index2 === notices.length - 1 ? notice3.updateMark : void 0; + var key2 = notice3.key, userPassKey = notice3.userPassKey; + var noticeProps = _objectSpread2(_objectSpread2(_objectSpread2({ + prefixCls, + closeIcon + }, notice3), notice3.props), {}, { + key: key2, + noticeKey: userPassKey || key2, + updateMark, + onClose: function onClose2(noticeKey) { + var _notice$onClose; + _this2.remove(noticeKey); + (_notice$onClose = notice3.onClose) === null || _notice$onClose === void 0 ? void 0 : _notice$onClose.call(notice3); + }, + onClick: notice3.onClick, + children: notice3.content + }); + noticeKeys.push(key2); + _this2.noticePropsMap[key2] = { + props: noticeProps, + holderCallback + }; + }); + return /* @__PURE__ */ React30.createElement("div", { + className: (0, import_classnames4.default)(prefixCls, className), + style: style2 + }, /* @__PURE__ */ React30.createElement(CSSMotionList_default, { + keys: noticeKeys, + motionName: this.getTransitionName(), + onVisibleChanged: function onVisibleChanged(changedVisible, _ref4) { + var key2 = _ref4.key; + if (!changedVisible) { + delete _this2.noticePropsMap[key2]; + } + } + }, function(_ref5) { + var key2 = _ref5.key, motionClassName = _ref5.className, motionStyle = _ref5.style, visible = _ref5.visible; + var _this2$noticePropsMap = _this2.noticePropsMap[key2], noticeProps = _this2$noticePropsMap.props, holderCallback = _this2$noticePropsMap.holderCallback; + if (holderCallback) { + return /* @__PURE__ */ React30.createElement("div", { + key: key2, + className: (0, import_classnames4.default)(motionClassName, "".concat(prefixCls, "-hook-holder")), + style: _objectSpread2({}, motionStyle), + ref: function ref(div) { + if (typeof key2 === "undefined") { + return; + } + if (div) { + _this2.hookRefs.set(key2, div); + holderCallback(div, noticeProps); + } else { + _this2.hookRefs.delete(key2); + } + } + }); + } + return /* @__PURE__ */ React30.createElement(Notice, _extends({}, noticeProps, { + className: (0, import_classnames4.default)(motionClassName, noticeProps === null || noticeProps === void 0 ? void 0 : noticeProps.className), + style: _objectSpread2(_objectSpread2({}, motionStyle), noticeProps === null || noticeProps === void 0 ? void 0 : noticeProps.style), + visible + })); + })); + } + }]); + return Notification2; + }(import_react11.Component); + Notification.newInstance = void 0; + Notification.defaultProps = { + prefixCls: "rc-notification", + animation: "fade", + style: { + top: 65, + left: "50%" + } + }; + Notification.newInstance = function newNotificationInstance(properties, callback) { + var _ref6 = properties || {}, getContainer3 = _ref6.getContainer, props = _objectWithoutProperties(_ref6, ["getContainer"]); + var div = document.createElement("div"); + if (getContainer3) { + var root = getContainer3(); + root.appendChild(div); + } else { + document.body.appendChild(div); + } + var called = false; + function ref(notification) { + if (called) { + return; + } + called = true; + callback({ + notice: function notice3(noticeProps) { + notification.add(noticeProps); + }, + removeNotice: function removeNotice(key2) { + notification.remove(key2); + }, + component: notification, + destroy: function destroy3() { + import_react_dom3.default.unmountComponentAtNode(div); + if (div.parentNode) { + div.parentNode.removeChild(div); + } + }, + useNotification: function useNotification2() { + return useNotification(notification); + } + }); + } + if (false) { + properties.TEST_RENDER(/* @__PURE__ */ React30.createElement(Notification, _extends({}, props, { + ref + }))); + return; + } + import_react_dom3.default.render(/* @__PURE__ */ React30.createElement(Notification, _extends({}, props, { + ref + })), div); + }; + var Notification_default = Notification; + + // node_modules/rc-notification/es/index.js + var es_default2 = Notification_default; + + // node_modules/@ant-design/icons/es/icons/LoadingOutlined.js + var React33 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.js + var LoadingOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" }; + var LoadingOutlined_default = LoadingOutlined; + + // node_modules/@ant-design/icons/es/components/AntdIcon.js + var React32 = __toModule(require_react()); + var import_classnames5 = __toModule(require_classnames()); + + // node_modules/@ctrl/tinycolor/dist/module/util.js + function bound01(n, max) { + if (isOnePointZero(n)) { + n = "100%"; + } + var isPercent = isPercentage(n); + n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n))); + if (isPercent) { + n = parseInt(String(n * max), 10) / 100; + } + if (Math.abs(n - max) < 1e-6) { + return 1; + } + if (max === 360) { + n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max)); + } else { + n = n % max / parseFloat(String(max)); + } + return n; + } + function isOnePointZero(n) { + return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1; + } + function isPercentage(n) { + return typeof n === "string" && n.indexOf("%") !== -1; + } + function boundAlpha(a) { + a = parseFloat(a); + if (isNaN(a) || a < 0 || a > 1) { + a = 1; + } + return a; + } + function convertToPercentage(n) { + if (n <= 1) { + return Number(n) * 100 + "%"; + } + return n; + } + function pad2(c) { + return c.length === 1 ? "0" + c : String(c); + } + + // node_modules/@ctrl/tinycolor/dist/module/conversion.js + function rgbToRgb(r, g, b) { + return { + r: bound01(r, 255) * 255, + g: bound01(g, 255) * 255, + b: bound01(b, 255) * 255 + }; + } + function hue2rgb(p, q, t) { + if (t < 0) { + t += 1; + } + if (t > 1) { + t -= 1; + } + if (t < 1 / 6) { + return p + (q - p) * (6 * t); + } + if (t < 1 / 2) { + return q; + } + if (t < 2 / 3) { + return p + (q - p) * (2 / 3 - t) * 6; + } + return p; + } + function hslToRgb(h, s, l) { + var r; + var g; + var b; + h = bound01(h, 360); + s = bound01(s, 100); + l = bound01(l, 100); + if (s === 0) { + g = l; + b = l; + r = l; + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hue2rgb(p, q, h + 1 / 3); + g = hue2rgb(p, q, h); + b = hue2rgb(p, q, h - 1 / 3); + } + return { r: r * 255, g: g * 255, b: b * 255 }; + } + function rgbToHsv(r, g, b) { + r = bound01(r, 255); + g = bound01(g, 255); + b = bound01(b, 255); + var max = Math.max(r, g, b); + var min = Math.min(r, g, b); + var h = 0; + var v = max; + var d = max - min; + var s = max === 0 ? 0 : d / max; + if (max === min) { + h = 0; + } else { + switch (max) { + case r: + h = (g - b) / d + (g < b ? 6 : 0); + break; + case g: + h = (b - r) / d + 2; + break; + case b: + h = (r - g) / d + 4; + break; + default: + break; + } + h /= 6; + } + return { h, s, v }; + } + function hsvToRgb(h, s, v) { + h = bound01(h, 360) * 6; + s = bound01(s, 100); + v = bound01(v, 100); + var i = Math.floor(h); + var f = h - i; + var p = v * (1 - s); + var q = v * (1 - f * s); + var t = v * (1 - (1 - f) * s); + var mod = i % 6; + var r = [v, q, p, p, t, v][mod]; + var g = [t, v, v, q, p, p][mod]; + var b = [p, p, t, v, v, q][mod]; + return { r: r * 255, g: g * 255, b: b * 255 }; + } + function rgbToHex(r, g, b, allow3Char) { + var hex2 = [ + pad2(Math.round(r).toString(16)), + pad2(Math.round(g).toString(16)), + pad2(Math.round(b).toString(16)) + ]; + if (allow3Char && hex2[0].startsWith(hex2[0].charAt(1)) && hex2[1].startsWith(hex2[1].charAt(1)) && hex2[2].startsWith(hex2[2].charAt(1))) { + return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0); + } + return hex2.join(""); + } + function convertHexToDecimal(h) { + return parseIntFromHex(h) / 255; + } + function parseIntFromHex(val) { + return parseInt(val, 16); + } + + // node_modules/@ctrl/tinycolor/dist/module/css-color-names.js + var names = { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyan: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgreen: "#006400", + darkgrey: "#a9a9a9", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + goldenrod: "#daa520", + gold: "#ffd700", + gray: "#808080", + green: "#008000", + greenyellow: "#adff2f", + grey: "#808080", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavenderblush: "#fff0f5", + lavender: "#e6e6fa", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgreen: "#90ee90", + lightgrey: "#d3d3d3", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370db", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#db7093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + rebeccapurple: "#663399", + red: "#ff0000", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + steelblue: "#4682b4", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + tomato: "#ff6347", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00", + yellowgreen: "#9acd32" + }; + + // node_modules/@ctrl/tinycolor/dist/module/format-input.js + function inputToRGB(color) { + var rgb = { r: 0, g: 0, b: 0 }; + var a = 1; + var s = null; + var v = null; + var l = null; + var ok = false; + var format3 = false; + if (typeof color === "string") { + color = stringInputToObject(color); + } + if (typeof color === "object") { + if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { + rgb = rgbToRgb(color.r, color.g, color.b); + ok = true; + format3 = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; + } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { + s = convertToPercentage(color.s); + v = convertToPercentage(color.v); + rgb = hsvToRgb(color.h, s, v); + ok = true; + format3 = "hsv"; + } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { + s = convertToPercentage(color.s); + l = convertToPercentage(color.l); + rgb = hslToRgb(color.h, s, l); + ok = true; + format3 = "hsl"; + } + if (Object.prototype.hasOwnProperty.call(color, "a")) { + a = color.a; + } + } + a = boundAlpha(a); + return { + ok, + format: color.format || format3, + r: Math.min(255, Math.max(rgb.r, 0)), + g: Math.min(255, Math.max(rgb.g, 0)), + b: Math.min(255, Math.max(rgb.b, 0)), + a + }; + } + var CSS_INTEGER = "[-\\+]?\\d+%?"; + var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; + var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; + var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var matchers = { + CSS_UNIT: new RegExp(CSS_UNIT), + rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), + rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), + hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), + hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), + hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), + hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), + hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, + hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ + }; + function stringInputToObject(color) { + color = color.trim().toLowerCase(); + if (color.length === 0) { + return false; + } + var named = false; + if (names[color]) { + color = names[color]; + named = true; + } else if (color === "transparent") { + return { r: 0, g: 0, b: 0, a: 0, format: "name" }; + } + var match = matchers.rgb.exec(color); + if (match) { + return { r: match[1], g: match[2], b: match[3] }; + } + match = matchers.rgba.exec(color); + if (match) { + return { r: match[1], g: match[2], b: match[3], a: match[4] }; + } + match = matchers.hsl.exec(color); + if (match) { + return { h: match[1], s: match[2], l: match[3] }; + } + match = matchers.hsla.exec(color); + if (match) { + return { h: match[1], s: match[2], l: match[3], a: match[4] }; + } + match = matchers.hsv.exec(color); + if (match) { + return { h: match[1], s: match[2], v: match[3] }; + } + match = matchers.hsva.exec(color); + if (match) { + return { h: match[1], s: match[2], v: match[3], a: match[4] }; + } + match = matchers.hex8.exec(color); + if (match) { + return { + r: parseIntFromHex(match[1]), + g: parseIntFromHex(match[2]), + b: parseIntFromHex(match[3]), + a: convertHexToDecimal(match[4]), + format: named ? "name" : "hex8" + }; + } + match = matchers.hex6.exec(color); + if (match) { + return { + r: parseIntFromHex(match[1]), + g: parseIntFromHex(match[2]), + b: parseIntFromHex(match[3]), + format: named ? "name" : "hex" + }; + } + match = matchers.hex4.exec(color); + if (match) { + return { + r: parseIntFromHex(match[1] + match[1]), + g: parseIntFromHex(match[2] + match[2]), + b: parseIntFromHex(match[3] + match[3]), + a: convertHexToDecimal(match[4] + match[4]), + format: named ? "name" : "hex8" + }; + } + match = matchers.hex3.exec(color); + if (match) { + return { + r: parseIntFromHex(match[1] + match[1]), + g: parseIntFromHex(match[2] + match[2]), + b: parseIntFromHex(match[3] + match[3]), + format: named ? "name" : "hex" + }; + } + return false; + } + function isValidCSSUnit(color) { + return Boolean(matchers.CSS_UNIT.exec(String(color))); + } + + // node_modules/@ant-design/colors/dist/index.esm.js + var hueStep = 2; + var saturationStep = 0.16; + var saturationStep2 = 0.05; + var brightnessStep1 = 0.05; + var brightnessStep2 = 0.15; + var lightColorCount = 5; + var darkColorCount = 4; + var darkColorMap = [{ + index: 7, + opacity: 0.15 + }, { + index: 6, + opacity: 0.25 + }, { + index: 5, + opacity: 0.3 + }, { + index: 5, + opacity: 0.45 + }, { + index: 5, + opacity: 0.65 + }, { + index: 5, + opacity: 0.85 + }, { + index: 4, + opacity: 0.9 + }, { + index: 3, + opacity: 0.95 + }, { + index: 2, + opacity: 0.97 + }, { + index: 1, + opacity: 0.98 + }]; + function toHsv(_ref) { + var r = _ref.r, g = _ref.g, b = _ref.b; + var hsv = rgbToHsv(r, g, b); + return { + h: hsv.h * 360, + s: hsv.s, + v: hsv.v + }; + } + function toHex(_ref2) { + var r = _ref2.r, g = _ref2.g, b = _ref2.b; + return "#".concat(rgbToHex(r, g, b, false)); + } + function mix(rgb1, rgb2, amount) { + var p = amount / 100; + var rgb = { + r: (rgb2.r - rgb1.r) * p + rgb1.r, + g: (rgb2.g - rgb1.g) * p + rgb1.g, + b: (rgb2.b - rgb1.b) * p + rgb1.b + }; + return rgb; + } + function getHue(hsv, i, light) { + var hue; + if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) { + hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i; + } else { + hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i; + } + if (hue < 0) { + hue += 360; + } else if (hue >= 360) { + hue -= 360; + } + return hue; + } + function getSaturation(hsv, i, light) { + if (hsv.h === 0 && hsv.s === 0) { + return hsv.s; + } + var saturation; + if (light) { + saturation = hsv.s - saturationStep * i; + } else if (i === darkColorCount) { + saturation = hsv.s + saturationStep; + } else { + saturation = hsv.s + saturationStep2 * i; + } + if (saturation > 1) { + saturation = 1; + } + if (light && i === lightColorCount && saturation > 0.1) { + saturation = 0.1; + } + if (saturation < 0.06) { + saturation = 0.06; + } + return Number(saturation.toFixed(2)); + } + function getValue2(hsv, i, light) { + var value; + if (light) { + value = hsv.v + brightnessStep1 * i; + } else { + value = hsv.v - brightnessStep2 * i; + } + if (value > 1) { + value = 1; + } + return Number(value.toFixed(2)); + } + function generate(color) { + var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var patterns = []; + var pColor = inputToRGB(color); + for (var i = lightColorCount; i > 0; i -= 1) { + var hsv = toHsv(pColor); + var colorString = toHex(inputToRGB({ + h: getHue(hsv, i, true), + s: getSaturation(hsv, i, true), + v: getValue2(hsv, i, true) + })); + patterns.push(colorString); + } + patterns.push(toHex(pColor)); + for (var _i = 1; _i <= darkColorCount; _i += 1) { + var _hsv = toHsv(pColor); + var _colorString = toHex(inputToRGB({ + h: getHue(_hsv, _i), + s: getSaturation(_hsv, _i), + v: getValue2(_hsv, _i) + })); + patterns.push(_colorString); + } + if (opts.theme === "dark") { + return darkColorMap.map(function(_ref3) { + var index2 = _ref3.index, opacity = _ref3.opacity; + var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index2]), opacity * 100)); + return darkColorString; + }); + } + return patterns; + } + var presetPrimaryColors = { + red: "#F5222D", + volcano: "#FA541C", + orange: "#FA8C16", + gold: "#FAAD14", + yellow: "#FADB14", + lime: "#A0D911", + green: "#52C41A", + cyan: "#13C2C2", + blue: "#1890FF", + geekblue: "#2F54EB", + purple: "#722ED1", + magenta: "#EB2F96", + grey: "#666666" + }; + var presetPalettes = {}; + var presetDarkPalettes = {}; + Object.keys(presetPrimaryColors).forEach(function(key2) { + presetPalettes[key2] = generate(presetPrimaryColors[key2]); + presetPalettes[key2].primary = presetPalettes[key2][5]; + presetDarkPalettes[key2] = generate(presetPrimaryColors[key2], { + theme: "dark", + backgroundColor: "#141414" + }); + presetDarkPalettes[key2].primary = presetDarkPalettes[key2][5]; + }); + var red = presetPalettes.red; + var volcano = presetPalettes.volcano; + var gold = presetPalettes.gold; + var orange = presetPalettes.orange; + var yellow = presetPalettes.yellow; + var lime = presetPalettes.lime; + var green = presetPalettes.green; + var cyan = presetPalettes.cyan; + var blue = presetPalettes.blue; + var geekblue = presetPalettes.geekblue; + var purple = presetPalettes.purple; + var magenta = presetPalettes.magenta; + var grey = presetPalettes.grey; + + // node_modules/@ant-design/icons/es/utils.js + var import_react12 = __toModule(require_react()); + + // node_modules/rc-util/es/Dom/dynamicCSS.js + var MARK_KEY = "rc-util-key"; + function getContainer(option) { + if (option.attachTo) { + return option.attachTo; + } + var head = document.querySelector("head"); + return head || document.body; + } + function injectCSS(css2) { + var _option$csp; + var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + if (!canUseDom()) { + return null; + } + var styleNode = document.createElement("style"); + if ((_option$csp = option.csp) === null || _option$csp === void 0 ? void 0 : _option$csp.nonce) { + var _option$csp2; + styleNode.nonce = (_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce; + } + styleNode.innerHTML = css2; + var container = getContainer(option); + var firstChild = container.firstChild; + if (option.prepend && container.prepend) { + container.prepend(styleNode); + } else if (option.prepend && firstChild) { + container.insertBefore(styleNode, firstChild); + } else { + container.appendChild(styleNode); + } + return styleNode; + } + var containerCache = new Map(); + function updateCSS(css2, key2) { + var option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var container = getContainer(option); + if (!containerCache.has(container)) { + var placeholderStyle = injectCSS("", option); + var parentNode = placeholderStyle.parentNode; + containerCache.set(container, parentNode); + parentNode.removeChild(placeholderStyle); + } + var existNode = Array.from(containerCache.get(container).children).find(function(node) { + return node.tagName === "STYLE" && node[MARK_KEY] === key2; + }); + if (existNode) { + var _option$csp3, _option$csp4; + if (((_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce) && existNode.nonce !== ((_option$csp4 = option.csp) === null || _option$csp4 === void 0 ? void 0 : _option$csp4.nonce)) { + var _option$csp5; + existNode.nonce = (_option$csp5 = option.csp) === null || _option$csp5 === void 0 ? void 0 : _option$csp5.nonce; + } + if (existNode.innerHTML !== css2) { + existNode.innerHTML = css2; + } + return existNode; + } + var newNode = injectCSS(css2, option); + newNode[MARK_KEY] = key2; + return newNode; + } + + // node_modules/@ant-design/icons/es/utils.js + function warning4(valid, message) { + warning_default(valid, "[@ant-design/icons] ".concat(message)); + } + function isIconDefinition(target) { + return _typeof(target) === "object" && typeof target.name === "string" && typeof target.theme === "string" && (_typeof(target.icon) === "object" || typeof target.icon === "function"); + } + function normalizeAttrs() { + var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + return Object.keys(attrs).reduce(function(acc, key2) { + var val = attrs[key2]; + switch (key2) { + case "class": + acc.className = val; + delete acc.class; + break; + default: + acc[key2] = val; + } + return acc; + }, {}); + } + function generate2(node, key2, rootProps) { + if (!rootProps) { + return /* @__PURE__ */ import_react12.default.createElement(node.tag, _objectSpread2({ + key: key2 + }, normalizeAttrs(node.attrs)), (node.children || []).map(function(child, index2) { + return generate2(child, "".concat(key2, "-").concat(node.tag, "-").concat(index2)); + })); + } + return /* @__PURE__ */ import_react12.default.createElement(node.tag, _objectSpread2(_objectSpread2({ + key: key2 + }, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function(child, index2) { + return generate2(child, "".concat(key2, "-").concat(node.tag, "-").concat(index2)); + })); + } + function getSecondaryColor(primaryColor) { + return generate(primaryColor)[0]; + } + function normalizeTwoToneColors(twoToneColor) { + if (!twoToneColor) { + return []; + } + return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor]; + } + var iconStyles = "\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n"; + var useInsertStyles = function useInsertStyles2() { + var styleStr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : iconStyles; + var _useContext = (0, import_react12.useContext)(Context_default), csp = _useContext.csp; + (0, import_react12.useEffect)(function() { + updateCSS(styleStr, "@ant-design-icons", { + prepend: true, + csp + }); + }, []); + }; + + // node_modules/@ant-design/icons/es/components/IconBase.js + var twoToneColorPalette = { + primaryColor: "#333", + secondaryColor: "#E6E6E6", + calculated: false + }; + function setTwoToneColors(_ref) { + var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor; + twoToneColorPalette.primaryColor = primaryColor; + twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor); + twoToneColorPalette.calculated = !!secondaryColor; + } + function getTwoToneColors() { + return _objectSpread2({}, twoToneColorPalette); + } + var IconBase = function IconBase2(props) { + var icon = props.icon, className = props.className, onClick = props.onClick, style2 = props.style, primaryColor = props.primaryColor, secondaryColor = props.secondaryColor, restProps = _objectWithoutProperties(props, ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"]); + var colors = twoToneColorPalette; + if (primaryColor) { + colors = { + primaryColor, + secondaryColor: secondaryColor || getSecondaryColor(primaryColor) + }; + } + useInsertStyles(); + warning4(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon)); + if (!isIconDefinition(icon)) { + return null; + } + var target = icon; + if (target && typeof target.icon === "function") { + target = _objectSpread2(_objectSpread2({}, target), {}, { + icon: target.icon(colors.primaryColor, colors.secondaryColor) + }); + } + return generate2(target.icon, "svg-".concat(target.name), _objectSpread2({ + className, + onClick, + style: style2, + "data-icon": target.name, + width: "1em", + height: "1em", + fill: "currentColor", + "aria-hidden": "true" + }, restProps)); + }; + IconBase.displayName = "IconReact"; + IconBase.getTwoToneColors = getTwoToneColors; + IconBase.setTwoToneColors = setTwoToneColors; + var IconBase_default = IconBase; + + // node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js + function setTwoToneColor(twoToneColor) { + var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; + return IconBase_default.setTwoToneColors({ + primaryColor, + secondaryColor + }); + } + function getTwoToneColor() { + var colors = IconBase_default.getTwoToneColors(); + if (!colors.calculated) { + return colors.primaryColor; + } + return [colors.primaryColor, colors.secondaryColor]; + } + + // node_modules/@ant-design/icons/es/components/AntdIcon.js + setTwoToneColor("#1890ff"); + var Icon = /* @__PURE__ */ React32.forwardRef(function(props, ref) { + var _classNames; + var className = props.className, icon = props.icon, spin = props.spin, rotate = props.rotate, tabIndex = props.tabIndex, onClick = props.onClick, twoToneColor = props.twoToneColor, restProps = _objectWithoutProperties(props, ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"]); + var _React$useContext = React32.useContext(Context_default), _React$useContext$pre = _React$useContext.prefixCls, prefixCls = _React$useContext$pre === void 0 ? "anticon" : _React$useContext$pre; + var classString = (0, import_classnames5.default)(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), _defineProperty(_classNames, "".concat(prefixCls, "-spin"), !!spin || icon.name === "loading"), _classNames), className); + var iconTabIndex = tabIndex; + if (iconTabIndex === void 0 && onClick) { + iconTabIndex = -1; + } + var svgStyle = rotate ? { + msTransform: "rotate(".concat(rotate, "deg)"), + transform: "rotate(".concat(rotate, "deg)") + } : void 0; + var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1]; + return /* @__PURE__ */ React32.createElement("span", Object.assign({ + role: "img", + "aria-label": icon.name + }, restProps, { + ref, + tabIndex: iconTabIndex, + onClick, + className: classString + }), /* @__PURE__ */ React32.createElement(IconBase_default, { + icon, + primaryColor, + secondaryColor, + style: svgStyle + })); + }); + Icon.displayName = "AntdIcon"; + Icon.getTwoToneColor = getTwoToneColor; + Icon.setTwoToneColor = setTwoToneColor; + var AntdIcon_default = Icon; + + // node_modules/@ant-design/icons/es/icons/LoadingOutlined.js + var LoadingOutlined2 = function LoadingOutlined3(props, ref) { + return /* @__PURE__ */ React33.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: LoadingOutlined_default + })); + }; + LoadingOutlined2.displayName = "LoadingOutlined"; + var LoadingOutlined_default2 = /* @__PURE__ */ React33.forwardRef(LoadingOutlined2); + + // node_modules/@ant-design/icons/es/icons/ExclamationCircleFilled.js + var React34 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleFilled.js + var ExclamationCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" }; + var ExclamationCircleFilled_default = ExclamationCircleFilled; + + // node_modules/@ant-design/icons/es/icons/ExclamationCircleFilled.js + var ExclamationCircleFilled2 = function ExclamationCircleFilled3(props, ref) { + return /* @__PURE__ */ React34.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: ExclamationCircleFilled_default + })); + }; + ExclamationCircleFilled2.displayName = "ExclamationCircleFilled"; + var ExclamationCircleFilled_default2 = /* @__PURE__ */ React34.forwardRef(ExclamationCircleFilled2); + + // node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js + var React35 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/CloseCircleFilled.js + var CloseCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" } }] }, "name": "close-circle", "theme": "filled" }; + var CloseCircleFilled_default = CloseCircleFilled; + + // node_modules/@ant-design/icons/es/icons/CloseCircleFilled.js + var CloseCircleFilled2 = function CloseCircleFilled3(props, ref) { + return /* @__PURE__ */ React35.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: CloseCircleFilled_default + })); + }; + CloseCircleFilled2.displayName = "CloseCircleFilled"; + var CloseCircleFilled_default2 = /* @__PURE__ */ React35.forwardRef(CloseCircleFilled2); + + // node_modules/@ant-design/icons/es/icons/CheckCircleFilled.js + var React36 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/CheckCircleFilled.js + var CheckCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" }; + var CheckCircleFilled_default = CheckCircleFilled; + + // node_modules/@ant-design/icons/es/icons/CheckCircleFilled.js + var CheckCircleFilled2 = function CheckCircleFilled3(props, ref) { + return /* @__PURE__ */ React36.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: CheckCircleFilled_default + })); + }; + CheckCircleFilled2.displayName = "CheckCircleFilled"; + var CheckCircleFilled_default2 = /* @__PURE__ */ React36.forwardRef(CheckCircleFilled2); + + // node_modules/@ant-design/icons/es/icons/InfoCircleFilled.js + var React37 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/InfoCircleFilled.js + var InfoCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" }; + var InfoCircleFilled_default = InfoCircleFilled; + + // node_modules/@ant-design/icons/es/icons/InfoCircleFilled.js + var InfoCircleFilled2 = function InfoCircleFilled3(props, ref) { + return /* @__PURE__ */ React37.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: InfoCircleFilled_default + })); + }; + InfoCircleFilled2.displayName = "InfoCircleFilled"; + var InfoCircleFilled_default2 = /* @__PURE__ */ React37.forwardRef(InfoCircleFilled2); + + // node_modules/antd/es/message/hooks/useMessage.js + var React38 = __toModule(require_react()); + function createUseMessage(getRcNotificationInstance, getRCNoticeProps3) { + var useMessage = function useMessage2() { + var getPrefixCls; + var innerInstance = null; + var proxy = { + add: function add(noticeProps, holderCallback) { + innerInstance === null || innerInstance === void 0 ? void 0 : innerInstance.component.add(noticeProps, holderCallback); + } + }; + var _useRCNotification = useNotification(proxy), _useRCNotification2 = _slicedToArray(_useRCNotification, 2), hookNotify = _useRCNotification2[0], holder = _useRCNotification2[1]; + function notify(args) { + var customizePrefixCls = args.prefixCls; + var mergedPrefixCls = getPrefixCls("message", customizePrefixCls); + var rootPrefixCls = getPrefixCls(); + var target = args.key || getKeyThenIncreaseKey(); + var closePromise = new Promise(function(resolve) { + var callback = function callback2() { + if (typeof args.onClose === "function") { + args.onClose(); + } + return resolve(true); + }; + getRcNotificationInstance(_extends(_extends({}, args), { + prefixCls: mergedPrefixCls, + rootPrefixCls + }), function(_ref) { + var prefixCls = _ref.prefixCls, instance = _ref.instance; + innerInstance = instance; + hookNotify(getRCNoticeProps3(_extends(_extends({}, args), { + key: target, + onClose: callback + }), prefixCls)); + }); + }); + var result = function result2() { + if (innerInstance) { + innerInstance.removeNotice(target); + } + }; + result.then = function(filled, rejected) { + return closePromise.then(filled, rejected); + }; + result.promise = closePromise; + return result; + } + var hookApiRef = React38.useRef({}); + hookApiRef.current.open = notify; + ["success", "info", "warning", "error", "loading"].forEach(function(type2) { + return attachTypeApi(hookApiRef.current, type2); + }); + return [hookApiRef.current, /* @__PURE__ */ React38.createElement(ConfigConsumer, { + key: "holder" + }, function(context) { + getPrefixCls = context.getPrefixCls; + return holder; + })]; + }; + return useMessage; + } + + // node_modules/antd/es/message/index.js + var messageInstance; + var defaultDuration = 3; + var defaultTop; + var key = 1; + var localPrefixCls = ""; + var transitionName = "move-up"; + var hasTransitionName = false; + var getContainer2; + var maxCount; + var rtl = false; + function getKeyThenIncreaseKey() { + return key++; + } + function setMessageConfig(options) { + if (options.top !== void 0) { + defaultTop = options.top; + messageInstance = null; + } + if (options.duration !== void 0) { + defaultDuration = options.duration; + } + if (options.prefixCls !== void 0) { + localPrefixCls = options.prefixCls; + } + if (options.getContainer !== void 0) { + getContainer2 = options.getContainer; + } + if (options.transitionName !== void 0) { + transitionName = options.transitionName; + messageInstance = null; + hasTransitionName = true; + } + if (options.maxCount !== void 0) { + maxCount = options.maxCount; + messageInstance = null; + } + if (options.rtl !== void 0) { + rtl = options.rtl; + } + } + function getRCNotificationInstance(args, callback) { + var customizePrefixCls = args.prefixCls; + var _globalConfig = globalConfig(), getPrefixCls = _globalConfig.getPrefixCls, getRootPrefixCls = _globalConfig.getRootPrefixCls; + var prefixCls = getPrefixCls("message", customizePrefixCls || localPrefixCls); + var rootPrefixCls = getRootPrefixCls(args.rootPrefixCls, prefixCls); + if (messageInstance) { + callback({ + prefixCls, + rootPrefixCls, + instance: messageInstance + }); + return; + } + var instanceConfig = { + prefixCls, + transitionName: hasTransitionName ? transitionName : "".concat(rootPrefixCls, "-").concat(transitionName), + style: { + top: defaultTop + }, + getContainer: getContainer2, + maxCount + }; + es_default2.newInstance(instanceConfig, function(instance) { + if (messageInstance) { + callback({ + prefixCls, + rootPrefixCls, + instance: messageInstance + }); + return; + } + messageInstance = instance; + if (false) { + messageInstance.config = instanceConfig; + } + callback({ + prefixCls, + rootPrefixCls, + instance + }); + }); + } + var typeToIcon = { + info: InfoCircleFilled_default2, + success: CheckCircleFilled_default2, + error: CloseCircleFilled_default2, + warning: ExclamationCircleFilled_default2, + loading: LoadingOutlined_default2 + }; + function getRCNoticeProps(args, prefixCls) { + var _classNames; + var duration = args.duration !== void 0 ? args.duration : defaultDuration; + var IconComponent = typeToIcon[args.type]; + var messageClass = (0, import_classnames6.default)("".concat(prefixCls, "-custom-content"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(args.type), args.type), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), rtl === true), _classNames)); + return { + key: args.key, + duration, + style: args.style || {}, + className: args.className, + content: /* @__PURE__ */ React39.createElement("div", { + className: messageClass + }, args.icon || IconComponent && /* @__PURE__ */ React39.createElement(IconComponent, null), /* @__PURE__ */ React39.createElement("span", null, args.content)), + onClose: args.onClose, + onClick: args.onClick + }; + } + function notice(args) { + var target = args.key || key++; + var closePromise = new Promise(function(resolve) { + var callback = function callback2() { + if (typeof args.onClose === "function") { + args.onClose(); + } + return resolve(true); + }; + getRCNotificationInstance(args, function(_ref) { + var prefixCls = _ref.prefixCls, instance = _ref.instance; + instance.notice(getRCNoticeProps(_extends(_extends({}, args), { + key: target, + onClose: callback + }), prefixCls)); + }); + }); + var result = function result2() { + if (messageInstance) { + messageInstance.removeNotice(target); + } + }; + result.then = function(filled, rejected) { + return closePromise.then(filled, rejected); + }; + result.promise = closePromise; + return result; + } + function isArgsProps(content) { + return Object.prototype.toString.call(content) === "[object Object]" && !!content.content; + } + var api = { + open: notice, + config: setMessageConfig, + destroy: function destroy(messageKey) { + if (messageInstance) { + if (messageKey) { + var _messageInstance = messageInstance, removeNotice = _messageInstance.removeNotice; + removeNotice(messageKey); + } else { + var _messageInstance2 = messageInstance, destroy3 = _messageInstance2.destroy; + destroy3(); + messageInstance = null; + } + } + } + }; + function attachTypeApi(originalApi, type2) { + originalApi[type2] = function(content, duration, onClose2) { + if (isArgsProps(content)) { + return originalApi.open(_extends(_extends({}, content), { + type: type2 + })); + } + if (typeof duration === "function") { + onClose2 = duration; + duration = void 0; + } + return originalApi.open({ + content, + duration, + type: type2, + onClose: onClose2 + }); + }; + } + ["success", "info", "warning", "error", "loading"].forEach(function(type2) { + return attachTypeApi(api, type2); + }); + api.warn = api.warning; + api.useMessage = createUseMessage(getRCNotificationInstance, getRCNoticeProps); + var message_default = api; + + // node_modules/antd/es/notification/index.js + var import_regenerator2 = __toModule(require_regenerator()); + var React46 = __toModule(require_react()); + + // node_modules/@ant-design/icons/es/icons/CloseOutlined.js + var React40 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/CloseOutlined.js + var CloseOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" } }] }, "name": "close", "theme": "outlined" }; + var CloseOutlined_default = CloseOutlined; + + // node_modules/@ant-design/icons/es/icons/CloseOutlined.js + var CloseOutlined2 = function CloseOutlined3(props, ref) { + return /* @__PURE__ */ React40.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: CloseOutlined_default + })); + }; + CloseOutlined2.displayName = "CloseOutlined"; + var CloseOutlined_default2 = /* @__PURE__ */ React40.forwardRef(CloseOutlined2); + + // node_modules/antd/es/notification/index.js + var import_classnames7 = __toModule(require_classnames()); + + // node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.js + var React41 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/CheckCircleOutlined.js + var CheckCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "check-circle", "theme": "outlined" }; + var CheckCircleOutlined_default = CheckCircleOutlined; + + // node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.js + var CheckCircleOutlined2 = function CheckCircleOutlined3(props, ref) { + return /* @__PURE__ */ React41.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: CheckCircleOutlined_default + })); + }; + CheckCircleOutlined2.displayName = "CheckCircleOutlined"; + var CheckCircleOutlined_default2 = /* @__PURE__ */ React41.forwardRef(CheckCircleOutlined2); + + // node_modules/@ant-design/icons/es/icons/CloseCircleOutlined.js + var React42 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/CloseCircleOutlined.js + var CloseCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" } }, { "tag": "path", "attrs": { "d": "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "close-circle", "theme": "outlined" }; + var CloseCircleOutlined_default = CloseCircleOutlined; + + // node_modules/@ant-design/icons/es/icons/CloseCircleOutlined.js + var CloseCircleOutlined2 = function CloseCircleOutlined3(props, ref) { + return /* @__PURE__ */ React42.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: CloseCircleOutlined_default + })); + }; + CloseCircleOutlined2.displayName = "CloseCircleOutlined"; + var CloseCircleOutlined_default2 = /* @__PURE__ */ React42.forwardRef(CloseCircleOutlined2); + + // node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js + var React43 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js + var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" }; + var ExclamationCircleOutlined_default = ExclamationCircleOutlined; + + // node_modules/@ant-design/icons/es/icons/ExclamationCircleOutlined.js + var ExclamationCircleOutlined2 = function ExclamationCircleOutlined3(props, ref) { + return /* @__PURE__ */ React43.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: ExclamationCircleOutlined_default + })); + }; + ExclamationCircleOutlined2.displayName = "ExclamationCircleOutlined"; + var ExclamationCircleOutlined_default2 = /* @__PURE__ */ React43.forwardRef(ExclamationCircleOutlined2); + + // node_modules/@ant-design/icons/es/icons/InfoCircleOutlined.js + var React44 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/InfoCircleOutlined.js + var InfoCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, "name": "info-circle", "theme": "outlined" }; + var InfoCircleOutlined_default = InfoCircleOutlined; + + // node_modules/@ant-design/icons/es/icons/InfoCircleOutlined.js + var InfoCircleOutlined2 = function InfoCircleOutlined3(props, ref) { + return /* @__PURE__ */ React44.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: InfoCircleOutlined_default + })); + }; + InfoCircleOutlined2.displayName = "InfoCircleOutlined"; + var InfoCircleOutlined_default2 = /* @__PURE__ */ React44.forwardRef(InfoCircleOutlined2); + + // node_modules/antd/es/notification/hooks/useNotification.js + var React45 = __toModule(require_react()); + function createUseNotification(getNotificationInstance2, getRCNoticeProps3) { + var useNotification2 = function useNotification3() { + var getPrefixCls; + var innerInstance = null; + var proxy = { + add: function add(noticeProps, holderCallback) { + innerInstance === null || innerInstance === void 0 ? void 0 : innerInstance.component.add(noticeProps, holderCallback); + } + }; + var _useRCNotification = useNotification(proxy), _useRCNotification2 = _slicedToArray(_useRCNotification, 2), hookNotify = _useRCNotification2[0], holder = _useRCNotification2[1]; + function notify(args) { + var customizePrefixCls = args.prefixCls; + var mergedPrefixCls = getPrefixCls("notification", customizePrefixCls); + getNotificationInstance2(_extends(_extends({}, args), { + prefixCls: mergedPrefixCls + }), function(_ref) { + var prefixCls = _ref.prefixCls, instance = _ref.instance; + innerInstance = instance; + hookNotify(getRCNoticeProps3(args, prefixCls)); + }); + } + var hookApiRef = React45.useRef({}); + hookApiRef.current.open = notify; + ["success", "info", "warning", "error"].forEach(function(type2) { + hookApiRef.current[type2] = function(args) { + return hookApiRef.current.open(_extends(_extends({}, args), { + type: type2 + })); + }; + }); + return [hookApiRef.current, /* @__PURE__ */ React45.createElement(ConfigConsumer, { + key: "holder" + }, function(context) { + getPrefixCls = context.getPrefixCls; + return holder; + })]; + }; + return useNotification2; + } + + // node_modules/antd/es/notification/index.js + var notificationInstance = {}; + var defaultDuration2 = 4.5; + var defaultTop2 = 24; + var defaultBottom = 24; + var defaultPrefixCls = ""; + var defaultPlacement = "topRight"; + var defaultGetContainer; + var defaultCloseIcon; + var rtl2 = false; + function setNotificationConfig(options) { + var duration = options.duration, placement = options.placement, bottom = options.bottom, top = options.top, getContainer3 = options.getContainer, closeIcon = options.closeIcon, prefixCls = options.prefixCls; + if (prefixCls !== void 0) { + defaultPrefixCls = prefixCls; + } + if (duration !== void 0) { + defaultDuration2 = duration; + } + if (placement !== void 0) { + defaultPlacement = placement; + } else if (options.rtl) { + defaultPlacement = "topLeft"; + } + if (bottom !== void 0) { + defaultBottom = bottom; + } + if (top !== void 0) { + defaultTop2 = top; + } + if (getContainer3 !== void 0) { + defaultGetContainer = getContainer3; + } + if (closeIcon !== void 0) { + defaultCloseIcon = closeIcon; + } + if (options.rtl !== void 0) { + rtl2 = options.rtl; + } + } + function getPlacementStyle(placement) { + var top = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultTop2; + var bottom = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : defaultBottom; + var style2; + switch (placement) { + case "topLeft": + style2 = { + left: 0, + top, + bottom: "auto" + }; + break; + case "topRight": + style2 = { + right: 0, + top, + bottom: "auto" + }; + break; + case "bottomLeft": + style2 = { + left: 0, + top: "auto", + bottom + }; + break; + default: + style2 = { + right: 0, + top: "auto", + bottom + }; + break; + } + return style2; + } + function getNotificationInstance(args, callback) { + var _args$placement = args.placement, placement = _args$placement === void 0 ? defaultPlacement : _args$placement, top = args.top, bottom = args.bottom, _args$getContainer = args.getContainer, getContainer3 = _args$getContainer === void 0 ? defaultGetContainer : _args$getContainer, _args$closeIcon = args.closeIcon, closeIcon = _args$closeIcon === void 0 ? defaultCloseIcon : _args$closeIcon, customizePrefixCls = args.prefixCls; + var _globalConfig = globalConfig(), getPrefixCls = _globalConfig.getPrefixCls; + var prefixCls = getPrefixCls("notification", customizePrefixCls || defaultPrefixCls); + var cacheKey = "".concat(prefixCls, "-").concat(placement); + var cacheInstance = notificationInstance[cacheKey]; + if (cacheInstance) { + Promise.resolve(cacheInstance).then(function(instance) { + callback({ + prefixCls: "".concat(prefixCls, "-notice"), + instance + }); + }); + return; + } + var closeIconToRender = /* @__PURE__ */ React46.createElement("span", { + className: "".concat(prefixCls, "-close-x") + }, closeIcon || /* @__PURE__ */ React46.createElement(CloseOutlined_default2, { + className: "".concat(prefixCls, "-close-icon") + })); + var notificationClass = (0, import_classnames7.default)("".concat(prefixCls, "-").concat(placement), _defineProperty({}, "".concat(prefixCls, "-rtl"), rtl2 === true)); + notificationInstance[cacheKey] = new Promise(function(resolve) { + es_default2.newInstance({ + prefixCls, + className: notificationClass, + style: getPlacementStyle(placement, top, bottom), + getContainer: getContainer3, + closeIcon: closeIconToRender + }, function(notification) { + resolve(notification); + callback({ + prefixCls: "".concat(prefixCls, "-notice"), + instance: notification + }); + }); + }); + } + var typeToIcon2 = { + success: CheckCircleOutlined_default2, + info: InfoCircleOutlined_default2, + error: CloseCircleOutlined_default2, + warning: ExclamationCircleOutlined_default2 + }; + function getRCNoticeProps2(args, prefixCls) { + var durationArg = args.duration, icon = args.icon, type2 = args.type, description = args.description, message = args.message, btn = args.btn, onClose2 = args.onClose, onClick = args.onClick, key2 = args.key, style2 = args.style, className = args.className; + var duration = durationArg === void 0 ? defaultDuration2 : durationArg; + var iconNode = null; + if (icon) { + iconNode = /* @__PURE__ */ React46.createElement("span", { + className: "".concat(prefixCls, "-icon") + }, args.icon); + } else if (type2) { + iconNode = /* @__PURE__ */ React46.createElement(typeToIcon2[type2] || null, { + className: "".concat(prefixCls, "-icon ").concat(prefixCls, "-icon-").concat(type2) + }); + } + var autoMarginTag = !description && iconNode ? /* @__PURE__ */ React46.createElement("span", { + className: "".concat(prefixCls, "-message-single-line-auto-margin") + }) : null; + return { + content: /* @__PURE__ */ React46.createElement("div", { + className: iconNode ? "".concat(prefixCls, "-with-icon") : "", + role: "alert" + }, iconNode, /* @__PURE__ */ React46.createElement("div", { + className: "".concat(prefixCls, "-message") + }, autoMarginTag, message), /* @__PURE__ */ React46.createElement("div", { + className: "".concat(prefixCls, "-description") + }, description), btn ? /* @__PURE__ */ React46.createElement("span", { + className: "".concat(prefixCls, "-btn") + }, btn) : null), + duration, + closable: true, + onClose: onClose2, + onClick, + key: key2, + style: style2 || {}, + className: (0, import_classnames7.default)(className, _defineProperty({}, "".concat(prefixCls, "-").concat(type2), !!type2)) + }; + } + function notice2(args) { + getNotificationInstance(args, function(_ref) { + var prefixCls = _ref.prefixCls, instance = _ref.instance; + instance.notice(getRCNoticeProps2(args, prefixCls)); + }); + } + var api2 = { + open: notice2, + close: function close(key2) { + Object.keys(notificationInstance).forEach(function(cacheKey) { + return Promise.resolve(notificationInstance[cacheKey]).then(function(instance) { + instance.removeNotice(key2); + }); + }); + }, + config: setNotificationConfig, + destroy: function destroy2() { + Object.keys(notificationInstance).forEach(function(cacheKey) { + Promise.resolve(notificationInstance[cacheKey]).then(function(instance) { + instance.destroy(); + }); + delete notificationInstance[cacheKey]; + }); + } + }; + ["success", "info", "warning", "error"].forEach(function(type2) { + api2[type2] = function(args) { + return api2.open(_extends(_extends({}, args), { + type: type2 + })); + }; + }); + api2.warn = api2.warning; + api2.useNotification = createUseNotification(getNotificationInstance, getRCNoticeProps2); + var notification_default = api2; + + // node_modules/antd/es/config-provider/index.js + var PASSED_PROPS = ["getTargetContainer", "getPopupContainer", "renderEmpty", "pageHeader", "input", "form"]; + var defaultPrefixCls2 = "ant"; + var globalPrefixCls; + var setGlobalConfig = function setGlobalConfig2(params) { + if (params.prefixCls !== void 0) { + globalPrefixCls = params.prefixCls; + } + }; + function getGlobalPrefixCls() { + return globalPrefixCls || defaultPrefixCls2; + } + var globalConfig = function globalConfig2() { + return { + getPrefixCls: function getPrefixCls(suffixCls, customizePrefixCls) { + if (customizePrefixCls) + return customizePrefixCls; + return suffixCls ? "".concat(getGlobalPrefixCls(), "-").concat(suffixCls) : getGlobalPrefixCls(); + }, + getRootPrefixCls: function getRootPrefixCls(rootPrefixCls, customizePrefixCls) { + if (rootPrefixCls) { + return rootPrefixCls; + } + if (globalPrefixCls) { + return globalPrefixCls; + } + if (customizePrefixCls && customizePrefixCls.includes("-")) { + return customizePrefixCls.replace(/^(.*)-[^-]*$/, "$1"); + } + return getGlobalPrefixCls(); + } + }; + }; + var ProviderChildren = function ProviderChildren2(props) { + var children = props.children, csp = props.csp, autoInsertSpaceInButton = props.autoInsertSpaceInButton, form = props.form, locale4 = props.locale, componentSize = props.componentSize, direction = props.direction, space = props.space, virtual = props.virtual, dropdownMatchSelectWidth = props.dropdownMatchSelectWidth, legacyLocale = props.legacyLocale, parentContext = props.parentContext, iconPrefixCls = props.iconPrefixCls; + var getPrefixCls = React47.useCallback(function(suffixCls, customizePrefixCls) { + var prefixCls = props.prefixCls; + if (customizePrefixCls) + return customizePrefixCls; + var mergedPrefixCls = prefixCls || parentContext.getPrefixCls(""); + return suffixCls ? "".concat(mergedPrefixCls, "-").concat(suffixCls) : mergedPrefixCls; + }, [parentContext.getPrefixCls, props.prefixCls]); + var config = _extends(_extends({}, parentContext), { + csp, + autoInsertSpaceInButton, + locale: locale4 || legacyLocale, + direction, + space, + virtual, + dropdownMatchSelectWidth, + getPrefixCls + }); + PASSED_PROPS.forEach(function(propName) { + var propValue = props[propName]; + if (propValue) { + config[propName] = propValue; + } + }); + var memoedConfig = useMemo2(function() { + return config; + }, config, function(prevConfig, currentConfig) { + var prevKeys = Object.keys(prevConfig); + var currentKeys = Object.keys(currentConfig); + return prevKeys.length !== currentKeys.length || prevKeys.some(function(key2) { + return prevConfig[key2] !== currentConfig[key2]; + }); + }); + var memoIconContextValue = React47.useMemo(function() { + return { + prefixCls: iconPrefixCls, + csp + }; + }, [iconPrefixCls]); + var childNode = children; + var validateMessages = {}; + if (locale4 && locale4.Form && locale4.Form.defaultValidateMessages) { + validateMessages = locale4.Form.defaultValidateMessages; + } + if (form && form.validateMessages) { + validateMessages = _extends(_extends({}, validateMessages), form.validateMessages); + } + if (Object.keys(validateMessages).length > 0) { + childNode = /* @__PURE__ */ React47.createElement(FormProvider, { + validateMessages + }, children); + } + if (locale4) { + childNode = /* @__PURE__ */ React47.createElement(LocaleProvider, { + locale: locale4, + _ANT_MARK__: ANT_MARK + }, childNode); + } + if (iconPrefixCls) { + childNode = /* @__PURE__ */ React47.createElement(Context_default.Provider, { + value: memoIconContextValue + }, childNode); + } + if (componentSize) { + childNode = /* @__PURE__ */ React47.createElement(SizeContextProvider, { + size: componentSize + }, childNode); + } + return /* @__PURE__ */ React47.createElement(ConfigContext.Provider, { + value: memoedConfig + }, childNode); + }; + var ConfigProvider = function ConfigProvider2(props) { + React47.useEffect(function() { + if (props.direction) { + message_default.config({ + rtl: props.direction === "rtl" + }); + notification_default.config({ + rtl: props.direction === "rtl" + }); + } + }, [props.direction]); + return /* @__PURE__ */ React47.createElement(LocaleReceiver, null, function(_, __, legacyLocale) { + return /* @__PURE__ */ React47.createElement(ConfigConsumer, null, function(context) { + return /* @__PURE__ */ React47.createElement(ProviderChildren, _extends({ + parentContext: context, + legacyLocale + }, props)); + }); + }); + }; + ConfigProvider.ConfigContext = ConfigContext; + ConfigProvider.SizeContext = SizeContext_default; + ConfigProvider.config = setGlobalConfig; + + // node_modules/rc-util/es/Dom/addEventListener.js + var import_react_dom4 = __toModule(require_react_dom()); + function addEventListenerWrap(target, eventType, cb, option) { + var callback = import_react_dom4.default.unstable_batchedUpdates ? function run(e) { + import_react_dom4.default.unstable_batchedUpdates(cb, e); + } : cb; + if (target.addEventListener) { + target.addEventListener(eventType, callback, option); + } + return { + remove: function remove() { + if (target.removeEventListener) { + target.removeEventListener(eventType, callback); + } + } + }; + } + + // node_modules/rc-util/es/KeyCode.js + var KeyCode = { + MAC_ENTER: 3, + BACKSPACE: 8, + TAB: 9, + NUM_CENTER: 12, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + PAUSE: 19, + CAPS_LOCK: 20, + ESC: 27, + SPACE: 32, + PAGE_UP: 33, + PAGE_DOWN: 34, + END: 35, + HOME: 36, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + PRINT_SCREEN: 44, + INSERT: 45, + DELETE: 46, + ZERO: 48, + ONE: 49, + TWO: 50, + THREE: 51, + FOUR: 52, + FIVE: 53, + SIX: 54, + SEVEN: 55, + EIGHT: 56, + NINE: 57, + QUESTION_MARK: 63, + A: 65, + B: 66, + C: 67, + D: 68, + E: 69, + F: 70, + G: 71, + H: 72, + I: 73, + J: 74, + K: 75, + L: 76, + M: 77, + N: 78, + O: 79, + P: 80, + Q: 81, + R: 82, + S: 83, + T: 84, + U: 85, + V: 86, + W: 87, + X: 88, + Y: 89, + Z: 90, + META: 91, + WIN_KEY_RIGHT: 92, + CONTEXT_MENU: 93, + NUM_ZERO: 96, + NUM_ONE: 97, + NUM_TWO: 98, + NUM_THREE: 99, + NUM_FOUR: 100, + NUM_FIVE: 101, + NUM_SIX: 102, + NUM_SEVEN: 103, + NUM_EIGHT: 104, + NUM_NINE: 105, + NUM_MULTIPLY: 106, + NUM_PLUS: 107, + NUM_MINUS: 109, + NUM_PERIOD: 110, + NUM_DIVISION: 111, + F1: 112, + F2: 113, + F3: 114, + F4: 115, + F5: 116, + F6: 117, + F7: 118, + F8: 119, + F9: 120, + F10: 121, + F11: 122, + F12: 123, + NUMLOCK: 144, + SEMICOLON: 186, + DASH: 189, + EQUALS: 187, + COMMA: 188, + PERIOD: 190, + SLASH: 191, + APOSTROPHE: 192, + SINGLE_QUOTE: 222, + OPEN_SQUARE_BRACKET: 219, + BACKSLASH: 220, + CLOSE_SQUARE_BRACKET: 221, + WIN_KEY: 224, + MAC_FF_META: 224, + WIN_IME: 229, + isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) { + var keyCode = e.keyCode; + if (e.altKey && !e.ctrlKey || e.metaKey || keyCode >= KeyCode.F1 && keyCode <= KeyCode.F12) { + return false; + } + switch (keyCode) { + case KeyCode.ALT: + case KeyCode.CAPS_LOCK: + case KeyCode.CONTEXT_MENU: + case KeyCode.CTRL: + case KeyCode.DOWN: + case KeyCode.END: + case KeyCode.ESC: + case KeyCode.HOME: + case KeyCode.INSERT: + case KeyCode.LEFT: + case KeyCode.MAC_FF_META: + case KeyCode.META: + case KeyCode.NUMLOCK: + case KeyCode.NUM_CENTER: + case KeyCode.PAGE_DOWN: + case KeyCode.PAGE_UP: + case KeyCode.PAUSE: + case KeyCode.PRINT_SCREEN: + case KeyCode.RIGHT: + case KeyCode.SHIFT: + case KeyCode.UP: + case KeyCode.WIN_KEY: + case KeyCode.WIN_KEY_RIGHT: + return false; + default: + return true; + } + }, + isCharacterKey: function isCharacterKey(keyCode) { + if (keyCode >= KeyCode.ZERO && keyCode <= KeyCode.NINE) { + return true; + } + if (keyCode >= KeyCode.NUM_ZERO && keyCode <= KeyCode.NUM_MULTIPLY) { + return true; + } + if (keyCode >= KeyCode.A && keyCode <= KeyCode.Z) { + return true; + } + if (window.navigator.userAgent.indexOf("WebKit") !== -1 && keyCode === 0) { + return true; + } + switch (keyCode) { + case KeyCode.SPACE: + case KeyCode.QUESTION_MARK: + case KeyCode.NUM_PLUS: + case KeyCode.NUM_MINUS: + case KeyCode.NUM_PERIOD: + case KeyCode.NUM_DIVISION: + case KeyCode.SEMICOLON: + case KeyCode.DASH: + case KeyCode.EQUALS: + case KeyCode.COMMA: + case KeyCode.PERIOD: + case KeyCode.SLASH: + case KeyCode.APOSTROPHE: + case KeyCode.SINGLE_QUOTE: + case KeyCode.OPEN_SQUARE_BRACKET: + case KeyCode.BACKSLASH: + case KeyCode.CLOSE_SQUARE_BRACKET: + return true; + default: + return false; + } + } + }; + var KeyCode_default = KeyCode; + + // node_modules/rc-util/es/isMobile.js + var isMobile_default = function() { + if (typeof navigator === "undefined" || typeof window === "undefined") { + return false; + } + var agent = navigator.userAgent || navigator.vendor || window.opera; + if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(agent === null || agent === void 0 ? void 0 : agent.substr(0, 4))) { + return true; + } + return false; + }; + + // node_modules/rc-util/es/hooks/useMergedState.js + var React48 = __toModule(require_react()); + function useControlledState(defaultStateValue, option) { + var _ref = option || {}, defaultValue = _ref.defaultValue, value = _ref.value, onChange = _ref.onChange, postState = _ref.postState; + var _React$useState = React48.useState(function() { + if (value !== void 0) { + return value; + } + if (defaultValue !== void 0) { + return typeof defaultValue === "function" ? defaultValue() : defaultValue; + } + return typeof defaultStateValue === "function" ? defaultStateValue() : defaultStateValue; + }), _React$useState2 = _slicedToArray(_React$useState, 2), innerValue = _React$useState2[0], setInnerValue = _React$useState2[1]; + var mergedValue = value !== void 0 ? value : innerValue; + if (postState) { + mergedValue = postState(mergedValue); + } + function triggerChange(newValue) { + setInnerValue(newValue); + if (mergedValue !== newValue && onChange) { + onChange(newValue, mergedValue); + } + } + var firstRenderRef = React48.useRef(true); + React48.useEffect(function() { + if (firstRenderRef.current) { + firstRenderRef.current = false; + return; + } + if (value === void 0) { + setInnerValue(value); + } + }, [value]); + return [mergedValue, triggerChange]; + } + + // node_modules/rc-trigger/es/index.js + var React57 = __toModule(require_react()); + var import_react_dom6 = __toModule(require_react_dom()); + + // node_modules/rc-util/es/Dom/contains.js + function contains(root, n) { + if (!root) { + return false; + } + return root.contains(n); + } + + // node_modules/rc-util/es/Portal.js + var import_react13 = __toModule(require_react()); + var import_react_dom5 = __toModule(require_react_dom()); + var Portal = (0, import_react13.forwardRef)(function(props, ref) { + var didUpdate = props.didUpdate, getContainer3 = props.getContainer, children = props.children; + var containerRef = (0, import_react13.useRef)(); + (0, import_react13.useImperativeHandle)(ref, function() { + return {}; + }); + var initRef = (0, import_react13.useRef)(false); + if (!initRef.current && canUseDom()) { + containerRef.current = getContainer3(); + initRef.current = true; + } + (0, import_react13.useEffect)(function() { + didUpdate === null || didUpdate === void 0 ? void 0 : didUpdate(props); + }); + (0, import_react13.useEffect)(function() { + return function() { + var _containerRef$current, _containerRef$current2; + (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.parentNode) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.removeChild(containerRef.current); + }; + }, []); + return containerRef.current ? import_react_dom5.default.createPortal(children, containerRef.current) : null; + }); + var Portal_default = Portal; + + // node_modules/rc-trigger/es/index.js + var import_classnames11 = __toModule(require_classnames()); + + // node_modules/rc-trigger/es/utils/alignUtil.js + function isPointsEq(a1, a2, isAlignPoint) { + if (isAlignPoint) { + return a1[0] === a2[0]; + } + return a1[0] === a2[0] && a1[1] === a2[1]; + } + function getAlignFromPlacement(builtinPlacements, placementStr, align) { + var baseAlign = builtinPlacements[placementStr] || {}; + return _objectSpread2(_objectSpread2({}, baseAlign), align); + } + function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) { + var points = align.points; + var placements = Object.keys(builtinPlacements); + for (var i = 0; i < placements.length; i += 1) { + var placement = placements[i]; + if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) { + return "".concat(prefixCls, "-placement-").concat(placement); + } + } + return ""; + } + + // node_modules/rc-trigger/es/Popup/index.js + var React55 = __toModule(require_react()); + var import_react18 = __toModule(require_react()); + + // node_modules/rc-trigger/es/Popup/Mask.js + var React49 = __toModule(require_react()); + var import_classnames8 = __toModule(require_classnames()); + + // node_modules/rc-trigger/es/utils/legacyUtil.js + function getMotion(_ref) { + var prefixCls = _ref.prefixCls, motion = _ref.motion, animation = _ref.animation, transitionName2 = _ref.transitionName; + if (motion) { + return motion; + } + if (animation) { + return { + motionName: "".concat(prefixCls, "-").concat(animation) + }; + } + if (transitionName2) { + return { + motionName: transitionName2 + }; + } + return null; + } + + // node_modules/rc-trigger/es/Popup/Mask.js + function Mask(props) { + var prefixCls = props.prefixCls, visible = props.visible, zIndex = props.zIndex, mask = props.mask, maskMotion = props.maskMotion, maskAnimation = props.maskAnimation, maskTransitionName = props.maskTransitionName; + if (!mask) { + return null; + } + var motion = {}; + if (maskMotion || maskTransitionName || maskAnimation) { + motion = _objectSpread2({ + motionAppear: true + }, getMotion({ + motion: maskMotion, + prefixCls, + transitionName: maskTransitionName, + animation: maskAnimation + })); + } + return /* @__PURE__ */ React49.createElement(es_default, _extends({}, motion, { + visible, + removeOnLeave: true + }), function(_ref) { + var className = _ref.className; + return /* @__PURE__ */ React49.createElement("div", { + style: { + zIndex + }, + className: (0, import_classnames8.default)("".concat(prefixCls, "-mask"), className) + }); + }); + } + + // node_modules/rc-trigger/es/Popup/PopupInner.js + var React53 = __toModule(require_react()); + var import_react17 = __toModule(require_react()); + + // node_modules/rc-align/es/Align.js + var import_react15 = __toModule(require_react()); + + // node_modules/rc-util/es/Dom/isVisible.js + var isVisible_default = function(element) { + if (!element) { + return false; + } + if (element.offsetParent) { + return true; + } + if (element.getBBox) { + var box = element.getBBox(); + if (box.width || box.height) { + return true; + } + } + if (element.getBoundingClientRect) { + var _box = element.getBoundingClientRect(); + if (_box.width || _box.height) { + return true; + } + } + return false; + }; + + // node_modules/dom-align/dist-web/index.js + function ownKeys4(object3, enumerableOnly) { + var keys = Object.keys(object3); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object3); + if (enumerableOnly) { + symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object3, sym).enumerable; + }); + } + keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread22(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys4(Object(source), true).forEach(function(key2) { + _defineProperty2(target, key2, source[key2]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys4(Object(source)).forEach(function(key2) { + Object.defineProperty(target, key2, Object.getOwnPropertyDescriptor(source, key2)); + }); + } + } + return target; + } + function _typeof2(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof2 = function(obj2) { + return typeof obj2; + }; + } else { + _typeof2 = function(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof2(obj); + } + function _defineProperty2(obj, key2, value) { + if (key2 in obj) { + Object.defineProperty(obj, key2, { + value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key2] = value; + } + return obj; + } + var vendorPrefix; + var jsCssMap = { + Webkit: "-webkit-", + Moz: "-moz-", + ms: "-ms-", + O: "-o-" + }; + function getVendorPrefix() { + if (vendorPrefix !== void 0) { + return vendorPrefix; + } + vendorPrefix = ""; + var style2 = document.createElement("p").style; + var testProp = "Transform"; + for (var key2 in jsCssMap) { + if (key2 + testProp in style2) { + vendorPrefix = key2; + } + } + return vendorPrefix; + } + function getTransitionName2() { + return getVendorPrefix() ? "".concat(getVendorPrefix(), "TransitionProperty") : "transitionProperty"; + } + function getTransformName() { + return getVendorPrefix() ? "".concat(getVendorPrefix(), "Transform") : "transform"; + } + function setTransitionProperty(node, value) { + var name = getTransitionName2(); + if (name) { + node.style[name] = value; + if (name !== "transitionProperty") { + node.style.transitionProperty = value; + } + } + } + function setTransform(node, value) { + var name = getTransformName(); + if (name) { + node.style[name] = value; + if (name !== "transform") { + node.style.transform = value; + } + } + } + function getTransitionProperty(node) { + return node.style.transitionProperty || node.style[getTransitionName2()]; + } + function getTransformXY(node) { + var style2 = window.getComputedStyle(node, null); + var transform = style2.getPropertyValue("transform") || style2.getPropertyValue(getTransformName()); + if (transform && transform !== "none") { + var matrix = transform.replace(/[^0-9\-.,]/g, "").split(","); + return { + x: parseFloat(matrix[12] || matrix[4], 0), + y: parseFloat(matrix[13] || matrix[5], 0) + }; + } + return { + x: 0, + y: 0 + }; + } + var matrix2d = /matrix\((.*)\)/; + var matrix3d = /matrix3d\((.*)\)/; + function setTransformXY(node, xy) { + var style2 = window.getComputedStyle(node, null); + var transform = style2.getPropertyValue("transform") || style2.getPropertyValue(getTransformName()); + if (transform && transform !== "none") { + var arr; + var match2d = transform.match(matrix2d); + if (match2d) { + match2d = match2d[1]; + arr = match2d.split(",").map(function(item) { + return parseFloat(item, 10); + }); + arr[4] = xy.x; + arr[5] = xy.y; + setTransform(node, "matrix(".concat(arr.join(","), ")")); + } else { + var match3d = transform.match(matrix3d)[1]; + arr = match3d.split(",").map(function(item) { + return parseFloat(item, 10); + }); + arr[12] = xy.x; + arr[13] = xy.y; + setTransform(node, "matrix3d(".concat(arr.join(","), ")")); + } + } else { + setTransform(node, "translateX(".concat(xy.x, "px) translateY(").concat(xy.y, "px) translateZ(0)")); + } + } + var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; + var getComputedStyleX; + function forceRelayout(elem) { + var originalStyle = elem.style.display; + elem.style.display = "none"; + elem.offsetHeight; + elem.style.display = originalStyle; + } + function css(el, name, v) { + var value = v; + if (_typeof2(name) === "object") { + for (var i in name) { + if (name.hasOwnProperty(i)) { + css(el, i, name[i]); + } + } + return void 0; + } + if (typeof value !== "undefined") { + if (typeof value === "number") { + value = "".concat(value, "px"); + } + el.style[name] = value; + return void 0; + } + return getComputedStyleX(el, name); + } + function getClientPosition(elem) { + var box; + var x; + var y; + var doc = elem.ownerDocument; + var body = doc.body; + var docElem = doc && doc.documentElement; + box = elem.getBoundingClientRect(); + x = box.left; + y = box.top; + x -= docElem.clientLeft || body.clientLeft || 0; + y -= docElem.clientTop || body.clientTop || 0; + return { + left: x, + top: y + }; + } + function getScroll(w, top) { + var ret = w["page".concat(top ? "Y" : "X", "Offset")]; + var method3 = "scroll".concat(top ? "Top" : "Left"); + if (typeof ret !== "number") { + var d = w.document; + ret = d.documentElement[method3]; + if (typeof ret !== "number") { + ret = d.body[method3]; + } + } + return ret; + } + function getScrollLeft(w) { + return getScroll(w); + } + function getScrollTop(w) { + return getScroll(w, true); + } + function getOffset(el) { + var pos = getClientPosition(el); + var doc = el.ownerDocument; + var w = doc.defaultView || doc.parentWindow; + pos.left += getScrollLeft(w); + pos.top += getScrollTop(w); + return pos; + } + function isWindow(obj) { + return obj !== null && obj !== void 0 && obj == obj.window; + } + function getDocument(node) { + if (isWindow(node)) { + return node.document; + } + if (node.nodeType === 9) { + return node; + } + return node.ownerDocument; + } + function _getComputedStyle(elem, name, cs) { + var computedStyle = cs; + var val = ""; + var d = getDocument(elem); + computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null); + if (computedStyle) { + val = computedStyle.getPropertyValue(name) || computedStyle[name]; + } + return val; + } + var _RE_NUM_NO_PX = new RegExp("^(".concat(RE_NUM, ")(?!px)[a-z%]+$"), "i"); + var RE_POS = /^(top|right|bottom|left)$/; + var CURRENT_STYLE = "currentStyle"; + var RUNTIME_STYLE = "runtimeStyle"; + var LEFT = "left"; + var PX = "px"; + function _getComputedStyleIE(elem, name) { + var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; + if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { + var style2 = elem.style; + var left = style2[LEFT]; + var rsLeft = elem[RUNTIME_STYLE][LEFT]; + elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; + style2[LEFT] = name === "fontSize" ? "1em" : ret || 0; + ret = style2.pixelLeft + PX; + style2[LEFT] = left; + elem[RUNTIME_STYLE][LEFT] = rsLeft; + } + return ret === "" ? "auto" : ret; + } + if (typeof window !== "undefined") { + getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; + } + function getOffsetDirection(dir, option) { + if (dir === "left") { + return option.useCssRight ? "right" : dir; + } + return option.useCssBottom ? "bottom" : dir; + } + function oppositeOffsetDirection(dir) { + if (dir === "left") { + return "right"; + } else if (dir === "right") { + return "left"; + } else if (dir === "top") { + return "bottom"; + } else if (dir === "bottom") { + return "top"; + } + } + function setLeftTop(elem, offset2, option) { + if (css(elem, "position") === "static") { + elem.style.position = "relative"; + } + var presetH = -999; + var presetV = -999; + var horizontalProperty = getOffsetDirection("left", option); + var verticalProperty = getOffsetDirection("top", option); + var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty); + var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty); + if (horizontalProperty !== "left") { + presetH = 999; + } + if (verticalProperty !== "top") { + presetV = 999; + } + var originalTransition = ""; + var originalOffset = getOffset(elem); + if ("left" in offset2 || "top" in offset2) { + originalTransition = getTransitionProperty(elem) || ""; + setTransitionProperty(elem, "none"); + } + if ("left" in offset2) { + elem.style[oppositeHorizontalProperty] = ""; + elem.style[horizontalProperty] = "".concat(presetH, "px"); + } + if ("top" in offset2) { + elem.style[oppositeVerticalProperty] = ""; + elem.style[verticalProperty] = "".concat(presetV, "px"); + } + forceRelayout(elem); + var old = getOffset(elem); + var originalStyle = {}; + for (var key2 in offset2) { + if (offset2.hasOwnProperty(key2)) { + var dir = getOffsetDirection(key2, option); + var preset = key2 === "left" ? presetH : presetV; + var off = originalOffset[key2] - old[key2]; + if (dir === key2) { + originalStyle[dir] = preset + off; + } else { + originalStyle[dir] = preset - off; + } + } + } + css(elem, originalStyle); + forceRelayout(elem); + if ("left" in offset2 || "top" in offset2) { + setTransitionProperty(elem, originalTransition); + } + var ret = {}; + for (var _key in offset2) { + if (offset2.hasOwnProperty(_key)) { + var _dir = getOffsetDirection(_key, option); + var _off = offset2[_key] - originalOffset[_key]; + if (_key === _dir) { + ret[_dir] = originalStyle[_dir] + _off; + } else { + ret[_dir] = originalStyle[_dir] - _off; + } + } + } + css(elem, ret); + } + function setTransform$1(elem, offset2) { + var originalOffset = getOffset(elem); + var originalXY = getTransformXY(elem); + var resultXY = { + x: originalXY.x, + y: originalXY.y + }; + if ("left" in offset2) { + resultXY.x = originalXY.x + offset2.left - originalOffset.left; + } + if ("top" in offset2) { + resultXY.y = originalXY.y + offset2.top - originalOffset.top; + } + setTransformXY(elem, resultXY); + } + function setOffset(elem, offset2, option) { + if (option.ignoreShake) { + var oriOffset = getOffset(elem); + var oLeft = oriOffset.left.toFixed(0); + var oTop = oriOffset.top.toFixed(0); + var tLeft = offset2.left.toFixed(0); + var tTop = offset2.top.toFixed(0); + if (oLeft === tLeft && oTop === tTop) { + return; + } + } + if (option.useCssRight || option.useCssBottom) { + setLeftTop(elem, offset2, option); + } else if (option.useCssTransform && getTransformName() in document.body.style) { + setTransform$1(elem, offset2); + } else { + setLeftTop(elem, offset2, option); + } + } + function each(arr, fn) { + for (var i = 0; i < arr.length; i++) { + fn(arr[i]); + } + } + function isBorderBoxFn(elem) { + return getComputedStyleX(elem, "boxSizing") === "border-box"; + } + var BOX_MODELS = ["margin", "border", "padding"]; + var CONTENT_INDEX = -1; + var PADDING_INDEX = 2; + var BORDER_INDEX = 1; + var MARGIN_INDEX = 0; + function swap(elem, options, callback) { + var old = {}; + var style2 = elem.style; + var name; + for (name in options) { + if (options.hasOwnProperty(name)) { + old[name] = style2[name]; + style2[name] = options[name]; + } + } + callback.call(elem); + for (name in options) { + if (options.hasOwnProperty(name)) { + style2[name] = old[name]; + } + } + } + function getPBMWidth(elem, props, which) { + var value = 0; + var prop; + var j; + var i; + for (j = 0; j < props.length; j++) { + prop = props[j]; + if (prop) { + for (i = 0; i < which.length; i++) { + var cssProp = void 0; + if (prop === "border") { + cssProp = "".concat(prop).concat(which[i], "Width"); + } else { + cssProp = prop + which[i]; + } + value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; + } + } + } + return value; + } + var domUtils = { + getParent: function getParent(element) { + var parent = element; + do { + if (parent.nodeType === 11 && parent.host) { + parent = parent.host; + } else { + parent = parent.parentNode; + } + } while (parent && parent.nodeType !== 1 && parent.nodeType !== 9); + return parent; + } + }; + each(["Width", "Height"], function(name) { + domUtils["doc".concat(name)] = function(refWin) { + var d = refWin.document; + return Math.max(d.documentElement["scroll".concat(name)], d.body["scroll".concat(name)], domUtils["viewport".concat(name)](d)); + }; + domUtils["viewport".concat(name)] = function(win) { + var prop = "client".concat(name); + var doc = win.document; + var body = doc.body; + var documentElement = doc.documentElement; + var documentElementProp = documentElement[prop]; + return doc.compatMode === "CSS1Compat" && documentElementProp || body && body[prop] || documentElementProp; + }; + }); + function getWH(elem, name, ex) { + var extra = ex; + if (isWindow(elem)) { + return name === "width" ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); + } else if (elem.nodeType === 9) { + return name === "width" ? domUtils.docWidth(elem) : domUtils.docHeight(elem); + } + var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"]; + var borderBoxValue = name === "width" ? elem.getBoundingClientRect().width : elem.getBoundingClientRect().height; + var isBorderBox = isBorderBoxFn(elem); + var cssBoxValue = 0; + if (borderBoxValue === null || borderBoxValue === void 0 || borderBoxValue <= 0) { + borderBoxValue = void 0; + cssBoxValue = getComputedStyleX(elem, name); + if (cssBoxValue === null || cssBoxValue === void 0 || Number(cssBoxValue) < 0) { + cssBoxValue = elem.style[name] || 0; + } + cssBoxValue = parseFloat(cssBoxValue) || 0; + } + if (extra === void 0) { + extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; + } + var borderBoxValueOrIsBorderBox = borderBoxValue !== void 0 || isBorderBox; + var val = borderBoxValue || cssBoxValue; + if (extra === CONTENT_INDEX) { + if (borderBoxValueOrIsBorderBox) { + return val - getPBMWidth(elem, ["border", "padding"], which); + } + return cssBoxValue; + } else if (borderBoxValueOrIsBorderBox) { + if (extra === BORDER_INDEX) { + return val; + } + return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ["border"], which) : getPBMWidth(elem, ["margin"], which)); + } + return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which); + } + var cssShow = { + position: "absolute", + visibility: "hidden", + display: "block" + }; + function getWHIgnoreDisplay() { + for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) { + args[_key2] = arguments[_key2]; + } + var val; + var elem = args[0]; + if (elem.offsetWidth !== 0) { + val = getWH.apply(void 0, args); + } else { + swap(elem, cssShow, function() { + val = getWH.apply(void 0, args); + }); + } + return val; + } + each(["width", "height"], function(name) { + var first = name.charAt(0).toUpperCase() + name.slice(1); + domUtils["outer".concat(first)] = function(el, includeMargin) { + return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); + }; + var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"]; + domUtils[name] = function(elem, v) { + var val = v; + if (val !== void 0) { + if (elem) { + var isBorderBox = isBorderBoxFn(elem); + if (isBorderBox) { + val += getPBMWidth(elem, ["padding", "border"], which); + } + return css(elem, name, val); + } + return void 0; + } + return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); + }; + }); + function mix2(to, from) { + for (var i in from) { + if (from.hasOwnProperty(i)) { + to[i] = from[i]; + } + } + return to; + } + var utils = { + getWindow: function getWindow(node) { + if (node && node.document && node.setTimeout) { + return node; + } + var doc = node.ownerDocument || node; + return doc.defaultView || doc.parentWindow; + }, + getDocument, + offset: function offset(el, value, option) { + if (typeof value !== "undefined") { + setOffset(el, value, option || {}); + } else { + return getOffset(el); + } + }, + isWindow, + each, + css, + clone: function clone(obj) { + var i; + var ret = {}; + for (i in obj) { + if (obj.hasOwnProperty(i)) { + ret[i] = obj[i]; + } + } + var overflow = obj.overflow; + if (overflow) { + for (i in obj) { + if (obj.hasOwnProperty(i)) { + ret.overflow[i] = obj.overflow[i]; + } + } + } + return ret; + }, + mix: mix2, + getWindowScrollLeft: function getWindowScrollLeft(w) { + return getScrollLeft(w); + }, + getWindowScrollTop: function getWindowScrollTop(w) { + return getScrollTop(w); + }, + merge: function merge() { + var ret = {}; + for (var i = 0; i < arguments.length; i++) { + utils.mix(ret, i < 0 || arguments.length <= i ? void 0 : arguments[i]); + } + return ret; + }, + viewportWidth: 0, + viewportHeight: 0 + }; + mix2(utils, domUtils); + var getParent2 = utils.getParent; + function getOffsetParent(element) { + if (utils.isWindow(element) || element.nodeType === 9) { + return null; + } + var doc = utils.getDocument(element); + var body = doc.body; + var parent; + var positionStyle = utils.css(element, "position"); + var skipStatic = positionStyle === "fixed" || positionStyle === "absolute"; + if (!skipStatic) { + return element.nodeName.toLowerCase() === "html" ? null : getParent2(element); + } + for (parent = getParent2(element); parent && parent !== body && parent.nodeType !== 9; parent = getParent2(parent)) { + positionStyle = utils.css(parent, "position"); + if (positionStyle !== "static") { + return parent; + } + } + return null; + } + var getParent$1 = utils.getParent; + function isAncestorFixed(element) { + if (utils.isWindow(element) || element.nodeType === 9) { + return false; + } + var doc = utils.getDocument(element); + var body = doc.body; + var parent = null; + for (parent = getParent$1(element); parent && parent !== body && parent !== doc; parent = getParent$1(parent)) { + var positionStyle = utils.css(parent, "position"); + if (positionStyle === "fixed") { + return true; + } + } + return false; + } + function getVisibleRectForElement(element, alwaysByViewport) { + var visibleRect = { + left: 0, + right: Infinity, + top: 0, + bottom: Infinity + }; + var el = getOffsetParent(element); + var doc = utils.getDocument(element); + var win = doc.defaultView || doc.parentWindow; + var body = doc.body; + var documentElement = doc.documentElement; + while (el) { + if ((navigator.userAgent.indexOf("MSIE") === -1 || el.clientWidth !== 0) && el !== body && el !== documentElement && utils.css(el, "overflow") !== "visible") { + var pos = utils.offset(el); + pos.left += el.clientLeft; + pos.top += el.clientTop; + visibleRect.top = Math.max(visibleRect.top, pos.top); + visibleRect.right = Math.min(visibleRect.right, pos.left + el.clientWidth); + visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight); + visibleRect.left = Math.max(visibleRect.left, pos.left); + } else if (el === body || el === documentElement) { + break; + } + el = getOffsetParent(el); + } + var originalPosition = null; + if (!utils.isWindow(element) && element.nodeType !== 9) { + originalPosition = element.style.position; + var position = utils.css(element, "position"); + if (position === "absolute") { + element.style.position = "fixed"; + } + } + var scrollX = utils.getWindowScrollLeft(win); + var scrollY = utils.getWindowScrollTop(win); + var viewportWidth = utils.viewportWidth(win); + var viewportHeight = utils.viewportHeight(win); + var documentWidth = documentElement.scrollWidth; + var documentHeight = documentElement.scrollHeight; + var bodyStyle = window.getComputedStyle(body); + if (bodyStyle.overflowX === "hidden") { + documentWidth = win.innerWidth; + } + if (bodyStyle.overflowY === "hidden") { + documentHeight = win.innerHeight; + } + if (element.style) { + element.style.position = originalPosition; + } + if (alwaysByViewport || isAncestorFixed(element)) { + visibleRect.left = Math.max(visibleRect.left, scrollX); + visibleRect.top = Math.max(visibleRect.top, scrollY); + visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth); + visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight); + } else { + var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth); + visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth); + var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight); + visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight); + } + return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null; + } + function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) { + var pos = utils.clone(elFuturePos); + var size = { + width: elRegion.width, + height: elRegion.height + }; + if (overflow.adjustX && pos.left < visibleRect.left) { + pos.left = visibleRect.left; + } + if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) { + size.width -= pos.left + size.width - visibleRect.right; + } + if (overflow.adjustX && pos.left + size.width > visibleRect.right) { + pos.left = Math.max(visibleRect.right - size.width, visibleRect.left); + } + if (overflow.adjustY && pos.top < visibleRect.top) { + pos.top = visibleRect.top; + } + if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) { + size.height -= pos.top + size.height - visibleRect.bottom; + } + if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) { + pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top); + } + return utils.mix(pos, size); + } + function getRegion(node) { + var offset2; + var w; + var h; + if (!utils.isWindow(node) && node.nodeType !== 9) { + offset2 = utils.offset(node); + w = utils.outerWidth(node); + h = utils.outerHeight(node); + } else { + var win = utils.getWindow(node); + offset2 = { + left: utils.getWindowScrollLeft(win), + top: utils.getWindowScrollTop(win) + }; + w = utils.viewportWidth(win); + h = utils.viewportHeight(win); + } + offset2.width = w; + offset2.height = h; + return offset2; + } + function getAlignOffset(region, align) { + var V = align.charAt(0); + var H = align.charAt(1); + var w = region.width; + var h = region.height; + var x = region.left; + var y = region.top; + if (V === "c") { + y += h / 2; + } else if (V === "b") { + y += h; + } + if (H === "c") { + x += w / 2; + } else if (H === "r") { + x += w; + } + return { + left: x, + top: y + }; + } + function getElFuturePos(elRegion, refNodeRegion, points, offset2, targetOffset) { + var p1 = getAlignOffset(refNodeRegion, points[1]); + var p2 = getAlignOffset(elRegion, points[0]); + var diff = [p2.left - p1.left, p2.top - p1.top]; + return { + left: Math.round(elRegion.left - diff[0] + offset2[0] - targetOffset[0]), + top: Math.round(elRegion.top - diff[1] + offset2[1] - targetOffset[1]) + }; + } + function isFailX(elFuturePos, elRegion, visibleRect) { + return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right; + } + function isFailY(elFuturePos, elRegion, visibleRect) { + return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom; + } + function isCompleteFailX(elFuturePos, elRegion, visibleRect) { + return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left; + } + function isCompleteFailY(elFuturePos, elRegion, visibleRect) { + return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top; + } + function flip(points, reg, map) { + var ret = []; + utils.each(points, function(p) { + ret.push(p.replace(reg, function(m) { + return map[m]; + })); + }); + return ret; + } + function flipOffset(offset2, index2) { + offset2[index2] = -offset2[index2]; + return offset2; + } + function convertOffset(str, offsetLen) { + var n; + if (/%$/.test(str)) { + n = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen; + } else { + n = parseInt(str, 10); + } + return n || 0; + } + function normalizeOffset(offset2, el) { + offset2[0] = convertOffset(offset2[0], el.width); + offset2[1] = convertOffset(offset2[1], el.height); + } + function doAlign(el, tgtRegion, align, isTgtRegionVisible) { + var points = align.points; + var offset2 = align.offset || [0, 0]; + var targetOffset = align.targetOffset || [0, 0]; + var overflow = align.overflow; + var source = align.source || el; + offset2 = [].concat(offset2); + targetOffset = [].concat(targetOffset); + overflow = overflow || {}; + var newOverflowCfg = {}; + var fail = 0; + var alwaysByViewport = !!(overflow && overflow.alwaysByViewport); + var visibleRect = getVisibleRectForElement(source, alwaysByViewport); + var elRegion = getRegion(source); + normalizeOffset(offset2, elRegion); + normalizeOffset(targetOffset, tgtRegion); + var elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset2, targetOffset); + var newElRegion = utils.merge(elRegion, elFuturePos); + if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) { + if (overflow.adjustX) { + if (isFailX(elFuturePos, elRegion, visibleRect)) { + var newPoints = flip(points, /[lr]/gi, { + l: "r", + r: "l" + }); + var newOffset = flipOffset(offset2, 0); + var newTargetOffset = flipOffset(targetOffset, 0); + var newElFuturePos = getElFuturePos(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset); + if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) { + fail = 1; + points = newPoints; + offset2 = newOffset; + targetOffset = newTargetOffset; + } + } + } + if (overflow.adjustY) { + if (isFailY(elFuturePos, elRegion, visibleRect)) { + var _newPoints = flip(points, /[tb]/gi, { + t: "b", + b: "t" + }); + var _newOffset = flipOffset(offset2, 1); + var _newTargetOffset = flipOffset(targetOffset, 1); + var _newElFuturePos = getElFuturePos(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset); + if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) { + fail = 1; + points = _newPoints; + offset2 = _newOffset; + targetOffset = _newTargetOffset; + } + } + } + if (fail) { + elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset2, targetOffset); + utils.mix(newElRegion, elFuturePos); + } + var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect); + var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect); + if (isStillFailX || isStillFailY) { + var _newPoints2 = points; + if (isStillFailX) { + _newPoints2 = flip(points, /[lr]/gi, { + l: "r", + r: "l" + }); + } + if (isStillFailY) { + _newPoints2 = flip(points, /[tb]/gi, { + t: "b", + b: "t" + }); + } + points = _newPoints2; + offset2 = align.offset || [0, 0]; + targetOffset = align.targetOffset || [0, 0]; + } + newOverflowCfg.adjustX = overflow.adjustX && isStillFailX; + newOverflowCfg.adjustY = overflow.adjustY && isStillFailY; + if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) { + newElRegion = adjustForViewport(elFuturePos, elRegion, visibleRect, newOverflowCfg); + } + } + if (newElRegion.width !== elRegion.width) { + utils.css(source, "width", utils.width(source) + newElRegion.width - elRegion.width); + } + if (newElRegion.height !== elRegion.height) { + utils.css(source, "height", utils.height(source) + newElRegion.height - elRegion.height); + } + utils.offset(source, { + left: newElRegion.left, + top: newElRegion.top + }, { + useCssRight: align.useCssRight, + useCssBottom: align.useCssBottom, + useCssTransform: align.useCssTransform, + ignoreShake: align.ignoreShake + }); + return { + points, + offset: offset2, + targetOffset, + overflow: newOverflowCfg + }; + } + function isOutOfVisibleRect(target, alwaysByViewport) { + var visibleRect = getVisibleRectForElement(target, alwaysByViewport); + var targetRegion = getRegion(target); + return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom; + } + function alignElement(el, refNode, align) { + var target = align.target || refNode; + var refNodeRegion = getRegion(target); + var isTargetNotOutOfVisible = !isOutOfVisibleRect(target, align.overflow && align.overflow.alwaysByViewport); + return doAlign(el, refNodeRegion, align, isTargetNotOutOfVisible); + } + alignElement.__getOffsetParent = getOffsetParent; + alignElement.__getVisibleRectForElement = getVisibleRectForElement; + function alignPoint(el, tgtPoint, align) { + var pageX; + var pageY; + var doc = utils.getDocument(el); + var win = doc.defaultView || doc.parentWindow; + var scrollX = utils.getWindowScrollLeft(win); + var scrollY = utils.getWindowScrollTop(win); + var viewportWidth = utils.viewportWidth(win); + var viewportHeight = utils.viewportHeight(win); + if ("pageX" in tgtPoint) { + pageX = tgtPoint.pageX; + } else { + pageX = scrollX + tgtPoint.clientX; + } + if ("pageY" in tgtPoint) { + pageY = tgtPoint.pageY; + } else { + pageY = scrollY + tgtPoint.clientY; + } + var tgtRegion = { + left: pageX, + top: pageY, + width: 0, + height: 0 + }; + var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight; + var points = [align.points[0], "cc"]; + return doAlign(el, tgtRegion, _objectSpread22(_objectSpread22({}, align), {}, { + points + }), pointInView); + } + + // node_modules/rc-align/es/util.js + function isSamePoint(prev, next) { + if (prev === next) + return true; + if (!prev || !next) + return false; + if ("pageX" in next && "pageY" in next) { + return prev.pageX === next.pageX && prev.pageY === next.pageY; + } + if ("clientX" in next && "clientY" in next) { + return prev.clientX === next.clientX && prev.clientY === next.clientY; + } + return false; + } + function restoreFocus(activeElement, container) { + if (activeElement !== document.activeElement && contains(container, activeElement) && typeof activeElement.focus === "function") { + activeElement.focus(); + } + } + function monitorResize(element, callback) { + var prevWidth = null; + var prevHeight = null; + function onResize(_ref) { + var _ref2 = _slicedToArray(_ref, 1), target = _ref2[0].target; + if (!document.documentElement.contains(target)) + return; + var _target$getBoundingCl = target.getBoundingClientRect(), width = _target$getBoundingCl.width, height = _target$getBoundingCl.height; + var fixedWidth = Math.floor(width); + var fixedHeight = Math.floor(height); + if (prevWidth !== fixedWidth || prevHeight !== fixedHeight) { + Promise.resolve().then(function() { + callback({ + width: fixedWidth, + height: fixedHeight + }); + }); + } + prevWidth = fixedWidth; + prevHeight = fixedHeight; + } + var resizeObserver = new ResizeObserver_es_default(onResize); + if (element) { + resizeObserver.observe(element); + } + return function() { + resizeObserver.disconnect(); + }; + } + + // node_modules/rc-align/es/hooks/useBuffer.js + var import_react14 = __toModule(require_react()); + var useBuffer_default = function(callback, buffer) { + var calledRef = import_react14.default.useRef(false); + var timeoutRef = import_react14.default.useRef(null); + function cancelTrigger() { + window.clearTimeout(timeoutRef.current); + } + function trigger(force) { + if (!calledRef.current || force === true) { + if (callback() === false) { + return; + } + calledRef.current = true; + cancelTrigger(); + timeoutRef.current = window.setTimeout(function() { + calledRef.current = false; + }, buffer); + } else { + cancelTrigger(); + timeoutRef.current = window.setTimeout(function() { + calledRef.current = false; + trigger(); + }, buffer); + } + } + return [trigger, function() { + calledRef.current = false; + cancelTrigger(); + }]; + }; + + // node_modules/rc-align/es/Align.js + function getElement(func) { + if (typeof func !== "function") + return null; + return func(); + } + function getPoint(point) { + if (_typeof(point) !== "object" || !point) + return null; + return point; + } + var Align = function Align2(_ref, ref) { + var children = _ref.children, disabled = _ref.disabled, target = _ref.target, align = _ref.align, onAlign = _ref.onAlign, monitorWindowResize = _ref.monitorWindowResize, _ref$monitorBufferTim = _ref.monitorBufferTime, monitorBufferTime = _ref$monitorBufferTim === void 0 ? 0 : _ref$monitorBufferTim; + var cacheRef = import_react15.default.useRef({}); + var nodeRef = import_react15.default.useRef(); + var childNode = import_react15.default.Children.only(children); + var forceAlignPropsRef = import_react15.default.useRef({}); + forceAlignPropsRef.current.disabled = disabled; + forceAlignPropsRef.current.target = target; + forceAlignPropsRef.current.onAlign = onAlign; + var _useBuffer = useBuffer_default(function() { + var _forceAlignPropsRef$c = forceAlignPropsRef.current, latestDisabled = _forceAlignPropsRef$c.disabled, latestTarget = _forceAlignPropsRef$c.target, latestOnAlign = _forceAlignPropsRef$c.onAlign; + if (!latestDisabled && latestTarget) { + var source = nodeRef.current; + var result; + var element = getElement(latestTarget); + var point = getPoint(latestTarget); + cacheRef.current.element = element; + cacheRef.current.point = point; + var _document = document, activeElement = _document.activeElement; + if (element && isVisible_default(element)) { + result = alignElement(source, element, align); + } else if (point) { + result = alignPoint(source, point, align); + } + restoreFocus(activeElement, source); + if (latestOnAlign && result) { + latestOnAlign(source, result); + } + return true; + } + return false; + }, monitorBufferTime), _useBuffer2 = _slicedToArray(_useBuffer, 2), _forceAlign = _useBuffer2[0], cancelForceAlign = _useBuffer2[1]; + var resizeMonitor = import_react15.default.useRef({ + cancel: function cancel2() { + } + }); + var sourceResizeMonitor = import_react15.default.useRef({ + cancel: function cancel2() { + } + }); + import_react15.default.useEffect(function() { + var element = getElement(target); + var point = getPoint(target); + if (nodeRef.current !== sourceResizeMonitor.current.element) { + sourceResizeMonitor.current.cancel(); + sourceResizeMonitor.current.element = nodeRef.current; + sourceResizeMonitor.current.cancel = monitorResize(nodeRef.current, _forceAlign); + } + if (cacheRef.current.element !== element || !isSamePoint(cacheRef.current.point, point)) { + _forceAlign(); + if (resizeMonitor.current.element !== element) { + resizeMonitor.current.cancel(); + resizeMonitor.current.element = element; + resizeMonitor.current.cancel = monitorResize(element, _forceAlign); + } + } + }); + import_react15.default.useEffect(function() { + if (!disabled) { + _forceAlign(); + } else { + cancelForceAlign(); + } + }, [disabled]); + var winResizeRef = import_react15.default.useRef(null); + import_react15.default.useEffect(function() { + if (monitorWindowResize) { + if (!winResizeRef.current) { + winResizeRef.current = addEventListenerWrap(window, "resize", _forceAlign); + } + } else if (winResizeRef.current) { + winResizeRef.current.remove(); + winResizeRef.current = null; + } + }, [monitorWindowResize]); + import_react15.default.useEffect(function() { + return function() { + resizeMonitor.current.cancel(); + sourceResizeMonitor.current.cancel(); + if (winResizeRef.current) + winResizeRef.current.remove(); + cancelForceAlign(); + }; + }, []); + import_react15.default.useImperativeHandle(ref, function() { + return { + forceAlign: function forceAlign() { + return _forceAlign(true); + } + }; + }); + if (import_react15.default.isValidElement(childNode)) { + childNode = import_react15.default.cloneElement(childNode, { + ref: composeRef(childNode.ref, nodeRef) + }); + } + return childNode; + }; + var RefAlign = import_react15.default.forwardRef(Align); + RefAlign.displayName = "Align"; + var Align_default = RefAlign; + + // node_modules/rc-align/es/index.js + var es_default3 = Align_default; + + // node_modules/rc-trigger/es/Popup/PopupInner.js + var import_classnames9 = __toModule(require_classnames()); + + // node_modules/rc-trigger/es/Popup/useVisibleStatus.js + var import_regenerator3 = __toModule(require_regenerator()); + var import_react16 = __toModule(require_react()); + var StatusQueue = ["measure", "align", null, "motion"]; + var useVisibleStatus_default = function(visible, doMeasure) { + var _useState = (0, import_react16.useState)(null), _useState2 = _slicedToArray(_useState, 2), status = _useState2[0], setInternalStatus = _useState2[1]; + var rafRef = (0, import_react16.useRef)(); + var destroyRef = (0, import_react16.useRef)(false); + function setStatus(nextStatus) { + if (!destroyRef.current) { + setInternalStatus(nextStatus); + } + } + function cancelRaf() { + wrapperRaf.cancel(rafRef.current); + } + function goNextStatus(callback) { + cancelRaf(); + rafRef.current = wrapperRaf(function() { + setStatus(function(prev) { + switch (status) { + case "align": + return "motion"; + case "motion": + return "stable"; + default: + } + return prev; + }); + callback === null || callback === void 0 ? void 0 : callback(); + }); + } + (0, import_react16.useEffect)(function() { + setStatus("measure"); + }, [visible]); + (0, import_react16.useEffect)(function() { + switch (status) { + case "measure": + doMeasure(); + break; + default: + } + if (status) { + rafRef.current = wrapperRaf(/* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ import_regenerator3.default.mark(function _callee() { + var index2, nextStatus; + return import_regenerator3.default.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + index2 = StatusQueue.indexOf(status); + nextStatus = StatusQueue[index2 + 1]; + if (nextStatus && index2 !== -1) { + setStatus(nextStatus); + } + case 3: + case "end": + return _context.stop(); + } + } + }, _callee); + }))); + } + }, [status]); + (0, import_react16.useEffect)(function() { + return function() { + destroyRef.current = true; + cancelRaf(); + }; + }, []); + return [status, goNextStatus]; + }; + + // node_modules/rc-trigger/es/Popup/useStretchStyle.js + var React52 = __toModule(require_react()); + var useStretchStyle_default = function(stretch) { + var _React$useState = React52.useState({ + width: 0, + height: 0 + }), _React$useState2 = _slicedToArray(_React$useState, 2), targetSize = _React$useState2[0], setTargetSize = _React$useState2[1]; + function measureStretch(element) { + setTargetSize({ + width: element.offsetWidth, + height: element.offsetHeight + }); + } + var style2 = React52.useMemo(function() { + var sizeStyle = {}; + if (stretch) { + var width = targetSize.width, height = targetSize.height; + if (stretch.indexOf("height") !== -1 && height) { + sizeStyle.height = height; + } else if (stretch.indexOf("minHeight") !== -1 && height) { + sizeStyle.minHeight = height; + } + if (stretch.indexOf("width") !== -1 && width) { + sizeStyle.width = width; + } else if (stretch.indexOf("minWidth") !== -1 && width) { + sizeStyle.minWidth = width; + } + } + return sizeStyle; + }, [stretch, targetSize]); + return [style2, measureStretch]; + }; + + // node_modules/rc-trigger/es/Popup/PopupInner.js + var PopupInner = /* @__PURE__ */ React53.forwardRef(function(props, ref) { + var visible = props.visible, prefixCls = props.prefixCls, className = props.className, style2 = props.style, children = props.children, zIndex = props.zIndex, stretch = props.stretch, destroyPopupOnHide = props.destroyPopupOnHide, forceRender = props.forceRender, align = props.align, point = props.point, getRootDomNode = props.getRootDomNode, getClassNameFromAlign = props.getClassNameFromAlign, onAlign = props.onAlign, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onMouseDown = props.onMouseDown, onTouchStart = props.onTouchStart; + var alignRef = (0, import_react17.useRef)(); + var elementRef = (0, import_react17.useRef)(); + var _useState = (0, import_react17.useState)(), _useState2 = _slicedToArray(_useState, 2), alignedClassName = _useState2[0], setAlignedClassName = _useState2[1]; + var _useStretchStyle = useStretchStyle_default(stretch), _useStretchStyle2 = _slicedToArray(_useStretchStyle, 2), stretchStyle = _useStretchStyle2[0], measureStretchStyle = _useStretchStyle2[1]; + function doMeasure() { + if (stretch) { + measureStretchStyle(getRootDomNode()); + } + } + var _useVisibleStatus = useVisibleStatus_default(visible, doMeasure), _useVisibleStatus2 = _slicedToArray(_useVisibleStatus, 2), status = _useVisibleStatus2[0], goNextStatus = _useVisibleStatus2[1]; + var prepareResolveRef = (0, import_react17.useRef)(); + function getAlignTarget() { + if (point) { + return point; + } + return getRootDomNode; + } + function forceAlign() { + var _alignRef$current; + (_alignRef$current = alignRef.current) === null || _alignRef$current === void 0 ? void 0 : _alignRef$current.forceAlign(); + } + function onInternalAlign(popupDomNode, matchAlign) { + if (status === "align") { + var nextAlignedClassName = getClassNameFromAlign(matchAlign); + setAlignedClassName(nextAlignedClassName); + if (alignedClassName !== nextAlignedClassName) { + Promise.resolve().then(function() { + forceAlign(); + }); + } else { + goNextStatus(function() { + var _prepareResolveRef$cu; + (_prepareResolveRef$cu = prepareResolveRef.current) === null || _prepareResolveRef$cu === void 0 ? void 0 : _prepareResolveRef$cu.call(prepareResolveRef); + }); + } + onAlign === null || onAlign === void 0 ? void 0 : onAlign(popupDomNode, matchAlign); + } + } + var motion = _objectSpread2({}, getMotion(props)); + ["onAppearEnd", "onEnterEnd", "onLeaveEnd"].forEach(function(eventName) { + var originHandler = motion[eventName]; + motion[eventName] = function(element, event) { + goNextStatus(); + return originHandler === null || originHandler === void 0 ? void 0 : originHandler(element, event); + }; + }); + function onShowPrepare() { + return new Promise(function(resolve) { + prepareResolveRef.current = resolve; + }); + } + React53.useEffect(function() { + if (!motion.motionName && status === "motion") { + goNextStatus(); + } + }, [motion.motionName, status]); + React53.useImperativeHandle(ref, function() { + return { + forceAlign, + getElement: function getElement2() { + return elementRef.current; + } + }; + }); + var mergedStyle = _objectSpread2(_objectSpread2({}, stretchStyle), {}, { + zIndex, + opacity: status === "motion" || status === "stable" || !visible ? void 0 : 0, + pointerEvents: status === "stable" ? void 0 : "none" + }, style2); + var alignDisabled = true; + if ((align === null || align === void 0 ? void 0 : align.points) && (status === "align" || status === "stable")) { + alignDisabled = false; + } + var childNode = children; + if (React53.Children.count(children) > 1) { + childNode = /* @__PURE__ */ React53.createElement("div", { + className: "".concat(prefixCls, "-content") + }, children); + } + return /* @__PURE__ */ React53.createElement(es_default, _extends({ + visible, + ref: elementRef, + leavedClassName: "".concat(prefixCls, "-hidden") + }, motion, { + onAppearPrepare: onShowPrepare, + onEnterPrepare: onShowPrepare, + removeOnLeave: destroyPopupOnHide, + forceRender + }), function(_ref, motionRef) { + var motionClassName = _ref.className, motionStyle = _ref.style; + var mergedClassName = (0, import_classnames9.default)(prefixCls, className, alignedClassName, motionClassName); + return /* @__PURE__ */ React53.createElement(es_default3, { + target: getAlignTarget(), + key: "popup", + ref: alignRef, + monitorWindowResize: true, + disabled: alignDisabled, + align, + onAlign: onInternalAlign + }, /* @__PURE__ */ React53.createElement("div", { + ref: motionRef, + className: mergedClassName, + onMouseEnter, + onMouseLeave, + onMouseDownCapture: onMouseDown, + onTouchStartCapture: onTouchStart, + style: _objectSpread2(_objectSpread2({}, motionStyle), mergedStyle) + }, childNode)); + }); + }); + PopupInner.displayName = "PopupInner"; + var PopupInner_default = PopupInner; + + // node_modules/rc-trigger/es/Popup/MobilePopupInner.js + var React54 = __toModule(require_react()); + var import_classnames10 = __toModule(require_classnames()); + var MobilePopupInner = /* @__PURE__ */ React54.forwardRef(function(props, ref) { + var prefixCls = props.prefixCls, visible = props.visible, zIndex = props.zIndex, children = props.children, _props$mobile = props.mobile; + _props$mobile = _props$mobile === void 0 ? {} : _props$mobile; + var popupClassName = _props$mobile.popupClassName, popupStyle = _props$mobile.popupStyle, _props$mobile$popupMo = _props$mobile.popupMotion, popupMotion = _props$mobile$popupMo === void 0 ? {} : _props$mobile$popupMo, popupRender = _props$mobile.popupRender; + var elementRef = React54.useRef(); + React54.useImperativeHandle(ref, function() { + return { + forceAlign: function forceAlign() { + }, + getElement: function getElement2() { + return elementRef.current; + } + }; + }); + var mergedStyle = _objectSpread2({ + zIndex + }, popupStyle); + var childNode = children; + if (React54.Children.count(children) > 1) { + childNode = /* @__PURE__ */ React54.createElement("div", { + className: "".concat(prefixCls, "-content") + }, children); + } + if (popupRender) { + childNode = popupRender(childNode); + } + return /* @__PURE__ */ React54.createElement(es_default, _extends({ + visible, + ref: elementRef, + removeOnLeave: true + }, popupMotion), function(_ref, motionRef) { + var motionClassName = _ref.className, motionStyle = _ref.style; + var mergedClassName = (0, import_classnames10.default)(prefixCls, popupClassName, motionClassName); + return /* @__PURE__ */ React54.createElement("div", { + ref: motionRef, + className: mergedClassName, + style: _objectSpread2(_objectSpread2({}, motionStyle), mergedStyle) + }, childNode); + }); + }); + MobilePopupInner.displayName = "MobilePopupInner"; + var MobilePopupInner_default = MobilePopupInner; + + // node_modules/rc-trigger/es/Popup/index.js + var Popup = /* @__PURE__ */ React55.forwardRef(function(_ref, ref) { + var visible = _ref.visible, mobile = _ref.mobile, props = _objectWithoutProperties(_ref, ["visible", "mobile"]); + var _useState = (0, import_react18.useState)(visible), _useState2 = _slicedToArray(_useState, 2), innerVisible = _useState2[0], serInnerVisible = _useState2[1]; + var _useState3 = (0, import_react18.useState)(false), _useState4 = _slicedToArray(_useState3, 2), inMobile = _useState4[0], setInMobile = _useState4[1]; + var cloneProps = _objectSpread2(_objectSpread2({}, props), {}, { + visible: innerVisible + }); + (0, import_react18.useEffect)(function() { + serInnerVisible(visible); + if (visible && mobile) { + setInMobile(isMobile_default()); + } + }, [visible, mobile]); + var popupNode = inMobile ? /* @__PURE__ */ React55.createElement(MobilePopupInner_default, _extends({}, cloneProps, { + mobile, + ref + })) : /* @__PURE__ */ React55.createElement(PopupInner_default, _extends({}, cloneProps, { + ref + })); + return /* @__PURE__ */ React55.createElement("div", null, /* @__PURE__ */ React55.createElement(Mask, cloneProps), popupNode); + }); + Popup.displayName = "Popup"; + var Popup_default = Popup; + + // node_modules/rc-trigger/es/context.js + var React56 = __toModule(require_react()); + var TriggerContext = /* @__PURE__ */ React56.createContext(null); + var context_default2 = TriggerContext; + + // node_modules/rc-trigger/es/index.js + function noop() { + } + function returnEmptyString() { + return ""; + } + function returnDocument(element) { + if (element) { + return element.ownerDocument; + } + return window.document; + } + var ALL_HANDLERS = ["onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onContextMenu"]; + function generateTrigger(PortalComponent) { + var Trigger = /* @__PURE__ */ function(_React$Component) { + _inherits(Trigger2, _React$Component); + var _super = _createSuper(Trigger2); + function Trigger2(props) { + var _this; + _classCallCheck(this, Trigger2); + _this = _super.call(this, props); + _this.popupRef = /* @__PURE__ */ React57.createRef(); + _this.triggerRef = /* @__PURE__ */ React57.createRef(); + _this.onMouseEnter = function(e) { + var mouseEnterDelay = _this.props.mouseEnterDelay; + _this.fireEvents("onMouseEnter", e); + _this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e); + }; + _this.onMouseMove = function(e) { + _this.fireEvents("onMouseMove", e); + _this.setPoint(e); + }; + _this.onMouseLeave = function(e) { + _this.fireEvents("onMouseLeave", e); + _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay); + }; + _this.onPopupMouseEnter = function() { + _this.clearDelayTimer(); + }; + _this.onPopupMouseLeave = function(e) { + var _this$popupRef$curren; + if (e.relatedTarget && !e.relatedTarget.setTimeout && contains((_this$popupRef$curren = _this.popupRef.current) === null || _this$popupRef$curren === void 0 ? void 0 : _this$popupRef$curren.getElement(), e.relatedTarget)) { + return; + } + _this.delaySetPopupVisible(false, _this.props.mouseLeaveDelay); + }; + _this.onFocus = function(e) { + _this.fireEvents("onFocus", e); + _this.clearDelayTimer(); + if (_this.isFocusToShow()) { + _this.focusTime = Date.now(); + _this.delaySetPopupVisible(true, _this.props.focusDelay); + } + }; + _this.onMouseDown = function(e) { + _this.fireEvents("onMouseDown", e); + _this.preClickTime = Date.now(); + }; + _this.onTouchStart = function(e) { + _this.fireEvents("onTouchStart", e); + _this.preTouchTime = Date.now(); + }; + _this.onBlur = function(e) { + _this.fireEvents("onBlur", e); + _this.clearDelayTimer(); + if (_this.isBlurToHide()) { + _this.delaySetPopupVisible(false, _this.props.blurDelay); + } + }; + _this.onContextMenu = function(e) { + e.preventDefault(); + _this.fireEvents("onContextMenu", e); + _this.setPopupVisible(true, e); + }; + _this.onContextMenuClose = function() { + if (_this.isContextMenuToShow()) { + _this.close(); + } + }; + _this.onClick = function(event) { + _this.fireEvents("onClick", event); + if (_this.focusTime) { + var preTime; + if (_this.preClickTime && _this.preTouchTime) { + preTime = Math.min(_this.preClickTime, _this.preTouchTime); + } else if (_this.preClickTime) { + preTime = _this.preClickTime; + } else if (_this.preTouchTime) { + preTime = _this.preTouchTime; + } + if (Math.abs(preTime - _this.focusTime) < 20) { + return; + } + _this.focusTime = 0; + } + _this.preClickTime = 0; + _this.preTouchTime = 0; + if (_this.isClickToShow() && (_this.isClickToHide() || _this.isBlurToHide()) && event && event.preventDefault) { + event.preventDefault(); + } + var nextVisible = !_this.state.popupVisible; + if (_this.isClickToHide() && !nextVisible || nextVisible && _this.isClickToShow()) { + _this.setPopupVisible(!_this.state.popupVisible, event); + } + }; + _this.onPopupMouseDown = function() { + _this.hasPopupMouseDown = true; + clearTimeout(_this.mouseDownTimeout); + _this.mouseDownTimeout = window.setTimeout(function() { + _this.hasPopupMouseDown = false; + }, 0); + if (_this.context) { + var _this$context; + (_this$context = _this.context).onPopupMouseDown.apply(_this$context, arguments); + } + }; + _this.onDocumentClick = function(event) { + if (_this.props.mask && !_this.props.maskClosable) { + return; + } + var target = event.target; + var root = _this.getRootDomNode(); + var popupNode = _this.getPopupDomNode(); + if ((!contains(root, target) || _this.isContextMenuOnly()) && !contains(popupNode, target) && !_this.hasPopupMouseDown) { + _this.close(); + } + }; + _this.getRootDomNode = function() { + var getTriggerDOMNode = _this.props.getTriggerDOMNode; + if (getTriggerDOMNode) { + return getTriggerDOMNode(_this.triggerRef.current); + } + try { + var domNode = findDOMNode(_this.triggerRef.current); + if (domNode) { + return domNode; + } + } catch (err) { + } + return import_react_dom6.default.findDOMNode(_assertThisInitialized(_this)); + }; + _this.getPopupClassNameFromAlign = function(align) { + var className = []; + var _this$props = _this.props, popupPlacement = _this$props.popupPlacement, builtinPlacements = _this$props.builtinPlacements, prefixCls = _this$props.prefixCls, alignPoint2 = _this$props.alignPoint, getPopupClassNameFromAlign = _this$props.getPopupClassNameFromAlign; + if (popupPlacement && builtinPlacements) { + className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint2)); + } + if (getPopupClassNameFromAlign) { + className.push(getPopupClassNameFromAlign(align)); + } + return className.join(" "); + }; + _this.getComponent = function() { + var _this$props2 = _this.props, prefixCls = _this$props2.prefixCls, destroyPopupOnHide = _this$props2.destroyPopupOnHide, popupClassName = _this$props2.popupClassName, onPopupAlign = _this$props2.onPopupAlign, popupMotion = _this$props2.popupMotion, popupAnimation = _this$props2.popupAnimation, popupTransitionName = _this$props2.popupTransitionName, popupStyle = _this$props2.popupStyle, mask = _this$props2.mask, maskAnimation = _this$props2.maskAnimation, maskTransitionName = _this$props2.maskTransitionName, maskMotion = _this$props2.maskMotion, zIndex = _this$props2.zIndex, popup = _this$props2.popup, stretch = _this$props2.stretch, alignPoint2 = _this$props2.alignPoint, mobile = _this$props2.mobile, forceRender = _this$props2.forceRender; + var _this$state = _this.state, popupVisible2 = _this$state.popupVisible, point = _this$state.point; + var align = _this.getPopupAlign(); + var mouseProps = {}; + if (_this.isMouseEnterToShow()) { + mouseProps.onMouseEnter = _this.onPopupMouseEnter; + } + if (_this.isMouseLeaveToHide()) { + mouseProps.onMouseLeave = _this.onPopupMouseLeave; + } + mouseProps.onMouseDown = _this.onPopupMouseDown; + mouseProps.onTouchStart = _this.onPopupMouseDown; + return /* @__PURE__ */ React57.createElement(Popup_default, _extends({ + prefixCls, + destroyPopupOnHide, + visible: popupVisible2, + point: alignPoint2 && point, + className: popupClassName, + align, + onAlign: onPopupAlign, + animation: popupAnimation, + getClassNameFromAlign: _this.getPopupClassNameFromAlign + }, mouseProps, { + stretch, + getRootDomNode: _this.getRootDomNode, + style: popupStyle, + mask, + zIndex, + transitionName: popupTransitionName, + maskAnimation, + maskTransitionName, + maskMotion, + ref: _this.popupRef, + motion: popupMotion, + mobile, + forceRender + }), typeof popup === "function" ? popup() : popup); + }; + _this.attachParent = function(popupContainer) { + wrapperRaf.cancel(_this.attachId); + var _this$props3 = _this.props, getPopupContainer = _this$props3.getPopupContainer, getDocument2 = _this$props3.getDocument; + var domNode = _this.getRootDomNode(); + var mountNode; + if (!getPopupContainer) { + mountNode = getDocument2(_this.getRootDomNode()).body; + } else if (domNode || getPopupContainer.length === 0) { + mountNode = getPopupContainer(domNode); + } + if (mountNode) { + mountNode.appendChild(popupContainer); + } else { + _this.attachId = wrapperRaf(function() { + _this.attachParent(popupContainer); + }); + } + }; + _this.getContainer = function() { + var getDocument2 = _this.props.getDocument; + var popupContainer = getDocument2(_this.getRootDomNode()).createElement("div"); + popupContainer.style.position = "absolute"; + popupContainer.style.top = "0"; + popupContainer.style.left = "0"; + popupContainer.style.width = "100%"; + _this.attachParent(popupContainer); + return popupContainer; + }; + _this.setPoint = function(point) { + var alignPoint2 = _this.props.alignPoint; + if (!alignPoint2 || !point) + return; + _this.setState({ + point: { + pageX: point.pageX, + pageY: point.pageY + } + }); + }; + _this.handlePortalUpdate = function() { + if (_this.state.prevPopupVisible !== _this.state.popupVisible) { + _this.props.afterPopupVisibleChange(_this.state.popupVisible); + } + }; + var popupVisible; + if ("popupVisible" in props) { + popupVisible = !!props.popupVisible; + } else { + popupVisible = !!props.defaultPopupVisible; + } + _this.state = { + prevPopupVisible: popupVisible, + popupVisible + }; + ALL_HANDLERS.forEach(function(h) { + _this["fire".concat(h)] = function(e) { + _this.fireEvents(h, e); + }; + }); + return _this; + } + _createClass(Trigger2, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.componentDidUpdate(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + var props = this.props; + var state = this.state; + if (state.popupVisible) { + var currentDocument; + if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextMenuToShow())) { + currentDocument = props.getDocument(this.getRootDomNode()); + this.clickOutsideHandler = addEventListenerWrap(currentDocument, "mousedown", this.onDocumentClick); + } + if (!this.touchOutsideHandler) { + currentDocument = currentDocument || props.getDocument(this.getRootDomNode()); + this.touchOutsideHandler = addEventListenerWrap(currentDocument, "touchstart", this.onDocumentClick); + } + if (!this.contextMenuOutsideHandler1 && this.isContextMenuToShow()) { + currentDocument = currentDocument || props.getDocument(this.getRootDomNode()); + this.contextMenuOutsideHandler1 = addEventListenerWrap(currentDocument, "scroll", this.onContextMenuClose); + } + if (!this.contextMenuOutsideHandler2 && this.isContextMenuToShow()) { + this.contextMenuOutsideHandler2 = addEventListenerWrap(window, "blur", this.onContextMenuClose); + } + return; + } + this.clearOutsideHandler(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.clearDelayTimer(); + this.clearOutsideHandler(); + clearTimeout(this.mouseDownTimeout); + wrapperRaf.cancel(this.attachId); + } + }, { + key: "getPopupDomNode", + value: function getPopupDomNode() { + var _this$popupRef$curren2; + return ((_this$popupRef$curren2 = this.popupRef.current) === null || _this$popupRef$curren2 === void 0 ? void 0 : _this$popupRef$curren2.getElement()) || null; + } + }, { + key: "getPopupAlign", + value: function getPopupAlign() { + var props = this.props; + var popupPlacement = props.popupPlacement, popupAlign = props.popupAlign, builtinPlacements = props.builtinPlacements; + if (popupPlacement && builtinPlacements) { + return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign); + } + return popupAlign; + } + }, { + key: "setPopupVisible", + value: function setPopupVisible(popupVisible, event) { + var alignPoint2 = this.props.alignPoint; + var prevPopupVisible = this.state.popupVisible; + this.clearDelayTimer(); + if (prevPopupVisible !== popupVisible) { + if (!("popupVisible" in this.props)) { + this.setState({ + popupVisible, + prevPopupVisible + }); + } + this.props.onPopupVisibleChange(popupVisible); + } + if (alignPoint2 && event && popupVisible) { + this.setPoint(event); + } + } + }, { + key: "delaySetPopupVisible", + value: function delaySetPopupVisible(visible, delayS, event) { + var _this2 = this; + var delay = delayS * 1e3; + this.clearDelayTimer(); + if (delay) { + var point = event ? { + pageX: event.pageX, + pageY: event.pageY + } : null; + this.delayTimer = window.setTimeout(function() { + _this2.setPopupVisible(visible, point); + _this2.clearDelayTimer(); + }, delay); + } else { + this.setPopupVisible(visible, event); + } + } + }, { + key: "clearDelayTimer", + value: function clearDelayTimer() { + if (this.delayTimer) { + clearTimeout(this.delayTimer); + this.delayTimer = null; + } + } + }, { + key: "clearOutsideHandler", + value: function clearOutsideHandler() { + if (this.clickOutsideHandler) { + this.clickOutsideHandler.remove(); + this.clickOutsideHandler = null; + } + if (this.contextMenuOutsideHandler1) { + this.contextMenuOutsideHandler1.remove(); + this.contextMenuOutsideHandler1 = null; + } + if (this.contextMenuOutsideHandler2) { + this.contextMenuOutsideHandler2.remove(); + this.contextMenuOutsideHandler2 = null; + } + if (this.touchOutsideHandler) { + this.touchOutsideHandler.remove(); + this.touchOutsideHandler = null; + } + } + }, { + key: "createTwoChains", + value: function createTwoChains(event) { + var childPros = this.props.children.props; + var props = this.props; + if (childPros[event] && props[event]) { + return this["fire".concat(event)]; + } + return childPros[event] || props[event]; + } + }, { + key: "isClickToShow", + value: function isClickToShow() { + var _this$props4 = this.props, action = _this$props4.action, showAction = _this$props4.showAction; + return action.indexOf("click") !== -1 || showAction.indexOf("click") !== -1; + } + }, { + key: "isContextMenuOnly", + value: function isContextMenuOnly() { + var action = this.props.action; + return action === "contextMenu" || action.length === 1 && action[0] === "contextMenu"; + } + }, { + key: "isContextMenuToShow", + value: function isContextMenuToShow() { + var _this$props5 = this.props, action = _this$props5.action, showAction = _this$props5.showAction; + return action.indexOf("contextMenu") !== -1 || showAction.indexOf("contextMenu") !== -1; + } + }, { + key: "isClickToHide", + value: function isClickToHide() { + var _this$props6 = this.props, action = _this$props6.action, hideAction = _this$props6.hideAction; + return action.indexOf("click") !== -1 || hideAction.indexOf("click") !== -1; + } + }, { + key: "isMouseEnterToShow", + value: function isMouseEnterToShow() { + var _this$props7 = this.props, action = _this$props7.action, showAction = _this$props7.showAction; + return action.indexOf("hover") !== -1 || showAction.indexOf("mouseEnter") !== -1; + } + }, { + key: "isMouseLeaveToHide", + value: function isMouseLeaveToHide() { + var _this$props8 = this.props, action = _this$props8.action, hideAction = _this$props8.hideAction; + return action.indexOf("hover") !== -1 || hideAction.indexOf("mouseLeave") !== -1; + } + }, { + key: "isFocusToShow", + value: function isFocusToShow() { + var _this$props9 = this.props, action = _this$props9.action, showAction = _this$props9.showAction; + return action.indexOf("focus") !== -1 || showAction.indexOf("focus") !== -1; + } + }, { + key: "isBlurToHide", + value: function isBlurToHide() { + var _this$props10 = this.props, action = _this$props10.action, hideAction = _this$props10.hideAction; + return action.indexOf("focus") !== -1 || hideAction.indexOf("blur") !== -1; + } + }, { + key: "forcePopupAlign", + value: function forcePopupAlign() { + if (this.state.popupVisible) { + var _this$popupRef$curren3; + (_this$popupRef$curren3 = this.popupRef.current) === null || _this$popupRef$curren3 === void 0 ? void 0 : _this$popupRef$curren3.forceAlign(); + } + } + }, { + key: "fireEvents", + value: function fireEvents(type2, e) { + var childCallback = this.props.children.props[type2]; + if (childCallback) { + childCallback(e); + } + var callback = this.props[type2]; + if (callback) { + callback(e); + } + } + }, { + key: "close", + value: function close2() { + this.setPopupVisible(false); + } + }, { + key: "render", + value: function render() { + var popupVisible = this.state.popupVisible; + var _this$props11 = this.props, children = _this$props11.children, forceRender = _this$props11.forceRender, alignPoint2 = _this$props11.alignPoint, className = _this$props11.className, autoDestroy = _this$props11.autoDestroy; + var child = React57.Children.only(children); + var newChildProps = { + key: "trigger" + }; + if (this.isContextMenuToShow()) { + newChildProps.onContextMenu = this.onContextMenu; + } else { + newChildProps.onContextMenu = this.createTwoChains("onContextMenu"); + } + if (this.isClickToHide() || this.isClickToShow()) { + newChildProps.onClick = this.onClick; + newChildProps.onMouseDown = this.onMouseDown; + newChildProps.onTouchStart = this.onTouchStart; + } else { + newChildProps.onClick = this.createTwoChains("onClick"); + newChildProps.onMouseDown = this.createTwoChains("onMouseDown"); + newChildProps.onTouchStart = this.createTwoChains("onTouchStart"); + } + if (this.isMouseEnterToShow()) { + newChildProps.onMouseEnter = this.onMouseEnter; + if (alignPoint2) { + newChildProps.onMouseMove = this.onMouseMove; + } + } else { + newChildProps.onMouseEnter = this.createTwoChains("onMouseEnter"); + } + if (this.isMouseLeaveToHide()) { + newChildProps.onMouseLeave = this.onMouseLeave; + } else { + newChildProps.onMouseLeave = this.createTwoChains("onMouseLeave"); + } + if (this.isFocusToShow() || this.isBlurToHide()) { + newChildProps.onFocus = this.onFocus; + newChildProps.onBlur = this.onBlur; + } else { + newChildProps.onFocus = this.createTwoChains("onFocus"); + newChildProps.onBlur = this.createTwoChains("onBlur"); + } + var childrenClassName = (0, import_classnames11.default)(child && child.props && child.props.className, className); + if (childrenClassName) { + newChildProps.className = childrenClassName; + } + var cloneProps = _objectSpread2({}, newChildProps); + if (supportRef(child)) { + cloneProps.ref = composeRef(this.triggerRef, child.ref); + } + var trigger = /* @__PURE__ */ React57.cloneElement(child, cloneProps); + var portal; + if (popupVisible || this.popupRef.current || forceRender) { + portal = /* @__PURE__ */ React57.createElement(PortalComponent, { + key: "portal", + getContainer: this.getContainer, + didUpdate: this.handlePortalUpdate + }, this.getComponent()); + } + if (!popupVisible && autoDestroy) { + portal = null; + } + return /* @__PURE__ */ React57.createElement(context_default2.Provider, { + value: { + onPopupMouseDown: this.onPopupMouseDown + } + }, trigger, portal); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(_ref, prevState) { + var popupVisible = _ref.popupVisible; + var newState = {}; + if (popupVisible !== void 0 && prevState.popupVisible !== popupVisible) { + newState.popupVisible = popupVisible; + newState.prevPopupVisible = prevState.popupVisible; + } + return newState; + } + }]); + return Trigger2; + }(React57.Component); + Trigger.contextType = context_default2; + Trigger.defaultProps = { + prefixCls: "rc-trigger-popup", + getPopupClassNameFromAlign: returnEmptyString, + getDocument: returnDocument, + onPopupVisibleChange: noop, + afterPopupVisibleChange: noop, + onPopupAlign: noop, + popupClassName: "", + mouseEnterDelay: 0, + mouseLeaveDelay: 0.1, + focusDelay: 0, + blurDelay: 0.15, + popupStyle: {}, + destroyPopupOnHide: false, + popupAlign: {}, + defaultPopupVisible: false, + mask: false, + maskClosable: true, + action: [], + showAction: [], + hideAction: [], + autoDestroy: false + }; + return Trigger; + } + var es_default4 = generateTrigger(Portal_default); + + // node_modules/antd/es/_util/reactNode.js + var React58 = __toModule(require_react()); + var isValidElement4 = React58.isValidElement; + function replaceElement(element, replacement, props) { + if (!isValidElement4(element)) + return replacement; + return /* @__PURE__ */ React58.cloneElement(element, typeof props === "function" ? props(element.props || {}) : props); + } + function cloneElement5(element, props) { + return replaceElement(element, element, props); + } + + // node_modules/antd/es/_util/type.js + var tuple = function tuple2() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return args; + }; + + // node_modules/antd/es/_util/colors.js + var PresetStatusColorTypes = tuple("success", "processing", "error", "default", "warning"); + var PresetColorTypes = tuple("pink", "red", "yellow", "orange", "cyan", "green", "blue", "purple", "geekblue", "magenta", "volcano", "gold", "lime"); + + // node_modules/antd/es/button/button.js + var React62 = __toModule(require_react()); + var import_classnames13 = __toModule(require_classnames()); + + // node_modules/antd/es/button/button-group.js + var React59 = __toModule(require_react()); + var import_classnames12 = __toModule(require_classnames()); + + // node_modules/antd/es/_util/unreachableException.js + var UnreachableException = function UnreachableException2(value) { + _classCallCheck(this, UnreachableException2); + return new Error("unreachable case: ".concat(JSON.stringify(value))); + }; + + // node_modules/antd/es/button/button-group.js + var __rest2 = function(s, e) { + var t = {}; + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + } + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + var ButtonGroup = function ButtonGroup2(props) { + return /* @__PURE__ */ React59.createElement(ConfigConsumer, null, function(_ref) { + var _classNames; + var getPrefixCls = _ref.getPrefixCls, direction = _ref.direction; + var customizePrefixCls = props.prefixCls, size = props.size, className = props.className, others = __rest2(props, ["prefixCls", "size", "className"]); + var prefixCls = getPrefixCls("btn-group", customizePrefixCls); + var sizeCls = ""; + switch (size) { + case "large": + sizeCls = "lg"; + break; + case "small": + sizeCls = "sm"; + break; + case "middle": + case void 0: + break; + default: + console.warn(new UnreachableException(size)); + } + var classes = (0, import_classnames12.default)(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(sizeCls), sizeCls), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === "rtl"), _classNames), className); + return /* @__PURE__ */ React59.createElement("div", _extends({}, others, { + className: classes + })); + }); + }; + var button_group_default = ButtonGroup; + + // node_modules/antd/es/_util/wave.js + var React60 = __toModule(require_react()); + + // node_modules/antd/es/_util/raf.js + var id = 0; + var ids = {}; + function wrapperRaf2(callback) { + var delayFrames = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1; + var myId = id++; + var restFrames = delayFrames; + function internalCallback() { + restFrames -= 1; + if (restFrames <= 0) { + callback(); + delete ids[myId]; + } else { + ids[myId] = wrapperRaf(internalCallback); + } + } + ids[myId] = wrapperRaf(internalCallback); + return myId; + } + wrapperRaf2.cancel = function cancel(pid) { + if (pid === void 0) + return; + wrapperRaf.cancel(ids[pid]); + delete ids[pid]; + }; + wrapperRaf2.ids = ids; + + // node_modules/antd/es/_util/wave.js + var styleForPseudo; + function isHidden(element) { + if (false) { + return false; + } + return !element || element.offsetParent === null || element.hidden; + } + function isNotGrey(color) { + var match = (color || "").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/); + if (match && match[1] && match[2] && match[3]) { + return !(match[1] === match[2] && match[2] === match[3]); + } + return true; + } + var Wave = /* @__PURE__ */ function(_React$Component) { + _inherits(Wave2, _React$Component); + var _super = _createSuper(Wave2); + function Wave2() { + var _this; + _classCallCheck(this, Wave2); + _this = _super.apply(this, arguments); + _this.containerRef = /* @__PURE__ */ React60.createRef(); + _this.animationStart = false; + _this.destroyed = false; + _this.onClick = function(node, waveColor) { + var _a, _b; + if (!node || isHidden(node) || node.className.indexOf("-leave") >= 0) { + return; + } + var insertExtraNode = _this.props.insertExtraNode; + _this.extraNode = document.createElement("div"); + var _assertThisInitialize = _assertThisInitialized(_this), extraNode = _assertThisInitialize.extraNode; + var getPrefixCls = _this.context.getPrefixCls; + extraNode.className = "".concat(getPrefixCls(""), "-click-animating-node"); + var attributeName = _this.getAttributeName(); + node.setAttribute(attributeName, "true"); + if (waveColor && waveColor !== "#ffffff" && waveColor !== "rgb(255, 255, 255)" && isNotGrey(waveColor) && !/rgba\((?:\d*, ){3}0\)/.test(waveColor) && waveColor !== "transparent") { + extraNode.style.borderColor = waveColor; + var nodeRoot = ((_a = node.getRootNode) === null || _a === void 0 ? void 0 : _a.call(node)) || node.ownerDocument; + var nodeBody = nodeRoot instanceof Document ? nodeRoot.body : (_b = nodeRoot.firstChild) !== null && _b !== void 0 ? _b : nodeRoot; + styleForPseudo = updateCSS("\n [".concat(getPrefixCls(""), "-click-animating-without-extra-node='true']::after, .").concat(getPrefixCls(""), "-click-animating-node {\n --antd-wave-shadow-color: ").concat(waveColor, ";\n }"), "antd-wave", { + csp: _this.csp, + attachTo: nodeBody + }); + } + if (insertExtraNode) { + node.appendChild(extraNode); + } + ["transition", "animation"].forEach(function(name) { + node.addEventListener("".concat(name, "start"), _this.onTransitionStart); + node.addEventListener("".concat(name, "end"), _this.onTransitionEnd); + }); + }; + _this.onTransitionStart = function(e) { + if (_this.destroyed) { + return; + } + var node = _this.containerRef.current; + if (!e || e.target !== node || _this.animationStart) { + return; + } + _this.resetEffect(node); + }; + _this.onTransitionEnd = function(e) { + if (!e || e.animationName !== "fadeEffect") { + return; + } + _this.resetEffect(e.target); + }; + _this.bindAnimationEvent = function(node) { + if (!node || !node.getAttribute || node.getAttribute("disabled") || node.className.indexOf("disabled") >= 0) { + return; + } + var onClick = function onClick2(e) { + if (e.target.tagName === "INPUT" || isHidden(e.target)) { + return; + } + _this.resetEffect(node); + var waveColor = getComputedStyle(node).getPropertyValue("border-top-color") || getComputedStyle(node).getPropertyValue("border-color") || getComputedStyle(node).getPropertyValue("background-color"); + _this.clickWaveTimeoutId = window.setTimeout(function() { + return _this.onClick(node, waveColor); + }, 0); + wrapperRaf2.cancel(_this.animationStartId); + _this.animationStart = true; + _this.animationStartId = wrapperRaf2(function() { + _this.animationStart = false; + }, 10); + }; + node.addEventListener("click", onClick, true); + return { + cancel: function cancel2() { + node.removeEventListener("click", onClick, true); + } + }; + }; + _this.renderWave = function(_ref) { + var csp = _ref.csp; + var children = _this.props.children; + _this.csp = csp; + if (!/* @__PURE__ */ React60.isValidElement(children)) + return children; + var ref = _this.containerRef; + if (supportRef(children)) { + ref = composeRef(children.ref, _this.containerRef); + } + return cloneElement5(children, { + ref + }); + }; + return _this; + } + _createClass(Wave2, [{ + key: "componentDidMount", + value: function componentDidMount() { + var node = this.containerRef.current; + if (!node || node.nodeType !== 1) { + return; + } + this.instance = this.bindAnimationEvent(node); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.instance) { + this.instance.cancel(); + } + if (this.clickWaveTimeoutId) { + clearTimeout(this.clickWaveTimeoutId); + } + this.destroyed = true; + } + }, { + key: "getAttributeName", + value: function getAttributeName() { + var getPrefixCls = this.context.getPrefixCls; + var insertExtraNode = this.props.insertExtraNode; + return insertExtraNode ? "".concat(getPrefixCls(""), "-click-animating") : "".concat(getPrefixCls(""), "-click-animating-without-extra-node"); + } + }, { + key: "resetEffect", + value: function resetEffect(node) { + var _this2 = this; + if (!node || node === this.extraNode || !(node instanceof Element)) { + return; + } + var insertExtraNode = this.props.insertExtraNode; + var attributeName = this.getAttributeName(); + node.setAttribute(attributeName, "false"); + if (styleForPseudo) { + styleForPseudo.innerHTML = ""; + } + if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) { + node.removeChild(this.extraNode); + } + ["transition", "animation"].forEach(function(name) { + node.removeEventListener("".concat(name, "start"), _this2.onTransitionStart); + node.removeEventListener("".concat(name, "end"), _this2.onTransitionEnd); + }); + } + }, { + key: "render", + value: function render() { + return /* @__PURE__ */ React60.createElement(ConfigConsumer, null, this.renderWave); + } + }]); + return Wave2; + }(React60.Component); + Wave.contextType = ConfigContext; + + // node_modules/antd/es/button/LoadingIcon.js + var import_react19 = __toModule(require_react()); + var getCollapsedWidth = function getCollapsedWidth2() { + return { + width: 0, + opacity: 0, + transform: "scale(0)" + }; + }; + var getRealWidth = function getRealWidth2(node) { + return { + width: node.scrollWidth, + opacity: 1, + transform: "scale(1)" + }; + }; + var LoadingIcon = function LoadingIcon2(_ref) { + var prefixCls = _ref.prefixCls, loading = _ref.loading, existIcon = _ref.existIcon; + var visible = !!loading; + if (existIcon) { + return /* @__PURE__ */ import_react19.default.createElement("span", { + className: "".concat(prefixCls, "-loading-icon") + }, /* @__PURE__ */ import_react19.default.createElement(LoadingOutlined_default2, null)); + } + return /* @__PURE__ */ import_react19.default.createElement(es_default, { + visible, + motionName: "".concat(prefixCls, "-loading-icon-motion"), + removeOnLeave: true, + onAppearStart: getCollapsedWidth, + onAppearActive: getRealWidth, + onEnterStart: getCollapsedWidth, + onEnterActive: getRealWidth, + onLeaveStart: getRealWidth, + onLeaveActive: getCollapsedWidth + }, function(_ref2, ref) { + var className = _ref2.className, style2 = _ref2.style; + return /* @__PURE__ */ import_react19.default.createElement("span", { + className: "".concat(prefixCls, "-loading-icon"), + style: style2, + ref + }, /* @__PURE__ */ import_react19.default.createElement(LoadingOutlined_default2, { + className + })); + }); + }; + var LoadingIcon_default = LoadingIcon; + + // node_modules/antd/es/button/button.js + var __rest3 = function(s, e) { + var t = {}; + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + } + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + var rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/; + var isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar); + function isString(str) { + return typeof str === "string"; + } + function isUnborderedButtonType(type2) { + return type2 === "text" || type2 === "link"; + } + function insertSpace(child, needInserted) { + if (child == null) { + return; + } + var SPACE = needInserted ? " " : ""; + if (typeof child !== "string" && typeof child !== "number" && isString(child.type) && isTwoCNChar(child.props.children)) { + return cloneElement5(child, { + children: child.props.children.split("").join(SPACE) + }); + } + if (typeof child === "string") { + if (isTwoCNChar(child)) { + child = child.split("").join(SPACE); + } + return /* @__PURE__ */ React62.createElement("span", null, child); + } + return child; + } + function spaceChildren(children, needInserted) { + var isPrevChildPure = false; + var childList = []; + React62.Children.forEach(children, function(child) { + var type2 = _typeof(child); + var isCurrentChildPure = type2 === "string" || type2 === "number"; + if (isPrevChildPure && isCurrentChildPure) { + var lastIndex = childList.length - 1; + var lastChild = childList[lastIndex]; + childList[lastIndex] = "".concat(lastChild).concat(child); + } else { + childList.push(child); + } + isPrevChildPure = isCurrentChildPure; + }); + return React62.Children.map(childList, function(child) { + return insertSpace(child, needInserted); + }); + } + var ButtonTypes = tuple("default", "primary", "ghost", "dashed", "link", "text"); + var ButtonShapes = tuple("circle", "round"); + var ButtonHTMLTypes = tuple("submit", "button", "reset"); + var InternalButton = function InternalButton2(props, ref) { + var _classNames; + var _props$loading = props.loading, loading = _props$loading === void 0 ? false : _props$loading, customizePrefixCls = props.prefixCls, type2 = props.type, danger = props.danger, shape = props.shape, customizeSize = props.size, className = props.className, children = props.children, icon = props.icon, _props$ghost = props.ghost, ghost = _props$ghost === void 0 ? false : _props$ghost, _props$block = props.block, block = _props$block === void 0 ? false : _props$block, _props$htmlType = props.htmlType, htmlType = _props$htmlType === void 0 ? "button" : _props$htmlType, rest = __rest3(props, ["loading", "prefixCls", "type", "danger", "shape", "size", "className", "children", "icon", "ghost", "block", "htmlType"]); + var size = React62.useContext(SizeContext_default); + var _React$useState = React62.useState(!!loading), _React$useState2 = _slicedToArray(_React$useState, 2), innerLoading = _React$useState2[0], setLoading = _React$useState2[1]; + var _React$useState3 = React62.useState(false), _React$useState4 = _slicedToArray(_React$useState3, 2), hasTwoCNChar = _React$useState4[0], setHasTwoCNChar = _React$useState4[1]; + var _React$useContext = React62.useContext(ConfigContext), getPrefixCls = _React$useContext.getPrefixCls, autoInsertSpaceInButton = _React$useContext.autoInsertSpaceInButton, direction = _React$useContext.direction; + var buttonRef = ref || /* @__PURE__ */ React62.createRef(); + var delayTimeoutRef = React62.useRef(); + var isNeedInserted = function isNeedInserted2() { + return React62.Children.count(children) === 1 && !icon && !isUnborderedButtonType(type2); + }; + var fixTwoCNChar = function fixTwoCNChar2() { + if (!buttonRef || !buttonRef.current || autoInsertSpaceInButton === false) { + return; + } + var buttonText = buttonRef.current.textContent; + if (isNeedInserted() && isTwoCNChar(buttonText)) { + if (!hasTwoCNChar) { + setHasTwoCNChar(true); + } + } else if (hasTwoCNChar) { + setHasTwoCNChar(false); + } + }; + var loadingOrDelay; + if (_typeof(loading) === "object" && loading.delay) { + loadingOrDelay = loading.delay || true; + } else { + loadingOrDelay = !!loading; + } + React62.useEffect(function() { + clearTimeout(delayTimeoutRef.current); + if (typeof loadingOrDelay === "number") { + delayTimeoutRef.current = window.setTimeout(function() { + setLoading(loadingOrDelay); + }, loadingOrDelay); + } else { + setLoading(loadingOrDelay); + } + }, [loadingOrDelay]); + React62.useEffect(fixTwoCNChar, [buttonRef]); + var handleClick = function handleClick2(e) { + var _a; + var onClick = props.onClick, disabled = props.disabled; + if (innerLoading || disabled) { + e.preventDefault(); + return; + } + (_a = onClick) === null || _a === void 0 ? void 0 : _a(e); + }; + devWarning_default(!(typeof icon === "string" && icon.length > 2), "Button", "`icon` is using ReactNode instead of string naming in v4. Please check `".concat(icon, "` at https://ant.design/components/icon")); + devWarning_default(!(ghost && isUnborderedButtonType(type2)), "Button", "`link` or `text` button can't be a `ghost` button."); + var prefixCls = getPrefixCls("btn", customizePrefixCls); + var autoInsertSpace = autoInsertSpaceInButton !== false; + var sizeCls = ""; + switch (customizeSize || size) { + case "large": + sizeCls = "lg"; + break; + case "small": + sizeCls = "sm"; + break; + default: + break; + } + var iconType = innerLoading ? "loading" : icon; + var classes = (0, import_classnames13.default)(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(type2), type2), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(shape), shape), _defineProperty(_classNames, "".concat(prefixCls, "-").concat(sizeCls), sizeCls), _defineProperty(_classNames, "".concat(prefixCls, "-icon-only"), !children && children !== 0 && !!iconType), _defineProperty(_classNames, "".concat(prefixCls, "-background-ghost"), ghost && !isUnborderedButtonType(type2)), _defineProperty(_classNames, "".concat(prefixCls, "-loading"), innerLoading), _defineProperty(_classNames, "".concat(prefixCls, "-two-chinese-chars"), hasTwoCNChar && autoInsertSpace), _defineProperty(_classNames, "".concat(prefixCls, "-block"), block), _defineProperty(_classNames, "".concat(prefixCls, "-dangerous"), !!danger), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === "rtl"), _classNames), className); + var iconNode = icon && !innerLoading ? icon : /* @__PURE__ */ React62.createElement(LoadingIcon_default, { + existIcon: !!icon, + prefixCls, + loading: !!innerLoading + }); + var kids = children || children === 0 ? spaceChildren(children, isNeedInserted() && autoInsertSpace) : null; + var linkButtonRestProps = omit(rest, ["navigate"]); + if (linkButtonRestProps.href !== void 0) { + return /* @__PURE__ */ React62.createElement("a", _extends({}, linkButtonRestProps, { + className: classes, + onClick: handleClick, + ref: buttonRef + }), iconNode, kids); + } + var buttonNode = /* @__PURE__ */ React62.createElement("button", _extends({}, rest, { + type: htmlType, + className: classes, + onClick: handleClick, + ref: buttonRef + }), iconNode, kids); + if (isUnborderedButtonType(type2)) { + return buttonNode; + } + return /* @__PURE__ */ React62.createElement(Wave, null, buttonNode); + }; + var Button2 = /* @__PURE__ */ React62.forwardRef(InternalButton); + Button2.displayName = "Button"; + Button2.Group = button_group_default; + Button2.__ANT_BUTTON = true; + var button_default = Button2; + + // node_modules/antd/es/button/index.js + var button_default2 = button_default; + + // node_modules/@ant-design/icons/es/icons/CalendarOutlined.js + var React63 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/CalendarOutlined.js + var CalendarOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" } }] }, "name": "calendar", "theme": "outlined" }; + var CalendarOutlined_default = CalendarOutlined; + + // node_modules/@ant-design/icons/es/icons/CalendarOutlined.js + var CalendarOutlined2 = function CalendarOutlined3(props, ref) { + return /* @__PURE__ */ React63.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: CalendarOutlined_default + })); + }; + CalendarOutlined2.displayName = "CalendarOutlined"; + var CalendarOutlined_default2 = /* @__PURE__ */ React63.forwardRef(CalendarOutlined2); + + // node_modules/@ant-design/icons/es/icons/ClockCircleOutlined.js + var React64 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/ClockCircleOutlined.js + var ClockCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z" } }] }, "name": "clock-circle", "theme": "outlined" }; + var ClockCircleOutlined_default = ClockCircleOutlined; + + // node_modules/@ant-design/icons/es/icons/ClockCircleOutlined.js + var ClockCircleOutlined2 = function ClockCircleOutlined3(props, ref) { + return /* @__PURE__ */ React64.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: ClockCircleOutlined_default + })); + }; + ClockCircleOutlined2.displayName = "ClockCircleOutlined"; + var ClockCircleOutlined_default2 = /* @__PURE__ */ React64.forwardRef(ClockCircleOutlined2); + + // node_modules/@ant-design/icons/es/icons/SwapRightOutlined.js + var React65 = __toModule(require_react()); + + // node_modules/@ant-design/icons-svg/es/asn/SwapRightOutlined.js + var SwapRightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z" } }] }, "name": "swap-right", "theme": "outlined" }; + var SwapRightOutlined_default = SwapRightOutlined; + + // node_modules/@ant-design/icons/es/icons/SwapRightOutlined.js + var SwapRightOutlined2 = function SwapRightOutlined3(props, ref) { + return /* @__PURE__ */ React65.createElement(AntdIcon_default, Object.assign({}, props, { + ref, + icon: SwapRightOutlined_default + })); + }; + SwapRightOutlined2.displayName = "SwapRightOutlined"; + var SwapRightOutlined_default2 = /* @__PURE__ */ React65.forwardRef(SwapRightOutlined2); + + // node_modules/rc-picker/es/generate/moment.js + var import_moment = __toModule(require_moment()); + var generateConfig = { + getNow: function getNow() { + return (0, import_moment.default)(); + }, + getFixedDate: function getFixedDate(string2) { + return (0, import_moment.default)(string2, "YYYY-MM-DD"); + }, + getEndDate: function getEndDate(date3) { + var clone2 = date3.clone(); + return clone2.endOf("month"); + }, + getWeekDay: function getWeekDay(date3) { + var clone2 = date3.clone().locale("en_US"); + return clone2.weekday() + clone2.localeData().firstDayOfWeek(); + }, + getYear: function getYear(date3) { + return date3.year(); + }, + getMonth: function getMonth(date3) { + return date3.month(); + }, + getDate: function getDate(date3) { + return date3.date(); + }, + getHour: function getHour(date3) { + return date3.hour(); + }, + getMinute: function getMinute(date3) { + return date3.minute(); + }, + getSecond: function getSecond(date3) { + return date3.second(); + }, + addYear: function addYear(date3, diff) { + var clone2 = date3.clone(); + return clone2.add(diff, "year"); + }, + addMonth: function addMonth(date3, diff) { + var clone2 = date3.clone(); + return clone2.add(diff, "month"); + }, + addDate: function addDate(date3, diff) { + var clone2 = date3.clone(); + return clone2.add(diff, "day"); + }, + setYear: function setYear(date3, year) { + var clone2 = date3.clone(); + return clone2.year(year); + }, + setMonth: function setMonth(date3, month) { + var clone2 = date3.clone(); + return clone2.month(month); + }, + setDate: function setDate(date3, num) { + var clone2 = date3.clone(); + return clone2.date(num); + }, + setHour: function setHour(date3, hour) { + var clone2 = date3.clone(); + return clone2.hour(hour); + }, + setMinute: function setMinute(date3, minute) { + var clone2 = date3.clone(); + return clone2.minute(minute); + }, + setSecond: function setSecond(date3, second) { + var clone2 = date3.clone(); + return clone2.second(second); + }, + isAfter: function isAfter(date1, date22) { + return date1.isAfter(date22); + }, + isValidate: function isValidate(date3) { + return date3.isValid(); + }, + locale: { + getWeekFirstDay: function getWeekFirstDay(locale4) { + var date3 = (0, import_moment.default)().locale(locale4); + return date3.localeData().firstDayOfWeek(); + }, + getWeekFirstDate: function getWeekFirstDate(locale4, date3) { + var clone2 = date3.clone(); + var result = clone2.locale(locale4); + return result.weekday(0); + }, + getWeek: function getWeek(locale4, date3) { + var clone2 = date3.clone(); + var result = clone2.locale(locale4); + return result.week(); + }, + getShortWeekDays: function getShortWeekDays(locale4) { + var date3 = (0, import_moment.default)().locale(locale4); + return date3.localeData().weekdaysMin(); + }, + getShortMonths: function getShortMonths(locale4) { + var date3 = (0, import_moment.default)().locale(locale4); + return date3.localeData().monthsShort(); + }, + format: function format2(locale4, date3, _format) { + var clone2 = date3.clone(); + var result = clone2.locale(locale4); + return result.format(_format); + }, + parse: function parse(locale4, text, formats) { + var fallbackFormatList = []; + for (var i = 0; i < formats.length; i += 1) { + var format3 = formats[i]; + var formatText = text; + if (format3.includes("wo") || format3.includes("Wo")) { + format3 = format3.replace(/wo/g, "w").replace(/Wo/g, "W"); + var matchFormat = format3.match(/[-YyMmDdHhSsWwGg]+/g); + var matchText = formatText.match(/[-\d]+/g); + if (matchFormat && matchText) { + format3 = matchFormat.join(""); + formatText = matchText.join(""); + } else { + fallbackFormatList.push(format3.replace(/o/g, "")); + } + } + var date3 = (0, import_moment.default)(formatText, format3, locale4, true); + if (date3.isValid()) { + return date3; + } + } + for (var _i = 0; _i < fallbackFormatList.length; _i += 1) { + var _date = (0, import_moment.default)(text, fallbackFormatList[_i], locale4, false); + if (_date.isValid()) { + noteOnce(false, "Not match any format strictly and fallback to fuzzy match. Please help to fire a issue about this."); + return _date; + } + } + return null; + } + } + }; + var moment_default = generateConfig; + + // node_modules/rc-picker/es/Picker.js + var React96 = __toModule(require_react()); + var import_classnames22 = __toModule(require_classnames()); + + // node_modules/rc-picker/es/PickerPanel.js + var React93 = __toModule(require_react()); + var import_classnames20 = __toModule(require_classnames()); + + // node_modules/rc-picker/es/panels/TimePanel/index.js + var React75 = __toModule(require_react()); + var import_classnames16 = __toModule(require_classnames()); + + // node_modules/rc-picker/es/panels/TimePanel/TimeHeader.js + var React72 = __toModule(require_react()); + + // node_modules/rc-picker/es/panels/Header.js + var React67 = __toModule(require_react()); + + // node_modules/rc-picker/es/PanelContext.js + var React66 = __toModule(require_react()); + var PanelContext = /* @__PURE__ */ React66.createContext({}); + var PanelContext_default = PanelContext; + + // node_modules/rc-picker/es/panels/Header.js + var HIDDEN_STYLE = { + visibility: "hidden" + }; + function Header(_ref) { + var prefixCls = _ref.prefixCls, _ref$prevIcon = _ref.prevIcon, prevIcon = _ref$prevIcon === void 0 ? "\u2039" : _ref$prevIcon, _ref$nextIcon = _ref.nextIcon, nextIcon = _ref$nextIcon === void 0 ? "\u203A" : _ref$nextIcon, _ref$superPrevIcon = _ref.superPrevIcon, superPrevIcon = _ref$superPrevIcon === void 0 ? "\xAB" : _ref$superPrevIcon, _ref$superNextIcon = _ref.superNextIcon, superNextIcon = _ref$superNextIcon === void 0 ? "\xBB" : _ref$superNextIcon, onSuperPrev = _ref.onSuperPrev, onSuperNext = _ref.onSuperNext, onPrev = _ref.onPrev, onNext = _ref.onNext, children = _ref.children; + var _React$useContext = React67.useContext(PanelContext_default), hideNextBtn = _React$useContext.hideNextBtn, hidePrevBtn = _React$useContext.hidePrevBtn; + return /* @__PURE__ */ React67.createElement("div", { + className: prefixCls + }, onSuperPrev && /* @__PURE__ */ React67.createElement("button", { + type: "button", + onClick: onSuperPrev, + tabIndex: -1, + className: "".concat(prefixCls, "-super-prev-btn"), + style: hidePrevBtn ? HIDDEN_STYLE : {} + }, superPrevIcon), onPrev && /* @__PURE__ */ React67.createElement("button", { + type: "button", + onClick: onPrev, + tabIndex: -1, + className: "".concat(prefixCls, "-prev-btn"), + style: hidePrevBtn ? HIDDEN_STYLE : {} + }, prevIcon), /* @__PURE__ */ React67.createElement("div", { + className: "".concat(prefixCls, "-view") + }, children), onNext && /* @__PURE__ */ React67.createElement("button", { + type: "button", + onClick: onNext, + tabIndex: -1, + className: "".concat(prefixCls, "-next-btn"), + style: hideNextBtn ? HIDDEN_STYLE : {} + }, nextIcon), onSuperNext && /* @__PURE__ */ React67.createElement("button", { + type: "button", + onClick: onSuperNext, + tabIndex: -1, + className: "".concat(prefixCls, "-super-next-btn"), + style: hideNextBtn ? HIDDEN_STYLE : {} + }, superNextIcon)); + } + var Header_default = Header; + + // node_modules/rc-picker/es/panels/DecadePanel/index.js + var React71 = __toModule(require_react()); + + // node_modules/rc-picker/es/panels/DecadePanel/DecadeHeader.js + var React68 = __toModule(require_react()); + function DecadeHeader(props) { + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, viewDate = props.viewDate, onPrevDecades = props.onPrevDecades, onNextDecades = props.onNextDecades; + var _React$useContext = React68.useContext(PanelContext_default), hideHeader = _React$useContext.hideHeader; + if (hideHeader) { + return null; + } + var headerPrefixCls = "".concat(prefixCls, "-header"); + var yearNumber = generateConfig2.getYear(viewDate); + var startYear = Math.floor(yearNumber / DECADE_DISTANCE_COUNT) * DECADE_DISTANCE_COUNT; + var endYear = startYear + DECADE_DISTANCE_COUNT - 1; + return /* @__PURE__ */ React68.createElement(Header_default, _extends({}, props, { + prefixCls: headerPrefixCls, + onSuperPrev: onPrevDecades, + onSuperNext: onNextDecades + }), startYear, "-", endYear); + } + var DecadeHeader_default = DecadeHeader; + + // node_modules/rc-picker/es/panels/DecadePanel/DecadeBody.js + var React70 = __toModule(require_react()); + + // node_modules/rc-picker/es/panels/PanelBody.js + var React69 = __toModule(require_react()); + var import_classnames14 = __toModule(require_classnames()); + + // node_modules/rc-picker/es/utils/timeUtil.js + function setTime(generateConfig2, date3, hour, minute, second) { + var nextTime = generateConfig2.setHour(date3, hour); + nextTime = generateConfig2.setMinute(nextTime, minute); + nextTime = generateConfig2.setSecond(nextTime, second); + return nextTime; + } + function setDateTime(generateConfig2, date3, defaultDate) { + if (!defaultDate) { + return date3; + } + var newDate = date3; + newDate = generateConfig2.setHour(newDate, generateConfig2.getHour(defaultDate)); + newDate = generateConfig2.setMinute(newDate, generateConfig2.getMinute(defaultDate)); + newDate = generateConfig2.setSecond(newDate, generateConfig2.getSecond(defaultDate)); + return newDate; + } + function getLowerBoundTime(hour, minute, second, hourStep, minuteStep, secondStep) { + var lowerBoundHour = Math.floor(hour / hourStep) * hourStep; + if (lowerBoundHour < hour) { + return [lowerBoundHour, 60 - minuteStep, 60 - secondStep]; + } + var lowerBoundMinute = Math.floor(minute / minuteStep) * minuteStep; + if (lowerBoundMinute < minute) { + return [lowerBoundHour, lowerBoundMinute, 60 - secondStep]; + } + var lowerBoundSecond = Math.floor(second / secondStep) * secondStep; + return [lowerBoundHour, lowerBoundMinute, lowerBoundSecond]; + } + function getLastDay(generateConfig2, date3) { + var year = generateConfig2.getYear(date3); + var month = generateConfig2.getMonth(date3) + 1; + var endDate = generateConfig2.getEndDate(generateConfig2.getFixedDate("".concat(year, "-").concat(month, "-01"))); + var lastDay = generateConfig2.getDate(endDate); + var monthShow = month < 10 ? "0".concat(month) : "".concat(month); + return "".concat(year, "-").concat(monthShow, "-").concat(lastDay); + } + + // node_modules/rc-picker/es/panels/PanelBody.js + function PanelBody(_ref) { + var prefixCls = _ref.prefixCls, disabledDate = _ref.disabledDate, onSelect = _ref.onSelect, picker = _ref.picker, rowNum = _ref.rowNum, colNum = _ref.colNum, prefixColumn = _ref.prefixColumn, rowClassName = _ref.rowClassName, baseDate = _ref.baseDate, getCellClassName = _ref.getCellClassName, getCellText = _ref.getCellText, getCellNode = _ref.getCellNode, getCellDate = _ref.getCellDate, generateConfig2 = _ref.generateConfig, titleCell = _ref.titleCell, headerCells = _ref.headerCells; + var _React$useContext = React69.useContext(PanelContext_default), onDateMouseEnter = _React$useContext.onDateMouseEnter, onDateMouseLeave = _React$useContext.onDateMouseLeave, mode = _React$useContext.mode; + var cellPrefixCls = "".concat(prefixCls, "-cell"); + var rows = []; + for (var i = 0; i < rowNum; i += 1) { + var row = []; + var rowStartDate = void 0; + var _loop = function _loop2(j2) { + var _objectSpread23; + var offset2 = i * colNum + j2; + var currentDate = getCellDate(baseDate, offset2); + var disabled = getCellDateDisabled({ + cellDate: currentDate, + mode, + disabledDate, + generateConfig: generateConfig2 + }); + if (j2 === 0) { + rowStartDate = currentDate; + if (prefixColumn) { + row.push(prefixColumn(rowStartDate)); + } + } + var title = titleCell && titleCell(currentDate); + row.push(/* @__PURE__ */ React69.createElement("td", { + key: j2, + title, + className: (0, import_classnames14.default)(cellPrefixCls, _objectSpread2((_objectSpread23 = {}, _defineProperty(_objectSpread23, "".concat(cellPrefixCls, "-disabled"), disabled), _defineProperty(_objectSpread23, "".concat(cellPrefixCls, "-start"), getCellText(currentDate) === 1 || picker === "year" && Number(title) % 10 === 0), _defineProperty(_objectSpread23, "".concat(cellPrefixCls, "-end"), title === getLastDay(generateConfig2, currentDate) || picker === "year" && Number(title) % 10 === 9), _objectSpread23), getCellClassName(currentDate))), + onClick: function onClick() { + if (!disabled) { + onSelect(currentDate); + } + }, + onMouseEnter: function onMouseEnter() { + if (!disabled && onDateMouseEnter) { + onDateMouseEnter(currentDate); + } + }, + onMouseLeave: function onMouseLeave() { + if (!disabled && onDateMouseLeave) { + onDateMouseLeave(currentDate); + } + } + }, getCellNode ? getCellNode(currentDate) : /* @__PURE__ */ React69.createElement("div", { + className: "".concat(cellPrefixCls, "-inner") + }, getCellText(currentDate)))); + }; + for (var j = 0; j < colNum; j += 1) { + _loop(j); + } + rows.push(/* @__PURE__ */ React69.createElement("tr", { + key: i, + className: rowClassName && rowClassName(rowStartDate) + }, row)); + } + return /* @__PURE__ */ React69.createElement("div", { + className: "".concat(prefixCls, "-body") + }, /* @__PURE__ */ React69.createElement("table", { + className: "".concat(prefixCls, "-content") + }, headerCells && /* @__PURE__ */ React69.createElement("thead", null, /* @__PURE__ */ React69.createElement("tr", null, headerCells)), /* @__PURE__ */ React69.createElement("tbody", null, rows))); + } + + // node_modules/rc-picker/es/panels/DecadePanel/DecadeBody.js + var DECADE_COL_COUNT = 3; + var DECADE_ROW_COUNT = 4; + function DecadeBody(props) { + var DECADE_UNIT_DIFF_DES = DECADE_UNIT_DIFF - 1; + var prefixCls = props.prefixCls, viewDate = props.viewDate, generateConfig2 = props.generateConfig; + var cellPrefixCls = "".concat(prefixCls, "-cell"); + var yearNumber = generateConfig2.getYear(viewDate); + var decadeYearNumber = Math.floor(yearNumber / DECADE_UNIT_DIFF) * DECADE_UNIT_DIFF; + var startDecadeYear = Math.floor(yearNumber / DECADE_DISTANCE_COUNT) * DECADE_DISTANCE_COUNT; + var endDecadeYear = startDecadeYear + DECADE_DISTANCE_COUNT - 1; + var baseDecadeYear = generateConfig2.setYear(viewDate, startDecadeYear - Math.ceil((DECADE_COL_COUNT * DECADE_ROW_COUNT * DECADE_UNIT_DIFF - DECADE_DISTANCE_COUNT) / 2)); + var getCellClassName = function getCellClassName2(date3) { + var _ref; + var startDecadeNumber = generateConfig2.getYear(date3); + var endDecadeNumber = startDecadeNumber + DECADE_UNIT_DIFF_DES; + return _ref = {}, _defineProperty(_ref, "".concat(cellPrefixCls, "-in-view"), startDecadeYear <= startDecadeNumber && endDecadeNumber <= endDecadeYear), _defineProperty(_ref, "".concat(cellPrefixCls, "-selected"), startDecadeNumber === decadeYearNumber), _ref; + }; + return /* @__PURE__ */ React70.createElement(PanelBody, _extends({}, props, { + rowNum: DECADE_ROW_COUNT, + colNum: DECADE_COL_COUNT, + baseDate: baseDecadeYear, + getCellText: function getCellText(date3) { + var startDecadeNumber = generateConfig2.getYear(date3); + return "".concat(startDecadeNumber, "-").concat(startDecadeNumber + DECADE_UNIT_DIFF_DES); + }, + getCellClassName, + getCellDate: function getCellDate(date3, offset2) { + return generateConfig2.addYear(date3, offset2 * DECADE_UNIT_DIFF); + } + })); + } + var DecadeBody_default = DecadeBody; + + // node_modules/rc-picker/es/utils/uiUtil.js + var scrollIds = new Map(); + function waitElementReady(element, callback) { + var id2; + function tryOrNextFrame() { + if (isVisible_default(element)) { + callback(); + } else { + id2 = wrapperRaf(function() { + tryOrNextFrame(); + }); + } + } + tryOrNextFrame(); + return function() { + wrapperRaf.cancel(id2); + }; + } + function scrollTo(element, to, duration) { + if (scrollIds.get(element)) { + cancelAnimationFrame(scrollIds.get(element)); + } + if (duration <= 0) { + scrollIds.set(element, requestAnimationFrame(function() { + element.scrollTop = to; + })); + return; + } + var difference = to - element.scrollTop; + var perTick = difference / duration * 10; + scrollIds.set(element, requestAnimationFrame(function() { + element.scrollTop += perTick; + if (element.scrollTop !== to) { + scrollTo(element, to, duration - 10); + } + })); + } + function createKeyDownHandler(event, _ref) { + var onLeftRight = _ref.onLeftRight, onCtrlLeftRight = _ref.onCtrlLeftRight, onUpDown = _ref.onUpDown, onPageUpDown = _ref.onPageUpDown, onEnter = _ref.onEnter; + var which = event.which, ctrlKey = event.ctrlKey, metaKey = event.metaKey; + switch (which) { + case KeyCode_default.LEFT: + if (ctrlKey || metaKey) { + if (onCtrlLeftRight) { + onCtrlLeftRight(-1); + return true; + } + } else if (onLeftRight) { + onLeftRight(-1); + return true; + } + break; + case KeyCode_default.RIGHT: + if (ctrlKey || metaKey) { + if (onCtrlLeftRight) { + onCtrlLeftRight(1); + return true; + } + } else if (onLeftRight) { + onLeftRight(1); + return true; + } + break; + case KeyCode_default.UP: + if (onUpDown) { + onUpDown(-1); + return true; + } + break; + case KeyCode_default.DOWN: + if (onUpDown) { + onUpDown(1); + return true; + } + break; + case KeyCode_default.PAGE_UP: + if (onPageUpDown) { + onPageUpDown(-1); + return true; + } + break; + case KeyCode_default.PAGE_DOWN: + if (onPageUpDown) { + onPageUpDown(1); + return true; + } + break; + case KeyCode_default.ENTER: + if (onEnter) { + onEnter(); + return true; + } + break; + } + return false; + } + function getDefaultFormat(format3, picker, showTime, use12Hours) { + var mergedFormat = format3; + if (!mergedFormat) { + switch (picker) { + case "time": + mergedFormat = use12Hours ? "hh:mm:ss a" : "HH:mm:ss"; + break; + case "week": + mergedFormat = "gggg-wo"; + break; + case "month": + mergedFormat = "YYYY-MM"; + break; + case "quarter": + mergedFormat = "YYYY-[Q]Q"; + break; + case "year": + mergedFormat = "YYYY"; + break; + default: + mergedFormat = showTime ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD"; + } + } + return mergedFormat; + } + function getInputSize(picker, format3, generateConfig2) { + var defaultSize = picker === "time" ? 8 : 10; + var length = typeof format3 === "function" ? format3(generateConfig2.getNow()).length : format3.length; + return Math.max(defaultSize, length) + 2; + } + var globalClickFunc = null; + var clickCallbacks = new Set(); + function addGlobalMouseDownEvent(callback) { + if (!globalClickFunc && typeof window !== "undefined" && window.addEventListener) { + globalClickFunc = function globalClickFunc2(e) { + _toConsumableArray(clickCallbacks).forEach(function(queueFunc) { + queueFunc(e); + }); + }; + window.addEventListener("mousedown", globalClickFunc); + } + clickCallbacks.add(callback); + return function() { + clickCallbacks.delete(callback); + if (clickCallbacks.size === 0) { + window.removeEventListener("mousedown", globalClickFunc); + globalClickFunc = null; + } + }; + } + function getTargetFromEvent(e) { + var target = e.target; + if (e.composed && target.shadowRoot) { + var _e$composedPath; + return ((_e$composedPath = e.composedPath) === null || _e$composedPath === void 0 ? void 0 : _e$composedPath.call(e)[0]) || target; + } + return target; + } + var getYearNextMode = function getYearNextMode2(next) { + if (next === "month" || next === "date") { + return "year"; + } + return next; + }; + var getMonthNextMode = function getMonthNextMode2(next) { + if (next === "date") { + return "month"; + } + return next; + }; + var getQuarterNextMode = function getQuarterNextMode2(next) { + if (next === "month" || next === "date") { + return "quarter"; + } + return next; + }; + var getWeekNextMode = function getWeekNextMode2(next) { + if (next === "date") { + return "week"; + } + return next; + }; + var PickerModeMap = { + year: getYearNextMode, + month: getMonthNextMode, + quarter: getQuarterNextMode, + week: getWeekNextMode, + time: null, + date: null + }; + function elementsContains(elements, target) { + return elements.some(function(ele) { + return ele && ele.contains(target); + }); + } + + // node_modules/rc-picker/es/panels/DecadePanel/index.js + var DECADE_UNIT_DIFF = 10; + var DECADE_DISTANCE_COUNT = DECADE_UNIT_DIFF * 10; + function DecadePanel(props) { + var prefixCls = props.prefixCls, onViewDateChange = props.onViewDateChange, generateConfig2 = props.generateConfig, viewDate = props.viewDate, operationRef = props.operationRef, onSelect = props.onSelect, onPanelChange = props.onPanelChange; + var panelPrefixCls = "".concat(prefixCls, "-decade-panel"); + operationRef.current = { + onKeyDown: function onKeyDown(event) { + return createKeyDownHandler(event, { + onLeftRight: function onLeftRight(diff) { + onSelect(generateConfig2.addYear(viewDate, diff * DECADE_UNIT_DIFF), "key"); + }, + onCtrlLeftRight: function onCtrlLeftRight(diff) { + onSelect(generateConfig2.addYear(viewDate, diff * DECADE_DISTANCE_COUNT), "key"); + }, + onUpDown: function onUpDown(diff) { + onSelect(generateConfig2.addYear(viewDate, diff * DECADE_UNIT_DIFF * DECADE_COL_COUNT), "key"); + }, + onEnter: function onEnter() { + onPanelChange("year", viewDate); + } + }); + } + }; + var onDecadesChange = function onDecadesChange2(diff) { + var newDate = generateConfig2.addYear(viewDate, diff * DECADE_DISTANCE_COUNT); + onViewDateChange(newDate); + onPanelChange(null, newDate); + }; + var onInternalSelect = function onInternalSelect2(date3) { + onSelect(date3, "mouse"); + onPanelChange("year", date3); + }; + return /* @__PURE__ */ React71.createElement("div", { + className: panelPrefixCls + }, /* @__PURE__ */ React71.createElement(DecadeHeader_default, _extends({}, props, { + prefixCls, + onPrevDecades: function onPrevDecades() { + onDecadesChange(-1); + }, + onNextDecades: function onNextDecades() { + onDecadesChange(1); + } + })), /* @__PURE__ */ React71.createElement(DecadeBody_default, _extends({}, props, { + prefixCls, + onSelect: onInternalSelect + }))); + } + var DecadePanel_default = DecadePanel; + + // node_modules/rc-picker/es/utils/dateUtil.js + var WEEK_DAY_COUNT = 7; + function isNullEqual(value1, value2) { + if (!value1 && !value2) { + return true; + } + if (!value1 || !value2) { + return false; + } + return void 0; + } + function isSameDecade(generateConfig2, decade1, decade2) { + var equal = isNullEqual(decade1, decade2); + if (typeof equal === "boolean") { + return equal; + } + var num1 = Math.floor(generateConfig2.getYear(decade1) / 10); + var num2 = Math.floor(generateConfig2.getYear(decade2) / 10); + return num1 === num2; + } + function isSameYear(generateConfig2, year1, year2) { + var equal = isNullEqual(year1, year2); + if (typeof equal === "boolean") { + return equal; + } + return generateConfig2.getYear(year1) === generateConfig2.getYear(year2); + } + function getQuarter(generateConfig2, date3) { + var quota = Math.floor(generateConfig2.getMonth(date3) / 3); + return quota + 1; + } + function isSameQuarter(generateConfig2, quarter1, quarter2) { + var equal = isNullEqual(quarter1, quarter2); + if (typeof equal === "boolean") { + return equal; + } + return isSameYear(generateConfig2, quarter1, quarter2) && getQuarter(generateConfig2, quarter1) === getQuarter(generateConfig2, quarter2); + } + function isSameMonth(generateConfig2, month1, month2) { + var equal = isNullEqual(month1, month2); + if (typeof equal === "boolean") { + return equal; + } + return isSameYear(generateConfig2, month1, month2) && generateConfig2.getMonth(month1) === generateConfig2.getMonth(month2); + } + function isSameDate(generateConfig2, date1, date22) { + var equal = isNullEqual(date1, date22); + if (typeof equal === "boolean") { + return equal; + } + return generateConfig2.getYear(date1) === generateConfig2.getYear(date22) && generateConfig2.getMonth(date1) === generateConfig2.getMonth(date22) && generateConfig2.getDate(date1) === generateConfig2.getDate(date22); + } + function isSameTime(generateConfig2, time1, time2) { + var equal = isNullEqual(time1, time2); + if (typeof equal === "boolean") { + return equal; + } + return generateConfig2.getHour(time1) === generateConfig2.getHour(time2) && generateConfig2.getMinute(time1) === generateConfig2.getMinute(time2) && generateConfig2.getSecond(time1) === generateConfig2.getSecond(time2); + } + function isSameWeek(generateConfig2, locale4, date1, date22) { + var equal = isNullEqual(date1, date22); + if (typeof equal === "boolean") { + return equal; + } + return generateConfig2.locale.getWeek(locale4, date1) === generateConfig2.locale.getWeek(locale4, date22); + } + function isEqual(generateConfig2, value1, value2) { + return isSameDate(generateConfig2, value1, value2) && isSameTime(generateConfig2, value1, value2); + } + function isInRange(generateConfig2, startDate, endDate, current) { + if (!startDate || !endDate || !current) { + return false; + } + return !isSameDate(generateConfig2, startDate, current) && !isSameDate(generateConfig2, endDate, current) && generateConfig2.isAfter(current, startDate) && generateConfig2.isAfter(endDate, current); + } + function getWeekStartDate(locale4, generateConfig2, value) { + var weekFirstDay = generateConfig2.locale.getWeekFirstDay(locale4); + var monthStartDate = generateConfig2.setDate(value, 1); + var startDateWeekDay = generateConfig2.getWeekDay(monthStartDate); + var alignStartDate = generateConfig2.addDate(monthStartDate, weekFirstDay - startDateWeekDay); + if (generateConfig2.getMonth(alignStartDate) === generateConfig2.getMonth(value) && generateConfig2.getDate(alignStartDate) > 1) { + alignStartDate = generateConfig2.addDate(alignStartDate, -7); + } + return alignStartDate; + } + function getClosingViewDate(viewDate, picker, generateConfig2) { + var offset2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1; + switch (picker) { + case "year": + return generateConfig2.addYear(viewDate, offset2 * 10); + case "quarter": + case "month": + return generateConfig2.addYear(viewDate, offset2); + default: + return generateConfig2.addMonth(viewDate, offset2); + } + } + function formatValue(value, _ref) { + var generateConfig2 = _ref.generateConfig, locale4 = _ref.locale, format3 = _ref.format; + return typeof format3 === "function" ? format3(value) : generateConfig2.locale.format(locale4.locale, value, format3); + } + function parseValue(value, _ref2) { + var generateConfig2 = _ref2.generateConfig, locale4 = _ref2.locale, formatList = _ref2.formatList; + if (!value || typeof formatList[0] === "function") { + return null; + } + return generateConfig2.locale.parse(locale4.locale, value, formatList); + } + function getCellDateDisabled(_ref3) { + var cellDate = _ref3.cellDate, mode = _ref3.mode, disabledDate = _ref3.disabledDate, generateConfig2 = _ref3.generateConfig; + if (!disabledDate) + return false; + var getDisabledFromRange = function getDisabledFromRange2(currentMode, start, end) { + var current = start; + while (current <= end) { + var date3 = void 0; + switch (currentMode) { + case "date": { + date3 = generateConfig2.setDate(cellDate, current); + if (!disabledDate(date3)) { + return false; + } + break; + } + case "month": { + date3 = generateConfig2.setMonth(cellDate, current); + if (!getCellDateDisabled({ + cellDate: date3, + mode: "month", + generateConfig: generateConfig2, + disabledDate + })) { + return false; + } + break; + } + case "year": { + date3 = generateConfig2.setYear(cellDate, current); + if (!getCellDateDisabled({ + cellDate: date3, + mode: "year", + generateConfig: generateConfig2, + disabledDate + })) { + return false; + } + break; + } + } + current += 1; + } + return true; + }; + switch (mode) { + case "date": + case "week": { + return disabledDate(cellDate); + } + case "month": { + var startDate = 1; + var endDate = generateConfig2.getDate(generateConfig2.getEndDate(cellDate)); + return getDisabledFromRange("date", startDate, endDate); + } + case "quarter": { + var startMonth = Math.floor(generateConfig2.getMonth(cellDate) / 3) * 3; + var endMonth = startMonth + 2; + return getDisabledFromRange("month", startMonth, endMonth); + } + case "year": { + return getDisabledFromRange("month", 0, 11); + } + case "decade": { + var year = generateConfig2.getYear(cellDate); + var startYear = Math.floor(year / DECADE_UNIT_DIFF) * DECADE_UNIT_DIFF; + var endYear = startYear + DECADE_UNIT_DIFF - 1; + return getDisabledFromRange("year", startYear, endYear); + } + } + } + + // node_modules/rc-picker/es/panels/TimePanel/TimeHeader.js + function TimeHeader(props) { + var _React$useContext = React72.useContext(PanelContext_default), hideHeader = _React$useContext.hideHeader; + if (hideHeader) { + return null; + } + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, locale4 = props.locale, value = props.value, format3 = props.format; + var headerPrefixCls = "".concat(prefixCls, "-header"); + return /* @__PURE__ */ React72.createElement(Header_default, { + prefixCls: headerPrefixCls + }, value ? formatValue(value, { + locale: locale4, + format: format3, + generateConfig: generateConfig2 + }) : "\xA0"); + } + var TimeHeader_default = TimeHeader; + + // node_modules/rc-picker/es/panels/TimePanel/TimeBody.js + var React74 = __toModule(require_react()); + + // node_modules/rc-picker/es/panels/TimePanel/TimeUnitColumn.js + var React73 = __toModule(require_react()); + var import_react20 = __toModule(require_react()); + var import_classnames15 = __toModule(require_classnames()); + function TimeUnitColumn(props) { + var prefixCls = props.prefixCls, units = props.units, onSelect = props.onSelect, value = props.value, active = props.active, hideDisabledOptions = props.hideDisabledOptions; + var cellPrefixCls = "".concat(prefixCls, "-cell"); + var _React$useContext = React73.useContext(PanelContext_default), open = _React$useContext.open; + var ulRef = (0, import_react20.useRef)(null); + var liRefs = (0, import_react20.useRef)(new Map()); + var scrollRef = (0, import_react20.useRef)(); + (0, import_react20.useLayoutEffect)(function() { + var li = liRefs.current.get(value); + if (li && open !== false) { + scrollTo(ulRef.current, li.offsetTop, 120); + } + }, [value]); + (0, import_react20.useLayoutEffect)(function() { + if (open) { + var li = liRefs.current.get(value); + if (li) { + scrollRef.current = waitElementReady(li, function() { + scrollTo(ulRef.current, li.offsetTop, 0); + }); + } + } + return function() { + var _scrollRef$current; + (_scrollRef$current = scrollRef.current) === null || _scrollRef$current === void 0 ? void 0 : _scrollRef$current.call(scrollRef); + }; + }, [open]); + return /* @__PURE__ */ React73.createElement("ul", { + className: (0, import_classnames15.default)("".concat(prefixCls, "-column"), _defineProperty({}, "".concat(prefixCls, "-column-active"), active)), + ref: ulRef, + style: { + position: "relative" + } + }, units.map(function(unit) { + var _classNames2; + if (hideDisabledOptions && unit.disabled) { + return null; + } + return /* @__PURE__ */ React73.createElement("li", { + key: unit.value, + ref: function ref(element) { + liRefs.current.set(unit.value, element); + }, + className: (0, import_classnames15.default)(cellPrefixCls, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(cellPrefixCls, "-disabled"), unit.disabled), _defineProperty(_classNames2, "".concat(cellPrefixCls, "-selected"), value === unit.value), _classNames2)), + onClick: function onClick() { + if (unit.disabled) { + return; + } + onSelect(unit.value); + } + }, /* @__PURE__ */ React73.createElement("div", { + className: "".concat(cellPrefixCls, "-inner") + }, unit.label)); + })); + } + var TimeUnitColumn_default = TimeUnitColumn; + + // node_modules/rc-picker/es/utils/miscUtil.js + function leftPad(str, length) { + var fill = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "0"; + var current = String(str); + while (current.length < length) { + current = "".concat(fill).concat(str); + } + return current; + } + var tuple3 = function tuple4() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return args; + }; + function toArray3(val) { + if (val === null || val === void 0) { + return []; + } + return Array.isArray(val) ? val : [val]; + } + function getDataOrAriaProps(props) { + var retProps = {}; + Object.keys(props).forEach(function(key2) { + if ((key2.substr(0, 5) === "data-" || key2.substr(0, 5) === "aria-" || key2 === "role" || key2 === "name") && key2.substr(0, 7) !== "data-__") { + retProps[key2] = props[key2]; + } + }); + return retProps; + } + function getValue3(values, index2) { + return values ? values[index2] : null; + } + function updateValues(values, value, index2) { + var newValues = [getValue3(values, 0), getValue3(values, 1)]; + newValues[index2] = typeof value === "function" ? value(newValues[index2]) : value; + if (!newValues[0] && !newValues[1]) { + return null; + } + return newValues; + } + + // node_modules/rc-picker/es/panels/TimePanel/TimeBody.js + function shouldUnitsUpdate(prevUnits, nextUnits) { + if (prevUnits.length !== nextUnits.length) + return true; + for (var i = 0; i < prevUnits.length; i += 1) { + if (prevUnits[i].disabled !== nextUnits[i].disabled) + return true; + } + return false; + } + function generateUnits(start, end, step, disabledUnits) { + var units = []; + for (var i = start; i <= end; i += step) { + units.push({ + label: leftPad(i, 2), + value: i, + disabled: (disabledUnits || []).includes(i) + }); + } + return units; + } + function TimeBody(props) { + var generateConfig2 = props.generateConfig, prefixCls = props.prefixCls, operationRef = props.operationRef, activeColumnIndex = props.activeColumnIndex, value = props.value, showHour = props.showHour, showMinute = props.showMinute, showSecond = props.showSecond, use12Hours = props.use12Hours, _props$hourStep = props.hourStep, hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep, _props$minuteStep = props.minuteStep, minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep, _props$secondStep = props.secondStep, secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep, disabledHours = props.disabledHours, disabledMinutes = props.disabledMinutes, disabledSeconds = props.disabledSeconds, hideDisabledOptions = props.hideDisabledOptions, onSelect = props.onSelect; + var columns = []; + var contentPrefixCls = "".concat(prefixCls, "-content"); + var columnPrefixCls = "".concat(prefixCls, "-time-panel"); + var isPM; + var originHour = value ? generateConfig2.getHour(value) : -1; + var hour = originHour; + var minute = value ? generateConfig2.getMinute(value) : -1; + var second = value ? generateConfig2.getSecond(value) : -1; + var setTime2 = function setTime3(isNewPM, newHour, newMinute, newSecond) { + var newDate = value || generateConfig2.getNow(); + var mergedHour = Math.max(0, newHour); + var mergedMinute = Math.max(0, newMinute); + var mergedSecond = Math.max(0, newSecond); + newDate = setTime(generateConfig2, newDate, !use12Hours || !isNewPM ? mergedHour : mergedHour + 12, mergedMinute, mergedSecond); + return newDate; + }; + var rawHours = generateUnits(0, 23, hourStep, disabledHours && disabledHours()); + var memorizedRawHours = useMemo2(function() { + return rawHours; + }, rawHours, shouldUnitsUpdate); + if (use12Hours) { + isPM = hour >= 12; + hour %= 12; + } + var _React$useMemo = React74.useMemo(function() { + if (!use12Hours) { + return [false, false]; + } + var AMPMDisabled = [true, true]; + memorizedRawHours.forEach(function(_ref) { + var disabled = _ref.disabled, hourValue = _ref.value; + if (disabled) + return; + if (hourValue >= 12) { + AMPMDisabled[1] = false; + } else { + AMPMDisabled[0] = false; + } + }); + return AMPMDisabled; + }, [use12Hours, memorizedRawHours]), _React$useMemo2 = _slicedToArray(_React$useMemo, 2), AMDisabled = _React$useMemo2[0], PMDisabled = _React$useMemo2[1]; + var hours = React74.useMemo(function() { + if (!use12Hours) + return memorizedRawHours; + return memorizedRawHours.filter(isPM ? function(hourMeta) { + return hourMeta.value >= 12; + } : function(hourMeta) { + return hourMeta.value < 12; + }).map(function(hourMeta) { + var hourValue = hourMeta.value % 12; + var hourLabel = hourValue === 0 ? "12" : leftPad(hourValue, 2); + return _objectSpread2(_objectSpread2({}, hourMeta), {}, { + label: hourLabel, + value: hourValue + }); + }); + }, [use12Hours, isPM, memorizedRawHours]); + var minutes = generateUnits(0, 59, minuteStep, disabledMinutes && disabledMinutes(originHour)); + var seconds = generateUnits(0, 59, secondStep, disabledSeconds && disabledSeconds(originHour, minute)); + operationRef.current = { + onUpDown: function onUpDown(diff) { + var column = columns[activeColumnIndex]; + if (column) { + var valueIndex = column.units.findIndex(function(unit) { + return unit.value === column.value; + }); + var unitLen = column.units.length; + for (var i = 1; i < unitLen; i += 1) { + var nextUnit = column.units[(valueIndex + diff * i + unitLen) % unitLen]; + if (nextUnit.disabled !== true) { + column.onSelect(nextUnit.value); + break; + } + } + } + } + }; + function addColumnNode(condition, node, columnValue, units, onColumnSelect) { + if (condition !== false) { + columns.push({ + node: /* @__PURE__ */ React74.cloneElement(node, { + prefixCls: columnPrefixCls, + value: columnValue, + active: activeColumnIndex === columns.length, + onSelect: onColumnSelect, + units, + hideDisabledOptions + }), + onSelect: onColumnSelect, + value: columnValue, + units + }); + } + } + addColumnNode(showHour, /* @__PURE__ */ React74.createElement(TimeUnitColumn_default, { + key: "hour" + }), hour, hours, function(num) { + onSelect(setTime2(isPM, num, minute, second), "mouse"); + }); + addColumnNode(showMinute, /* @__PURE__ */ React74.createElement(TimeUnitColumn_default, { + key: "minute" + }), minute, minutes, function(num) { + onSelect(setTime2(isPM, hour, num, second), "mouse"); + }); + addColumnNode(showSecond, /* @__PURE__ */ React74.createElement(TimeUnitColumn_default, { + key: "second" + }), second, seconds, function(num) { + onSelect(setTime2(isPM, hour, minute, num), "mouse"); + }); + var PMIndex = -1; + if (typeof isPM === "boolean") { + PMIndex = isPM ? 1 : 0; + } + addColumnNode(use12Hours === true, /* @__PURE__ */ React74.createElement(TimeUnitColumn_default, { + key: "12hours" + }), PMIndex, [{ + label: "AM", + value: 0, + disabled: AMDisabled + }, { + label: "PM", + value: 1, + disabled: PMDisabled + }], function(num) { + onSelect(setTime2(!!num, hour, minute, second), "mouse"); + }); + return /* @__PURE__ */ React74.createElement("div", { + className: contentPrefixCls + }, columns.map(function(_ref2) { + var node = _ref2.node; + return node; + })); + } + var TimeBody_default = TimeBody; + + // node_modules/rc-picker/es/panels/TimePanel/index.js + var countBoolean = function countBoolean2(boolList) { + return boolList.filter(function(bool) { + return bool !== false; + }).length; + }; + function TimePanel(props) { + var generateConfig2 = props.generateConfig, _props$format = props.format, format3 = _props$format === void 0 ? "HH:mm:ss" : _props$format, prefixCls = props.prefixCls, active = props.active, operationRef = props.operationRef, showHour = props.showHour, showMinute = props.showMinute, showSecond = props.showSecond, _props$use12Hours = props.use12Hours, use12Hours = _props$use12Hours === void 0 ? false : _props$use12Hours, onSelect = props.onSelect, value = props.value; + var panelPrefixCls = "".concat(prefixCls, "-time-panel"); + var bodyOperationRef = React75.useRef(); + var _React$useState = React75.useState(-1), _React$useState2 = _slicedToArray(_React$useState, 2), activeColumnIndex = _React$useState2[0], setActiveColumnIndex = _React$useState2[1]; + var columnsCount = countBoolean([showHour, showMinute, showSecond, use12Hours]); + operationRef.current = { + onKeyDown: function onKeyDown(event) { + return createKeyDownHandler(event, { + onLeftRight: function onLeftRight(diff) { + setActiveColumnIndex((activeColumnIndex + diff + columnsCount) % columnsCount); + }, + onUpDown: function onUpDown(diff) { + if (activeColumnIndex === -1) { + setActiveColumnIndex(0); + } else if (bodyOperationRef.current) { + bodyOperationRef.current.onUpDown(diff); + } + }, + onEnter: function onEnter() { + onSelect(value || generateConfig2.getNow(), "key"); + setActiveColumnIndex(-1); + } + }); + }, + onBlur: function onBlur() { + setActiveColumnIndex(-1); + } + }; + return /* @__PURE__ */ React75.createElement("div", { + className: (0, import_classnames16.default)(panelPrefixCls, _defineProperty({}, "".concat(panelPrefixCls, "-active"), active)) + }, /* @__PURE__ */ React75.createElement(TimeHeader_default, _extends({}, props, { + format: format3, + prefixCls + })), /* @__PURE__ */ React75.createElement(TimeBody_default, _extends({}, props, { + prefixCls, + activeColumnIndex, + operationRef: bodyOperationRef + }))); + } + var TimePanel_default = TimePanel; + + // node_modules/rc-picker/es/panels/DatetimePanel/index.js + var React80 = __toModule(require_react()); + var import_classnames18 = __toModule(require_classnames()); + + // node_modules/rc-picker/es/panels/DatePanel/index.js + var React79 = __toModule(require_react()); + var import_classnames17 = __toModule(require_classnames()); + + // node_modules/rc-picker/es/panels/DatePanel/DateBody.js + var React77 = __toModule(require_react()); + + // node_modules/rc-picker/es/RangeContext.js + var React76 = __toModule(require_react()); + var RangeContext = /* @__PURE__ */ React76.createContext({}); + var RangeContext_default = RangeContext; + + // node_modules/rc-picker/es/hooks/useCellClassName.js + function useCellClassName(_ref) { + var cellPrefixCls = _ref.cellPrefixCls, generateConfig2 = _ref.generateConfig, rangedValue = _ref.rangedValue, hoverRangedValue = _ref.hoverRangedValue, isInView = _ref.isInView, isSameCell = _ref.isSameCell, offsetCell = _ref.offsetCell, today = _ref.today, value = _ref.value; + function getClassName(currentDate) { + var _ref2; + var prevDate = offsetCell(currentDate, -1); + var nextDate = offsetCell(currentDate, 1); + var rangeStart = getValue3(rangedValue, 0); + var rangeEnd = getValue3(rangedValue, 1); + var hoverStart = getValue3(hoverRangedValue, 0); + var hoverEnd = getValue3(hoverRangedValue, 1); + var isRangeHovered = isInRange(generateConfig2, hoverStart, hoverEnd, currentDate); + function isRangeStart(date3) { + return isSameCell(rangeStart, date3); + } + function isRangeEnd(date3) { + return isSameCell(rangeEnd, date3); + } + var isHoverStart = isSameCell(hoverStart, currentDate); + var isHoverEnd = isSameCell(hoverEnd, currentDate); + var isHoverEdgeStart = (isRangeHovered || isHoverEnd) && (!isInView(prevDate) || isRangeEnd(prevDate)); + var isHoverEdgeEnd = (isRangeHovered || isHoverStart) && (!isInView(nextDate) || isRangeStart(nextDate)); + return _ref2 = {}, _defineProperty(_ref2, "".concat(cellPrefixCls, "-in-view"), isInView(currentDate)), _defineProperty(_ref2, "".concat(cellPrefixCls, "-in-range"), isInRange(generateConfig2, rangeStart, rangeEnd, currentDate)), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-start"), isRangeStart(currentDate)), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-end"), isRangeEnd(currentDate)), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-start-single"), isRangeStart(currentDate) && !rangeEnd), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-end-single"), isRangeEnd(currentDate) && !rangeStart), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-start-near-hover"), isRangeStart(currentDate) && (isSameCell(prevDate, hoverStart) || isInRange(generateConfig2, hoverStart, hoverEnd, prevDate))), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-end-near-hover"), isRangeEnd(currentDate) && (isSameCell(nextDate, hoverEnd) || isInRange(generateConfig2, hoverStart, hoverEnd, nextDate))), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-hover"), isRangeHovered), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-hover-start"), isHoverStart), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-hover-end"), isHoverEnd), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-hover-edge-start"), isHoverEdgeStart), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-hover-edge-end"), isHoverEdgeEnd), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-hover-edge-start-near-range"), isHoverEdgeStart && isSameCell(prevDate, rangeEnd)), _defineProperty(_ref2, "".concat(cellPrefixCls, "-range-hover-edge-end-near-range"), isHoverEdgeEnd && isSameCell(nextDate, rangeStart)), _defineProperty(_ref2, "".concat(cellPrefixCls, "-today"), isSameCell(today, currentDate)), _defineProperty(_ref2, "".concat(cellPrefixCls, "-selected"), isSameCell(value, currentDate)), _ref2; + } + return getClassName; + } + + // node_modules/rc-picker/es/panels/DatePanel/DateBody.js + function DateBody(props) { + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, prefixColumn = props.prefixColumn, locale4 = props.locale, rowCount = props.rowCount, viewDate = props.viewDate, value = props.value, dateRender = props.dateRender; + var _React$useContext = React77.useContext(RangeContext_default), rangedValue = _React$useContext.rangedValue, hoverRangedValue = _React$useContext.hoverRangedValue; + var baseDate = getWeekStartDate(locale4.locale, generateConfig2, viewDate); + var cellPrefixCls = "".concat(prefixCls, "-cell"); + var weekFirstDay = generateConfig2.locale.getWeekFirstDay(locale4.locale); + var today = generateConfig2.getNow(); + var headerCells = []; + var weekDaysLocale = locale4.shortWeekDays || (generateConfig2.locale.getShortWeekDays ? generateConfig2.locale.getShortWeekDays(locale4.locale) : []); + if (prefixColumn) { + headerCells.push(/* @__PURE__ */ React77.createElement("th", { + key: "empty", + "aria-label": "empty cell" + })); + } + for (var i = 0; i < WEEK_DAY_COUNT; i += 1) { + headerCells.push(/* @__PURE__ */ React77.createElement("th", { + key: i + }, weekDaysLocale[(i + weekFirstDay) % WEEK_DAY_COUNT])); + } + var getCellClassName = useCellClassName({ + cellPrefixCls, + today, + value, + generateConfig: generateConfig2, + rangedValue: prefixColumn ? null : rangedValue, + hoverRangedValue: prefixColumn ? null : hoverRangedValue, + isSameCell: function isSameCell(current, target) { + return isSameDate(generateConfig2, current, target); + }, + isInView: function isInView(date3) { + return isSameMonth(generateConfig2, date3, viewDate); + }, + offsetCell: function offsetCell(date3, offset2) { + return generateConfig2.addDate(date3, offset2); + } + }); + var getCellNode = dateRender ? function(date3) { + return dateRender(date3, today); + } : void 0; + return /* @__PURE__ */ React77.createElement(PanelBody, _extends({}, props, { + rowNum: rowCount, + colNum: WEEK_DAY_COUNT, + baseDate, + getCellNode, + getCellText: generateConfig2.getDate, + getCellClassName, + getCellDate: generateConfig2.addDate, + titleCell: function titleCell(date3) { + return formatValue(date3, { + locale: locale4, + format: "YYYY-MM-DD", + generateConfig: generateConfig2 + }); + }, + headerCells + })); + } + var DateBody_default = DateBody; + + // node_modules/rc-picker/es/panels/DatePanel/DateHeader.js + var React78 = __toModule(require_react()); + function DateHeader(props) { + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, locale4 = props.locale, viewDate = props.viewDate, onNextMonth = props.onNextMonth, onPrevMonth = props.onPrevMonth, onNextYear = props.onNextYear, onPrevYear = props.onPrevYear, onYearClick = props.onYearClick, onMonthClick = props.onMonthClick; + var _React$useContext = React78.useContext(PanelContext_default), hideHeader = _React$useContext.hideHeader; + if (hideHeader) { + return null; + } + var headerPrefixCls = "".concat(prefixCls, "-header"); + var monthsLocale = locale4.shortMonths || (generateConfig2.locale.getShortMonths ? generateConfig2.locale.getShortMonths(locale4.locale) : []); + var month = generateConfig2.getMonth(viewDate); + var yearNode = /* @__PURE__ */ React78.createElement("button", { + type: "button", + key: "year", + onClick: onYearClick, + tabIndex: -1, + className: "".concat(prefixCls, "-year-btn") + }, formatValue(viewDate, { + locale: locale4, + format: locale4.yearFormat, + generateConfig: generateConfig2 + })); + var monthNode = /* @__PURE__ */ React78.createElement("button", { + type: "button", + key: "month", + onClick: onMonthClick, + tabIndex: -1, + className: "".concat(prefixCls, "-month-btn") + }, locale4.monthFormat ? formatValue(viewDate, { + locale: locale4, + format: locale4.monthFormat, + generateConfig: generateConfig2 + }) : monthsLocale[month]); + var monthYearNodes = locale4.monthBeforeYear ? [monthNode, yearNode] : [yearNode, monthNode]; + return /* @__PURE__ */ React78.createElement(Header_default, _extends({}, props, { + prefixCls: headerPrefixCls, + onSuperPrev: onPrevYear, + onPrev: onPrevMonth, + onNext: onNextMonth, + onSuperNext: onNextYear + }), monthYearNodes); + } + var DateHeader_default = DateHeader; + + // node_modules/rc-picker/es/panels/DatePanel/index.js + var DATE_ROW_COUNT = 6; + function DatePanel(props) { + var prefixCls = props.prefixCls, _props$panelName = props.panelName, panelName = _props$panelName === void 0 ? "date" : _props$panelName, keyboardConfig = props.keyboardConfig, active = props.active, operationRef = props.operationRef, generateConfig2 = props.generateConfig, value = props.value, viewDate = props.viewDate, onViewDateChange = props.onViewDateChange, onPanelChange = props.onPanelChange, _onSelect = props.onSelect; + var panelPrefixCls = "".concat(prefixCls, "-").concat(panelName, "-panel"); + operationRef.current = { + onKeyDown: function onKeyDown(event) { + return createKeyDownHandler(event, _objectSpread2({ + onLeftRight: function onLeftRight(diff) { + _onSelect(generateConfig2.addDate(value || viewDate, diff), "key"); + }, + onCtrlLeftRight: function onCtrlLeftRight(diff) { + _onSelect(generateConfig2.addYear(value || viewDate, diff), "key"); + }, + onUpDown: function onUpDown(diff) { + _onSelect(generateConfig2.addDate(value || viewDate, diff * WEEK_DAY_COUNT), "key"); + }, + onPageUpDown: function onPageUpDown(diff) { + _onSelect(generateConfig2.addMonth(value || viewDate, diff), "key"); + } + }, keyboardConfig)); + } + }; + var onYearChange = function onYearChange2(diff) { + var newDate = generateConfig2.addYear(viewDate, diff); + onViewDateChange(newDate); + onPanelChange(null, newDate); + }; + var onMonthChange = function onMonthChange2(diff) { + var newDate = generateConfig2.addMonth(viewDate, diff); + onViewDateChange(newDate); + onPanelChange(null, newDate); + }; + return /* @__PURE__ */ React79.createElement("div", { + className: (0, import_classnames17.default)(panelPrefixCls, _defineProperty({}, "".concat(panelPrefixCls, "-active"), active)) + }, /* @__PURE__ */ React79.createElement(DateHeader_default, _extends({}, props, { + prefixCls, + value, + viewDate, + onPrevYear: function onPrevYear() { + onYearChange(-1); + }, + onNextYear: function onNextYear() { + onYearChange(1); + }, + onPrevMonth: function onPrevMonth() { + onMonthChange(-1); + }, + onNextMonth: function onNextMonth() { + onMonthChange(1); + }, + onMonthClick: function onMonthClick() { + onPanelChange("month", viewDate); + }, + onYearClick: function onYearClick() { + onPanelChange("year", viewDate); + } + })), /* @__PURE__ */ React79.createElement(DateBody_default, _extends({}, props, { + onSelect: function onSelect(date3) { + return _onSelect(date3, "mouse"); + }, + prefixCls, + value, + viewDate, + rowCount: DATE_ROW_COUNT + }))); + } + var DatePanel_default = DatePanel; + + // node_modules/rc-picker/es/panels/DatetimePanel/index.js + var ACTIVE_PANEL = tuple3("date", "time"); + function DatetimePanel(props) { + var prefixCls = props.prefixCls, operationRef = props.operationRef, generateConfig2 = props.generateConfig, value = props.value, defaultValue = props.defaultValue, disabledTime = props.disabledTime, showTime = props.showTime, onSelect = props.onSelect; + var panelPrefixCls = "".concat(prefixCls, "-datetime-panel"); + var _React$useState = React80.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), activePanel = _React$useState2[0], setActivePanel = _React$useState2[1]; + var dateOperationRef = React80.useRef({}); + var timeOperationRef = React80.useRef({}); + var timeProps = _typeof(showTime) === "object" ? _objectSpread2({}, showTime) : {}; + function getNextActive(offset2) { + var activeIndex = ACTIVE_PANEL.indexOf(activePanel) + offset2; + var nextActivePanel = ACTIVE_PANEL[activeIndex] || null; + return nextActivePanel; + } + var onBlur = function onBlur2(e) { + if (timeOperationRef.current.onBlur) { + timeOperationRef.current.onBlur(e); + } + setActivePanel(null); + }; + operationRef.current = { + onKeyDown: function onKeyDown(event) { + if (event.which === KeyCode_default.TAB) { + var nextActivePanel = getNextActive(event.shiftKey ? -1 : 1); + setActivePanel(nextActivePanel); + if (nextActivePanel) { + event.preventDefault(); + } + return true; + } + if (activePanel) { + var ref = activePanel === "date" ? dateOperationRef : timeOperationRef; + if (ref.current && ref.current.onKeyDown) { + ref.current.onKeyDown(event); + } + return true; + } + if ([KeyCode_default.LEFT, KeyCode_default.RIGHT, KeyCode_default.UP, KeyCode_default.DOWN].includes(event.which)) { + setActivePanel("date"); + return true; + } + return false; + }, + onBlur, + onClose: onBlur + }; + var onInternalSelect = function onInternalSelect2(date3, source) { + var selectedDate = date3; + if (source === "date" && !value && timeProps.defaultValue) { + selectedDate = generateConfig2.setHour(selectedDate, generateConfig2.getHour(timeProps.defaultValue)); + selectedDate = generateConfig2.setMinute(selectedDate, generateConfig2.getMinute(timeProps.defaultValue)); + selectedDate = generateConfig2.setSecond(selectedDate, generateConfig2.getSecond(timeProps.defaultValue)); + } else if (source === "time" && !value && defaultValue) { + selectedDate = generateConfig2.setYear(selectedDate, generateConfig2.getYear(defaultValue)); + selectedDate = generateConfig2.setMonth(selectedDate, generateConfig2.getMonth(defaultValue)); + selectedDate = generateConfig2.setDate(selectedDate, generateConfig2.getDate(defaultValue)); + } + if (onSelect) { + onSelect(selectedDate, "mouse"); + } + }; + var disabledTimes = disabledTime ? disabledTime(value || null) : {}; + return /* @__PURE__ */ React80.createElement("div", { + className: (0, import_classnames18.default)(panelPrefixCls, _defineProperty({}, "".concat(panelPrefixCls, "-active"), activePanel)) + }, /* @__PURE__ */ React80.createElement(DatePanel_default, _extends({}, props, { + operationRef: dateOperationRef, + active: activePanel === "date", + onSelect: function onSelect2(date3) { + onInternalSelect(setDateTime(generateConfig2, date3, showTime && _typeof(showTime) === "object" ? showTime.defaultValue : null), "date"); + } + })), /* @__PURE__ */ React80.createElement(TimePanel_default, _extends({}, props, { + format: void 0 + }, timeProps, disabledTimes, { + defaultValue: void 0, + operationRef: timeOperationRef, + active: activePanel === "time", + onSelect: function onSelect2(date3) { + onInternalSelect(date3, "time"); + } + }))); + } + var DatetimePanel_default = DatetimePanel; + + // node_modules/rc-picker/es/panels/WeekPanel/index.js + var React81 = __toModule(require_react()); + var import_classnames19 = __toModule(require_classnames()); + function WeekPanel(props) { + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, locale4 = props.locale, value = props.value; + var cellPrefixCls = "".concat(prefixCls, "-cell"); + var prefixColumn = function prefixColumn2(date3) { + return /* @__PURE__ */ React81.createElement("td", { + key: "week", + className: (0, import_classnames19.default)(cellPrefixCls, "".concat(cellPrefixCls, "-week")) + }, generateConfig2.locale.getWeek(locale4.locale, date3)); + }; + var rowPrefixCls = "".concat(prefixCls, "-week-panel-row"); + var rowClassName = function rowClassName2(date3) { + return (0, import_classnames19.default)(rowPrefixCls, _defineProperty({}, "".concat(rowPrefixCls, "-selected"), isSameWeek(generateConfig2, locale4.locale, value, date3))); + }; + return /* @__PURE__ */ React81.createElement(DatePanel_default, _extends({}, props, { + panelName: "week", + prefixColumn, + rowClassName, + keyboardConfig: { + onLeftRight: null + } + })); + } + var WeekPanel_default = WeekPanel; + + // node_modules/rc-picker/es/panels/MonthPanel/index.js + var React84 = __toModule(require_react()); + + // node_modules/rc-picker/es/panels/MonthPanel/MonthHeader.js + var React82 = __toModule(require_react()); + function MonthHeader(props) { + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, locale4 = props.locale, viewDate = props.viewDate, onNextYear = props.onNextYear, onPrevYear = props.onPrevYear, onYearClick = props.onYearClick; + var _React$useContext = React82.useContext(PanelContext_default), hideHeader = _React$useContext.hideHeader; + if (hideHeader) { + return null; + } + var headerPrefixCls = "".concat(prefixCls, "-header"); + return /* @__PURE__ */ React82.createElement(Header_default, _extends({}, props, { + prefixCls: headerPrefixCls, + onSuperPrev: onPrevYear, + onSuperNext: onNextYear + }), /* @__PURE__ */ React82.createElement("button", { + type: "button", + onClick: onYearClick, + className: "".concat(prefixCls, "-year-btn") + }, formatValue(viewDate, { + locale: locale4, + format: locale4.yearFormat, + generateConfig: generateConfig2 + }))); + } + var MonthHeader_default = MonthHeader; + + // node_modules/rc-picker/es/panels/MonthPanel/MonthBody.js + var React83 = __toModule(require_react()); + var MONTH_COL_COUNT = 3; + var MONTH_ROW_COUNT = 4; + function MonthBody(props) { + var prefixCls = props.prefixCls, locale4 = props.locale, value = props.value, viewDate = props.viewDate, generateConfig2 = props.generateConfig, monthCellRender = props.monthCellRender; + var _React$useContext = React83.useContext(RangeContext_default), rangedValue = _React$useContext.rangedValue, hoverRangedValue = _React$useContext.hoverRangedValue; + var cellPrefixCls = "".concat(prefixCls, "-cell"); + var getCellClassName = useCellClassName({ + cellPrefixCls, + value, + generateConfig: generateConfig2, + rangedValue, + hoverRangedValue, + isSameCell: function isSameCell(current, target) { + return isSameMonth(generateConfig2, current, target); + }, + isInView: function isInView() { + return true; + }, + offsetCell: function offsetCell(date3, offset2) { + return generateConfig2.addMonth(date3, offset2); + } + }); + var monthsLocale = locale4.shortMonths || (generateConfig2.locale.getShortMonths ? generateConfig2.locale.getShortMonths(locale4.locale) : []); + var baseMonth = generateConfig2.setMonth(viewDate, 0); + var getCellNode = monthCellRender ? function(date3) { + return monthCellRender(date3, locale4); + } : void 0; + return /* @__PURE__ */ React83.createElement(PanelBody, _extends({}, props, { + rowNum: MONTH_ROW_COUNT, + colNum: MONTH_COL_COUNT, + baseDate: baseMonth, + getCellNode, + getCellText: function getCellText(date3) { + return locale4.monthFormat ? formatValue(date3, { + locale: locale4, + format: locale4.monthFormat, + generateConfig: generateConfig2 + }) : monthsLocale[generateConfig2.getMonth(date3)]; + }, + getCellClassName, + getCellDate: generateConfig2.addMonth, + titleCell: function titleCell(date3) { + return formatValue(date3, { + locale: locale4, + format: "YYYY-MM", + generateConfig: generateConfig2 + }); + } + })); + } + var MonthBody_default = MonthBody; + + // node_modules/rc-picker/es/panels/MonthPanel/index.js + function MonthPanel(props) { + var prefixCls = props.prefixCls, operationRef = props.operationRef, onViewDateChange = props.onViewDateChange, generateConfig2 = props.generateConfig, value = props.value, viewDate = props.viewDate, onPanelChange = props.onPanelChange, _onSelect = props.onSelect; + var panelPrefixCls = "".concat(prefixCls, "-month-panel"); + operationRef.current = { + onKeyDown: function onKeyDown(event) { + return createKeyDownHandler(event, { + onLeftRight: function onLeftRight(diff) { + _onSelect(generateConfig2.addMonth(value || viewDate, diff), "key"); + }, + onCtrlLeftRight: function onCtrlLeftRight(diff) { + _onSelect(generateConfig2.addYear(value || viewDate, diff), "key"); + }, + onUpDown: function onUpDown(diff) { + _onSelect(generateConfig2.addMonth(value || viewDate, diff * MONTH_COL_COUNT), "key"); + }, + onEnter: function onEnter() { + onPanelChange("date", value || viewDate); + } + }); + } + }; + var onYearChange = function onYearChange2(diff) { + var newDate = generateConfig2.addYear(viewDate, diff); + onViewDateChange(newDate); + onPanelChange(null, newDate); + }; + return /* @__PURE__ */ React84.createElement("div", { + className: panelPrefixCls + }, /* @__PURE__ */ React84.createElement(MonthHeader_default, _extends({}, props, { + prefixCls, + onPrevYear: function onPrevYear() { + onYearChange(-1); + }, + onNextYear: function onNextYear() { + onYearChange(1); + }, + onYearClick: function onYearClick() { + onPanelChange("year", viewDate); + } + })), /* @__PURE__ */ React84.createElement(MonthBody_default, _extends({}, props, { + prefixCls, + onSelect: function onSelect(date3) { + _onSelect(date3, "mouse"); + onPanelChange("date", date3); + } + }))); + } + var MonthPanel_default = MonthPanel; + + // node_modules/rc-picker/es/panels/QuarterPanel/index.js + var React87 = __toModule(require_react()); + + // node_modules/rc-picker/es/panels/QuarterPanel/QuarterHeader.js + var React85 = __toModule(require_react()); + function QuarterHeader(props) { + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, locale4 = props.locale, viewDate = props.viewDate, onNextYear = props.onNextYear, onPrevYear = props.onPrevYear, onYearClick = props.onYearClick; + var _React$useContext = React85.useContext(PanelContext_default), hideHeader = _React$useContext.hideHeader; + if (hideHeader) { + return null; + } + var headerPrefixCls = "".concat(prefixCls, "-header"); + return /* @__PURE__ */ React85.createElement(Header_default, _extends({}, props, { + prefixCls: headerPrefixCls, + onSuperPrev: onPrevYear, + onSuperNext: onNextYear + }), /* @__PURE__ */ React85.createElement("button", { + type: "button", + onClick: onYearClick, + className: "".concat(prefixCls, "-year-btn") + }, formatValue(viewDate, { + locale: locale4, + format: locale4.yearFormat, + generateConfig: generateConfig2 + }))); + } + var QuarterHeader_default = QuarterHeader; + + // node_modules/rc-picker/es/panels/QuarterPanel/QuarterBody.js + var React86 = __toModule(require_react()); + var QUARTER_COL_COUNT = 4; + var QUARTER_ROW_COUNT = 1; + function QuarterBody(props) { + var prefixCls = props.prefixCls, locale4 = props.locale, value = props.value, viewDate = props.viewDate, generateConfig2 = props.generateConfig; + var _React$useContext = React86.useContext(RangeContext_default), rangedValue = _React$useContext.rangedValue, hoverRangedValue = _React$useContext.hoverRangedValue; + var cellPrefixCls = "".concat(prefixCls, "-cell"); + var getCellClassName = useCellClassName({ + cellPrefixCls, + value, + generateConfig: generateConfig2, + rangedValue, + hoverRangedValue, + isSameCell: function isSameCell(current, target) { + return isSameQuarter(generateConfig2, current, target); + }, + isInView: function isInView() { + return true; + }, + offsetCell: function offsetCell(date3, offset2) { + return generateConfig2.addMonth(date3, offset2 * 3); + } + }); + var baseQuarter = generateConfig2.setDate(generateConfig2.setMonth(viewDate, 0), 1); + return /* @__PURE__ */ React86.createElement(PanelBody, _extends({}, props, { + rowNum: QUARTER_ROW_COUNT, + colNum: QUARTER_COL_COUNT, + baseDate: baseQuarter, + getCellText: function getCellText(date3) { + return formatValue(date3, { + locale: locale4, + format: locale4.quarterFormat || "[Q]Q", + generateConfig: generateConfig2 + }); + }, + getCellClassName, + getCellDate: function getCellDate(date3, offset2) { + return generateConfig2.addMonth(date3, offset2 * 3); + }, + titleCell: function titleCell(date3) { + return formatValue(date3, { + locale: locale4, + format: "YYYY-[Q]Q", + generateConfig: generateConfig2 + }); + } + })); + } + var QuarterBody_default = QuarterBody; + + // node_modules/rc-picker/es/panels/QuarterPanel/index.js + function QuarterPanel(props) { + var prefixCls = props.prefixCls, operationRef = props.operationRef, onViewDateChange = props.onViewDateChange, generateConfig2 = props.generateConfig, value = props.value, viewDate = props.viewDate, onPanelChange = props.onPanelChange, _onSelect = props.onSelect; + var panelPrefixCls = "".concat(prefixCls, "-quarter-panel"); + operationRef.current = { + onKeyDown: function onKeyDown(event) { + return createKeyDownHandler(event, { + onLeftRight: function onLeftRight(diff) { + _onSelect(generateConfig2.addMonth(value || viewDate, diff * 3), "key"); + }, + onCtrlLeftRight: function onCtrlLeftRight(diff) { + _onSelect(generateConfig2.addYear(value || viewDate, diff), "key"); + }, + onUpDown: function onUpDown(diff) { + _onSelect(generateConfig2.addYear(value || viewDate, diff), "key"); + } + }); + } + }; + var onYearChange = function onYearChange2(diff) { + var newDate = generateConfig2.addYear(viewDate, diff); + onViewDateChange(newDate); + onPanelChange(null, newDate); + }; + return /* @__PURE__ */ React87.createElement("div", { + className: panelPrefixCls + }, /* @__PURE__ */ React87.createElement(QuarterHeader_default, _extends({}, props, { + prefixCls, + onPrevYear: function onPrevYear() { + onYearChange(-1); + }, + onNextYear: function onNextYear() { + onYearChange(1); + }, + onYearClick: function onYearClick() { + onPanelChange("year", viewDate); + } + })), /* @__PURE__ */ React87.createElement(QuarterBody_default, _extends({}, props, { + prefixCls, + onSelect: function onSelect(date3) { + _onSelect(date3, "mouse"); + } + }))); + } + var QuarterPanel_default = QuarterPanel; + + // node_modules/rc-picker/es/panels/YearPanel/index.js + var React90 = __toModule(require_react()); + + // node_modules/rc-picker/es/panels/YearPanel/YearHeader.js + var React88 = __toModule(require_react()); + function YearHeader(props) { + var prefixCls = props.prefixCls, generateConfig2 = props.generateConfig, viewDate = props.viewDate, onPrevDecade = props.onPrevDecade, onNextDecade = props.onNextDecade, onDecadeClick = props.onDecadeClick; + var _React$useContext = React88.useContext(PanelContext_default), hideHeader = _React$useContext.hideHeader; + if (hideHeader) { + return null; + } + var headerPrefixCls = "".concat(prefixCls, "-header"); + var yearNumber = generateConfig2.getYear(viewDate); + var startYear = Math.floor(yearNumber / YEAR_DECADE_COUNT) * YEAR_DECADE_COUNT; + var endYear = startYear + YEAR_DECADE_COUNT - 1; + return /* @__PURE__ */ React88.createElement(Header_default, _extends({}, props, { + prefixCls: headerPrefixCls, + onSuperPrev: onPrevDecade, + onSuperNext: onNextDecade + }), /* @__PURE__ */ React88.createElement("button", { + type: "button", + onClick: onDecadeClick, + className: "".concat(prefixCls, "-decade-btn") + }, startYear, "-", endYear)); + } + var YearHeader_default = YearHeader; + + // node_modules/rc-picker/es/panels/YearPanel/YearBody.js + var React89 = __toModule(require_react()); + var YEAR_COL_COUNT = 3; + var YEAR_ROW_COUNT = 4; + function YearBody(props) { + var prefixCls = props.prefixCls, value = props.value, viewDate = props.viewDate, locale4 = props.locale, generateConfig2 = props.generateConfig; + var _React$useContext = React89.useContext(RangeContext_default), rangedValue = _React$useContext.rangedValue, hoverRangedValue = _React$useContext.hoverRangedValue; + var yearPrefixCls = "".concat(prefixCls, "-cell"); + var yearNumber = generateConfig2.getYear(viewDate); + var startYear = Math.floor(yearNumber / YEAR_DECADE_COUNT) * YEAR_DECADE_COUNT; + var endYear = startYear + YEAR_DECADE_COUNT - 1; + var baseYear = generateConfig2.setYear(viewDate, startYear - Math.ceil((YEAR_COL_COUNT * YEAR_ROW_COUNT - YEAR_DECADE_COUNT) / 2)); + var isInView = function isInView2(date3) { + var currentYearNumber = generateConfig2.getYear(date3); + return startYear <= currentYearNumber && currentYearNumber <= endYear; + }; + var getCellClassName = useCellClassName({ + cellPrefixCls: yearPrefixCls, + value, + generateConfig: generateConfig2, + rangedValue, + hoverRangedValue, + isSameCell: function isSameCell(current, target) { + return isSameYear(generateConfig2, current, target); + }, + isInView, + offsetCell: function offsetCell(date3, offset2) { + return generateConfig2.addYear(date3, offset2); + } + }); + return /* @__PURE__ */ React89.createElement(PanelBody, _extends({}, props, { + rowNum: YEAR_ROW_COUNT, + colNum: YEAR_COL_COUNT, + baseDate: baseYear, + getCellText: generateConfig2.getYear, + getCellClassName, + getCellDate: generateConfig2.addYear, + titleCell: function titleCell(date3) { + return formatValue(date3, { + locale: locale4, + format: "YYYY", + generateConfig: generateConfig2 + }); + } + })); + } + var YearBody_default = YearBody; + + // node_modules/rc-picker/es/panels/YearPanel/index.js + var YEAR_DECADE_COUNT = 10; + function YearPanel(props) { + var prefixCls = props.prefixCls, operationRef = props.operationRef, onViewDateChange = props.onViewDateChange, generateConfig2 = props.generateConfig, value = props.value, viewDate = props.viewDate, sourceMode = props.sourceMode, _onSelect = props.onSelect, onPanelChange = props.onPanelChange; + var panelPrefixCls = "".concat(prefixCls, "-year-panel"); + operationRef.current = { + onKeyDown: function onKeyDown(event) { + return createKeyDownHandler(event, { + onLeftRight: function onLeftRight(diff) { + _onSelect(generateConfig2.addYear(value || viewDate, diff), "key"); + }, + onCtrlLeftRight: function onCtrlLeftRight(diff) { + _onSelect(generateConfig2.addYear(value || viewDate, diff * YEAR_DECADE_COUNT), "key"); + }, + onUpDown: function onUpDown(diff) { + _onSelect(generateConfig2.addYear(value || viewDate, diff * YEAR_COL_COUNT), "key"); + }, + onEnter: function onEnter() { + onPanelChange(sourceMode === "date" ? "date" : "month", value || viewDate); + } + }); + } + }; + var onDecadeChange = function onDecadeChange2(diff) { + var newDate = generateConfig2.addYear(viewDate, diff * 10); + onViewDateChange(newDate); + onPanelChange(null, newDate); + }; + return /* @__PURE__ */ React90.createElement("div", { + className: panelPrefixCls + }, /* @__PURE__ */ React90.createElement(YearHeader_default, _extends({}, props, { + prefixCls, + onPrevDecade: function onPrevDecade() { + onDecadeChange(-1); + }, + onNextDecade: function onNextDecade() { + onDecadeChange(1); + }, + onDecadeClick: function onDecadeClick() { + onPanelChange("decade", viewDate); + } + })), /* @__PURE__ */ React90.createElement(YearBody_default, _extends({}, props, { + prefixCls, + onSelect: function onSelect(date3) { + onPanelChange(sourceMode === "date" ? "date" : "month", date3); + _onSelect(date3, "mouse"); + } + }))); + } + var YearPanel_default = YearPanel; + + // node_modules/rc-picker/es/utils/getExtraFooter.js + var React91 = __toModule(require_react()); + function getExtraFooter(prefixCls, mode, renderExtraFooter) { + if (!renderExtraFooter) { + return null; + } + return /* @__PURE__ */ React91.createElement("div", { + className: "".concat(prefixCls, "-footer-extra") + }, renderExtraFooter(mode)); + } + + // node_modules/rc-picker/es/utils/getRanges.js + var React92 = __toModule(require_react()); + function getRanges(_ref) { + var prefixCls = _ref.prefixCls, _ref$rangeList = _ref.rangeList, rangeList = _ref$rangeList === void 0 ? [] : _ref$rangeList, _ref$components = _ref.components, components = _ref$components === void 0 ? {} : _ref$components, needConfirmButton = _ref.needConfirmButton, onNow = _ref.onNow, onOk = _ref.onOk, okDisabled = _ref.okDisabled, showNow = _ref.showNow, locale4 = _ref.locale; + var presetNode; + var okNode; + if (rangeList.length) { + var Item = components.rangeItem || "span"; + presetNode = /* @__PURE__ */ React92.createElement(React92.Fragment, null, rangeList.map(function(_ref2) { + var label = _ref2.label, onClick = _ref2.onClick, onMouseEnter = _ref2.onMouseEnter, onMouseLeave = _ref2.onMouseLeave; + return /* @__PURE__ */ React92.createElement("li", { + key: label, + className: "".concat(prefixCls, "-preset") + }, /* @__PURE__ */ React92.createElement(Item, { + onClick, + onMouseEnter, + onMouseLeave + }, label)); + })); + } + if (needConfirmButton) { + var Button3 = components.button || "button"; + if (onNow && !presetNode && showNow !== false) { + presetNode = /* @__PURE__ */ React92.createElement("li", { + className: "".concat(prefixCls, "-now") + }, /* @__PURE__ */ React92.createElement("a", { + className: "".concat(prefixCls, "-now-btn"), + onClick: onNow + }, locale4.now)); + } + okNode = needConfirmButton && /* @__PURE__ */ React92.createElement("li", { + className: "".concat(prefixCls, "-ok") + }, /* @__PURE__ */ React92.createElement(Button3, { + disabled: okDisabled, + onClick: onOk + }, locale4.ok)); + } + if (!presetNode && !okNode) { + return null; + } + return /* @__PURE__ */ React92.createElement("ul", { + className: "".concat(prefixCls, "-ranges") + }, presetNode, okNode); + } + + // node_modules/rc-picker/es/PickerPanel.js + function PickerPanel(props) { + var _classNames; + var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-picker" : _props$prefixCls, className = props.className, style2 = props.style, locale4 = props.locale, generateConfig2 = props.generateConfig, value = props.value, defaultValue = props.defaultValue, pickerValue = props.pickerValue, defaultPickerValue = props.defaultPickerValue, disabledDate = props.disabledDate, mode = props.mode, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, _props$tabIndex = props.tabIndex, tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex, showNow = props.showNow, showTime = props.showTime, showToday = props.showToday, renderExtraFooter = props.renderExtraFooter, hideHeader = props.hideHeader, onSelect = props.onSelect, onChange = props.onChange, onPanelChange = props.onPanelChange, onMouseDown = props.onMouseDown, onPickerValueChange = props.onPickerValueChange, _onOk = props.onOk, components = props.components, direction = props.direction, _props$hourStep = props.hourStep, hourStep = _props$hourStep === void 0 ? 1 : _props$hourStep, _props$minuteStep = props.minuteStep, minuteStep = _props$minuteStep === void 0 ? 1 : _props$minuteStep, _props$secondStep = props.secondStep, secondStep = _props$secondStep === void 0 ? 1 : _props$secondStep; + var needConfirmButton = picker === "date" && !!showTime || picker === "time"; + var isHourStepValid = 24 % hourStep === 0; + var isMinuteStepValid = 60 % minuteStep === 0; + var isSecondStepValid = 60 % secondStep === 0; + if (true) { + warning_default(!value || generateConfig2.isValidate(value), "Invalidate date pass to `value`."); + warning_default(!value || generateConfig2.isValidate(value), "Invalidate date pass to `defaultValue`."); + warning_default(isHourStepValid, "`hourStep` ".concat(hourStep, " is invalid. It should be a factor of 24.")); + warning_default(isMinuteStepValid, "`minuteStep` ".concat(minuteStep, " is invalid. It should be a factor of 60.")); + warning_default(isSecondStepValid, "`secondStep` ".concat(secondStep, " is invalid. It should be a factor of 60.")); + } + var panelContext = React93.useContext(PanelContext_default); + var operationRef = panelContext.operationRef, panelDivRef = panelContext.panelRef, onContextSelect = panelContext.onSelect, hideRanges = panelContext.hideRanges, defaultOpenValue = panelContext.defaultOpenValue; + var _React$useContext = React93.useContext(RangeContext_default), inRange = _React$useContext.inRange, panelPosition = _React$useContext.panelPosition, rangedValue = _React$useContext.rangedValue, hoverRangedValue = _React$useContext.hoverRangedValue; + var panelRef = React93.useRef({}); + var initRef = React93.useRef(true); + var _useMergedState = useControlledState(null, { + value, + defaultValue, + postState: function postState(val) { + if (!val && defaultOpenValue && picker === "time") { + return defaultOpenValue; + } + return val; + } + }), _useMergedState2 = _slicedToArray(_useMergedState, 2), mergedValue = _useMergedState2[0], setInnerValue = _useMergedState2[1]; + var _useMergedState3 = useControlledState(null, { + value: pickerValue, + defaultValue: defaultPickerValue || mergedValue, + postState: function postState(date3) { + var now3 = generateConfig2.getNow(); + if (!date3) + return now3; + if (!mergedValue && showTime) { + if (_typeof(showTime) === "object") { + return setDateTime(generateConfig2, date3, showTime.defaultValue || now3); + } + if (defaultValue) { + return setDateTime(generateConfig2, date3, defaultValue); + } + return setDateTime(generateConfig2, date3, now3); + } + return date3; + } + }), _useMergedState4 = _slicedToArray(_useMergedState3, 2), viewDate = _useMergedState4[0], setInnerViewDate = _useMergedState4[1]; + var setViewDate = function setViewDate2(date3) { + setInnerViewDate(date3); + if (onPickerValueChange) { + onPickerValueChange(date3); + } + }; + var getInternalNextMode = function getInternalNextMode2(nextMode) { + var getNextMode = PickerModeMap[picker]; + if (getNextMode) { + return getNextMode(nextMode); + } + return nextMode; + }; + var _useMergedState5 = useControlledState(function() { + if (picker === "time") { + return "time"; + } + return getInternalNextMode("date"); + }, { + value: mode + }), _useMergedState6 = _slicedToArray(_useMergedState5, 2), mergedMode = _useMergedState6[0], setInnerMode = _useMergedState6[1]; + React93.useEffect(function() { + setInnerMode(picker); + }, [picker]); + var _React$useState = React93.useState(function() { + return mergedMode; + }), _React$useState2 = _slicedToArray(_React$useState, 2), sourceMode = _React$useState2[0], setSourceMode = _React$useState2[1]; + var onInternalPanelChange = function onInternalPanelChange2(newMode, viewValue) { + var nextMode = getInternalNextMode(newMode || mergedMode); + setSourceMode(mergedMode); + setInnerMode(nextMode); + if (onPanelChange && (mergedMode !== nextMode || isEqual(generateConfig2, viewDate, viewDate))) { + onPanelChange(viewValue, nextMode); + } + }; + var triggerSelect = function triggerSelect2(date3, type2) { + var forceTriggerSelect = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; + if (mergedMode === picker || forceTriggerSelect) { + setInnerValue(date3); + if (onSelect) { + onSelect(date3); + } + if (onContextSelect) { + onContextSelect(date3, type2); + } + if (onChange && !isEqual(generateConfig2, date3, mergedValue) && !(disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date3))) { + onChange(date3); + } + } + }; + var onInternalKeyDown = function onInternalKeyDown2(e) { + if (panelRef.current && panelRef.current.onKeyDown) { + if ([KeyCode_default.LEFT, KeyCode_default.RIGHT, KeyCode_default.UP, KeyCode_default.DOWN, KeyCode_default.PAGE_UP, KeyCode_default.PAGE_DOWN, KeyCode_default.ENTER].includes(e.which)) { + e.preventDefault(); + } + return panelRef.current.onKeyDown(e); + } + { + warning_default(false, "Panel not correct handle keyDown event. Please help to fire issue about this."); + return false; + } + }; + var onInternalBlur = function onInternalBlur2(e) { + if (panelRef.current && panelRef.current.onBlur) { + panelRef.current.onBlur(e); + } + }; + if (operationRef && panelPosition !== "right") { + operationRef.current = { + onKeyDown: onInternalKeyDown, + onClose: function onClose2() { + if (panelRef.current && panelRef.current.onClose) { + panelRef.current.onClose(); + } + } + }; + } + React93.useEffect(function() { + if (value && !initRef.current) { + setInnerViewDate(value); + } + }, [value]); + React93.useEffect(function() { + initRef.current = false; + }, []); + var panelNode; + var pickerProps = _objectSpread2(_objectSpread2({}, props), {}, { + operationRef: panelRef, + prefixCls, + viewDate, + value: mergedValue, + onViewDateChange: setViewDate, + sourceMode, + onPanelChange: onInternalPanelChange, + disabledDate + }); + delete pickerProps.onChange; + delete pickerProps.onSelect; + switch (mergedMode) { + case "decade": + panelNode = /* @__PURE__ */ React93.createElement(DecadePanel_default, _extends({}, pickerProps, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + break; + case "year": + panelNode = /* @__PURE__ */ React93.createElement(YearPanel_default, _extends({}, pickerProps, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + break; + case "month": + panelNode = /* @__PURE__ */ React93.createElement(MonthPanel_default, _extends({}, pickerProps, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + break; + case "quarter": + panelNode = /* @__PURE__ */ React93.createElement(QuarterPanel_default, _extends({}, pickerProps, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + break; + case "week": + panelNode = /* @__PURE__ */ React93.createElement(WeekPanel_default, _extends({}, pickerProps, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + break; + case "time": + delete pickerProps.showTime; + panelNode = /* @__PURE__ */ React93.createElement(TimePanel_default, _extends({}, pickerProps, _typeof(showTime) === "object" ? showTime : null, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + break; + default: + if (showTime) { + panelNode = /* @__PURE__ */ React93.createElement(DatetimePanel_default, _extends({}, pickerProps, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + } else { + panelNode = /* @__PURE__ */ React93.createElement(DatePanel_default, _extends({}, pickerProps, { + onSelect: function onSelect2(date3, type2) { + setViewDate(date3); + triggerSelect(date3, type2); + } + })); + } + } + var extraFooter; + var rangesNode; + var onNow = function onNow2() { + var now3 = generateConfig2.getNow(); + var lowerBoundTime = getLowerBoundTime(generateConfig2.getHour(now3), generateConfig2.getMinute(now3), generateConfig2.getSecond(now3), isHourStepValid ? hourStep : 1, isMinuteStepValid ? minuteStep : 1, isSecondStepValid ? secondStep : 1); + var adjustedNow = setTime(generateConfig2, now3, lowerBoundTime[0], lowerBoundTime[1], lowerBoundTime[2]); + triggerSelect(adjustedNow, "submit"); + }; + if (!hideRanges) { + extraFooter = getExtraFooter(prefixCls, mergedMode, renderExtraFooter); + rangesNode = getRanges({ + prefixCls, + components, + needConfirmButton, + okDisabled: !mergedValue || disabledDate && disabledDate(mergedValue), + locale: locale4, + showNow, + onNow: needConfirmButton && onNow, + onOk: function onOk() { + if (mergedValue) { + triggerSelect(mergedValue, "submit", true); + if (_onOk) { + _onOk(mergedValue); + } + } + } + }); + } + var todayNode; + if (showToday && mergedMode === "date" && picker === "date" && !showTime) { + var now2 = generateConfig2.getNow(); + var todayCls = "".concat(prefixCls, "-today-btn"); + var disabled = disabledDate && disabledDate(now2); + todayNode = /* @__PURE__ */ React93.createElement("a", { + className: (0, import_classnames20.default)(todayCls, disabled && "".concat(todayCls, "-disabled")), + "aria-disabled": disabled, + onClick: function onClick() { + if (!disabled) { + triggerSelect(now2, "mouse", true); + } + } + }, locale4.today); + } + return /* @__PURE__ */ React93.createElement(PanelContext_default.Provider, { + value: _objectSpread2(_objectSpread2({}, panelContext), {}, { + mode: mergedMode, + hideHeader: "hideHeader" in props ? hideHeader : panelContext.hideHeader, + hidePrevBtn: inRange && panelPosition === "right", + hideNextBtn: inRange && panelPosition === "left" + }) + }, /* @__PURE__ */ React93.createElement("div", { + tabIndex, + className: (0, import_classnames20.default)("".concat(prefixCls, "-panel"), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-panel-has-range"), rangedValue && rangedValue[0] && rangedValue[1]), _defineProperty(_classNames, "".concat(prefixCls, "-panel-has-range-hover"), hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1]), _defineProperty(_classNames, "".concat(prefixCls, "-panel-rtl"), direction === "rtl"), _classNames)), + style: style2, + onKeyDown: onInternalKeyDown, + onBlur: onInternalBlur, + onMouseDown, + ref: panelDivRef + }, panelNode, extraFooter || rangesNode || todayNode ? /* @__PURE__ */ React93.createElement("div", { + className: "".concat(prefixCls, "-footer") + }, extraFooter, rangesNode, todayNode) : null)); + } + var PickerPanel_default = PickerPanel; + + // node_modules/rc-picker/es/PickerTrigger.js + var React94 = __toModule(require_react()); + var import_classnames21 = __toModule(require_classnames()); + var BUILT_IN_PLACEMENTS = { + bottomLeft: { + points: ["tl", "bl"], + offset: [0, 4], + overflow: { + adjustX: 1, + adjustY: 1 + } + }, + bottomRight: { + points: ["tr", "br"], + offset: [0, 4], + overflow: { + adjustX: 1, + adjustY: 1 + } + }, + topLeft: { + points: ["bl", "tl"], + offset: [0, -4], + overflow: { + adjustX: 0, + adjustY: 1 + } + }, + topRight: { + points: ["br", "tr"], + offset: [0, -4], + overflow: { + adjustX: 0, + adjustY: 1 + } + } + }; + function PickerTrigger(_ref) { + var _classNames; + var prefixCls = _ref.prefixCls, popupElement = _ref.popupElement, popupStyle = _ref.popupStyle, visible = _ref.visible, dropdownClassName = _ref.dropdownClassName, dropdownAlign = _ref.dropdownAlign, transitionName2 = _ref.transitionName, getPopupContainer = _ref.getPopupContainer, children = _ref.children, range2 = _ref.range, popupPlacement = _ref.popupPlacement, direction = _ref.direction; + var dropdownPrefixCls = "".concat(prefixCls, "-dropdown"); + var getPopupPlacement = function getPopupPlacement2() { + if (popupPlacement !== void 0) { + return popupPlacement; + } + return direction === "rtl" ? "bottomRight" : "bottomLeft"; + }; + return /* @__PURE__ */ React94.createElement(es_default4, { + showAction: [], + hideAction: [], + popupPlacement: getPopupPlacement(), + builtinPlacements: BUILT_IN_PLACEMENTS, + prefixCls: dropdownPrefixCls, + popupTransitionName: transitionName2, + popup: popupElement, + popupAlign: dropdownAlign, + popupVisible: visible, + popupClassName: (0, import_classnames21.default)(dropdownClassName, (_classNames = {}, _defineProperty(_classNames, "".concat(dropdownPrefixCls, "-range"), range2), _defineProperty(_classNames, "".concat(dropdownPrefixCls, "-rtl"), direction === "rtl"), _classNames)), + popupStyle, + getPopupContainer + }, children); + } + var PickerTrigger_default = PickerTrigger; + + // node_modules/rc-picker/es/hooks/usePickerInput.js + var import_react21 = __toModule(require_react()); + function usePickerInput(_ref) { + var open = _ref.open, value = _ref.value, isClickOutside = _ref.isClickOutside, triggerOpen = _ref.triggerOpen, forwardKeyDown = _ref.forwardKeyDown, _onKeyDown = _ref.onKeyDown, blurToCancel = _ref.blurToCancel, onSubmit = _ref.onSubmit, onCancel = _ref.onCancel, _onFocus = _ref.onFocus, _onBlur = _ref.onBlur; + var _useState = (0, import_react21.useState)(false), _useState2 = _slicedToArray(_useState, 2), typing = _useState2[0], setTyping = _useState2[1]; + var _useState3 = (0, import_react21.useState)(false), _useState4 = _slicedToArray(_useState3, 2), focused = _useState4[0], setFocused = _useState4[1]; + var preventBlurRef = (0, import_react21.useRef)(false); + var valueChangedRef = (0, import_react21.useRef)(false); + var preventDefaultRef = (0, import_react21.useRef)(false); + var inputProps = { + onMouseDown: function onMouseDown() { + setTyping(true); + triggerOpen(true); + }, + onKeyDown: function onKeyDown(e) { + var preventDefault = function preventDefault2() { + preventDefaultRef.current = true; + }; + _onKeyDown(e, preventDefault); + if (preventDefaultRef.current) + return; + switch (e.which) { + case KeyCode_default.ENTER: { + if (!open) { + triggerOpen(true); + } else if (onSubmit() !== false) { + setTyping(true); + } + e.preventDefault(); + return; + } + case KeyCode_default.TAB: { + if (typing && open && !e.shiftKey) { + setTyping(false); + e.preventDefault(); + } else if (!typing && open) { + if (!forwardKeyDown(e) && e.shiftKey) { + setTyping(true); + e.preventDefault(); + } + } + return; + } + case KeyCode_default.ESC: { + setTyping(true); + onCancel(); + return; + } + } + if (!open && ![KeyCode_default.SHIFT].includes(e.which)) { + triggerOpen(true); + } else if (!typing) { + forwardKeyDown(e); + } + }, + onFocus: function onFocus(e) { + setTyping(true); + setFocused(true); + if (_onFocus) { + _onFocus(e); + } + }, + onBlur: function onBlur(e) { + if (preventBlurRef.current || !isClickOutside(document.activeElement)) { + preventBlurRef.current = false; + return; + } + if (blurToCancel) { + setTimeout(function() { + var _document = document, activeElement = _document.activeElement; + while (activeElement && activeElement.shadowRoot) { + activeElement = activeElement.shadowRoot.activeElement; + } + if (isClickOutside(activeElement)) { + onCancel(); + } + }, 0); + } else if (open) { + triggerOpen(false); + if (valueChangedRef.current) { + onSubmit(); + } + } + setFocused(false); + if (_onBlur) { + _onBlur(e); + } + } + }; + (0, import_react21.useEffect)(function() { + valueChangedRef.current = false; + }, [open]); + (0, import_react21.useEffect)(function() { + valueChangedRef.current = true; + }, [value]); + (0, import_react21.useEffect)(function() { + return addGlobalMouseDownEvent(function(e) { + var target = getTargetFromEvent(e); + if (open) { + var clickedOutside = isClickOutside(target); + if (!clickedOutside) { + preventBlurRef.current = true; + requestAnimationFrame(function() { + preventBlurRef.current = false; + }); + } else if (!focused || clickedOutside) { + triggerOpen(false); + } + } + }); + }); + return [inputProps, { + focused, + typing + }]; + } + + // node_modules/rc-picker/es/hooks/useTextValueMapping.js + var React95 = __toModule(require_react()); + function useTextValueMapping(_ref) { + var valueTexts = _ref.valueTexts, onTextChange = _ref.onTextChange; + var _React$useState = React95.useState(""), _React$useState2 = _slicedToArray(_React$useState, 2), text = _React$useState2[0], setInnerText = _React$useState2[1]; + var valueTextsRef = React95.useRef([]); + valueTextsRef.current = valueTexts; + function triggerTextChange(value) { + setInnerText(value); + onTextChange(value); + } + function resetText() { + setInnerText(valueTextsRef.current[0]); + } + React95.useEffect(function() { + if (valueTexts.every(function(valText) { + return valText !== text; + })) { + resetText(); + } + }, [valueTexts.join("||")]); + return [text, triggerTextChange, resetText]; + } + + // node_modules/rc-picker/es/hooks/useValueTexts.js + var import_shallowequal = __toModule(require_shallowequal()); + function useValueTexts(value, _ref) { + var formatList = _ref.formatList, generateConfig2 = _ref.generateConfig, locale4 = _ref.locale; + return useMemo2(function() { + if (!value) { + return [[""], ""]; + } + var firstValueText = ""; + var fullValueTexts = []; + for (var i = 0; i < formatList.length; i += 1) { + var format3 = formatList[i]; + var formatStr = formatValue(value, { + generateConfig: generateConfig2, + locale: locale4, + format: format3 + }); + fullValueTexts.push(formatStr); + if (i === 0) { + firstValueText = formatStr; + } + } + return [fullValueTexts, firstValueText]; + }, [value, formatList], function(prev, next) { + return prev[0] !== next[0] || !(0, import_shallowequal.default)(prev[1], next[1]); + }); + } + + // node_modules/rc-picker/es/hooks/useHoverValue.js + var import_react22 = __toModule(require_react()); + function useHoverValue(valueText, _ref) { + var formatList = _ref.formatList, generateConfig2 = _ref.generateConfig, locale4 = _ref.locale; + var _useState = (0, import_react22.useState)(null), _useState2 = _slicedToArray(_useState, 2), value = _useState2[0], internalSetValue = _useState2[1]; + var raf3 = (0, import_react22.useRef)(null); + function setValue2(val) { + var immediately = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + cancelAnimationFrame(raf3.current); + if (immediately) { + internalSetValue(val); + return; + } + raf3.current = requestAnimationFrame(function() { + internalSetValue(val); + }); + } + var _useValueTexts = useValueTexts(value, { + formatList, + generateConfig: generateConfig2, + locale: locale4 + }), _useValueTexts2 = _slicedToArray(_useValueTexts, 2), firstText = _useValueTexts2[1]; + function onEnter(date3) { + setValue2(date3); + } + function onLeave() { + var immediately = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + setValue2(null, immediately); + } + (0, import_react22.useEffect)(function() { + onLeave(true); + }, [valueText]); + (0, import_react22.useEffect)(function() { + return function() { + return cancelAnimationFrame(raf3.current); + }; + }, []); + return [firstText, onEnter, onLeave]; + } + + // node_modules/rc-picker/es/Picker.js + function InnerPicker(props) { + var _classNames2; + var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-picker" : _props$prefixCls, id2 = props.id, tabIndex = props.tabIndex, style2 = props.style, className = props.className, dropdownClassName = props.dropdownClassName, dropdownAlign = props.dropdownAlign, popupStyle = props.popupStyle, transitionName2 = props.transitionName, generateConfig2 = props.generateConfig, locale4 = props.locale, inputReadOnly = props.inputReadOnly, allowClear = props.allowClear, autoFocus = props.autoFocus, showTime = props.showTime, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, format3 = props.format, use12Hours = props.use12Hours, value = props.value, defaultValue = props.defaultValue, open = props.open, defaultOpen = props.defaultOpen, defaultOpenValue = props.defaultOpenValue, suffixIcon = props.suffixIcon, clearIcon = props.clearIcon, disabled = props.disabled, disabledDate = props.disabledDate, placeholder = props.placeholder, getPopupContainer = props.getPopupContainer, pickerRef = props.pickerRef, panelRender = props.panelRender, onChange = props.onChange, onOpenChange = props.onOpenChange, onFocus = props.onFocus, onBlur = props.onBlur, onMouseDown = props.onMouseDown, onMouseUp = props.onMouseUp, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, onContextMenu = props.onContextMenu, onClick = props.onClick, _onKeyDown = props.onKeyDown, _onSelect = props.onSelect, direction = props.direction, _props$autoComplete = props.autoComplete, autoComplete = _props$autoComplete === void 0 ? "off" : _props$autoComplete; + var inputRef = React96.useRef(null); + var needConfirmButton = picker === "date" && !!showTime || picker === "time"; + var formatList = toArray3(getDefaultFormat(format3, picker, showTime, use12Hours)); + var panelDivRef = React96.useRef(null); + var inputDivRef = React96.useRef(null); + var _useMergedState = useControlledState(null, { + value, + defaultValue + }), _useMergedState2 = _slicedToArray(_useMergedState, 2), mergedValue = _useMergedState2[0], setInnerValue = _useMergedState2[1]; + var _React$useState = React96.useState(mergedValue), _React$useState2 = _slicedToArray(_React$useState, 2), selectedValue = _React$useState2[0], setSelectedValue = _React$useState2[1]; + var operationRef = React96.useRef(null); + var _useMergedState3 = useControlledState(false, { + value: open, + defaultValue: defaultOpen, + postState: function postState(postOpen) { + return disabled ? false : postOpen; + }, + onChange: function onChange2(newOpen) { + if (onOpenChange) { + onOpenChange(newOpen); + } + if (!newOpen && operationRef.current && operationRef.current.onClose) { + operationRef.current.onClose(); + } + } + }), _useMergedState4 = _slicedToArray(_useMergedState3, 2), mergedOpen = _useMergedState4[0], triggerInnerOpen = _useMergedState4[1]; + var _useValueTexts = useValueTexts(selectedValue, { + formatList, + generateConfig: generateConfig2, + locale: locale4 + }), _useValueTexts2 = _slicedToArray(_useValueTexts, 2), valueTexts = _useValueTexts2[0], firstValueText = _useValueTexts2[1]; + var _useTextValueMapping = useTextValueMapping({ + valueTexts, + onTextChange: function onTextChange(newText) { + var inputDate = parseValue(newText, { + locale: locale4, + formatList, + generateConfig: generateConfig2 + }); + if (inputDate && (!disabledDate || !disabledDate(inputDate))) { + setSelectedValue(inputDate); + } + } + }), _useTextValueMapping2 = _slicedToArray(_useTextValueMapping, 3), text = _useTextValueMapping2[0], triggerTextChange = _useTextValueMapping2[1], resetText = _useTextValueMapping2[2]; + var triggerChange = function triggerChange2(newValue) { + setSelectedValue(newValue); + setInnerValue(newValue); + if (onChange && !isEqual(generateConfig2, mergedValue, newValue)) { + onChange(newValue, newValue ? formatValue(newValue, { + generateConfig: generateConfig2, + locale: locale4, + format: formatList[0] + }) : ""); + } + }; + var triggerOpen = function triggerOpen2(newOpen) { + if (disabled && newOpen) { + return; + } + triggerInnerOpen(newOpen); + }; + var forwardKeyDown = function forwardKeyDown2(e) { + if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) { + return operationRef.current.onKeyDown(e); + } + { + warning_default(false, "Picker not correct forward KeyDown operation. Please help to fire issue about this."); + return false; + } + }; + var onInternalMouseUp = function onInternalMouseUp2() { + if (onMouseUp) { + onMouseUp.apply(void 0, arguments); + } + if (inputRef.current) { + inputRef.current.focus(); + triggerOpen(true); + } + }; + var _usePickerInput = usePickerInput({ + blurToCancel: needConfirmButton, + open: mergedOpen, + value: text, + triggerOpen, + forwardKeyDown, + isClickOutside: function isClickOutside(target) { + return !elementsContains([panelDivRef.current, inputDivRef.current], target); + }, + onSubmit: function onSubmit() { + if (disabledDate && disabledDate(selectedValue)) { + return false; + } + triggerChange(selectedValue); + triggerOpen(false); + resetText(); + return true; + }, + onCancel: function onCancel() { + triggerOpen(false); + setSelectedValue(mergedValue); + resetText(); + }, + onKeyDown: function onKeyDown(e, preventDefault) { + _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault); + }, + onFocus, + onBlur + }), _usePickerInput2 = _slicedToArray(_usePickerInput, 2), inputProps = _usePickerInput2[0], _usePickerInput2$ = _usePickerInput2[1], focused = _usePickerInput2$.focused, typing = _usePickerInput2$.typing; + React96.useEffect(function() { + if (!mergedOpen) { + setSelectedValue(mergedValue); + if (!valueTexts.length || valueTexts[0] === "") { + triggerTextChange(""); + } else if (firstValueText !== text) { + resetText(); + } + } + }, [mergedOpen, valueTexts]); + React96.useEffect(function() { + if (!mergedOpen) { + resetText(); + } + }, [picker]); + React96.useEffect(function() { + setSelectedValue(mergedValue); + }, [mergedValue]); + if (pickerRef) { + pickerRef.current = { + focus: function focus() { + if (inputRef.current) { + inputRef.current.focus(); + } + }, + blur: function blur() { + if (inputRef.current) { + inputRef.current.blur(); + } + } + }; + } + var _useHoverValue = useHoverValue(text, { + formatList, + generateConfig: generateConfig2, + locale: locale4 + }), _useHoverValue2 = _slicedToArray(_useHoverValue, 3), hoverValue = _useHoverValue2[0], onEnter = _useHoverValue2[1], onLeave = _useHoverValue2[2]; + var panelProps = _objectSpread2(_objectSpread2({}, props), {}, { + className: void 0, + style: void 0, + pickerValue: void 0, + onPickerValueChange: void 0, + onChange: null + }); + var panelNode = /* @__PURE__ */ React96.createElement(PickerPanel_default, _extends({}, panelProps, { + generateConfig: generateConfig2, + className: (0, import_classnames22.default)(_defineProperty({}, "".concat(prefixCls, "-panel-focused"), !typing)), + value: selectedValue, + locale: locale4, + tabIndex: -1, + onSelect: function onSelect(date3) { + _onSelect === null || _onSelect === void 0 ? void 0 : _onSelect(date3); + setSelectedValue(date3); + }, + direction, + onPanelChange: function onPanelChange(viewDate, mode) { + var onPanelChange2 = props.onPanelChange; + onLeave(true); + onPanelChange2 === null || onPanelChange2 === void 0 ? void 0 : onPanelChange2(viewDate, mode); + } + })); + if (panelRender) { + panelNode = panelRender(panelNode); + } + var panel = /* @__PURE__ */ React96.createElement("div", { + className: "".concat(prefixCls, "-panel-container"), + onMouseDown: function onMouseDown2(e) { + e.preventDefault(); + } + }, panelNode); + var suffixNode; + if (suffixIcon) { + suffixNode = /* @__PURE__ */ React96.createElement("span", { + className: "".concat(prefixCls, "-suffix") + }, suffixIcon); + } + var clearNode; + if (allowClear && mergedValue && !disabled) { + clearNode = /* @__PURE__ */ React96.createElement("span", { + onMouseDown: function onMouseDown2(e) { + e.preventDefault(); + e.stopPropagation(); + }, + onMouseUp: function onMouseUp2(e) { + e.preventDefault(); + e.stopPropagation(); + triggerChange(null); + triggerOpen(false); + }, + className: "".concat(prefixCls, "-clear") + }, clearIcon || /* @__PURE__ */ React96.createElement("span", { + className: "".concat(prefixCls, "-clear-btn") + })); + } + if (true) { + warning_default(!defaultOpenValue, "`defaultOpenValue` may confuse user for the current value status. Please use `defaultValue` instead."); + } + var onContextSelect = function onContextSelect2(date3, type2) { + if (type2 === "submit" || type2 !== "key" && !needConfirmButton) { + triggerChange(date3); + triggerOpen(false); + } + }; + var popupPlacement = direction === "rtl" ? "bottomRight" : "bottomLeft"; + return /* @__PURE__ */ React96.createElement(PanelContext_default.Provider, { + value: { + operationRef, + hideHeader: picker === "time", + panelRef: panelDivRef, + onSelect: onContextSelect, + open: mergedOpen, + defaultOpenValue, + onDateMouseEnter: onEnter, + onDateMouseLeave: onLeave + } + }, /* @__PURE__ */ React96.createElement(PickerTrigger_default, { + visible: mergedOpen, + popupElement: panel, + popupStyle, + prefixCls, + dropdownClassName, + dropdownAlign, + getPopupContainer, + transitionName: transitionName2, + popupPlacement, + direction + }, /* @__PURE__ */ React96.createElement("div", { + className: (0, import_classnames22.default)(prefixCls, className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames2, "".concat(prefixCls, "-focused"), focused), _defineProperty(_classNames2, "".concat(prefixCls, "-rtl"), direction === "rtl"), _classNames2)), + style: style2, + onMouseDown, + onMouseUp: onInternalMouseUp, + onMouseEnter, + onMouseLeave, + onContextMenu, + onClick + }, /* @__PURE__ */ React96.createElement("div", { + className: (0, import_classnames22.default)("".concat(prefixCls, "-input"), _defineProperty({}, "".concat(prefixCls, "-input-placeholder"), !!hoverValue)), + ref: inputDivRef + }, /* @__PURE__ */ React96.createElement("input", _extends({ + id: id2, + tabIndex, + disabled, + readOnly: inputReadOnly || typeof formatList[0] === "function" || !typing, + value: hoverValue || text, + onChange: function onChange2(e) { + triggerTextChange(e.target.value); + }, + autoFocus, + placeholder, + ref: inputRef, + title: text + }, inputProps, { + size: getInputSize(picker, formatList[0], generateConfig2) + }, getDataOrAriaProps(props), { + autoComplete + })), suffixNode, clearNode)))); + } + var Picker = /* @__PURE__ */ function(_React$Component) { + _inherits(Picker2, _React$Component); + var _super = _createSuper(Picker2); + function Picker2() { + var _this; + _classCallCheck(this, Picker2); + _this = _super.apply(this, arguments); + _this.pickerRef = /* @__PURE__ */ React96.createRef(); + _this.focus = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.focus(); + } + }; + _this.blur = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.blur(); + } + }; + return _this; + } + _createClass(Picker2, [{ + key: "render", + value: function render() { + return /* @__PURE__ */ React96.createElement(InnerPicker, _extends({}, this.props, { + pickerRef: this.pickerRef + })); + } + }]); + return Picker2; + }(React96.Component); + var Picker_default = Picker; + + // node_modules/rc-picker/es/RangePicker.js + var React99 = __toModule(require_react()); + var import_react23 = __toModule(require_react()); + var import_classnames23 = __toModule(require_classnames()); + + // node_modules/rc-picker/es/hooks/useRangeDisabled.js + var React97 = __toModule(require_react()); + function useRangeDisabled(_ref, disabledStart, disabledEnd) { + var picker = _ref.picker, locale4 = _ref.locale, selectedValue = _ref.selectedValue, disabledDate = _ref.disabledDate, disabled = _ref.disabled, generateConfig2 = _ref.generateConfig; + var startDate = getValue3(selectedValue, 0); + var endDate = getValue3(selectedValue, 1); + function weekFirstDate(date3) { + return generateConfig2.locale.getWeekFirstDate(locale4.locale, date3); + } + function monthNumber(date3) { + var year = generateConfig2.getYear(date3); + var month = generateConfig2.getMonth(date3); + return year * 100 + month; + } + function quarterNumber(date3) { + var year = generateConfig2.getYear(date3); + var quarter = getQuarter(generateConfig2, date3); + return year * 10 + quarter; + } + var disabledStartDate = React97.useCallback(function(date3) { + if (disabledDate && disabledDate(date3)) { + return true; + } + if (disabled[1] && endDate) { + return !isSameDate(generateConfig2, date3, endDate) && generateConfig2.isAfter(date3, endDate); + } + if (disabledStart && endDate) { + switch (picker) { + case "quarter": + return quarterNumber(date3) > quarterNumber(endDate); + case "month": + return monthNumber(date3) > monthNumber(endDate); + case "week": + return weekFirstDate(date3) > weekFirstDate(endDate); + default: + return !isSameDate(generateConfig2, date3, endDate) && generateConfig2.isAfter(date3, endDate); + } + } + return false; + }, [disabledDate, disabled[1], endDate, disabledStart]); + var disabledEndDate = React97.useCallback(function(date3) { + if (disabledDate && disabledDate(date3)) { + return true; + } + if (disabled[0] && startDate) { + return !isSameDate(generateConfig2, date3, endDate) && generateConfig2.isAfter(startDate, date3); + } + if (disabledEnd && startDate) { + switch (picker) { + case "quarter": + return quarterNumber(date3) < quarterNumber(startDate); + case "month": + return monthNumber(date3) < monthNumber(startDate); + case "week": + return weekFirstDate(date3) < weekFirstDate(startDate); + default: + return !isSameDate(generateConfig2, date3, startDate) && generateConfig2.isAfter(startDate, date3); + } + } + return false; + }, [disabledDate, disabled[0], startDate, disabledEnd]); + return [disabledStartDate, disabledEndDate]; + } + + // node_modules/rc-picker/es/hooks/useRangeViewDates.js + var React98 = __toModule(require_react()); + function getStartEndDistance(startDate, endDate, picker, generateConfig2) { + var startNext = getClosingViewDate(startDate, picker, generateConfig2, 1); + function getDistance(compareFunc) { + if (compareFunc(startDate, endDate)) { + return "same"; + } + if (compareFunc(startNext, endDate)) { + return "closing"; + } + return "far"; + } + switch (picker) { + case "year": + return getDistance(function(start, end) { + return isSameDecade(generateConfig2, start, end); + }); + case "quarter": + case "month": + return getDistance(function(start, end) { + return isSameYear(generateConfig2, start, end); + }); + default: + return getDistance(function(start, end) { + return isSameMonth(generateConfig2, start, end); + }); + } + } + function getRangeViewDate(values, index2, picker, generateConfig2) { + var startDate = getValue3(values, 0); + var endDate = getValue3(values, 1); + if (index2 === 0) { + return startDate; + } + if (startDate && endDate) { + var distance = getStartEndDistance(startDate, endDate, picker, generateConfig2); + switch (distance) { + case "same": + return startDate; + case "closing": + return startDate; + default: + return getClosingViewDate(endDate, picker, generateConfig2, -1); + } + } + return startDate; + } + function useRangeViewDates(_ref) { + var values = _ref.values, picker = _ref.picker, defaultDates = _ref.defaultDates, generateConfig2 = _ref.generateConfig; + var _React$useState = React98.useState(function() { + return [getValue3(defaultDates, 0), getValue3(defaultDates, 1)]; + }), _React$useState2 = _slicedToArray(_React$useState, 2), defaultViewDates = _React$useState2[0], setDefaultViewDates = _React$useState2[1]; + var _React$useState3 = React98.useState(null), _React$useState4 = _slicedToArray(_React$useState3, 2), viewDates = _React$useState4[0], setInternalViewDates = _React$useState4[1]; + var startDate = getValue3(values, 0); + var endDate = getValue3(values, 1); + function getViewDate(index2) { + if (defaultViewDates[index2]) { + return defaultViewDates[index2]; + } + return getValue3(viewDates, index2) || getRangeViewDate(values, index2, picker, generateConfig2) || startDate || endDate || generateConfig2.getNow(); + } + function setViewDate(viewDate, index2) { + if (viewDate) { + var newViewDates = updateValues(viewDates, viewDate, index2); + setDefaultViewDates(updateValues(defaultViewDates, null, index2) || [null, null]); + var anotherIndex = (index2 + 1) % 2; + if (!getValue3(values, anotherIndex)) { + newViewDates = updateValues(newViewDates, viewDate, anotherIndex); + } + setInternalViewDates(newViewDates); + } else if (startDate || endDate) { + setInternalViewDates(null); + } + } + return [getViewDate, setViewDate]; + } + + // node_modules/rc-picker/es/RangePicker.js + function reorderValues(values, generateConfig2) { + if (values && values[0] && values[1] && generateConfig2.isAfter(values[0], values[1])) { + return [values[1], values[0]]; + } + return values; + } + function canValueTrigger(value, index2, disabled, allowEmpty) { + if (value) { + return true; + } + if (allowEmpty && allowEmpty[index2]) { + return true; + } + if (disabled[(index2 + 1) % 2]) { + return true; + } + return false; + } + function InnerRangePicker(props) { + var _classNames2, _classNames3, _classNames4; + var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-picker" : _props$prefixCls, id2 = props.id, style2 = props.style, className = props.className, popupStyle = props.popupStyle, dropdownClassName = props.dropdownClassName, transitionName2 = props.transitionName, dropdownAlign = props.dropdownAlign, getPopupContainer = props.getPopupContainer, generateConfig2 = props.generateConfig, locale4 = props.locale, placeholder = props.placeholder, autoFocus = props.autoFocus, disabled = props.disabled, format3 = props.format, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, showTime = props.showTime, use12Hours = props.use12Hours, _props$separator = props.separator, separator = _props$separator === void 0 ? "~" : _props$separator, value = props.value, defaultValue = props.defaultValue, defaultPickerValue = props.defaultPickerValue, open = props.open, defaultOpen = props.defaultOpen, disabledDate = props.disabledDate, _disabledTime = props.disabledTime, dateRender = props.dateRender, panelRender = props.panelRender, ranges = props.ranges, allowEmpty = props.allowEmpty, allowClear = props.allowClear, suffixIcon = props.suffixIcon, clearIcon = props.clearIcon, pickerRef = props.pickerRef, inputReadOnly = props.inputReadOnly, mode = props.mode, renderExtraFooter = props.renderExtraFooter, onChange = props.onChange, onOpenChange = props.onOpenChange, onPanelChange = props.onPanelChange, onCalendarChange = props.onCalendarChange, _onFocus = props.onFocus, onBlur = props.onBlur, _onOk = props.onOk, _onKeyDown = props.onKeyDown, components = props.components, order = props.order, direction = props.direction, activePickerIndex = props.activePickerIndex, _props$autoComplete = props.autoComplete, autoComplete = _props$autoComplete === void 0 ? "off" : _props$autoComplete; + var needConfirmButton = picker === "date" && !!showTime || picker === "time"; + var openRecordsRef = (0, import_react23.useRef)({}); + var containerRef = (0, import_react23.useRef)(null); + var panelDivRef = (0, import_react23.useRef)(null); + var startInputDivRef = (0, import_react23.useRef)(null); + var endInputDivRef = (0, import_react23.useRef)(null); + var separatorRef = (0, import_react23.useRef)(null); + var startInputRef = (0, import_react23.useRef)(null); + var endInputRef = (0, import_react23.useRef)(null); + var formatList = toArray3(getDefaultFormat(format3, picker, showTime, use12Hours)); + var _useMergedState = useControlledState(0, { + value: activePickerIndex + }), _useMergedState2 = _slicedToArray(_useMergedState, 2), mergedActivePickerIndex = _useMergedState2[0], setMergedActivePickerIndex = _useMergedState2[1]; + var operationRef = (0, import_react23.useRef)(null); + var mergedDisabled = React99.useMemo(function() { + if (Array.isArray(disabled)) { + return disabled; + } + return [disabled || false, disabled || false]; + }, [disabled]); + var _useMergedState3 = useControlledState(null, { + value, + defaultValue, + postState: function postState(values) { + return picker === "time" && !order ? values : reorderValues(values, generateConfig2); + } + }), _useMergedState4 = _slicedToArray(_useMergedState3, 2), mergedValue = _useMergedState4[0], setInnerValue = _useMergedState4[1]; + var _useRangeViewDates = useRangeViewDates({ + values: mergedValue, + picker, + defaultDates: defaultPickerValue, + generateConfig: generateConfig2 + }), _useRangeViewDates2 = _slicedToArray(_useRangeViewDates, 2), getViewDate = _useRangeViewDates2[0], setViewDate = _useRangeViewDates2[1]; + var _useMergedState5 = useControlledState(mergedValue, { + postState: function postState(values) { + var postValues = values; + if (mergedDisabled[0] && mergedDisabled[1]) { + return postValues; + } + for (var i = 0; i < 2; i += 1) { + if (mergedDisabled[i] && !getValue3(postValues, i) && !getValue3(allowEmpty, i)) { + postValues = updateValues(postValues, generateConfig2.getNow(), i); + } + } + return postValues; + } + }), _useMergedState6 = _slicedToArray(_useMergedState5, 2), selectedValue = _useMergedState6[0], setSelectedValue = _useMergedState6[1]; + var _useMergedState7 = useControlledState([picker, picker], { + value: mode + }), _useMergedState8 = _slicedToArray(_useMergedState7, 2), mergedModes = _useMergedState8[0], setInnerModes = _useMergedState8[1]; + (0, import_react23.useEffect)(function() { + setInnerModes([picker, picker]); + }, [picker]); + var triggerModesChange = function triggerModesChange2(modes, values) { + setInnerModes(modes); + if (onPanelChange) { + onPanelChange(values, modes); + } + }; + var _useRangeDisabled = useRangeDisabled({ + picker, + selectedValue, + locale: locale4, + disabled: mergedDisabled, + disabledDate, + generateConfig: generateConfig2 + }, openRecordsRef.current[1], openRecordsRef.current[0]), _useRangeDisabled2 = _slicedToArray(_useRangeDisabled, 2), disabledStartDate = _useRangeDisabled2[0], disabledEndDate = _useRangeDisabled2[1]; + var _useMergedState9 = useControlledState(false, { + value: open, + defaultValue: defaultOpen, + postState: function postState(postOpen) { + return mergedDisabled[mergedActivePickerIndex] ? false : postOpen; + }, + onChange: function onChange2(newOpen) { + if (onOpenChange) { + onOpenChange(newOpen); + } + if (!newOpen && operationRef.current && operationRef.current.onClose) { + operationRef.current.onClose(); + } + } + }), _useMergedState10 = _slicedToArray(_useMergedState9, 2), mergedOpen = _useMergedState10[0], triggerInnerOpen = _useMergedState10[1]; + var startOpen = mergedOpen && mergedActivePickerIndex === 0; + var endOpen = mergedOpen && mergedActivePickerIndex === 1; + var _useState = (0, import_react23.useState)(0), _useState2 = _slicedToArray(_useState, 2), popupMinWidth = _useState2[0], setPopupMinWidth = _useState2[1]; + (0, import_react23.useEffect)(function() { + if (!mergedOpen && containerRef.current) { + setPopupMinWidth(containerRef.current.offsetWidth); + } + }, [mergedOpen]); + var triggerRef = React99.useRef(); + function _triggerOpen(newOpen, index2) { + if (newOpen) { + clearTimeout(triggerRef.current); + openRecordsRef.current[index2] = true; + setMergedActivePickerIndex(index2); + triggerInnerOpen(newOpen); + if (!mergedOpen) { + setViewDate(null, index2); + } + } else if (mergedActivePickerIndex === index2) { + triggerInnerOpen(newOpen); + var openRecords = openRecordsRef.current; + triggerRef.current = setTimeout(function() { + if (openRecords === openRecordsRef.current) { + openRecordsRef.current = {}; + } + }); + } + } + function triggerOpenAndFocus(index2) { + _triggerOpen(true, index2); + setTimeout(function() { + var inputRef = [startInputRef, endInputRef][index2]; + if (inputRef.current) { + inputRef.current.focus(); + } + }, 0); + } + function triggerChange(newValue, sourceIndex) { + var values = newValue; + var startValue = getValue3(values, 0); + var endValue = getValue3(values, 1); + if (startValue && endValue && generateConfig2.isAfter(startValue, endValue)) { + if (picker === "week" && !isSameWeek(generateConfig2, locale4.locale, startValue, endValue) || picker === "quarter" && !isSameQuarter(generateConfig2, startValue, endValue) || picker !== "week" && picker !== "quarter" && picker !== "time" && !isSameDate(generateConfig2, startValue, endValue)) { + if (sourceIndex === 0) { + values = [startValue, null]; + endValue = null; + } else { + startValue = null; + values = [null, endValue]; + } + openRecordsRef.current = _defineProperty({}, sourceIndex, true); + } else if (picker !== "time" || order !== false) { + values = reorderValues(values, generateConfig2); + } + } + setSelectedValue(values); + var startStr2 = values && values[0] ? formatValue(values[0], { + generateConfig: generateConfig2, + locale: locale4, + format: formatList[0] + }) : ""; + var endStr2 = values && values[1] ? formatValue(values[1], { + generateConfig: generateConfig2, + locale: locale4, + format: formatList[0] + }) : ""; + if (onCalendarChange) { + var info = { + range: sourceIndex === 0 ? "start" : "end" + }; + onCalendarChange(values, [startStr2, endStr2], info); + } + var canStartValueTrigger = canValueTrigger(startValue, 0, mergedDisabled, allowEmpty); + var canEndValueTrigger = canValueTrigger(endValue, 1, mergedDisabled, allowEmpty); + var canTrigger = values === null || canStartValueTrigger && canEndValueTrigger; + if (canTrigger) { + setInnerValue(values); + if (onChange && (!isEqual(generateConfig2, getValue3(mergedValue, 0), startValue) || !isEqual(generateConfig2, getValue3(mergedValue, 1), endValue))) { + onChange(values, [startStr2, endStr2]); + } + } + var nextOpenIndex = null; + if (sourceIndex === 0 && !mergedDisabled[1]) { + nextOpenIndex = 1; + } else if (sourceIndex === 1 && !mergedDisabled[0]) { + nextOpenIndex = 0; + } + if (nextOpenIndex !== null && nextOpenIndex !== mergedActivePickerIndex && (!openRecordsRef.current[nextOpenIndex] || !getValue3(values, nextOpenIndex)) && getValue3(values, sourceIndex)) { + triggerOpenAndFocus(nextOpenIndex); + } else { + _triggerOpen(false, sourceIndex); + } + } + var forwardKeyDown = function forwardKeyDown2(e) { + if (mergedOpen && operationRef.current && operationRef.current.onKeyDown) { + return operationRef.current.onKeyDown(e); + } + { + warning_default(false, "Picker not correct forward KeyDown operation. Please help to fire issue about this."); + return false; + } + }; + var sharedTextHooksProps = { + formatList, + generateConfig: generateConfig2, + locale: locale4 + }; + var _useValueTexts = useValueTexts(getValue3(selectedValue, 0), sharedTextHooksProps), _useValueTexts2 = _slicedToArray(_useValueTexts, 2), startValueTexts = _useValueTexts2[0], firstStartValueText = _useValueTexts2[1]; + var _useValueTexts3 = useValueTexts(getValue3(selectedValue, 1), sharedTextHooksProps), _useValueTexts4 = _slicedToArray(_useValueTexts3, 2), endValueTexts = _useValueTexts4[0], firstEndValueText = _useValueTexts4[1]; + var _onTextChange = function onTextChange(newText, index2) { + var inputDate = parseValue(newText, { + locale: locale4, + formatList, + generateConfig: generateConfig2 + }); + var disabledFunc = index2 === 0 ? disabledStartDate : disabledEndDate; + if (inputDate && !disabledFunc(inputDate)) { + setSelectedValue(updateValues(selectedValue, inputDate, index2)); + setViewDate(inputDate, index2); + } + }; + var _useTextValueMapping = useTextValueMapping({ + valueTexts: startValueTexts, + onTextChange: function onTextChange(newText) { + return _onTextChange(newText, 0); + } + }), _useTextValueMapping2 = _slicedToArray(_useTextValueMapping, 3), startText = _useTextValueMapping2[0], triggerStartTextChange = _useTextValueMapping2[1], resetStartText = _useTextValueMapping2[2]; + var _useTextValueMapping3 = useTextValueMapping({ + valueTexts: endValueTexts, + onTextChange: function onTextChange(newText) { + return _onTextChange(newText, 1); + } + }), _useTextValueMapping4 = _slicedToArray(_useTextValueMapping3, 3), endText = _useTextValueMapping4[0], triggerEndTextChange = _useTextValueMapping4[1], resetEndText = _useTextValueMapping4[2]; + var _useState3 = (0, import_react23.useState)(null), _useState4 = _slicedToArray(_useState3, 2), rangeHoverValue = _useState4[0], setRangeHoverValue = _useState4[1]; + var _useState5 = (0, import_react23.useState)(null), _useState6 = _slicedToArray(_useState5, 2), hoverRangedValue = _useState6[0], setHoverRangedValue = _useState6[1]; + var _useHoverValue = useHoverValue(startText, { + formatList, + generateConfig: generateConfig2, + locale: locale4 + }), _useHoverValue2 = _slicedToArray(_useHoverValue, 3), startHoverValue = _useHoverValue2[0], onStartEnter = _useHoverValue2[1], onStartLeave = _useHoverValue2[2]; + var _useHoverValue3 = useHoverValue(endText, { + formatList, + generateConfig: generateConfig2, + locale: locale4 + }), _useHoverValue4 = _slicedToArray(_useHoverValue3, 3), endHoverValue = _useHoverValue4[0], onEndEnter = _useHoverValue4[1], onEndLeave = _useHoverValue4[2]; + var onDateMouseEnter = function onDateMouseEnter2(date3) { + setHoverRangedValue(updateValues(selectedValue, date3, mergedActivePickerIndex)); + if (mergedActivePickerIndex === 0) { + onStartEnter(date3); + } else { + onEndEnter(date3); + } + }; + var onDateMouseLeave = function onDateMouseLeave2() { + setHoverRangedValue(updateValues(selectedValue, null, mergedActivePickerIndex)); + if (mergedActivePickerIndex === 0) { + onStartLeave(); + } else { + onEndLeave(); + } + }; + var getSharedInputHookProps = function getSharedInputHookProps2(index2, resetText) { + return { + blurToCancel: needConfirmButton, + forwardKeyDown, + onBlur, + isClickOutside: function isClickOutside(target) { + return !elementsContains([panelDivRef.current, startInputDivRef.current, endInputDivRef.current], target); + }, + onFocus: function onFocus(e) { + setMergedActivePickerIndex(index2); + if (_onFocus) { + _onFocus(e); + } + }, + triggerOpen: function triggerOpen(newOpen) { + _triggerOpen(newOpen, index2); + }, + onSubmit: function onSubmit() { + triggerChange(selectedValue, index2); + resetText(); + }, + onCancel: function onCancel() { + _triggerOpen(false, index2); + setSelectedValue(mergedValue); + resetText(); + } + }; + }; + var _usePickerInput = usePickerInput(_objectSpread2(_objectSpread2({}, getSharedInputHookProps(0, resetStartText)), {}, { + open: startOpen, + value: startText, + onKeyDown: function onKeyDown(e, preventDefault) { + _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault); + } + })), _usePickerInput2 = _slicedToArray(_usePickerInput, 2), startInputProps = _usePickerInput2[0], _usePickerInput2$ = _usePickerInput2[1], startFocused = _usePickerInput2$.focused, startTyping = _usePickerInput2$.typing; + var _usePickerInput3 = usePickerInput(_objectSpread2(_objectSpread2({}, getSharedInputHookProps(1, resetEndText)), {}, { + open: endOpen, + value: endText, + onKeyDown: function onKeyDown(e, preventDefault) { + _onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(e, preventDefault); + } + })), _usePickerInput4 = _slicedToArray(_usePickerInput3, 2), endInputProps = _usePickerInput4[0], _usePickerInput4$ = _usePickerInput4[1], endFocused = _usePickerInput4$.focused, endTyping = _usePickerInput4$.typing; + var onPickerClick = function onPickerClick2(e) { + if (!mergedOpen && !startInputRef.current.contains(e.target) && !endInputRef.current.contains(e.target)) { + if (!mergedDisabled[0]) { + triggerOpenAndFocus(0); + } else if (!mergedDisabled[1]) { + triggerOpenAndFocus(1); + } + } + }; + var onPickerMouseDown = function onPickerMouseDown2(e) { + if (mergedOpen && (startFocused || endFocused) && !startInputRef.current.contains(e.target) && !endInputRef.current.contains(e.target)) { + e.preventDefault(); + } + }; + var startStr = mergedValue && mergedValue[0] ? formatValue(mergedValue[0], { + locale: locale4, + format: "YYYYMMDDHHmmss", + generateConfig: generateConfig2 + }) : ""; + var endStr = mergedValue && mergedValue[1] ? formatValue(mergedValue[1], { + locale: locale4, + format: "YYYYMMDDHHmmss", + generateConfig: generateConfig2 + }) : ""; + (0, import_react23.useEffect)(function() { + if (!mergedOpen) { + setSelectedValue(mergedValue); + if (!startValueTexts.length || startValueTexts[0] === "") { + triggerStartTextChange(""); + } else if (firstStartValueText !== startText) { + resetStartText(); + } + if (!endValueTexts.length || endValueTexts[0] === "") { + triggerEndTextChange(""); + } else if (firstEndValueText !== endText) { + resetEndText(); + } + } + }, [mergedOpen, startValueTexts, endValueTexts]); + (0, import_react23.useEffect)(function() { + setSelectedValue(mergedValue); + }, [startStr, endStr]); + if (true) { + if (value && Array.isArray(disabled) && (getValue3(disabled, 0) && !getValue3(value, 0) || getValue3(disabled, 1) && !getValue3(value, 1))) { + warning_default(false, "`disabled` should not set with empty `value`. You should set `allowEmpty` or `value` instead."); + } + } + if (pickerRef) { + pickerRef.current = { + focus: function focus() { + if (startInputRef.current) { + startInputRef.current.focus(); + } + }, + blur: function blur() { + if (startInputRef.current) { + startInputRef.current.blur(); + } + if (endInputRef.current) { + endInputRef.current.blur(); + } + } + }; + } + var rangeLabels = Object.keys(ranges || {}); + var rangeList = rangeLabels.map(function(label) { + var range2 = ranges[label]; + var newValues = typeof range2 === "function" ? range2() : range2; + return { + label, + onClick: function onClick() { + triggerChange(newValues, null); + _triggerOpen(false, mergedActivePickerIndex); + }, + onMouseEnter: function onMouseEnter() { + setRangeHoverValue(newValues); + }, + onMouseLeave: function onMouseLeave() { + setRangeHoverValue(null); + } + }; + }); + function renderPanel() { + var panelPosition = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; + var panelProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var panelHoverRangedValue = null; + if (mergedOpen && hoverRangedValue && hoverRangedValue[0] && hoverRangedValue[1] && generateConfig2.isAfter(hoverRangedValue[1], hoverRangedValue[0])) { + panelHoverRangedValue = hoverRangedValue; + } + var panelShowTime = showTime; + if (showTime && _typeof(showTime) === "object" && showTime.defaultValue) { + var timeDefaultValues = showTime.defaultValue; + panelShowTime = _objectSpread2(_objectSpread2({}, showTime), {}, { + defaultValue: getValue3(timeDefaultValues, mergedActivePickerIndex) || void 0 + }); + } + var panelDateRender = null; + if (dateRender) { + panelDateRender = function panelDateRender2(date3, today) { + return dateRender(date3, today, { + range: mergedActivePickerIndex ? "end" : "start" + }); + }; + } + return /* @__PURE__ */ React99.createElement(RangeContext_default.Provider, { + value: { + inRange: true, + panelPosition, + rangedValue: rangeHoverValue || selectedValue, + hoverRangedValue: panelHoverRangedValue + } + }, /* @__PURE__ */ React99.createElement(PickerPanel_default, _extends({}, props, panelProps, { + dateRender: panelDateRender, + showTime: panelShowTime, + mode: mergedModes[mergedActivePickerIndex], + generateConfig: generateConfig2, + style: void 0, + direction, + disabledDate: mergedActivePickerIndex === 0 ? disabledStartDate : disabledEndDate, + disabledTime: function disabledTime(date3) { + if (_disabledTime) { + return _disabledTime(date3, mergedActivePickerIndex === 0 ? "start" : "end"); + } + return false; + }, + className: (0, import_classnames23.default)(_defineProperty({}, "".concat(prefixCls, "-panel-focused"), mergedActivePickerIndex === 0 ? !startTyping : !endTyping)), + value: getValue3(selectedValue, mergedActivePickerIndex), + locale: locale4, + tabIndex: -1, + onPanelChange: function onPanelChange2(date3, newMode) { + if (mergedActivePickerIndex === 0) { + onStartLeave(true); + } + if (mergedActivePickerIndex === 1) { + onEndLeave(true); + } + triggerModesChange(updateValues(mergedModes, newMode, mergedActivePickerIndex), updateValues(selectedValue, date3, mergedActivePickerIndex)); + var viewDate = date3; + if (panelPosition === "right" && mergedModes[mergedActivePickerIndex] === newMode) { + viewDate = getClosingViewDate(viewDate, newMode, generateConfig2, -1); + } + setViewDate(viewDate, mergedActivePickerIndex); + }, + onOk: null, + onSelect: void 0, + onChange: void 0, + defaultValue: mergedActivePickerIndex === 0 ? getValue3(selectedValue, 1) : getValue3(selectedValue, 0), + defaultPickerValue: void 0 + }))); + } + var arrowLeft = 0; + var panelLeft = 0; + if (mergedActivePickerIndex && startInputDivRef.current && separatorRef.current && panelDivRef.current) { + arrowLeft = startInputDivRef.current.offsetWidth + separatorRef.current.offsetWidth; + if (panelDivRef.current.offsetWidth && arrowLeft > panelDivRef.current.offsetWidth) { + panelLeft = arrowLeft; + } + } + var arrowPositionStyle = direction === "rtl" ? { + right: arrowLeft + } : { + left: arrowLeft + }; + function renderPanels() { + var panels; + var extraNode = getExtraFooter(prefixCls, mergedModes[mergedActivePickerIndex], renderExtraFooter); + var rangesNode = getRanges({ + prefixCls, + components, + needConfirmButton, + okDisabled: !getValue3(selectedValue, mergedActivePickerIndex) || disabledDate && disabledDate(selectedValue[mergedActivePickerIndex]), + locale: locale4, + rangeList, + onOk: function onOk() { + if (getValue3(selectedValue, mergedActivePickerIndex)) { + triggerChange(selectedValue, mergedActivePickerIndex); + if (_onOk) { + _onOk(selectedValue); + } + } + } + }); + if (picker !== "time" && !showTime) { + var viewDate = getViewDate(mergedActivePickerIndex); + var nextViewDate = getClosingViewDate(viewDate, picker, generateConfig2); + var currentMode = mergedModes[mergedActivePickerIndex]; + var showDoublePanel = currentMode === picker; + var leftPanel = renderPanel(showDoublePanel ? "left" : false, { + pickerValue: viewDate, + onPickerValueChange: function onPickerValueChange(newViewDate) { + setViewDate(newViewDate, mergedActivePickerIndex); + } + }); + var rightPanel = renderPanel("right", { + pickerValue: nextViewDate, + onPickerValueChange: function onPickerValueChange(newViewDate) { + setViewDate(getClosingViewDate(newViewDate, picker, generateConfig2, -1), mergedActivePickerIndex); + } + }); + if (direction === "rtl") { + panels = /* @__PURE__ */ React99.createElement(React99.Fragment, null, rightPanel, showDoublePanel && leftPanel); + } else { + panels = /* @__PURE__ */ React99.createElement(React99.Fragment, null, leftPanel, showDoublePanel && rightPanel); + } + } else { + panels = renderPanel(); + } + var mergedNodes = /* @__PURE__ */ React99.createElement(React99.Fragment, null, /* @__PURE__ */ React99.createElement("div", { + className: "".concat(prefixCls, "-panels") + }, panels), (extraNode || rangesNode) && /* @__PURE__ */ React99.createElement("div", { + className: "".concat(prefixCls, "-footer") + }, extraNode, rangesNode)); + if (panelRender) { + mergedNodes = panelRender(mergedNodes); + } + return /* @__PURE__ */ React99.createElement("div", { + className: "".concat(prefixCls, "-panel-container"), + style: { + marginLeft: panelLeft + }, + ref: panelDivRef, + onMouseDown: function onMouseDown(e) { + e.preventDefault(); + } + }, mergedNodes); + } + var rangePanel = /* @__PURE__ */ React99.createElement("div", { + className: (0, import_classnames23.default)("".concat(prefixCls, "-range-wrapper"), "".concat(prefixCls, "-").concat(picker, "-range-wrapper")), + style: { + minWidth: popupMinWidth + } + }, /* @__PURE__ */ React99.createElement("div", { + className: "".concat(prefixCls, "-range-arrow"), + style: arrowPositionStyle + }), renderPanels()); + var suffixNode; + if (suffixIcon) { + suffixNode = /* @__PURE__ */ React99.createElement("span", { + className: "".concat(prefixCls, "-suffix") + }, suffixIcon); + } + var clearNode; + if (allowClear && (getValue3(mergedValue, 0) && !mergedDisabled[0] || getValue3(mergedValue, 1) && !mergedDisabled[1])) { + clearNode = /* @__PURE__ */ React99.createElement("span", { + onMouseDown: function onMouseDown(e) { + e.preventDefault(); + e.stopPropagation(); + }, + onMouseUp: function onMouseUp(e) { + e.preventDefault(); + e.stopPropagation(); + var values = mergedValue; + if (!mergedDisabled[0]) { + values = updateValues(values, null, 0); + } + if (!mergedDisabled[1]) { + values = updateValues(values, null, 1); + } + triggerChange(values, null); + _triggerOpen(false, mergedActivePickerIndex); + }, + className: "".concat(prefixCls, "-clear") + }, clearIcon || /* @__PURE__ */ React99.createElement("span", { + className: "".concat(prefixCls, "-clear-btn") + })); + } + var inputSharedProps = { + size: getInputSize(picker, formatList[0], generateConfig2) + }; + var activeBarLeft = 0; + var activeBarWidth = 0; + if (startInputDivRef.current && endInputDivRef.current && separatorRef.current) { + if (mergedActivePickerIndex === 0) { + activeBarWidth = startInputDivRef.current.offsetWidth; + } else { + activeBarLeft = arrowLeft; + activeBarWidth = endInputDivRef.current.offsetWidth; + } + } + var activeBarPositionStyle = direction === "rtl" ? { + right: activeBarLeft + } : { + left: activeBarLeft + }; + var onContextSelect = function onContextSelect2(date3, type2) { + var values = updateValues(selectedValue, date3, mergedActivePickerIndex); + if (type2 === "submit" || type2 !== "key" && !needConfirmButton) { + triggerChange(values, mergedActivePickerIndex); + if (mergedActivePickerIndex === 0) { + onStartLeave(); + } else { + onEndLeave(); + } + } else { + setSelectedValue(values); + } + }; + return /* @__PURE__ */ React99.createElement(PanelContext_default.Provider, { + value: { + operationRef, + hideHeader: picker === "time", + onDateMouseEnter, + onDateMouseLeave, + hideRanges: true, + onSelect: onContextSelect, + open: mergedOpen + } + }, /* @__PURE__ */ React99.createElement(PickerTrigger_default, { + visible: mergedOpen, + popupElement: rangePanel, + popupStyle, + prefixCls, + dropdownClassName, + dropdownAlign, + getPopupContainer, + transitionName: transitionName2, + range: true, + direction + }, /* @__PURE__ */ React99.createElement("div", _extends({ + ref: containerRef, + className: (0, import_classnames23.default)(prefixCls, "".concat(prefixCls, "-range"), className, (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), mergedDisabled[0] && mergedDisabled[1]), _defineProperty(_classNames2, "".concat(prefixCls, "-focused"), mergedActivePickerIndex === 0 ? startFocused : endFocused), _defineProperty(_classNames2, "".concat(prefixCls, "-rtl"), direction === "rtl"), _classNames2)), + style: style2, + onClick: onPickerClick, + onMouseDown: onPickerMouseDown + }, getDataOrAriaProps(props)), /* @__PURE__ */ React99.createElement("div", { + className: (0, import_classnames23.default)("".concat(prefixCls, "-input"), (_classNames3 = {}, _defineProperty(_classNames3, "".concat(prefixCls, "-input-active"), mergedActivePickerIndex === 0), _defineProperty(_classNames3, "".concat(prefixCls, "-input-placeholder"), !!startHoverValue), _classNames3)), + ref: startInputDivRef + }, /* @__PURE__ */ React99.createElement("input", _extends({ + id: id2, + disabled: mergedDisabled[0], + readOnly: inputReadOnly || typeof formatList[0] === "function" || !startTyping, + value: startHoverValue || startText, + onChange: function onChange2(e) { + triggerStartTextChange(e.target.value); + }, + autoFocus, + placeholder: getValue3(placeholder, 0) || "", + ref: startInputRef + }, startInputProps, inputSharedProps, { + autoComplete + }))), /* @__PURE__ */ React99.createElement("div", { + className: "".concat(prefixCls, "-range-separator"), + ref: separatorRef + }, separator), /* @__PURE__ */ React99.createElement("div", { + className: (0, import_classnames23.default)("".concat(prefixCls, "-input"), (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefixCls, "-input-active"), mergedActivePickerIndex === 1), _defineProperty(_classNames4, "".concat(prefixCls, "-input-placeholder"), !!endHoverValue), _classNames4)), + ref: endInputDivRef + }, /* @__PURE__ */ React99.createElement("input", _extends({ + disabled: mergedDisabled[1], + readOnly: inputReadOnly || typeof formatList[0] === "function" || !endTyping, + value: endHoverValue || endText, + onChange: function onChange2(e) { + triggerEndTextChange(e.target.value); + }, + placeholder: getValue3(placeholder, 1) || "", + ref: endInputRef + }, endInputProps, inputSharedProps, { + autoComplete + }))), /* @__PURE__ */ React99.createElement("div", { + className: "".concat(prefixCls, "-active-bar"), + style: _objectSpread2(_objectSpread2({}, activeBarPositionStyle), {}, { + width: activeBarWidth, + position: "absolute" + }) + }), suffixNode, clearNode))); + } + var RangePicker = /* @__PURE__ */ function(_React$Component) { + _inherits(RangePicker2, _React$Component); + var _super = _createSuper(RangePicker2); + function RangePicker2() { + var _this; + _classCallCheck(this, RangePicker2); + _this = _super.apply(this, arguments); + _this.pickerRef = /* @__PURE__ */ React99.createRef(); + _this.focus = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.focus(); + } + }; + _this.blur = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.blur(); + } + }; + return _this; + } + _createClass(RangePicker2, [{ + key: "render", + value: function render() { + return /* @__PURE__ */ React99.createElement(InnerRangePicker, _extends({}, this.props, { + pickerRef: this.pickerRef + })); + } + }]); + return RangePicker2; + }(React99.Component); + var RangePicker_default = RangePicker; + + // node_modules/rc-picker/es/index.js + var es_default5 = Picker_default; + + // node_modules/antd/es/date-picker/PickerButton.js + var React100 = __toModule(require_react()); + function PickerButton(props) { + return /* @__PURE__ */ React100.createElement(button_default2, _extends({ + size: "small", + type: "primary" + }, props)); + } + + // node_modules/antd/es/date-picker/PickerTag.js + var React103 = __toModule(require_react()); + + // node_modules/antd/es/tag/index.js + var React102 = __toModule(require_react()); + var import_classnames25 = __toModule(require_classnames()); + + // node_modules/antd/es/tag/CheckableTag.js + var React101 = __toModule(require_react()); + var import_classnames24 = __toModule(require_classnames()); + var __rest4 = function(s, e) { + var t = {}; + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + } + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + var CheckableTag = function CheckableTag2(_a) { + var _classNames; + var customizePrefixCls = _a.prefixCls, className = _a.className, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, restProps = __rest4(_a, ["prefixCls", "className", "checked", "onChange", "onClick"]); + var _React$useContext = React101.useContext(ConfigContext), getPrefixCls = _React$useContext.getPrefixCls; + var handleClick = function handleClick2(e) { + onChange === null || onChange === void 0 ? void 0 : onChange(!checked); + onClick === null || onClick === void 0 ? void 0 : onClick(e); + }; + var prefixCls = getPrefixCls("tag", customizePrefixCls); + var cls = (0, import_classnames24.default)(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-checkable"), true), _defineProperty(_classNames, "".concat(prefixCls, "-checkable-checked"), checked), _classNames), className); + return /* @__PURE__ */ React101.createElement("span", _extends({}, restProps, { + className: cls, + onClick: handleClick + })); + }; + var CheckableTag_default = CheckableTag; + + // node_modules/antd/es/tag/index.js + var __rest5 = function(s, e) { + var t = {}; + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + } + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + var PresetColorRegex = new RegExp("^(".concat(PresetColorTypes.join("|"), ")(-inverse)?$")); + var PresetStatusColorRegex = new RegExp("^(".concat(PresetStatusColorTypes.join("|"), ")$")); + var InternalTag = function InternalTag2(_a, ref) { + var _classNames; + var customizePrefixCls = _a.prefixCls, className = _a.className, style2 = _a.style, children = _a.children, icon = _a.icon, color = _a.color, onClose2 = _a.onClose, closeIcon = _a.closeIcon, _a$closable = _a.closable, closable = _a$closable === void 0 ? false : _a$closable, props = __rest5(_a, ["prefixCls", "className", "style", "children", "icon", "color", "onClose", "closeIcon", "closable"]); + var _React$useContext = React102.useContext(ConfigContext), getPrefixCls = _React$useContext.getPrefixCls, direction = _React$useContext.direction; + var _React$useState = React102.useState(true), _React$useState2 = _slicedToArray(_React$useState, 2), visible = _React$useState2[0], setVisible = _React$useState2[1]; + React102.useEffect(function() { + if ("visible" in props) { + setVisible(props.visible); + } + }, [props.visible]); + var isPresetColor = function isPresetColor2() { + if (!color) { + return false; + } + return PresetColorRegex.test(color) || PresetStatusColorRegex.test(color); + }; + var tagStyle = _extends({ + backgroundColor: color && !isPresetColor() ? color : void 0 + }, style2); + var presetColor = isPresetColor(); + var prefixCls = getPrefixCls("tag", customizePrefixCls); + var tagClassName = (0, import_classnames25.default)(prefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(color), presetColor), _defineProperty(_classNames, "".concat(prefixCls, "-has-color"), color && !presetColor), _defineProperty(_classNames, "".concat(prefixCls, "-hidden"), !visible), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === "rtl"), _classNames), className); + var handleCloseClick = function handleCloseClick2(e) { + e.stopPropagation(); + onClose2 === null || onClose2 === void 0 ? void 0 : onClose2(e); + if (e.defaultPrevented) { + return; + } + if (!("visible" in props)) { + setVisible(false); + } + }; + var renderCloseIcon = function renderCloseIcon2() { + if (closable) { + return closeIcon ? /* @__PURE__ */ React102.createElement("span", { + className: "".concat(prefixCls, "-close-icon"), + onClick: handleCloseClick + }, closeIcon) : /* @__PURE__ */ React102.createElement(CloseOutlined_default2, { + className: "".concat(prefixCls, "-close-icon"), + onClick: handleCloseClick + }); + } + return null; + }; + var isNeedWave = "onClick" in props || children && children.type === "a"; + var tagProps = omit(props, ["visible"]); + var iconNode = icon || null; + var kids = iconNode ? /* @__PURE__ */ React102.createElement(React102.Fragment, null, iconNode, /* @__PURE__ */ React102.createElement("span", null, children)) : children; + var tagNode = /* @__PURE__ */ React102.createElement("span", _extends({}, tagProps, { + ref, + className: tagClassName, + style: tagStyle + }), kids, renderCloseIcon()); + return isNeedWave ? /* @__PURE__ */ React102.createElement(Wave, null, tagNode) : tagNode; + }; + var Tag = /* @__PURE__ */ React102.forwardRef(InternalTag); + Tag.displayName = "Tag"; + Tag.CheckableTag = CheckableTag_default; + var tag_default = Tag; + + // node_modules/antd/es/date-picker/PickerTag.js + function PickerTag(props) { + return /* @__PURE__ */ React103.createElement(tag_default, _extends({ + color: "blue" + }, props)); + } + + // node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js + var React104 = __toModule(require_react()); + var import_classnames26 = __toModule(require_classnames()); + + // node_modules/antd/es/date-picker/util.js + function getPlaceholder(picker, locale4, customizePlaceholder) { + if (customizePlaceholder !== void 0) { + return customizePlaceholder; + } + if (picker === "year" && locale4.lang.yearPlaceholder) { + return locale4.lang.yearPlaceholder; + } + if (picker === "quarter" && locale4.lang.quarterPlaceholder) { + return locale4.lang.quarterPlaceholder; + } + if (picker === "month" && locale4.lang.monthPlaceholder) { + return locale4.lang.monthPlaceholder; + } + if (picker === "week" && locale4.lang.weekPlaceholder) { + return locale4.lang.weekPlaceholder; + } + if (picker === "time" && locale4.timePickerLocale.placeholder) { + return locale4.timePickerLocale.placeholder; + } + return locale4.lang.placeholder; + } + function getRangePlaceholder(picker, locale4, customizePlaceholder) { + if (customizePlaceholder !== void 0) { + return customizePlaceholder; + } + if (picker === "year" && locale4.lang.yearPlaceholder) { + return locale4.lang.rangeYearPlaceholder; + } + if (picker === "month" && locale4.lang.monthPlaceholder) { + return locale4.lang.rangeMonthPlaceholder; + } + if (picker === "week" && locale4.lang.weekPlaceholder) { + return locale4.lang.rangeWeekPlaceholder; + } + if (picker === "time" && locale4.timePickerLocale.placeholder) { + return locale4.timePickerLocale.rangePlaceholder; + } + return locale4.lang.rangePlaceholder; + } + + // node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js + var __rest6 = function(s, e) { + var t = {}; + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + } + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + function generatePicker(generateConfig2) { + function getPicker(picker, displayName) { + var Picker2 = /* @__PURE__ */ function(_React$Component) { + _inherits(Picker3, _React$Component); + var _super = _createSuper(Picker3); + function Picker3(props) { + var _this; + _classCallCheck(this, Picker3); + _this = _super.call(this, props); + _this.pickerRef = /* @__PURE__ */ React104.createRef(); + _this.focus = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.focus(); + } + }; + _this.blur = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.blur(); + } + }; + _this.renderPicker = function(contextLocale) { + var locale4 = _extends(_extends({}, contextLocale), _this.props.locale); + var _this$context = _this.context, getPrefixCls = _this$context.getPrefixCls, direction = _this$context.direction, getPopupContainer = _this$context.getPopupContainer; + var _a = _this.props, customizePrefixCls = _a.prefixCls, customizeGetPopupContainer = _a.getPopupContainer, className = _a.className, customizeSize = _a.size, _a$bordered = _a.bordered, bordered = _a$bordered === void 0 ? true : _a$bordered, placeholder = _a.placeholder, restProps = __rest6(_a, ["prefixCls", "getPopupContainer", "className", "size", "bordered", "placeholder"]); + var _this$props = _this.props, format3 = _this$props.format, showTime = _this$props.showTime; + var prefixCls = getPrefixCls("picker", customizePrefixCls); + var additionalProps = { + showToday: true + }; + var additionalOverrideProps = {}; + if (picker) { + additionalOverrideProps.picker = picker; + } + var mergedPicker = picker || _this.props.picker; + additionalOverrideProps = _extends(_extends(_extends({}, additionalOverrideProps), showTime ? getTimeProps(_extends({ + format: format3, + picker: mergedPicker + }, showTime)) : {}), mergedPicker === "time" ? getTimeProps(_extends(_extends({ + format: format3 + }, _this.props), { + picker: mergedPicker + })) : {}); + var rootPrefixCls = getPrefixCls(); + return /* @__PURE__ */ React104.createElement(SizeContext_default.Consumer, null, function(size) { + var _classNames; + var mergedSize = customizeSize || size; + return /* @__PURE__ */ React104.createElement(es_default5, _extends({ + ref: _this.pickerRef, + placeholder: getPlaceholder(mergedPicker, locale4, placeholder), + suffixIcon: mergedPicker === "time" ? /* @__PURE__ */ React104.createElement(ClockCircleOutlined_default2, null) : /* @__PURE__ */ React104.createElement(CalendarOutlined_default2, null), + clearIcon: /* @__PURE__ */ React104.createElement(CloseCircleFilled_default2, null), + allowClear: true, + transitionName: "".concat(rootPrefixCls, "-slide-up") + }, additionalProps, restProps, additionalOverrideProps, { + locale: locale4.lang, + className: (0, import_classnames26.default)((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(mergedSize), mergedSize), _defineProperty(_classNames, "".concat(prefixCls, "-borderless"), !bordered), _classNames), className), + prefixCls, + getPopupContainer: customizeGetPopupContainer || getPopupContainer, + generateConfig: generateConfig2, + prevIcon: /* @__PURE__ */ React104.createElement("span", { + className: "".concat(prefixCls, "-prev-icon") + }), + nextIcon: /* @__PURE__ */ React104.createElement("span", { + className: "".concat(prefixCls, "-next-icon") + }), + superPrevIcon: /* @__PURE__ */ React104.createElement("span", { + className: "".concat(prefixCls, "-super-prev-icon") + }), + superNextIcon: /* @__PURE__ */ React104.createElement("span", { + className: "".concat(prefixCls, "-super-next-icon") + }), + components: Components, + direction + })); + }); + }; + devWarning_default(picker !== "quarter", displayName, "DatePicker.".concat(displayName, " is legacy usage. Please use DatePicker[picker='").concat(picker, "'] directly.")); + return _this; + } + _createClass(Picker3, [{ + key: "render", + value: function render() { + return /* @__PURE__ */ React104.createElement(LocaleReceiver, { + componentName: "DatePicker", + defaultLocale: en_US_default4 + }, this.renderPicker); + } + }]); + return Picker3; + }(React104.Component); + Picker2.contextType = ConfigContext; + if (displayName) { + Picker2.displayName = displayName; + } + return Picker2; + } + var DatePicker2 = getPicker(); + var WeekPicker = getPicker("week", "WeekPicker"); + var MonthPicker = getPicker("month", "MonthPicker"); + var YearPicker = getPicker("year", "YearPicker"); + var TimePicker = getPicker("time", "TimePicker"); + var QuarterPicker = getPicker("quarter", "QuarterPicker"); + return { + DatePicker: DatePicker2, + WeekPicker, + MonthPicker, + YearPicker, + TimePicker, + QuarterPicker + }; + } + + // node_modules/antd/es/date-picker/generatePicker/generateRangePicker.js + var React105 = __toModule(require_react()); + var import_classnames27 = __toModule(require_classnames()); + var __rest7 = function(s, e) { + var t = {}; + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + } + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + function generateRangePicker(generateConfig2) { + var RangePicker2 = /* @__PURE__ */ function(_React$Component) { + _inherits(RangePicker3, _React$Component); + var _super = _createSuper(RangePicker3); + function RangePicker3() { + var _this; + _classCallCheck(this, RangePicker3); + _this = _super.apply(this, arguments); + _this.pickerRef = /* @__PURE__ */ React105.createRef(); + _this.focus = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.focus(); + } + }; + _this.blur = function() { + if (_this.pickerRef.current) { + _this.pickerRef.current.blur(); + } + }; + _this.renderPicker = function(contextLocale) { + var locale4 = _extends(_extends({}, contextLocale), _this.props.locale); + var _this$context = _this.context, getPrefixCls = _this$context.getPrefixCls, direction = _this$context.direction, getPopupContainer = _this$context.getPopupContainer; + var _a = _this.props, customizePrefixCls = _a.prefixCls, customGetPopupContainer = _a.getPopupContainer, className = _a.className, customizeSize = _a.size, _a$bordered = _a.bordered, bordered = _a$bordered === void 0 ? true : _a$bordered, placeholder = _a.placeholder, restProps = __rest7(_a, ["prefixCls", "getPopupContainer", "className", "size", "bordered", "placeholder"]); + var _this$props = _this.props, format3 = _this$props.format, showTime = _this$props.showTime, picker = _this$props.picker; + var prefixCls = getPrefixCls("picker", customizePrefixCls); + var additionalOverrideProps = {}; + additionalOverrideProps = _extends(_extends(_extends({}, additionalOverrideProps), showTime ? getTimeProps(_extends({ + format: format3, + picker + }, showTime)) : {}), picker === "time" ? getTimeProps(_extends(_extends({ + format: format3 + }, _this.props), { + picker + })) : {}); + var rootPrefixCls = getPrefixCls(); + return /* @__PURE__ */ React105.createElement(SizeContext_default.Consumer, null, function(size) { + var _classNames; + var mergedSize = customizeSize || size; + return /* @__PURE__ */ React105.createElement(RangePicker_default, _extends({ + separator: /* @__PURE__ */ React105.createElement("span", { + "aria-label": "to", + className: "".concat(prefixCls, "-separator") + }, /* @__PURE__ */ React105.createElement(SwapRightOutlined_default2, null)), + ref: _this.pickerRef, + placeholder: getRangePlaceholder(picker, locale4, placeholder), + suffixIcon: picker === "time" ? /* @__PURE__ */ React105.createElement(ClockCircleOutlined_default2, null) : /* @__PURE__ */ React105.createElement(CalendarOutlined_default2, null), + clearIcon: /* @__PURE__ */ React105.createElement(CloseCircleFilled_default2, null), + allowClear: true, + transitionName: "".concat(rootPrefixCls, "-slide-up") + }, restProps, additionalOverrideProps, { + className: (0, import_classnames27.default)((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(mergedSize), mergedSize), _defineProperty(_classNames, "".concat(prefixCls, "-borderless"), !bordered), _classNames), className), + locale: locale4.lang, + prefixCls, + getPopupContainer: customGetPopupContainer || getPopupContainer, + generateConfig: generateConfig2, + prevIcon: /* @__PURE__ */ React105.createElement("span", { + className: "".concat(prefixCls, "-prev-icon") + }), + nextIcon: /* @__PURE__ */ React105.createElement("span", { + className: "".concat(prefixCls, "-next-icon") + }), + superPrevIcon: /* @__PURE__ */ React105.createElement("span", { + className: "".concat(prefixCls, "-super-prev-icon") + }), + superNextIcon: /* @__PURE__ */ React105.createElement("span", { + className: "".concat(prefixCls, "-super-next-icon") + }), + components: Components, + direction + })); + }); + }; + return _this; + } + _createClass(RangePicker3, [{ + key: "render", + value: function render() { + return /* @__PURE__ */ React105.createElement(LocaleReceiver, { + componentName: "DatePicker", + defaultLocale: en_US_default4 + }, this.renderPicker); + } + }]); + return RangePicker3; + }(React105.Component); + RangePicker2.contextType = ConfigContext; + return RangePicker2; + } + + // node_modules/antd/es/date-picker/generatePicker/index.js + var Components = { + button: PickerButton, + rangeItem: PickerTag + }; + function toArray4(list) { + if (!list) { + return []; + } + return Array.isArray(list) ? list : [list]; + } + function getTimeProps(props) { + var format3 = props.format, picker = props.picker, showHour = props.showHour, showMinute = props.showMinute, showSecond = props.showSecond, use12Hours = props.use12Hours; + var firstFormat = toArray4(format3)[0]; + var showTimeObj = _extends({}, props); + if (firstFormat && typeof firstFormat === "string") { + if (!firstFormat.includes("s") && showSecond === void 0) { + showTimeObj.showSecond = false; + } + if (!firstFormat.includes("m") && showMinute === void 0) { + showTimeObj.showMinute = false; + } + if (!firstFormat.includes("H") && !firstFormat.includes("h") && showHour === void 0) { + showTimeObj.showHour = false; + } + if ((firstFormat.includes("a") || firstFormat.includes("A")) && use12Hours === void 0) { + showTimeObj.use12Hours = true; + } + } + if (picker === "time") { + return showTimeObj; + } + if (typeof firstFormat === "function") { + delete showTimeObj.format; + } + return { + showTime: showTimeObj + }; + } + function generatePicker2(generateConfig2) { + var _generateSinglePicker = generatePicker(generateConfig2), DatePicker2 = _generateSinglePicker.DatePicker, WeekPicker = _generateSinglePicker.WeekPicker, MonthPicker = _generateSinglePicker.MonthPicker, YearPicker = _generateSinglePicker.YearPicker, TimePicker = _generateSinglePicker.TimePicker, QuarterPicker = _generateSinglePicker.QuarterPicker; + var RangePicker2 = generateRangePicker(generateConfig2); + var MergedDatePicker = DatePicker2; + MergedDatePicker.WeekPicker = WeekPicker; + MergedDatePicker.MonthPicker = MonthPicker; + MergedDatePicker.YearPicker = YearPicker; + MergedDatePicker.RangePicker = RangePicker2; + MergedDatePicker.TimePicker = TimePicker; + MergedDatePicker.QuarterPicker = QuarterPicker; + return MergedDatePicker; + } + var generatePicker_default = generatePicker2; + + // node_modules/antd/es/date-picker/index.js + var DatePicker = generatePicker_default(moment_default); + var date_picker_default = DatePicker; + // src/index.tsx var Base = ({}) => { return /* @__PURE__ */ React.createElement("main", null, /* @__PURE__ */ React.createElement("h1", null, "I am the page"), /* @__PURE__ */ React.createElement("h3", { className: "bacon" - }, "Here is some text"), /* @__PURE__ */ React.createElement(React.Fragment, null, "Fragmen!t"), /* @__PURE__ */ React.createElement(Button, { + }, "Here is some text"), /* @__PURE__ */ React.createElement(React.Fragment, null, "Fragmen!t"), /* @__PURE__ */ React.createElement(date_picker_default, null), /* @__PURE__ */ React.createElement(Button, { label: "Do not click.", onClick: () => alert("I told u not to click!") })); }; function startReact() { - import_react_dom.default.render(/* @__PURE__ */ React.createElement(Base, null), document.querySelector("#reactroot")); + import_react_dom7.default.render(/* @__PURE__ */ React.createElement(Base, null), document.querySelector("#reactroot")); } globalThis.addEventListener("DOMContentLoaded", () => { startReact(); @@ -20452,6 +38915,11 @@ object-assign (c) Sindre Sorhus @license MIT */ +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ /** * Checks if an event is supported in the current execution environment. * @@ -20481,6 +38949,14 @@ object-assign * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ +/** @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. + */ /** @license React v17.0.2 * react-dom.development.js * @@ -20497,3 +38973,8 @@ object-assign * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! moment.js +//! momentjs.com +//! version : 2.29.1 diff --git a/demos/simple-react/package.json b/demos/simple-react/package.json index 4ea9dd0a84..785feeca80 100644 --- a/demos/simple-react/package.json +++ b/demos/simple-react/package.json @@ -1,13 +1,24 @@ { "name": "simple-react", "version": "1.0.0", - "main": "index.js", "license": "MIT", "dependencies": { "antd": "^4.16.1", "left-pad": "^1.3.0", + "parcel": "2.0.0-beta.3", "react": "^17.0.2", "react-bootstrap": "^1.6.1", "react-dom": "^17.0.2" + }, + "parcel": "parceldist/index.js", + "targets": { + "parcel": { + "outputFormat": "esmodule", + "sourceMap": false, + "optimize": false, + "engines": { + "chrome": "last 1 version" + } + } } } diff --git a/demos/simple-react/src/index.tsx b/demos/simple-react/src/index.tsx index 369a9a7105..46e0027ef2 100644 --- a/demos/simple-react/src/index.tsx +++ b/demos/simple-react/src/index.tsx @@ -1,11 +1,8 @@ import ReactDOM from "react-dom"; import { Button } from "./components/button"; -import * as Bootstrap from "react-bootstrap"; -import * as leftPad from "left-pad"; import { DatePicker } from "antd"; const Base = ({}) => { - Bootstrap.Accordion; return (

I am the page

@@ -28,3 +25,5 @@ function startReact() { globalThis.addEventListener("DOMContentLoaded", () => { startReact(); }); + +export { Base }; diff --git a/esdev.beforehashmapupgrade b/esdev.beforehashmapupgrade new file mode 100755 index 0000000000..ab63d272b0 Binary files /dev/null and b/esdev.beforehashmapupgrade differ diff --git a/node_modules.jsbundle b/node_modules.jsbundle new file mode 100644 index 0000000000..730b841470 Binary files /dev/null and b/node_modules.jsbundle differ diff --git a/src/api/schema.d.ts b/src/api/schema.d.ts index 2162d6901e..8d8ae010eb 100644 --- a/src/api/schema.d.ts +++ b/src/api/schema.d.ts @@ -137,6 +137,7 @@ type uint32 = number; path: StringPointer; code: StringPointer; package_id: uint32; + path_extname_length: byte; } export interface JavascriptBundledPackage { @@ -174,22 +175,30 @@ type uint32 = number; imports: ModuleImportRecord[]; } + export interface StringMap { + keys: string[]; + values: string[]; + } + + export interface LoaderMap { + extensions: string[]; + loaders: Loader[]; + } + export interface TransformOptions { jsx?: JSX; tsconfig_override?: string; resolve?: ResolveMode; public_url?: string; absolute_working_dir?: string; - define_keys?: string[]; - define_values?: string[]; + define?: StringMap; preserve_symlinks?: boolean; entry_points?: string[]; write?: boolean; inject?: string[]; output_dir?: string; external?: string[]; - loader_keys?: string[]; - loader_values?: Loader[]; + loaders?: LoaderMap; main_fields?: string[]; platform?: Platform; serve?: boolean; @@ -197,6 +206,7 @@ type uint32 = number; public_dir?: string; only_scan_dependencies?: ScanDependencyMode; generate_node_module_bundle?: boolean; + node_modules_bundle_path?: string; } export interface FileHandle { @@ -267,6 +277,10 @@ type uint32 = number; export declare function decodeModuleImportRecord(buffer: ByteBuffer): ModuleImportRecord; export declare function encodeModule(message: Module, bb: ByteBuffer): void; export declare function decodeModule(buffer: ByteBuffer): Module; + export declare function encodeStringMap(message: StringMap, bb: ByteBuffer): void; + export declare function decodeStringMap(buffer: ByteBuffer): StringMap; + export declare function encodeLoaderMap(message: LoaderMap, bb: ByteBuffer): void; + export declare function decodeLoaderMap(buffer: ByteBuffer): LoaderMap; export declare function encodeTransformOptions(message: TransformOptions, bb: ByteBuffer): void; export declare function decodeTransformOptions(buffer: ByteBuffer): TransformOptions; export declare function encodeFileHandle(message: FileHandle, bb: ByteBuffer): void; diff --git a/src/api/schema.js b/src/api/schema.js index 96d3b54fd3..3f0bb8179b 100644 --- a/src/api/schema.js +++ b/src/api/schema.js @@ -167,6 +167,7 @@ function decodeJavascriptBundledModule(bb) { result["path"] = decodeStringPointer(bb); result["code"] = decodeStringPointer(bb); result["package_id"] = bb.readUint32(); + result["path_extname_length"] = bb.readByte(); return result; } @@ -193,6 +194,13 @@ function encodeJavascriptBundledModule(message, bb) { throw new Error("Missing required field \"package_id\""); } + var value = message["path_extname_length"]; + if (value != null) { + bb.writeByte(value); + } else { + throw new Error("Missing required field \"path_extname_length\""); + } + } function decodeJavascriptBundledPackage(bb) { @@ -467,6 +475,88 @@ function encodeModule(message, bb) { } +function decodeStringMap(bb) { + var result = {}; + + var length = bb.readVarUint(); + var values = result["keys"] = Array(length); + for (var i = 0; i < length; i++) values[i] = bb.readString(); + var length = bb.readVarUint(); + var values = result["values"] = Array(length); + for (var i = 0; i < length; i++) values[i] = bb.readString(); + return result; +} + +function encodeStringMap(message, bb) { + + var value = message["keys"]; + if (value != null) { + var values = value, n = values.length; + bb.writeVarUint(n); + for (var i = 0; i < n; i++) { + value = values[i]; + bb.writeString(value); + } + } else { + throw new Error("Missing required field \"keys\""); + } + + var value = message["values"]; + if (value != null) { + var values = value, n = values.length; + bb.writeVarUint(n); + for (var i = 0; i < n; i++) { + value = values[i]; + bb.writeString(value); + } + } else { + throw new Error("Missing required field \"values\""); + } + +} + +function decodeLoaderMap(bb) { + var result = {}; + + var length = bb.readVarUint(); + var values = result["extensions"] = Array(length); + for (var i = 0; i < length; i++) values[i] = bb.readString(); + var length = bb.readVarUint(); + var values = result["loaders"] = Array(length); + for (var i = 0; i < length; i++) values[i] = Loader[bb.readByte()]; + return result; +} + +function encodeLoaderMap(message, bb) { + + var value = message["extensions"]; + if (value != null) { + var values = value, n = values.length; + bb.writeVarUint(n); + for (var i = 0; i < n; i++) { + value = values[i]; + bb.writeString(value); + } + } else { + throw new Error("Missing required field \"extensions\""); + } + + var value = message["loaders"]; + if (value != null) { + var values = value, n = values.length; + bb.writeVarUint(n); + for (var i = 0; i < n; i++) { + value = values[i]; + var encoded = Loader[value]; +if (encoded === void 0) throw new Error("Invalid value " + JSON.stringify(value) + " for enum \"Loader\""); +bb.writeByte(encoded); + } + } else { + throw new Error("Missing required field \"loaders\""); + } + +} + function decodeTransformOptions(bb) { var result = {}; @@ -496,91 +586,79 @@ function decodeTransformOptions(bb) { break; case 6: - var length = bb.readVarUint(); - var values = result["define_keys"] = Array(length); - for (var i = 0; i < length; i++) values[i] = bb.readString(); + result["define"] = decodeStringMap(bb); break; case 7: - var length = bb.readVarUint(); - var values = result["define_values"] = Array(length); - for (var i = 0; i < length; i++) values[i] = bb.readString(); - break; - - case 8: result["preserve_symlinks"] = !!bb.readByte(); break; - case 9: + case 8: var length = bb.readVarUint(); var values = result["entry_points"] = Array(length); for (var i = 0; i < length; i++) values[i] = bb.readString(); break; - case 10: + case 9: result["write"] = !!bb.readByte(); break; - case 11: + case 10: var length = bb.readVarUint(); var values = result["inject"] = Array(length); for (var i = 0; i < length; i++) values[i] = bb.readString(); break; - case 12: + case 11: result["output_dir"] = bb.readString(); break; - case 13: + case 12: var length = bb.readVarUint(); var values = result["external"] = Array(length); for (var i = 0; i < length; i++) values[i] = bb.readString(); break; + case 13: + result["loaders"] = decodeLoaderMap(bb); + break; + case 14: - var length = bb.readVarUint(); - var values = result["loader_keys"] = Array(length); - for (var i = 0; i < length; i++) values[i] = bb.readString(); - break; - - case 15: - var length = bb.readVarUint(); - var values = result["loader_values"] = Array(length); - for (var i = 0; i < length; i++) values[i] = Loader[bb.readByte()]; - break; - - case 16: var length = bb.readVarUint(); var values = result["main_fields"] = Array(length); for (var i = 0; i < length; i++) values[i] = bb.readString(); break; - case 17: + case 15: result["platform"] = Platform[bb.readByte()]; break; - case 18: + case 16: result["serve"] = !!bb.readByte(); break; - case 19: + case 17: var length = bb.readVarUint(); var values = result["extension_order"] = Array(length); for (var i = 0; i < length; i++) values[i] = bb.readString(); break; - case 20: + case 18: result["public_dir"] = bb.readString(); break; - case 21: + case 19: result["only_scan_dependencies"] = ScanDependencyMode[bb.readByte()]; break; - case 22: + case 20: result["generate_node_module_bundle"] = !!bb.readByte(); break; + case 21: + result["node_modules_bundle_path"] = bb.readString(); + break; + default: throw new Error("Attempted to parse invalid message"); } @@ -621,37 +699,21 @@ bb.writeByte(encoded); bb.writeString(value); } - var value = message["define_keys"]; + var value = message["define"]; if (value != null) { bb.writeByte(6); - var values = value, n = values.length; - bb.writeVarUint(n); - for (var i = 0; i < n; i++) { - value = values[i]; - bb.writeString(value); - } - } - - var value = message["define_values"]; - if (value != null) { - bb.writeByte(7); - var values = value, n = values.length; - bb.writeVarUint(n); - for (var i = 0; i < n; i++) { - value = values[i]; - bb.writeString(value); - } + encodeStringMap(value, bb); } var value = message["preserve_symlinks"]; if (value != null) { - bb.writeByte(8); + bb.writeByte(7); bb.writeByte(value); } var value = message["entry_points"]; if (value != null) { - bb.writeByte(9); + bb.writeByte(8); var values = value, n = values.length; bb.writeVarUint(n); for (var i = 0; i < n; i++) { @@ -662,13 +724,13 @@ bb.writeByte(encoded); var value = message["write"]; if (value != null) { - bb.writeByte(10); + bb.writeByte(9); bb.writeByte(value); } var value = message["inject"]; if (value != null) { - bb.writeByte(11); + bb.writeByte(10); var values = value, n = values.length; bb.writeVarUint(n); for (var i = 0; i < n; i++) { @@ -679,13 +741,13 @@ bb.writeByte(encoded); var value = message["output_dir"]; if (value != null) { - bb.writeByte(12); + bb.writeByte(11); bb.writeString(value); } var value = message["external"]; if (value != null) { - bb.writeByte(13); + bb.writeByte(12); var values = value, n = values.length; bb.writeVarUint(n); for (var i = 0; i < n; i++) { @@ -694,7 +756,13 @@ bb.writeByte(encoded); } } - var value = message["loader_keys"]; + var value = message["loaders"]; + if (value != null) { + bb.writeByte(13); + encodeLoaderMap(value, bb); + } + + var value = message["main_fields"]; if (value != null) { bb.writeByte(14); var values = value, n = values.length; @@ -705,33 +773,9 @@ bb.writeByte(encoded); } } - var value = message["loader_values"]; - if (value != null) { - bb.writeByte(15); - var values = value, n = values.length; - bb.writeVarUint(n); - for (var i = 0; i < n; i++) { - value = values[i]; - var encoded = Loader[value]; -if (encoded === void 0) throw new Error("Invalid value " + JSON.stringify(value) + " for enum \"Loader\""); -bb.writeByte(encoded); - } - } - - var value = message["main_fields"]; - if (value != null) { - bb.writeByte(16); - var values = value, n = values.length; - bb.writeVarUint(n); - for (var i = 0; i < n; i++) { - value = values[i]; - bb.writeString(value); - } - } - var value = message["platform"]; if (value != null) { - bb.writeByte(17); + bb.writeByte(15); var encoded = Platform[value]; if (encoded === void 0) throw new Error("Invalid value " + JSON.stringify(value) + " for enum \"Platform\""); bb.writeByte(encoded); @@ -739,13 +783,13 @@ bb.writeByte(encoded); var value = message["serve"]; if (value != null) { - bb.writeByte(18); + bb.writeByte(16); bb.writeByte(value); } var value = message["extension_order"]; if (value != null) { - bb.writeByte(19); + bb.writeByte(17); var values = value, n = values.length; bb.writeVarUint(n); for (var i = 0; i < n; i++) { @@ -756,13 +800,13 @@ bb.writeByte(encoded); var value = message["public_dir"]; if (value != null) { - bb.writeByte(20); + bb.writeByte(18); bb.writeString(value); } var value = message["only_scan_dependencies"]; if (value != null) { - bb.writeByte(21); + bb.writeByte(19); var encoded = ScanDependencyMode[value]; if (encoded === void 0) throw new Error("Invalid value " + JSON.stringify(value) + " for enum \"ScanDependencyMode\""); bb.writeByte(encoded); @@ -770,9 +814,15 @@ bb.writeByte(encoded); var value = message["generate_node_module_bundle"]; if (value != null) { - bb.writeByte(22); + bb.writeByte(20); bb.writeByte(value); } + + var value = message["node_modules_bundle_path"]; + if (value != null) { + bb.writeByte(21); + bb.writeString(value); + } bb.writeByte(0); } @@ -1207,6 +1257,10 @@ export { decodeModuleImportRecord } export { encodeModuleImportRecord } export { decodeModule } export { encodeModule } +export { decodeStringMap } +export { encodeStringMap } +export { decodeLoaderMap } +export { encodeLoaderMap } export { decodeTransformOptions } export { encodeTransformOptions } export { decodeFileHandle } diff --git a/src/api/schema.peechy b/src/api/schema.peechy index 1c21c7d5e6..f893c525b0 100644 --- a/src/api/schema.peechy +++ b/src/api/schema.peechy @@ -49,7 +49,9 @@ struct JavascriptBundledModule { StringPointer path; StringPointer code; uint32 package_id; - + // This lets us efficiently compare strings ignoring the extension + // If we instead omit the extension + byte path_extname_length; } struct JavascriptBundledPackage { @@ -105,6 +107,16 @@ struct Module { ModuleImportRecord[] imports; } +struct StringMap { + string[] keys; + string[] values; +} + +struct LoaderMap { + string[] extensions; + Loader[] loaders; +} + message TransformOptions { JSX jsx = 1; string tsconfig_override = 2; @@ -113,35 +125,34 @@ message TransformOptions { string public_url = 4; string absolute_working_dir = 5; + StringMap define = 6; - string[] define_keys = 6; - string[] define_values = 7; + bool preserve_symlinks = 7; - bool preserve_symlinks = 8; + string[] entry_points = 8; + bool write = 9; - string[] entry_points = 9; - bool write = 10; + string[] inject = 10; + string output_dir = 11; - string[] inject = 11; - string output_dir = 12; + string[] external = 12; - string[] external = 13; + LoaderMap loaders = 13; - string[] loader_keys = 14; - Loader[] loader_values = 15; + string[] main_fields = 14; + Platform platform = 15; - string[] main_fields = 16; - Platform platform = 17; + bool serve = 16; - bool serve = 18; + string[] extension_order = 17; - string[] extension_order = 19; + string public_dir = 18; - string public_dir = 20; + ScanDependencyMode only_scan_dependencies = 19; - ScanDependencyMode only_scan_dependencies = 21; + bool generate_node_module_bundle = 20; - bool generate_node_module_bundle = 22; + string node_modules_bundle_path = 21; } struct FileHandle { diff --git a/src/api/schema.zig b/src/api/schema.zig index 0e7cb6fcc7..4a2e44f9b0 100644 --- a/src/api/schema.zig +++ b/src/api/schema.zig @@ -1,3 +1,4 @@ + const std = @import("std"); pub const Reader = struct { @@ -58,7 +59,7 @@ pub const Reader = struct { return E.InvalidValue; } - pub fn readArray(this: *Self, comptime T: type) ![]T { + pub fn readArray(this: *Self, comptime T: type) ![]const T { const length = try this.readInt(u32); if (length == 0) { return &([_]T{}); @@ -92,7 +93,8 @@ pub const Reader = struct { } }, .Enum => |type_info| { - return std.meta.cast([]T, std.mem.readIntSliceNative(type_info.tag_type, try this.read(length * @sizeOf(type_info.tag_type)))); + const enum_values = try this.read(length * @sizeOf(type_info.tag_type)); + return @ptrCast([*]T, enum_values.ptr)[0..length]; }, else => {}, } @@ -136,6 +138,10 @@ pub const Reader = struct { return try this.readByte(); }, []const u8 => { + return try this.readArray(u8); + }, + + []const []const u8 => { return try this.readArray([]const u8); }, []u8 => { @@ -274,955 +280,1053 @@ pub fn Writer(comptime WritableStream: type) type { pub const ByteWriter = Writer(std.io.FixedBufferStream([]u8)); pub const FileWriter = Writer(std.fs.File); -pub const Api = struct { - pub const Loader = enum(u8) { - _none, - /// jsx - jsx, - /// js - js, - /// ts - ts, - /// tsx - tsx, +pub const Api = struct { - /// css - css, +pub const Loader = enum(u8) { - /// file - file, +_none, + /// jsx + jsx, - /// json - json, + /// js + js, - _, + /// ts + ts, - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; + /// tsx + tsx, - pub const ResolveMode = enum(u8) { - _none, - /// disable - disable, + /// css + css, - /// lazy - lazy, + /// file + file, - /// dev - dev, + /// json + json, - /// bundle - bundle, +_, - _, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; - - pub const Platform = enum(u8) { - _none, - /// browser - browser, - - /// node - node, - - _, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; - - pub const JsxRuntime = enum(u8) { - _none, - /// automatic - automatic, - - /// classic - classic, - - _, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; - - pub const Jsx = struct { - /// factory - factory: []const u8, - - /// runtime - runtime: JsxRuntime, - - /// fragment - fragment: []const u8, - - /// development - development: bool = false, - - /// import_source - import_source: []const u8, - - /// react_fast_refresh - react_fast_refresh: bool = false, - - pub fn decode(reader: anytype) anyerror!Jsx { - var this = std.mem.zeroes(Jsx); - - this.factory = try reader.readValue([]const u8); - this.runtime = try reader.readValue(JsxRuntime); - this.fragment = try reader.readValue([]const u8); - this.development = try reader.readValue(bool); - this.import_source = try reader.readValue([]const u8); - this.react_fast_refresh = try reader.readValue(bool); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.factory); - try writer.writeEnum(this.runtime); - try writer.writeValue(this.fragment); - try writer.writeInt(@intCast(u8, @boolToInt(this.development))); - try writer.writeValue(this.import_source); - try writer.writeInt(@intCast(u8, @boolToInt(this.react_fast_refresh))); - } - }; - - pub const StringPointer = packed struct { - /// offset - offset: u32 = 0, - - /// length - length: u32 = 0, - - pub fn decode(reader: anytype) anyerror!StringPointer { - var this = std.mem.zeroes(StringPointer); - - this.offset = try reader.readValue(u32); - this.length = try reader.readValue(u32); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.offset); - try writer.writeInt(this.length); - } - }; - - pub const JavascriptBundledModule = struct { - /// path - path: StringPointer, - - /// code - code: StringPointer, - - /// package_id - package_id: u32 = 0, - - pub fn decode(reader: anytype) anyerror!JavascriptBundledModule { - var this = std.mem.zeroes(JavascriptBundledModule); - - this.path = try reader.readValue(StringPointer); - this.code = try reader.readValue(StringPointer); - this.package_id = try reader.readValue(u32); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.path); - try writer.writeValue(this.code); - try writer.writeInt(this.package_id); - } - }; - - pub const JavascriptBundledPackage = struct { - /// name - name: StringPointer, - - /// version - version: StringPointer, - - /// hash - hash: u32 = 0, - - /// modules_offset - modules_offset: u32 = 0, - - /// modules_length - modules_length: u32 = 0, - - pub fn decode(reader: anytype) anyerror!JavascriptBundledPackage { - var this = std.mem.zeroes(JavascriptBundledPackage); - - this.name = try reader.readValue(StringPointer); - this.version = try reader.readValue(StringPointer); - this.hash = try reader.readValue(u32); - this.modules_offset = try reader.readValue(u32); - this.modules_length = try reader.readValue(u32); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.name); - try writer.writeValue(this.version); - try writer.writeInt(this.hash); - try writer.writeInt(this.modules_offset); - try writer.writeInt(this.modules_length); - } - }; - - pub const JavascriptBundle = struct { - /// modules - modules: []JavascriptBundledModule, - - /// packages - packages: []JavascriptBundledPackage, - - /// etag - etag: []const u8, - - /// generated_at - generated_at: u32 = 0, - - /// app_package_json_dependencies_hash - app_package_json_dependencies_hash: []const u8, - - /// import_from_name - import_from_name: []const u8, - - /// manifest_string - manifest_string: []const u8, - - pub fn decode(reader: anytype) anyerror!JavascriptBundle { - var this = std.mem.zeroes(JavascriptBundle); - - this.modules = try reader.readArray(JavascriptBundledModule); - this.packages = try reader.readArray(JavascriptBundledPackage); - this.etag = try reader.readArray(u8); - this.generated_at = try reader.readValue(u32); - this.app_package_json_dependencies_hash = try reader.readArray(u8); - this.import_from_name = try reader.readArray(u8); - this.manifest_string = try reader.readArray(u8); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(JavascriptBundledModule, this.modules); - try writer.writeArray(JavascriptBundledPackage, this.packages); - try writer.writeArray(u8, this.etag); - try writer.writeInt(this.generated_at); - try writer.writeArray(u8, this.app_package_json_dependencies_hash); - try writer.writeArray(u8, this.import_from_name); - try writer.writeArray(u8, this.manifest_string); - } - }; - - pub const JavascriptBundleContainer = struct { - /// bundle_format_version - bundle_format_version: ?u32 = null, - - /// bundle - bundle: ?JavascriptBundle = null, - - /// code_length - code_length: ?u32 = null, - - pub fn decode(reader: anytype) anyerror!JavascriptBundleContainer { - var this = std.mem.zeroes(JavascriptBundleContainer); - - while (true) { - switch (try reader.readByte()) { - 0 => { - return this; - }, - - 1 => { - this.bundle_format_version = try reader.readValue(u32); - }, - 2 => { - this.bundle = try reader.readValue(JavascriptBundle); - }, - 3 => { - this.code_length = try reader.readValue(u32); - }, - else => { - return error.InvalidMessage; - }, + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); } - } - unreachable; - } - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - if (this.bundle_format_version) |bundle_format_version| { - try writer.writeFieldID(1); - try writer.writeInt(bundle_format_version); - } - if (this.bundle) |bundle| { - try writer.writeFieldID(2); - try writer.writeValue(bundle); - } - if (this.code_length) |code_length| { - try writer.writeFieldID(3); - try writer.writeInt(code_length); - } - try writer.endMessage(); - } - }; - - pub const ScanDependencyMode = enum(u8) { - _none, - /// app - app, - - /// all - all, - - _, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; - - pub const ModuleImportType = enum(u8) { - _none, - /// import - import, - - /// require - require, - - _, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; - - pub const ModuleImportRecord = struct { - /// kind - kind: ModuleImportType, - - /// path - path: []const u8, - - /// dynamic - dynamic: bool = false, - - pub fn decode(reader: anytype) anyerror!ModuleImportRecord { - var this = std.mem.zeroes(ModuleImportRecord); - - this.kind = try reader.readValue(ModuleImportType); - this.path = try reader.readValue([]const u8); - this.dynamic = try reader.readValue(bool); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.kind); - try writer.writeValue(this.path); - try writer.writeInt(@intCast(u8, @boolToInt(this.dynamic))); - } - }; - - pub const Module = struct { - /// path - path: []const u8, - - /// imports - imports: []ModuleImportRecord, - - pub fn decode(reader: anytype) anyerror!Module { - var this = std.mem.zeroes(Module); - - this.path = try reader.readValue([]const u8); - this.imports = try reader.readArray(ModuleImportRecord); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.path); - try writer.writeArray(ModuleImportRecord, this.imports); - } - }; - - pub const TransformOptions = struct { - /// jsx - jsx: ?Jsx = null, - - /// tsconfig_override - tsconfig_override: ?[]const u8 = null, - - /// resolve - resolve: ?ResolveMode = null, - - /// public_url - public_url: ?[]const u8 = null, - - /// absolute_working_dir - absolute_working_dir: ?[]const u8 = null, - - /// define_keys - define_keys: []const []const u8, - - /// define_values - define_values: []const []const u8, - - /// preserve_symlinks - preserve_symlinks: ?bool = null, - - /// entry_points - entry_points: []const []const u8, - - /// write - write: ?bool = null, - - /// inject - inject: []const []const u8, - - /// output_dir - output_dir: ?[]const u8 = null, - - /// external - external: []const []const u8, - - /// loader_keys - loader_keys: []const []const u8, - - /// loader_values - loader_values: []const Loader, - - /// main_fields - main_fields: []const []const u8, - - /// platform - platform: ?Platform = null, - - /// serve - serve: ?bool = null, - - /// extension_order - extension_order: []const []const u8, - - /// public_dir - public_dir: ?[]const u8 = null, - - /// only_scan_dependencies - only_scan_dependencies: ?ScanDependencyMode = null, - - /// generate_node_module_bundle - generate_node_module_bundle: ?bool = null, - - pub fn decode(reader: anytype) anyerror!TransformOptions { - var this = std.mem.zeroes(TransformOptions); - - while (true) { - switch (try reader.readByte()) { - 0 => { - return this; - }, - - 1 => { - this.jsx = try reader.readValue(Jsx); - }, - 2 => { - this.tsconfig_override = try reader.readValue([]const u8); - }, - 3 => { - this.resolve = try reader.readValue(ResolveMode); - }, - 4 => { - this.public_url = try reader.readValue([]const u8); - }, - 5 => { - this.absolute_working_dir = try reader.readValue([]const u8); - }, - 6 => { - this.define_keys = try reader.readArray([]const u8); - }, - 7 => { - this.define_values = try reader.readArray([]const u8); - }, - 8 => { - this.preserve_symlinks = try reader.readValue(bool); - }, - 9 => { - this.entry_points = try reader.readArray([]const u8); - }, - 10 => { - this.write = try reader.readValue(bool); - }, - 11 => { - this.inject = try reader.readArray([]const u8); - }, - 12 => { - this.output_dir = try reader.readValue([]const u8); - }, - 13 => { - this.external = try reader.readArray([]const u8); - }, - 14 => { - this.loader_keys = try reader.readArray([]const u8); - }, - 15 => { - this.loader_values = try reader.readArray(Loader); - }, - 16 => { - this.main_fields = try reader.readArray([]const u8); - }, - 17 => { - this.platform = try reader.readValue(Platform); - }, - 18 => { - this.serve = try reader.readValue(bool); - }, - 19 => { - this.extension_order = try reader.readArray([]const u8); - }, - 20 => { - this.public_dir = try reader.readValue([]const u8); - }, - 21 => { - this.only_scan_dependencies = try reader.readValue(ScanDependencyMode); - }, - 22 => { - this.generate_node_module_bundle = try reader.readValue(bool); - }, - else => { - return error.InvalidMessage; - }, - } - } - unreachable; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - if (this.jsx) |jsx| { - try writer.writeFieldID(1); - try writer.writeValue(jsx); - } - if (this.tsconfig_override) |tsconfig_override| { - try writer.writeFieldID(2); - try writer.writeValue(tsconfig_override); - } - if (this.resolve) |resolve| { - try writer.writeFieldID(3); - try writer.writeEnum(resolve); - } - if (this.public_url) |public_url| { - try writer.writeFieldID(4); - try writer.writeValue(public_url); - } - if (this.absolute_working_dir) |absolute_working_dir| { - try writer.writeFieldID(5); - try writer.writeValue(absolute_working_dir); - } - if (this.define_keys) |define_keys| { - try writer.writeFieldID(6); - try writer.writeArray([]const u8, define_keys); - } - if (this.define_values) |define_values| { - try writer.writeFieldID(7); - try writer.writeArray([]const u8, define_values); - } - if (this.preserve_symlinks) |preserve_symlinks| { - try writer.writeFieldID(8); - try writer.writeInt(@intCast(u8, @boolToInt(preserve_symlinks))); - } - if (this.entry_points) |entry_points| { - try writer.writeFieldID(9); - try writer.writeArray([]const u8, entry_points); - } - if (this.write) |write| { - try writer.writeFieldID(10); - try writer.writeInt(@intCast(u8, @boolToInt(write))); - } - if (this.inject) |inject| { - try writer.writeFieldID(11); - try writer.writeArray([]const u8, inject); - } - if (this.output_dir) |output_dir| { - try writer.writeFieldID(12); - try writer.writeValue(output_dir); - } - if (this.external) |external| { - try writer.writeFieldID(13); - try writer.writeArray([]const u8, external); - } - if (this.loader_keys) |loader_keys| { - try writer.writeFieldID(14); - try writer.writeArray([]const u8, loader_keys); - } - if (this.loader_values) |loader_values| { - try writer.writeFieldID(15); - try writer.writeArray(Loader, loader_values); - } - if (this.main_fields) |main_fields| { - try writer.writeFieldID(16); - try writer.writeArray([]const u8, main_fields); - } - if (this.platform) |platform| { - try writer.writeFieldID(17); - try writer.writeEnum(platform); - } - if (this.serve) |serve| { - try writer.writeFieldID(18); - try writer.writeInt(@intCast(u8, @boolToInt(serve))); - } - if (this.extension_order) |extension_order| { - try writer.writeFieldID(19); - try writer.writeArray([]const u8, extension_order); - } - if (this.public_dir) |public_dir| { - try writer.writeFieldID(20); - try writer.writeValue(public_dir); - } - if (this.only_scan_dependencies) |only_scan_dependencies| { - try writer.writeFieldID(21); - try writer.writeEnum(only_scan_dependencies); - } - if (this.generate_node_module_bundle) |generate_node_module_bundle| { - try writer.writeFieldID(22); - try writer.writeInt(@intCast(u8, @boolToInt(generate_node_module_bundle))); - } - try writer.endMessage(); - } - }; - - pub const FileHandle = struct { - /// path - path: []const u8, - - /// size - size: u32 = 0, - - /// fd - fd: u32 = 0, - - pub fn decode(reader: anytype) anyerror!FileHandle { - var this = std.mem.zeroes(FileHandle); - - this.path = try reader.readValue([]const u8); - this.size = try reader.readValue(u32); - this.fd = try reader.readValue(u32); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.path); - try writer.writeInt(this.size); - try writer.writeInt(this.fd); - } - }; - - pub const Transform = struct { - /// handle - handle: ?FileHandle = null, - - /// path - path: ?[]const u8 = null, - - /// contents - contents: []const u8, - - /// loader - loader: ?Loader = null, - - /// options - options: ?TransformOptions = null, - - pub fn decode(reader: anytype) anyerror!Transform { - var this = std.mem.zeroes(Transform); - - while (true) { - switch (try reader.readByte()) { - 0 => { - return this; - }, - - 1 => { - this.handle = try reader.readValue(FileHandle); - }, - 2 => { - this.path = try reader.readValue([]const u8); - }, - 3 => { - this.contents = try reader.readArray(u8); - }, - 4 => { - this.loader = try reader.readValue(Loader); - }, - 5 => { - this.options = try reader.readValue(TransformOptions); - }, - else => { - return error.InvalidMessage; - }, - } - } - unreachable; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - if (this.handle) |handle| { - try writer.writeFieldID(1); - try writer.writeValue(handle); - } - if (this.path) |path| { - try writer.writeFieldID(2); - try writer.writeValue(path); - } - if (this.contents) |contents| { - try writer.writeFieldID(3); - try writer.writeArray(u8, contents); - } - if (this.loader) |loader| { - try writer.writeFieldID(4); - try writer.writeEnum(loader); - } - if (this.options) |options| { - try writer.writeFieldID(5); - try writer.writeValue(options); - } - try writer.endMessage(); - } - }; - - pub const TransformResponseStatus = enum(u32) { - _none, - /// success - success, - - /// fail - fail, - - _, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; - - pub const OutputFile = struct { - /// data - data: []const u8, - - /// path - path: []const u8, - - pub fn decode(reader: anytype) anyerror!OutputFile { - var this = std.mem.zeroes(OutputFile); - - this.data = try reader.readArray(u8); - this.path = try reader.readValue([]const u8); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeArray(u8, this.data); - try writer.writeValue(this.path); - } - }; - - pub const TransformResponse = struct { - /// status - status: TransformResponseStatus, - - /// files - files: []OutputFile, - - /// errors - errors: []Message, - - pub fn decode(reader: anytype) anyerror!TransformResponse { - var this = std.mem.zeroes(TransformResponse); - - this.status = try reader.readValue(TransformResponseStatus); - this.files = try reader.readArray(OutputFile); - this.errors = try reader.readArray(Message); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.status); - try writer.writeArray(OutputFile, this.files); - try writer.writeArray(Message, this.errors); - } - }; - - pub const MessageKind = enum(u32) { - _none, - /// err - err, - - /// warn - warn, - - /// note - note, - - /// debug - debug, - - _, - - pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { - return try std.json.stringify(@tagName(self), opts, o); - } - }; - - pub const Location = struct { - /// file - file: []const u8, - - /// namespace - namespace: []const u8, - - /// line - line: i32 = 0, - - /// column - column: i32 = 0, - - /// line_text - line_text: []const u8, - - /// suggestion - suggestion: []const u8, - - /// offset - offset: u32 = 0, - - pub fn decode(reader: anytype) anyerror!Location { - var this = std.mem.zeroes(Location); - - this.file = try reader.readValue([]const u8); - this.namespace = try reader.readValue([]const u8); - this.line = try reader.readValue(i32); - this.column = try reader.readValue(i32); - this.line_text = try reader.readValue([]const u8); - this.suggestion = try reader.readValue([]const u8); - this.offset = try reader.readValue(u32); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeValue(this.file); - try writer.writeValue(this.namespace); - try writer.writeInt(this.line); - try writer.writeInt(this.column); - try writer.writeValue(this.line_text); - try writer.writeValue(this.suggestion); - try writer.writeInt(this.offset); - } - }; - - pub const MessageData = struct { - /// text - text: ?[]const u8 = null, - - /// location - location: ?Location = null, - - pub fn decode(reader: anytype) anyerror!MessageData { - var this = std.mem.zeroes(MessageData); - - while (true) { - switch (try reader.readByte()) { - 0 => { - return this; - }, - - 1 => { - this.text = try reader.readValue([]const u8); - }, - 2 => { - this.location = try reader.readValue(Location); - }, - else => { - return error.InvalidMessage; - }, - } - } - unreachable; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - if (this.text) |text| { - try writer.writeFieldID(1); - try writer.writeValue(text); - } - if (this.location) |location| { - try writer.writeFieldID(2); - try writer.writeValue(location); - } - try writer.endMessage(); - } - }; - - pub const Message = struct { - /// kind - kind: MessageKind, - - /// data - data: MessageData, - - /// notes - notes: []MessageData, - - pub fn decode(reader: anytype) anyerror!Message { - var this = std.mem.zeroes(Message); - - this.kind = try reader.readValue(MessageKind); - this.data = try reader.readValue(MessageData); - this.notes = try reader.readArray(MessageData); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeEnum(this.kind); - try writer.writeValue(this.data); - try writer.writeArray(MessageData, this.notes); - } - }; - - pub const Log = struct { - /// warnings - warnings: u32 = 0, - - /// errors - errors: u32 = 0, - - /// msgs - msgs: []Message, - - pub fn decode(reader: anytype) anyerror!Log { - var this = std.mem.zeroes(Log); - - this.warnings = try reader.readValue(u32); - this.errors = try reader.readValue(u32); - this.msgs = try reader.readArray(Message); - return this; - } - - pub fn encode(this: *const @This(), writer: anytype) anyerror!void { - try writer.writeInt(this.warnings); - try writer.writeInt(this.errors); - try writer.writeArray(Message, this.msgs); - } - }; + }; +pub const ResolveMode = enum(u8) { + +_none, + /// disable + disable, + + /// lazy + lazy, + + /// dev + dev, + + /// bundle + bundle, + +_, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + + +}; + +pub const Platform = enum(u8) { + +_none, + /// browser + browser, + + /// node + node, + +_, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + + +}; + +pub const JsxRuntime = enum(u8) { + +_none, + /// automatic + automatic, + + /// classic + classic, + +_, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + + +}; + +pub const Jsx = struct { +/// factory +factory: []const u8, + +/// runtime +runtime: JsxRuntime, + +/// fragment +fragment: []const u8, + +/// development +development: bool = false, + +/// import_source +import_source: []const u8, + +/// react_fast_refresh +react_fast_refresh: bool = false, + + +pub fn decode(reader: anytype) anyerror!Jsx { + var this = std.mem.zeroes(Jsx); + + this.factory = try reader.readValue([]const u8); + this.runtime = try reader.readValue(JsxRuntime); + this.fragment = try reader.readValue([]const u8); + this.development = try reader.readValue(bool); + this.import_source = try reader.readValue([]const u8); + this.react_fast_refresh = try reader.readValue(bool); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.factory); + try writer.writeEnum(this.runtime); + try writer.writeValue(this.fragment); + try writer.writeInt(@intCast(u8, @boolToInt(this.development))); + try writer.writeValue(this.import_source); + try writer.writeInt(@intCast(u8, @boolToInt(this.react_fast_refresh))); +} + +}; + +pub const StringPointer = packed struct { +/// offset +offset: u32 = 0, + +/// length +length: u32 = 0, + + +pub fn decode(reader: anytype) anyerror!StringPointer { + var this = std.mem.zeroes(StringPointer); + + this.offset = try reader.readValue(u32); + this.length = try reader.readValue(u32); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.offset); + try writer.writeInt(this.length); +} + +}; + +pub const JavascriptBundledModule = struct { +/// path +path: StringPointer, + +/// code +code: StringPointer, + +/// package_id +package_id: u32 = 0, + +/// path_extname_length +path_extname_length: u8 = 0, + + +pub fn decode(reader: anytype) anyerror!JavascriptBundledModule { + var this = std.mem.zeroes(JavascriptBundledModule); + + this.path = try reader.readValue(StringPointer); + this.code = try reader.readValue(StringPointer); + this.package_id = try reader.readValue(u32); + this.path_extname_length = try reader.readValue(u8); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.path); + try writer.writeValue(this.code); + try writer.writeInt(this.package_id); + try writer.writeInt(this.path_extname_length); +} + +}; + +pub const JavascriptBundledPackage = struct { +/// name +name: StringPointer, + +/// version +version: StringPointer, + +/// hash +hash: u32 = 0, + +/// modules_offset +modules_offset: u32 = 0, + +/// modules_length +modules_length: u32 = 0, + + +pub fn decode(reader: anytype) anyerror!JavascriptBundledPackage { + var this = std.mem.zeroes(JavascriptBundledPackage); + + this.name = try reader.readValue(StringPointer); + this.version = try reader.readValue(StringPointer); + this.hash = try reader.readValue(u32); + this.modules_offset = try reader.readValue(u32); + this.modules_length = try reader.readValue(u32); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.name); + try writer.writeValue(this.version); + try writer.writeInt(this.hash); + try writer.writeInt(this.modules_offset); + try writer.writeInt(this.modules_length); +} + +}; + +pub const JavascriptBundle = struct { +/// modules +modules: []const JavascriptBundledModule, + +/// packages +packages: []const JavascriptBundledPackage, + +/// etag +etag: []const u8, + +/// generated_at +generated_at: u32 = 0, + +/// app_package_json_dependencies_hash +app_package_json_dependencies_hash: []const u8, + +/// import_from_name +import_from_name: []const u8, + +/// manifest_string +manifest_string: []const u8, + + +pub fn decode(reader: anytype) anyerror!JavascriptBundle { + var this = std.mem.zeroes(JavascriptBundle); + + this.modules = try reader.readArray(JavascriptBundledModule); + this.packages = try reader.readArray(JavascriptBundledPackage); + this.etag = try reader.readArray(u8); + this.generated_at = try reader.readValue(u32); + this.app_package_json_dependencies_hash = try reader.readArray(u8); + this.import_from_name = try reader.readArray(u8); + this.manifest_string = try reader.readArray(u8); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(JavascriptBundledModule, this.modules); + try writer.writeArray(JavascriptBundledPackage, this.packages); + try writer.writeArray(u8, this.etag); + try writer.writeInt(this.generated_at); + try writer.writeArray(u8, this.app_package_json_dependencies_hash); + try writer.writeArray(u8, this.import_from_name); + try writer.writeArray(u8, this.manifest_string); +} + +}; + +pub const JavascriptBundleContainer = struct { +/// bundle_format_version +bundle_format_version: ?u32 = null, + +/// bundle +bundle: ?JavascriptBundle = null, + +/// code_length +code_length: ?u32 = null, + + +pub fn decode(reader: anytype) anyerror!JavascriptBundleContainer { + var this = std.mem.zeroes(JavascriptBundleContainer); + + while(true) { + switch (try reader.readByte()) { + 0 => { return this; }, + + 1 => { + this.bundle_format_version = try reader.readValue(u32); +}, + 2 => { + this.bundle = try reader.readValue(JavascriptBundle); +}, + 3 => { + this.code_length = try reader.readValue(u32); +}, + else => { + return error.InvalidMessage; + }, + } + } +unreachable; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { +if (this.bundle_format_version) |bundle_format_version| { + try writer.writeFieldID(1); + try writer.writeInt(bundle_format_version); +} +if (this.bundle) |bundle| { + try writer.writeFieldID(2); + try writer.writeValue(bundle); +} +if (this.code_length) |code_length| { + try writer.writeFieldID(3); + try writer.writeInt(code_length); +} +try writer.endMessage(); +} + +}; + +pub const ScanDependencyMode = enum(u8) { + +_none, + /// app + app, + + /// all + all, + +_, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + + +}; + +pub const ModuleImportType = enum(u8) { + +_none, + /// import + import, + + /// require + require, + +_, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + + +}; + +pub const ModuleImportRecord = struct { +/// kind +kind: ModuleImportType, + +/// path +path: []const u8, + +/// dynamic +dynamic: bool = false, + + +pub fn decode(reader: anytype) anyerror!ModuleImportRecord { + var this = std.mem.zeroes(ModuleImportRecord); + + this.kind = try reader.readValue(ModuleImportType); + this.path = try reader.readValue([]const u8); + this.dynamic = try reader.readValue(bool); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.kind); + try writer.writeValue(this.path); + try writer.writeInt(@intCast(u8, @boolToInt(this.dynamic))); +} + +}; + +pub const Module = struct { +/// path +path: []const u8, + +/// imports +imports: []const ModuleImportRecord, + + +pub fn decode(reader: anytype) anyerror!Module { + var this = std.mem.zeroes(Module); + + this.path = try reader.readValue([]const u8); + this.imports = try reader.readArray(ModuleImportRecord); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.path); + try writer.writeArray(ModuleImportRecord, this.imports); +} + +}; + +pub const StringMap = struct { +/// keys +keys: []const []const u8, + +/// values +values: []const []const u8, + + +pub fn decode(reader: anytype) anyerror!StringMap { + var this = std.mem.zeroes(StringMap); + + this.keys = try reader.readArray([]const u8); + this.values = try reader.readArray([]const u8); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray([]const u8, this.keys); + try writer.writeArray([]const u8, this.values); +} + +}; + +pub const LoaderMap = struct { +/// extensions +extensions: []const []const u8, + +/// loaders +loaders: []const Loader, + + +pub fn decode(reader: anytype) anyerror!LoaderMap { + var this = std.mem.zeroes(LoaderMap); + + this.extensions = try reader.readArray([]const u8); + this.loaders = try reader.readArray(Loader); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray([]const u8, this.extensions); + try writer.writeArray(Loader, this.loaders); +} + +}; + +pub const TransformOptions = struct { +/// jsx +jsx: ?Jsx = null, + +/// tsconfig_override +tsconfig_override: ?[]const u8 = null, + +/// resolve +resolve: ?ResolveMode = null, + +/// public_url +public_url: ?[]const u8 = null, + +/// absolute_working_dir +absolute_working_dir: ?[]const u8 = null, + +/// define +define: ?StringMap = null, + +/// preserve_symlinks +preserve_symlinks: ?bool = null, + +/// entry_points +entry_points: []const []const u8, + +/// write +write: ?bool = null, + +/// inject +inject: []const []const u8, + +/// output_dir +output_dir: ?[]const u8 = null, + +/// external +external: []const []const u8, + +/// loaders +loaders: ?LoaderMap = null, + +/// main_fields +main_fields: []const []const u8, + +/// platform +platform: ?Platform = null, + +/// serve +serve: ?bool = null, + +/// extension_order +extension_order: []const []const u8, + +/// public_dir +public_dir: ?[]const u8 = null, + +/// only_scan_dependencies +only_scan_dependencies: ?ScanDependencyMode = null, + +/// generate_node_module_bundle +generate_node_module_bundle: ?bool = null, + +/// node_modules_bundle_path +node_modules_bundle_path: ?[]const u8 = null, + + +pub fn decode(reader: anytype) anyerror!TransformOptions { + var this = std.mem.zeroes(TransformOptions); + + while(true) { + switch (try reader.readByte()) { + 0 => { return this; }, + + 1 => { + this.jsx = try reader.readValue(Jsx); +}, + 2 => { + this.tsconfig_override = try reader.readValue([]const u8); +}, + 3 => { + this.resolve = try reader.readValue(ResolveMode); +}, + 4 => { + this.public_url = try reader.readValue([]const u8); +}, + 5 => { + this.absolute_working_dir = try reader.readValue([]const u8); +}, + 6 => { + this.define = try reader.readValue(StringMap); +}, + 7 => { + this.preserve_symlinks = try reader.readValue(bool); +}, + 8 => { + this.entry_points = try reader.readArray([]const u8); +}, + 9 => { + this.write = try reader.readValue(bool); +}, + 10 => { + this.inject = try reader.readArray([]const u8); +}, + 11 => { + this.output_dir = try reader.readValue([]const u8); +}, + 12 => { + this.external = try reader.readArray([]const u8); +}, + 13 => { + this.loaders = try reader.readValue(LoaderMap); +}, + 14 => { + this.main_fields = try reader.readArray([]const u8); +}, + 15 => { + this.platform = try reader.readValue(Platform); +}, + 16 => { + this.serve = try reader.readValue(bool); +}, + 17 => { + this.extension_order = try reader.readArray([]const u8); +}, + 18 => { + this.public_dir = try reader.readValue([]const u8); +}, + 19 => { + this.only_scan_dependencies = try reader.readValue(ScanDependencyMode); +}, + 20 => { + this.generate_node_module_bundle = try reader.readValue(bool); +}, + 21 => { + this.node_modules_bundle_path = try reader.readValue([]const u8); +}, + else => { + return error.InvalidMessage; + }, + } + } +unreachable; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { +if (this.jsx) |jsx| { + try writer.writeFieldID(1); + try writer.writeValue(jsx); +} +if (this.tsconfig_override) |tsconfig_override| { + try writer.writeFieldID(2); + try writer.writeValue(tsconfig_override); +} +if (this.resolve) |resolve| { + try writer.writeFieldID(3); + try writer.writeEnum(resolve); +} +if (this.public_url) |public_url| { + try writer.writeFieldID(4); + try writer.writeValue(public_url); +} +if (this.absolute_working_dir) |absolute_working_dir| { + try writer.writeFieldID(5); + try writer.writeValue(absolute_working_dir); +} +if (this.define) |define| { + try writer.writeFieldID(6); + try writer.writeValue(define); +} +if (this.preserve_symlinks) |preserve_symlinks| { + try writer.writeFieldID(7); + try writer.writeInt(@intCast(u8, @boolToInt(preserve_symlinks))); +} +if (this.entry_points) |entry_points| { + try writer.writeFieldID(8); + try writer.writeArray([]const u8, entry_points); +} +if (this.write) |write| { + try writer.writeFieldID(9); + try writer.writeInt(@intCast(u8, @boolToInt(write))); +} +if (this.inject) |inject| { + try writer.writeFieldID(10); + try writer.writeArray([]const u8, inject); +} +if (this.output_dir) |output_dir| { + try writer.writeFieldID(11); + try writer.writeValue(output_dir); +} +if (this.external) |external| { + try writer.writeFieldID(12); + try writer.writeArray([]const u8, external); +} +if (this.loaders) |loaders| { + try writer.writeFieldID(13); + try writer.writeValue(loaders); +} +if (this.main_fields) |main_fields| { + try writer.writeFieldID(14); + try writer.writeArray([]const u8, main_fields); +} +if (this.platform) |platform| { + try writer.writeFieldID(15); + try writer.writeEnum(platform); +} +if (this.serve) |serve| { + try writer.writeFieldID(16); + try writer.writeInt(@intCast(u8, @boolToInt(serve))); +} +if (this.extension_order) |extension_order| { + try writer.writeFieldID(17); + try writer.writeArray([]const u8, extension_order); +} +if (this.public_dir) |public_dir| { + try writer.writeFieldID(18); + try writer.writeValue(public_dir); +} +if (this.only_scan_dependencies) |only_scan_dependencies| { + try writer.writeFieldID(19); + try writer.writeEnum(only_scan_dependencies); +} +if (this.generate_node_module_bundle) |generate_node_module_bundle| { + try writer.writeFieldID(20); + try writer.writeInt(@intCast(u8, @boolToInt(generate_node_module_bundle))); +} +if (this.node_modules_bundle_path) |node_modules_bundle_path| { + try writer.writeFieldID(21); + try writer.writeValue(node_modules_bundle_path); +} +try writer.endMessage(); +} + +}; + +pub const FileHandle = struct { +/// path +path: []const u8, + +/// size +size: u32 = 0, + +/// fd +fd: u32 = 0, + + +pub fn decode(reader: anytype) anyerror!FileHandle { + var this = std.mem.zeroes(FileHandle); + + this.path = try reader.readValue([]const u8); + this.size = try reader.readValue(u32); + this.fd = try reader.readValue(u32); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.path); + try writer.writeInt(this.size); + try writer.writeInt(this.fd); +} + +}; + +pub const Transform = struct { +/// handle +handle: ?FileHandle = null, + +/// path +path: ?[]const u8 = null, + +/// contents +contents: []const u8, + +/// loader +loader: ?Loader = null, + +/// options +options: ?TransformOptions = null, + + +pub fn decode(reader: anytype) anyerror!Transform { + var this = std.mem.zeroes(Transform); + + while(true) { + switch (try reader.readByte()) { + 0 => { return this; }, + + 1 => { + this.handle = try reader.readValue(FileHandle); +}, + 2 => { + this.path = try reader.readValue([]const u8); +}, + 3 => { + this.contents = try reader.readArray(u8); +}, + 4 => { + this.loader = try reader.readValue(Loader); +}, + 5 => { + this.options = try reader.readValue(TransformOptions); +}, + else => { + return error.InvalidMessage; + }, + } + } +unreachable; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { +if (this.handle) |handle| { + try writer.writeFieldID(1); + try writer.writeValue(handle); +} +if (this.path) |path| { + try writer.writeFieldID(2); + try writer.writeValue(path); +} +if (this.contents) |contents| { + try writer.writeFieldID(3); + try writer.writeArray(u8, contents); +} +if (this.loader) |loader| { + try writer.writeFieldID(4); + try writer.writeEnum(loader); +} +if (this.options) |options| { + try writer.writeFieldID(5); + try writer.writeValue(options); +} +try writer.endMessage(); +} + +}; + +pub const TransformResponseStatus = enum(u32) { + +_none, + /// success + success, + + /// fail + fail, + +_, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + + +}; + +pub const OutputFile = struct { +/// data +data: []const u8, + +/// path +path: []const u8, + + +pub fn decode(reader: anytype) anyerror!OutputFile { + var this = std.mem.zeroes(OutputFile); + + this.data = try reader.readArray(u8); + this.path = try reader.readValue([]const u8); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeArray(u8, this.data); + try writer.writeValue(this.path); +} + +}; + +pub const TransformResponse = struct { +/// status +status: TransformResponseStatus, + +/// files +files: []const OutputFile, + +/// errors +errors: []const Message, + + +pub fn decode(reader: anytype) anyerror!TransformResponse { + var this = std.mem.zeroes(TransformResponse); + + this.status = try reader.readValue(TransformResponseStatus); + this.files = try reader.readArray(OutputFile); + this.errors = try reader.readArray(Message); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.status); + try writer.writeArray(OutputFile, this.files); + try writer.writeArray(Message, this.errors); +} + +}; + +pub const MessageKind = enum(u32) { + +_none, + /// err + err, + + /// warn + warn, + + /// note + note, + + /// debug + debug, + +_, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + + +}; + +pub const Location = struct { +/// file +file: []const u8, + +/// namespace +namespace: []const u8, + +/// line +line: i32 = 0, + +/// column +column: i32 = 0, + +/// line_text +line_text: []const u8, + +/// suggestion +suggestion: []const u8, + +/// offset +offset: u32 = 0, + + +pub fn decode(reader: anytype) anyerror!Location { + var this = std.mem.zeroes(Location); + + this.file = try reader.readValue([]const u8); + this.namespace = try reader.readValue([]const u8); + this.line = try reader.readValue(i32); + this.column = try reader.readValue(i32); + this.line_text = try reader.readValue([]const u8); + this.suggestion = try reader.readValue([]const u8); + this.offset = try reader.readValue(u32); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeValue(this.file); + try writer.writeValue(this.namespace); + try writer.writeInt(this.line); + try writer.writeInt(this.column); + try writer.writeValue(this.line_text); + try writer.writeValue(this.suggestion); + try writer.writeInt(this.offset); +} + +}; + +pub const MessageData = struct { +/// text +text: ?[]const u8 = null, + +/// location +location: ?Location = null, + + +pub fn decode(reader: anytype) anyerror!MessageData { + var this = std.mem.zeroes(MessageData); + + while(true) { + switch (try reader.readByte()) { + 0 => { return this; }, + + 1 => { + this.text = try reader.readValue([]const u8); +}, + 2 => { + this.location = try reader.readValue(Location); +}, + else => { + return error.InvalidMessage; + }, + } + } +unreachable; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { +if (this.text) |text| { + try writer.writeFieldID(1); + try writer.writeValue(text); +} +if (this.location) |location| { + try writer.writeFieldID(2); + try writer.writeValue(location); +} +try writer.endMessage(); +} + +}; + +pub const Message = struct { +/// kind +kind: MessageKind, + +/// data +data: MessageData, + +/// notes +notes: []const MessageData, + + +pub fn decode(reader: anytype) anyerror!Message { + var this = std.mem.zeroes(Message); + + this.kind = try reader.readValue(MessageKind); + this.data = try reader.readValue(MessageData); + this.notes = try reader.readArray(MessageData); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeEnum(this.kind); + try writer.writeValue(this.data); + try writer.writeArray(MessageData, this.notes); +} + +}; + +pub const Log = struct { +/// warnings +warnings: u32 = 0, + +/// errors +errors: u32 = 0, + +/// msgs +msgs: []const Message, + + +pub fn decode(reader: anytype) anyerror!Log { + var this = std.mem.zeroes(Log); + + this.warnings = try reader.readValue(u32); + this.errors = try reader.readValue(u32); + this.msgs = try reader.readArray(Message); + return this; +} + +pub fn encode(this: *const @This(), writer: anytype) anyerror!void { + try writer.writeInt(this.warnings); + try writer.writeInt(this.errors); + try writer.writeArray(Message, this.msgs); +} + +}; + + +}; + + const ExamplePackedStruct = packed struct { len: u32 = 0, offset: u32 = 0, diff --git a/src/bundler.zig b/src/bundler.zig index 9b8ac11b3e..630e967729 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -27,7 +27,7 @@ const resolve_path = @import("./resolver/resolve_path.zig"); const runtime = @import("./runtime.zig"); const Timer = @import("./timer.zig"); const hash_map = @import("hash_map.zig"); - +const PackageJSON = @import("./resolver/package_json.zig").PackageJSON; const DebugLogs = _resolver.DebugLogs; pub const ServeResult = struct { @@ -374,14 +374,22 @@ pub fn NewBundler(cache_files: bool) type { javascript_bundle.modules = this.module_list.items; javascript_bundle.packages = sorted_package_list; javascript_bundle.manifest_string = this.header_string_buffer.list.items; - + var etag_bytes: [8]u8 = undefined; + const etag_u64 = hasher.final(); + std.mem.writeIntNative(u64, &etag_bytes, etag_u64); + javascript_bundle.etag = &etag_bytes; javascript_bundle.generated_at = @truncate(u32, @intCast(u64, std.time.milliTimestamp())); - javascript_bundle.import_from_name = destination; - - var etag_bytes: [8]u8 = undefined; - std.mem.writeIntNative(u64, &etag_bytes, hasher.final()); - javascript_bundle.etag = &etag_bytes; + const basename = std.fs.path.basename(destination); + const extname = std.fs.path.extension(basename); + javascript_bundle.import_from_name = try std.fmt.allocPrint( + this.allocator, + "/{s}.{x}.jsb", + .{ + basename[0 .. basename.len - extname.len], + etag_u64, + }, + ); javascript_bundle_container.bundle_format_version = current_version; javascript_bundle_container.bundle = javascript_bundle; @@ -450,6 +458,7 @@ pub fn NewBundler(cache_files: bool) type { fn processImportRecord(this: *GenerateNodeModuleBundle, import_record: ImportRecord) !void {} const node_module_root_string = "node_modules" ++ std.fs.path.sep_str; threadlocal var package_key_buf: [512]u8 = undefined; + fn processFile(this: *GenerateNodeModuleBundle, _resolve: _resolver.Result) !void { var resolve = _resolve; if (resolve.is_external) return; @@ -459,7 +468,7 @@ pub fn NewBundler(cache_files: bool) type { var bundler = this.bundler; defer this.scan_pass_result.reset(); defer this.bundler.resetStore(); - const file_path = resolve.path_pair.primary; + var file_path = resolve.path_pair.primary; // If we're in a node_module, build that almost normally if (resolve.is_from_node_modules) { @@ -476,12 +485,13 @@ pub fn NewBundler(cache_files: bool) type { true, ); const source = logger.Source.initFile(Fs.File{ .path = file_path, .contents = entry.contents }, bundler.allocator) catch return null; - const source_dir = file_path.name.dir; + const source_dir = file_path.name.dirWithTrailingSlash(); var jsx = bundler.options.jsx; jsx.parse = loader.isJSX(); var opts = js_parser.Parser.Options.init(jsx, loader); opts.output_commonjs = true; + var ast: js_ast.Ast = (try bundler.resolver.caches.js.parse( bundler.allocator, opts, @@ -504,11 +514,37 @@ pub fn NewBundler(cache_files: bool) type { } const absolute_path = resolved_import.path_pair.primary.text; + const package_json: *const PackageJSON = (resolved_import.package_json orelse (this.bundler.resolver.packageJSONForResolvedNodeModule(resolved_import) orelse { + this.log.addWarningFmt( + &source, + import_record.range.loc, + this.allocator, + "Failed to find package.json for \"{s}\". This will be unresolved and might break at runtime. If it's external, you could add it to the external list.", + .{ + resolved_import.path_pair.primary.text, + source.path.text, + }, + ) catch {}; + continue; + })); + + // trim node_modules/${package.name}/ from the string to save space + // This reduces metadata size by about 30% for a large-ish file + // A future optimization here could be to reuse the string from the original path + var node_module_root = strings.indexOf(resolved_import.path_pair.primary.text, node_module_root_string) orelse unreachable; + // // omit package name + // node_module_root += package_json.name.len; + // omit node_modules + node_module_root += node_module_root_string.len; + // omit trailing separator + node_module_root += 1; // It should be the first index, not the last to support bundling multiple of the same package - if (strings.indexOf(absolute_path, node_module_root_string)) |node_module_start| { - import_record.path = Fs.Path.init(absolute_path[node_module_root_string.len + node_module_start ..]); - } + import_record.path = Fs.Path.init( + absolute_path[node_module_root..], + ); + + import_record.package_json_hash = package_json.hash; const get_or_put_result = try this.resolved_paths.getOrPut(absolute_path); @@ -520,6 +556,25 @@ pub fn NewBundler(cache_files: bool) type { } else |err| {} } + const PackageNameVersionPair = struct { name: string, version: string, hash: u32 }; + var package: PackageNameVersionPair = undefined; + + if (resolve.package_json) |package_json| { + package = .{ + .name = package_json.name, + .version = package_json.version, + .hash = package_json.hash, + }; + } else { + if (this.bundler.resolver.packageJSONForResolvedNodeModule(&resolve)) |package_json| { + package = .{ + .name = package_json.name, + .version = package_json.version, + .hash = package_json.hash, + }; + } + } + const code_offset = this.tmpfile_byte_offset - code_start_byte_offset; var writer = js_printer.NewFileWriter(this.tmpfile); var symbols: [][]js_ast.Symbol = &([_][]js_ast.Symbol{ast.symbols}); @@ -538,6 +593,7 @@ pub fn NewBundler(cache_files: bool) type { .externals = ast.externals, // Indent by one .indent = 1, + .package_json_hash = package.hash, .runtime_imports = ast.runtime_imports, }, Linker, @@ -546,30 +602,14 @@ pub fn NewBundler(cache_files: bool) type { ); this.tmpfile_byte_offset += code_length; - const PackageNameVersionPair = struct { name: string, version: string }; - var package: PackageNameVersionPair = undefined; - - if (resolve.package_json_version) |version| { - package = .{ .name = resolve.package_json_name.?, .version = version }; - } else { - if (this.bundler.resolver.packageJSONForResolvedNodeModule(&resolve)) |package_json| { - package = .{ - .name = package_json.name, - .version = package_json.version, - }; - } - } - - const package_id_key = try std.fmt.bufPrint(&package_key_buf, "{s}@{s}", .{ package.name, package.version }); - const package_id_key_hash = std.hash.Wyhash.hash(0, package_id_key); - var package_get_or_put_entry = try this.package_list_map.getOrPut(package_id_key_hash); + var package_get_or_put_entry = try this.package_list_map.getOrPut(package.hash); if (!package_get_or_put_entry.found_existing) { package_get_or_put_entry.value_ptr.* = @truncate(u32, this.package_list.items.len); try this.package_list.append( Api.JavascriptBundledPackage{ .name = try this.appendHeaderString(package.name), .version = try this.appendHeaderString(package.version), - .hash = @truncate(u32, package_id_key_hash), + .hash = package.hash, }, ); } @@ -584,11 +624,14 @@ pub fn NewBundler(cache_files: bool) type { // omit trailing separator node_module_root += 1; + var path_str = resolve.path_pair.primary.text[node_module_root..]; + var path_extname_length = @truncate(u8, std.fs.path.extension(path_str).len); try this.module_list.append( Api.JavascriptBundledModule{ .path = try this.appendHeaderString( - resolve.path_pair.primary.text[node_module_root..], + path_str, ), + .path_extname_length = path_extname_length, .package_id = package_get_or_put_entry.value_ptr.*, .code = Api.StringPointer{ .length = @truncate(u32, code_length), @@ -615,7 +658,7 @@ pub fn NewBundler(cache_files: bool) type { ) catch return; const source = logger.Source.initFile(Fs.File{ .path = file_path, .contents = entry.contents }, bundler.allocator) catch return null; - const source_dir = file_path.name.dir; + const source_dir = file_path.name.dirWithTrailingSlash(); var jsx = bundler.options.jsx; jsx.parse = loader.isJSX(); @@ -802,7 +845,7 @@ pub fn NewBundler(cache_files: bool) type { ) catch return null; const source = logger.Source.initFile(Fs.File{ .path = file_path, .contents = entry.contents }, bundler.allocator) catch return null; - const source_dir = file_path.name.dir; + const source_dir = file_path.name.dirWithTrailingSlash(); var jsx = bundler.options.jsx; jsx.parse = loader.isJSX(); @@ -1258,6 +1301,7 @@ pub fn NewBundler(cache_files: bool) type { if (bundler.resolve_results.contains(key)) { continue; } + try bundler.resolve_results.put(key, result); entry_points[entry_point_i] = result; @@ -1281,8 +1325,9 @@ pub fn NewBundler(cache_files: bool) type { } else { const output_dir = bundler.options.output_dir_handle orelse { Output.printError("Invalid or missing output directory.", .{}); - std.os.exit(1); + Global.crash(); }; + try switch (bundler.options.import_path_format) { .relative => bundler.processResolveQueue(.relative, std.fs.Dir, output_dir), .relative_nodejs => bundler.processResolveQueue(.relative_nodejs, std.fs.Dir, output_dir), @@ -1360,45 +1405,18 @@ pub const Transformer = struct { ) !options.TransformResult { js_ast.Expr.Data.Store.create(allocator); js_ast.Stmt.Data.Store.create(allocator); - var raw_defines = try options.stringHashMapFromArrays(RawDefines, allocator, opts.define_keys, opts.define_values); - if (opts.define_keys.len == 0) { - try raw_defines.put(options.DefaultUserDefines.NodeEnv.Key, options.DefaultUserDefines.NodeEnv.Value); - } - var user_defines = try DefineData.from_input(raw_defines, log, alloc.static); - var define = try Define.init( - alloc.static, - user_defines, - ); + var define = try options.definesFromTransformOptions(allocator, log, opts.define); const cwd = if (opts.absolute_working_dir) |workdir| try std.fs.realpathAlloc(allocator, workdir) else try std.process.getCwdAlloc(allocator); const output_dir_parts = [_]string{ try std.process.getCwdAlloc(allocator), opts.output_dir orelse "out" }; const output_dir = try std.fs.path.join(allocator, &output_dir_parts); var output_files = try std.ArrayList(options.OutputFile).initCapacity(allocator, opts.entry_points.len); - var loader_values = try allocator.alloc(options.Loader, opts.loader_values.len); const platform = options.Platform.from(opts.platform); const out_extensions = platform.outExtensions(allocator); - for (loader_values) |_, i| { - const loader = switch (opts.loader_values[i]) { - .jsx => options.Loader.jsx, - .js => options.Loader.js, - .ts => options.Loader.ts, - .css => options.Loader.css, - .tsx => options.Loader.tsx, - .json => options.Loader.json, - else => unreachable, - }; - - loader_values[i] = loader; - } - var loader_map = try options.stringHashMapFromArrays( - std.StringHashMap(options.Loader), - allocator, - opts.loader_keys, - loader_values, - ); + var loader_map = try options.loadersFromTransformOptions(allocator, opts.loaders); var use_default_loaders = loader_map.count() == 0; var jsx = if (opts.jsx) |_jsx| try options.JSX.Pragma.fromApi(_jsx, allocator) else options.JSX.Pragma{}; diff --git a/src/cli.zig b/src/cli.zig index 472c6ac025..c6b1c38bd3 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -132,7 +132,9 @@ pub const Cli = struct { clap.parseParam("--platform \"browser\" or \"node\". Defaults to \"browser\"") catch unreachable, clap.parseParam("--main-fields ... Main fields to lookup in package.json. Defaults to --platform dependent") catch unreachable, clap.parseParam("--scan Instead of bundling or transpiling, print a list of every file imported by an entry point, recursively") catch unreachable, - clap.parseParam("--jsb Generate a new node_modules.jsb file from node_modules and entry point(s)") catch unreachable, + clap.parseParam("--new-jsb Generate a new node_modules.jsb file from node_modules and entry point(s)") catch unreachable, + clap.parseParam("--jsb Use a Speedy JavaScript Bundle (default: \"./node_modules.jsb\" if exists)") catch unreachable, + // clap.parseParam("--no-jsb Use a Speedy JavaScript Bundle (default: \"./node_modules.jsb\" if exists)") catch unreachable, clap.parseParam("... Entry points to use") catch unreachable, }; @@ -186,6 +188,22 @@ pub const Cli = struct { var react_fast_refresh = args.flag("--react-fast-refresh"); var main_fields = args.options("--main-fields"); + var node_modules_bundle_path = args.option("--jsb") orelse brk: { + if (args.flag("--new-jsb")) { + break :brk null; + } + + const node_modules_bundle_path_absolute = resolve_path.joinAbs(cwd, .auto, "node_modules.jsb"); + std.fs.accessAbsolute(node_modules_bundle_path_absolute, .{}) catch |err| { + break :brk null; + }; + break :brk try allocator.dupe(u8, node_modules_bundle_path_absolute); + }; + + if (args.flag("--new-jsb")) { + node_modules_bundle_path = null; + } + const PlatformMatcher = strings.ExactSizeMatcher(8); const ResoveMatcher = strings.ExactSizeMatcher(8); @@ -266,10 +284,15 @@ pub const Cli = struct { .absolute_working_dir = cwd, .tsconfig_override = tsconfig_override, .public_url = public_url, - .define_keys = define_keys, - .define_values = define_values, - .loader_keys = loader_keys, - .loader_values = loader_values, + .define = .{ + .keys = define_keys, + .values = define_values, + }, + .loaders = .{ + .extensions = loader_keys, + .loaders = loader_values, + }, + .node_modules_bundle_path = node_modules_bundle_path, .public_dir = if (args.option("--public-dir")) |public_dir| allocator.dupe(u8, public_dir) catch unreachable else null, .write = write, .serve = serve, @@ -279,7 +302,7 @@ pub const Cli = struct { .main_fields = args.options("--main-fields"), .platform = platform, .only_scan_dependencies = if (args.flag("--scan")) Api.ScanDependencyMode.all else Api.ScanDependencyMode._none, - .generate_node_module_bundle = if (args.flag("--jsb")) true else false, + .generate_node_module_bundle = if (args.flag("--new-jsb")) true else false, }; } }; @@ -363,6 +386,13 @@ pub const Cli = struct { args, ); }, + .lazy => { + result = try bundler.ServeBundler.bundle( + allocator, + &log, + args, + ); + }, else => { result = try bundler.Bundler.bundle( allocator, diff --git a/src/fs.zig b/src/fs.zig index a6a1584f46..d3957ebe38 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -918,6 +918,18 @@ pub const PathName = struct { return MutableString.ensureValidIdentifier(self.base, allocator); } + pub fn dirWithTrailingSlash(this: *const PathName) string { + // The three strings basically always point to the same underlying ptr + // so if dir does not have a trailing slash, but is spaced one apart from the basename + // we can assume there is a trailing slash there + // so we extend the original slice's length by one + if (this.dir[this.dir.len - 1] != std.fs.path.sep_posix and (@ptrToInt(this.dir.ptr) + this.dir.len + 1) == @ptrToInt(this.base.ptr)) { + return this.dir.ptr[0 .. this.dir.len + 1]; + } + + return this.dir; + } + pub fn init(_path: string) PathName { var path = _path; var base = path; diff --git a/src/global.zig b/src/global.zig index bc0ab3ee3e..6610abafd6 100644 --- a/src/global.zig +++ b/src/global.zig @@ -104,6 +104,7 @@ pub const Output = struct { } pub fn disableBuffering() void { + Output.flush(); enable_buffering = false; } @@ -285,14 +286,18 @@ pub const Output = struct { printer(new_fmt[0..new_fmt_i], args); } - pub fn pretty(comptime fmt: string, args: anytype) void { + pub fn prettyWithPrinter(comptime fmt: string, args: anytype, printer: anytype) void { if (enable_ansi_colors) { - _pretty(fmt, args, print, true); + _pretty(fmt, args, printer, true); } else { - _pretty(fmt, args, print, false); + _pretty(fmt, args, printer, false); } } + pub fn pretty(comptime fmt: string, args: anytype) void { + prettyWithPrinter(fmt, args, print); + } + pub fn prettyln(comptime fmt: string, args: anytype) void { if (enable_ansi_colors) { _pretty(fmt, args, println, true); @@ -309,6 +314,26 @@ pub const Output = struct { return printError(fmt, args); } + pub fn prettyError(comptime fmt: string, args: anytype) void { + prettyWithPrinter(fmt, args, printError); + } + + pub fn prettyErrorln(comptime fmt: string, args: anytype) void { + if (fmt[fmt.len - 1] != '\n') { + return prettyWithPrinter( + fmt ++ "\n", + args, + printError, + ); + } + + return prettyWithPrinter( + fmt, + args, + printError, + ); + } + pub fn errorLn(comptime fmt: string, args: anytype) void { return printErrorln(fmt, args); } @@ -329,8 +354,10 @@ pub const Global = struct { pub fn panic(comptime fmt: string, args: anytype) noreturn { if (isWasm) { Output.print(fmt, args); + Output.flush(); @panic(fmt); } else { + Output.flush(); std.debug.panic(fmt, args); } } @@ -338,6 +365,12 @@ pub const Global = struct { pub fn notimpl() noreturn { Global.panic("Not implemented yet!!!!!", .{}); } + + // Make sure we always print any leftover + pub fn crash() noreturn { + Output.flush(); + std.os.exit(1); + } }; pub const FileDescriptorType = if (isBrowser) u0 else std.os.fd_t; diff --git a/src/import_record.zig b/src/import_record.zig index 69c4988826..89801b9be3 100644 --- a/src/import_record.zig +++ b/src/import_record.zig @@ -44,6 +44,9 @@ pub const ImportRecord = struct { range: logger.Range, path: fs.Path, + // 0 is invalid + package_json_hash: u32 = 0, + source_index: Ref.Int = std.math.maxInt(Ref.Int), // True for the following cases: @@ -60,6 +63,8 @@ pub const ImportRecord = struct { is_internal: bool = false, + is_bundled: bool = false, + // Sometimes the parser creates an import record and decides it isn't needed. // For example, TypeScript code may have import statements that later turn // out to be type-only imports after analyzing the whole file. diff --git a/src/js_ast.zig b/src/js_ast.zig index a0add31571..9be9d461ac 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -3474,6 +3474,8 @@ pub const Ast = struct { module_ref: ?Ref = null, wrapper_ref: ?Ref = null, + bundle_namespace_ref: ?Ref = null, + // These are used when bundling. They are filled in during the parser pass // since we already have to traverse the AST then anyway and the parser pass // is conveniently fully parallelized. diff --git a/src/js_parser/js_parser.zig b/src/js_parser/js_parser.zig index 1802d71688..81ab8e2d60 100644 --- a/src/js_parser/js_parser.zig +++ b/src/js_parser/js_parser.zig @@ -1522,6 +1522,24 @@ pub const Parser = struct { // June 4: "Parsing took: 18028000" // June 4: "Rest of this took: 8003000" _ = try p.parseStmtsUpTo(js_lexer.T.t_end_of_file, &opts); + + // Symbol use counts are unavailable + // So we say "did we parse any JSX?" + // if yes, just automatically add the import so that .jsb knows to include the file. + if (self.options.jsx.parse and p.needs_jsx_import) { + _ = p.addImportRecord( + .internal, + logger.Loc{ .start = 0 }, + p.options.jsx.import_source, + ); + // Ensure we have both classic and automatic + // This is to handle cases where they use fragments in the automatic runtime + _ = p.addImportRecord( + .internal, + logger.Loc{ .start = 0 }, + p.options.jsx.classic_import_source, + ); + } } pub fn parse(self: *Parser) !js_ast.Result { @@ -1770,7 +1788,7 @@ pub const Parser = struct { }; decl_i += 1; } - const import_record_id = p.addImportRecord(.internal, loc, p.options.jsx.import_source); + const import_record_id = p.addImportRecord(.internal, loc, p.options.jsx.classic_import_source); jsx_part_stmts[stmt_i] = p.s(S.Import{ .namespace_ref = classic_namespace_ref, .star_name_loc = loc, @@ -1826,7 +1844,15 @@ pub const Parser = struct { var runtime_imports_iter = p.runtime_imports.iter(); while (runtime_imports_iter.next()) |entry| { const imports = [_]u16{entry.key}; - p.generateImportStmt(RuntimeImports.Name, &imports, &before, p.runtime_imports, null, "import_") catch unreachable; + p.generateImportStmt( + RuntimeImports.Name, + &imports, + &before, + p.runtime_imports, + null, + "import_", + true, + ) catch unreachable; } if (p.cjs_import_stmts.items.len > 0 and !p.options.output_commonjs) { @@ -2009,6 +2035,7 @@ pub fn NewParser( ) type { const ImportRecordList = if (only_scan_imports_and_do_not_visit) *std.ArrayList(ImportRecord) else std.ArrayList(ImportRecord); const NamedImportsType = if (only_scan_imports_and_do_not_visit) *js_ast.Ast.NamedImports else js_ast.Ast.NamedImports; + const NeedsJSXType = if (only_scan_imports_and_do_not_visit) bool else void; // P is for Parser! // public only because of Binding.ToExpr @@ -2110,6 +2137,14 @@ pub fn NewParser( top_level_symbol_to_parts: Map(js_ast.Ref, List(u32)), import_namespace_cc_map: Map(ImportNamespaceCallOrConstruct, bool), + // When we're only scanning the imports + // If they're using the automatic JSX runtime + // We won't know that we need to import JSX robustly because we don't track + // symbol counts. Instead, we ask: + // "Did we parse anything that looked like JSX"? + // If yes, then automatically add the JSX import. + needs_jsx_import: NeedsJSXType, + // The parser does two passes and we need to pass the scope tree information // from the first pass to the second pass. That's done by tracking the calls // to pushScopeForParsePass() and popScope() during the first pass in @@ -2736,11 +2771,11 @@ pub fn NewParser( symbols: anytype, additional_stmt: ?Stmt, comptime suffix: string, + comptime is_internal: bool, ) !void { const import_record_i = p.addImportRecordByRange(.stmt, logger.Range.None, import_path); var import_record: *ImportRecord = &p.import_records.items[import_record_i]; - - import_record.is_internal = true; + import_record.is_internal = is_internal; var import_path_identifier = try import_record.path.name.nonUniqueNameString(p.allocator); var namespace_identifier = try p.allocator.alloc(u8, import_path_identifier.len + suffix.len); var clause_items = try p.allocator.alloc(js_ast.ClauseItem, imports.len); @@ -9254,6 +9289,10 @@ pub fn NewParser( } pub fn parseJSXElement(p: *P, loc: logger.Loc) !Expr { + if (only_scan_imports_and_do_not_visit) { + p.needs_jsx_import = true; + } + var tag = try JSXTag.parse(p); // The tag may have TypeScript type arguments: "/>" @@ -13237,6 +13276,7 @@ pub fn NewParser( .require_resolve_transposer = undefined, .source = source, + .needs_jsx_import = if (only_scan_imports_and_do_not_visit) false else NeedsJSXType{}, .lexer = lexer, }; diff --git a/src/linker.zig b/src/linker.zig index 4d3d9ff696..fd00911f5d 100644 --- a/src/linker.zig +++ b/src/linker.zig @@ -88,6 +88,7 @@ pub fn NewLinker(comptime BundlerType: type) type { var needs_runtime = result.ast.uses_exports_ref or result.ast.uses_module_ref or result.ast.runtime_imports.hasAny(); const source_dir = file_path.name.dir; var externals = std.ArrayList(u32).init(linker.allocator); + var needs_bundle = false; // Step 1. Resolve imports & requires switch (result.loader) { @@ -106,12 +107,74 @@ pub fn NewLinker(comptime BundlerType: type) type { continue; } - if (linker.resolver.resolve(source_dir, import_record.path.text, import_record.kind)) |*resolved_import| { + if (linker.resolver.resolve(source_dir, import_record.path.text, import_record.kind)) |*_resolved_import| { + var resolved_import: *Resolver.Result = _resolved_import; if (resolved_import.is_external) { externals.append(record_index) catch unreachable; continue; } + if (resolved_import.package_json) |package_json| { + if (linker.options.node_modules_bundle) |node_modules_bundle| { + if (strings.contains(package_json.source.path.name.dirWithTrailingSlash(), "node_modules")) { + if (node_modules_bundle.getPackageIDByName(package_json.name)) |possible_pkg_ids| { + const pkg_id: u32 = brk: { + for (possible_pkg_ids) |pkg_id| { + const pkg = node_modules_bundle.bundle.packages[pkg_id]; + if (pkg.hash == package_json.hash) { + break :brk pkg_id; + } + } + + linker.log.addErrorFmt( + null, + logger.Loc.Empty, + linker.allocator, + "\"{s}\" version changed, we'll need to regenerate the .jsb.\nOld version: \"{s}\"\nNew version: \"{s}\"", + .{ + package_json.name, + node_modules_bundle.str(node_modules_bundle.bundle.packages[possible_pkg_ids[0]].version), + package_json.version, + }, + ) catch {}; + return error.RebuildJSB; + }; + + const package = &node_modules_bundle.bundle.packages[pkg_id]; + + if (isDebug) { + std.debug.assert(strings.eql(node_modules_bundle.str(package.name), package_json.name)); + } + + const package_relative_path = linker.fs.relative( + package_json.source.path.name.dirWithTrailingSlash(), + resolved_import.path_pair.primary.text, + ); + + const found_module = node_modules_bundle.findModuleInPackage(package, package_relative_path) orelse { + linker.log.addErrorFmt( + null, + logger.Loc.Empty, + linker.allocator, + "New dependency import: \"{s}/{s}\"\nWe'll need to regenerate the .jsb.", + .{ + package_json.name, + package_relative_path, + }, + ) catch {}; + return error.RebuildJSB; + }; + + import_record.is_bundled = true; + import_record.path.text = node_modules_bundle.str(found_module.path); + import_record.package_json_hash = package.hash; + needs_bundle = true; + continue; + } + } + } + } + linker.processImportRecord( // Include trailing slash file_path.text[0 .. source_dir.len + 1], @@ -138,7 +201,7 @@ pub fn NewLinker(comptime BundlerType: type) type { } else |err| { switch (err) { error.ModuleNotFound => { - if (BundlerType.Resolver.isPackagePath(import_record.path.text)) { + if (Resolver.isPackagePath(import_record.path.text)) { if (linker.options.platform != .node and Options.ExternalModules.isNodeBuiltin(import_record.path.text)) { try linker.log.addRangeErrorFmt( &result.source, @@ -198,9 +261,6 @@ pub fn NewLinker(comptime BundlerType: type) type { const ImportPathsList = allocators.BSSStringList(512, 128); pub var relative_paths_list: *ImportPathsList = undefined; - threadlocal var relative_path_allocator: std.heap.FixedBufferAllocator = undefined; - threadlocal var relative_path_allocator_buf: [4096]u8 = undefined; - threadlocal var relative_path_allocator_buf_loaded: bool = false; pub fn generateImportPath( linker: *ThisLinker, @@ -209,20 +269,6 @@ pub fn NewLinker(comptime BundlerType: type) type { package_version: ?string, comptime import_path_format: Options.BundleOptions.ImportPathFormat, ) !Fs.Path { - if (!relative_path_allocator_buf_loaded) { - relative_path_allocator_buf_loaded = true; - relative_path_allocator = std.heap.FixedBufferAllocator.init(&relative_path_allocator_buf); - } - defer relative_path_allocator.reset(); - - var absolute_pathname = Fs.PathName.init(source_path); - - if (!linker.options.preserve_extensions) { - if (linker.options.out_extensions.get(absolute_pathname.ext)) |ext| { - absolute_pathname.ext = ext; - } - } - switch (import_path_format) { .relative => { var pretty = try linker.allocator.dupe(u8, linker.fs.relative(source_dir, source_path)); @@ -238,6 +284,14 @@ pub fn NewLinker(comptime BundlerType: type) type { }, .absolute_url => { + var absolute_pathname = Fs.PathName.init(source_path); + + if (!linker.options.preserve_extensions) { + if (linker.options.out_extensions.get(absolute_pathname.ext)) |ext| { + absolute_pathname.ext = ext; + } + } + var base = linker.fs.relativeTo(source_path); if (strings.lastIndexOfChar(base, '.')) |dot| { base = base[0..dot]; @@ -285,7 +339,7 @@ pub fn NewLinker(comptime BundlerType: type) type { ) !void { // extremely naive. - resolve_result.is_from_node_modules = strings.contains(resolve_result.path_pair.primary.text, "/node_modules"); + resolve_result.is_from_node_modules = resolve_result.package_json != null or strings.contains(resolve_result.path_pair.primary.text, "/node_modules"); // lazy means: // Run the resolver @@ -297,7 +351,7 @@ pub fn NewLinker(comptime BundlerType: type) type { import_record.path = try linker.generateImportPath( source_dir, resolve_result.path_pair.primary.text, - resolve_result.package_json_version, + if (resolve_result.package_json) |package_json| package_json.version else "", import_path_format, ); } diff --git a/src/node_module_bundle.zig b/src/node_module_bundle.zig index ada125e22e..ec85e4fb18 100644 --- a/src/node_module_bundle.zig +++ b/src/node_module_bundle.zig @@ -3,6 +3,19 @@ const Api = schema.Api; const std = @import("std"); usingnamespace @import("global.zig"); +pub fn modulesIn(bundle: *const Api.JavascriptBundle, pkg: *const Api.JavascriptBundledPackage) []const Api.JavascriptBundledModule { + return bundle.modules[pkg.modules_offset .. pkg.modules_offset + pkg.modules_length]; +} + +// This corresponds to Api.JavascriptBundledPackage.hash +pub const BundledPackageHash = u32; +// This is the offset in the array of packages +pub const BundledPackageID = u32; + +const PackageIDMap = std.AutoHashMap(BundledPackageHash, BundledPackageID); + +const PackageNameMap = std.StringHashMap([]BundledPackageID); + pub const NodeModuleBundle = struct { container: Api.JavascriptBundleContainer, bundle: Api.JavascriptBundle, @@ -11,14 +24,199 @@ pub const NodeModuleBundle = struct { bytes: []u8 = undefined, fd: FileDescriptorType = 0, + // Lookup packages by ID - hash(name@version) + package_id_map: PackageIDMap, + + // Lookup packages by name. Remember that you can have multiple versions of the same package. + package_name_map: PackageNameMap, + + // This is stored as a single pre-allocated, flat array so we can avoid dynamic allocations. + package_name_ids_ptr: []BundledPackageID = &([_]BundledPackageID{}), + pub const magic_bytes = "#!/usr/bin/env speedy\n\n"; threadlocal var jsbundle_prefix: [magic_bytes.len + 5]u8 = undefined; + pub fn loadPackageMap(this: *NodeModuleBundle) !void { + this.package_name_map = PackageNameMap.init(this.allocator); + var ids = PackageIDMap.init(this.allocator); + + const package_count = @truncate(u32, this.bundle.packages.len); + + // this.package_has_multiple_versions = try std.bit_set.DynamicBitSet.initFull(package_count, this.allocator); + + try ids.ensureCapacity( + package_count, + ); + this.package_name_ids_ptr = try this.allocator.alloc(BundledPackageID, this.bundle.packages.len); + var remaining_names = this.package_name_ids_ptr; + try this.package_name_map.ensureCapacity( + package_count, + ); + var prev_package_ids_for_name: []u32 = &[_]u32{}; + + for (this.bundle.packages) |package, _package_id| { + const package_id = @truncate(u32, _package_id); + std.debug.assert(package.hash != 0); + ids.putAssumeCapacityNoClobber(package.hash, @truncate(u32, package_id)); + + const package_name = this.str(package.name); + var entry = this.package_name_map.getOrPutAssumeCapacity(package_name); + + if (entry.found_existing) { + // this.package_has_multiple_versions.set(prev_package_ids_for_name[prev_package_ids_for_name.len - 1]); + // Assert that multiple packages with the same name come immediately after another + // This catches any issues with the sorting order, which would cause all sorts of weird bugs + // This also allows us to simply extend the length of the previous slice to the new length + // Saving us an allocation + if (@ptrToInt(prev_package_ids_for_name.ptr) != @ptrToInt(entry.value_ptr.ptr)) { + Output.prettyErrorln( + \\Fatal: incorrect package sorting order detected in .jsb file.\n + \\This is a bug! Please create an issue.\n + \\If this bug blocks you from doing work, for now + \\please avoid having multiple versions of "{s}" in the same bundle.\n + \\\n + \\- Jarred" + , + .{ + package_name, + }, + ); + Global.crash(); + } + + const end = prev_package_ids_for_name.len + 1; + // Assert we have enough room to add another package + std.debug.assert(end < remaining_names.len); + entry.value_ptr.* = prev_package_ids_for_name.ptr[0..end]; + entry.value_ptr.*[end] = package_id; + } else { + prev_package_ids_for_name = remaining_names[0..1]; + prev_package_ids_for_name[0] = package_id; + entry.value_ptr.* = prev_package_ids_for_name; + remaining_names = remaining_names[1..]; + } + } + + this.package_id_map = ids; + } + + pub fn getPackageIDByHash(this: *const NodeModuleBundle, hash: BundledPackageID) ?u32 { + return this.package_id_map.get(hash); + } + + pub fn getPackageIDByName(this: *const NodeModuleBundle, name: string) ?[]u32 { + return this.package_name_map.get(name); + } + + pub fn getPackage(this: *const NodeModuleBundle, name: string) ?*const Api.JavascriptBundledPackage { + const package_id = this.getPackageID(name) orelse return null; + return &this.bundle.packages[@intCast(usize, package_id)]; + } + + pub fn hasModule(this: *const NodeModuleBundle, name: string) ?*const Api.JavascriptBundledPackage { + const package_id = this.getPackageID(name) orelse return null; + return &this.bundle.packages[@intCast(usize, package_id)]; + } + + pub const ModuleQuery = struct { + package: *const Api.JavascriptBundledPackage, + relative_path: string, + extensions: []string, + }; + + pub fn allocModuleImport( + this: *const NodeModuleBundle, + to: *const Api.JavascriptBundledModule, + allocator: *std.mem.Allocator, + ) !string { + return try std.fmt.allocPrint( + allocator, + "{x}/{s}", + .{ + this.bundle.packages[to.package_id].hash, + this.str(to.path), + 123, + }, + ); + } + + pub fn findModuleInPackageByPathWithoutPackageName( + this: *const NodeModuleBundle, + package: *const Api.JavascriptBundledPackage, + query: ModuleQuery, + ) ?Api.JavascriptBundledModule { + // const ModuleSearcher = struct { + // ctx: *const NodeModuleBundle, + // query: ModuleQuery, + // }; + // std.sort.binarySearch(comptime T: type, key: T, items: []const T, context: anytype, comptime compareFn: fn(context:@TypeOf(context), lhs:T, rhs:T)math.Order) + } + + pub fn findModuleInPackage( + this: *const NodeModuleBundle, + package: *const Api.JavascriptBundledPackage, + _query: string, + ) ?*const Api.JavascriptBundledModule { + const ModuleFinder = struct { + const Self = @This(); + ctx: *const NodeModuleBundle, + pkg: *const Api.JavascriptBundledPackage, + query: string, + + // Since the module doesn't necessarily exist, we use an integer overflow as the module name + pub fn moduleName(context: *const Self, module: *const Api.JavascriptBundledModule) string { + return if (module.path.offset == context.ctx.bundle.manifest_string.len) context.query else context.ctx.str(module.path); + } + + pub fn cmpAsc(context: Self, lhs: Api.JavascriptBundledModule, rhs: Api.JavascriptBundledModule) std.math.Order { + // Comapre the module name + const lhs_name = context.moduleName(&lhs); + const rhs_name = context.moduleName(&rhs); + const VoidType = void; + + const traversal_length = std.math.min(lhs_name.len, rhs_name.len); + + for (lhs_name[0..traversal_length]) |char, i| { + switch (std.math.order(char, rhs_name[i])) { + .lt, .gt => |order| { + return order; + }, + .eq => {}, + } + } + + return std.math.order(lhs_name.len, rhs_name.len); + } + }; + var to_find = Api.JavascriptBundledModule{ + .package_id = 0, + .code = .{}, + .path = .{ + .offset = @truncate(u32, this.bundle.manifest_string.len), + }, + }; + + var finder = ModuleFinder{ .ctx = this, .pkg = package, .query = _query }; + + const modules = modulesIn(&this.bundle, package); + const module_id = std.sort.binarySearch( + Api.JavascriptBundledModule, + to_find, + modules, + finder, + ModuleFinder.cmpAsc, + ) orelse return null; + return &modules[module_id]; + } + pub fn init(container: Api.JavascriptBundleContainer, allocator: *std.mem.Allocator) NodeModuleBundle { return NodeModuleBundle{ .container = container, .bundle = container.bundle.?, .allocator = allocator, + .package_id_map = undefined, + .package_name_map = undefined, + .package_name_ids_ptr = undefined, }; } @@ -43,14 +241,19 @@ pub const NodeModuleBundle = struct { var reader = schema.Reader.init(read_bytes, allocator); var container = try Api.JavascriptBundleContainer.decode(&reader); - return NodeModuleBundle{ + var bundle = NodeModuleBundle{ .allocator = allocator, .container = container, .bundle = container.bundle.?, .fd = stream.handle, .bytes = read_bytes, .bytes_ptr = file_bytes, + .package_id_map = undefined, + .package_name_map = undefined, + .package_name_ids_ptr = undefined, }; + try bundle.loadPackageMap(); + return bundle; } pub fn str(bundle: *const NodeModuleBundle, pointer: Api.StringPointer) string { @@ -58,7 +261,6 @@ pub const NodeModuleBundle = struct { } pub fn getPackageSize(this: *const NodeModuleBundle, pkg: Api.JavascriptBundledPackage) usize { - const modules = this.bundle.modules[pkg.modules_offset .. pkg.modules_offset + pkg.modules_length]; var size: usize = 0; for (modules) |module| { size += module.code.length; @@ -86,10 +288,11 @@ pub const NodeModuleBundle = struct { ); for (modules) |module| { - const size_level = switch (module.code.length) { - 0...5_000 => SizeLevel.good, - 5_001...74_999 => SizeLevel.neutral, - else => SizeLevel.bad, + const size_level: SizeLevel = + switch (module.code.length) { + 0...5_000 => .good, + 5_001...74_999 => .neutral, + else => .bad, }; Output.print(indent, .{}); diff --git a/src/options.zig b/src/options.zig index 954e01dfa6..56c72ff1a3 100644 --- a/src/options.zig +++ b/src/options.zig @@ -7,6 +7,7 @@ const api = @import("./api/schema.zig"); const Api = api.Api; const defines = @import("./defines.zig"); const resolve_path = @import("./resolver/resolve_path.zig"); +const NodeModuleBundle = @import("./node_module_bundle.zig").NodeModuleBundle; usingnamespace @import("global.zig"); @@ -96,7 +97,7 @@ pub const ExternalModules = struct { .prefix = external[0..i], .suffix = external[i + 1 .. external.len], }) catch unreachable; - } else if (resolver.Resolver.isPackagePath(external)) { + } else if (resolver.isPackagePath(external)) { result.node_modules.insert(external) catch unreachable; } else { const normalized = validatePath(log, fs, cwd, external, allocator, "external path"); @@ -478,6 +479,60 @@ pub const DefaultUserDefines = struct { }; }; +pub fn definesFromTransformOptions(allocator: *std.mem.Allocator, log: *logger.Log, _input_define: ?Api.StringMap) !*defines.Define { + var input_user_define = _input_define orelse std.mem.zeroes(Api.StringMap); + + var user_defines = try stringHashMapFromArrays( + defines.RawDefines, + allocator, + input_user_define.keys, + input_user_define.values, + ); + if (input_user_define.keys.len == 0) { + try user_defines.put(DefaultUserDefines.NodeEnv.Key, DefaultUserDefines.NodeEnv.Value); + } + + var resolved_defines = try defines.DefineData.from_input(user_defines, log, allocator); + return try defines.Define.init( + allocator, + resolved_defines, + ); +} + +pub fn loadersFromTransformOptions(allocator: *std.mem.Allocator, _loaders: ?Api.LoaderMap) !std.StringHashMap(Loader) { + var input_loaders = _loaders orelse std.mem.zeroes(Api.LoaderMap); + var loader_values = try allocator.alloc(Loader, input_loaders.loaders.len); + for (loader_values) |_, i| { + const loader = switch (input_loaders.loaders[i]) { + .jsx => Loader.jsx, + .js => Loader.js, + .ts => Loader.ts, + .css => Loader.css, + .tsx => Loader.tsx, + .json => Loader.json, + else => unreachable, + }; + + loader_values[i] = loader; + } + + var loaders = try stringHashMapFromArrays( + std.StringHashMap(Loader), + allocator, + input_loaders.extensions, + loader_values, + ); + const default_loader_ext = comptime [_]string{ ".jsx", ".json", ".js", ".mjs", ".css", ".ts", ".tsx" }; + + inline for (default_loader_ext) |ext| { + if (!loaders.contains(ext)) { + try loaders.put(ext, defaultLoaders.get(ext).?); + } + } + + return loaders; +} + pub const BundleOptions = struct { footer: string = "", banner: string = "", @@ -497,6 +552,7 @@ pub const BundleOptions = struct { preserve_symlinks: bool = false, preserve_extensions: bool = false, timings: Timings = Timings{}, + node_modules_bundle: ?*NodeModuleBundle = null, append_package_version_in_query_string: bool = false, @@ -511,6 +567,8 @@ pub const BundleOptions = struct { out_extensions: std.StringHashMap(string), import_path_format: ImportPathFormat = ImportPathFormat.relative, + pub fn asJavascriptBundleConfig(this: *const BundleOptions) Api.JavascriptBundleConfig {} + pub const ImportPathFormat = enum { relative, // omit file extension for Node.js packages @@ -531,44 +589,12 @@ pub const BundleOptions = struct { log: *logger.Log, transform: Api.TransformOptions, ) !BundleOptions { - var loader_values = try allocator.alloc(Loader, transform.loader_values.len); - for (loader_values) |_, i| { - const loader = switch (transform.loader_values[i]) { - .jsx => Loader.jsx, - .js => Loader.js, - .ts => Loader.ts, - .css => Loader.css, - .tsx => Loader.tsx, - .json => Loader.json, - else => unreachable, - }; - - loader_values[i] = loader; - } - - var loaders = try stringHashMapFromArrays(std.StringHashMap(Loader), allocator, transform.loader_keys, loader_values); - const default_loader_ext = [_]string{ ".jsx", ".json", ".js", ".mjs", ".css", ".ts", ".tsx" }; - inline for (default_loader_ext) |ext| { - if (!loaders.contains(ext)) { - try loaders.put(ext, defaultLoaders.get(ext).?); - } - } - - var user_defines = try stringHashMapFromArrays(defines.RawDefines, allocator, transform.define_keys, transform.define_values); - if (transform.define_keys.len == 0) { - try user_defines.put(DefaultUserDefines.NodeEnv.Key, DefaultUserDefines.NodeEnv.Value); - } - - var resolved_defines = try defines.DefineData.from_input(user_defines, log, allocator); const output_dir_parts = [_]string{ try std.process.getCwdAlloc(allocator), transform.output_dir orelse "out" }; var opts: BundleOptions = BundleOptions{ .log = log, .resolve_mode = transform.resolve orelse .dev, - .define = try defines.Define.init( - allocator, - resolved_defines, - ), - .loaders = loaders, + .define = try definesFromTransformOptions(allocator, log, transform.define), + .loaders = try loadersFromTransformOptions(allocator, transform.loaders), .output_dir = try fs.absAlloc(allocator, &output_dir_parts), .platform = Platform.from(transform.platform), .write = transform.write orelse false, @@ -665,6 +691,46 @@ pub const BundleOptions = struct { opts.output_dir_handle = try openOutputDir(opts.output_dir); } + if (opts.resolve_mode == .lazy and !(transform.generate_node_module_bundle orelse false)) { + if (transform.node_modules_bundle_path) |bundle_path| { + if (bundle_path.len > 0) { + load_bundle: { + const pretty_path = fs.relativeTo(bundle_path); + var bundle_file = std.fs.openFileAbsolute(bundle_path, .{ .read = true, .write = true }) catch |err| { + Output.disableBuffering(); + Output.prettyErrorln("error opening \"{s}\": {s}", .{ pretty_path, @errorName(err) }); + break :load_bundle; + }; + + const time_start = std.time.nanoTimestamp(); + if (NodeModuleBundle.loadBundle(allocator, bundle_file)) |bundle| { + var node_module_bundle = try allocator.create(NodeModuleBundle); + node_module_bundle.* = bundle; + opts.node_modules_bundle = node_module_bundle; + const elapsed = @intToFloat(f64, (std.time.nanoTimestamp() - time_start)) / std.time.ns_per_ms; + Output.prettyErrorln( + "\"{s}\" - {d} modules, {d} packages [{d:>.2}ms]", + .{ + pretty_path, + node_module_bundle.bundle.modules.len, + node_module_bundle.bundle.packages.len, + elapsed, + }, + ); + Output.flush(); + } else |err| { + Output.disableBuffering(); + Output.prettyErrorln( + "error reading \"{s}\": {s}, deleting it so you don't keep seeing this message.", + .{ pretty_path, @errorName(err) }, + ); + bundle_file.close(); + } + } + } + } + } + return opts; } }; @@ -673,12 +739,12 @@ pub fn openOutputDir(output_dir: string) !std.fs.Dir { return std.fs.openDirAbsolute(output_dir, std.fs.Dir.OpenDirOptions{}) catch brk: { std.fs.makeDirAbsolute(output_dir) catch |err| { Output.printErrorln("error: Unable to mkdir \"{s}\": \"{s}\"", .{ output_dir, @errorName(err) }); - std.os.exit(1); + Global.crash(); }; var handle = std.fs.openDirAbsolute(output_dir, std.fs.Dir.OpenDirOptions{}) catch |err2| { Output.printErrorln("error: Unable to open \"{s}\": \"{s}\"", .{ output_dir, @errorName(err2) }); - std.os.exit(1); + Global.crash(); }; break :brk handle; }; diff --git a/src/resolver/package_json.zig b/src/resolver/package_json.zig index 596a60c57c..e8c8a98b5c 100644 --- a/src/resolver/package_json.zig +++ b/src/resolver/package_json.zig @@ -11,13 +11,14 @@ const resolver = @import("./resolver.zig"); const MainFieldMap = std.StringHashMap(string); const BrowserMap = std.StringHashMap(string); - +threadlocal var hashed_buf: [2048]u8 = undefined; pub const PackageJSON = struct { name: string = "", source: logger.Source, main_fields: MainFieldMap, module_type: options.ModuleType, version: string = "", + hash: u32 = 0, // Present if the "browser" field is present. This field is intended to be // used by bundlers and lets you redirect the paths of certain 3rd-party @@ -46,7 +47,13 @@ pub const PackageJSON = struct { // browser_map: BrowserMap, - pub fn parse(comptime ResolverType: type, r: *ResolverType, input_path: string, dirname_fd: StoredFileDescriptorType) ?PackageJSON { + pub fn parse( + comptime ResolverType: type, + r: *ResolverType, + input_path: string, + dirname_fd: StoredFileDescriptorType, + comptime generate_hash: bool, + ) ?PackageJSON { const parts = [_]string{ input_path, "package.json" }; const package_json_path_ = r.fs.abs(&parts); @@ -190,6 +197,13 @@ pub const PackageJSON = struct { // TODO: side effects // TODO: exports map + if (generate_hash) { + std.mem.copy(u8, &hashed_buf, package_json.name); + hashed_buf[package_json.name.len + 1] = '@'; + std.mem.copy(u8, hashed_buf[package_json.name.len + 1 ..], package_json.version); + package_json.hash = @truncate(u32, std.hash.Wyhash.hash(0, hashed_buf[0 .. package_json.name.len + 1 + package_json.version.len])); + } + return package_json; } }; diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig index 8e3e5a718a..2bbd83c55f 100644 --- a/src/resolver/resolve_path.zig +++ b/src/resolver/resolve_path.zig @@ -149,6 +149,34 @@ pub fn longestCommonPathGeneric(strings: []const []const u8, comptime separator: return strings[0][0 .. last_common_separator + 1]; } +const sep_posix_str = &([_]u8{std.fs.path.sep_posix}); +const node_modules_root = "node_modules" ++ std.fs.path.sep_str; + +pub const PackageRelativePath = struct { base_path: string, package_name: string }; +pub fn packageRelative(absolute_path: string) ?PackageRelativePath { + if (std.Target.current.os.tag == .windows) { + @compileError("Not implemented in windows"); + } + + const node_modules_index = std.mem.lastIndexOf(u8, absolute_path, node_modules_root) orelse return null; + const current_path = absolute_path[node_modules_index + node_modules_root.len + 1 ..]; + return packageRelativeFromNodeModulesFolder(current_path); +} + +pub fn packageRelativeFromNodeModulesFolder(current_path: string) ?PackageRelativePath { + if (std.Target.current.os.tag == .windows) { + @compileError("Not implemented in windows"); + } + + const package_name_end = std.mem.indexOfScalar(u8, current_path, std.fs.path.sep) orelse return null; + const package_name = current_path[0..package_name_end]; + + return PackageRelativePath{ + .base_path = current_path[package_name_end + 1 ..], + .package_name = package_name, + }; +} + pub fn longestCommonPath(strings: []const []const u8) []const u8 { return longestCommonPathGeneric(strings, '/', isSepAny); } @@ -678,7 +706,7 @@ pub fn joinAbsStringBuf(_cwd: []const u8, buf: []u8, _parts: anytype, comptime _ return _cwd; } - if ((_platform == .loose or _platform == .posix) and parts.len == 1 and parts[0].len == 1 and parts[0] == std.fs.path.sep_posix) { + if ((_platform == .loose or _platform == .posix) and parts.len == 1 and parts[0].len == 1 and parts[0][0] == std.fs.path.sep_posix) { return "/"; } @@ -859,50 +887,50 @@ test "joinAbsStringPosix" { var t = tester.Tester.t(std.heap.c_allocator); defer t.report(@src()); const string = []const u8; - const cwd = "/Users/jarredsumner/Code/app"; + const cwd = "/Users/jarredsumner/Code/app/"; _ = t.expect( "/Users/jarredsumner/Code/app/foo/bar/file.js", - joinAbsString(cwd, [_]string{ "foo", "bar", "file.js" }, .posix), + joinAbsString(cwd, &[_]string{ "foo", "bar", "file.js" }, .posix), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "foo", "bar", "../file.js" }, .posix), + joinAbsString(cwd, &[_]string{ "foo", "bar", "../file.js" }, .posix), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "foo", "./bar", "../file.js" }, .posix), + joinAbsString(cwd, &[_]string{ "foo", "./bar", "../file.js" }, .posix), + @src(), + ); + + _ = t.expect( + "/Users/jarredsumner/file.js", + joinAbsString(cwd, &[_]string{ "", "../../file.js" }, .posix), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "", "../../file.js" }, .posix), - @src(), - ); - - _ = t.expect( - "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "././././foo", "././././bar././././", "../file.js" }, .posix), + joinAbsString(cwd, &[_]string{ "././././foo", "././././bar././././", "../file.js" }, .posix), @src(), ); _ = t.expect( "/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", "././././bar././././", "../file.js" }, .posix), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", "././././bar././././", "../file.js" }, .posix), @src(), ); _ = t.expect( "/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", ".", "././././bar././././", ".", "../file.js" }, .posix), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", ".", "././././bar././././", ".", "../file.js" }, .posix), @src(), ); _ = t.expect( "/Code/app/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", "..", "././././bar././././", ".", "../file.js" }, .posix), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", "..", "././././bar././././", ".", "../file.js" }, .posix), @src(), ); } @@ -915,81 +943,81 @@ test "joinAbsStringLoose" { _ = t.expect( "/Users/jarredsumner/Code/app/foo/bar/file.js", - joinAbsString(cwd, [_]string{ "foo", "bar", "file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "foo", "bar", "file.js" }, .loose), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "foo", "bar", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "foo", "bar", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "foo", "./bar", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "foo", "./bar", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "././././foo", "././././bar././././", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "././././foo", "././././bar././././", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", "././././bar././././", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", "././././bar././././", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", ".", "././././bar././././", ".", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", ".", "././././bar././././", ".", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Code/app/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", "..", "././././bar././././", ".", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", "..", "././././bar././././", ".", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/bar/file.js", - joinAbsString(cwd, [_]string{ "foo", "bar", "file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "foo", "bar", "file.js" }, .loose), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "foo", "bar", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "foo", "bar", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "foo", "./bar", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "foo", "./bar", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Users/jarredsumner/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ ".\\.\\.\\.\\foo", "././././bar././././", "..\\file.js" }, .loose), + joinAbsString(cwd, &[_]string{ ".\\.\\.\\.\\foo", "././././bar././././", "..\\file.js" }, .loose), @src(), ); _ = t.expect( "/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", "././././bar././././", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", "././././bar././././", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Code/app/foo/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", ".", "././././bar././././", ".", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", ".", "././././bar././././", ".", "../file.js" }, .loose), @src(), ); _ = t.expect( "/Code/app/file.js", - joinAbsString(cwd, [_]string{ "/Code/app", "././././foo", "..", "././././bar././././", ".", "../file.js" }, .loose), + joinAbsString(cwd, &[_]string{ "/Code/app", "././././foo", "..", "././././bar././././", ".", "../file.js" }, .loose), @src(), ); } diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig index 489dbbfedf..6819fe3f0d 100644 --- a/src/resolver/resolver.zig +++ b/src/resolver/resolver.zig @@ -19,6 +19,12 @@ const StringBoolMap = std.StringHashMap(bool); const allocators = @import("../allocators.zig"); const Path = Fs.Path; +const NodeModuleBundle = @import("../node_module_bundle.zig").NodeModuleBundle; + +pub fn isPackagePath(path: string) bool { + // this could probably be flattened into something more optimized + return path[0] != '/' and !strings.startsWith(path, "./") and !strings.startsWith(path, "../") and !strings.eql(path, ".") and !strings.eql(path, ".."); +} pub const SideEffectsData = struct { source: *logger.Source, @@ -120,8 +126,7 @@ pub const Result = struct { jsx: options.JSX.Pragma = options.JSX.Pragma{}, - package_json_version: ?string = null, - package_json_name: ?string = null, + package_json: ?*PackageJSON = null, is_external: bool = false, @@ -281,8 +286,7 @@ pub const MatchResult = struct { dirname_fd: StoredFileDescriptorType = 0, file_fd: StoredFileDescriptorType = 0, is_node_module: bool = false, - package_json_version: ?string = null, - package_json_name: ?string = null, + package_json: ?*PackageJSON = null, diff_case: ?Fs.FileSystem.Entry.Lookup.DifferentCase = null, }; @@ -304,6 +308,7 @@ pub fn NewResolver(cache_files: bool) type { fs: *Fs.FileSystem, log: *logger.Log, allocator: *std.mem.Allocator, + node_module_bundle: ?*NodeModuleBundle, debug_logs: ?DebugLogs = null, elapsed: i128 = 0, // tracing @@ -367,6 +372,7 @@ pub fn NewResolver(cache_files: bool) type { .caches = CacheSet.init(allocator), .opts = opts, .fs = _fs, + .node_module_bundle = opts.node_modules_bundle, .log = log, }; } @@ -521,8 +527,7 @@ pub fn NewResolver(cache_files: bool) type { .diff_case = res.diff_case, .dirname_fd = dir_info.getFileDescriptor(), .is_from_node_modules = res.is_node_module, - .package_json_name = res.package_json_name, - .package_json_version = res.package_json_version, + .package_json = res.package_json, }; } } @@ -551,8 +556,7 @@ pub fn NewResolver(cache_files: bool) type { .path_pair = entry.path_pair, .diff_case = entry.diff_case, .is_from_node_modules = entry.is_node_module, - .package_json_name = entry.package_json_name, - .package_json_version = entry.package_json_version, + .package_json = entry.package_json, }; } @@ -610,8 +614,7 @@ pub fn NewResolver(cache_files: bool) type { .is_from_node_modules = _result.is_node_module, .module_type = pkg.module_type, .dirname_fd = _result.dirname_fd, - .package_json_version = pkg.version, - .package_json_name = pkg.name, + .package_json = pkg, }; check_relative = false; check_package = false; @@ -629,8 +632,7 @@ pub fn NewResolver(cache_files: bool) type { .diff_case = res.diff_case, .is_from_node_modules = res.is_node_module, .dirname_fd = res.dirname_fd, - .package_json_version = res.package_json_version, - .package_json_name = res.package_json_name, + .package_json = res.package_json, }; } else if (!check_package) { return null; @@ -679,8 +681,7 @@ pub fn NewResolver(cache_files: bool) type { .dirname_fd = node_module.dirname_fd, .diff_case = node_module.diff_case, .is_from_node_modules = true, - .package_json_version = package_json.version, - .package_json_name = package_json.name, + .package_json = package_json, }; } } else { @@ -702,8 +703,7 @@ pub fn NewResolver(cache_files: bool) type { .diff_case = res.diff_case, .is_from_node_modules = res.is_node_module, .dirname_fd = res.dirname_fd, - .package_json_version = res.package_json_version, - .package_json_name = res.package_json_name, + .package_json = res.package_json, }; } else { // Note: node's "self references" are not currently supported @@ -719,8 +719,7 @@ pub fn NewResolver(cache_files: bool) type { const pkg_json = dir_info.package_json orelse continue; const rel_path = r.fs.relative(pkg_json.source.key_path.text, path.text); result.module_type = pkg_json.module_type; - result.package_json_version = if (result.package_json_version == null) pkg_json.version else result.package_json_version; - result.package_json_name = if (result.package_json_name == null) pkg_json.name else result.package_json_name; + result.package_json = result.package_json orelse pkg_json; if (r.checkBrowserMap(pkg_json, rel_path)) |remapped| { if (remapped.len == 0) { path.is_disabled = true; @@ -888,17 +887,12 @@ pub fn NewResolver(cache_files: bool) type { } pub fn parsePackageJSON(r: *ThisResolver, file: string, dirname_fd: StoredFileDescriptorType) !?*PackageJSON { - const pkg = PackageJSON.parse(ThisResolver, r, file, dirname_fd) orelse return null; + const pkg = PackageJSON.parse(ThisResolver, r, file, dirname_fd, !cache_files) orelse return null; var _pkg = try r.allocator.create(PackageJSON); _pkg.* = pkg; return _pkg; } - pub fn isPackagePath(path: string) bool { - // this could probably be flattened into something more optimized - return path[0] != '/' and !strings.startsWith(path, "./") and !strings.startsWith(path, "../") and !strings.eql(path, ".") and !strings.eql(path, ".."); - } - fn dirInfoCached(r: *ThisResolver, path: string) !?*DirInfo { const top_result = try r.dir_cache.getOrPut(path); if (top_result.status != .unknown) { @@ -1322,8 +1316,7 @@ pub fn NewResolver(cache_files: bool) type { .path_pair = PathPair{ .primary = _path, }, - .package_json_version = browser_json.version, - .package_json_name = browser_json.name, + .package_json = browser_json, }; } @@ -1339,8 +1332,7 @@ pub fn NewResolver(cache_files: bool) type { if (dir_info.package_json) |package_json| { return MatchResult{ .path_pair = PathPair{ .primary = Fs.Path.init(result.path) }, - .package_json_name = package_json.name, - .package_json_version = package_json.version, + .package_json = package_json, .dirname_fd = result.dirname_fd, }; } @@ -1383,8 +1375,7 @@ pub fn NewResolver(cache_files: bool) type { return MatchResult{ .path_pair = .{ .primary = Path.init(out_buf) }, .diff_case = lookup.diff_case, - .package_json_name = package_json.name, - .package_json_version = package_json.version, + .package_json = package_json, .dirname_fd = dir_info.getFileDescriptor(), }; } @@ -1423,8 +1414,7 @@ pub fn NewResolver(cache_files: bool) type { .path_pair = PathPair{ .primary = _path, }, - .package_json_version = browser_json.version, - .package_json_name = browser_json.name, + .package_json = browser_json, }; } @@ -1469,8 +1459,7 @@ pub fn NewResolver(cache_files: bool) type { .path_pair = .{ .primary = Path.init(file.path) }, .diff_case = file.diff_case, .dirname_fd = file.dirname_fd, - .package_json_name = package_json.name, - .package_json_version = package_json.version, + .package_json = package_json, }; } } @@ -1497,13 +1486,11 @@ pub fn NewResolver(cache_files: bool) type { } const dir_info = (r.dirInfoCached(path) catch null) orelse return null; - var package_json_version: ?string = null; - var package_json_name: ?string = null; + var package_json: ?*PackageJSON = null; // Try using the main field(s) from "package.json" if (dir_info.package_json) |pkg_json| { - package_json_version = pkg_json.version; - package_json_name = pkg_json.name; + package_json = pkg_json; if (pkg_json.main_fields.count() > 0) { const main_field_values = pkg_json.main_fields; const main_field_keys = r.opts.main_fields; @@ -1564,8 +1551,7 @@ pub fn NewResolver(cache_files: bool) type { }, .diff_case = auto_main_result.diff_case, .dirname_fd = auto_main_result.dirname_fd, - .package_json_version = pkg_json.version, - .package_json_name = pkg_json.name, + .package_json = package_json, }; } else { if (r.debug_logs) |*debug| { @@ -1576,15 +1562,13 @@ pub fn NewResolver(cache_files: bool) type { }) catch {}; } var _auto_main_result = auto_main_result; - _auto_main_result.package_json_version = pkg_json.version; - _auto_main_result.package_json_name = pkg_json.name; + _auto_main_result.package_json = package_json; return _auto_main_result; } } } - if (_result.package_json_version == null) _result.package_json_version = package_json_version; - if (_result.package_json_name == null) _result.package_json_name = package_json_name; + _result.package_json = _result.package_json orelse package_json; return _result; } } @@ -1592,13 +1576,7 @@ pub fn NewResolver(cache_files: bool) type { // Look for an "index" file with known extensions if (r.loadAsIndexWithBrowserRemapping(dir_info, path, extension_order)) |*res| { - if (res.package_json_version == null and package_json_version != null) { - res.package_json_version = package_json_version; - } - - if (res.package_json_name == null and package_json_name != null) { - res.package_json_name = package_json_name; - } + res.package_json = res.package_json orelse package_json; return res.*; } @@ -1881,5 +1859,9 @@ pub fn NewResolver(cache_files: bool) type { }; } -pub const Resolver = NewResolver(true); -pub const ResolverUncached = NewResolver(false); +pub const Resolver = NewResolver( + true, +); +pub const ResolverUncached = NewResolver( + false, +); diff --git a/src/runtime.js b/src/runtime.js index e00271303b..5ac6d3a931 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -53,6 +53,10 @@ export var __commonJS = var require_cache = new WeakMap(); +export var __SPEEDY_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { + RequireFailedError: class RequireFailedError {}, +}; + export var __require = (namespace) => { var entry = require_cache.get(namespace); if (typeof entry !== "undefined") { @@ -65,6 +69,16 @@ export var __require = (namespace) => { ? namespace["default"] : namespace; + if (typeof target !== "function") { + throw new __SPEEDY_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.RequireFailedError( + `Couldn't find module "${ + typeof namespace === "string" + ? namespace + : namespace.name || namespace.displayName || namespace.toString() + }"` + ); + } + var exports = target(); require_cache.set(namespace, exports); return exports; @@ -81,3 +95,21 @@ export var __name = (target, name) => { }; export const __esModule = true; + +// Used to implement ES6 exports to CommonJS +export var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +export var __reExport = (target, module, desc) => { + if ((module && typeof module === "object") || typeof module === "function") + for (let key of __getOwnPropNames(module)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { + get: () => module[key], + enumerable: + !(desc = __getOwnPropDesc(module, key)) || desc.enumerable, + }); + return target; +}; diff --git a/src/runtime.version b/src/runtime.version index 9a0793a08b..e8750c9a12 100644 --- a/src/runtime.version +++ b/src/runtime.version @@ -1 +1 @@ -6c20b700cd52b930 \ No newline at end of file +e9b61815176778be \ No newline at end of file diff --git a/src/runtime.zig b/src/runtime.zig index 8f97718d8c..6f53af6ad5 100644 --- a/src/runtime.zig +++ b/src/runtime.zig @@ -19,8 +19,17 @@ pub const Runtime = struct { __toModule: ?Ref = null, __commonJS: ?Ref = null, __require: ?Ref = null, + __export: ?Ref = null, + __reExport: ?Ref = null, - pub const all = [_][]const u8{ "__name", "__toModule", "__require", "__commonJS" }; + pub const all = [_][]const u8{ + "__name", + "__toModule", + "__require", + "__commonJS", + "__export", + "__reExport", + }; pub const Name = " { + if (@field(this.runtime_imports, all[4])) |val| { + return Entry{ .key = 4, .value = val }; + } + }, + 5 => { + if (@field(this.runtime_imports, all[5])) |val| { + return Entry{ .key = 5, .value = val }; + } + }, else => { return null; }, @@ -106,6 +125,8 @@ pub const Runtime = struct { 1 => @field(imports, all[1]), 2 => @field(imports, all[2]), 3 => @field(imports, all[3]), + 4 => @field(imports, all[4]), + 5 => @field(imports, all[5]), else => null, }; }