"use client";
import { n as __toESM, t as __commonJSMin } from "./chunk-CO3PsZeE.js";
import { t as require_react } from "./react.js";
import { t as require_react_dom } from "./react-dom.js";
import { $ as RefIcon$17, A as RefIcon$12, B as RefIcon$28, C as RefIcon$36, Ct as presetPalettes, D as RefIcon$35, Dt as clsx, E as RefIcon$51, Et as FastColor, F as RefIcon$41, G as RefIcon$48, H as RefIcon$45, I as RefIcon$50, J as RefIcon$30, K as RefIcon$8, L as RefIcon$20, M as RefIcon$38, N as RefIcon$40, O as RefIcon$16, Ot as IconContext, P as RefIcon$39, Q as RefIcon$3, R as RefIcon$34, S as RefIcon$21, St as gold, T as RefIcon$49, Tt as generate, U as RefIcon$13, V as RefIcon$4, W as RefIcon$47, X as RefIcon$46, Y as RefIcon$44, Z as RefIcon, _ as RefIcon$7, _t as removeCSS, a as supportRef, at as RefIcon$18, b as RefIcon$6, bt as canUseDom, c as useMemo$44, d as RefIcon$33, et as RefIcon$9, f as RefIcon$10, g as RefIcon$32, gt as getShadowRoot, h as RefIcon$26, ht as warningOnce, i as supportNodeRef, it as RefIcon$37, j as RefIcon$2, k as RefIcon$5, l as RefIcon$25, m as RefIcon$19, mt as warning$2, n as fillRef, nt as RefIcon$42, o as useComposeRef, ot as RefIcon$11, p as RefIcon$15, pt as noteOnce, q as RefIcon$29, r as getNodeRef, rt as RefIcon$43, s as isFragment$1, t as composeRef, tt as RefIcon$1, u as RefIcon$24, v as RefIcon$23, vt as updateCSS, w as RefIcon$14, wt as presetPrimaryColors, x as RefIcon$31, xt as blue, y as RefIcon$22, yt as contains, z as RefIcon$27 } from "./ref-CC_C1lUG.js";
import { t as require_client } from "./client-Cx8rFc1g.js";
//#region node_modules/antd/es/_util/getReactMajorVersionCanDelMe.js
var import_react = /* @__PURE__ */ __toESM(require_react());
function getReactMajorVersion() {
return Number.parseInt(import_react.version.split(".")[0], 10);
}
//#endregion
//#region node_modules/@rc-component/util/es/hooks/useEvent.js
var useEvent = (callback) => {
const fnRef = import_react.useRef(callback);
fnRef.current = callback;
return import_react.useCallback((...args) => fnRef.current?.(...args), []);
};
//#endregion
//#region node_modules/@rc-component/util/es/hooks/useLayoutEffect.js
/**
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
*/
var useInternalLayoutEffect = canUseDom() ? import_react.useLayoutEffect : import_react.useEffect;
var useLayoutEffect$1 = (callback, deps) => {
const firstMountRef = import_react.useRef(true);
useInternalLayoutEffect(() => {
return callback(firstMountRef.current);
}, deps);
useInternalLayoutEffect(() => {
firstMountRef.current = false;
return () => {
firstMountRef.current = true;
};
}, []);
};
var useLayoutUpdateEffect = (callback, deps) => {
useLayoutEffect$1((firstMount) => {
if (!firstMount) return callback();
}, deps);
};
//#endregion
//#region node_modules/@rc-component/util/es/hooks/useState.js
/**
* Same as React.useState but `setState` accept `ignoreDestroy` param to not to setState after destroyed.
* We do not make this auto is to avoid real memory leak.
* Developer should confirm it's safe to ignore themselves.
*/
var useSafeState = (defaultValue) => {
const destroyRef = import_react.useRef(false);
const [value, setValue] = import_react.useState(defaultValue);
import_react.useEffect(() => {
destroyRef.current = false;
return () => {
destroyRef.current = true;
};
}, []);
function safeSetState(updater, ignoreDestroy) {
if (ignoreDestroy && destroyRef.current) return;
setValue(updater);
}
return [value, safeSetState];
};
//#endregion
//#region node_modules/@rc-component/util/es/hooks/useControlledState.js
/**
* Similar to `useState` but will use props value if provided.
* From React 18, we do not need safe `useState` since it will not throw for unmounted update.
* This hooks remove the `onChange` & `postState` logic since we only need basic merged state logic.
*/
function useControlledState(defaultStateValue, value) {
const [innerValue, setInnerValue] = (0, import_react.useState)(defaultStateValue);
const mergedValue = value !== void 0 ? value : innerValue;
useLayoutEffect$1((mount) => {
if (!mount) setInnerValue(value);
}, [value]);
return [mergedValue, setInnerValue];
}
//#endregion
//#region node_modules/@rc-component/util/es/utils/get.js
function get(entity, path) {
let current = entity;
for (let i = 0; i < path.length; i += 1) {
if (current === null || current === void 0) return;
current = current[path[i]];
}
return current;
}
//#endregion
//#region node_modules/@rc-component/util/es/utils/set.js
function internalSet(entity, paths, value, removeIfUndefined) {
if (!paths.length) return value;
const [path, ...restPath] = paths;
let clone;
if (!entity && typeof path === "number") clone = [];
else if (Array.isArray(entity)) clone = [...entity];
else clone = { ...entity };
if (removeIfUndefined && value === void 0 && restPath.length === 1) delete clone[path][restPath[0]];
else clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
return clone;
}
function set(entity, paths, value, removeIfUndefined = false) {
if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) return entity;
return internalSet(entity, paths, value, removeIfUndefined);
}
function isObject(obj) {
return typeof obj === "object" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
}
function createEmpty(source) {
return Array.isArray(source) ? [] : {};
}
var keys = typeof Reflect === "undefined" ? Object.keys : Reflect.ownKeys;
/**
* Merge multiple objects. Support custom merge logic.
* @param sources object sources
* @param config.prepareArray Customize array prepare function.
* It will return empty [] by default.
* So when match array, it will auto be override with next array in sources.
*/
function mergeWith(sources, config = {}) {
const { prepareArray } = config;
const finalPrepareArray = prepareArray || (() => []);
let clone = createEmpty(sources[0]);
sources.forEach((src) => {
function internalMerge(path, parentLoopSet) {
const loopSet = new Set(parentLoopSet);
const value = get(src, path);
const isArr = Array.isArray(value);
if (isArr || isObject(value)) {
if (!loopSet.has(value)) {
loopSet.add(value);
const originValue = get(clone, path);
if (isArr) clone = set(clone, path, finalPrepareArray(originValue, value));
else if (!originValue || typeof originValue !== "object") clone = set(clone, path, createEmpty(value));
keys(value).forEach((key) => {
if (Object.getOwnPropertyDescriptor(value, key).enumerable) internalMerge([...path, key], loopSet);
});
}
} else clone = set(clone, path, value);
}
internalMerge([]);
});
return clone;
}
/**
* Merge multiple objects into a new single object.
* Arrays will be replaced by default.
*/
function merge$1(...sources) {
return mergeWith(sources);
}
//#endregion
//#region node_modules/@rc-component/util/es/omit.js
function omit(obj, fields) {
const clone = Object.assign({}, obj);
if (Array.isArray(fields)) fields.forEach((key) => {
delete clone[key];
});
return clone;
}
//#endregion
//#region node_modules/@rc-component/util/es/Children/toArray.js
function toArray$8(children, option = {}) {
let ret = [];
import_react.Children.forEach(children, (child) => {
if ((child === void 0 || child === null) && !option.keepEmpty) return;
if (Array.isArray(child)) ret = ret.concat(toArray$8(child));
else if (isFragment$1(child) && child.props) ret = ret.concat(toArray$8(child.props.children, option));
else ret.push(child);
});
return ret;
}
//#endregion
//#region node_modules/antd/es/_util/warning.js
function noop$4() {}
var { resetWarned: rcResetWarned } = warningOnce;
var deprecatedWarnList = null;
var _warning = noop$4;
_warning = (valid, component, message) => {
warningOnce(valid, `[antd: ${component}] ${message}`);
};
var warning$1 = _warning;
var WarningContext = /* @__PURE__ */ import_react.createContext({});
/**
* This is a hook but we not named as `useWarning`
* since this is only used in development.
* We should always wrap this in `if (process.env.NODE_ENV !== 'production')` condition
*/
var devUseWarning = (component) => {
const { strict } = import_react.useContext(WarningContext);
const typeWarning = (valid, type, message) => {
if (!valid) if (strict === false && type === "deprecated") {
const existWarning = deprecatedWarnList;
if (!deprecatedWarnList) deprecatedWarnList = {};
deprecatedWarnList[component] = deprecatedWarnList[component] || [];
if (!deprecatedWarnList[component].includes(message || "")) deprecatedWarnList[component].push(message || "");
if (!existWarning) console.warn("[antd] There exists deprecated usage in your code:", deprecatedWarnList);
} else warning$1(valid, component, message);
};
typeWarning.deprecated = (valid, oldProp, newProp, message = "") => {
typeWarning(valid, "deprecated", `\`${oldProp}\` is deprecated. Please use \`${newProp}\` instead.${message ? ` ${message}` : ""}`);
};
return typeWarning;
};
//#endregion
//#region node_modules/@rc-component/util/es/Dom/findDOMNode.js
function isDOM(node) {
return node instanceof HTMLElement || node instanceof SVGElement;
}
/**
* Retrieves a DOM node via a ref, and does not invoke `findDOMNode`.
*/
function getDOM(node) {
if (node && typeof node === "object" && isDOM(node.nativeElement)) return node.nativeElement;
if (isDOM(node)) return node;
return null;
}
//#endregion
//#region node_modules/@rc-component/resize-observer/es/Collection.js
var CollectionContext = /* @__PURE__ */ import_react.createContext(null);
/**
* Collect all the resize event from children ResizeObserver
*/
function Collection({ children, onBatchResize }) {
const resizeIdRef = import_react.useRef(0);
const resizeInfosRef = import_react.useRef([]);
const onCollectionResize = import_react.useContext(CollectionContext);
const onResize = import_react.useCallback((size, element, data) => {
resizeIdRef.current += 1;
const currentId = resizeIdRef.current;
resizeInfosRef.current.push({
size,
element,
data
});
Promise.resolve().then(() => {
if (currentId === resizeIdRef.current) {
onBatchResize?.(resizeInfosRef.current);
resizeInfosRef.current = [];
}
});
onCollectionResize?.(size, element, data);
}, [onBatchResize, onCollectionResize]);
return /* @__PURE__ */ import_react.createElement(CollectionContext.Provider, { value: onResize }, children);
}
//#endregion
//#region node_modules/@rc-component/resize-observer/es/utils/observerUtil.js
var elementListeners = /* @__PURE__ */ new Map();
function onResize(entities) {
entities.forEach((entity) => {
const { target } = entity;
elementListeners.get(target)?.forEach((listener) => listener(target));
});
}
var observer;
function ensureResizeObserver() {
if (!observer) observer = new ResizeObserver(onResize);
return observer;
}
function observe(element, callback) {
if (!elementListeners.has(element)) {
elementListeners.set(element, /* @__PURE__ */ new Set());
ensureResizeObserver().observe(element);
}
elementListeners.get(element).add(callback);
}
function unobserve(element, callback) {
if (elementListeners.has(element)) {
elementListeners.get(element).delete(callback);
if (!elementListeners.get(element).size) {
ensureResizeObserver().unobserve(element);
elementListeners.delete(element);
}
}
}
//#endregion
//#region node_modules/@rc-component/resize-observer/es/useResizeObserver.js
function useResizeObserver(enabled, getTarget, onDelayResize, onSyncResize) {
const sizeRef = import_react.useRef({
width: -1,
height: -1,
offsetWidth: -1,
offsetHeight: -1
});
const onInternalResize = useEvent((target) => {
const { width, height } = target.getBoundingClientRect();
const { offsetWidth, offsetHeight } = target;
/**
* Resize observer trigger when content size changed.
* In most case we just care about element size,
* let's use `boundary` instead of `contentRect` here to avoid shaking.
*/
const fixedWidth = Math.floor(width);
const fixedHeight = Math.floor(height);
if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
const size = {
width: fixedWidth,
height: fixedHeight,
offsetWidth,
offsetHeight
};
sizeRef.current = size;
const mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
const mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
const sizeInfo = {
...size,
offsetWidth: mergedOffsetWidth,
offsetHeight: mergedOffsetHeight
};
onSyncResize?.(sizeInfo, target);
Promise.resolve().then(() => {
onDelayResize?.(sizeInfo, target);
});
}
});
const isFuncTarget = typeof getTarget === "function";
const funcTargetIdRef = import_react.useRef(0);
import_react.useEffect(() => {
const target = isFuncTarget ? getTarget() : getTarget;
if (target && enabled) observe(target, onInternalResize);
else if (enabled && isFuncTarget) funcTargetIdRef.current += 1;
return () => {
if (target) unobserve(target, onInternalResize);
};
}, [enabled, isFuncTarget ? funcTargetIdRef.current : getTarget]);
}
//#endregion
//#region node_modules/@rc-component/resize-observer/es/SingleObserver/index.js
function SingleObserver(props, ref) {
const { children, disabled, onResize, data } = props;
const elementRef = import_react.useRef(null);
const onCollectionResize = import_react.useContext(CollectionContext);
const isRenderProps = typeof children === "function";
const mergedChildren = isRenderProps ? children(elementRef) : children;
const canRef = !isRenderProps && /* @__PURE__ */ import_react.isValidElement(mergedChildren) && supportRef(mergedChildren);
const mergedRef = useComposeRef(canRef ? getNodeRef(mergedChildren) : null, elementRef);
const getDomElement = () => {
return getDOM(elementRef.current);
};
import_react.useImperativeHandle(ref, () => getDomElement());
useResizeObserver(!disabled, getDomElement, onResize, (sizeInfo, target) => {
onCollectionResize?.(sizeInfo, target, data);
});
return canRef ? /* @__PURE__ */ import_react.cloneElement(mergedChildren, { ref: mergedRef }) : mergedChildren;
}
var RefSingleObserver = /* @__PURE__ */ import_react.forwardRef(SingleObserver);
RefSingleObserver.displayName = "SingleObserver";
//#endregion
//#region node_modules/@rc-component/resize-observer/es/index.js
function _extends$99() {
_extends$99 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$99.apply(this, arguments);
}
var INTERNAL_PREFIX_KEY = "rc-observer-key";
function ResizeObserver$1(props, ref) {
const { children } = props;
const childNodes = typeof children === "function" ? [children] : toArray$8(children);
if (childNodes.length > 1) warning$2(false, "Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.");
else if (childNodes.length === 0) warning$2(false, "`children` of ResizeObserver is empty. Nothing is in observe.");
return childNodes.map((child, index) => {
const key = child?.key || `${INTERNAL_PREFIX_KEY}-${index}`;
return /* @__PURE__ */ import_react.createElement(RefSingleObserver, _extends$99({}, props, {
key,
ref: index === 0 ? ref : void 0
}), child);
});
}
var RefResizeObserver = /* @__PURE__ */ import_react.forwardRef(ResizeObserver$1);
RefResizeObserver.displayName = "ResizeObserver";
RefResizeObserver.Collection = Collection;
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
function _arrayLikeToArray$34(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
function _arrayWithoutHoles$8(r) {
if (Array.isArray(r)) return _arrayLikeToArray$34(r);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray$8(r) {
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
function _unsupportedIterableToArray$34(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray$34(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$34(r, a) : void 0;
}
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread$8() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
function _toConsumableArray$8(r) {
return _arrayWithoutHoles$8(r) || _iterableToArray$8(r) || _unsupportedIterableToArray$34(r) || _nonIterableSpread$8();
}
//#endregion
//#region node_modules/@rc-component/util/es/raf.js
var raf = (callback) => +setTimeout(callback, 16);
var caf = (num) => clearTimeout(num);
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
raf = (callback) => window.requestAnimationFrame(callback);
caf = (handle) => window.cancelAnimationFrame(handle);
}
var rafUUID = 0;
var rafIds = /* @__PURE__ */ new Map();
function cleanup(id) {
rafIds.delete(id);
}
var wrapperRaf = (callback, times = 1) => {
rafUUID += 1;
const id = rafUUID;
function callRef(leftTimes) {
if (leftTimes === 0) {
cleanup(id);
callback();
} else {
const realId = raf(() => {
callRef(leftTimes - 1);
});
rafIds.set(id, realId);
}
}
callRef(times);
return id;
};
wrapperRaf.cancel = (id) => {
const realId = rafIds.get(id);
cleanup(id);
return caf(realId);
};
wrapperRaf.ids = () => rafIds;
//#endregion
//#region node_modules/antd/es/_util/throttleByAnimationFrame.js
function throttleByAnimationFrame(fn) {
let requestId = null;
const later = (args) => () => {
requestId = null;
fn.apply(void 0, _toConsumableArray$8(args));
};
const throttled = (...args) => {
if (requestId === null) requestId = wrapperRaf(later(args));
};
throttled.cancel = () => {
wrapperRaf.cancel(requestId);
requestId = null;
};
return throttled;
}
var defaultIconPrefixCls = "anticon";
var Variants = [
"outlined",
"borderless",
"filled",
"underlined"
];
var defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) return customizePrefixCls;
return suffixCls ? `ant-${suffixCls}` : "ant";
};
var ConfigContext = /* @__PURE__ */ import_react.createContext({
getPrefixCls: defaultGetPrefixCls,
iconPrefixCls: defaultIconPrefixCls
});
var { Consumer: ConfigConsumer } = ConfigContext;
var EMPTY_OBJECT = {};
/**
* Get ConfigProvider configured component props.
* This help to reduce bundle size for saving `?.` operator.
* Do not use as `useMemo` deps since we do not cache the object here.
*
* NOTE: not refactor this with `useMemo` since memo will cost another memory space,
* which will waste both compare calculation & memory.
*/
function useComponentConfig(propName) {
const context = import_react.useContext(ConfigContext);
const { getPrefixCls, direction, getPopupContainer, renderEmpty } = context;
return {
classNames: EMPTY_OBJECT,
styles: EMPTY_OBJECT,
...context[propName],
getPrefixCls,
direction,
getPopupContainer,
renderEmpty
};
}
//#endregion
//#region node_modules/@emotion/hash/dist/hash.browser.esm.js
function murmur2(str) {
var h = 0;
var k, i = 0, len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
k ^= k >>> 24;
h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
}
switch (len) {
case 3: h ^= (str.charCodeAt(i + 2) & 255) << 16;
case 2: h ^= (str.charCodeAt(i + 1) & 255) << 8;
case 1:
h ^= str.charCodeAt(i) & 255;
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
}
h ^= h >>> 13;
h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
//#endregion
//#region node_modules/@rc-component/util/es/isEqual.js
/**
* Deeply compares two object literals.
* @param obj1 object 1
* @param obj2 object 2
* @param shallow shallow compare
* @returns
*/
function isEqual(obj1, obj2, shallow = false) {
const refSet = /* @__PURE__ */ new Set();
function deepEqual(a, b, level = 1) {
const circular = refSet.has(a);
warningOnce(!circular, "Warning: There may be circular references");
if (circular) return false;
if (a === b) return true;
if (shallow && level > 1) return false;
refSet.add(a);
const newLevel = level + 1;
if (Array.isArray(a)) {
if (!Array.isArray(b) || a.length !== b.length) return false;
for (let i = 0; i < a.length; i++) if (!deepEqual(a[i], b[i], newLevel)) return false;
return true;
}
if (a && b && typeof a === "object" && typeof b === "object") {
const keys = Object.keys(a);
if (keys.length !== Object.keys(b).length) return false;
return keys.every((key) => deepEqual(a[key], b[key], newLevel));
}
return false;
}
return deepEqual(obj1, obj2);
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/Cache.js
var SPLIT$1 = "%";
/** Connect key with `SPLIT` */
function pathKey(keys) {
return keys.join(SPLIT$1);
}
/** Record update id for extract static style order. */
var updateId = 0;
var Entity = class {
instanceId;
constructor(instanceId) {
this.instanceId = instanceId;
}
/** @private Internal cache map. Do not access this directly */
cache = /* @__PURE__ */ new Map();
/** @private Record update times for each key */
updateTimes = /* @__PURE__ */ new Map();
extracted = /* @__PURE__ */ new Set();
get(keys) {
return this.opGet(pathKey(keys));
}
/** A fast get cache with `get` concat. */
opGet(keyPathStr) {
return this.cache.get(keyPathStr) || null;
}
update(keys, valueFn) {
return this.opUpdate(pathKey(keys), valueFn);
}
/** A fast get cache with `get` concat. */
opUpdate(keyPathStr, valueFn) {
const nextValue = valueFn(this.cache.get(keyPathStr));
if (nextValue === null) {
this.cache.delete(keyPathStr);
this.updateTimes.delete(keyPathStr);
} else {
this.cache.set(keyPathStr, nextValue);
this.updateTimes.set(keyPathStr, updateId);
updateId += 1;
}
}
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/StyleContext.js
var ATTR_TOKEN = "data-token-hash";
var ATTR_MARK = "data-css-hash";
var ATTR_CACHE_PATH = "data-cache-path";
var CSS_IN_JS_INSTANCE = "__cssinjs_instance__";
function createCache() {
const cssinjsInstanceId = Math.random().toString(12).slice(2);
if (typeof document !== "undefined" && document.head && document.body) {
const styles = document.body.querySelectorAll(`style[data-css-hash]`) || [];
const { firstChild } = document.head;
Array.from(styles).forEach((style) => {
style[CSS_IN_JS_INSTANCE] ||= cssinjsInstanceId;
if (style["__cssinjs_instance__"] === cssinjsInstanceId) document.head.insertBefore(style, firstChild);
});
const styleHash = {};
Array.from(document.querySelectorAll(`style[${ATTR_MARK}]`)).forEach((style) => {
const hash = style.getAttribute(ATTR_MARK);
if (styleHash[hash]) {
if (style["__cssinjs_instance__"] === cssinjsInstanceId) style.parentNode?.removeChild(style);
} else styleHash[hash] = true;
});
}
return new Entity(cssinjsInstanceId);
}
var StyleContext = /* @__PURE__ */ import_react.createContext({
hashPriority: "low",
cache: createCache(),
defaultCache: true,
autoPrefix: false
});
//#endregion
//#region node_modules/@ant-design/cssinjs/es/theme/ThemeCache.js
function sameDerivativeOption(left, right) {
if (left.length !== right.length) return false;
for (let i = 0; i < left.length; i++) if (left[i] !== right[i]) return false;
return true;
}
var ThemeCache = class ThemeCache {
static MAX_CACHE_SIZE = 20;
static MAX_CACHE_OFFSET = 5;
cache;
keys;
cacheCallTimes;
constructor() {
this.cache = /* @__PURE__ */ new Map();
this.keys = [];
this.cacheCallTimes = 0;
}
size() {
return this.keys.length;
}
internalGet(derivativeOption, updateCallTimes = false) {
let cache = { map: this.cache };
derivativeOption.forEach((derivative) => {
if (!cache) cache = void 0;
else cache = cache?.map?.get(derivative);
});
if (cache?.value && updateCallTimes) cache.value[1] = this.cacheCallTimes++;
return cache?.value;
}
get(derivativeOption) {
return this.internalGet(derivativeOption, true)?.[0];
}
has(derivativeOption) {
return !!this.internalGet(derivativeOption);
}
set(derivativeOption, value) {
if (!this.has(derivativeOption)) {
if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {
const [targetKey] = this.keys.reduce((result, key) => {
const [, callTimes] = result;
if (this.internalGet(key)[1] < callTimes) return [key, this.internalGet(key)[1]];
return result;
}, [this.keys[0], this.cacheCallTimes]);
this.delete(targetKey);
}
this.keys.push(derivativeOption);
}
let cache = this.cache;
derivativeOption.forEach((derivative, index) => {
if (index === derivativeOption.length - 1) cache.set(derivative, { value: [value, this.cacheCallTimes++] });
else {
const cacheValue = cache.get(derivative);
if (!cacheValue) cache.set(derivative, { map: /* @__PURE__ */ new Map() });
else if (!cacheValue.map) cacheValue.map = /* @__PURE__ */ new Map();
cache = cache.get(derivative).map;
}
});
}
deleteByPath(currentCache, derivatives) {
const cache = currentCache.get(derivatives[0]);
if (derivatives.length === 1) {
if (!cache.map) currentCache.delete(derivatives[0]);
else currentCache.set(derivatives[0], { map: cache.map });
return cache.value?.[0];
}
const result = this.deleteByPath(cache.map, derivatives.slice(1));
if ((!cache.map || cache.map.size === 0) && !cache.value) currentCache.delete(derivatives[0]);
return result;
}
delete(derivativeOption) {
if (this.has(derivativeOption)) {
this.keys = this.keys.filter((item) => !sameDerivativeOption(item, derivativeOption));
return this.deleteByPath(this.cache, derivativeOption);
}
}
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/theme/Theme.js
var uuid$4 = 0;
/**
* Theme with algorithms to derive tokens from design tokens.
* Use `createTheme` first which will help to manage the theme instance cache.
*/
var Theme = class {
derivatives;
id;
constructor(derivatives) {
this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
this.id = uuid$4;
if (derivatives.length === 0) warning$2(derivatives.length > 0, "[Ant Design CSS-in-JS] Theme should have at least one derivative function.");
uuid$4 += 1;
}
getDerivativeToken(token) {
return this.derivatives.reduce((result, derivative) => derivative(token, result), void 0);
}
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/theme/createTheme.js
var cacheThemes = new ThemeCache();
/**
* Same as new Theme, but will always return same one if `derivative` not changed.
*/
function createTheme(derivatives) {
const derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
if (!cacheThemes.has(derivativeArr)) cacheThemes.set(derivativeArr, new Theme(derivativeArr));
return cacheThemes.get(derivativeArr);
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/util/index.js
var resultCache = /* @__PURE__ */ new WeakMap();
var RESULT_VALUE = {};
function memoResult(callback, deps) {
let current = resultCache;
for (let i = 0; i < deps.length; i += 1) {
const dep = deps[i];
if (!current.has(dep)) current.set(dep, /* @__PURE__ */ new WeakMap());
current = current.get(dep);
}
if (!current.has(RESULT_VALUE)) current.set(RESULT_VALUE, callback());
return current.get(RESULT_VALUE);
}
var flattenTokenCache = /* @__PURE__ */ new WeakMap();
/**
* Flatten token to string, this will auto cache the result when token not change
*/
function flattenToken(token) {
let str = flattenTokenCache.get(token) || "";
if (!str) {
Object.keys(token).forEach((key) => {
const value = token[key];
str += key;
if (value instanceof Theme) str += value.id;
else if (value && typeof value === "object") str += flattenToken(value);
else str += value;
});
str = murmur2(str);
flattenTokenCache.set(token, str);
}
return str;
}
/**
* Convert derivative token to key string
*/
function token2key(token, salt) {
return murmur2(`${salt}_${flattenToken(token)}`);
}
`random-${Date.now()}-${Math.random()}`.replace(/\./g, "");
var isClientSide = canUseDom();
function unit$1(num) {
if (typeof num === "number") return `${num}px`;
return num;
}
function where(options) {
const { hashCls, hashPriority = "low" } = options || {};
if (!hashCls) return "";
const hashSelector = `.${hashCls}`;
return hashPriority === "low" ? `:where(${hashSelector})` : hashSelector;
}
var isNonNullable$1 = (val) => {
return val !== void 0 && val !== null;
};
/**
* Get nonce value and inject it into CSS config if available.
*/
function injectCSPNonce(config, nonce) {
const nonceStr = typeof nonce === "function" ? nonce() : nonce;
if (nonceStr) return {
...config,
csp: {
...config.csp,
nonce: nonceStr
}
};
return config;
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/util/css-variables.js
var token2CSSVar = (token, prefix = "") => {
return `--${prefix ? `${prefix}-` : ""}${token}`.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g, "$1-$2").replace(/([a-z])([A-Z0-9])/g, "$1-$2").toLowerCase();
};
var serializeCSSVar = (cssVars, hashId, options) => {
const { hashCls, hashPriority = "low", scope } = options || {};
if (!Object.keys(cssVars).length) return "";
const baseSelector = `${where({
hashCls,
hashPriority
})}.${hashId}`;
const scopes = [scope].flat().filter(Boolean);
return `${scopes.length ? scopes.map((s) => `${baseSelector}.${s}`).join(", ") : baseSelector}{${Object.entries(cssVars).map(([key, value]) => `${key}:${value};`).join("")}}`;
};
var transformToken = (token, themeKey, config) => {
const { hashCls, hashPriority = "low", prefix, unitless, ignore, preserve } = config || {};
const cssVars = {};
const result = {};
Object.entries(token).forEach(([key, value]) => {
if (preserve?.[key]) result[key] = value;
else if ((typeof value === "string" || typeof value === "number") && !ignore?.[key]) {
const cssVar = token2CSSVar(key, prefix);
cssVars[cssVar] = typeof value === "number" && !unitless?.[key] ? `${value}px` : String(value);
result[key] = `var(${cssVar})`;
}
});
return [result, serializeCSSVar(cssVars, themeKey, {
scope: config?.scope,
hashCls,
hashPriority
})];
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/hooks/useHMR.js
var webpackHMR = false;
function useDevHMR() {
return webpackHMR;
}
if (typeof module !== "undefined" && module && module.hot && typeof window !== "undefined") {
const win = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : null;
if (win && typeof win.webpackHotUpdate === "function") {
const originWebpackHotUpdate = win.webpackHotUpdate;
win.webpackHotUpdate = (...args) => {
webpackHMR = true;
setTimeout(() => {
webpackHMR = false;
}, 0);
return originWebpackHotUpdate(...args);
};
}
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/hooks/useGlobalCache.js
var effectMap = /* @__PURE__ */ new Map();
function useGlobalCache(prefix, keyPath, cacheFn, onCacheRemove, onCacheEffect) {
const { cache: globalCache } = import_react.useContext(StyleContext);
const fullPathStr = pathKey([prefix, ...keyPath]);
const HMRUpdate = useDevHMR();
const buildCache = (updater) => {
globalCache.opUpdate(fullPathStr, (prevCache) => {
const [times = 0, cache] = prevCache || [void 0, void 0];
let tmpCache = cache;
if (cache && HMRUpdate) {
onCacheRemove?.(tmpCache, HMRUpdate);
tmpCache = null;
}
const data = [times, tmpCache || cacheFn()];
return updater ? updater(data) : data;
});
};
import_react.useMemo(() => {
buildCache();
}, [fullPathStr]);
let cacheEntity = globalCache.opGet(fullPathStr);
if (!cacheEntity) {
buildCache();
cacheEntity = globalCache.opGet(fullPathStr);
}
const cacheContent = cacheEntity[1];
(0, import_react.useInsertionEffect)(() => {
buildCache(([times, cache]) => [times + 1, cache]);
if (!effectMap.has(fullPathStr)) {
onCacheEffect?.(cacheContent);
effectMap.set(fullPathStr, true);
Promise.resolve().then(() => {
effectMap.delete(fullPathStr);
});
}
return () => {
globalCache.opUpdate(fullPathStr, (prevCache) => {
const [times = 0, cache] = prevCache || [];
if (times - 1 === 0) {
onCacheRemove?.(cache, false);
effectMap.delete(fullPathStr);
return null;
}
return [times - 1, cache];
});
};
}, [fullPathStr]);
return cacheContent;
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/hooks/useCacheToken.js
var EMPTY_OVERRIDE = {};
var hashPrefix = "css-dev-only-do-not-override";
var tokenKeys = /* @__PURE__ */ new Map();
function recordCleanToken(tokenKey) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);
}
function removeStyleTags(key, instanceId) {
if (typeof document !== "undefined") document.querySelectorAll(`style[${ATTR_TOKEN}="${key}"]`).forEach((style) => {
if (style["__cssinjs_instance__"] === instanceId) style.parentNode?.removeChild(style);
});
}
var TOKEN_THRESHOLD = -1;
function cleanTokenStyle(tokenKey, instanceId) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);
const cleanableKeyList = /* @__PURE__ */ new Set();
tokenKeys.forEach((value, key) => {
if (value <= 0) cleanableKeyList.add(key);
});
if (tokenKeys.size - cleanableKeyList.size > TOKEN_THRESHOLD) cleanableKeyList.forEach((key) => {
removeStyleTags(key, instanceId);
tokenKeys.delete(key);
});
}
var getComputedToken$1 = (originToken, overrideToken, theme, format) => {
let mergedDerivativeToken = {
...theme.getDerivativeToken(originToken),
...overrideToken
};
if (format) mergedDerivativeToken = format(mergedDerivativeToken);
return mergedDerivativeToken;
};
var TOKEN_PREFIX = "token";
/**
* Cache theme derivative token as global shared one
* @param theme Theme entity
* @param tokens List of tokens, used for cache. Please do not dynamic generate object directly
* @param option Additional config
* @returns Call Theme.getDerivativeToken(tokenObject) to get token
*/
function useCacheToken(theme, tokens, option) {
const { cache: { instanceId }, container, hashPriority } = (0, import_react.useContext)(StyleContext);
const { salt = "", override = EMPTY_OVERRIDE, formatToken, getComputedToken: compute, cssVar, nonce } = option;
const mergedToken = memoResult(() => Object.assign({}, ...tokens), tokens);
const tokenStr = flattenToken(mergedToken);
const overrideTokenStr = flattenToken(override);
const cssVarStr = flattenToken(cssVar);
return useGlobalCache(TOKEN_PREFIX, [
salt,
theme.id,
tokenStr,
overrideTokenStr,
cssVarStr
], () => {
const mergedDerivativeToken = compute ? compute(mergedToken, override, theme) : getComputedToken$1(mergedToken, override, theme, formatToken);
const actualToken = { ...mergedDerivativeToken };
const mergedSalt = `${salt}_${cssVar.prefix}`;
const hashId = murmur2(mergedSalt);
const hashCls = `${hashPrefix}-${hashId}`;
actualToken._tokenKey = token2key(actualToken, mergedSalt);
const [tokenWithCssVar, cssVarsStr] = transformToken(mergedDerivativeToken, cssVar.key, {
prefix: cssVar.prefix,
ignore: cssVar.ignore,
unitless: cssVar.unitless,
preserve: cssVar.preserve,
hashPriority,
hashCls: cssVar.hashed ? hashCls : void 0
});
tokenWithCssVar._hashId = hashId;
recordCleanToken(cssVar.key);
return [
tokenWithCssVar,
hashCls,
actualToken,
cssVarsStr,
cssVar.key
];
}, ([, , , , themeKey]) => {
cleanTokenStyle(themeKey, instanceId);
}, ([, , , cssVarsStr, themeKey]) => {
if (!cssVarsStr) return;
let mergedCSSConfig = {
mark: ATTR_MARK,
prepend: "queue",
attachTo: container,
priority: -999
};
mergedCSSConfig = injectCSPNonce(mergedCSSConfig, nonce);
const style = updateCSS(cssVarsStr, murmur2(`css-var-${themeKey}`), mergedCSSConfig);
style[CSS_IN_JS_INSTANCE] = instanceId;
style.setAttribute(ATTR_TOKEN, themeKey);
});
}
//#endregion
//#region node_modules/@emotion/unitless/dist/unitless.browser.esm.js
var unitlessKeys = {
animationIterationCount: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
//#endregion
//#region node_modules/stylis/src/Enum.js
var MS = "-ms-";
var MOZ = "-moz-";
var WEBKIT = "-webkit-";
var COMMENT = "comm";
var RULESET = "rule";
var DECLARATION = "decl";
var IMPORT = "@import";
var NAMESPACE = "@namespace";
var KEYFRAMES = "@keyframes";
var LAYER = "@layer";
//#endregion
//#region node_modules/stylis/src/Utility.js
/**
* @param {number}
* @return {number}
*/
var abs = Math.abs;
/**
* @param {number}
* @return {string}
*/
var from = String.fromCharCode;
/**
* @param {object}
* @return {object}
*/
var assign = Object.assign;
/**
* @param {string} value
* @param {number} length
* @return {number}
*/
function hash(value, length) {
return charat(value, 0) ^ 45 ? (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
}
/**
* @param {string} value
* @return {string}
*/
function trim(value) {
return value.trim();
}
/**
* @param {string} value
* @param {RegExp} pattern
* @return {string?}
*/
function match$1(value, pattern) {
return (value = pattern.exec(value)) ? value[0] : value;
}
/**
* @param {string} value
* @param {(string|RegExp)} pattern
* @param {string} replacement
* @return {string}
*/
function replace(value, pattern, replacement) {
return value.replace(pattern, replacement);
}
/**
* @param {string} value
* @param {string} search
* @return {number}
*/
function indexof(value, search) {
return value.indexOf(search);
}
/**
* @param {string} value
* @param {number} index
* @return {number}
*/
function charat(value, index) {
return value.charCodeAt(index) | 0;
}
/**
* @param {string} value
* @param {number} begin
* @param {number} end
* @return {string}
*/
function substr(value, begin, end) {
return value.slice(begin, end);
}
/**
* @param {string} value
* @return {number}
*/
function strlen(value) {
return value.length;
}
/**
* @param {any[]} value
* @return {number}
*/
function sizeof(value) {
return value.length;
}
/**
* @param {any} value
* @param {any[]} array
* @return {any}
*/
function append(value, array) {
return array.push(value), value;
}
/**
* @param {string[]} array
* @param {function} callback
* @return {string}
*/
function combine(array, callback) {
return array.map(callback).join("");
}
/**
* @param {string[]} array
* @param {RegExp} pattern
* @return {string[]}
*/
function filter$1(array, pattern) {
return array.filter(function(value) {
return !match$1(value, pattern);
});
}
//#endregion
//#region node_modules/stylis/src/Tokenizer.js
var line = 1;
var column = 1;
var length = 0;
var position$1 = 0;
var character = 0;
var characters = "";
/**
* @param {string} value
* @param {object | null} root
* @param {object | null} parent
* @param {string} type
* @param {string[] | string} props
* @param {object[] | string} children
* @param {object[]} siblings
* @param {number} length
*/
function node(value, root, parent, type, props, children, length, siblings) {
return {
value,
root,
parent,
type,
props,
children,
line,
column,
length,
return: "",
siblings
};
}
/**
* @param {object} root
* @param {object} props
* @return {object}
*/
function copy$1(root, props) {
return assign(node("", null, null, "", null, null, 0, root.siblings), root, { length: -root.length }, props);
}
/**
* @param {object} root
*/
function lift(root) {
while (root.root) root = copy$1(root.root, { children: [root] });
append(root, root.siblings);
}
/**
* @return {number}
*/
function char() {
return character;
}
/**
* @return {number}
*/
function prev() {
character = position$1 > 0 ? charat(characters, --position$1) : 0;
if (column--, character === 10) column = 1, line--;
return character;
}
/**
* @return {number}
*/
function next() {
character = position$1 < length ? charat(characters, position$1++) : 0;
if (column++, character === 10) column = 1, line++;
return character;
}
/**
* @return {number}
*/
function peek() {
return charat(characters, position$1);
}
/**
* @return {number}
*/
function caret() {
return position$1;
}
/**
* @param {number} begin
* @param {number} end
* @return {string}
*/
function slice(begin, end) {
return substr(characters, begin, end);
}
/**
* @param {number} type
* @return {number}
*/
function token(type) {
switch (type) {
case 0:
case 9:
case 10:
case 13:
case 32: return 5;
case 33:
case 43:
case 44:
case 47:
case 62:
case 64:
case 126:
case 59:
case 123:
case 125: return 4;
case 58: return 3;
case 34:
case 39:
case 40:
case 91: return 2;
case 41:
case 93: return 1;
}
return 0;
}
/**
* @param {string} value
* @return {any[]}
*/
function alloc(value) {
return line = column = 1, length = strlen(characters = value), position$1 = 0, [];
}
/**
* @param {any} value
* @return {any}
*/
function dealloc(value) {
return characters = "", value;
}
/**
* @param {number} type
* @return {string}
*/
function delimit(type) {
return trim(slice(position$1 - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
}
/**
* @param {number} type
* @return {string}
*/
function whitespace$1(type) {
while (character = peek()) if (character < 33) next();
else break;
return token(type) > 2 || token(character) > 3 ? "" : " ";
}
/**
* @param {number} index
* @param {number} count
* @return {string}
*/
function escaping(index, count) {
while (--count && next()) if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break;
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
}
/**
* @param {number} type
* @return {number}
*/
function delimiter(type) {
while (next()) switch (character) {
case type: return position$1;
case 34:
case 39:
if (type !== 34 && type !== 39) delimiter(character);
break;
case 40:
if (type === 41) delimiter(type);
break;
case 92:
next();
break;
}
return position$1;
}
/**
* @param {number} type
* @param {number} index
* @return {number}
*/
function commenter(type, index) {
while (next()) if (type + character === 57) break;
else if (type + character === 84 && peek() === 47) break;
return "/*" + slice(index, position$1 - 1) + "*" + from(type === 47 ? type : next());
}
/**
* @param {number} index
* @return {string}
*/
function identifier(index) {
while (!token(peek())) next();
return slice(index, position$1);
}
//#endregion
//#region node_modules/stylis/src/Parser.js
/**
* @param {string} value
* @return {object[]}
*/
function compile(value) {
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {string[]} rule
* @param {string[]} rules
* @param {string[]} rulesets
* @param {number[]} pseudo
* @param {number[]} points
* @param {string[]} declarations
* @return {object}
*/
function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
var index = 0;
var offset = 0;
var length = pseudo;
var atrule = 0;
var property = 0;
var previous = 0;
var variable = 1;
var scanning = 1;
var ampersand = 1;
var parens = 0;
var character = 0;
var type = "";
var props = rules;
var children = rulesets;
var reference = rule;
var characters = type;
while (scanning) switch (previous = character, character = next()) {
case 40:
if (previous != 108 && charat(characters, length - 1) == 58) parens++, characters += "(";
else characters += delimit(character);
break;
case 41:
parens--, characters += ")";
break;
case 34:
case 39:
case 91:
characters += delimit(character);
break;
case 9:
case 10:
case 13:
case 32:
if (parens > 0) {
characters += from(character);
break;
}
characters += whitespace$1(previous);
break;
case 92:
characters += escaping(caret() - 1, 7);
continue;
case 47:
switch (peek()) {
case 42:
case 47:
append(comment(commenter(next(), caret()), root, parent, declarations), declarations);
if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters) && substr(characters, -1, void 0) !== " ") characters += " ";
break;
default: characters += "/";
}
break;
case 123 * variable: points[index++] = strlen(characters) * ampersand;
case 125 * variable:
case 59:
case 0:
if (parens > 0 && character) {
characters += from(character);
break;
}
switch (character) {
case 0:
case 125: scanning = 0;
case 59 + offset:
if (ampersand == -1) characters = replace(characters, /\f/g, "");
if (property > 0 && (strlen(characters) - length || variable === 0)) append(property > 32 ? declaration(characters + ";", rule, parent, length - 1, declarations) : declaration(replace(characters, " ", "") + ";", rule, parent, length - 2, declarations), declarations);
break;
case 59: characters += ";";
default:
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets);
if (character === 123) if (offset === 0) parse(characters, root, reference, reference, props, rulesets, length, points, children);
else {
switch (atrule) {
case 99: if (charat(characters, 3) === 110) break;
case 108: if (charat(characters, 2) === 97) break;
default: offset = 0;
case 100:
case 109:
case 115:
}
if (offset) parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children);
else parse(characters, reference, reference, reference, [""], children, 0, points, children);
}
}
index = offset = property = 0, variable = ampersand = 1, type = characters = "", length = pseudo;
break;
case 58: length = 1 + strlen(characters), property = previous;
default:
if (variable < 1) {
if (character == 123) --variable;
else if (character == 125 && variable++ == 0 && prev() == 125) continue;
}
switch (characters += from(character), character * variable) {
case 38:
ampersand = offset > 0 ? 1 : (characters += "\f", -1);
break;
case 44:
if (parens > 0) break;
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
break;
case 64:
if (peek() === 45) characters += delimit(next());
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
break;
case 45: if (previous === 45 && strlen(characters) == 2) variable = 0;
}
}
return rulesets;
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} index
* @param {number} offset
* @param {string[]} rules
* @param {number[]} points
* @param {string} type
* @param {string[]} props
* @param {string[]} children
* @param {number} length
* @param {object[]} siblings
* @return {object}
*/
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {
var post = offset - 1;
var rule = offset === 0 ? rules : [""];
var size = sizeof(rule);
for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x]))) props[k++] = z;
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings);
}
/**
* @param {number} value
* @param {object} root
* @param {object?} parent
* @param {object[]} siblings
* @return {object}
*/
function comment(value, root, parent, siblings) {
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings);
}
/**
* @param {string} value
* @param {object} root
* @param {object?} parent
* @param {number} length
* @param {object[]} siblings
* @return {object}
*/
function declaration(value, root, parent, length, siblings) {
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings);
}
//#endregion
//#region node_modules/stylis/src/Prefixer.js
/**
* @param {string} value
* @param {number} length
* @param {object[]} children
* @return {string}
*/
function prefix(value, length, children) {
switch (hash(value, length)) {
case 5103: return WEBKIT + "print-" + value + value;
case 5737:
case 4201:
case 3177:
case 3433:
case 1641:
case 4457:
case 2921:
case 5572:
case 6356:
case 5844:
case 3191:
case 6645:
case 3005:
case 4215:
case 6389:
case 5109:
case 5365:
case 5621:
case 3829:
case 6391:
case 5879:
case 5623:
case 6135:
case 4599: return WEBKIT + value + value;
case 4855: return WEBKIT + value.replace("add", "source-over").replace("substract", "source-out").replace("intersect", "source-in").replace("exclude", "xor") + value;
case 4789: return MOZ + value + value;
case 5349:
case 4246:
case 4810:
case 6968:
case 2756: return WEBKIT + value + MOZ + value + MS + value + value;
case 5936: switch (charat(value, length + 11)) {
case 114: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
case 108: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
case 45: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
}
case 6828:
case 4268:
case 2903: return WEBKIT + value + MS + value + value;
case 6165: return WEBKIT + value + MS + "flex-" + value + value;
case 5187: return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
case 5443: return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (!match$1(value, /flex-|baseline/) ? MS + "grid-row-" + replace(value, /flex-|-self/g, "") : "") + value;
case 4675: return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value;
case 5548: return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
case 5292: return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
case 6060: return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
case 4554: return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
case 6187: return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
case 5495:
case 3959: return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
case 4968: return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /space-between/, "justify") + WEBKIT + value + value;
case 4200:
if (!match$1(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length) + value;
break;
case 2592:
case 3360: return MS + replace(value, "template-", "") + value;
case 4384:
case 3616:
if (children && children.some(function(element, index) {
return length = index, match$1(element.props, /grid-\w+-end/);
})) return ~indexof(value + (children = children[length].value), "span") ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span") ? match$1(children, /\d+/) : +match$1(children, /\d+/) - +match$1(value, /\d+/)) + ";";
return MS + replace(value, "-start", "") + value;
case 4896:
case 4128: return children && children.some(function(element) {
return match$1(element.props, /grid-\w+-start/);
}) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value;
case 4095:
case 3583:
case 4068:
case 2532: return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
case 109: if (charat(value, length + 4) !== 45) break;
case 102: return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length + 3) == 108 ? "$3" : "$2-$3")) + value;
case 115: return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length, children) + value : value;
}
break;
case 5152:
case 5920: return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_, a, b, c, d, e, f) {
return MS + a + ":" + b + f + (c ? MS + a + "-span:" + (d ? e : +e - +b) + f : "") + value;
});
case 4949:
if (charat(value, length + 6) === 121) return replace(value, ":", ":" + WEBKIT) + value;
break;
case 6444:
switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {
case 120: return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
case 100: return replace(value, ":", ":" + MS) + value;
}
break;
case 5719:
case 2647:
case 2135:
case 3927:
case 2391: return replace(value, "scroll-", "scroll-snap-") + value;
}
return value;
}
//#endregion
//#region node_modules/stylis/src/Serializer.js
/**
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
function serialize(children, callback) {
var output = "";
for (var i = 0; i < children.length; i++) output += callback(children[i], i, children, callback) || "";
return output;
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
* @return {string}
*/
function stringify$2(element, index, children, callback) {
switch (element.type) {
case LAYER: if (element.children.length) break;
case IMPORT:
case NAMESPACE:
case DECLARATION: return element.return = element.return || element.value;
case COMMENT: return "";
case KEYFRAMES: return element.return = element.value + "{" + serialize(element.children, callback) + "}";
case RULESET: if (!strlen(element.value = element.props.join(","))) return "";
}
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
}
//#endregion
//#region node_modules/stylis/src/Middleware.js
/**
* @param {function[]} collection
* @return {function}
*/
function middleware(collection) {
var length = sizeof(collection);
return function(element, index, children, callback) {
var output = "";
for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || "";
return output;
};
}
/**
* @param {object} element
* @param {number} index
* @param {object[]} children
* @param {function} callback
*/
function prefixer(element, index, children, callback) {
if (element.length > -1) {
if (!element.return) switch (element.type) {
case DECLARATION:
element.return = prefix(element.value, element.length, children);
return;
case KEYFRAMES: return serialize([copy$1(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback);
case RULESET: if (element.length) return combine(children = element.props, function(value) {
switch (match$1(value, callback = /(::plac\w+|:read-\w+)/)) {
case ":read-only":
case ":read-write":
lift(copy$1(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] }));
lift(copy$1(element, { props: [value] }));
assign(element, { props: filter$1(children, callback) });
break;
case "::placeholder":
lift(copy$1(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] }));
lift(copy$1(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] }));
lift(copy$1(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] }));
lift(copy$1(element, { props: [value] }));
assign(element, { props: filter$1(children, callback) });
break;
}
return "";
});
}
}
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/linters/utils.js
function lintWarning(message, info) {
const { path, parentSelectors } = info;
warningOnce(false, `[Ant Design CSS-in-JS] ${path ? `Error in ${path}: ` : ""}${message}${parentSelectors.length ? ` Selector: ${parentSelectors.join(" | ")}` : ""}`);
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/linters/contentQuotesLinter.js
var linter$1 = (key, value, info) => {
if (key === "content") {
if (typeof value !== "string" || [
"normal",
"none",
"initial",
"inherit",
"unset"
].indexOf(value) === -1 && !/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/.test(value) && !value.startsWith("var(") && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== "\"" && value.charAt(0) !== "'")) lintWarning(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${value}"'\`.`, info);
}
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/linters/hashedAnimationLinter.js
var linter = (key, value, info) => {
if (key === "animation") {
if (info.hashId && value !== "none") lintWarning(`You seem to be using hashed animation '${value}', in which case 'animationName' with Keyframe as value is recommended.`, info);
}
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/util/cacheMapUtil.js
var ATTR_CACHE_MAP = "data-ant-cssinjs-cache-path";
/**
* This marks style from the css file.
* Which means not exist in `` tag.
*/
var CSS_FILE_STYLE = "_FILE_STYLE__";
var cachePathMap;
var fromCSSFile = true;
function prepare() {
if (!cachePathMap) {
cachePathMap = {};
if (canUseDom()) {
const div = document.createElement("div");
div.className = ATTR_CACHE_MAP;
div.style.position = "fixed";
div.style.visibility = "hidden";
div.style.top = "-9999px";
document.body.appendChild(div);
let content = getComputedStyle(div).content || "";
content = content.replace(/^"/, "").replace(/"$/, "");
content.split(";").forEach((item) => {
const [path, hash] = item.split(":");
cachePathMap[path] = hash;
});
const inlineMapStyle = document.querySelector(`style[${ATTR_CACHE_MAP}]`);
if (inlineMapStyle) {
fromCSSFile = false;
inlineMapStyle.parentNode?.removeChild(inlineMapStyle);
}
document.body.removeChild(div);
}
}
}
function existPath(path) {
prepare();
return !!cachePathMap[path];
}
function getStyleAndHash(path) {
const hash = cachePathMap[path];
let styleStr = null;
if (hash && canUseDom()) if (fromCSSFile) styleStr = CSS_FILE_STYLE;
else {
const style = document.querySelector(`style[${ATTR_MARK}="${cachePathMap[path]}"]`);
if (style) styleStr = style.innerHTML;
else delete cachePathMap[path];
}
return [styleStr, hash];
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/hooks/useStyleRegister.js
var SKIP_CHECK = "_skip_check_";
var MULTI_VALUE = "_multi_value_";
function normalizeStyle(styleStr, autoPrefix) {
return (autoPrefix ? serialize(compile(styleStr), middleware([prefixer, stringify$2])) : serialize(compile(styleStr), stringify$2)).replace(/\{%%%\:[^;];}/g, ";");
}
function isCompoundCSSProperty(value) {
return typeof value === "object" && value && (SKIP_CHECK in value || MULTI_VALUE in value);
}
function injectSelectorHash(key, hashId, hashPriority = "high") {
if (!hashId) return key;
const hashSelector = where({
hashCls: hashId,
hashPriority
});
return key.split(",").map((k) => {
const fullPath = k.trim().split(/\s+/);
let firstPath = fullPath[0] || "";
const htmlElement = firstPath.match(/^\w+/)?.[0] || "";
firstPath = `${htmlElement}${hashSelector}${firstPath.slice(htmlElement.length)}`;
return [firstPath, ...fullPath.slice(1)].join(" ");
}).join(",");
}
var parseStyle = (interpolation, config = {}, { root, injectHash, parentSelectors } = {
root: true,
parentSelectors: []
}) => {
const { hashId, layer, path, hashPriority, transformers = [], linters = [] } = config;
let styleStr = "";
let effectStyle = {};
function parseKeyframes(keyframes) {
const animationName = keyframes.getName(hashId);
if (!effectStyle[animationName]) {
const [parsedStr] = parseStyle(keyframes.style, config, {
root: false,
parentSelectors
});
effectStyle[animationName] = `@keyframes ${keyframes.getName(hashId)}${parsedStr}`;
}
}
function flattenList(list, fullList = []) {
list.forEach((item) => {
if (Array.isArray(item)) flattenList(item, fullList);
else if (item) fullList.push(item);
});
return fullList;
}
flattenList(Array.isArray(interpolation) ? interpolation : [interpolation]).forEach((originStyle) => {
const style = typeof originStyle === "string" && !root ? {} : originStyle;
if (typeof style === "string") styleStr += `${style}\n`;
else if (style._keyframe) parseKeyframes(style);
else {
const mergedStyle = transformers.reduce((prev, trans) => trans?.visit?.(prev) || prev, style);
Object.keys(mergedStyle).forEach((key) => {
const value = mergedStyle[key];
if (typeof value === "object" && value && (key !== "animationName" || !value._keyframe) && !isCompoundCSSProperty(value)) {
let subInjectHash = false;
let mergedKey = key.trim();
let nextRoot = false;
if ((root || injectHash) && hashId) if (mergedKey.startsWith("@")) subInjectHash = true;
else if (mergedKey === "&") mergedKey = injectSelectorHash("", hashId, hashPriority);
else mergedKey = injectSelectorHash(key, hashId, hashPriority);
else if (root && !hashId && (mergedKey === "&" || mergedKey === "")) {
mergedKey = "";
nextRoot = true;
}
const [parsedStr, childEffectStyle] = parseStyle(value, config, {
root: nextRoot,
injectHash: subInjectHash,
parentSelectors: [...parentSelectors, mergedKey]
});
effectStyle = {
...effectStyle,
...childEffectStyle
};
styleStr += `${mergedKey}${parsedStr}`;
} else {
function appendStyle(cssKey, cssValue) {
if (typeof value !== "object" || !value?.[SKIP_CHECK]) [
linter$1,
linter,
...linters
].forEach((linter) => linter(cssKey, cssValue, {
path,
hashId,
parentSelectors
}));
const styleName = cssKey.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
let formatValue = cssValue;
if (!unitlessKeys[cssKey] && typeof formatValue === "number" && formatValue !== 0) formatValue = `${formatValue}px`;
if (cssKey === "animationName" && cssValue?._keyframe) {
parseKeyframes(cssValue);
formatValue = cssValue.getName(hashId);
}
styleStr += `${styleName}:${formatValue};`;
}
const actualValue = value?.value ?? value;
if (typeof value === "object" && value?.[MULTI_VALUE] && Array.isArray(actualValue)) actualValue.forEach((item) => {
appendStyle(key, item);
});
else if (isNonNullable$1(actualValue)) appendStyle(key, actualValue);
}
});
}
});
if (!root) styleStr = `{${styleStr}}`;
else if (layer) {
if (styleStr) styleStr = `@layer ${layer.name} {${styleStr}}`;
if (layer.dependencies) effectStyle[`@layer ${layer.name}`] = layer.dependencies.map((deps) => `@layer ${deps}, ${layer.name};`).join("\n");
}
return [styleStr, effectStyle];
};
function uniqueHash(path, styleStr) {
return murmur2(`${path.join("%")}${styleStr}`);
}
var STYLE_PREFIX = "style";
/**
* Register a style to the global style sheet.
*/
function useStyleRegister(info, styleFn) {
const { path, hashId, layer, nonce, clientOnly, order = 0 } = info;
const { mock, hashPriority, container, transformers, linters, cache, layer: enableLayer, autoPrefix } = import_react.useContext(StyleContext);
const fullPath = [hashId || ""];
if (enableLayer) fullPath.push("layer");
fullPath.push(...path);
let isMergedClientSide = isClientSide;
if (mock !== void 0) isMergedClientSide = mock === "client";
useGlobalCache(STYLE_PREFIX, fullPath, () => {
const cachePath = fullPath.join("|");
if (existPath(cachePath)) {
const [inlineCacheStyleStr, styleHash] = getStyleAndHash(cachePath);
if (inlineCacheStyleStr) return [
inlineCacheStyleStr,
styleHash,
{},
clientOnly,
order
];
}
const [parsedStyle, effectStyle] = parseStyle(styleFn(), {
hashId,
hashPriority,
layer: enableLayer ? layer : void 0,
path: path.join("-"),
transformers,
linters
});
const styleStr = normalizeStyle(parsedStyle, autoPrefix || false);
return [
styleStr,
uniqueHash(fullPath, styleStr),
effectStyle,
clientOnly,
order
];
}, (cacheValue, fromHMR) => {
const [, styleId] = cacheValue;
if (fromHMR && isClientSide) removeCSS(styleId, {
mark: ATTR_MARK,
attachTo: container
});
}, (cacheValue) => {
const [styleStr, styleId, effectStyle, , priority] = cacheValue;
if (isMergedClientSide && styleStr !== "_FILE_STYLE__") {
let mergedCSSConfig = {
mark: ATTR_MARK,
prepend: enableLayer ? false : "queue",
attachTo: container,
priority
};
mergedCSSConfig = injectCSPNonce(mergedCSSConfig, nonce);
const effectLayerKeys = [];
const effectRestKeys = [];
Object.keys(effectStyle).forEach((key) => {
if (key.startsWith("@layer")) effectLayerKeys.push(key);
else effectRestKeys.push(key);
});
effectLayerKeys.forEach((effectKey) => {
updateCSS(normalizeStyle(effectStyle[effectKey], autoPrefix || false), `_layer-${effectKey}`, {
...mergedCSSConfig,
prepend: true
});
});
const style = updateCSS(styleStr, styleId, mergedCSSConfig);
style[CSS_IN_JS_INSTANCE] = cache.instanceId;
style.setAttribute(ATTR_CACHE_PATH, fullPath.join("|"));
effectRestKeys.forEach((effectKey) => {
updateCSS(normalizeStyle(effectStyle[effectKey], autoPrefix || false), `_effect-${effectKey}`, mergedCSSConfig);
});
}
});
}
//#endregion
//#region node_modules/@ant-design/cssinjs/es/hooks/useCSSVarRegister.js
var CSS_VAR_PREFIX = "cssVar";
var useCSSVarRegister = (config, fn) => {
const { key, prefix, unitless, ignore, token, hashId, scope, nonce } = config;
const { cache: { instanceId }, container, hashPriority } = (0, import_react.useContext)(StyleContext);
const { _tokenKey: tokenKey } = token;
const scopeKey = Array.isArray(scope) ? scope.join("@@") : scope;
const stylePath = [
...config.path,
key,
scopeKey,
tokenKey
];
return useGlobalCache(CSS_VAR_PREFIX, stylePath, () => {
const [mergedToken, cssVarsStr] = transformToken(fn(), key, {
prefix,
unitless,
ignore,
scope,
hashPriority,
hashCls: hashId
});
return [
mergedToken,
cssVarsStr,
uniqueHash(stylePath, cssVarsStr),
key
];
}, ([, , styleId]) => {
if (isClientSide) removeCSS(styleId, {
mark: ATTR_MARK,
attachTo: container
});
}, ([, cssVarsStr, styleId]) => {
if (!cssVarsStr) return;
let mergedCSSConfig = {
mark: ATTR_MARK,
prepend: "queue",
attachTo: container,
priority: -999
};
mergedCSSConfig = injectCSPNonce(mergedCSSConfig, nonce);
const style = updateCSS(cssVarsStr, styleId, mergedCSSConfig);
style[CSS_IN_JS_INSTANCE] = instanceId;
style.setAttribute(ATTR_TOKEN, key);
});
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/Keyframes.js
var Keyframe = class {
name;
style;
constructor(name, style) {
this.name = name;
this.style = style;
}
getName(hashId = "") {
return hashId ? `${hashId}-${this.name}` : this.name;
}
_keyframe = true;
};
//#endregion
//#region node_modules/@ant-design/cssinjs/es/transformers/legacyLogicalProperties.js
function noSplit(list) {
list.notSplit = true;
return list;
}
noSplit(["borderTop", "borderBottom"]), noSplit(["borderTop"]), noSplit(["borderBottom"]), noSplit(["borderLeft", "borderRight"]), noSplit(["borderLeft"]), noSplit(["borderRight"]);
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof$30(o) {
"@babel/helpers - typeof";
return _typeof$30 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$30(o);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom());
function _arrayWithHoles$31(r) {
if (Array.isArray(r)) return r;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit$31(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
function _nonIterableRest$31() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js
function _slicedToArray$31(r, e) {
return _arrayWithHoles$31(r) || _iterableToArrayLimit$31(r, e) || _unsupportedIterableToArray$34(r, e) || _nonIterableRest$31();
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
function toPrimitive(t, r) {
if ("object" != _typeof$30(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$30(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof$30(i) ? i : i + "";
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
function _defineProperty$28(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/objectSpread2.js
function ownKeys$18(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread2(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$18(Object(t), !0).forEach(function(r) {
_defineProperty$28(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$18(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
function _classCallCheck$1(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/createClass.js
function _defineProperties$1(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
}
}
function _createClass$1(e, r, t) {
return r && _defineProperties$1(e.prototype, r), t && _defineProperties$1(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
function _assertThisInitialized(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf(t, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
return t.__proto__ = e, t;
}, _setPrototypeOf(t, e);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/inherits.js
function _inherits(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, { constructor: {
value: t,
writable: !0,
configurable: !0
} }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
function _getPrototypeOf(t) {
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
return t.__proto__ || Object.getPrototypeOf(t);
}, _getPrototypeOf(t);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
function _isNativeReflectConstruct() {
try {
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
} catch (t) {}
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
return !!t;
})();
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
function _possibleConstructorReturn(t, e) {
if (e && ("object" == _typeof$30(e) || "function" == typeof e)) return e;
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
return _assertThisInitialized(t);
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/createSuper.js
function _createSuper(t) {
var r = _isNativeReflectConstruct();
return function() {
var e, o = _getPrototypeOf(t);
if (r) {
var s = _getPrototypeOf(this).constructor;
e = Reflect.construct(o, arguments, s);
} else e = o.apply(this, arguments);
return _possibleConstructorReturn(this, e);
};
}
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/calc/calculator.js
var AbstractCalculator = /* @__PURE__ */ _createClass$1(function AbstractCalculator() {
_classCallCheck$1(this, AbstractCalculator);
});
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/calc/CSSCalculator.js
var CALC_UNIT = "CALC_UNIT";
var regexp$1 = new RegExp(CALC_UNIT, "g");
function unit(value) {
if (typeof value === "number") return "".concat(value).concat(CALC_UNIT);
return value;
}
var CSSCalculator = /* @__PURE__ */ function(_AbstractCalculator) {
_inherits(CSSCalculator, _AbstractCalculator);
var _super = _createSuper(CSSCalculator);
function CSSCalculator(num, unitlessCssVar) {
var _this;
_classCallCheck$1(this, CSSCalculator);
_this = _super.call(this);
_defineProperty$28(_assertThisInitialized(_this), "result", "");
_defineProperty$28(_assertThisInitialized(_this), "unitlessCssVar", void 0);
_defineProperty$28(_assertThisInitialized(_this), "lowPriority", void 0);
var numType = _typeof$30(num);
_this.unitlessCssVar = unitlessCssVar;
if (num instanceof CSSCalculator) _this.result = "(".concat(num.result, ")");
else if (numType === "number") _this.result = unit(num);
else if (numType === "string") _this.result = num;
return _this;
}
_createClass$1(CSSCalculator, [
{
key: "add",
value: function add(num) {
if (num instanceof CSSCalculator) this.result = "".concat(this.result, " + ").concat(num.getResult());
else if (typeof num === "number" || typeof num === "string") this.result = "".concat(this.result, " + ").concat(unit(num));
this.lowPriority = true;
return this;
}
},
{
key: "sub",
value: function sub(num) {
if (num instanceof CSSCalculator) this.result = "".concat(this.result, " - ").concat(num.getResult());
else if (typeof num === "number" || typeof num === "string") this.result = "".concat(this.result, " - ").concat(unit(num));
this.lowPriority = true;
return this;
}
},
{
key: "mul",
value: function mul(num) {
if (this.lowPriority) this.result = "(".concat(this.result, ")");
if (num instanceof CSSCalculator) this.result = "".concat(this.result, " * ").concat(num.getResult(true));
else if (typeof num === "number" || typeof num === "string") this.result = "".concat(this.result, " * ").concat(num);
this.lowPriority = false;
return this;
}
},
{
key: "div",
value: function div(num) {
if (this.lowPriority) this.result = "(".concat(this.result, ")");
if (num instanceof CSSCalculator) this.result = "".concat(this.result, " / ").concat(num.getResult(true));
else if (typeof num === "number" || typeof num === "string") this.result = "".concat(this.result, " / ").concat(num);
this.lowPriority = false;
return this;
}
},
{
key: "getResult",
value: function getResult(force) {
return this.lowPriority || force ? "(".concat(this.result, ")") : this.result;
}
},
{
key: "equal",
value: function equal(options) {
var _this2 = this;
var cssUnit = (options || {}).unit;
var mergedUnit = true;
if (typeof cssUnit === "boolean") mergedUnit = cssUnit;
else if (Array.from(this.unitlessCssVar).some(function(cssVar) {
return _this2.result.includes(cssVar);
})) mergedUnit = false;
this.result = this.result.replace(regexp$1, mergedUnit ? "px" : "");
if (typeof this.lowPriority !== "undefined") return "calc(".concat(this.result, ")");
return this.result;
}
}
]);
return CSSCalculator;
}(AbstractCalculator);
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/calc/NumCalculator.js
var NumCalculator = /* @__PURE__ */ function(_AbstractCalculator) {
_inherits(NumCalculator, _AbstractCalculator);
var _super = _createSuper(NumCalculator);
function NumCalculator(num) {
var _this;
_classCallCheck$1(this, NumCalculator);
_this = _super.call(this);
_defineProperty$28(_assertThisInitialized(_this), "result", 0);
if (num instanceof NumCalculator) _this.result = num.result;
else if (typeof num === "number") _this.result = num;
return _this;
}
_createClass$1(NumCalculator, [
{
key: "add",
value: function add(num) {
if (num instanceof NumCalculator) this.result += num.result;
else if (typeof num === "number") this.result += num;
return this;
}
},
{
key: "sub",
value: function sub(num) {
if (num instanceof NumCalculator) this.result -= num.result;
else if (typeof num === "number") this.result -= num;
return this;
}
},
{
key: "mul",
value: function mul(num) {
if (num instanceof NumCalculator) this.result *= num.result;
else if (typeof num === "number") this.result *= num;
return this;
}
},
{
key: "div",
value: function div(num) {
if (num instanceof NumCalculator) this.result /= num.result;
else if (typeof num === "number") this.result /= num;
return this;
}
},
{
key: "equal",
value: function equal() {
return this.result;
}
}
]);
return NumCalculator;
}(AbstractCalculator);
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/calc/index.js
var genCalc = function genCalc(type, unitlessCssVar) {
var Calculator = type === "css" ? CSSCalculator : NumCalculator;
return function(num) {
return new Calculator(num, unitlessCssVar);
};
};
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/getCompVarPrefix.js
var getCompVarPrefix = function getCompVarPrefix(component, prefix) {
return "".concat([prefix, component.replace(/([A-Z]+)([A-Z][a-z]+)/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2")].filter(Boolean).join("-"));
};
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/getComponentToken.js
function getComponentToken(component, token, defaultToken, options) {
var customToken = _objectSpread2({}, token[component]);
if (options !== null && options !== void 0 && options.deprecatedTokens) options.deprecatedTokens.forEach(function(_ref) {
var _ref2 = _slicedToArray$31(_ref, 2), oldTokenKey = _ref2[0], newTokenKey = _ref2[1];
warningOnce(!(customToken !== null && customToken !== void 0 && customToken[oldTokenKey]), "Component Token `".concat(String(oldTokenKey), "` of ").concat(String(component), " is deprecated. Please use `").concat(String(newTokenKey), "` instead."));
if (customToken !== null && customToken !== void 0 && customToken[oldTokenKey] || customToken !== null && customToken !== void 0 && customToken[newTokenKey]) {
var _customToken$newToken;
(_customToken$newToken = customToken[newTokenKey]) !== null && _customToken$newToken !== void 0 || (customToken[newTokenKey] = customToken === null || customToken === void 0 ? void 0 : customToken[oldTokenKey]);
}
});
var mergedToken = _objectSpread2(_objectSpread2({}, defaultToken), customToken);
Object.keys(mergedToken).forEach(function(key) {
if (mergedToken[key] === token[key]) delete mergedToken[key];
});
return mergedToken;
}
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/statistic.js
var enableStatistic = true;
var recording = true;
/**
* This function will do as `Object.assign` in production. But will use Object.defineProperty:get to
* pass all value access in development. To support statistic field usage with alias token.
*/
function merge() {
for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) objs[_key] = arguments[_key];
/* istanbul ignore next */
if (!enableStatistic) return Object.assign.apply(Object, [{}].concat(objs));
recording = false;
var ret = {};
objs.forEach(function(obj) {
if (_typeof$30(obj) !== "object") return;
Object.keys(obj).forEach(function(key) {
Object.defineProperty(ret, key, {
configurable: true,
enumerable: true,
get: function get() {
return obj[key];
}
});
});
});
recording = true;
return ret;
}
/** @internal Internal Usage. Not use in your production. */
var statistic = {};
/* istanbul ignore next */
function noop$3() {}
/** Statistic token usage case. Should use `merge` function if you do not want spread record. */
var statisticToken = function statisticToken(token) {
var tokenKeys;
var proxy = token;
var flush = noop$3;
if (enableStatistic && typeof Proxy !== "undefined") {
tokenKeys = /* @__PURE__ */ new Set();
proxy = new Proxy(token, { get: function get(obj, prop) {
if (recording) {
var _tokenKeys;
(_tokenKeys = tokenKeys) === null || _tokenKeys === void 0 || _tokenKeys.add(prop);
}
return obj[prop];
} });
flush = function flush(componentName, componentToken) {
var _statistic$componentN;
statistic[componentName] = {
global: Array.from(tokenKeys),
component: _objectSpread2(_objectSpread2({}, (_statistic$componentN = statistic[componentName]) === null || _statistic$componentN === void 0 ? void 0 : _statistic$componentN.component), componentToken)
};
};
}
return {
token: proxy,
keys: tokenKeys,
flush
};
};
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/getDefaultComponentToken.js
function getDefaultComponentToken(component, token, getDefaultToken) {
if (typeof getDefaultToken === "function") {
var _token$component;
return getDefaultToken(merge(token, (_token$component = token[component]) !== null && _token$component !== void 0 ? _token$component : {}));
}
return getDefaultToken !== null && getDefaultToken !== void 0 ? getDefaultToken : {};
}
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/maxmin.js
function genMaxMin(type) {
if (type === "js") return {
max: Math.max,
min: Math.min
};
return {
max: function max() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
return "max(".concat(args.map(function(value) {
return unit$1(value);
}).join(","), ")");
},
min: function min() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];
return "min(".concat(args.map(function(value) {
return unit$1(value);
}).join(","), ")");
}
};
}
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/_util/hooks/useUniqueMemo.js
var BEAT_LIMIT = 1e3 * 60 * 10;
var uniqueMap = new (/* @__PURE__ */ function() {
function ArrayKeyMap() {
_classCallCheck$1(this, ArrayKeyMap);
_defineProperty$28(this, "map", /* @__PURE__ */ new Map());
_defineProperty$28(this, "objectIDMap", /* @__PURE__ */ new WeakMap());
_defineProperty$28(this, "nextID", 0);
_defineProperty$28(this, "lastAccessBeat", /* @__PURE__ */ new Map());
_defineProperty$28(this, "accessBeat", 0);
}
_createClass$1(ArrayKeyMap, [
{
key: "set",
value: function set(keys, value) {
this.clear();
var compositeKey = this.getCompositeKey(keys);
this.map.set(compositeKey, value);
this.lastAccessBeat.set(compositeKey, Date.now());
}
},
{
key: "get",
value: function get(keys) {
var compositeKey = this.getCompositeKey(keys);
var cache = this.map.get(compositeKey);
this.lastAccessBeat.set(compositeKey, Date.now());
this.accessBeat += 1;
return cache;
}
},
{
key: "getCompositeKey",
value: function getCompositeKey(keys) {
var _this = this;
return keys.map(function(key) {
if (key && _typeof$30(key) === "object") return "obj_".concat(_this.getObjectID(key));
return "".concat(_typeof$30(key), "_").concat(key);
}).join("|");
}
},
{
key: "getObjectID",
value: function getObjectID(obj) {
if (this.objectIDMap.has(obj)) return this.objectIDMap.get(obj);
var id = this.nextID;
this.objectIDMap.set(obj, id);
this.nextID += 1;
return id;
}
},
{
key: "clear",
value: function clear() {
var _this2 = this;
if (this.accessBeat > 1e4) {
var now = Date.now();
this.lastAccessBeat.forEach(function(beat, key) {
if (now - beat > BEAT_LIMIT) {
_this2.map.delete(key);
_this2.lastAccessBeat.delete(key);
}
});
this.accessBeat = 0;
}
}
}
]);
return ArrayKeyMap;
}())();
/**
* Like `useMemo`, but this hook result will be shared across all instances.
*/
function useUniqueMemo(memoFn, deps) {
return import_react.useMemo(function() {
var cachedValue = uniqueMap.get(deps);
if (cachedValue) return cachedValue;
var newValue = memoFn();
uniqueMap.set(deps, newValue);
return newValue;
}, deps);
}
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/hooks/useCSP.js
/**
* Provide a default hook since not everyone needs to config this.
*/
var useDefaultCSP = function useDefaultCSP() {
return {};
};
//#endregion
//#region node_modules/@ant-design/cssinjs-utils/es/util/genStyleUtils.js
function genStyleUtils(config) {
var _config$useCSP = config.useCSP, useCSP = _config$useCSP === void 0 ? useDefaultCSP : _config$useCSP, useToken = config.useToken, usePrefix = config.usePrefix, getResetStyles = config.getResetStyles, getCommonStyle = config.getCommonStyle, getCompUnitless = config.getCompUnitless;
function genStyleHooks(component, styleFn, getDefaultToken, options) {
var componentName = Array.isArray(component) ? component[0] : component;
function prefixToken(key) {
return "".concat(String(componentName)).concat(key.slice(0, 1).toUpperCase()).concat(key.slice(1));
}
var originUnitless = (options === null || options === void 0 ? void 0 : options.unitless) || {};
var compUnitless = _objectSpread2(_objectSpread2({}, typeof getCompUnitless === "function" ? getCompUnitless(component) : {}), {}, _defineProperty$28({}, prefixToken("zIndexPopup"), true));
Object.keys(originUnitless).forEach(function(key) {
compUnitless[prefixToken(key)] = originUnitless[key];
});
var mergedOptions = _objectSpread2(_objectSpread2({}, options), {}, {
unitless: compUnitless,
prefixToken
});
var useStyle = genComponentStyleHook(component, styleFn, getDefaultToken, mergedOptions);
var useCSSVar = genCSSVarRegister(componentName, getDefaultToken, mergedOptions);
return function(prefixCls) {
var rootCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : prefixCls;
var hashId = useStyle(prefixCls, rootCls);
var extraPrefixCls = options === null || options === void 0 ? void 0 : options.extraCssVarPrefixCls;
var resolvedExtraPrefixCls = typeof extraPrefixCls === "function" ? extraPrefixCls({
prefixCls,
rootCls
}) : extraPrefixCls;
return [hashId, useCSSVar(resolvedExtraPrefixCls !== null && resolvedExtraPrefixCls !== void 0 && resolvedExtraPrefixCls.length ? [rootCls].concat(_toConsumableArray$8(resolvedExtraPrefixCls)) : rootCls)];
};
}
function genCSSVarRegister(component, getDefaultToken, options) {
var compUnitless = options.unitless, prefixToken = options.prefixToken, ignore = options.ignore;
return function(rootCls) {
var _useToken = useToken(), cssVar = _useToken.cssVar, realToken = _useToken.realToken;
var csp = useCSP();
useCSSVarRegister({
path: [component],
prefix: cssVar.prefix,
key: cssVar.key,
unitless: compUnitless,
ignore,
token: realToken,
scope: rootCls,
nonce: function nonce() {
return csp.nonce;
}
}, function() {
var defaultToken = getDefaultComponentToken(component, realToken, getDefaultToken);
var componentToken = getComponentToken(component, realToken, defaultToken, { deprecatedTokens: options === null || options === void 0 ? void 0 : options.deprecatedTokens });
if (defaultToken) Object.keys(defaultToken).forEach(function(key) {
componentToken[prefixToken(key)] = componentToken[key];
delete componentToken[key];
});
return componentToken;
});
return cssVar === null || cssVar === void 0 ? void 0 : cssVar.key;
};
}
function genComponentStyleHook(componentName, styleFn, getDefaultToken) {
var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
var cells = Array.isArray(componentName) ? componentName : [componentName, componentName];
var component = _slicedToArray$31(cells, 1)[0];
var concatComponent = cells.join("-");
var mergedLayer = config.layer || { name: "antd" };
return function(prefixCls) {
var rootCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : prefixCls;
var _useToken2 = useToken(), theme = _useToken2.theme, realToken = _useToken2.realToken, hashId = _useToken2.hashId, token = _useToken2.token, cssVar = _useToken2.cssVar, zeroRuntime = _useToken2.zeroRuntime;
if ((0, import_react.useMemo)(function() {
return zeroRuntime;
}, [])) return hashId;
var _usePrefix = usePrefix(), rootPrefixCls = _usePrefix.rootPrefixCls, iconPrefixCls = _usePrefix.iconPrefixCls;
var csp = useCSP();
var type = "css";
var calc = useUniqueMemo(function() {
var unitlessCssVar = /* @__PURE__ */ new Set();
Object.keys(options.unitless || {}).forEach(function(key) {
unitlessCssVar.add(token2CSSVar(key, cssVar.prefix));
unitlessCssVar.add(token2CSSVar(key, getCompVarPrefix(component, cssVar.prefix)));
});
return genCalc(type, unitlessCssVar);
}, [
type,
component,
cssVar === null || cssVar === void 0 ? void 0 : cssVar.prefix
]);
var _genMaxMin = genMaxMin(type), max = _genMaxMin.max, min = _genMaxMin.min;
var sharedConfig = {
theme,
token,
hashId,
nonce: function nonce() {
return csp.nonce;
},
clientOnly: options.clientOnly,
layer: mergedLayer,
order: options.order || -999
};
if (typeof getResetStyles === "function") useStyleRegister(_objectSpread2(_objectSpread2({}, sharedConfig), {}, {
clientOnly: false,
path: ["Shared", rootPrefixCls]
}), function() {
return getResetStyles(token, {
prefix: {
rootPrefixCls,
iconPrefixCls
},
csp
});
});
useStyleRegister(_objectSpread2(_objectSpread2({}, sharedConfig), {}, { path: [
concatComponent,
prefixCls,
iconPrefixCls
] }), function() {
if (options.injectStyle === false) return [];
var _statisticToken = statisticToken(token), proxyToken = _statisticToken.token, flush = _statisticToken.flush;
var defaultComponentToken = getDefaultComponentToken(component, realToken, getDefaultToken);
var componentCls = ".".concat(prefixCls);
var componentToken = getComponentToken(component, realToken, defaultComponentToken, { deprecatedTokens: options.deprecatedTokens });
if (defaultComponentToken && _typeof$30(defaultComponentToken) === "object") Object.keys(defaultComponentToken).forEach(function(key) {
defaultComponentToken[key] = "var(".concat(token2CSSVar(key, getCompVarPrefix(component, cssVar.prefix)), ")");
});
var mergedToken = merge(proxyToken, {
componentCls,
prefixCls,
iconCls: ".".concat(iconPrefixCls),
antCls: ".".concat(rootPrefixCls),
calc,
max,
min
}, defaultComponentToken);
var styleInterpolation = styleFn(mergedToken, {
hashId,
prefixCls,
rootPrefixCls,
iconPrefixCls
});
flush(component, componentToken);
var commonStyle = typeof getCommonStyle === "function" ? getCommonStyle(mergedToken, prefixCls, rootCls, options.resetFont) : null;
return [options.resetStyle === false ? null : commonStyle, styleInterpolation];
});
return hashId;
};
}
function genSubStyleComponent(componentName, styleFn, getDefaultToken) {
var useStyle = genComponentStyleHook(componentName, styleFn, getDefaultToken, _objectSpread2({
resetStyle: false,
order: -998
}, arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}));
var StyledComponent = function StyledComponent(_ref) {
var prefixCls = _ref.prefixCls, _ref$rootCls = _ref.rootCls;
useStyle(prefixCls, _ref$rootCls === void 0 ? prefixCls : _ref$rootCls);
return null;
};
StyledComponent.displayName = "SubStyle_".concat(String(Array.isArray(componentName) ? componentName.join(".") : componentName));
return StyledComponent;
}
return {
genStyleHooks,
genSubStyleComponent,
genComponentStyleHook
};
}
//#endregion
//#region node_modules/antd/es/theme/interface/presetColors.js
var PresetColors = [
"blue",
"purple",
"cyan",
"green",
"magenta",
"pink",
"red",
"orange",
"yellow",
"volcano",
"geekblue",
"lime",
"gold"
];
//#endregion
//#region node_modules/antd/es/theme/themes/shared/genFontSizes.js
function getLineHeight(fontSize) {
return (fontSize + 8) / fontSize;
}
function getFontSizes(base) {
const fontSizes = Array.from({ length: 10 }).map((_, index) => {
const i = index - 1;
const baseSize = base * Math.E ** (i / 5);
return Math.floor((index > 1 ? Math.floor(baseSize) : Math.ceil(baseSize)) / 2) * 2;
});
fontSizes[1] = base;
return fontSizes.map((size) => ({
size,
lineHeight: getLineHeight(size)
}));
}
//#endregion
//#region node_modules/antd/es/version/index.js
var version_default = "6.3.7";
//#endregion
//#region node_modules/antd/es/theme/themes/seed.js
var defaultPresetColors = {
blue: "#1677FF",
purple: "#722ED1",
cyan: "#13C2C2",
green: "#52C41A",
magenta: "#EB2F96",
/**
* @deprecated Use magenta instead
*/
pink: "#EB2F96",
red: "#F5222D",
orange: "#FA8C16",
yellow: "#FADB14",
volcano: "#FA541C",
geekblue: "#2F54EB",
gold: "#FAAD14",
lime: "#A0D911"
};
var seedToken = {
...defaultPresetColors,
colorPrimary: "#1677ff",
colorSuccess: "#52c41a",
colorWarning: "#faad14",
colorError: "#ff4d4f",
colorInfo: "#1677ff",
colorLink: "",
colorTextBase: "",
colorBgBase: "",
fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,
fontFamilyCode: `'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
fontSize: 14,
lineWidth: 1,
lineType: "solid",
motionUnit: .1,
motionBase: 0,
motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)",
motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)",
motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)",
motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)",
motionEaseInBack: "cubic-bezier(0.71, -0.46, 0.88, 0.6)",
motionEaseInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
borderRadius: 6,
sizeUnit: 4,
sizeStep: 4,
sizePopupArrow: 16,
controlHeight: 32,
zIndexBase: 0,
zIndexPopupBase: 1e3,
opacityImage: 1,
wireframe: false,
motion: true
};
//#endregion
//#region node_modules/antd/es/theme/themes/shared/genColorMapToken.js
function genColorMapToken(seed, { generateColorPalettes, generateNeutralColorPalettes }) {
const { colorSuccess: colorSuccessBase, colorWarning: colorWarningBase, colorError: colorErrorBase, colorInfo: colorInfoBase, colorPrimary: colorPrimaryBase, colorBgBase, colorTextBase } = seed;
const primaryColors = generateColorPalettes(colorPrimaryBase);
const successColors = generateColorPalettes(colorSuccessBase);
const warningColors = generateColorPalettes(colorWarningBase);
const errorColors = generateColorPalettes(colorErrorBase);
const infoColors = generateColorPalettes(colorInfoBase);
const neutralColors = generateNeutralColorPalettes(colorBgBase, colorTextBase);
const linkColors = generateColorPalettes(seed.colorLink || seed.colorInfo);
const colorErrorBgFilledHover = new FastColor(errorColors[1]).mix(new FastColor(errorColors[3]), 50).toHexString();
const presetColorTokens = {};
PresetColors.forEach((colorKey) => {
const colorBase = seed[colorKey];
if (colorBase) {
const colorPalette = generateColorPalettes(colorBase);
presetColorTokens[`${colorKey}Hover`] = colorPalette[5];
presetColorTokens[`${colorKey}Active`] = colorPalette[7];
}
});
return {
...neutralColors,
colorPrimaryBg: primaryColors[1],
colorPrimaryBgHover: primaryColors[2],
colorPrimaryBorder: primaryColors[3],
colorPrimaryBorderHover: primaryColors[4],
colorPrimaryHover: primaryColors[5],
colorPrimary: primaryColors[6],
colorPrimaryActive: primaryColors[7],
colorPrimaryTextHover: primaryColors[8],
colorPrimaryText: primaryColors[9],
colorPrimaryTextActive: primaryColors[10],
colorSuccessBg: successColors[1],
colorSuccessBgHover: successColors[2],
colorSuccessBorder: successColors[3],
colorSuccessBorderHover: successColors[4],
colorSuccessHover: successColors[4],
colorSuccess: successColors[6],
colorSuccessActive: successColors[7],
colorSuccessTextHover: successColors[8],
colorSuccessText: successColors[9],
colorSuccessTextActive: successColors[10],
colorErrorBg: errorColors[1],
colorErrorBgHover: errorColors[2],
colorErrorBgFilledHover,
colorErrorBgActive: errorColors[3],
colorErrorBorder: errorColors[3],
colorErrorBorderHover: errorColors[4],
colorErrorHover: errorColors[5],
colorError: errorColors[6],
colorErrorActive: errorColors[7],
colorErrorTextHover: errorColors[8],
colorErrorText: errorColors[9],
colorErrorTextActive: errorColors[10],
colorWarningBg: warningColors[1],
colorWarningBgHover: warningColors[2],
colorWarningBorder: warningColors[3],
colorWarningBorderHover: warningColors[4],
colorWarningHover: warningColors[4],
colorWarning: warningColors[6],
colorWarningActive: warningColors[7],
colorWarningTextHover: warningColors[8],
colorWarningText: warningColors[9],
colorWarningTextActive: warningColors[10],
colorInfoBg: infoColors[1],
colorInfoBgHover: infoColors[2],
colorInfoBorder: infoColors[3],
colorInfoBorderHover: infoColors[4],
colorInfoHover: infoColors[4],
colorInfo: infoColors[6],
colorInfoActive: infoColors[7],
colorInfoTextHover: infoColors[8],
colorInfoText: infoColors[9],
colorInfoTextActive: infoColors[10],
colorLinkHover: linkColors[4],
colorLink: linkColors[6],
colorLinkActive: linkColors[7],
...presetColorTokens,
colorBgMask: new FastColor("#000").setA(.45).toRgbString(),
colorWhite: "#fff"
};
}
//#endregion
//#region node_modules/antd/es/theme/themes/shared/genRadius.js
var genRadius = (radiusBase) => {
let radiusLG = radiusBase;
let radiusSM = radiusBase;
let radiusXS = radiusBase;
let radiusOuter = radiusBase;
if (radiusBase < 6 && radiusBase >= 5) radiusLG = radiusBase + 1;
else if (radiusBase < 16 && radiusBase >= 6) radiusLG = radiusBase + 2;
else if (radiusBase >= 16) radiusLG = 16;
if (radiusBase < 7 && radiusBase >= 5) radiusSM = 4;
else if (radiusBase < 8 && radiusBase >= 7) radiusSM = 5;
else if (radiusBase < 14 && radiusBase >= 8) radiusSM = 6;
else if (radiusBase < 16 && radiusBase >= 14) radiusSM = 7;
else if (radiusBase >= 16) radiusSM = 8;
if (radiusBase < 6 && radiusBase >= 2) radiusXS = 1;
else if (radiusBase >= 6) radiusXS = 2;
if (radiusBase > 4 && radiusBase < 8) radiusOuter = 4;
else if (radiusBase >= 8) radiusOuter = 6;
return {
borderRadius: radiusBase,
borderRadiusXS: radiusXS,
borderRadiusSM: radiusSM,
borderRadiusLG: radiusLG,
borderRadiusOuter: radiusOuter
};
};
//#endregion
//#region node_modules/antd/es/theme/themes/shared/genCommonMapToken.js
function genCommonMapToken(token) {
const { motionUnit, motionBase, borderRadius, lineWidth } = token;
return {
motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
lineWidthBold: lineWidth + 1,
...genRadius(borderRadius)
};
}
//#endregion
//#region node_modules/antd/es/theme/themes/shared/genControlHeight.js
var genControlHeight = (token) => {
const { controlHeight } = token;
return {
controlHeightSM: controlHeight * .75,
controlHeightXS: controlHeight * .5,
controlHeightLG: controlHeight * 1.25
};
};
//#endregion
//#region node_modules/antd/es/theme/themes/shared/genFontMapToken.js
var genFontMapToken = (fontSize) => {
const fontSizePairs = getFontSizes(fontSize);
const fontSizes = fontSizePairs.map((pair) => pair.size);
const lineHeights = fontSizePairs.map((pair) => pair.lineHeight);
const fontSizeMD = fontSizes[1];
const fontSizeSM = fontSizes[0];
const fontSizeLG = fontSizes[2];
const lineHeight = lineHeights[1];
const lineHeightSM = lineHeights[0];
const lineHeightLG = lineHeights[2];
return {
fontSizeSM,
fontSize: fontSizeMD,
fontSizeLG,
fontSizeXL: fontSizes[3],
fontSizeHeading1: fontSizes[6],
fontSizeHeading2: fontSizes[5],
fontSizeHeading3: fontSizes[4],
fontSizeHeading4: fontSizes[3],
fontSizeHeading5: fontSizes[2],
lineHeight,
lineHeightLG,
lineHeightSM,
fontHeight: Math.round(lineHeight * fontSizeMD),
fontHeightLG: Math.round(lineHeightLG * fontSizeLG),
fontHeightSM: Math.round(lineHeightSM * fontSizeSM),
lineHeightHeading1: lineHeights[6],
lineHeightHeading2: lineHeights[5],
lineHeightHeading3: lineHeights[4],
lineHeightHeading4: lineHeights[3],
lineHeightHeading5: lineHeights[2]
};
};
//#endregion
//#region node_modules/antd/es/theme/themes/shared/genSizeMapToken.js
function genSizeMapToken$1(token) {
const { sizeUnit, sizeStep } = token;
return {
sizeXXL: sizeUnit * (sizeStep + 8),
sizeXL: sizeUnit * (sizeStep + 4),
sizeLG: sizeUnit * (sizeStep + 2),
sizeMD: sizeUnit * (sizeStep + 1),
sizeMS: sizeUnit * sizeStep,
size: sizeUnit * sizeStep,
sizeSM: sizeUnit * (sizeStep - 1),
sizeXS: sizeUnit * (sizeStep - 2),
sizeXXS: sizeUnit * (sizeStep - 3)
};
}
//#endregion
//#region node_modules/antd/es/theme/themes/default/colorAlgorithm.js
var getAlphaColor$2 = (baseColor, alpha) => new FastColor(baseColor).setA(alpha).toRgbString();
var getSolidColor$1 = (baseColor, brightness) => {
return new FastColor(baseColor).darken(brightness).toHexString();
};
//#endregion
//#region node_modules/antd/es/theme/themes/default/colors.js
var generateColorPalettes$1 = (baseColor) => {
const colors = generate(baseColor);
return {
1: colors[0],
2: colors[1],
3: colors[2],
4: colors[3],
5: colors[4],
6: colors[5],
7: colors[6],
8: colors[4],
9: colors[5],
10: colors[6]
};
};
var generateNeutralColorPalettes$1 = (bgBaseColor, textBaseColor, shadowColor) => {
const colorBgBase = bgBaseColor || "#fff";
const colorTextBase = textBaseColor || "#000";
return {
colorBgBase,
colorTextBase,
colorShadow: shadowColor || "#000",
colorText: getAlphaColor$2(colorTextBase, .88),
colorTextSecondary: getAlphaColor$2(colorTextBase, .65),
colorTextTertiary: getAlphaColor$2(colorTextBase, .45),
colorTextQuaternary: getAlphaColor$2(colorTextBase, .25),
colorFill: getAlphaColor$2(colorTextBase, .15),
colorFillSecondary: getAlphaColor$2(colorTextBase, .06),
colorFillTertiary: getAlphaColor$2(colorTextBase, .04),
colorFillQuaternary: getAlphaColor$2(colorTextBase, .02),
colorBgSolid: getAlphaColor$2(colorTextBase, 1),
colorBgSolidHover: getAlphaColor$2(colorTextBase, .75),
colorBgSolidActive: getAlphaColor$2(colorTextBase, .95),
colorBgLayout: getSolidColor$1(colorBgBase, 4),
colorBgContainer: getSolidColor$1(colorBgBase, 0),
colorBgElevated: getSolidColor$1(colorBgBase, 0),
colorBgSpotlight: getAlphaColor$2(colorTextBase, .85),
colorBgBlur: "transparent",
colorBorder: getSolidColor$1(colorBgBase, 15),
colorBorderDisabled: getSolidColor$1(colorBgBase, 15),
colorBorderSecondary: getSolidColor$1(colorBgBase, 6)
};
};
//#endregion
//#region node_modules/antd/es/theme/themes/default/index.js
function derivative$2(token) {
presetPrimaryColors.pink = presetPrimaryColors.magenta;
presetPalettes.pink = presetPalettes.magenta;
const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
const colors = token[colorKey] === presetPrimaryColors[colorKey] ? presetPalettes[colorKey] : generate(token[colorKey]);
return Array.from({ length: 10 }, () => 1).reduce((prev, _, i) => {
prev[`${colorKey}-${i + 1}`] = colors[i];
prev[`${colorKey}${i + 1}`] = colors[i];
return prev;
}, {});
}).reduce((prev, cur) => {
prev = {
...prev,
...cur
};
return prev;
}, {});
return {
...token,
...colorPalettes,
...genColorMapToken(token, {
generateColorPalettes: generateColorPalettes$1,
generateNeutralColorPalettes: generateNeutralColorPalettes$1
}),
...genFontMapToken(token.fontSize),
...genSizeMapToken$1(token),
...genControlHeight(token),
...genCommonMapToken(token)
};
}
//#endregion
//#region node_modules/antd/es/theme/themes/default/theme.js
var defaultTheme = createTheme(derivative$2);
//#endregion
//#region node_modules/antd/es/theme/context.js
var defaultConfig = {
token: seedToken,
override: { override: seedToken },
hashed: true
};
var DesignTokenContext = /* @__PURE__ */ import_react.createContext(defaultConfig);
//#endregion
//#region node_modules/antd/es/theme/util/getAlphaColor.js
function isStableColor(color) {
return color >= 0 && color <= 255;
}
function getAlphaColor$1(frontColor, backgroundColor) {
const { r: fR, g: fG, b: fB, a: originAlpha } = new FastColor(frontColor).toRgb();
if (originAlpha < 1) return frontColor;
const { r: bR, g: bG, b: bB } = new FastColor(backgroundColor).toRgb();
for (let fA = .01; fA <= 1; fA += .01) {
const r = Math.round((fR - bR * (1 - fA)) / fA);
const g = Math.round((fG - bG * (1 - fA)) / fA);
const b = Math.round((fB - bB * (1 - fA)) / fA);
if (isStableColor(r) && isStableColor(g) && isStableColor(b)) return new FastColor({
r,
g,
b,
a: Math.round(fA * 100) / 100
}).toRgbString();
}
/* istanbul ignore next */
return new FastColor({
r: fR,
g: fG,
b: fB,
a: 1
}).toRgbString();
}
//#endregion
//#region node_modules/antd/es/theme/util/alias.js
/**
* Seed (designer) > Derivative (designer) > Alias (developer).
*
* Merge seed & derivative & override token and generate alias token for developer.
*/
function formatToken(derivativeToken) {
const { override, ...restToken } = derivativeToken;
const overrideTokens = { ...override };
Object.keys(seedToken).forEach((token) => {
delete overrideTokens[token];
});
const mergedToken = {
...restToken,
...overrideTokens
};
const shadowBaseColor = new FastColor(mergedToken.colorShadow);
const shadowBaseAlpha = shadowBaseColor.a;
const getShadowColor = (alpha) => shadowBaseColor.clone().setA(shadowBaseAlpha * alpha).toRgbString();
const screenXS = 480;
const screenSM = 576;
const screenMD = 768;
const screenLG = 992;
const screenXL = 1200;
const screenXXL = 1600;
const screenXXXL = 1920;
if (mergedToken.motion === false) {
const fastDuration = "0s";
mergedToken.motionDurationFast = fastDuration;
mergedToken.motionDurationMid = fastDuration;
mergedToken.motionDurationSlow = fastDuration;
}
return {
...mergedToken,
colorFillContent: mergedToken.colorFillSecondary,
colorFillContentHover: mergedToken.colorFill,
colorFillAlter: mergedToken.colorFillQuaternary,
colorBgContainerDisabled: mergedToken.colorFillTertiary,
colorBorderBg: mergedToken.colorBgContainer,
colorSplit: getAlphaColor$1(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
colorTextPlaceholder: mergedToken.colorTextQuaternary,
colorTextDisabled: mergedToken.colorTextQuaternary,
colorTextHeading: mergedToken.colorText,
colorTextLabel: mergedToken.colorTextSecondary,
colorTextDescription: mergedToken.colorTextTertiary,
colorTextLightSolid: mergedToken.colorWhite,
colorHighlight: mergedToken.colorError,
colorBgTextHover: mergedToken.colorFillSecondary,
colorBgTextActive: mergedToken.colorFill,
colorIcon: mergedToken.colorTextTertiary,
colorIconHover: mergedToken.colorText,
colorErrorOutline: getAlphaColor$1(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
colorWarningOutline: getAlphaColor$1(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
fontSizeIcon: mergedToken.fontSizeSM,
lineWidthFocus: mergedToken.lineWidth * 3,
lineWidth: mergedToken.lineWidth,
controlOutlineWidth: mergedToken.lineWidth * 2,
controlInteractiveSize: mergedToken.controlHeight / 2,
controlItemBgHover: mergedToken.colorFillTertiary,
controlItemBgActive: mergedToken.colorPrimaryBg,
controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
controlItemBgActiveDisabled: mergedToken.colorFill,
controlTmpOutline: mergedToken.colorFillQuaternary,
controlOutline: getAlphaColor$1(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
lineType: mergedToken.lineType,
borderRadius: mergedToken.borderRadius,
borderRadiusXS: mergedToken.borderRadiusXS,
borderRadiusSM: mergedToken.borderRadiusSM,
borderRadiusLG: mergedToken.borderRadiusLG,
fontWeightStrong: 600,
opacityLoading: .65,
linkDecoration: "none",
linkHoverDecoration: "none",
linkFocusDecoration: "none",
controlPaddingHorizontal: 12,
controlPaddingHorizontalSM: 8,
paddingXXS: mergedToken.sizeXXS,
paddingXS: mergedToken.sizeXS,
paddingSM: mergedToken.sizeSM,
padding: mergedToken.size,
paddingMD: mergedToken.sizeMD,
paddingLG: mergedToken.sizeLG,
paddingXL: mergedToken.sizeXL,
paddingContentHorizontalLG: mergedToken.sizeLG,
paddingContentVerticalLG: mergedToken.sizeMS,
paddingContentHorizontal: mergedToken.sizeMS,
paddingContentVertical: mergedToken.sizeSM,
paddingContentHorizontalSM: mergedToken.size,
paddingContentVerticalSM: mergedToken.sizeXS,
marginXXS: mergedToken.sizeXXS,
marginXS: mergedToken.sizeXS,
marginSM: mergedToken.sizeSM,
margin: mergedToken.size,
marginMD: mergedToken.sizeMD,
marginLG: mergedToken.sizeLG,
marginXL: mergedToken.sizeXL,
marginXXL: mergedToken.sizeXXL,
boxShadow: `
0 6px 16px 0 ${getShadowColor(.08)},
0 3px 6px -4px ${getShadowColor(.12)},
0 9px 28px 8px ${getShadowColor(.05)}
`,
boxShadowSecondary: `
0 6px 16px 0 ${getShadowColor(.08)},
0 3px 6px -4px ${getShadowColor(.12)},
0 9px 28px 8px ${getShadowColor(.05)}
`,
boxShadowTertiary: `
0 1px 2px 0 ${getShadowColor(.03)},
0 1px 6px -1px ${getShadowColor(.02)},
0 2px 4px 0 ${getShadowColor(.02)}
`,
screenXS,
screenXSMin: screenXS,
screenXSMax: screenSM - 1,
screenSM,
screenSMMin: screenSM,
screenSMMax: screenMD - 1,
screenMD,
screenMDMin: screenMD,
screenMDMax: screenLG - 1,
screenLG,
screenLGMin: screenLG,
screenLGMax: screenXL - 1,
screenXL,
screenXLMin: screenXL,
screenXLMax: screenXXL - 1,
screenXXL,
screenXXLMin: screenXXL,
screenXXLMax: screenXXXL - 1,
screenXXXL,
screenXXXLMin: screenXXXL,
boxShadowPopoverArrow: `2px 2px 5px ${getShadowColor(.05)}`,
boxShadowCard: `
0 1px 2px -2px ${getShadowColor(.16)},
0 3px 6px 0 ${getShadowColor(.12)},
0 5px 12px 4px ${getShadowColor(.09)}
`,
boxShadowDrawerRight: `
-6px 0 16px 0 ${getShadowColor(.08)},
-3px 0 6px -4px ${getShadowColor(.12)},
-9px 0 28px 8px ${getShadowColor(.05)}
`,
boxShadowDrawerLeft: `
6px 0 16px 0 ${getShadowColor(.08)},
3px 0 6px -4px ${getShadowColor(.12)},
9px 0 28px 8px ${getShadowColor(.05)}
`,
boxShadowDrawerUp: `
0 6px 16px 0 ${getShadowColor(.08)},
0 3px 6px -4px ${getShadowColor(.12)},
0 9px 28px 8px ${getShadowColor(.05)}
`,
boxShadowDrawerDown: `
0 -6px 16px 0 ${getShadowColor(.08)},
0 -3px 6px -4px ${getShadowColor(.12)},
0 -9px 28px 8px ${getShadowColor(.05)}
`,
boxShadowTabsOverflowLeft: `inset 10px 0 8px -8px ${getShadowColor(.08)}`,
boxShadowTabsOverflowRight: `inset -10px 0 8px -8px ${getShadowColor(.08)}`,
boxShadowTabsOverflowTop: `inset 0 10px 8px -8px ${getShadowColor(.08)}`,
boxShadowTabsOverflowBottom: `inset 0 -10px 8px -8px ${getShadowColor(.08)}`,
...overrideTokens
};
}
//#endregion
//#region node_modules/antd/es/theme/useToken.js
var unitless = {
lineHeight: true,
lineHeightSM: true,
lineHeightLG: true,
lineHeightHeading1: true,
lineHeightHeading2: true,
lineHeightHeading3: true,
lineHeightHeading4: true,
lineHeightHeading5: true,
opacityLoading: true,
fontWeightStrong: true,
zIndexPopupBase: true,
zIndexBase: true,
opacityImage: true
};
var ignore = {
motionBase: true,
motionUnit: true
};
var preserve = {
screenXS: true,
screenXSMin: true,
screenXSMax: true,
screenSM: true,
screenSMMin: true,
screenSMMax: true,
screenMD: true,
screenMDMin: true,
screenMDMax: true,
screenLG: true,
screenLGMin: true,
screenLGMax: true,
screenXL: true,
screenXLMin: true,
screenXLMax: true,
screenXXL: true,
screenXXLMin: true,
screenXXLMax: true,
screenXXXL: true,
screenXXXLMin: true
};
var getComputedToken = (originToken, overrideToken, theme) => {
const derivativeToken = theme.getDerivativeToken(originToken);
const { override, ...components } = overrideToken;
let mergedDerivativeToken = {
...derivativeToken,
override
};
mergedDerivativeToken = formatToken(mergedDerivativeToken);
if (components) Object.entries(components).forEach(([key, value]) => {
const { theme: componentTheme, ...componentTokens } = value;
let mergedComponentToken = componentTokens;
if (componentTheme) mergedComponentToken = getComputedToken({
...mergedDerivativeToken,
...componentTokens
}, { override: componentTokens }, componentTheme);
mergedDerivativeToken[key] = mergedComponentToken;
});
return mergedDerivativeToken;
};
function useToken$1() {
const { token: rootDesignToken, hashed, theme, override, cssVar: ctxCssVar, zeroRuntime } = import_react.useContext(DesignTokenContext);
const { csp } = import_react.useContext(ConfigContext);
const cssVar = {
prefix: ctxCssVar?.prefix ?? "ant",
key: ctxCssVar?.key ?? "css-var-root"
};
const salt = `${version_default}-${hashed || ""}`;
const mergedTheme = theme || defaultTheme;
const [token, hashId, realToken] = useCacheToken(mergedTheme, [seedToken, rootDesignToken], {
salt,
override,
getComputedToken,
cssVar: {
...cssVar,
unitless,
ignore,
preserve
},
nonce: csp?.nonce
});
return [
mergedTheme,
realToken,
hashed ? hashId : "",
token,
cssVar,
!!zeroRuntime
];
}
//#endregion
//#region node_modules/antd/es/style/index.js
var textEllipsis = {
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis"
};
var resetComponent = (token, needInheritFontFamily = false) => ({
boxSizing: "border-box",
margin: 0,
padding: 0,
color: token.colorText,
fontSize: token.fontSize,
lineHeight: token.lineHeight,
listStyle: "none",
fontFamily: needInheritFontFamily ? "inherit" : token.fontFamily
});
var resetIcon = () => ({
display: "inline-flex",
alignItems: "center",
color: "inherit",
fontStyle: "normal",
lineHeight: 0,
textAlign: "center",
textTransform: "none",
verticalAlign: "-0.125em",
textRendering: "optimizeLegibility",
"-webkit-font-smoothing": "antialiased",
"-moz-osx-font-smoothing": "grayscale",
"> *": { lineHeight: 1 },
svg: { display: "inline-block" }
});
var clearFix = () => ({
"&::before": {
display: "table",
content: "\"\""
},
"&::after": {
display: "table",
clear: "both",
content: "\"\""
}
});
var genFocusOutline = (token, offset) => ({
outline: `${unit$1(token.lineWidthFocus)} solid ${token.colorPrimaryBorder}`,
outlineOffset: offset ?? 1,
transition: [`outline-offset`, `outline`].map((prop) => `${prop} 0s`).join(", ")
});
var genFocusStyle = (token, offset) => ({ "&:focus-visible": genFocusOutline(token, offset) });
var genLinkStyle = (token) => ({ a: {
color: token.colorLink,
textDecoration: token.linkDecoration,
backgroundColor: "transparent",
outline: "none",
cursor: "pointer",
transition: `color ${token.motionDurationSlow}`,
"-webkit-text-decoration-skip": "objects",
"&:hover": { color: token.colorLinkHover },
"&:active": { color: token.colorLinkActive },
"&:active, &:hover": {
textDecoration: token.linkHoverDecoration,
outline: 0
},
"&:focus": {
textDecoration: token.linkFocusDecoration,
outline: 0
},
...genFocusStyle(token),
"&[disabled]": {
color: token.colorTextDisabled,
cursor: "not-allowed"
}
} });
var genCommonStyle = (token, componentPrefixCls, rootCls, resetFont) => {
const prefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
const rootPrefixSelector = rootCls ? `.${rootCls}` : prefixSelector;
const resetStyle = {
boxSizing: "border-box",
"&::before, &::after": { boxSizing: "border-box" }
};
let resetFontStyle = {};
if (resetFont !== false) resetFontStyle = {
fontFamily: token.fontFamily,
fontSize: token.fontSize
};
return { [rootPrefixSelector]: {
...resetFontStyle,
...resetStyle,
[prefixSelector]: resetStyle
} };
};
var genIconStyle$1 = (iconPrefixCls) => ({ [`.${iconPrefixCls}`]: {
...resetIcon(),
[`.${iconPrefixCls} .${iconPrefixCls}-icon`]: { display: "block" }
} });
var operationUnit = (token) => ({
color: token.colorLink,
textDecoration: token.linkDecoration,
outline: "none",
cursor: "pointer",
transition: `all ${token.motionDurationSlow}`,
border: 0,
padding: 0,
background: "none",
userSelect: "none",
...genFocusStyle(token),
"&:hover": {
color: token.colorLinkHover,
textDecoration: token.linkHoverDecoration
},
"&:focus": {
color: token.colorLinkHover,
textDecoration: token.linkFocusDecoration
},
"&:active": {
color: token.colorLinkActive,
textDecoration: token.linkHoverDecoration
}
});
//#endregion
//#region node_modules/antd/es/theme/util/genStyleUtils.js
var { genStyleHooks, genComponentStyleHook, genSubStyleComponent } = genStyleUtils({
usePrefix: () => {
const { getPrefixCls, iconPrefixCls } = (0, import_react.useContext)(ConfigContext);
return {
rootPrefixCls: getPrefixCls(),
iconPrefixCls
};
},
useToken: () => {
const [theme, realToken, hashId, token, cssVar, zeroRuntime] = useToken$1();
return {
theme,
realToken,
hashId,
token,
cssVar,
zeroRuntime
};
},
useCSP: () => {
const { csp } = (0, import_react.useContext)(ConfigContext);
return csp ?? {};
},
getResetStyles: (token, config) => {
const linkStyle = genLinkStyle(token);
return [
linkStyle,
{ "&": linkStyle },
genIconStyle$1(config?.prefix.iconPrefixCls ?? "anticon")
];
},
getCommonStyle: genCommonStyle,
getCompUnitless: () => unitless
});
var genCssVar = (antCls, component) => {
const cssPrefix = `--${antCls.replace(/\./g, "")}-${component}-`;
const varName = (name) => {
return `${cssPrefix}${name}`;
};
const varRef = (name, fallback) => {
return fallback ? `var(${cssPrefix}${name}, ${fallback})` : `var(${cssPrefix}${name})`;
};
return [varName, varRef];
};
//#endregion
//#region node_modules/antd/es/theme/util/genPresetColor.js
function genPresetColor$1(token, genCss) {
return PresetColors.reduce((prev, colorKey) => {
const lightColor = token[`${colorKey}1`];
const lightBorderColor = token[`${colorKey}3`];
const darkColor = token[`${colorKey}6`];
const textColor = token[`${colorKey}7`];
return {
...prev,
...genCss(colorKey, {
lightColor,
lightBorderColor,
darkColor,
textColor
})
};
}, {});
}
//#endregion
//#region node_modules/antd/es/theme/util/useResetIconStyle.js
var useResetIconStyle = (iconPrefixCls, csp) => {
const [theme, token] = useToken$1();
return useStyleRegister({
theme,
token,
hashId: "",
path: ["ant-design-icons", iconPrefixCls],
nonce: () => csp?.nonce,
layer: { name: "antd" }
}, () => genIconStyle$1(iconPrefixCls));
};
//#endregion
//#region node_modules/antd/es/affix/style/index.js
var genSharedAffixStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
position: "fixed",
zIndex: token.zIndexPopup
} };
};
var prepareComponentToken$57 = (token) => ({ zIndexPopup: token.zIndexBase + 10 });
var style_default$64 = genStyleHooks("Affix", genSharedAffixStyle, prepareComponentToken$57);
//#endregion
//#region node_modules/antd/es/affix/utils.js
function getTargetRect(target) {
return target !== window ? target.getBoundingClientRect() : {
top: 0,
bottom: window.innerHeight
};
}
function getFixedTop(placeholderRect, targetRect, offsetTop) {
if (offsetTop !== void 0 && Math.round(targetRect.top) > Math.round(placeholderRect.top) - offsetTop) return offsetTop + targetRect.top;
}
function getFixedBottom(placeholderRect, targetRect, offsetBottom) {
if (offsetBottom !== void 0 && Math.round(targetRect.bottom) < Math.round(placeholderRect.bottom) + offsetBottom) return offsetBottom + (window.innerHeight - targetRect.bottom);
}
//#endregion
//#region node_modules/antd/es/affix/index.js
var TRIGGER_EVENTS = [
"resize",
"scroll",
"touchstart",
"touchmove",
"touchend",
"pageshow",
"load"
];
var getDefaultTarget = () => {
return typeof window !== "undefined" ? window : null;
};
var AFFIX_STATUS_NONE = 0;
var AFFIX_STATUS_PREPARE = 1;
var Affix = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { style, offsetTop, offsetBottom, prefixCls, className, rootClassName, children, target, onChange, onTestUpdatePosition, ...restProps } = props;
const { getPrefixCls, className: contextClassName, style: contextStyle } = useComponentConfig("affix");
const { getTargetContainer } = import_react.useContext(ConfigContext);
const affixPrefixCls = getPrefixCls("affix", prefixCls);
const [lastAffix, setLastAffix] = import_react.useState(false);
const [affixStyle, setAffixStyle] = import_react.useState();
const [placeholderStyle, setPlaceholderStyle] = import_react.useState();
const statusRef = import_react.useRef(AFFIX_STATUS_NONE);
const prevTargetRef = import_react.useRef(null);
const prevListenerRef = import_react.useRef(null);
const placeholderNodeRef = import_react.useRef(null);
const fixedNodeRef = import_react.useRef(null);
const timerRef = import_react.useRef(null);
const targetFunc = target ?? getTargetContainer ?? getDefaultTarget;
const internalOffsetTop = offsetBottom === void 0 && offsetTop === void 0 ? 0 : offsetTop;
const measure = () => {
if (statusRef.current !== AFFIX_STATUS_PREPARE || !fixedNodeRef.current || !placeholderNodeRef.current || !targetFunc) return;
const targetNode = targetFunc();
if (targetNode) {
const newState = { status: AFFIX_STATUS_NONE };
const placeholderRect = getTargetRect(placeholderNodeRef.current);
if (placeholderRect.top === 0 && placeholderRect.left === 0 && placeholderRect.width === 0 && placeholderRect.height === 0) return;
const targetRect = getTargetRect(targetNode);
const fixedTop = getFixedTop(placeholderRect, targetRect, internalOffsetTop);
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
if (fixedTop !== void 0) {
newState.affixStyle = {
position: "fixed",
top: fixedTop,
width: placeholderRect.width,
height: placeholderRect.height
};
newState.placeholderStyle = {
width: placeholderRect.width,
height: placeholderRect.height
};
} else if (fixedBottom !== void 0) {
newState.affixStyle = {
position: "fixed",
bottom: fixedBottom,
width: placeholderRect.width,
height: placeholderRect.height
};
newState.placeholderStyle = {
width: placeholderRect.width,
height: placeholderRect.height
};
}
newState.lastAffix = !!newState.affixStyle;
if (lastAffix !== newState.lastAffix) onChange?.(newState.lastAffix);
statusRef.current = newState.status;
setAffixStyle(newState.affixStyle);
setPlaceholderStyle(newState.placeholderStyle);
setLastAffix(newState.lastAffix);
}
};
const prepareMeasure = () => {
statusRef.current = AFFIX_STATUS_PREPARE;
measure();
};
const updatePosition = throttleByAnimationFrame(() => {
prepareMeasure();
});
const lazyUpdatePosition = throttleByAnimationFrame(() => {
if (targetFunc && affixStyle) {
const targetNode = targetFunc();
if (targetNode && placeholderNodeRef.current) {
const targetRect = getTargetRect(targetNode);
const placeholderRect = getTargetRect(placeholderNodeRef.current);
const fixedTop = getFixedTop(placeholderRect, targetRect, internalOffsetTop);
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom);
if (fixedTop !== void 0 && affixStyle.top === fixedTop || fixedBottom !== void 0 && affixStyle.bottom === fixedBottom) return;
}
}
prepareMeasure();
});
const addListeners = () => {
const listenerTarget = targetFunc?.();
if (!listenerTarget) return;
TRIGGER_EVENTS.forEach((eventName) => {
if (prevListenerRef.current) prevTargetRef.current?.removeEventListener(eventName, prevListenerRef.current);
listenerTarget?.addEventListener(eventName, lazyUpdatePosition);
});
prevTargetRef.current = listenerTarget;
prevListenerRef.current = lazyUpdatePosition;
};
const removeListeners = () => {
const newTarget = targetFunc?.();
TRIGGER_EVENTS.forEach((eventName) => {
newTarget?.removeEventListener(eventName, lazyUpdatePosition);
if (prevListenerRef.current) prevTargetRef.current?.removeEventListener(eventName, prevListenerRef.current);
});
updatePosition.cancel();
lazyUpdatePosition.cancel();
};
import_react.useImperativeHandle(ref, () => ({ updatePosition }));
import_react.useEffect(() => {
timerRef.current = setTimeout(addListeners);
return () => {
if (timerRef.current) {
clearTimeout(timerRef.current);
timerRef.current = null;
}
removeListeners();
};
}, []);
import_react.useEffect(() => {
addListeners();
return () => removeListeners();
}, [
target,
affixStyle,
lastAffix,
offsetTop,
offsetBottom
]);
import_react.useEffect(() => {
updatePosition();
}, [
target,
offsetTop,
offsetBottom
]);
const [hashId, cssVarCls] = style_default$64(affixPrefixCls);
const mergedCls = clsx({ [clsx(rootClassName, hashId, affixPrefixCls, cssVarCls)]: affixStyle });
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: updatePosition }, /* @__PURE__ */ import_react.createElement("div", {
style: {
...contextStyle,
...style
},
className: clsx(className, contextClassName),
ref: placeholderNodeRef,
...restProps
}, affixStyle && /* @__PURE__ */ import_react.createElement("div", {
style: placeholderStyle,
"aria-hidden": "true"
}), /* @__PURE__ */ import_react.createElement("div", {
className: mergedCls,
ref: fixedNodeRef,
style: affixStyle
}, /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: updatePosition }, children))));
});
Affix.displayName = "Affix";
//#endregion
//#region node_modules/@rc-component/motion/es/context.js
var Context$1 = /* @__PURE__ */ import_react.createContext({});
var MotionProvider = (props) => {
const { children, ...rest } = props;
const memoizedValue = import_react.useMemo(() => {
return { motion: rest.motion };
}, [rest.motion]);
return /* @__PURE__ */ import_react.createElement(Context$1.Provider, { value: memoizedValue }, children);
};
//#endregion
//#region node_modules/@rc-component/util/es/hooks/useSyncState.js
/**
* Same as React.useState but will always get latest state.
* This is useful when React merge multiple state updates into one.
* e.g. onTransitionEnd trigger multiple event at once will be merged state update in React.
*/
function useSyncState$3(defaultValue) {
const [, forceUpdate] = import_react.useReducer((x) => x + 1, 0);
const currentValueRef = import_react.useRef(defaultValue);
return [useEvent(() => {
return currentValueRef.current;
}), useEvent((updater) => {
currentValueRef.current = typeof updater === "function" ? updater(currentValueRef.current) : updater;
forceUpdate();
})];
}
//#endregion
//#region node_modules/@rc-component/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";
/**
* Used for disabled motion case.
* Prepare stage will still work but start & active will be skipped.
*/
var STEP_PREPARED = "prepared";
//#endregion
//#region node_modules/@rc-component/motion/es/util/motion.js
function makePrefixMap(styleProp, eventName) {
const prefixes = {};
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
prefixes[`Webkit${styleProp}`] = `webkit${eventName}`;
prefixes[`Moz${styleProp}`] = `moz${eventName}`;
prefixes[`ms${styleProp}`] = `MS${eventName}`;
prefixes[`O${styleProp}`] = `o${eventName.toLowerCase()}`;
return prefixes;
}
function getVendorPrefixes(domSupport, win) {
const 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()) ({style} = document.createElement("div"));
var prefixedEventNames = {};
function getVendorPrefixedEventName(eventName) {
if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];
const prefixMap = vendorPrefixes[eventName];
if (prefixMap) {
const stylePropList = Object.keys(prefixMap);
const len = stylePropList.length;
for (let i = 0; i < len; i += 1) {
const 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$1(transitionName, transitionType) {
if (!transitionName) return null;
if (typeof transitionName === "object") return transitionName[transitionType.replace(/-\w/g, (match) => match[1].toUpperCase())];
return `${transitionName}-${transitionType}`;
}
//#endregion
//#region node_modules/@rc-component/motion/es/hooks/useDomMotionEvents.js
var useDomMotionEvents_default = ((onInternalMotionEnd) => {
const cacheElementRef = (0, import_react.useRef)();
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;
}
}
import_react.useEffect(() => () => {
removeMotionEvents(cacheElementRef.current);
cacheElementRef.current = null;
}, []);
return [patchMotionEvents, removeMotionEvents];
});
//#endregion
//#region node_modules/@rc-component/motion/es/hooks/useIsomorphicLayoutEffect.js
var useIsomorphicLayoutEffect = canUseDom() ? import_react.useLayoutEffect : import_react.useEffect;
//#endregion
//#region node_modules/@rc-component/motion/es/hooks/useNextFrame.js
var useNextFrame_default = (() => {
const nextFrameRef = import_react.useRef(null);
function cancelNextFrame() {
wrapperRaf.cancel(nextFrameRef.current);
}
function nextFrame(callback, delay = 2) {
cancelNextFrame();
const nextFrameId = wrapperRaf(() => {
if (delay <= 1) callback({ isCanceled: () => nextFrameId !== nextFrameRef.current });
else nextFrame(callback, delay - 1);
});
nextFrameRef.current = nextFrameId;
}
import_react.useEffect(() => () => {
cancelNextFrame();
}, []);
return [nextFrame, cancelNextFrame];
});
//#endregion
//#region node_modules/@rc-component/motion/es/hooks/useStepQueue.js
var FULL_STEP_QUEUE = [
STEP_PREPARE,
STEP_START,
STEP_ACTIVE,
"end"
];
var SIMPLE_STEP_QUEUE = [STEP_PREPARE, STEP_PREPARED];
function isActive(step) {
return step === "active" || step === "end";
}
var useStepQueue_default = ((status, prepareOnly, callback) => {
const [step, setStep] = useSafeState(STEP_NONE);
const [nextFrame, cancelNextFrame] = useNextFrame_default();
function startQueue() {
setStep(STEP_PREPARE, true);
}
const STEP_QUEUE = prepareOnly ? SIMPLE_STEP_QUEUE : FULL_STEP_QUEUE;
useIsomorphicLayoutEffect(() => {
if (step !== "none" && step !== "end") {
const nextStep = STEP_QUEUE[STEP_QUEUE.indexOf(step) + 1];
const result = callback(step);
if (result === false) setStep(nextStep, true);
else if (nextStep) nextFrame((info) => {
function doNext() {
if (info.isCanceled()) return;
setStep(nextStep, true);
}
if (result === true) doNext();
else Promise.resolve(result).then(doNext);
});
}
}, [status, step]);
import_react.useEffect(() => () => {
cancelNextFrame();
}, []);
return [startQueue, step];
});
//#endregion
//#region node_modules/@rc-component/motion/es/hooks/useStatus.js
function useStatus$1(supportMotion, visible, getElement, { motionEnter = true, motionAppear = true, motionLeave = true, motionDeadline, motionLeaveImmediately, onAppearPrepare, onEnterPrepare, onLeavePrepare, onAppearStart, onEnterStart, onLeaveStart, onAppearActive, onEnterActive, onLeaveActive, onAppearEnd, onEnterEnd, onLeaveEnd, onVisibleChanged }) {
const [asyncVisible, setAsyncVisible] = import_react.useState();
const [getStatus, setStatus] = useSyncState$3(STATUS_NONE);
const [style, setStyle] = import_react.useState([null, null]);
const currentStatus = getStatus();
const mountedRef = (0, import_react.useRef)(false);
const deadlineRef = (0, import_react.useRef)(null);
function getDomElement() {
return getElement();
}
const activeRef = (0, import_react.useRef)(false);
/**
* Clean up status & style
*/
function updateMotionEndStatus() {
setStatus(STATUS_NONE);
setStyle([null, null]);
}
const onInternalMotionEnd = useEvent((event) => {
const status = getStatus();
if (status === "none") return;
const element = getDomElement();
if (event && !event.deadline && event.target !== element) return;
const currentActive = activeRef.current;
let canEnd;
if (status === "appear" && currentActive) canEnd = onAppearEnd?.(element, event);
else if (status === "enter" && currentActive) canEnd = onEnterEnd?.(element, event);
else if (status === "leave" && currentActive) canEnd = onLeaveEnd?.(element, event);
if (currentActive && canEnd !== false) updateMotionEndStatus();
});
const [patchMotionEvents] = useDomMotionEvents_default(onInternalMotionEnd);
const getEventHandlers = (targetStatus) => {
switch (targetStatus) {
case STATUS_APPEAR: return {
[STEP_PREPARE]: onAppearPrepare,
[STEP_START]: onAppearStart,
[STEP_ACTIVE]: onAppearActive
};
case STATUS_ENTER: return {
[STEP_PREPARE]: onEnterPrepare,
[STEP_START]: onEnterStart,
[STEP_ACTIVE]: onEnterActive
};
case STATUS_LEAVE: return {
[STEP_PREPARE]: onLeavePrepare,
[STEP_START]: onLeaveStart,
[STEP_ACTIVE]: onLeaveActive
};
default: return {};
}
};
const eventHandlers = import_react.useMemo(() => getEventHandlers(currentStatus), [currentStatus]);
const [startStep, step] = useStepQueue_default(currentStatus, !supportMotion, (newStep) => {
if (newStep === "prepare") {
const onPrepare = eventHandlers[STEP_PREPARE];
if (!onPrepare) return false;
return onPrepare(getDomElement());
}
if (newStep in eventHandlers) setStyle([eventHandlers[newStep]?.(getDomElement(), null) || null, newStep]);
if (newStep === "active" && currentStatus !== "none") {
patchMotionEvents(getDomElement());
if (motionDeadline > 0) {
clearTimeout(deadlineRef.current);
deadlineRef.current = setTimeout(() => {
onInternalMotionEnd({ deadline: true });
}, motionDeadline);
}
}
if (newStep === "prepared") updateMotionEndStatus();
return true;
});
activeRef.current = isActive(step);
const visibleRef = (0, import_react.useRef)(null);
useIsomorphicLayoutEffect(() => {
if (mountedRef.current && visibleRef.current === visible) return;
setAsyncVisible(visible);
const isMounted = mountedRef.current;
mountedRef.current = true;
let 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;
const nextEventHandlers = getEventHandlers(nextStatus);
if (nextStatus && (supportMotion || nextEventHandlers["prepare"])) {
setStatus(nextStatus);
startStep();
} else setStatus(STATUS_NONE);
visibleRef.current = visible;
}, [visible]);
(0, import_react.useEffect)(() => {
if (currentStatus === "appear" && !motionAppear || currentStatus === "enter" && !motionEnter || currentStatus === "leave" && !motionLeave) setStatus(STATUS_NONE);
}, [
motionAppear,
motionEnter,
motionLeave
]);
(0, import_react.useEffect)(() => () => {
mountedRef.current = false;
clearTimeout(deadlineRef.current);
}, []);
const firstMountChangeRef = import_react.useRef(false);
(0, import_react.useEffect)(() => {
if (asyncVisible) firstMountChangeRef.current = true;
if (asyncVisible !== void 0 && currentStatus === "none") {
if (firstMountChangeRef.current || asyncVisible) onVisibleChanged?.(asyncVisible);
firstMountChangeRef.current = true;
}
}, [asyncVisible, currentStatus]);
let mergedStyle = style[0];
if (eventHandlers["prepare"] && step === "start") mergedStyle = {
transition: "none",
...mergedStyle
};
const styleStep = style[1];
return [
getStatus,
step,
mergedStyle,
asyncVisible ?? visible,
!mountedRef.current && currentStatus === "none" && supportMotion && motionAppear ? "NONE" : step === "start" || step === "active" ? styleStep === step : true
];
}
//#endregion
//#region node_modules/@rc-component/motion/es/CSSMotion.js
function isRefNotConsumed(children) {
return children?.length < 2;
}
/**
* `transitionSupport` is used for none transition test case.
* Default we use browser transition event support check.
*/
function genCSSMotion(config) {
let transitionSupport = config;
if (typeof config === "object") ({transitionSupport} = config);
function isSupportTransition(props, contextMotion) {
return !!(props.motionName && transitionSupport && contextMotion !== false);
}
const CSSMotion = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { visible = true, removeOnLeave = true, forceRender, children, motionName, leavedClassName, eventProps } = props;
const { motion: contextMotion } = import_react.useContext(Context$1);
const supportMotion = isSupportTransition(props, contextMotion);
const nodeRef = (0, import_react.useRef)();
function getDomElement() {
return getDOM(nodeRef.current);
}
const [getStatus, statusStep, statusStyle, mergedVisible, styleReady] = useStatus$1(supportMotion, visible, getDomElement, props);
const status = getStatus();
const renderedRef = import_react.useRef(mergedVisible);
if (mergedVisible) renderedRef.current = true;
const refObj = import_react.useMemo(() => {
const obj = {};
Object.defineProperties(obj, {
nativeElement: {
enumerable: true,
get: getDomElement
},
inMotion: {
enumerable: true,
get: () => () => getStatus() !== STATUS_NONE
},
enableMotion: {
enumerable: true,
get: () => () => supportMotion
}
});
return obj;
}, []);
import_react.useImperativeHandle(ref, () => refObj, []);
const idRef = import_react.useRef(0);
if (styleReady) idRef.current += 1;
const returnNode = import_react.useMemo(() => {
if (styleReady === "NONE") return null;
let motionChildren;
const mergedProps = {
...eventProps,
visible
};
if (!children) motionChildren = null;
else if (status === "none") if (mergedVisible) motionChildren = children({ ...mergedProps }, nodeRef);
else if (!removeOnLeave && renderedRef.current && leavedClassName) motionChildren = children({
...mergedProps,
className: leavedClassName
}, nodeRef);
else if (forceRender || !removeOnLeave && !leavedClassName) motionChildren = children({
...mergedProps,
style: { display: "none" }
}, nodeRef);
else motionChildren = null;
else {
let statusSuffix;
if (statusStep === "prepare") statusSuffix = "prepare";
else if (isActive(statusStep)) statusSuffix = "active";
else if (statusStep === "start") statusSuffix = "start";
const motionCls = getTransitionName$1(motionName, `${status}-${statusSuffix}`);
motionChildren = children({
...mergedProps,
className: clsx(getTransitionName$1(motionName, status), {
[motionCls]: motionCls && statusSuffix,
[motionName]: typeof motionName === "string"
}),
style: statusStyle
}, nodeRef);
}
return motionChildren;
}, [idRef.current]);
if (isRefNotConsumed(children) && supportNodeRef(returnNode)) {
const originNodeRef = getNodeRef(returnNode);
if (originNodeRef !== nodeRef) return /* @__PURE__ */ import_react.cloneElement(returnNode, { ref: composeRef(originNodeRef, nodeRef) });
}
return returnNode;
});
CSSMotion.displayName = "CSSMotion";
return CSSMotion;
}
var CSSMotion_default = genCSSMotion(supportTransition);
var STATUS_KEEP = "keep";
var STATUS_REMOVE = "remove";
var STATUS_REMOVED = "removed";
function wrapKeyToObject(key) {
let keyObj;
if (key && typeof key === "object" && "key" in key) keyObj = key;
else keyObj = { key };
return {
...keyObj,
key: String(keyObj.key)
};
}
function parseKeys(keys = []) {
return keys.map(wrapKeyToObject);
}
function diffKeys(prevKeys = [], currentKeys = []) {
let list = [];
let currentIndex = 0;
const currentLen = currentKeys.length;
const prevKeyObjects = parseKeys(prevKeys);
const currentKeyObjects = parseKeys(currentKeys);
prevKeyObjects.forEach((keyObj) => {
let hit = false;
for (let i = currentIndex; i < currentLen; i += 1) {
const currentKeyObj = currentKeyObjects[i];
if (currentKeyObj.key === keyObj.key) {
if (currentIndex < i) {
list = list.concat(currentKeyObjects.slice(currentIndex, i).map((obj) => ({
...obj,
status: "add"
})));
currentIndex = i;
}
list.push({
...currentKeyObj,
status: STATUS_KEEP
});
currentIndex += 1;
hit = true;
break;
}
}
if (!hit) list.push({
...keyObj,
status: STATUS_REMOVE
});
});
if (currentIndex < currentLen) list = list.concat(currentKeyObjects.slice(currentIndex).map((obj) => ({
...obj,
status: "add"
})));
/**
* Merge same key when it remove and add again:
* [1 - add, 2 - keep, 1 - remove] -> [1 - keep, 2 - keep]
*/
const keys = {};
list.forEach(({ key }) => {
keys[key] = (keys[key] || 0) + 1;
});
Object.keys(keys).filter((key) => keys[key] > 1).forEach((matchKey) => {
list = list.filter(({ key, status }) => key !== matchKey || status !== "remove");
list.forEach((node) => {
if (node.key === matchKey) node.status = STATUS_KEEP;
});
});
return list;
}
//#endregion
//#region node_modules/@rc-component/motion/es/CSSMotionList.js
function _extends$98() {
_extends$98 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$98.apply(this, arguments);
}
var MOTION_PROP_NAMES = [
"eventProps",
"visible",
"children",
"motionName",
"motionAppear",
"motionEnter",
"motionLeave",
"motionLeaveImmediately",
"motionDeadline",
"removeOnLeave",
"leavedClassName",
"onAppearPrepare",
"onAppearStart",
"onAppearActive",
"onAppearEnd",
"onEnterStart",
"onEnterActive",
"onEnterEnd",
"onLeaveStart",
"onLeaveActive",
"onLeaveEnd"
];
/**
* Generate a CSSMotionList component with config
* @param transitionSupport No need since CSSMotionList no longer depends on transition support
* @param CSSMotion CSSMotion component
*/
function genCSSMotionList(transitionSupport, CSSMotion = CSSMotion_default) {
class CSSMotionList extends import_react.Component {
static defaultProps = { component: "div" };
state = { keyEntities: [] };
static getDerivedStateFromProps({ keys }, { keyEntities }) {
return { keyEntities: diffKeys(keyEntities, parseKeys(keys)).filter((entity) => {
const prevEntity = keyEntities.find(({ key }) => entity.key === key);
if (prevEntity && prevEntity.status === "removed" && entity.status === "remove") return false;
return true;
}) };
}
removeKey = (removeKey) => {
this.setState((prevState) => {
return { keyEntities: prevState.keyEntities.map((entity) => {
if (entity.key !== removeKey) return entity;
return {
...entity,
status: STATUS_REMOVED
};
}) };
}, () => {
const { keyEntities } = this.state;
if (keyEntities.filter(({ status }) => status !== "removed").length === 0 && this.props.onAllRemoved) this.props.onAllRemoved();
});
};
render() {
const { keyEntities } = this.state;
const { component, children, onVisibleChanged, onAllRemoved, ...restProps } = this.props;
const Component = component || import_react.Fragment;
const motionProps = {};
MOTION_PROP_NAMES.forEach((prop) => {
motionProps[prop] = restProps[prop];
delete restProps[prop];
});
delete restProps.keys;
return /* @__PURE__ */ import_react.createElement(Component, restProps, keyEntities.map(({ status, ...eventProps }, index) => {
const visible = status === "add" || status === "keep";
return /* @__PURE__ */ import_react.createElement(CSSMotion, _extends$98({}, motionProps, {
key: eventProps.key,
visible,
eventProps,
onVisibleChanged: (changedVisible) => {
onVisibleChanged?.(changedVisible, { key: eventProps.key });
if (!changedVisible) this.removeKey(eventProps.key);
}
}), isRefNotConsumed(children) ? (props) => children({
...props,
index
}) : (props, ref) => children({
...props,
index
}, ref));
}));
}
}
return CSSMotionList;
}
var CSSMotionList_default = genCSSMotionList(supportTransition);
//#endregion
//#region node_modules/@rc-component/motion/es/index.js
var es_default$28 = CSSMotion_default;
//#endregion
//#region node_modules/@rc-component/util/es/pickAttrs.js
var propList = `accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`.split(/[\s\n]+/);
var ariaPrefix = "aria-";
var dataPrefix = "data-";
function match(key, prefix) {
return key.indexOf(prefix) === 0;
}
/**
* Picker props from exist props with filter
* @param props Passed props
* @param ariaOnly boolean | { aria?: boolean; data?: boolean; attr?: boolean; } filter config
*/
function pickAttrs(props, ariaOnly = false) {
let mergedConfig;
if (ariaOnly === false) mergedConfig = {
aria: true,
data: true,
attr: true
};
else if (ariaOnly === true) mergedConfig = { aria: true };
else mergedConfig = { ...ariaOnly };
const attrs = {};
Object.keys(props).forEach((key) => {
if (mergedConfig.aria && (key === "role" || match(key, ariaPrefix)) || mergedConfig.data && match(key, dataPrefix) || mergedConfig.attr && propList.includes(key)) attrs[key] = props[key];
});
return attrs;
}
//#endregion
//#region node_modules/@rc-component/pagination/es/locale/en_US.js
var locale$4 = {
items_per_page: "/ page",
jump_to: "Go to",
jump_to_confirm: "confirm",
page: "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",
page_size: "Page Size"
};
//#endregion
//#region node_modules/@rc-component/picker/es/locale/common.js
var commonLocale = {
yearFormat: "YYYY",
dayFormat: "D",
cellMeridiemFormat: "A",
monthBeforeYear: true
};
//#endregion
//#region node_modules/@rc-component/picker/es/locale/en_US.js
function _typeof$29(o) {
"@babel/helpers - typeof";
return _typeof$29 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$29(o);
}
function ownKeys$17(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$17(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$17(Object(t), !0).forEach(function(r) {
_defineProperty$27(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$17(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$27(obj, key, value) {
key = _toPropertyKey$27(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$27(t) {
var i = _toPrimitive$27(t, "string");
return "symbol" == _typeof$29(i) ? i : String(i);
}
function _toPrimitive$27(t, r) {
if ("object" != _typeof$29(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$29(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
var locale$3 = _objectSpread$17(_objectSpread$17({}, commonLocale), {}, {
locale: "en_US",
today: "Today",
now: "Now",
backToToday: "Back to today",
ok: "OK",
clear: "Clear",
week: "Week",
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",
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"
});
//#endregion
//#region node_modules/antd/es/time-picker/locale/en_US.js
var locale$2 = {
placeholder: "Select time",
rangePlaceholder: ["Start time", "End time"]
};
//#endregion
//#region node_modules/antd/es/date-picker/locale/en_US.js
var locale$1 = {
lang: {
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"],
rangeQuarterPlaceholder: ["Start quarter", "End quarter"],
rangeMonthPlaceholder: ["Start month", "End month"],
rangeWeekPlaceholder: ["Start week", "End week"],
...locale$3
},
timePickerLocale: { ...locale$2 }
};
//#endregion
//#region node_modules/antd/es/calendar/locale/en_US.js
var en_US_default = locale$1;
//#endregion
//#region node_modules/antd/es/locale/en_US.js
var typeTemplate$1 = "${label} is not a valid ${type}";
var localeValues = {
locale: "en",
Pagination: locale$4,
DatePicker: locale$1,
TimePicker: locale$2,
Calendar: en_US_default,
global: {
placeholder: "Please select",
close: "Close",
sortable: "sortable"
},
Table: {
filterTitle: "Filter menu",
filterConfirm: "OK",
filterReset: "Reset",
filterEmptyText: "No filters",
filterCheckAll: "Select all items",
filterSearchPlaceholder: "Search in 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"
},
Tour: {
Next: "Next",
Previous: "Previous",
Finish: "Finish"
},
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",
deselectAll: "Deselect 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",
collapse: "Collapse"
},
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: typeTemplate$1,
method: typeTemplate$1,
array: typeTemplate$1,
object: typeTemplate$1,
number: typeTemplate$1,
date: typeTemplate$1,
boolean: typeTemplate$1,
integer: typeTemplate$1,
float: typeTemplate$1,
regexp: typeTemplate$1,
email: typeTemplate$1,
url: typeTemplate$1,
hex: typeTemplate$1
},
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}" }
}
},
QRCode: {
expired: "QR code expired",
refresh: "Refresh",
scanned: "Scanned"
},
ColorPicker: {
presetEmpty: "Empty",
transparent: "Transparent",
singleColor: "Single",
gradientColor: "Gradient"
}
};
//#endregion
//#region node_modules/antd/es/modal/locale.js
var runtimeLocale = { ...localeValues.Modal };
var localeList = [];
var generateLocale = () => localeList.reduce((merged, locale) => ({
...merged,
...locale
}), localeValues.Modal);
function changeConfirmLocale(newLocale) {
if (newLocale) {
const cloneLocale = { ...newLocale };
localeList.push(cloneLocale);
runtimeLocale = generateLocale();
return () => {
localeList = localeList.filter((locale) => locale !== cloneLocale);
runtimeLocale = generateLocale();
};
}
runtimeLocale = { ...localeValues.Modal };
}
function getConfirmLocale() {
return runtimeLocale;
}
//#endregion
//#region node_modules/antd/es/locale/context.js
var LocaleContext = /* @__PURE__ */ (0, import_react.createContext)(void 0);
//#endregion
//#region node_modules/antd/es/locale/useLocale.js
var useLocale$1 = (componentName, defaultLocale) => {
const fullLocale = import_react.useContext(LocaleContext);
return [import_react.useMemo(() => {
const locale = defaultLocale || localeValues[componentName];
const localeFromContext = fullLocale?.[componentName] ?? {};
return {
...typeof locale === "function" ? locale() : locale,
...localeFromContext || {}
};
}, [
componentName,
defaultLocale,
fullLocale
]), import_react.useMemo(() => {
const localeCode = fullLocale?.locale;
if (fullLocale?.exist && !localeCode) return localeValues.locale;
return localeCode;
}, [fullLocale])];
};
//#endregion
//#region node_modules/antd/es/locale/index.js
var ANT_MARK = "internalMark";
var LocaleProvider = (props) => {
const { locale = {}, children, _ANT_MARK__ } = props;
devUseWarning("LocaleProvider")(_ANT_MARK__ === ANT_MARK, "deprecated", "`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale");
import_react.useEffect(() => {
return changeConfirmLocale(locale?.Modal);
}, [locale]);
const getMemoizedContextValue = import_react.useMemo(() => ({
...locale,
exist: true
}), [locale]);
return /* @__PURE__ */ import_react.createElement(LocaleContext.Provider, { value: getMemoizedContextValue }, children);
};
LocaleProvider.displayName = "LocaleProvider";
//#endregion
//#region node_modules/antd/es/_util/extendsObject.js
function mergeProps$1(...items) {
const ret = {};
items.forEach((item) => {
if (item) Object.keys(item).forEach((key) => {
if (item[key] !== void 0) ret[key] = item[key];
});
});
return ret;
}
//#endregion
//#region node_modules/antd/es/_util/is.js
var isNonNullable = (val) => {
return val !== void 0 && val !== null;
};
var isNumber = (val) => {
return typeof val === "number" && !Number.isNaN(val);
};
var isString = (val) => {
return typeof val === "string";
};
var isPlainObject = (val) => {
return val !== null && typeof val === "object";
};
var isFunction = (val) => {
return typeof val === "function";
};
var isThenable = (val) => {
return isNonNullable(val) && isFunction(val.then);
};
var isPrimitive = (val) => {
return typeof val !== "object" && !isFunction(val) || val === null;
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useClosable.js
var pickClosable = (context) => {
if (!context) return;
const { closable, closeIcon } = context;
return {
closable,
closeIcon
};
};
var EmptyFallbackCloseCollection = {};
var computeClosableConfig = (closable, closeIcon) => {
if (!closable && (closable === false || closeIcon === false || closeIcon === null)) return false;
if (closable === void 0 && closeIcon === void 0) return null;
let closableConfig = { closeIcon: typeof closeIcon !== "boolean" && closeIcon !== null ? closeIcon : void 0 };
if (isPlainObject(closable)) closableConfig = {
...closableConfig,
...closable
};
return closableConfig;
};
var mergeClosableConfigs = (propConfig, contextConfig, fallbackConfig) => {
if (propConfig === false) return false;
if (propConfig) return mergeProps$1(fallbackConfig, contextConfig, propConfig);
if (contextConfig === false) return false;
if (contextConfig) return mergeProps$1(fallbackConfig, contextConfig);
return fallbackConfig.closable ? fallbackConfig : false;
};
var computeCloseIcon = (mergedConfig, fallbackCloseCollection, closeLabel) => {
const { closeIconRender } = fallbackCloseCollection;
const { closeIcon, ...restConfig } = mergedConfig;
let finalCloseIcon = closeIcon;
const ariaOrDataProps = pickAttrs(restConfig, true);
if (isNonNullable(finalCloseIcon)) {
if (closeIconRender) finalCloseIcon = closeIconRender(finalCloseIcon);
finalCloseIcon = /* @__PURE__ */ import_react.isValidElement(finalCloseIcon) ? /* @__PURE__ */ import_react.cloneElement(finalCloseIcon, {
"aria-label": closeLabel,
...finalCloseIcon.props,
...ariaOrDataProps
}) : /* @__PURE__ */ import_react.createElement("span", {
"aria-label": closeLabel,
...ariaOrDataProps
}, finalCloseIcon);
}
return [finalCloseIcon, ariaOrDataProps];
};
var computeClosable = (propCloseCollection, contextCloseCollection, fallbackCloseCollection = EmptyFallbackCloseCollection, closeLabel = "Close") => {
const propConfig = computeClosableConfig(propCloseCollection?.closable, propCloseCollection?.closeIcon);
const contextConfig = computeClosableConfig(contextCloseCollection?.closable, contextCloseCollection?.closeIcon);
const mergedFallback = {
closeIcon: /* @__PURE__ */ import_react.createElement(RefIcon, null),
...fallbackCloseCollection
};
const mergedConfig = mergeClosableConfigs(propConfig, contextConfig, mergedFallback);
const closeBtnIsDisabled = typeof mergedConfig !== "boolean" ? !!mergedConfig?.disabled : false;
if (mergedConfig === false) return [
false,
null,
closeBtnIsDisabled,
{}
];
const [closeIcon, ariaProps] = computeCloseIcon(mergedConfig, mergedFallback, closeLabel);
return [
true,
closeIcon,
closeBtnIsDisabled,
ariaProps
];
};
var useClosable$1 = (propCloseCollection, contextCloseCollection, fallbackCloseCollection = EmptyFallbackCloseCollection) => {
const [contextLocale] = useLocale$1("global", localeValues.global);
return import_react.useMemo(() => {
return computeClosable(propCloseCollection, contextCloseCollection, {
closeIcon: /* @__PURE__ */ import_react.createElement(RefIcon, null),
...fallbackCloseCollection
}, contextLocale.close);
}, [
propCloseCollection,
contextCloseCollection,
fallbackCloseCollection,
contextLocale.close
]);
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useForceUpdate.js
var useForceUpdate = () => {
return import_react.useReducer((ori) => ori + 1, 0);
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useMergedMask.js
var normalizeMaskConfig = (mask, maskClosable) => {
let maskConfig = {};
if (isPlainObject(mask)) maskConfig = mask;
if (typeof mask === "boolean") maskConfig = { enabled: mask };
if (maskConfig.closable === void 0 && maskClosable !== void 0) maskConfig.closable = maskClosable;
return maskConfig;
};
var useMergedMask = (mask, contextMask, prefixCls, maskClosable) => {
return (0, import_react.useMemo)(() => {
const maskConfig = normalizeMaskConfig(mask, maskClosable);
const contextMaskConfig = normalizeMaskConfig(contextMask);
const mergedConfig = {
blur: false,
...contextMaskConfig,
...maskConfig,
closable: maskConfig.closable ?? maskClosable ?? contextMaskConfig.closable ?? true
};
const className = mergedConfig.blur ? `${prefixCls}-mask-blur` : void 0;
return [
mergedConfig.enabled !== false,
{ mask: className },
!!mergedConfig.closable
];
}, [
mask,
contextMask,
prefixCls,
maskClosable
]);
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useMergeSemantic.js
var mergeClassNames = (schema, ...classNames) => {
const mergedSchema = schema || {};
return classNames.filter(Boolean).reduce((acc, cur) => {
Object.keys(cur || {}).forEach((key) => {
const keySchema = mergedSchema[key];
const curVal = cur[key];
if (isPlainObject(keySchema)) if (isPlainObject(curVal)) acc[key] = mergeClassNames(keySchema, acc[key], curVal);
else {
const { _default: defaultField } = keySchema;
if (defaultField) {
acc[key] = acc[key] || {};
acc[key][defaultField] = clsx(acc[key][defaultField], curVal);
}
}
else acc[key] = clsx(acc[key], curVal);
});
return acc;
}, {});
};
var useSemanticClassNames = (schema, ...classNames) => {
return import_react.useMemo(() => mergeClassNames.apply(void 0, [schema].concat(classNames)), [schema].concat(classNames));
};
var mergeStyles = (...styles) => {
return styles.filter(Boolean).reduce((acc, cur = {}) => {
Object.keys(cur).forEach((key) => {
acc[key] = {
...acc[key],
...cur[key]
};
});
return acc;
}, {});
};
var useSemanticStyles = (...styles) => {
return import_react.useMemo(() => mergeStyles.apply(void 0, styles), [].concat(styles));
};
var fillObjectBySchema = (obj, schema) => {
const newObj = { ...obj };
Object.keys(schema).forEach((key) => {
if (key !== "_default") {
const nestSchema = schema[key];
const nextValue = newObj[key] || {};
newObj[key] = nestSchema ? fillObjectBySchema(nextValue, nestSchema) : nextValue;
}
});
return newObj;
};
var resolveStyleOrClass = (value, info) => {
return typeof value === "function" ? value(info) : value;
};
/**
* @desc Merge classNames and styles from multiple sources. When `schema` is provided, it **must** provide the nest object structure.
* @descZH 合并来自多个来源的 classNames 和 styles,当提供了 `schema` 时,必须提供嵌套的对象结构。
*/
var useMergeSemantic = (classNamesList, stylesList, info, schema) => {
const resolvedClassNamesList = classNamesList.map((classNames) => classNames ? resolveStyleOrClass(classNames, info) : void 0);
const resolvedStylesList = stylesList.map((styles) => styles ? resolveStyleOrClass(styles, info) : void 0);
const mergedClassNames = useSemanticClassNames.apply(void 0, [schema].concat(_toConsumableArray$8(resolvedClassNamesList)));
const mergedStyles = useSemanticStyles.apply(void 0, _toConsumableArray$8(resolvedStylesList));
return import_react.useMemo(() => {
if (!schema) return [mergedClassNames, mergedStyles];
return [fillObjectBySchema(mergedClassNames, schema), fillObjectBySchema(mergedStyles, schema)];
}, [
mergedClassNames,
mergedStyles,
schema
]);
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useMultipleSelect.js
/**
* @title multipleSelect hooks
* @description multipleSelect by hold down shift key
*/
var useMultipleSelect = (getKey) => {
const [prevSelectedIndex, setPrevSelectedIndex] = (0, import_react.useState)(null);
return [(0, import_react.useCallback)((currentSelectedIndex, data, selectedKeys) => {
const configPrevSelectedIndex = prevSelectedIndex ?? currentSelectedIndex;
const startIndex = Math.min(configPrevSelectedIndex || 0, currentSelectedIndex);
const endIndex = Math.max(configPrevSelectedIndex || 0, currentSelectedIndex);
const rangeKeys = data.slice(startIndex, endIndex + 1).map(getKey);
const shouldSelected = rangeKeys.some((rangeKey) => !selectedKeys.has(rangeKey));
const changedKeys = [];
rangeKeys.forEach((item) => {
if (shouldSelected) {
if (!selectedKeys.has(item)) changedKeys.push(item);
selectedKeys.add(item);
} else {
selectedKeys.delete(item);
changedKeys.push(item);
}
});
setPrevSelectedIndex(shouldSelected ? endIndex : null);
return changedKeys;
}, [prevSelectedIndex]), setPrevSelectedIndex];
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useOrientation.js
var isValidOrientation = (orientation) => {
return orientation === "horizontal" || orientation === "vertical";
};
var useOrientation = (orientation, vertical, legacyDirection) => {
return (0, import_react.useMemo)(() => {
const validOrientation = isValidOrientation(orientation);
let mergedOrientation;
if (validOrientation) mergedOrientation = orientation;
else if (typeof vertical === "boolean") mergedOrientation = vertical ? "vertical" : "horizontal";
else mergedOrientation = isValidOrientation(legacyDirection) ? legacyDirection : "horizontal";
return [mergedOrientation, mergedOrientation === "vertical"];
}, [
legacyDirection,
orientation,
vertical
]);
};
//#endregion
//#region node_modules/antd/es/_util/hooks/usePatchElement.js
var usePatchElement = () => {
const [elements, setElements] = import_react.useState([]);
return [elements, import_react.useCallback((element) => {
setElements((originElements) => [].concat(_toConsumableArray$8(originElements), [element]));
return () => {
setElements((originElements) => originElements.filter((ele) => ele !== element));
};
}, [])];
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useProxyImperativeHandle.js
var fillProxy = (element, handler) => {
element._antProxy = element._antProxy || {};
Object.keys(handler).forEach((key) => {
if (!(key in element._antProxy)) {
const ori = element[key];
element._antProxy[key] = ori;
element[key] = handler[key];
}
});
return element;
};
var useProxyImperativeHandle = (ref, init) => {
return (0, import_react.useImperativeHandle)(ref, () => {
const refObj = init();
const { nativeElement } = refObj;
if (typeof Proxy !== "undefined") return new Proxy(nativeElement, { get(obj, prop) {
if (refObj[prop]) return refObj[prop];
return Reflect.get(obj, prop);
} });
return fillProxy(nativeElement, refObj);
});
};
//#endregion
//#region node_modules/antd/es/_util/hooks/useSyncState.js
var useSyncState$2 = (initialValue) => {
const ref = import_react.useRef(initialValue);
const [, forceUpdate] = useForceUpdate();
return [() => ref.current, (newValue) => {
ref.current = newValue;
forceUpdate();
}];
};
//#endregion
//#region node_modules/antd/es/_util/zindexContext.js
var ZIndexContext = /* @__PURE__ */ import_react.createContext(void 0);
ZIndexContext.displayName = "ZIndexContext";
//#endregion
//#region node_modules/antd/es/_util/hooks/useZIndex.js
var CONTAINER_OFFSET = 100;
var CONTAINER_MAX_OFFSET = CONTAINER_OFFSET * 10;
/**
* Static function will default be the `CONTAINER_MAX_OFFSET`.
* But it still may have children component like Select, Dropdown.
* So the warning zIndex should exceed the `CONTAINER_MAX_OFFSET`.
*/
var CONTAINER_MAX_OFFSET_WITH_CHILDREN = CONTAINER_MAX_OFFSET + CONTAINER_OFFSET;
var containerBaseZIndexOffset = {
Modal: CONTAINER_OFFSET,
Drawer: CONTAINER_OFFSET,
Popover: CONTAINER_OFFSET,
Popconfirm: CONTAINER_OFFSET,
Tooltip: CONTAINER_OFFSET,
Tour: CONTAINER_OFFSET,
FloatButton: CONTAINER_OFFSET
};
var consumerBaseZIndexOffset = {
SelectLike: 50,
Dropdown: 50,
DatePicker: 50,
Menu: 50,
ImagePreview: 1
};
var isContainerType = (type) => {
return type in containerBaseZIndexOffset;
};
var useZIndex = (componentType, customZIndex) => {
const [, token] = useToken$1();
const parentZIndex = import_react.useContext(ZIndexContext);
const isContainer = isContainerType(componentType);
let result;
if (customZIndex !== void 0) result = [customZIndex, customZIndex];
else {
let zIndex = parentZIndex ?? 0;
if (isContainer) zIndex += (parentZIndex ? 0 : token.zIndexPopupBase) + containerBaseZIndexOffset[componentType];
else zIndex += consumerBaseZIndexOffset[componentType];
result = [parentZIndex === void 0 ? customZIndex : zIndex, zIndex];
}
{
const warning = devUseWarning(componentType);
const maxZIndex = token.zIndexPopupBase + CONTAINER_MAX_OFFSET_WITH_CHILDREN;
const currentZIndex = result[0] || 0;
warning(customZIndex !== void 0 || currentZIndex <= maxZIndex, "usage", "`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.");
}
return result;
};
//#endregion
//#region node_modules/antd/es/alert/style/index.js
var genAlertTypeStyle = (bgColor, borderColor, iconColor, token, alertCls) => ({
background: bgColor,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${borderColor}`,
[`${alertCls}-icon`]: { color: iconColor }
});
var genBaseStyle$18 = (token) => {
const { componentCls, motionDurationSlow: duration, marginXS, marginSM, fontSize, fontSizeLG, lineHeight, borderRadiusLG: borderRadius, motionEaseInOutCirc, withDescriptionIconSize, colorText, colorTextHeading, withDescriptionPadding, defaultPadding } = token;
return {
[componentCls]: {
...resetComponent(token),
position: "relative",
display: "flex",
alignItems: "center",
padding: defaultPadding,
wordWrap: "break-word",
borderRadius,
[`&${componentCls}-rtl`]: { direction: "rtl" },
[`${componentCls}-section`]: {
flex: 1,
minWidth: 0
},
[`${componentCls}-icon`]: {
marginInlineEnd: marginXS,
lineHeight: 0
},
"&-description": {
display: "none",
fontSize,
lineHeight
},
"&-title": { color: colorTextHeading },
[`&${componentCls}-motion-leave`]: {
overflow: "hidden",
opacity: 1,
transition: [
`max-height`,
`opacity`,
`padding-top`,
`padding-bottom`,
`margin-bottom`
].map((prop) => `${prop} ${duration} ${motionEaseInOutCirc}`).join(", ")
},
[`&${componentCls}-motion-leave-active`]: {
maxHeight: 0,
marginBottom: "0 !important",
paddingTop: 0,
paddingBottom: 0,
opacity: 0
}
},
[`${componentCls}-with-description`]: {
alignItems: "flex-start",
padding: withDescriptionPadding,
[`${componentCls}-icon`]: {
marginInlineEnd: marginSM,
fontSize: withDescriptionIconSize,
lineHeight: 0
},
[`${componentCls}-title`]: {
display: "block",
marginBottom: marginXS,
color: colorTextHeading,
fontSize: fontSizeLG
},
[`${componentCls}-description`]: {
display: "block",
color: colorText
}
},
[`${componentCls}-banner`]: {
marginBottom: 0,
border: "0 !important",
borderRadius: 0
}
};
};
var genTypeStyle = (token) => {
const { componentCls, colorSuccess, colorSuccessBorder, colorSuccessBg, colorWarning, colorWarningBorder, colorWarningBg, colorError, colorErrorBorder, colorErrorBg, colorInfo, colorInfoBorder, colorInfoBg } = token;
return { [componentCls]: {
"&-success": genAlertTypeStyle(colorSuccessBg, colorSuccessBorder, colorSuccess, token, componentCls),
"&-info": genAlertTypeStyle(colorInfoBg, colorInfoBorder, colorInfo, token, componentCls),
"&-warning": genAlertTypeStyle(colorWarningBg, colorWarningBorder, colorWarning, token, componentCls),
"&-error": {
...genAlertTypeStyle(colorErrorBg, colorErrorBorder, colorError, token, componentCls),
[`${componentCls}-description > pre`]: {
margin: 0,
padding: 0
}
}
} };
};
var genActionStyle = (token) => {
const { componentCls, iconCls, motionDurationMid, marginXS, fontSizeIcon, colorIcon, colorIconHover } = token;
return { [componentCls]: {
"&-actions": { marginInlineStart: marginXS },
[`${componentCls}-close-icon`]: {
marginInlineStart: marginXS,
padding: 0,
overflow: "hidden",
fontSize: fontSizeIcon,
lineHeight: unit$1(fontSizeIcon),
backgroundColor: "transparent",
border: "none",
cursor: "pointer",
...genFocusStyle(token),
[`${iconCls}-close`]: {
color: colorIcon,
transition: `color ${motionDurationMid}`,
"&:hover": { color: colorIconHover }
}
},
"&-close-text": {
color: colorIcon,
transition: `color ${motionDurationMid}`,
"&:hover": { color: colorIconHover }
}
} };
};
var prepareComponentToken$56 = (token) => {
return {
withDescriptionIconSize: token.fontSizeHeading3,
defaultPadding: `${token.paddingContentVerticalSM}px 12px`,
withDescriptionPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`
};
};
var style_default$63 = genStyleHooks("Alert", (token) => [
genBaseStyle$18(token),
genTypeStyle(token),
genActionStyle(token)
], prepareComponentToken$56);
//#endregion
//#region node_modules/antd/es/alert/Alert.js
var IconNode = (props) => {
const { icon, type, className, style, successIcon, infoIcon, warningIcon, errorIcon } = props;
const iconMapFilled = {
success: successIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$1, null),
info: infoIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$2, null),
error: errorIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$3, null),
warning: warningIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$4, null)
};
return /* @__PURE__ */ import_react.createElement("span", {
className,
style
}, icon ?? iconMapFilled[type]);
};
var CloseIconNode = (props) => {
const { isClosable, prefixCls, closeIcon, handleClose, ariaProps, className, style } = props;
const mergedCloseIcon = closeIcon === true || closeIcon === void 0 ? /* @__PURE__ */ import_react.createElement(RefIcon, null) : closeIcon;
return isClosable ? /* @__PURE__ */ import_react.createElement("button", {
type: "button",
onClick: handleClose,
className: clsx(`${prefixCls}-close-icon`, className),
tabIndex: 0,
style,
...ariaProps
}, mergedCloseIcon) : null;
};
var Alert$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { description, prefixCls: customizePrefixCls, message, title, banner, className, rootClassName, style, onMouseEnter, onMouseLeave, onClick, afterClose, showIcon, closable, closeText, closeIcon, action, id, styles, classNames, ...otherProps } = props;
const mergedTitle = title ?? message;
const [closed, setClosed] = import_react.useState(false);
{
const warning = devUseWarning("Alert");
[["closeText", "closable.closeIcon"], ["message", "title"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const internalRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({ nativeElement: internalRef.current }));
const { getPrefixCls, direction, closable: contextClosable, closeIcon: contextCloseIcon, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, successIcon, infoIcon, warningIcon, errorIcon } = useComponentConfig("alert");
const prefixCls = getPrefixCls("alert", customizePrefixCls);
const [hashId, cssVarCls] = style_default$63(prefixCls);
const { onClose: closableOnClose, afterClose: closableAfterClose } = isPlainObject(closable) ? closable : {};
const handleClose = (e) => {
setClosed(true);
(closableOnClose ?? props.onClose)?.(e);
};
const type = import_react.useMemo(() => {
if (props.type !== void 0) return props.type;
return banner ? "warning" : "info";
}, [props.type, banner]);
const isClosable = import_react.useMemo(() => {
if (isPlainObject(closable) && closable.closeIcon) return true;
if (closeText) return true;
if (typeof closable === "boolean") return closable;
if (closeIcon !== false && isNonNullable(closeIcon)) return true;
return !!contextClosable;
}, [
closeText,
closeIcon,
closable,
contextClosable
]);
const isShowIcon = banner && showIcon === void 0 ? true : showIcon;
const mergedProps = {
...props,
prefixCls,
type,
showIcon: isShowIcon,
closable: isClosable
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const alertCls = clsx(prefixCls, `${prefixCls}-${type}`, {
[`${prefixCls}-with-description`]: !!description,
[`${prefixCls}-no-icon`]: !isShowIcon,
[`${prefixCls}-banner`]: !!banner,
[`${prefixCls}-rtl`]: direction === "rtl"
}, contextClassName, className, rootClassName, mergedClassNames.root, cssVarCls, hashId);
const restProps = pickAttrs(otherProps, {
aria: true,
data: true
});
const mergedCloseIcon = import_react.useMemo(() => {
if (isPlainObject(closable) && closable.closeIcon) return closable.closeIcon;
if (closeText) return closeText;
if (closeIcon !== void 0) return closeIcon;
if (isPlainObject(contextClosable) && contextClosable.closeIcon) return contextClosable.closeIcon;
return contextCloseIcon;
}, [
closeIcon,
closable,
contextClosable,
closeText,
contextCloseIcon
]);
const mergedAriaProps = import_react.useMemo(() => {
const merged = closable ?? contextClosable;
if (isPlainObject(merged)) return pickAttrs(merged, {
data: true,
aria: true
});
return {};
}, [closable, contextClosable]);
return /* @__PURE__ */ import_react.createElement(es_default$28, {
visible: !closed,
motionName: `${prefixCls}-motion`,
motionAppear: false,
motionEnter: false,
onLeaveStart: (node) => ({ maxHeight: node.offsetHeight }),
onLeaveEnd: closableAfterClose ?? afterClose
}, ({ className: motionClassName, style: motionStyle }, setRef) => /* @__PURE__ */ import_react.createElement("div", {
id,
ref: composeRef(internalRef, setRef),
"data-show": !closed,
className: clsx(alertCls, motionClassName),
style: {
...mergedStyles.root,
...contextStyle,
...style,
...motionStyle
},
onMouseEnter,
onMouseLeave,
onClick,
role: "alert",
...restProps
}, isShowIcon ? /* @__PURE__ */ import_react.createElement(IconNode, {
className: clsx(`${prefixCls}-icon`, mergedClassNames.icon),
style: mergedStyles.icon,
description,
icon: props.icon,
prefixCls,
type,
successIcon,
infoIcon,
warningIcon,
errorIcon
}) : null, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-section`, mergedClassNames.section),
style: mergedStyles.section
}, mergedTitle ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, mergedClassNames.title),
style: mergedStyles.title
}, mergedTitle) : null, description ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-description`, mergedClassNames.description),
style: mergedStyles.description
}, description) : null), action ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-actions`, mergedClassNames.actions),
style: mergedStyles.actions
}, action) : null, /* @__PURE__ */ import_react.createElement(CloseIconNode, {
className: mergedClassNames.close,
style: mergedStyles.close,
isClosable,
prefixCls,
closeIcon: mergedCloseIcon,
handleClose,
ariaProps: mergedAriaProps
})));
});
Alert$1.displayName = "Alert";
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/callSuper.js
function _callSuper$5(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
//#endregion
//#region node_modules/antd/es/alert/ErrorBoundary.js
var ErrorBoundary = /* @__PURE__ */ function(_React$PureComponent) {
function ErrorBoundary() {
var _this;
_classCallCheck$1(this, ErrorBoundary);
_this = _callSuper$5(this, ErrorBoundary, arguments);
_this.state = {
error: void 0,
info: {}
};
return _this;
}
_inherits(ErrorBoundary, _React$PureComponent);
return _createClass$1(ErrorBoundary, [{
key: "componentDidCatch",
value: function componentDidCatch(error, info) {
this.setState({
error,
info
});
}
}, {
key: "render",
value: function render() {
const { message, title, description, id, children } = this.props;
const { error, info } = this.state;
const mergedTitle = title ?? message;
const componentStack = info?.componentStack || null;
const errorMessage = isNonNullable(mergedTitle) ? mergedTitle : error?.toString();
const errorDescription = isNonNullable(description) ? description : componentStack;
if (error) return /* @__PURE__ */ import_react.createElement(Alert$1, {
id,
type: "error",
title: errorMessage,
description: /* @__PURE__ */ import_react.createElement("pre", { style: {
fontSize: "0.9em",
overflowX: "auto"
} }, errorDescription)
});
return children;
}
}]);
}(import_react.PureComponent);
//#endregion
//#region node_modules/antd/es/alert/index.js
var Alert = Alert$1;
Alert.ErrorBoundary = ErrorBoundary;
//#endregion
//#region node_modules/compute-scroll-into-view/dist/index.js
var t = (t) => "object" == typeof t && null != t && 1 === t.nodeType, e$1 = (t, e) => (!e || "hidden" !== t) && "visible" !== t && "clip" !== t, n = (t, n) => {
if (t.clientHeight < t.scrollHeight || t.clientWidth < t.scrollWidth) {
const o = getComputedStyle(t, null);
return e$1(o.overflowY, n) || e$1(o.overflowX, n) || ((t) => {
const e = ((t) => {
if (!t.ownerDocument || !t.ownerDocument.defaultView) return null;
try {
return t.ownerDocument.defaultView.frameElement;
} catch (t) {
return null;
}
})(t);
return !!e && (e.clientHeight < t.scrollHeight || e.clientWidth < t.scrollWidth);
})(t);
}
return !1;
}, o$1 = (t, e, n, o, l, r, i, s) => r < t && i > e || r > t && i < e ? 0 : r <= t && s <= n || i >= e && s >= n ? r - t - o : i > e && s < n || r < t && s > n ? i - e + l : 0, l = (t) => {
const e = t.parentElement;
return null == e ? t.getRootNode().host || null : e;
}, r = (e, r) => {
var i, s, d, h;
if ("undefined" == typeof document) return [];
const { scrollMode: c, block: f, inline: u, boundary: a, skipOverflowHiddenElements: g } = r, p = "function" == typeof a ? a : (t) => t !== a;
if (!t(e)) throw new TypeError("Invalid target");
const m = document.scrollingElement || document.documentElement, w = [];
let W = e;
for (; t(W) && p(W);) {
if (W = l(W), W === m) {
w.push(W);
break;
}
null != W && W === document.body && n(W) && !n(document.documentElement) || null != W && n(W, g) && w.push(W);
}
const b = null != (s = null == (i = window.visualViewport) ? void 0 : i.width) ? s : innerWidth, H = null != (h = null == (d = window.visualViewport) ? void 0 : d.height) ? h : innerHeight, { scrollX: y, scrollY: M } = window, { height: v, width: E, top: x, right: C, bottom: I, left: R } = e.getBoundingClientRect(), { top: T, right: B, bottom: F, left: V } = ((t) => {
const e = window.getComputedStyle(t);
return {
top: parseFloat(e.scrollMarginTop) || 0,
right: parseFloat(e.scrollMarginRight) || 0,
bottom: parseFloat(e.scrollMarginBottom) || 0,
left: parseFloat(e.scrollMarginLeft) || 0
};
})(e);
let k = "start" === f || "nearest" === f ? x - T : "end" === f ? I + F : x + v / 2 - T + F, D = "center" === u ? R + E / 2 - V + B : "end" === u ? C + B : R - V;
const L = [];
for (let t = 0; t < w.length; t++) {
const e = w[t], { height: l, width: r, top: i, right: s, bottom: d, left: h } = e.getBoundingClientRect();
if ("if-needed" === c && x >= 0 && R >= 0 && I <= H && C <= b && (e === m && !n(e) || x >= i && I <= d && R >= h && C <= s)) return L;
const a = getComputedStyle(e), g = parseInt(a.borderLeftWidth, 10), p = parseInt(a.borderTopWidth, 10), W = parseInt(a.borderRightWidth, 10), T = parseInt(a.borderBottomWidth, 10);
let B = 0, F = 0;
const V = "offsetWidth" in e ? e.offsetWidth - e.clientWidth - g - W : 0, S = "offsetHeight" in e ? e.offsetHeight - e.clientHeight - p - T : 0, X = "offsetWidth" in e ? 0 === e.offsetWidth ? 0 : r / e.offsetWidth : 0, Y = "offsetHeight" in e ? 0 === e.offsetHeight ? 0 : l / e.offsetHeight : 0;
if (m === e) B = "start" === f ? k : "end" === f ? k - H : "nearest" === f ? o$1(M, M + H, H, p, T, M + k, M + k + v, v) : k - H / 2, F = "start" === u ? D : "center" === u ? D - b / 2 : "end" === u ? D - b : o$1(y, y + b, b, g, W, y + D, y + D + E, E), B = Math.max(0, B + M), F = Math.max(0, F + y);
else {
B = "start" === f ? k - i - p : "end" === f ? k - d + T + S : "nearest" === f ? o$1(i, d, l, p, T + S, k, k + v, v) : k - (i + l / 2) + S / 2, F = "start" === u ? D - h - g : "center" === u ? D - (h + r / 2) + V / 2 : "end" === u ? D - s + W + V : o$1(h, s, r, g, W + V, D, D + E, E);
const { scrollLeft: t, scrollTop: n } = e;
B = 0 === Y ? 0 : Math.max(0, Math.min(n + B / Y, e.scrollHeight - l / Y + S)), F = 0 === X ? 0 : Math.max(0, Math.min(t + F / X, e.scrollWidth - r / X + V)), k += n - B, D += t - F;
}
L.push({
el: e,
top: B,
left: F
});
}
return L;
};
//#endregion
//#region node_modules/scroll-into-view-if-needed/dist/index.js
var o = (t) => !1 === t ? {
block: "end",
inline: "nearest"
} : ((t) => t === Object(t) && 0 !== Object.keys(t).length)(t) ? t : {
block: "start",
inline: "nearest"
};
function e(e, r$1) {
if (!e.isConnected || !((t) => {
let o = t;
for (; o && o.parentNode;) {
if (o.parentNode === document) return !0;
o = o.parentNode instanceof ShadowRoot ? o.parentNode.host : o.parentNode;
}
return !1;
})(e)) return;
const n = ((t) => {
const o = window.getComputedStyle(t);
return {
top: parseFloat(o.scrollMarginTop) || 0,
right: parseFloat(o.scrollMarginRight) || 0,
bottom: parseFloat(o.scrollMarginBottom) || 0,
left: parseFloat(o.scrollMarginLeft) || 0
};
})(e);
if (((t) => "object" == typeof t && "function" == typeof t.behavior)(r$1)) return r$1.behavior(r(e, r$1));
const l = "boolean" == typeof r$1 || null == r$1 ? void 0 : r$1.behavior;
for (const { el: a, top: i, left: s } of r(e, o(r$1))) {
const t = i - n.top + n.bottom, o = s - n.left + n.right;
a.scroll({
top: t,
left: o,
behavior: l
});
}
}
//#endregion
//#region node_modules/antd/es/_util/getScroll.js
var isWindow = (obj) => {
return isNonNullable(obj) && obj === obj.window;
};
var getScroll$2 = (target) => {
if (typeof window === "undefined")
/* istanbul ignore next */
return 0;
let result = 0;
if (isWindow(target)) result = target.pageYOffset;
else if (target instanceof Document) result = target.documentElement.scrollTop;
else if (target instanceof HTMLElement) result = target.scrollTop;
else if (target) result = target["scrollTop"];
if (target && !isWindow(target) && typeof result !== "number") result = (target.ownerDocument ?? target).documentElement?.scrollTop;
return result;
};
//#endregion
//#region node_modules/antd/es/_util/easings.js
function easeInOutCubic(t, b, c, d) {
const cc = c - b;
t /= d / 2;
if (t < 1) return cc / 2 * t * t * t + b;
return cc / 2 * ((t -= 2) * t * t + 2) + b;
}
//#endregion
//#region node_modules/antd/es/_util/scrollTo.js
function scrollTo(y, options = {}) {
const { getContainer = () => window, callback, duration = 450 } = options;
const container = getContainer();
const scrollTop = getScroll$2(container);
const startTime = Date.now();
let rafId;
const frameFunc = () => {
const time = Date.now() - startTime;
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
if (isWindow(container)) container.scrollTo(window.pageXOffset, nextScrollTop);
else if (container instanceof Document || container.constructor.name === "HTMLDocument") container.documentElement.scrollTop = nextScrollTop;
else container.scrollTop = nextScrollTop;
if (time < duration) rafId = wrapperRaf(frameFunc);
else if (typeof callback === "function") callback();
};
rafId = wrapperRaf(frameFunc);
return () => {
wrapperRaf.cancel(rafId);
};
}
//#endregion
//#region node_modules/antd/es/config-provider/hooks/useCSSVarCls.js
/**
* This hook is only for cssVar to add root className for components.
* If root ClassName is needed, this hook could be refactored with `-root`
* @param prefixCls
*/
var useCSSVarCls = (prefixCls) => `${prefixCls}-css-var`;
//#endregion
//#region node_modules/antd/es/form/validateMessagesContext.js
var validateMessagesContext_default = /* @__PURE__ */ (0, import_react.createContext)(void 0);
//#endregion
//#region node_modules/@rc-component/portal/es/Context.js
var OrderContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/portal/es/mock.js
var inline = false;
function inlineMock(nextInline) {
if (typeof nextInline === "boolean") inline = nextInline;
return inline;
}
//#endregion
//#region node_modules/@rc-component/portal/es/useDom.js
var EMPTY_LIST$5 = [];
/**
* Will add `div` to document. Nest call will keep order
* @param render Render DOM in document
*/
function useDom(render, debug) {
const [ele] = import_react.useState(() => {
if (!canUseDom()) return null;
const defaultEle = document.createElement("div");
if (debug) defaultEle.setAttribute("data-debug", debug);
return defaultEle;
});
const appendedRef = import_react.useRef(false);
const queueCreate = import_react.useContext(OrderContext);
const [queue, setQueue] = import_react.useState(EMPTY_LIST$5);
const mergedQueueCreate = queueCreate || (appendedRef.current ? void 0 : (appendFn) => {
setQueue((origin) => {
return [appendFn, ...origin];
});
});
function append() {
if (!ele.parentElement) document.body.appendChild(ele);
appendedRef.current = true;
}
function cleanup() {
ele.parentElement?.removeChild(ele);
appendedRef.current = false;
}
useLayoutEffect$1(() => {
if (render) if (queueCreate) queueCreate(append);
else append();
else cleanup();
return cleanup;
}, [render]);
useLayoutEffect$1(() => {
if (queue.length) {
queue.forEach((appendFn) => appendFn());
setQueue(EMPTY_LIST$5);
}
}, [queue]);
return [ele, mergedQueueCreate];
}
//#endregion
//#region node_modules/@rc-component/util/es/getScrollBarSize.js
var cached$1;
function measureScrollbarSize(ele) {
const randomId = `rc-scrollbar-measure-${Math.random().toString(36).substring(7)}`;
const measureEle = document.createElement("div");
measureEle.id = randomId;
const measureStyle = measureEle.style;
measureStyle.position = "absolute";
measureStyle.left = "0";
measureStyle.top = "0";
measureStyle.width = "100px";
measureStyle.height = "100px";
measureStyle.overflow = "scroll";
let fallbackWidth;
let fallbackHeight;
if (ele) {
const targetStyle = getComputedStyle(ele);
measureStyle.scrollbarColor = targetStyle.scrollbarColor;
measureStyle.scrollbarWidth = targetStyle.scrollbarWidth;
const webkitScrollbarStyle = getComputedStyle(ele, "::-webkit-scrollbar");
const width = parseInt(webkitScrollbarStyle.width, 10);
const height = parseInt(webkitScrollbarStyle.height, 10);
try {
updateCSS(`
#${randomId}::-webkit-scrollbar {
${width ? `width: ${webkitScrollbarStyle.width};` : ""}
${height ? `height: ${webkitScrollbarStyle.height};` : ""}
}`, randomId);
} catch (e) {
console.error(e);
fallbackWidth = width;
fallbackHeight = height;
}
}
document.body.appendChild(measureEle);
const scrollWidth = ele && fallbackWidth && !Number.isNaN(fallbackWidth) ? fallbackWidth : measureEle.offsetWidth - measureEle.clientWidth;
const scrollHeight = ele && fallbackHeight && !Number.isNaN(fallbackHeight) ? fallbackHeight : measureEle.offsetHeight - measureEle.clientHeight;
document.body.removeChild(measureEle);
removeCSS(randomId);
return {
width: scrollWidth,
height: scrollHeight
};
}
function getScrollBarSize(fresh) {
if (typeof document === "undefined") return 0;
if (fresh || cached$1 === void 0) cached$1 = measureScrollbarSize();
return cached$1.width;
}
function getTargetScrollBarSize(target) {
if (typeof document === "undefined" || !target || !(target instanceof Element)) return {
width: 0,
height: 0
};
return measureScrollbarSize(target);
}
//#endregion
//#region node_modules/@rc-component/portal/es/util.js
/**
* Test usage export. Do not use in your production
*/
function isBodyOverflowing() {
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
}
//#endregion
//#region node_modules/@rc-component/portal/es/useScrollLocker.js
var UNIQUE_ID = `rc-util-locker-${Date.now()}`;
var uuid$3 = 0;
function useScrollLocker(lock) {
const mergedLock = !!lock;
const [id] = import_react.useState(() => {
uuid$3 += 1;
return `${UNIQUE_ID}_${uuid$3}`;
});
useLayoutEffect$1(() => {
if (mergedLock) {
const scrollbarSize = getTargetScrollBarSize(document.body).width;
updateCSS(`
html body {
overflow-y: hidden;
${isBodyOverflowing() ? `width: calc(100% - ${scrollbarSize}px);` : ""}
}`, id);
} else removeCSS(id);
return () => {
removeCSS(id);
};
}, [mergedLock, id]);
}
//#endregion
//#region node_modules/@rc-component/util/es/hooks/useId.js
function getUseId() {
return { ...import_react }.useId;
}
var uuid$2 = 0;
/**
* Generate a valid HTML id from prefix and key.
* Sanitizes the key by replacing invalid characters with hyphens.
* @param prefix - The prefix for the id
* @param key - The key from React element, may contain spaces or invalid characters
* @returns A valid HTML id string
*/
function getId(prefix, key) {
return `${prefix}-${String(key).replace(/[^a-zA-Z0-9_.:-]/g, "-")}`;
}
var useOriginId = getUseId();
var useId_default = useOriginId ? function useId(id) {
const reactId = useOriginId();
if (id) return id;
return reactId;
} : function useCompatId(id) {
const [innerId, setInnerId] = import_react.useState("ssr-id");
import_react.useEffect(() => {
const nextId = uuid$2;
uuid$2 += 1;
setInnerId(`rc_unique_${nextId}`);
}, []);
if (id) return id;
return innerId;
};
//#endregion
//#region node_modules/@rc-component/portal/es/useEscKeyDown.js
var stack = [];
var IME_LOCK_DURATION = 200;
var lastCompositionEndTime = 0;
var onGlobalKeyDown = (event) => {
if (event.key === "Escape" && !event.isComposing) {
if (Date.now() - lastCompositionEndTime < IME_LOCK_DURATION) return;
const len = stack.length;
for (let i = len - 1; i >= 0; i -= 1) stack[i].onEsc({
top: i === len - 1,
event
});
}
};
var onGlobalCompositionEnd = () => {
lastCompositionEndTime = Date.now();
};
function attachGlobalEventListeners() {
window.addEventListener("keydown", onGlobalKeyDown);
window.addEventListener("compositionend", onGlobalCompositionEnd);
}
function detachGlobalEventListeners() {
if (stack.length === 0) {
window.removeEventListener("keydown", onGlobalKeyDown);
window.removeEventListener("compositionend", onGlobalCompositionEnd);
}
}
function useEscKeyDown(open, onEsc) {
const id = useId_default();
const onEventEsc = useEvent(onEsc);
const ensure = () => {
if (!stack.find((item) => item.id === id)) stack.push({
id,
onEsc: onEventEsc
});
};
const clear = () => {
stack = stack.filter((item) => item.id !== id);
};
(0, import_react.useMemo)(() => {
if (open) ensure();
else if (!open) clear();
}, [open]);
(0, import_react.useEffect)(() => {
if (open) {
ensure();
attachGlobalEventListeners();
return () => {
clear();
detachGlobalEventListeners();
};
}
}, [open]);
}
//#endregion
//#region node_modules/@rc-component/portal/es/Portal.js
var getPortalContainer = (getContainer) => {
if (getContainer === false) return false;
if (!canUseDom() || !getContainer) return null;
if (typeof getContainer === "string") return document.querySelector(getContainer);
if (typeof getContainer === "function") return getContainer();
return getContainer;
};
var Portal = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { open, autoLock, getContainer, debug, autoDestroy = true, children, onEsc } = props;
const [shouldRender, setShouldRender] = import_react.useState(open);
const mergedRender = shouldRender || open;
warningOnce(canUseDom() || !open, `Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR.`);
import_react.useEffect(() => {
if (autoDestroy || open) setShouldRender(open);
}, [open, autoDestroy]);
const [innerContainer, setInnerContainer] = import_react.useState(() => getPortalContainer(getContainer));
import_react.useEffect(() => {
const customizeContainer = getPortalContainer(getContainer);
setInnerContainer(() => customizeContainer ?? null);
});
const [defaultContainer, queueCreate] = useDom(mergedRender && !innerContainer, debug);
const mergedContainer = innerContainer ?? defaultContainer;
useScrollLocker(autoLock && open && canUseDom() && (mergedContainer === defaultContainer || mergedContainer === document.body));
useEscKeyDown(open, onEsc);
let childRef = null;
if (children && supportRef(children) && ref) childRef = getNodeRef(children);
const mergedRef = useComposeRef(childRef, ref);
if (!mergedRender || !canUseDom() || innerContainer === void 0) return null;
const renderInline = mergedContainer === false || inlineMock();
let reffedChildren = children;
if (ref) reffedChildren = /* @__PURE__ */ import_react.cloneElement(children, { ref: mergedRef });
return /* @__PURE__ */ import_react.createElement(OrderContext.Provider, { value: queueCreate }, renderInline ? reffedChildren : /* @__PURE__ */ (0, import_react_dom.createPortal)(reffedChildren, mergedContainer));
});
Portal.displayName = "Portal";
//#endregion
//#region node_modules/@rc-component/portal/es/index.js
var es_default$27 = Portal;
//#endregion
//#region node_modules/@rc-component/trigger/es/Popup/Arrow.js
function Arrow(props) {
const { prefixCls, align, arrow, arrowPos } = props;
const { className, content, style } = arrow || {};
const { x = 0, y = 0 } = arrowPos;
const arrowRef = import_react.useRef(null);
if (!align || !align.points) return null;
const alignStyle = { position: "absolute" };
if (align.autoArrow !== false) {
const popupPoints = align.points[0];
const targetPoints = align.points[1];
const popupTB = popupPoints[0];
const popupLR = popupPoints[1];
const targetTB = targetPoints[0];
const targetLR = targetPoints[1];
if (popupTB === targetTB || !["t", "b"].includes(popupTB)) alignStyle.top = y;
else if (popupTB === "t") alignStyle.top = 0;
else alignStyle.bottom = 0;
if (popupLR === targetLR || !["l", "r"].includes(popupLR)) alignStyle.left = x;
else if (popupLR === "l") alignStyle.left = 0;
else alignStyle.right = 0;
}
return /* @__PURE__ */ import_react.createElement("div", {
ref: arrowRef,
className: clsx(`${prefixCls}-arrow`, className),
style: {
...alignStyle,
...style
}
}, content);
}
//#endregion
//#region node_modules/@rc-component/trigger/es/Popup/Mask.js
function _extends$97() {
_extends$97 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$97.apply(this, arguments);
}
function Mask$2(props) {
const { prefixCls, open, zIndex, mask, motion, mobile } = props;
if (!mask) return null;
return /* @__PURE__ */ import_react.createElement(es_default$28, _extends$97({}, motion, {
motionAppear: true,
visible: open,
removeOnLeave: true
}), ({ className }) => /* @__PURE__ */ import_react.createElement("div", {
style: { zIndex },
className: clsx(`${prefixCls}-mask`, mobile && `${prefixCls}-mobile-mask`, className)
}));
}
//#endregion
//#region node_modules/@rc-component/trigger/es/Popup/PopupContent.js
var PopupContent = /* @__PURE__ */ import_react.memo(({ children }) => children, (_, next) => next.cache);
PopupContent.displayName = "PopupContent";
//#endregion
//#region node_modules/@rc-component/trigger/es/hooks/useOffsetStyle.js
function useOffsetStyle(isMobile, ready, open, align, offsetR, offsetB, offsetX, offsetY) {
const AUTO = "auto";
const offsetStyle = isMobile ? {} : {
left: "-1000vw",
top: "-1000vh",
right: AUTO,
bottom: AUTO
};
if (!isMobile && (ready || !open)) {
const { points } = align;
const dynamicInset = align.dynamicInset || align._experimental?.dynamicInset;
const alignRight = dynamicInset && points[0][1] === "r";
const alignBottom = dynamicInset && points[0][0] === "b";
if (alignRight) {
offsetStyle.right = offsetR;
offsetStyle.left = AUTO;
} else {
offsetStyle.left = offsetX;
offsetStyle.right = AUTO;
}
if (alignBottom) {
offsetStyle.bottom = offsetB;
offsetStyle.top = AUTO;
} else {
offsetStyle.top = offsetY;
offsetStyle.bottom = AUTO;
}
}
return offsetStyle;
}
//#endregion
//#region node_modules/@rc-component/trigger/es/Popup/index.js
function _extends$96() {
_extends$96 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$96.apply(this, arguments);
}
var Popup$2 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { onEsc, popup, className, prefixCls, style, target, onVisibleChanged, open, keepDom, fresh, onClick, mask, arrow, arrowPos, align, motion, maskMotion, mobile, forceRender, getPopupContainer, autoDestroy, portal: Portal, children, zIndex, onMouseEnter, onMouseLeave, onPointerEnter, onPointerDownCapture, ready, offsetX, offsetY, offsetR, offsetB, onAlign, onPrepare, onResize, stretch, targetWidth, targetHeight } = props;
const popupContent = typeof popup === "function" ? popup() : popup;
const isNodeVisible = open || keepDom;
const isMobile = !!mobile;
const [mergedMask, mergedMaskMotion, mergedPopupMotion] = import_react.useMemo(() => {
if (mobile) return [
mobile.mask,
mobile.maskMotion,
mobile.motion
];
return [
mask,
maskMotion,
motion
];
}, [
mobile,
mask,
maskMotion,
motion
]);
const getPopupContainerNeedParams = getPopupContainer?.length > 0;
const [show, setShow] = import_react.useState(!getPopupContainer || !getPopupContainerNeedParams);
useLayoutEffect$1(() => {
if (!show && getPopupContainerNeedParams && target) setShow(true);
}, [
show,
getPopupContainerNeedParams,
target
]);
const onInternalResize = useEvent((size, ele) => {
onResize?.(size, ele);
onAlign();
});
const offsetStyle = useOffsetStyle(isMobile, ready, open, align, offsetR, offsetB, offsetX, offsetY);
if (!show) return null;
const miscStyle = {};
if (stretch) {
if (stretch.includes("height") && targetHeight) miscStyle.height = targetHeight;
else if (stretch.includes("minHeight") && targetHeight) miscStyle.minHeight = targetHeight;
if (stretch.includes("width") && targetWidth) miscStyle.width = targetWidth;
else if (stretch.includes("minWidth") && targetWidth) miscStyle.minWidth = targetWidth;
}
if (!open) miscStyle.pointerEvents = "none";
return /* @__PURE__ */ import_react.createElement(Portal, {
open: forceRender || isNodeVisible,
getContainer: getPopupContainer && (() => getPopupContainer(target)),
autoDestroy,
onEsc
}, /* @__PURE__ */ import_react.createElement(Mask$2, {
prefixCls,
open,
zIndex,
mask: mergedMask,
motion: mergedMaskMotion,
mobile: isMobile
}), /* @__PURE__ */ import_react.createElement(RefResizeObserver, {
onResize: onInternalResize,
disabled: !open
}, (resizeObserverRef) => {
return /* @__PURE__ */ import_react.createElement(es_default$28, _extends$96({
motionAppear: true,
motionEnter: true,
motionLeave: true,
removeOnLeave: false,
forceRender,
leavedClassName: `${prefixCls}-hidden`
}, mergedPopupMotion, {
onAppearPrepare: onPrepare,
onEnterPrepare: onPrepare,
visible: open,
onVisibleChanged: (nextVisible) => {
motion?.onVisibleChanged?.(nextVisible);
onVisibleChanged(nextVisible);
}
}), ({ className: motionClassName, style: motionStyle }, motionRef) => {
const cls = clsx(prefixCls, motionClassName, className, { [`${prefixCls}-mobile`]: isMobile });
return /* @__PURE__ */ import_react.createElement("div", {
ref: composeRef(resizeObserverRef, ref, motionRef),
className: cls,
style: {
"--arrow-x": `${arrowPos.x || 0}px`,
"--arrow-y": `${arrowPos.y || 0}px`,
...offsetStyle,
...miscStyle,
...motionStyle,
boxSizing: "border-box",
zIndex,
...style
},
onMouseEnter,
onMouseLeave,
onPointerEnter,
onClick,
onPointerDownCapture
}, arrow && /* @__PURE__ */ import_react.createElement(Arrow, {
prefixCls,
arrow,
arrowPos,
align
}), /* @__PURE__ */ import_react.createElement(PopupContent, { cache: !open && !fresh }, popupContent));
});
}), children);
});
Popup$2.displayName = "Popup";
//#endregion
//#region node_modules/@rc-component/trigger/es/context.js
var TriggerContext = /* @__PURE__ */ import_react.createContext(null);
var UniqueContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/trigger/es/hooks/useAction.js
function toArray$7(val) {
return val ? Array.isArray(val) ? val : [val] : [];
}
function useAction(action, showAction, hideAction) {
return import_react.useMemo(() => {
const mergedShowAction = toArray$7(showAction ?? action);
const mergedHideAction = toArray$7(hideAction ?? action);
const showActionSet = new Set(mergedShowAction);
const hideActionSet = new Set(mergedHideAction);
if (showActionSet.has("hover") && !showActionSet.has("click")) showActionSet.add("touch");
if (hideActionSet.has("hover") && !hideActionSet.has("click")) hideActionSet.add("touch");
return [showActionSet, hideActionSet];
}, [
action,
showAction,
hideAction
]);
}
//#endregion
//#region node_modules/@rc-component/util/es/Dom/isVisible.js
var isVisible_default = ((element) => {
if (!element) return false;
if (element instanceof Element) {
if (element.offsetParent) return true;
if (element.getBBox) {
const { width, height } = element.getBBox();
if (width || height) return true;
}
if (element.getBoundingClientRect) {
const { width, height } = element.getBoundingClientRect();
if (width || height) return true;
}
}
return false;
});
//#endregion
//#region node_modules/@rc-component/trigger/es/util.js
function isPointsEq(a1 = [], a2 = [], isAlignPoint) {
const getVal = (a, index) => a[index] || "";
if (isAlignPoint) return getVal(a1, 0) === getVal(a2, 0);
return getVal(a1, 0) === getVal(a2, 0) && getVal(a1, 1) === getVal(a2, 1);
}
function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
const { points } = align;
const placements = Object.keys(builtinPlacements);
for (let i = 0; i < placements.length; i += 1) {
const placement = placements[i];
if (isPointsEq(builtinPlacements[placement]?.points, points, isAlignPoint)) return `${prefixCls}-placement-${placement}`;
}
return "";
}
function getWin(ele) {
return ele.ownerDocument.defaultView;
}
/**
* Get all the scrollable parent elements of the element
* @param ele The element to be detected
* @param areaOnly Only return the parent which will cut visible area
*/
function collectScroller(ele) {
const scrollerList = [];
let current = ele?.parentElement;
const scrollStyle = [
"hidden",
"scroll",
"clip",
"auto"
];
while (current) {
const { overflowX, overflowY, overflow } = getWin(current).getComputedStyle(current);
if ([
overflowX,
overflowY,
overflow
].some((o) => scrollStyle.includes(o))) scrollerList.push(current);
current = current.parentElement;
}
return scrollerList;
}
function toNum(num, defaultValue = 1) {
return Number.isNaN(num) ? defaultValue : num;
}
function getPxValue(val) {
return toNum(parseFloat(val), 0);
}
/**
*
*
* **************************************
* * Border *
* * ************************** *
* * * * * *
* * B * * S * B *
* * o * * c * o *
* * r * Content * r * r *
* * d * * o * d *
* * e * * l * e *
* * r ******************** l * r *
* * * Scroll * *
* * ************************** *
* * Border *
* **************************************
*
*/
/**
* Get visible area of element
*/
function getVisibleArea(initArea, scrollerList) {
const visibleArea = { ...initArea };
(scrollerList || []).forEach((ele) => {
if (ele instanceof HTMLBodyElement || ele instanceof HTMLHtmlElement) return;
const { overflow, overflowClipMargin, borderTopWidth, borderBottomWidth, borderLeftWidth, borderRightWidth } = getWin(ele).getComputedStyle(ele);
const eleRect = ele.getBoundingClientRect();
const { offsetHeight: eleOutHeight, clientHeight: eleInnerHeight, offsetWidth: eleOutWidth, clientWidth: eleInnerWidth } = ele;
const borderTopNum = getPxValue(borderTopWidth);
const borderBottomNum = getPxValue(borderBottomWidth);
const borderLeftNum = getPxValue(borderLeftWidth);
const borderRightNum = getPxValue(borderRightWidth);
const scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1e3) / 1e3);
const scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1e3) / 1e3);
const eleScrollWidth = (eleOutWidth - eleInnerWidth - borderLeftNum - borderRightNum) * scaleX;
const eleScrollHeight = (eleOutHeight - eleInnerHeight - borderTopNum - borderBottomNum) * scaleY;
const scaledBorderTopWidth = borderTopNum * scaleY;
const scaledBorderBottomWidth = borderBottomNum * scaleY;
const scaledBorderLeftWidth = borderLeftNum * scaleX;
const scaledBorderRightWidth = borderRightNum * scaleX;
let clipMarginWidth = 0;
let clipMarginHeight = 0;
if (overflow === "clip") {
const clipNum = getPxValue(overflowClipMargin);
clipMarginWidth = clipNum * scaleX;
clipMarginHeight = clipNum * scaleY;
}
const eleLeft = eleRect.x + scaledBorderLeftWidth - clipMarginWidth;
const eleTop = eleRect.y + scaledBorderTopWidth - clipMarginHeight;
const eleRight = eleLeft + eleRect.width + 2 * clipMarginWidth - scaledBorderLeftWidth - scaledBorderRightWidth - eleScrollWidth;
const eleBottom = eleTop + eleRect.height + 2 * clipMarginHeight - scaledBorderTopWidth - scaledBorderBottomWidth - eleScrollHeight;
visibleArea.left = Math.max(visibleArea.left, eleLeft);
visibleArea.top = Math.max(visibleArea.top, eleTop);
visibleArea.right = Math.min(visibleArea.right, eleRight);
visibleArea.bottom = Math.min(visibleArea.bottom, eleBottom);
});
return visibleArea;
}
//#endregion
//#region node_modules/@rc-component/trigger/es/hooks/useAlign.js
function getUnitOffset(size, offset = 0) {
const offsetStr = `${offset}`;
const cells = offsetStr.match(/^(.*)\%$/);
if (cells) return size * (parseFloat(cells[1]) / 100);
return parseFloat(offsetStr);
}
function getNumberOffset(rect, offset) {
const [offsetX, offsetY] = offset || [];
return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
}
function splitPoints(points = "") {
return [points[0], points[1]];
}
function getAlignPoint(rect, points) {
const topBottom = points[0];
const leftRight = points[1];
let x;
let y;
if (topBottom === "t") y = rect.y;
else if (topBottom === "b") y = rect.y + rect.height;
else y = rect.y + rect.height / 2;
if (leftRight === "l") x = rect.x;
else if (leftRight === "r") x = rect.x + rect.width;
else x = rect.x + rect.width / 2;
return {
x,
y
};
}
function reversePoints(points, index) {
const reverseMap = {
t: "b",
b: "t",
l: "r",
r: "l"
};
const clone = [...points];
clone[index] = reverseMap[points[index]] || "c";
return clone;
}
function flatPoints(points) {
return points.join("");
}
function useAlign(open, popupEle, target, placement, builtinPlacements, popupAlign, onPopupAlign, mobile) {
const [offsetInfo, setOffsetInfo] = import_react.useState({
ready: false,
offsetX: 0,
offsetY: 0,
offsetR: 0,
offsetB: 0,
arrowX: 0,
arrowY: 0,
scaleX: 1,
scaleY: 1,
align: builtinPlacements[placement] || {}
});
const alignCountRef = import_react.useRef(0);
const scrollerList = import_react.useMemo(() => {
if (!popupEle || mobile) return [];
return collectScroller(popupEle);
}, [popupEle]);
const prevFlipRef = import_react.useRef({});
const resetFlipCache = () => {
prevFlipRef.current = {};
};
if (!open) resetFlipCache();
const onAlign = useEvent(() => {
if (popupEle && target && open && !mobile) {
const popupElement = popupEle;
const doc = popupElement.ownerDocument;
const win = getWin(popupElement);
const { position: popupPosition } = win.getComputedStyle(popupElement);
const originLeft = popupElement.style.left;
const originTop = popupElement.style.top;
const originRight = popupElement.style.right;
const originBottom = popupElement.style.bottom;
const originOverflow = popupElement.style.overflow;
const placementInfo = {
...builtinPlacements[placement],
...popupAlign
};
const placeholderElement = doc.createElement("div");
popupElement.parentElement?.appendChild(placeholderElement);
placeholderElement.style.left = `${popupElement.offsetLeft}px`;
placeholderElement.style.top = `${popupElement.offsetTop}px`;
placeholderElement.style.position = popupPosition;
placeholderElement.style.height = `${popupElement.offsetHeight}px`;
placeholderElement.style.width = `${popupElement.offsetWidth}px`;
popupElement.style.left = "0";
popupElement.style.top = "0";
popupElement.style.right = "auto";
popupElement.style.bottom = "auto";
popupElement.style.overflow = "hidden";
let targetRect;
if (Array.isArray(target)) targetRect = {
x: target[0],
y: target[1],
width: 0,
height: 0
};
else {
const rect = target.getBoundingClientRect();
rect.x = rect.x ?? rect.left;
rect.y = rect.y ?? rect.top;
targetRect = {
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height
};
}
const popupRect = popupElement.getBoundingClientRect();
const { height, width } = win.getComputedStyle(popupElement);
popupRect.x = popupRect.x ?? popupRect.left;
popupRect.y = popupRect.y ?? popupRect.top;
const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollTop, scrollLeft } = doc.documentElement;
const popupHeight = popupRect.height;
const popupWidth = popupRect.width;
const targetHeight = targetRect.height;
const targetWidth = targetRect.width;
const visibleRegion = {
left: 0,
top: 0,
right: clientWidth,
bottom: clientHeight
};
const scrollRegion = {
left: -scrollLeft,
top: -scrollTop,
right: scrollWidth - scrollLeft,
bottom: scrollHeight - scrollTop
};
let { htmlRegion } = placementInfo;
const VISIBLE = "visible";
const VISIBLE_FIRST = "visibleFirst";
if (htmlRegion !== "scroll" && htmlRegion !== VISIBLE_FIRST) htmlRegion = VISIBLE;
const isVisibleFirst = htmlRegion === VISIBLE_FIRST;
const scrollRegionArea = getVisibleArea(scrollRegion, scrollerList);
const visibleRegionArea = getVisibleArea(visibleRegion, scrollerList);
const visibleArea = htmlRegion === VISIBLE ? visibleRegionArea : scrollRegionArea;
const adjustCheckVisibleArea = isVisibleFirst ? visibleRegionArea : visibleArea;
popupElement.style.left = "auto";
popupElement.style.top = "auto";
popupElement.style.right = "0";
popupElement.style.bottom = "0";
const popupMirrorRect = popupElement.getBoundingClientRect();
popupElement.style.left = originLeft;
popupElement.style.top = originTop;
popupElement.style.right = originRight;
popupElement.style.bottom = originBottom;
popupElement.style.overflow = originOverflow;
popupElement.parentElement?.removeChild(placeholderElement);
const scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1e3) / 1e3);
const scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1e3) / 1e3);
if (scaleX === 0 || scaleY === 0 || isDOM(target) && !isVisible_default(target)) return;
const { offset, targetOffset } = placementInfo;
let [popupOffsetX, popupOffsetY] = getNumberOffset(popupRect, offset);
const [targetOffsetX, targetOffsetY] = getNumberOffset(targetRect, targetOffset);
targetRect.x -= targetOffsetX;
targetRect.y -= targetOffsetY;
const [popupPoint, targetPoint] = placementInfo.points || [];
const targetPoints = splitPoints(targetPoint);
const popupPoints = splitPoints(popupPoint);
const targetAlignPoint = getAlignPoint(targetRect, targetPoints);
const popupAlignPoint = getAlignPoint(popupRect, popupPoints);
const nextAlignInfo = { ...placementInfo };
let nextPoints = [popupPoints, targetPoints];
let nextOffsetX = targetAlignPoint.x - popupAlignPoint.x + popupOffsetX;
let nextOffsetY = targetAlignPoint.y - popupAlignPoint.y + popupOffsetY;
function getIntersectionVisibleArea(offsetX, offsetY, area = visibleArea) {
const l = popupRect.x + offsetX;
const t = popupRect.y + offsetY;
const r = l + popupWidth;
const b = t + popupHeight;
const visibleL = Math.max(l, area.left);
const visibleT = Math.max(t, area.top);
const visibleR = Math.min(r, area.right);
const visibleB = Math.min(b, area.bottom);
return Math.max(0, (visibleR - visibleL) * (visibleB - visibleT));
}
const originIntersectionVisibleArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY);
const originIntersectionRecommendArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY, visibleRegionArea);
const targetAlignPointTL = getAlignPoint(targetRect, ["t", "l"]);
const popupAlignPointTL = getAlignPoint(popupRect, ["t", "l"]);
const targetAlignPointBR = getAlignPoint(targetRect, ["b", "r"]);
const popupAlignPointBR = getAlignPoint(popupRect, ["b", "r"]);
const { adjustX, adjustY, shiftX, shiftY } = placementInfo.overflow || {};
const supportAdjust = (val) => {
if (typeof val === "boolean") return val;
return val >= 0;
};
let nextPopupY;
let nextPopupBottom;
let nextPopupX;
let nextPopupRight;
function syncNextPopupPosition() {
nextPopupY = popupRect.y + nextOffsetY;
nextPopupBottom = nextPopupY + popupHeight;
nextPopupX = popupRect.x + nextOffsetX;
nextPopupRight = nextPopupX + popupWidth;
}
syncNextPopupPosition();
const needAdjustY = supportAdjust(adjustY);
const sameTB = popupPoints[0] === targetPoints[0];
if (needAdjustY && popupPoints[0] === "t" && (nextPopupBottom > adjustCheckVisibleArea.bottom || prevFlipRef.current.bt)) {
let tmpNextOffsetY = nextOffsetY;
if (sameTB) tmpNextOffsetY -= popupHeight - targetHeight;
else tmpNextOffsetY = targetAlignPointTL.y - popupAlignPointBR.y - popupOffsetY;
const newVisibleArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY);
const newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY, visibleRegionArea);
if (newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst || newVisibleRecommendArea >= originIntersectionRecommendArea)) {
prevFlipRef.current.bt = true;
nextOffsetY = tmpNextOffsetY;
popupOffsetY = -popupOffsetY;
nextPoints = [reversePoints(nextPoints[0], 0), reversePoints(nextPoints[1], 0)];
} else prevFlipRef.current.bt = false;
}
if (needAdjustY && popupPoints[0] === "b" && (nextPopupY < adjustCheckVisibleArea.top || prevFlipRef.current.tb)) {
let tmpNextOffsetY = nextOffsetY;
if (sameTB) tmpNextOffsetY += popupHeight - targetHeight;
else tmpNextOffsetY = targetAlignPointBR.y - popupAlignPointTL.y - popupOffsetY;
const newVisibleArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY);
const newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY, visibleRegionArea);
if (newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst || newVisibleRecommendArea >= originIntersectionRecommendArea)) {
prevFlipRef.current.tb = true;
nextOffsetY = tmpNextOffsetY;
popupOffsetY = -popupOffsetY;
nextPoints = [reversePoints(nextPoints[0], 0), reversePoints(nextPoints[1], 0)];
} else prevFlipRef.current.tb = false;
}
const needAdjustX = supportAdjust(adjustX);
const sameLR = popupPoints[1] === targetPoints[1];
if (needAdjustX && popupPoints[1] === "l" && (nextPopupRight > adjustCheckVisibleArea.right || prevFlipRef.current.rl)) {
let tmpNextOffsetX = nextOffsetX;
if (sameLR) tmpNextOffsetX -= popupWidth - targetWidth;
else tmpNextOffsetX = targetAlignPointTL.x - popupAlignPointBR.x - popupOffsetX;
const newVisibleArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY);
const newVisibleRecommendArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY, visibleRegionArea);
if (newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst || newVisibleRecommendArea >= originIntersectionRecommendArea)) {
prevFlipRef.current.rl = true;
nextOffsetX = tmpNextOffsetX;
popupOffsetX = -popupOffsetX;
nextPoints = [reversePoints(nextPoints[0], 1), reversePoints(nextPoints[1], 1)];
} else prevFlipRef.current.rl = false;
}
if (needAdjustX && popupPoints[1] === "r" && (nextPopupX < adjustCheckVisibleArea.left || prevFlipRef.current.lr)) {
let tmpNextOffsetX = nextOffsetX;
if (sameLR) tmpNextOffsetX += popupWidth - targetWidth;
else tmpNextOffsetX = targetAlignPointBR.x - popupAlignPointTL.x - popupOffsetX;
const newVisibleArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY);
const newVisibleRecommendArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY, visibleRegionArea);
if (newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst || newVisibleRecommendArea >= originIntersectionRecommendArea)) {
prevFlipRef.current.lr = true;
nextOffsetX = tmpNextOffsetX;
popupOffsetX = -popupOffsetX;
nextPoints = [reversePoints(nextPoints[0], 1), reversePoints(nextPoints[1], 1)];
} else prevFlipRef.current.lr = false;
}
nextAlignInfo.points = [flatPoints(nextPoints[0]), flatPoints(nextPoints[1])];
syncNextPopupPosition();
const numShiftX = shiftX === true ? 0 : shiftX;
if (typeof numShiftX === "number") {
if (nextPopupX < visibleRegionArea.left) {
nextOffsetX -= nextPopupX - visibleRegionArea.left - popupOffsetX;
if (targetRect.x + targetWidth < visibleRegionArea.left + numShiftX) nextOffsetX += targetRect.x - visibleRegionArea.left + targetWidth - numShiftX;
}
if (nextPopupRight > visibleRegionArea.right) {
nextOffsetX -= nextPopupRight - visibleRegionArea.right - popupOffsetX;
if (targetRect.x > visibleRegionArea.right - numShiftX) nextOffsetX += targetRect.x - visibleRegionArea.right + numShiftX;
}
}
const numShiftY = shiftY === true ? 0 : shiftY;
if (typeof numShiftY === "number") {
if (nextPopupY < visibleRegionArea.top) {
nextOffsetY -= nextPopupY - visibleRegionArea.top - popupOffsetY;
if (targetRect.y + targetHeight < visibleRegionArea.top + numShiftY) nextOffsetY += targetRect.y - visibleRegionArea.top + targetHeight - numShiftY;
}
if (nextPopupBottom > visibleRegionArea.bottom) {
nextOffsetY -= nextPopupBottom - visibleRegionArea.bottom - popupOffsetY;
if (targetRect.y > visibleRegionArea.bottom - numShiftY) nextOffsetY += targetRect.y - visibleRegionArea.bottom + numShiftY;
}
}
const popupLeft = popupRect.x + nextOffsetX;
const popupRight = popupLeft + popupWidth;
const popupTop = popupRect.y + nextOffsetY;
const popupBottom = popupTop + popupHeight;
const targetLeft = targetRect.x;
const targetRight = targetLeft + targetWidth;
const targetTop = targetRect.y;
const targetBottom = targetTop + targetHeight;
/** Arrow X of popup offset */
const nextArrowX = (Math.max(popupLeft, targetLeft) + Math.min(popupRight, targetRight)) / 2 - popupLeft;
const nextArrowY = (Math.max(popupTop, targetTop) + Math.min(popupBottom, targetBottom)) / 2 - popupTop;
onPopupAlign?.(popupEle, nextAlignInfo);
let offsetX4Right = popupMirrorRect.right - popupRect.x - (nextOffsetX + popupRect.width);
let offsetY4Bottom = popupMirrorRect.bottom - popupRect.y - (nextOffsetY + popupRect.height);
if (scaleX === 1) {
nextOffsetX = Math.floor(nextOffsetX);
offsetX4Right = Math.floor(offsetX4Right);
}
if (scaleY === 1) {
nextOffsetY = Math.floor(nextOffsetY);
offsetY4Bottom = Math.floor(offsetY4Bottom);
}
setOffsetInfo({
ready: true,
offsetX: nextOffsetX / scaleX,
offsetY: nextOffsetY / scaleY,
offsetR: offsetX4Right / scaleX,
offsetB: offsetY4Bottom / scaleY,
arrowX: nextArrowX / scaleX,
arrowY: nextArrowY / scaleY,
scaleX,
scaleY,
align: nextAlignInfo
});
}
});
const triggerAlign = () => {
alignCountRef.current += 1;
const id = alignCountRef.current;
Promise.resolve().then(() => {
if (alignCountRef.current === id) onAlign();
});
};
const resetReady = () => {
setOffsetInfo((ori) => ({
...ori,
ready: false
}));
};
useLayoutEffect$1(resetReady, [placement]);
useLayoutEffect$1(() => {
if (!open) resetReady();
}, [open]);
return [
offsetInfo.ready,
offsetInfo.offsetX,
offsetInfo.offsetY,
offsetInfo.offsetR,
offsetInfo.offsetB,
offsetInfo.arrowX,
offsetInfo.arrowY,
offsetInfo.scaleX,
offsetInfo.scaleY,
offsetInfo.align,
triggerAlign
];
}
//#endregion
//#region node_modules/@rc-component/trigger/es/hooks/useDelay.js
function useDelay$1() {
const delayRef = import_react.useRef(null);
const clearDelay = () => {
if (delayRef.current) {
clearTimeout(delayRef.current);
delayRef.current = null;
}
};
const delayInvoke = (callback, delay) => {
clearDelay();
if (delay === 0) callback();
else delayRef.current = setTimeout(() => {
callback();
}, delay * 1e3);
};
import_react.useEffect(() => {
return () => {
clearDelay();
};
}, []);
return delayInvoke;
}
//#endregion
//#region node_modules/@rc-component/trigger/es/hooks/useWatch.js
function useWatch$1(open, target, popup, onAlign, onScroll) {
useLayoutEffect$1(() => {
if (open && target && popup) {
const targetElement = target;
const popupElement = popup;
const targetScrollList = collectScroller(targetElement);
const popupScrollList = collectScroller(popupElement);
const win = getWin(popupElement);
const mergedList = new Set([
win,
...targetScrollList,
...popupScrollList
]);
function notifyScroll() {
onAlign();
onScroll();
}
mergedList.forEach((scroller) => {
scroller.addEventListener("scroll", notifyScroll, { passive: true });
});
win.addEventListener("resize", notifyScroll, { passive: true });
onAlign();
return () => {
mergedList.forEach((scroller) => {
scroller.removeEventListener("scroll", notifyScroll);
win.removeEventListener("resize", notifyScroll);
});
};
}
}, [
open,
target,
popup
]);
}
//#endregion
//#region node_modules/@rc-component/trigger/es/hooks/useWinClick.js
/**
* Close if click on the window.
* Return the function that click on the Popup element.
*/
function useWinClick(open, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen) {
const openRef = import_react.useRef(open);
openRef.current = open;
const popupPointerDownRef = import_react.useRef(false);
import_react.useEffect(() => {
if (clickToHide && popupEle && (!mask || maskClosable)) {
const onPointerDown = () => {
popupPointerDownRef.current = false;
};
const onTriggerClose = (e) => {
if (openRef.current && !inPopupOrChild(e.composedPath?.()?.[0] || e.target) && !popupPointerDownRef.current) triggerOpen(false);
};
const win = getWin(popupEle);
win.addEventListener("pointerdown", onPointerDown, true);
win.addEventListener("mousedown", onTriggerClose, true);
win.addEventListener("contextmenu", onTriggerClose, true);
const targetShadowRoot = getShadowRoot(targetEle);
if (targetShadowRoot) {
targetShadowRoot.addEventListener("mousedown", onTriggerClose, true);
targetShadowRoot.addEventListener("contextmenu", onTriggerClose, true);
}
if (targetEle) {
const targetRoot = targetEle.getRootNode?.();
const popupRoot = popupEle.getRootNode?.();
warning$2(targetRoot === popupRoot, `trigger element and popup element should in same shadow root.`);
}
return () => {
win.removeEventListener("pointerdown", onPointerDown, true);
win.removeEventListener("mousedown", onTriggerClose, true);
win.removeEventListener("contextmenu", onTriggerClose, true);
if (targetShadowRoot) {
targetShadowRoot.removeEventListener("mousedown", onTriggerClose, true);
targetShadowRoot.removeEventListener("contextmenu", onTriggerClose, true);
}
};
}
}, [
clickToHide,
targetEle,
popupEle,
mask,
maskClosable
]);
function onPopupPointerDown() {
popupPointerDownRef.current = true;
}
return onPopupPointerDown;
}
//#endregion
//#region node_modules/@rc-component/trigger/es/UniqueProvider/useTargetState.js
/**
* Control the state of popup bind target:
* 1. When set `target`. Do show the popup.
* 2. When `target` is removed. Do hide the popup.
* 3. When `target` change to another one:
* a. We wait motion finish of previous popup.
* b. Then we set new target and show the popup.
* 4. During appear/enter animation, cache new options and apply after animation completes.
*/
function useTargetState() {
const [options, setOptions] = import_react.useState(null);
const [open, setOpen] = import_react.useState(false);
const [isAnimating, setIsAnimating] = import_react.useState(false);
const pendingOptionsRef = import_react.useRef(null);
return [
useEvent((nextOptions) => {
if (nextOptions === false) {
pendingOptionsRef.current = null;
setOpen(false);
} else if (isAnimating && open) pendingOptionsRef.current = nextOptions;
else {
setOpen(true);
setOptions(nextOptions);
pendingOptionsRef.current = null;
if (!open) setIsAnimating(true);
}
}),
open,
options,
useEvent((visible) => {
if (visible) {
setIsAnimating(false);
if (pendingOptionsRef.current) {
setOptions(pendingOptionsRef.current);
pendingOptionsRef.current = null;
}
} else {
setIsAnimating(false);
pendingOptionsRef.current = null;
}
})
];
}
//#endregion
//#region node_modules/@rc-component/trigger/es/UniqueProvider/UniqueContainer.js
function _extends$95() {
_extends$95 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$95.apply(this, arguments);
}
var UniqueContainer = (props) => {
const { prefixCls, isMobile, ready, open, align, offsetR, offsetB, offsetX, offsetY, arrowPos, popupSize, motion, uniqueContainerClassName, uniqueContainerStyle } = props;
const containerCls = `${prefixCls}-unique-container`;
const [motionVisible, setMotionVisible] = import_react.useState(false);
const offsetStyle = useOffsetStyle(isMobile, ready, open, align, offsetR, offsetB, offsetX, offsetY);
const cachedOffsetStyleRef = import_react.useRef(offsetStyle);
if (ready) cachedOffsetStyleRef.current = offsetStyle;
const sizeStyle = {};
if (popupSize) {
sizeStyle.width = popupSize.width;
sizeStyle.height = popupSize.height;
}
return /* @__PURE__ */ import_react.createElement(es_default$28, _extends$95({
motionAppear: true,
motionEnter: true,
motionLeave: true,
removeOnLeave: false,
leavedClassName: `${containerCls}-hidden`
}, motion, {
visible: open,
onVisibleChanged: (nextVisible) => {
setMotionVisible(nextVisible);
}
}), ({ className: motionClassName, style: motionStyle }) => {
const cls = clsx(containerCls, motionClassName, uniqueContainerClassName, { [`${containerCls}-visible`]: motionVisible });
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style: {
"--arrow-x": `${arrowPos?.x || 0}px`,
"--arrow-y": `${arrowPos?.y || 0}px`,
...cachedOffsetStyleRef.current,
...sizeStyle,
...motionStyle,
...uniqueContainerStyle
}
});
});
};
//#endregion
//#region node_modules/@rc-component/trigger/es/UniqueProvider/index.js
var UniqueProvider$1 = ({ children, postTriggerProps }) => {
const [trigger, open, options, onTargetVisibleChanged] = useTargetState();
const mergedOptions = import_react.useMemo(() => {
if (!options || !postTriggerProps) return options;
return postTriggerProps(options);
}, [options, postTriggerProps]);
const [popupEle, setPopupEle] = import_react.useState(null);
const [popupSize, setPopupSize] = import_react.useState(null);
const externalPopupRef = import_react.useRef(null);
const setPopupRef = useEvent((node) => {
externalPopupRef.current = node;
if (isDOM(node) && popupEle !== node) setPopupEle(node);
});
const isOpenRef = import_react.useRef(null);
const delayInvoke = useDelay$1();
const show = useEvent((showOptions, isOpen) => {
isOpenRef.current = isOpen;
delayInvoke(() => {
trigger(showOptions);
}, showOptions.delay);
});
const hide = (delay) => {
delayInvoke(() => {
if (isOpenRef.current?.()) return;
trigger(false);
}, delay);
};
const onVisibleChanged = useEvent((visible) => {
onTargetVisibleChanged(visible);
});
const [ready, offsetX, offsetY, offsetR, offsetB, arrowX, arrowY, , , alignInfo, onAlign] = useAlign(open, popupEle, mergedOptions?.target, mergedOptions?.popupPlacement, mergedOptions?.builtinPlacements || {}, mergedOptions?.popupAlign, void 0, false);
const alignedClassName = import_react.useMemo(() => {
if (!mergedOptions) return "";
return clsx(getAlignPopupClassName(mergedOptions.builtinPlacements || {}, mergedOptions.prefixCls || "", alignInfo, false), mergedOptions.getPopupClassNameFromAlign?.(alignInfo));
}, [
alignInfo,
mergedOptions?.getPopupClassNameFromAlign,
mergedOptions?.builtinPlacements,
mergedOptions?.prefixCls
]);
const contextValue = import_react.useMemo(() => ({
show,
hide
}), []);
import_react.useEffect(() => {
onAlign();
}, [mergedOptions?.target]);
const onPrepare = useEvent(() => {
onAlign();
return Promise.resolve();
});
const subPopupElements = import_react.useRef({});
const parentContext = import_react.useContext(TriggerContext);
const triggerContextValue = import_react.useMemo(() => ({ registerSubPopup: (id, subPopupEle) => {
subPopupElements.current[id] = subPopupEle;
parentContext?.registerSubPopup(id, subPopupEle);
} }), [parentContext]);
const prefixCls = mergedOptions?.prefixCls;
return /* @__PURE__ */ import_react.createElement(UniqueContext.Provider, { value: contextValue }, children, mergedOptions && /* @__PURE__ */ import_react.createElement(TriggerContext.Provider, { value: triggerContextValue }, /* @__PURE__ */ import_react.createElement(Popup$2, {
ref: setPopupRef,
portal: es_default$27,
onEsc: mergedOptions.onEsc,
prefixCls,
popup: mergedOptions.popup,
className: clsx(mergedOptions.popupClassName, alignedClassName, `${prefixCls}-unique-controlled`),
style: mergedOptions.popupStyle,
target: mergedOptions.target,
open,
keepDom: true,
fresh: true,
autoDestroy: false,
onVisibleChanged,
ready,
offsetX,
offsetY,
offsetR,
offsetB,
onAlign,
onPrepare,
onResize: (size) => setPopupSize({
width: size.offsetWidth,
height: size.offsetHeight
}),
arrowPos: {
x: arrowX,
y: arrowY
},
align: alignInfo,
zIndex: mergedOptions.zIndex,
mask: mergedOptions.mask,
arrow: mergedOptions.arrow,
motion: mergedOptions.popupMotion,
maskMotion: mergedOptions.maskMotion,
getPopupContainer: mergedOptions.getPopupContainer
}, /* @__PURE__ */ import_react.createElement(UniqueContainer, {
prefixCls,
isMobile: false,
ready,
open,
align: alignInfo,
offsetR,
offsetB,
offsetX,
offsetY,
arrowPos: {
x: arrowX,
y: arrowY
},
popupSize,
motion: mergedOptions.popupMotion,
uniqueContainerClassName: clsx(mergedOptions.uniqueContainerClassName, alignedClassName),
uniqueContainerStyle: mergedOptions.uniqueContainerStyle
}))));
};
//#endregion
//#region node_modules/@rc-component/trigger/es/index.js
function generateTrigger(PortalComponent = es_default$27) {
const Trigger = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls = "rc-trigger-popup", children, action = "hover", showAction, hideAction, popupVisible, defaultPopupVisible, onOpenChange, afterOpenChange, onPopupVisibleChange, afterPopupVisibleChange, mouseEnterDelay, mouseLeaveDelay = .1, focusDelay, blurDelay, mask, maskClosable = true, getPopupContainer, forceRender, autoDestroy, popup, popupClassName, uniqueContainerClassName, uniqueContainerStyle, popupStyle, popupPlacement, builtinPlacements = {}, popupAlign, zIndex, stretch, getPopupClassNameFromAlign, fresh, unique, alignPoint, onPopupClick, onPopupAlign, arrow, popupMotion, maskMotion, mobile, ...restProps } = props;
const mergedAutoDestroy = autoDestroy || false;
const openUncontrolled = popupVisible === void 0;
const isMobile = !!mobile;
const subPopupElements = import_react.useRef({});
const parentContext = import_react.useContext(TriggerContext);
const context = import_react.useMemo(() => {
return { registerSubPopup: (id, subPopupEle) => {
subPopupElements.current[id] = subPopupEle;
parentContext?.registerSubPopup(id, subPopupEle);
} };
}, [parentContext]);
const uniqueContext = import_react.useContext(UniqueContext);
const id = useId_default();
const [popupEle, setPopupEle] = import_react.useState(null);
const externalPopupRef = import_react.useRef(null);
const setPopupRef = useEvent((node) => {
externalPopupRef.current = node;
if (isDOM(node) && popupEle !== node) setPopupEle(node);
parentContext?.registerSubPopup(id, node);
});
const [targetEle, setTargetEle] = import_react.useState(null);
const externalForwardRef = import_react.useRef(null);
const setTargetRef = useEvent((node) => {
const domNode = getDOM(node);
if (isDOM(domNode) && targetEle !== domNode) {
setTargetEle(domNode);
externalForwardRef.current = domNode;
}
});
const cloneProps = {};
const inPopupOrChild = useEvent((ele) => {
const childDOM = targetEle;
return childDOM?.contains(ele) || getShadowRoot(childDOM)?.host === ele || ele === childDOM || popupEle?.contains(ele) || getShadowRoot(popupEle)?.host === ele || ele === popupEle || Object.values(subPopupElements.current).some((subPopupEle) => subPopupEle?.contains(ele) || ele === subPopupEle);
});
const innerArrow = arrow ? { ...arrow !== true ? arrow : {} } : null;
const [internalOpen, setInternalOpen] = useControlledState(defaultPopupVisible || false, popupVisible);
const mergedOpen = internalOpen || false;
const child = import_react.useMemo(() => {
const nextChild = typeof children === "function" ? children({ open: mergedOpen }) : children;
return import_react.Children.only(nextChild);
}, [children, mergedOpen]);
const originChildProps = child?.props || {};
const isOpen = useEvent(() => mergedOpen);
const getUniqueOptions = useEvent((delay = 0) => ({
popup,
target: targetEle,
delay,
prefixCls,
popupClassName,
uniqueContainerClassName,
uniqueContainerStyle,
popupStyle,
popupPlacement,
builtinPlacements,
popupAlign,
zIndex,
mask,
maskClosable,
popupMotion,
maskMotion,
arrow: innerArrow,
getPopupContainer,
getPopupClassNameFromAlign,
id,
onEsc
}));
useLayoutEffect$1(() => {
if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) if (mergedOpen) uniqueContext.show(getUniqueOptions(mouseEnterDelay), isOpen);
else uniqueContext.hide(mouseLeaveDelay);
}, [mergedOpen, targetEle]);
const openRef = import_react.useRef(mergedOpen);
openRef.current = mergedOpen;
const internalTriggerOpen = useEvent((nextOpen) => {
(0, import_react_dom.flushSync)(() => {
if (mergedOpen !== nextOpen) {
setInternalOpen(nextOpen);
onOpenChange?.(nextOpen);
onPopupVisibleChange?.(nextOpen);
}
});
});
const delayInvoke = useDelay$1();
const triggerOpen = (nextOpen, delay = 0) => {
if (popupVisible !== void 0) {
delayInvoke(() => {
internalTriggerOpen(nextOpen);
}, delay);
return;
}
if (uniqueContext && unique && openUncontrolled && !parentContext) {
if (nextOpen) uniqueContext.show(getUniqueOptions(delay), isOpen);
else uniqueContext.hide(delay);
return;
}
delayInvoke(() => {
internalTriggerOpen(nextOpen);
}, delay);
};
function onEsc({ top }) {
if (top) triggerOpen(false);
}
const [inMotion, setInMotion] = import_react.useState(false);
useLayoutEffect$1((firstMount) => {
if (!firstMount || mergedOpen) setInMotion(true);
}, [mergedOpen]);
const [motionPrepareResolve, setMotionPrepareResolve] = import_react.useState(null);
const [mousePos, setMousePos] = import_react.useState(null);
const setMousePosByEvent = (event) => {
setMousePos([event.clientX, event.clientY]);
};
const [ready, offsetX, offsetY, offsetR, offsetB, arrowX, arrowY, scaleX, scaleY, alignInfo, onAlign] = useAlign(mergedOpen, popupEle, alignPoint && mousePos !== null ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign, isMobile);
const [showActions, hideActions] = useAction(action, showAction, hideAction);
const clickToShow = showActions.has("click");
const clickToHide = hideActions.has("click") || hideActions.has("contextMenu");
const triggerAlign = useEvent(() => {
if (!inMotion) onAlign();
});
const onScroll = () => {
if (openRef.current && alignPoint && clickToHide) triggerOpen(false);
};
useWatch$1(mergedOpen, targetEle, popupEle, triggerAlign, onScroll);
useLayoutEffect$1(() => {
triggerAlign();
}, [mousePos, popupPlacement]);
useLayoutEffect$1(() => {
if (mergedOpen && !builtinPlacements?.[popupPlacement]) triggerAlign();
}, [JSON.stringify(popupAlign)]);
const alignedClassName = import_react.useMemo(() => {
return clsx(getAlignPopupClassName(builtinPlacements, prefixCls, alignInfo, alignPoint), getPopupClassNameFromAlign?.(alignInfo));
}, [
alignInfo,
getPopupClassNameFromAlign,
builtinPlacements,
prefixCls,
alignPoint
]);
import_react.useImperativeHandle(ref, () => ({
nativeElement: externalForwardRef.current,
popupElement: externalPopupRef.current,
forceAlign: triggerAlign
}));
const [targetWidth, setTargetWidth] = import_react.useState(0);
const [targetHeight, setTargetHeight] = import_react.useState(0);
const syncTargetSize = () => {
if (stretch && targetEle) {
const rect = targetEle.getBoundingClientRect();
setTargetWidth(rect.width);
setTargetHeight(rect.height);
}
};
const onTargetResize = () => {
syncTargetSize();
triggerAlign();
};
const onVisibleChanged = (visible) => {
setInMotion(false);
onAlign();
afterOpenChange?.(visible);
afterPopupVisibleChange?.(visible);
};
const onPrepare = () => new Promise((resolve) => {
syncTargetSize();
setMotionPrepareResolve(() => resolve);
});
useLayoutEffect$1(() => {
if (motionPrepareResolve) {
onAlign();
motionPrepareResolve();
setMotionPrepareResolve(null);
}
}, [motionPrepareResolve]);
/**
* Util wrapper for trigger action
* @param eventName Listen event name
* @param nextOpen Next open state after trigger
* @param delay Delay to trigger open change
* @param callback Callback if current event need additional action
* @param ignoreCheck Ignore current event if check return true
*/
function wrapperAction(eventName, nextOpen, delay, callback, ignoreCheck) {
cloneProps[eventName] = (event, ...args) => {
if (!ignoreCheck || !ignoreCheck()) {
callback?.(event);
triggerOpen(nextOpen, delay);
}
originChildProps[eventName]?.(event, ...args);
};
}
const touchToShow = showActions.has("touch");
const touchToHide = hideActions.has("touch");
/** Used for prevent `hover` event conflict with mobile env */
const touchedRef = import_react.useRef(false);
if (touchToShow || touchToHide) cloneProps.onTouchStart = (...args) => {
touchedRef.current = true;
if (openRef.current && touchToHide) triggerOpen(false);
else if (!openRef.current && touchToShow) triggerOpen(true);
originChildProps.onTouchStart?.(...args);
};
if (clickToShow || clickToHide) cloneProps.onClick = (event, ...args) => {
if (openRef.current && clickToHide) triggerOpen(false);
else if (!openRef.current && clickToShow) {
setMousePosByEvent(event);
triggerOpen(true);
}
originChildProps.onClick?.(event, ...args);
touchedRef.current = false;
};
const onPopupPointerDown = useWinClick(mergedOpen, clickToHide || touchToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen);
const hoverToShow = showActions.has("hover");
const hoverToHide = hideActions.has("hover");
let onPopupMouseEnter;
let onPopupMouseLeave;
const ignoreMouseTrigger = () => {
return touchedRef.current;
};
if (hoverToShow) {
const onMouseEnterCallback = (event) => {
setMousePosByEvent(event);
};
wrapperAction("onMouseEnter", true, mouseEnterDelay, onMouseEnterCallback, ignoreMouseTrigger);
wrapperAction("onPointerEnter", true, mouseEnterDelay, onMouseEnterCallback, ignoreMouseTrigger);
onPopupMouseEnter = (event) => {
if ((mergedOpen || inMotion) && popupEle?.contains(event.target)) triggerOpen(true, mouseEnterDelay);
};
if (alignPoint) cloneProps.onMouseMove = (event) => {
originChildProps.onMouseMove?.(event);
};
}
if (hoverToHide) {
wrapperAction("onMouseLeave", false, mouseLeaveDelay, void 0, ignoreMouseTrigger);
wrapperAction("onPointerLeave", false, mouseLeaveDelay, void 0, ignoreMouseTrigger);
onPopupMouseLeave = () => {
triggerOpen(false, mouseLeaveDelay);
};
}
if (showActions.has("focus")) wrapperAction("onFocus", true, focusDelay);
if (hideActions.has("focus")) wrapperAction("onBlur", false, blurDelay);
if (showActions.has("contextMenu")) cloneProps.onContextMenu = (event, ...args) => {
if (openRef.current && hideActions.has("contextMenu")) triggerOpen(false);
else {
setMousePosByEvent(event);
triggerOpen(true);
}
event.preventDefault();
originChildProps.onContextMenu?.(event, ...args);
};
const rendedRef = import_react.useRef(false);
rendedRef.current ||= forceRender || mergedOpen || inMotion;
const mergedChildrenProps = {
...originChildProps,
...cloneProps
};
const passedProps = {};
[
"onContextMenu",
"onClick",
"onMouseDown",
"onTouchStart",
"onMouseEnter",
"onMouseLeave",
"onFocus",
"onBlur"
].forEach((eventName) => {
if (restProps[eventName]) passedProps[eventName] = (...args) => {
mergedChildrenProps[eventName]?.(...args);
restProps[eventName](...args);
};
});
const arrowPos = {
x: arrowX,
y: arrowY
};
useResizeObserver(mergedOpen, targetEle, onTargetResize);
const mergedRef = useComposeRef(setTargetRef, getNodeRef(child));
const triggerNode = /* @__PURE__ */ import_react.cloneElement(child, {
...mergedChildrenProps,
...passedProps,
ref: mergedRef
});
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, triggerNode, rendedRef.current && (!uniqueContext || !unique) && /* @__PURE__ */ import_react.createElement(TriggerContext.Provider, { value: context }, /* @__PURE__ */ import_react.createElement(Popup$2, {
portal: PortalComponent,
ref: setPopupRef,
prefixCls,
popup,
className: clsx(popupClassName, !isMobile && alignedClassName),
style: popupStyle,
target: targetEle,
onMouseEnter: onPopupMouseEnter,
onMouseLeave: onPopupMouseLeave,
onPointerEnter: onPopupMouseEnter,
zIndex,
open: mergedOpen,
keepDom: inMotion,
fresh,
onClick: onPopupClick,
onPointerDownCapture: onPopupPointerDown,
mask,
motion: popupMotion,
maskMotion,
onVisibleChanged,
onPrepare,
forceRender,
autoDestroy: mergedAutoDestroy,
getPopupContainer,
onEsc,
align: alignInfo,
arrow: innerArrow,
arrowPos,
ready,
offsetX,
offsetY,
offsetR,
offsetB,
onAlign: triggerAlign,
stretch,
targetWidth: targetWidth / scaleX,
targetHeight: targetHeight / scaleY,
mobile
})));
});
Trigger.displayName = "Trigger";
return Trigger;
}
var es_default$26 = generateTrigger(es_default$27);
//#endregion
//#region node_modules/antd/es/_util/reactNode.js
function isFragment(child) {
return child && /* @__PURE__ */ import_react.isValidElement(child) && child.type === import_react.Fragment;
}
var replaceElement = (element, replacement, props) => {
if (!/* @__PURE__ */ import_react.isValidElement(element)) return replacement;
return /* @__PURE__ */ import_react.cloneElement(element, isFunction(props) ? props(element.props || {}) : props);
};
function cloneElement$1(element, props) {
return replaceElement(element, element, props);
}
//#endregion
//#region node_modules/antd/es/tooltip/UniqueProvider/MotionContent.js
var MotionContent = ({ children }) => {
const { getPrefixCls } = import_react.useContext(ConfigContext);
const rootPrefixCls = getPrefixCls();
/* istanbul ignore next */
if (!/* @__PURE__ */ import_react.isValidElement(children)) return children;
return /* @__PURE__ */ import_react.createElement(es_default$28, {
visible: true,
motionName: `${rootPrefixCls}-fade`,
motionAppear: true,
motionEnter: true,
motionLeave: false,
removeOnLeave: false
}, ({ style: motionStyle, className: motionClassName }) => {
return cloneElement$1(children, (oriProps) => ({
className: clsx(oriProps.className, motionClassName),
style: {
...oriProps.style,
...motionStyle
}
}));
});
};
//#endregion
//#region node_modules/antd/es/tooltip/UniqueProvider/index.js
var cachedPlacements = [null, null];
function uniqueBuiltinPlacements(ori) {
if (cachedPlacements[0] !== ori) {
const target = {};
Object.keys(ori).forEach((placement) => {
target[placement] = {
...ori[placement],
dynamicInset: false
};
});
cachedPlacements[0] = ori;
cachedPlacements[1] = target;
}
return cachedPlacements[1];
}
var UniqueProvider = ({ children }) => {
const renderPopup = (options) => {
const { id, builtinPlacements, popup } = options;
const popupEle = typeof popup === "function" ? popup() : popup;
const parsedPlacements = uniqueBuiltinPlacements(builtinPlacements);
return {
...options,
getPopupContainer: null,
arrow: false,
popup: /* @__PURE__ */ import_react.createElement(MotionContent, { key: id }, popupEle),
builtinPlacements: parsedPlacements
};
};
return /* @__PURE__ */ import_react.createElement(UniqueProvider$1, { postTriggerProps: renderPopup }, children);
};
//#endregion
//#region node_modules/antd/es/config-provider/DisabledContext.js
var DisabledContext = /* @__PURE__ */ import_react.createContext(false);
var DisabledContextProvider = ({ children, disabled }) => {
const originDisabled = import_react.useContext(DisabledContext);
return /* @__PURE__ */ import_react.createElement(DisabledContext.Provider, { value: disabled ?? originDisabled }, children);
};
//#endregion
//#region node_modules/antd/es/config-provider/SizeContext.js
var SizeContext = /* @__PURE__ */ import_react.createContext(void 0);
var SizeContextProvider = ({ children, size }) => {
const originSize = import_react.useContext(SizeContext);
return /* @__PURE__ */ import_react.createElement(SizeContext.Provider, { value: size || originSize }, children);
};
//#endregion
//#region node_modules/antd/es/config-provider/hooks/useConfig.js
function useConfig() {
return {
componentDisabled: (0, import_react.useContext)(DisabledContext),
componentSize: (0, import_react.useContext)(SizeContext)
};
}
//#endregion
//#region node_modules/antd/es/config-provider/hooks/useTheme.js
function useTheme(theme, parentTheme, config) {
const warning = devUseWarning("ConfigProvider");
const themeConfig = theme || {};
const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? {
...defaultConfig,
hashed: parentTheme?.hashed ?? defaultConfig.hashed,
cssVar: parentTheme?.cssVar
} : parentTheme;
const themeKey = (0, import_react.useId)();
{
const cssVarEnabled = themeConfig.cssVar || parentThemeConfig.cssVar;
const validKey = !!(isPlainObject(themeConfig.cssVar) && themeConfig.cssVar?.key || themeKey);
warning(!cssVarEnabled || validKey, "breaking", "Missing key in `cssVar` config. Please upgrade to React 18 or set `cssVar.key` manually in each ConfigProvider inside `cssVar` enabled ConfigProvider.");
}
return useMemo$44(() => {
if (!theme) return parentTheme;
const mergedComponents = { ...parentThemeConfig.components };
Object.keys(theme.components || {}).forEach((componentName) => {
mergedComponents[componentName] = {
...mergedComponents[componentName],
...theme.components[componentName]
};
});
const cssVarKey = `css-var-${themeKey.replace(/:/g, "")}`;
const mergedCssVar = {
prefix: config?.prefixCls,
...parentThemeConfig.cssVar,
...themeConfig.cssVar,
key: themeConfig.cssVar?.key || cssVarKey
};
return {
...parentThemeConfig,
...themeConfig,
token: {
...parentThemeConfig.token,
...themeConfig.token
},
components: mergedComponents,
cssVar: mergedCssVar
};
}, [themeConfig, parentThemeConfig], (prev, next) => prev.some((prevTheme, index) => {
const nextTheme = next[index];
return !isEqual(prevTheme, nextTheme, true);
}));
}
//#endregion
//#region node_modules/antd/es/config-provider/MotionWrapper.js
var MotionCacheContext = /* @__PURE__ */ import_react.createContext(true);
MotionCacheContext.displayName = "MotionCacheContext";
function MotionWrapper(props) {
const parentMotion = import_react.useContext(MotionCacheContext);
const { children } = props;
const [, token] = useToken$1();
const { motion } = token;
const needWrapMotionProviderRef = import_react.useRef(false);
needWrapMotionProviderRef.current || (needWrapMotionProviderRef.current = parentMotion !== motion);
if (needWrapMotionProviderRef.current) return /* @__PURE__ */ import_react.createElement(MotionCacheContext.Provider, { value: motion }, /* @__PURE__ */ import_react.createElement(MotionProvider, { motion }, children));
return children;
}
//#endregion
//#region node_modules/antd/es/config-provider/PropWarning.js
/**
* Warning for ConfigProviderProps.
* This will be empty function in production.
*/
var PropWarning = /* @__PURE__ */ import_react.memo((props) => {
const { dropdownMatchSelectWidth } = props;
devUseWarning("ConfigProvider").deprecated(dropdownMatchSelectWidth === void 0, "dropdownMatchSelectWidth", "popupMatchSelectWidth");
return null;
});
PropWarning.displayName = "PropWarning";
//#endregion
//#region node_modules/antd/es/config-provider/index.js
/**
* This component registers icon styles inside the DesignTokenContext.Provider
* so that CSS variables use the correct cssVar key from the theme config.
*/
var IconStyle = ({ iconPrefixCls, csp }) => {
useResetIconStyle(iconPrefixCls, csp);
return null;
};
/**
* Since too many feedback using static method like `Modal.confirm` not getting theme, we record the
* theme register info here to help developer get warning info.
*/
var existThemeConfig = false;
var warnContext = (componentName) => {
warning$1(!existThemeConfig, componentName, `Static function can not consume context like dynamic theme. Please use 'App' component instead.`);
};
var PASSED_PROPS = [
"getTargetContainer",
"getPopupContainer",
"renderEmpty",
"input",
"pagination",
"form",
"select",
"button"
];
var globalPrefixCls;
var globalIconPrefixCls;
var globalTheme;
var globalHolderRender;
function getGlobalPrefixCls() {
return globalPrefixCls || "ant";
}
function getGlobalIconPrefixCls() {
return globalIconPrefixCls || "anticon";
}
var setGlobalConfig = (props) => {
const { prefixCls, iconPrefixCls, theme, holderRender } = props;
if (prefixCls !== void 0) globalPrefixCls = prefixCls;
if (iconPrefixCls !== void 0) globalIconPrefixCls = iconPrefixCls;
if ("holderRender" in props) globalHolderRender = holderRender;
if (theme) globalTheme = theme;
};
var globalConfig = () => ({
getPrefixCls: (suffixCls, customizePrefixCls) => {
if (customizePrefixCls) return customizePrefixCls;
return suffixCls ? `${getGlobalPrefixCls()}-${suffixCls}` : getGlobalPrefixCls();
},
getIconPrefixCls: getGlobalIconPrefixCls,
getRootPrefixCls: () => {
if (globalPrefixCls) return globalPrefixCls;
return getGlobalPrefixCls();
},
getTheme: () => globalTheme,
holderRender: globalHolderRender
});
var ProviderChildren = (props) => {
const { children, csp: customCsp, autoInsertSpaceInButton, alert, affix, anchor, app, form, locale: rawLocale, componentSize, direction, space, splitter, virtual, dropdownMatchSelectWidth, popupMatchSelectWidth, popupOverflow, legacyLocale, parentContext, iconPrefixCls: customIconPrefixCls, theme, componentDisabled, segmented, statistic, spin, calendar, carousel, cascader, collapse, typography, checkbox, descriptions, divider, drawer, skeleton, steps, image, layout, list, mentions, modal, progress, result, slider, breadcrumb, masonry, menu, pagination, input, textArea, otp, empty, badge, radio, rate, ribbon, switch: SWITCH, transfer, avatar, message, tag, table, card, cardMeta, tabs, timeline, timePicker, upload, notification, tree, colorPicker, datePicker, rangePicker, flex, wave, dropdown, warning: warningConfig, tour, tooltip, popover, popconfirm, qrcode, floatButton, floatButtonGroup, variant, inputNumber, treeSelect, watermark } = props;
const locale = import_react.useMemo(() => {
if (isPlainObject(rawLocale) && Object.prototype.hasOwnProperty.call(rawLocale, "default") && rawLocale.default?.locale) return rawLocale.default;
return rawLocale;
}, [rawLocale]);
const getPrefixCls = import_react.useCallback((suffixCls, customizePrefixCls) => {
const { prefixCls } = props;
if (customizePrefixCls) return customizePrefixCls;
const mergedPrefixCls = prefixCls || parentContext.getPrefixCls("");
return suffixCls ? `${mergedPrefixCls}-${suffixCls}` : mergedPrefixCls;
}, [parentContext.getPrefixCls, props.prefixCls]);
const iconPrefixCls = customIconPrefixCls || parentContext.iconPrefixCls || "anticon";
const csp = customCsp || parentContext.csp;
const mergedTheme = useTheme(theme, parentContext.theme, { prefixCls: getPrefixCls("") });
existThemeConfig = existThemeConfig || !!mergedTheme;
const baseConfig = {
csp,
autoInsertSpaceInButton,
alert,
affix,
anchor,
app,
locale: locale || legacyLocale,
direction,
space,
splitter,
virtual,
popupMatchSelectWidth: popupMatchSelectWidth ?? dropdownMatchSelectWidth,
popupOverflow,
getPrefixCls,
iconPrefixCls,
theme: mergedTheme,
segmented,
statistic,
spin,
calendar,
carousel,
cascader,
collapse,
typography,
checkbox,
descriptions,
divider,
drawer,
skeleton,
steps,
image,
input,
textArea,
otp,
layout,
list,
mentions,
modal,
progress,
result,
slider,
breadcrumb,
masonry,
menu,
pagination,
empty,
badge,
radio,
rate,
ribbon,
switch: SWITCH,
transfer,
avatar,
message,
tag,
table,
card,
cardMeta,
tabs,
timeline,
timePicker,
upload,
notification,
tree,
colorPicker,
datePicker,
rangePicker,
flex,
wave,
dropdown,
warning: warningConfig,
tour,
tooltip,
popover,
popconfirm,
qrcode,
floatButton,
floatButtonGroup,
variant,
inputNumber,
treeSelect,
watermark
};
devUseWarning("ConfigProvider")(!("autoInsertSpaceInButton" in props), "deprecated", "`autoInsertSpaceInButton` is deprecated. Please use `{ button: { autoInsertSpace: boolean }}` instead.");
const config = { ...parentContext };
Object.keys(baseConfig).forEach((key) => {
if (baseConfig[key] !== void 0) config[key] = baseConfig[key];
});
PASSED_PROPS.forEach((propName) => {
const propValue = props[propName];
if (propValue) config[propName] = propValue;
});
if (typeof autoInsertSpaceInButton !== "undefined") config.button = {
autoInsertSpace: autoInsertSpaceInButton,
...config.button
};
const memoedConfig = useMemo$44(() => config, config, (prevConfig, currentConfig) => {
const prevKeys = Object.keys(prevConfig);
const currentKeys = Object.keys(currentConfig);
return prevKeys.length !== currentKeys.length || prevKeys.some((key) => prevConfig[key] !== currentConfig[key]);
});
const { layer } = import_react.useContext(StyleContext);
const memoIconContextValue = import_react.useMemo(() => ({
prefixCls: iconPrefixCls,
csp,
layer: layer ? "antd" : void 0
}), [
iconPrefixCls,
csp,
layer
]);
let childNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(IconStyle, {
iconPrefixCls,
csp
}), /* @__PURE__ */ import_react.createElement(PropWarning, { dropdownMatchSelectWidth }), children);
const validateMessages = import_react.useMemo(() => merge$1(localeValues.Form?.defaultValidateMessages || {}, memoedConfig.locale?.Form?.defaultValidateMessages || {}, memoedConfig.form?.validateMessages || {}, form?.validateMessages || {}), [memoedConfig, form?.validateMessages]);
if (Object.keys(validateMessages).length > 0) childNode = /* @__PURE__ */ import_react.createElement(validateMessagesContext_default.Provider, { value: validateMessages }, childNode);
if (locale) childNode = /* @__PURE__ */ import_react.createElement(LocaleProvider, {
locale,
_ANT_MARK__: ANT_MARK
}, childNode);
if (iconPrefixCls || csp) childNode = /* @__PURE__ */ import_react.createElement(IconContext.Provider, { value: memoIconContextValue }, childNode);
if (componentSize) childNode = /* @__PURE__ */ import_react.createElement(SizeContextProvider, { size: componentSize }, childNode);
childNode = /* @__PURE__ */ import_react.createElement(MotionWrapper, null, childNode);
if (tooltip?.unique) childNode = /* @__PURE__ */ import_react.createElement(UniqueProvider, null, childNode);
const memoTheme = import_react.useMemo(() => {
const { algorithm, token, components, cssVar, ...rest } = mergedTheme || {};
const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : defaultTheme;
const parsedComponents = {};
Object.entries(components || {}).forEach(([componentName, componentToken]) => {
const parsedToken = { ...componentToken };
if ("algorithm" in parsedToken) {
if (parsedToken.algorithm === true) parsedToken.theme = themeObj;
else if (Array.isArray(parsedToken.algorithm) || typeof parsedToken.algorithm === "function") parsedToken.theme = createTheme(parsedToken.algorithm);
delete parsedToken.algorithm;
}
parsedComponents[componentName] = parsedToken;
});
const mergedToken = {
...seedToken,
...token
};
return {
...rest,
theme: themeObj,
token: mergedToken,
components: parsedComponents,
override: {
override: mergedToken,
...parsedComponents
},
cssVar
};
}, [mergedTheme]);
if (theme) childNode = /* @__PURE__ */ import_react.createElement(DesignTokenContext.Provider, { value: memoTheme }, childNode);
if (memoedConfig.warning) childNode = /* @__PURE__ */ import_react.createElement(WarningContext.Provider, { value: memoedConfig.warning }, childNode);
if (componentDisabled !== void 0) childNode = /* @__PURE__ */ import_react.createElement(DisabledContextProvider, { disabled: componentDisabled }, childNode);
return /* @__PURE__ */ import_react.createElement(ConfigContext.Provider, { value: memoedConfig }, childNode);
};
var ConfigProvider = (props) => {
const context = import_react.useContext(ConfigContext);
const antLocale = import_react.useContext(LocaleContext);
return /* @__PURE__ */ import_react.createElement(ProviderChildren, {
parentContext: context,
legacyLocale: antLocale,
...props
});
};
ConfigProvider.ConfigContext = ConfigContext;
ConfigProvider.SizeContext = SizeContext;
ConfigProvider.config = setGlobalConfig;
ConfigProvider.useConfig = useConfig;
Object.defineProperty(ConfigProvider, "SizeContext", { get: () => {
warning$1(false, "ConfigProvider", "ConfigProvider.SizeContext is deprecated. Please use `ConfigProvider.useConfig().componentSize` instead.");
return SizeContext;
} });
ConfigProvider.displayName = "ConfigProvider";
//#endregion
//#region node_modules/antd/es/anchor/context.js
var AnchorContext = /* @__PURE__ */ import_react.createContext(void 0);
//#endregion
//#region node_modules/antd/es/anchor/AnchorLink.js
var AnchorLink = (props) => {
const { href, title, prefixCls: customizePrefixCls, children, className, target, replace } = props;
const { registerLink, unregisterLink, scrollTo, onClick, activeLink, direction, classNames: mergedClassNames, styles: mergedStyles } = import_react.useContext(AnchorContext) || {};
import_react.useEffect(() => {
registerLink?.(href);
return () => {
unregisterLink?.(href);
};
}, [href]);
const handleClick = (e) => {
onClick?.(e, {
title,
href
});
scrollTo?.(href);
if (e.defaultPrevented) return;
if (href.startsWith("http://") || href.startsWith("https://")) {
if (replace) {
e.preventDefault();
window.location.replace(href);
}
return;
}
e.preventDefault();
const historyMethod = replace ? "replaceState" : "pushState";
window.history[historyMethod](null, "", href);
};
devUseWarning("Anchor.Link")(!children || direction !== "horizontal", "usage", "`Anchor.Link children` is not supported when `Anchor` direction is horizontal");
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("anchor", customizePrefixCls);
const active = activeLink === href;
const wrapperClassName = clsx(`${prefixCls}-link`, className, mergedClassNames?.item, { [`${prefixCls}-link-active`]: active });
const titleClassName = clsx(`${prefixCls}-link-title`, mergedClassNames?.itemTitle, { [`${prefixCls}-link-title-active`]: active });
return /* @__PURE__ */ import_react.createElement("div", {
className: wrapperClassName,
style: mergedStyles?.item
}, /* @__PURE__ */ import_react.createElement("a", {
className: titleClassName,
style: mergedStyles?.itemTitle,
href,
title: typeof title === "string" ? title : "",
target,
onClick: handleClick
}, title), direction !== "horizontal" ? children : null);
};
//#endregion
//#region node_modules/antd/es/anchor/style/index.js
var genSharedAnchorStyle = (token) => {
const { componentCls, holderOffsetBlock, motionDurationSlow, lineWidthBold, colorPrimary, lineType, colorSplit, calc } = token;
return { [`${componentCls}-wrapper`]: {
marginBlockStart: calc(holderOffsetBlock).mul(-1).equal(),
paddingBlockStart: holderOffsetBlock,
[componentCls]: {
...resetComponent(token),
position: "relative",
paddingInlineStart: lineWidthBold,
[`${componentCls}-link`]: {
paddingBlock: token.linkPaddingBlock,
paddingInline: `${unit$1(token.linkPaddingInlineStart)} 0`,
"&-title": {
...textEllipsis,
position: "relative",
display: "block",
marginBlockEnd: token.anchorTitleBlock,
color: token.colorText,
transition: `all ${token.motionDurationSlow}`,
"&:only-child": { marginBlockEnd: 0 }
},
[`&-active > ${componentCls}-link-title`]: { color: token.colorPrimary },
[`${componentCls}-link`]: { paddingBlock: token.anchorPaddingBlockSecondary }
}
},
[`&:not(${componentCls}-wrapper-horizontal)`]: { [componentCls]: {
"&::before": {
position: "absolute",
insetInlineStart: 0,
top: 0,
height: "100%",
borderInlineStart: `${unit$1(lineWidthBold)} ${lineType} ${colorSplit}`,
content: "\" \""
},
[`${componentCls}-ink`]: {
position: "absolute",
insetInlineStart: 0,
display: "none",
transform: "translateY(-50%)",
transition: `top ${motionDurationSlow} ease-in-out`,
width: lineWidthBold,
backgroundColor: colorPrimary,
[`&${componentCls}-ink-visible`]: { display: "inline-block" }
}
} },
[`${componentCls}-fixed ${componentCls}-ink ${componentCls}-ink`]: { display: "none" }
} };
};
var genSharedAnchorHorizontalStyle = (token) => {
const { componentCls, motionDurationSlow, lineWidthBold, colorPrimary } = token;
return { [`${componentCls}-wrapper-horizontal`]: {
position: "relative",
"&::before": {
position: "absolute",
left: {
_skip_check_: true,
value: 0
},
right: {
_skip_check_: true,
value: 0
},
bottom: 0,
borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
content: "\" \""
},
[componentCls]: {
overflowX: "scroll",
position: "relative",
display: "flex",
scrollbarWidth: "none",
"&::-webkit-scrollbar": { display: "none" },
[`${componentCls}-link:first-of-type`]: { paddingInline: 0 },
[`${componentCls}-ink`]: {
position: "absolute",
bottom: 0,
transition: [`left`, `width`].map((prop) => `${prop} ${motionDurationSlow} ease-in-out`).join(", "),
height: lineWidthBold,
backgroundColor: colorPrimary
}
}
} };
};
var prepareComponentToken$55 = (token) => ({
linkPaddingBlock: token.paddingXXS,
linkPaddingInlineStart: token.padding
});
var style_default$62 = genStyleHooks("Anchor", (token) => {
const { fontSize, fontSizeLG, paddingXXS, calc } = token;
const anchorToken = merge(token, {
holderOffsetBlock: paddingXXS,
anchorPaddingBlockSecondary: calc(paddingXXS).div(2).equal(),
anchorTitleBlock: calc(fontSize).div(14).mul(3).equal(),
anchorBallSize: calc(fontSizeLG).div(2).equal()
});
return [genSharedAnchorStyle(anchorToken), genSharedAnchorHorizontalStyle(anchorToken)];
}, prepareComponentToken$55);
//#endregion
//#region node_modules/antd/es/anchor/Anchor.js
function getDefaultContainer() {
return window;
}
function getOffsetTop(element, container) {
if (!element.getClientRects().length) return 0;
const rect = element.getBoundingClientRect();
if (rect.width || rect.height) {
if (container === window) return rect.top - element.ownerDocument.documentElement.clientTop;
return rect.top - container.getBoundingClientRect().top;
}
return rect.top;
}
var sharpMatcherRegex = /#([\S ]+)$/;
var Anchor$1 = (props) => {
const { rootClassName, prefixCls: customPrefixCls, className, style, offsetTop, affix = true, showInkInFixed = false, children, items, direction: anchorDirection = "vertical", bounds, targetOffset, onClick, onChange, getContainer, getCurrentAnchor, replace, classNames, styles } = props;
{
const warning = devUseWarning("Anchor");
warning.deprecated(!children, "Anchor children", "items");
warning(!(anchorDirection === "horizontal" && items?.some((n) => "children" in n)), "usage", "`Anchor items#children` is not supported when `Anchor` direction is horizontal.");
}
const [links, setLinks] = import_react.useState([]);
const [activeLink, setActiveLink] = import_react.useState(null);
const activeLinkRef = import_react.useRef(activeLink);
const wrapperRef = import_react.useRef(null);
const spanLinkNodeRef = import_react.useRef(null);
const animatingRef = import_react.useRef(false);
const scrollRequestIdRef = import_react.useRef(null);
const { direction, getPrefixCls, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("anchor");
const { getTargetContainer } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("anchor", customPrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$62(prefixCls, rootCls);
const getCurrentContainer = getContainer ?? getTargetContainer ?? getDefaultContainer;
const dependencyListItem = JSON.stringify(links);
const registerLink = useEvent((link) => {
if (!links.includes(link)) setLinks((prev) => [].concat(_toConsumableArray$8(prev), [link]));
});
const unregisterLink = useEvent((link) => {
if (links.includes(link)) setLinks((prev) => prev.filter((i) => i !== link));
});
const updateInk = () => {
const linkNode = wrapperRef.current?.querySelector(`.${prefixCls}-link-title-active`);
if (linkNode && spanLinkNodeRef.current) {
const { style: inkStyle } = spanLinkNodeRef.current;
const horizontalAnchor = anchorDirection === "horizontal";
inkStyle.top = horizontalAnchor ? "" : `${linkNode.offsetTop + linkNode.clientHeight / 2}px`;
inkStyle.height = horizontalAnchor ? "" : `${linkNode.clientHeight}px`;
inkStyle.left = horizontalAnchor ? `${linkNode.offsetLeft}px` : "";
inkStyle.width = horizontalAnchor ? `${linkNode.clientWidth}px` : "";
if (horizontalAnchor) e(linkNode, {
scrollMode: "if-needed",
block: "nearest"
});
}
};
const getInternalCurrentAnchor = (_links, _offsetTop = 0, _bounds = 5) => {
const linkSections = [];
const container = getCurrentContainer();
_links.forEach((link) => {
const sharpLinkMatch = sharpMatcherRegex.exec(link?.toString());
if (!sharpLinkMatch) return;
const target = document.getElementById(sharpLinkMatch[1]);
if (target) {
const top = getOffsetTop(target, container);
if (top <= _offsetTop + _bounds) linkSections.push({
link,
top
});
}
});
if (linkSections.length) return linkSections.reduce((prev, curr) => curr.top > prev.top ? curr : prev).link;
return "";
};
const setCurrentActiveLink = useEvent((link) => {
if (activeLinkRef.current === link) return;
const newLink = typeof getCurrentAnchor === "function" ? getCurrentAnchor(link) : link;
setActiveLink(newLink);
activeLinkRef.current = newLink;
onChange?.(link);
});
const handleScroll = import_react.useCallback(() => {
if (animatingRef.current) return;
setCurrentActiveLink(getInternalCurrentAnchor(links, targetOffset !== void 0 ? targetOffset : offsetTop || 0, bounds));
}, [
links,
targetOffset,
offsetTop,
bounds
]);
const handleScrollTo = import_react.useCallback((link) => {
const previousActiveLink = activeLinkRef.current;
setCurrentActiveLink(link);
const sharpLinkMatch = sharpMatcherRegex.exec(link);
if (!sharpLinkMatch) return;
const targetElement = document.getElementById(sharpLinkMatch[1]);
if (!targetElement) return;
if (animatingRef.current) {
if (previousActiveLink === link) return;
scrollRequestIdRef.current?.();
}
const container = getCurrentContainer();
let y = getScroll$2(container) + getOffsetTop(targetElement, container);
y -= targetOffset !== void 0 ? targetOffset : offsetTop || 0;
animatingRef.current = true;
scrollRequestIdRef.current = scrollTo(y, {
getContainer: getCurrentContainer,
callback() {
animatingRef.current = false;
}
});
}, [targetOffset, offsetTop]);
const mergedProps = {
...props,
direction: anchorDirection
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const wrapperClass = clsx(hashId, cssVarCls, rootCls, rootClassName, `${prefixCls}-wrapper`, {
[`${prefixCls}-wrapper-horizontal`]: anchorDirection === "horizontal",
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, contextClassName, mergedClassNames.root);
const anchorClass = clsx(prefixCls, { [`${prefixCls}-fixed`]: !affix && !showInkInFixed });
const inkClass = clsx(`${prefixCls}-ink`, mergedClassNames.indicator, { [`${prefixCls}-ink-visible`]: activeLink });
const wrapperStyle = {
maxHeight: offsetTop ? `calc(100vh - ${offsetTop}px)` : "100vh",
...mergedStyles.root,
...contextStyle,
...style
};
const createNestedLink = (options) => Array.isArray(options) ? options.map((item) => /* @__PURE__ */ import_react.createElement(AnchorLink, {
replace,
...item,
key: item.key
}, anchorDirection === "vertical" && createNestedLink(item.children))) : null;
const anchorContent = /* @__PURE__ */ import_react.createElement("div", {
ref: wrapperRef,
className: wrapperClass,
style: wrapperStyle
}, /* @__PURE__ */ import_react.createElement("div", { className: anchorClass }, /* @__PURE__ */ import_react.createElement("span", {
className: inkClass,
ref: spanLinkNodeRef,
style: mergedStyles.indicator
}), "items" in props ? createNestedLink(items) : children));
import_react.useEffect(() => {
const scrollContainer = getCurrentContainer();
handleScroll();
scrollContainer?.addEventListener("scroll", handleScroll);
return () => {
scrollContainer?.removeEventListener("scroll", handleScroll);
};
}, [dependencyListItem]);
import_react.useEffect(() => {
if (typeof getCurrentAnchor === "function") setCurrentActiveLink(getCurrentAnchor(activeLinkRef.current || ""));
}, [getCurrentAnchor]);
import_react.useEffect(() => {
updateInk();
}, [
anchorDirection,
getCurrentAnchor,
dependencyListItem,
activeLink
]);
const memoizedContextValue = import_react.useMemo(() => ({
registerLink,
unregisterLink,
scrollTo: handleScrollTo,
activeLink,
onClick,
direction: anchorDirection,
classNames: mergedClassNames,
styles: mergedStyles
}), [
activeLink,
onClick,
handleScrollTo,
anchorDirection,
mergedStyles,
mergedClassNames
]);
const affixProps = isPlainObject(affix) ? affix : void 0;
return /* @__PURE__ */ import_react.createElement(AnchorContext.Provider, { value: memoizedContextValue }, affix ? /* @__PURE__ */ import_react.createElement(Affix, {
offsetTop,
target: getCurrentContainer,
...affixProps
}, anchorContent) : anchorContent);
};
Anchor$1.displayName = "Anchor";
//#endregion
//#region node_modules/antd/es/anchor/index.js
var Anchor = Anchor$1;
Anchor.Link = AnchorLink;
//#endregion
//#region node_modules/@rc-component/util/es/KeyCode.js
/**
* @ignore
* some key-codes definition and utils from closure-library
* @author yiminghe@gmail.com
*/
var KeyCode = {
/**
* MAC_ENTER
*/
MAC_ENTER: 3,
/**
* BACKSPACE
*/
BACKSPACE: 8,
/**
* TAB
*/
TAB: 9,
/**
* NUMLOCK on FF/Safari Mac
*/
NUM_CENTER: 12,
/**
* ENTER
*/
ENTER: 13,
/**
* SHIFT
*/
SHIFT: 16,
/**
* CTRL
*/
CTRL: 17,
/**
* ALT
*/
ALT: 18,
/**
* PAUSE
*/
PAUSE: 19,
/**
* CAPS_LOCK
*/
CAPS_LOCK: 20,
/**
* ESC
*/
ESC: 27,
/**
* SPACE
*/
SPACE: 32,
/**
* PAGE_UP
*/
PAGE_UP: 33,
/**
* PAGE_DOWN
*/
PAGE_DOWN: 34,
/**
* END
*/
END: 35,
/**
* HOME
*/
HOME: 36,
/**
* LEFT
*/
LEFT: 37,
/**
* UP
*/
UP: 38,
/**
* RIGHT
*/
RIGHT: 39,
/**
* DOWN
*/
DOWN: 40,
/**
* PRINT_SCREEN
*/
PRINT_SCREEN: 44,
/**
* INSERT
*/
INSERT: 45,
/**
* DELETE
*/
DELETE: 46,
/**
* ZERO
*/
ZERO: 48,
/**
* ONE
*/
ONE: 49,
/**
* TWO
*/
TWO: 50,
/**
* THREE
*/
THREE: 51,
/**
* FOUR
*/
FOUR: 52,
/**
* FIVE
*/
FIVE: 53,
/**
* SIX
*/
SIX: 54,
/**
* SEVEN
*/
SEVEN: 55,
/**
* EIGHT
*/
EIGHT: 56,
/**
* NINE
*/
NINE: 57,
/**
* QUESTION_MARK
*/
QUESTION_MARK: 63,
/**
* A
*/
A: 65,
/**
* B
*/
B: 66,
/**
* C
*/
C: 67,
/**
* D
*/
D: 68,
/**
* E
*/
E: 69,
/**
* F
*/
F: 70,
/**
* G
*/
G: 71,
/**
* H
*/
H: 72,
/**
* I
*/
I: 73,
/**
* J
*/
J: 74,
/**
* K
*/
K: 75,
/**
* L
*/
L: 76,
/**
* M
*/
M: 77,
/**
* N
*/
N: 78,
/**
* O
*/
O: 79,
/**
* P
*/
P: 80,
/**
* Q
*/
Q: 81,
/**
* R
*/
R: 82,
/**
* S
*/
S: 83,
/**
* T
*/
T: 84,
/**
* U
*/
U: 85,
/**
* V
*/
V: 86,
/**
* W
*/
W: 87,
/**
* X
*/
X: 88,
/**
* Y
*/
Y: 89,
/**
* Z
*/
Z: 90,
/**
* META
*/
META: 91,
/**
* WIN_KEY_RIGHT
*/
WIN_KEY_RIGHT: 92,
/**
* CONTEXT_MENU
*/
CONTEXT_MENU: 93,
/**
* NUM_ZERO
*/
NUM_ZERO: 96,
/**
* NUM_ONE
*/
NUM_ONE: 97,
/**
* NUM_TWO
*/
NUM_TWO: 98,
/**
* NUM_THREE
*/
NUM_THREE: 99,
/**
* NUM_FOUR
*/
NUM_FOUR: 100,
/**
* NUM_FIVE
*/
NUM_FIVE: 101,
/**
* NUM_SIX
*/
NUM_SIX: 102,
/**
* NUM_SEVEN
*/
NUM_SEVEN: 103,
/**
* NUM_EIGHT
*/
NUM_EIGHT: 104,
/**
* NUM_NINE
*/
NUM_NINE: 105,
/**
* NUM_MULTIPLY
*/
NUM_MULTIPLY: 106,
/**
* NUM_PLUS
*/
NUM_PLUS: 107,
/**
* NUM_MINUS
*/
NUM_MINUS: 109,
/**
* NUM_PERIOD
*/
NUM_PERIOD: 110,
/**
* NUM_DIVISION
*/
NUM_DIVISION: 111,
/**
* F1
*/
F1: 112,
/**
* F2
*/
F2: 113,
/**
* F3
*/
F3: 114,
/**
* F4
*/
F4: 115,
/**
* F5
*/
F5: 116,
/**
* F6
*/
F6: 117,
/**
* F7
*/
F7: 118,
/**
* F8
*/
F8: 119,
/**
* F9
*/
F9: 120,
/**
* F10
*/
F10: 121,
/**
* F11
*/
F11: 122,
/**
* F12
*/
F12: 123,
/**
* NUMLOCK
*/
NUMLOCK: 144,
/**
* SEMICOLON
*/
SEMICOLON: 186,
/**
* DASH
*/
DASH: 189,
/**
* EQUALS
*/
EQUALS: 187,
/**
* COMMA
*/
COMMA: 188,
/**
* PERIOD
*/
PERIOD: 190,
/**
* SLASH
*/
SLASH: 191,
/**
* APOSTROPHE
*/
APOSTROPHE: 192,
/**
* SINGLE_QUOTE
*/
SINGLE_QUOTE: 222,
/**
* OPEN_SQUARE_BRACKET
*/
OPEN_SQUARE_BRACKET: 219,
/**
* BACKSLASH
*/
BACKSLASH: 220,
/**
* CLOSE_SQUARE_BRACKET
*/
CLOSE_SQUARE_BRACKET: 221,
/**
* WIN_KEY
*/
WIN_KEY: 224,
/**
* MAC_FF_META
*/
MAC_FF_META: 224,
/**
* WIN_IME
*/
WIN_IME: 229,
/**
* whether text and modified key is entered at the same time.
*/
isTextModifyingKeyEvent: function isTextModifyingKeyEvent(e) {
const { keyCode } = e;
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;
}
},
/**
* whether character is entered.
*/
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;
}
},
isEditableTarget: function isEditableTarget(e) {
const target = e.target;
if (!(target instanceof HTMLElement)) return false;
const tagName = target.tagName;
if (tagName === "INPUT" || tagName === "TEXTAREA" || tagName === "SELECT" || target.isContentEditable) return true;
return false;
}
};
//#endregion
//#region node_modules/@rc-component/notification/es/Notice.js
function _extends$94() {
_extends$94 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$94.apply(this, arguments);
}
var Notify = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, style, className, duration = 4.5, showProgress, pauseOnHover = true, eventKey, content, closable, props: divProps, onClick, onNoticeClose, times, hovering: forcedHovering } = props;
const [hovering, setHovering] = import_react.useState(false);
const [percent, setPercent] = import_react.useState(0);
const [spentTime, setSpentTime] = import_react.useState(0);
const mergedHovering = forcedHovering || hovering;
const mergedDuration = typeof duration === "number" ? duration : 0;
const mergedShowProgress = mergedDuration > 0 && showProgress;
const onInternalClose = () => {
onNoticeClose(eventKey);
};
const onCloseKeyDown = (e) => {
if (e.key === "Enter" || e.code === "Enter" || e.keyCode === KeyCode.ENTER) onInternalClose();
};
import_react.useEffect(() => {
if (!mergedHovering && mergedDuration > 0) {
const start = Date.now() - spentTime;
const timeout = setTimeout(() => {
onInternalClose();
}, mergedDuration * 1e3 - spentTime);
return () => {
if (pauseOnHover) clearTimeout(timeout);
setSpentTime(Date.now() - start);
};
}
}, [
mergedDuration,
mergedHovering,
times
]);
import_react.useEffect(() => {
if (!mergedHovering && mergedShowProgress && (pauseOnHover || spentTime === 0)) {
const start = performance.now();
let animationFrame;
const calculate = () => {
cancelAnimationFrame(animationFrame);
animationFrame = requestAnimationFrame((timestamp) => {
const runtime = timestamp + spentTime - start;
const progress = Math.min(runtime / (mergedDuration * 1e3), 1);
setPercent(progress * 100);
if (progress < 1) calculate();
});
};
calculate();
return () => {
if (pauseOnHover) cancelAnimationFrame(animationFrame);
};
}
}, [
mergedDuration,
spentTime,
mergedHovering,
mergedShowProgress,
times
]);
const closableObj = import_react.useMemo(() => {
if (typeof closable === "object" && closable !== null) return closable;
return {};
}, [closable]);
const ariaProps = pickAttrs(closableObj, true);
const validPercent = 100 - (!percent || percent < 0 ? 0 : percent > 100 ? 100 : percent);
const noticePrefixCls = `${prefixCls}-notice`;
return /* @__PURE__ */ import_react.createElement("div", _extends$94({}, divProps, {
ref,
className: clsx(noticePrefixCls, className, { [`${noticePrefixCls}-closable`]: closable }),
style,
onMouseEnter: (e) => {
setHovering(true);
divProps?.onMouseEnter?.(e);
},
onMouseLeave: (e) => {
setHovering(false);
divProps?.onMouseLeave?.(e);
},
onClick
}), /* @__PURE__ */ import_react.createElement("div", { className: `${noticePrefixCls}-content` }, content), closable && /* @__PURE__ */ import_react.createElement("button", _extends$94({
className: `${noticePrefixCls}-close`,
onKeyDown: onCloseKeyDown,
"aria-label": "Close"
}, ariaProps, { onClick: (e) => {
e.preventDefault();
e.stopPropagation();
onInternalClose();
} }), closableObj.closeIcon ?? "x"), mergedShowProgress && /* @__PURE__ */ import_react.createElement("progress", {
className: `${noticePrefixCls}-progress`,
max: "100",
value: validPercent
}, validPercent + "%"));
});
//#endregion
//#region node_modules/@rc-component/notification/es/NotificationProvider.js
var NotificationContext = /* @__PURE__ */ import_react.createContext({});
var NotificationProvider = ({ children, classNames }) => {
return /* @__PURE__ */ import_react.createElement(NotificationContext.Provider, { value: { classNames } }, children);
};
//#endregion
//#region node_modules/@rc-component/notification/es/hooks/useStack.js
var DEFAULT_OFFSET$2 = 8;
var DEFAULT_THRESHOLD = 3;
var DEFAULT_GAP = 16;
var useStack = (config) => {
const result = {
offset: DEFAULT_OFFSET$2,
threshold: DEFAULT_THRESHOLD,
gap: DEFAULT_GAP
};
if (config && typeof config === "object") {
result.offset = config.offset ?? DEFAULT_OFFSET$2;
result.threshold = config.threshold ?? DEFAULT_THRESHOLD;
result.gap = config.gap ?? DEFAULT_GAP;
}
return [!!config, result];
};
//#endregion
//#region node_modules/@rc-component/notification/es/NoticeList.js
function _extends$93() {
_extends$93 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$93.apply(this, arguments);
}
var NoticeList = (props) => {
const { configList, placement, prefixCls, className, style, motion, onAllNoticeRemoved, onNoticeClose, stack: stackConfig } = props;
const { classNames: ctxCls } = (0, import_react.useContext)(NotificationContext);
const dictRef = (0, import_react.useRef)({});
const [latestNotice, setLatestNotice] = (0, import_react.useState)(null);
const [hoverKeys, setHoverKeys] = (0, import_react.useState)([]);
const keys = configList.map((config) => ({
config,
key: String(config.key)
}));
const [stack, { offset, threshold, gap }] = useStack(stackConfig);
const expanded = stack && (hoverKeys.length > 0 || keys.length <= threshold);
const placementMotion = typeof motion === "function" ? motion(placement) : motion;
(0, import_react.useEffect)(() => {
if (stack && hoverKeys.length > 1) setHoverKeys((prev) => prev.filter((key) => keys.some(({ key: dataKey }) => key === dataKey)));
}, [
hoverKeys,
keys,
stack
]);
(0, import_react.useEffect)(() => {
if (stack && dictRef.current[keys[keys.length - 1]?.key]) setLatestNotice(dictRef.current[keys[keys.length - 1]?.key]);
}, [keys, stack]);
return /* @__PURE__ */ import_react.createElement(CSSMotionList_default, _extends$93({
key: placement,
className: clsx(prefixCls, `${prefixCls}-${placement}`, ctxCls?.list, className, {
[`${prefixCls}-stack`]: !!stack,
[`${prefixCls}-stack-expanded`]: expanded
}),
style,
keys,
motionAppear: true
}, placementMotion, { onAllRemoved: () => {
onAllNoticeRemoved(placement);
} }), ({ config, className: motionClassName, style: motionStyle, index: motionIndex }, nodeRef) => {
const { key, times } = config;
const strKey = String(key);
const { className: configClassName, style: configStyle, classNames: configClassNames, styles: configStyles, ...restConfig } = config;
const dataIndex = keys.findIndex((item) => item.key === strKey);
const stackStyle = {};
if (stack) {
const index = keys.length - 1 - (dataIndex > -1 ? dataIndex : motionIndex - 1);
const transformX = placement === "top" || placement === "bottom" ? "-50%" : "0";
if (index > 0) {
stackStyle.height = expanded ? dictRef.current[strKey]?.offsetHeight : latestNotice?.offsetHeight;
let verticalOffset = 0;
for (let i = 0; i < index; i++) verticalOffset += dictRef.current[keys[keys.length - 1 - i].key]?.offsetHeight + gap;
stackStyle.transform = `translate3d(${transformX}, ${(expanded ? verticalOffset : index * offset) * (placement.startsWith("top") ? 1 : -1)}px, 0) scaleX(${!expanded && latestNotice?.offsetWidth && dictRef.current[strKey]?.offsetWidth ? (latestNotice?.offsetWidth - offset * 2 * (index < 3 ? index : 3)) / dictRef.current[strKey]?.offsetWidth : 1})`;
} else stackStyle.transform = `translate3d(${transformX}, 0, 0)`;
}
return /* @__PURE__ */ import_react.createElement("div", {
ref: nodeRef,
className: clsx(`${prefixCls}-notice-wrapper`, motionClassName, configClassNames?.wrapper),
style: {
...motionStyle,
...stackStyle,
...configStyles?.wrapper
},
onMouseEnter: () => setHoverKeys((prev) => prev.includes(strKey) ? prev : [...prev, strKey]),
onMouseLeave: () => setHoverKeys((prev) => prev.filter((k) => k !== strKey))
}, /* @__PURE__ */ import_react.createElement(Notify, _extends$93({}, restConfig, {
ref: (node) => {
if (dataIndex > -1) dictRef.current[strKey] = node;
else delete dictRef.current[strKey];
},
prefixCls,
classNames: configClassNames,
styles: configStyles,
className: clsx(configClassName, ctxCls?.notice),
style: configStyle,
times,
key,
eventKey: key,
onNoticeClose,
hovering: stack && hoverKeys.length > 0
})));
});
};
NoticeList.displayName = "NoticeList";
//#endregion
//#region node_modules/@rc-component/notification/es/Notifications.js
var Notifications = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls = "rc-notification", container, motion, maxCount, className, style, onAllRemoved, stack, renderNotifications } = props;
const [configList, setConfigList] = import_react.useState([]);
const onNoticeClose = (key) => {
const config = configList.find((item) => item.key === key);
const closable = config?.closable;
const { onClose: closableOnClose } = closable && typeof closable === "object" ? closable : {};
closableOnClose?.();
config?.onClose?.();
setConfigList((list) => list.filter((item) => item.key !== key));
};
import_react.useImperativeHandle(ref, () => ({
open: (config) => {
setConfigList((list) => {
let clone = [...list];
const index = clone.findIndex((item) => item.key === config.key);
const innerConfig = { ...config };
if (index >= 0) {
innerConfig.times = (list[index]?.times || 0) + 1;
clone[index] = innerConfig;
} else {
innerConfig.times = 0;
clone.push(innerConfig);
}
if (maxCount > 0 && clone.length > maxCount) clone = clone.slice(-maxCount);
return clone;
});
},
close: (key) => {
onNoticeClose(key);
},
destroy: () => {
setConfigList([]);
}
}));
const [placements, setPlacements] = import_react.useState({});
import_react.useEffect(() => {
const nextPlacements = {};
configList.forEach((config) => {
const { placement = "topRight" } = config;
if (placement) {
nextPlacements[placement] = nextPlacements[placement] || [];
nextPlacements[placement].push(config);
}
});
Object.keys(placements).forEach((placement) => {
nextPlacements[placement] = nextPlacements[placement] || [];
});
setPlacements(nextPlacements);
}, [configList]);
const onAllNoticeRemoved = (placement) => {
setPlacements((originPlacements) => {
const clone = { ...originPlacements };
if (!(clone[placement] || []).length) delete clone[placement];
return clone;
});
};
const emptyRef = import_react.useRef(false);
import_react.useEffect(() => {
if (Object.keys(placements).length > 0) emptyRef.current = true;
else if (emptyRef.current) {
onAllRemoved?.();
emptyRef.current = false;
}
}, [placements]);
if (!container) return null;
const placementList = Object.keys(placements);
return /* @__PURE__ */ (0, import_react_dom.createPortal)(/* @__PURE__ */ import_react.createElement(import_react.Fragment, null, placementList.map((placement) => {
const placementConfigList = placements[placement];
const list = /* @__PURE__ */ import_react.createElement(NoticeList, {
key: placement,
configList: placementConfigList,
placement,
prefixCls,
className: className?.(placement),
style: style?.(placement),
motion,
onNoticeClose,
onAllNoticeRemoved,
stack
});
return renderNotifications ? renderNotifications(list, {
prefixCls,
key: placement
}) : list;
})), container);
});
Notifications.displayName = "Notifications";
//#endregion
//#region node_modules/@rc-component/notification/es/hooks/useNotification.js
var defaultGetContainer = () => document.body;
var uniqueKey = 0;
function mergeConfig(...objList) {
const clone = {};
objList.forEach((obj) => {
if (obj) Object.keys(obj).forEach((key) => {
const val = obj[key];
if (val !== void 0) clone[key] = val;
});
});
return clone;
}
function useNotification$1(rootConfig = {}) {
const { getContainer = defaultGetContainer, motion, prefixCls, maxCount, className, style, onAllRemoved, stack, renderNotifications, ...shareConfig } = rootConfig;
const [container, setContainer] = import_react.useState();
const notificationsRef = import_react.useRef();
const contextHolder = /* @__PURE__ */ import_react.createElement(Notifications, {
container,
ref: notificationsRef,
prefixCls,
motion,
maxCount,
className,
style,
onAllRemoved,
stack,
renderNotifications
});
const [taskQueue, setTaskQueue] = import_react.useState([]);
const open = useEvent((config) => {
const mergedConfig = mergeConfig(shareConfig, config);
if (mergedConfig.key === null || mergedConfig.key === void 0) {
mergedConfig.key = `rc-notification-${uniqueKey}`;
uniqueKey += 1;
}
setTaskQueue((queue) => [...queue, {
type: "open",
config: mergedConfig
}]);
});
const api = import_react.useMemo(() => ({
open,
close: (key) => {
setTaskQueue((queue) => [...queue, {
type: "close",
key
}]);
},
destroy: () => {
setTaskQueue((queue) => [...queue, { type: "destroy" }]);
}
}), []);
import_react.useEffect(() => {
setContainer(getContainer());
});
import_react.useEffect(() => {
if (notificationsRef.current && taskQueue.length) {
taskQueue.forEach((task) => {
switch (task.type) {
case "open":
notificationsRef.current.open(task.config);
break;
case "close":
notificationsRef.current.close(task.key);
break;
case "destroy":
notificationsRef.current.destroy();
break;
}
});
let oriTaskQueue;
let tgtTaskQueue;
setTaskQueue((oriQueue) => {
if (oriTaskQueue !== oriQueue || !tgtTaskQueue) {
oriTaskQueue = oriQueue;
tgtTaskQueue = oriQueue.filter((task) => !taskQueue.includes(task));
}
return tgtTaskQueue;
});
}
}, [taskQueue]);
return [api, contextHolder];
}
//#endregion
//#region node_modules/antd/es/message/style/index.js
var genMessageStyle = (token) => {
const { componentCls, iconCls, boxShadow, colorText, colorSuccess, colorError, colorWarning, colorInfo, fontSizeLG, motionEaseInOutCirc, motionDurationSlow, marginXS, paddingXS, borderRadiusLG, zIndexPopup, contentPadding, contentBg } = token;
const noticeCls = `${componentCls}-notice`;
const messageMoveIn = new Keyframe("MessageMoveIn", {
"0%": {
padding: 0,
transform: "translateY(-100%)",
opacity: 0
},
"100%": {
padding: paddingXS,
transform: "translateY(0)",
opacity: 1
}
});
const messageMoveOut = new Keyframe("MessageMoveOut", {
"0%": {
maxHeight: token.height,
padding: paddingXS,
opacity: 1
},
"100%": {
maxHeight: 0,
padding: 0,
opacity: 0
}
});
const noticeStyle = {
padding: paddingXS,
textAlign: "center",
[`${componentCls}-custom-content`]: {
display: "flex",
alignItems: "center"
},
[`${componentCls}-custom-content > ${iconCls}`]: {
marginInlineEnd: marginXS,
fontSize: fontSizeLG
},
[`${noticeCls}-content`]: {
display: "inline-block",
padding: contentPadding,
background: contentBg,
borderRadius: borderRadiusLG,
boxShadow,
pointerEvents: "all"
},
[`${componentCls}-success > ${iconCls}`]: { color: colorSuccess },
[`${componentCls}-error > ${iconCls}`]: { color: colorError },
[`${componentCls}-warning > ${iconCls}`]: { color: colorWarning },
[`${componentCls}-info > ${iconCls},
${componentCls}-loading > ${iconCls}`]: { color: colorInfo }
};
return [
{ [componentCls]: {
...resetComponent(token),
color: colorText,
position: "fixed",
top: marginXS,
width: "100%",
pointerEvents: "none",
zIndex: zIndexPopup,
[`${componentCls}-move-up`]: { animationFillMode: "forwards" },
[`
${componentCls}-move-up-appear,
${componentCls}-move-up-enter
`]: {
animationName: messageMoveIn,
animationDuration: motionDurationSlow,
animationPlayState: "paused",
animationTimingFunction: motionEaseInOutCirc
},
[`
${componentCls}-move-up-appear${componentCls}-move-up-appear-active,
${componentCls}-move-up-enter${componentCls}-move-up-enter-active
`]: { animationPlayState: "running" },
[`${componentCls}-move-up-leave`]: {
animationName: messageMoveOut,
animationDuration: motionDurationSlow,
animationPlayState: "paused",
animationTimingFunction: motionEaseInOutCirc
},
[`${componentCls}-move-up-leave${componentCls}-move-up-leave-active`]: { animationPlayState: "running" },
"&-rtl": {
direction: "rtl",
span: { direction: "rtl" }
}
} },
{ [componentCls]: { [`${noticeCls}-wrapper`]: { ...noticeStyle } } },
{ [`${componentCls}-notice-pure-panel`]: {
...noticeStyle,
padding: 0,
textAlign: "start"
} }
];
};
var prepareComponentToken$54 = (token) => ({
zIndexPopup: token.zIndexPopupBase + CONTAINER_MAX_OFFSET + 10,
contentBg: token.colorBgElevated,
contentPadding: `${(token.controlHeightLG - token.fontSize * token.lineHeight) / 2}px ${token.paddingSM}px`
});
var style_default$61 = genStyleHooks("Message", (token) => {
return genMessageStyle(merge(token, { height: 150 }));
}, prepareComponentToken$54);
//#endregion
//#region node_modules/antd/es/message/PurePanel.js
var TypeIcon = {
info: /* @__PURE__ */ import_react.createElement(RefIcon$2, null),
success: /* @__PURE__ */ import_react.createElement(RefIcon$1, null),
error: /* @__PURE__ */ import_react.createElement(RefIcon$3, null),
warning: /* @__PURE__ */ import_react.createElement(RefIcon$4, null),
loading: /* @__PURE__ */ import_react.createElement(RefIcon$5, null)
};
var PureContent$1 = (props) => {
const { prefixCls, type, icon, children, classNames: pureContentClassNames, styles } = props;
const iconNode = cloneElement$1(icon || type && TypeIcon[type], (currentProps) => {
const mergedStyle = {
...currentProps?.style,
...styles?.icon
};
return {
className: clsx(currentProps.className, pureContentClassNames?.icon),
style: mergedStyle
};
});
return /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-custom-content`, `${prefixCls}-${type}`) }, iconNode, /* @__PURE__ */ import_react.createElement("span", {
className: pureContentClassNames?.content,
style: styles?.content
}, children));
};
/** @private Internal Component. Do not use in your production. */
var PurePanel$14 = (props) => {
const { prefixCls: staticPrefixCls, className, style, type, icon, content, classNames: messageClassNames, styles, ...restProps } = props;
const { getPrefixCls, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("message");
const prefixCls = staticPrefixCls || getPrefixCls("message");
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$61(prefixCls, rootCls);
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, messageClassNames], [contextStyles, styles], { props });
return /* @__PURE__ */ import_react.createElement(Notify, {
...restProps,
prefixCls,
className: clsx(contextClassName, mergedClassNames.root, className, hashId, `${prefixCls}-notice-pure-panel`, cssVarCls, rootCls),
style: {
...mergedStyles.root,
...contextStyle,
...style
},
eventKey: "pure",
duration: null,
content: /* @__PURE__ */ import_react.createElement(PureContent$1, {
prefixCls,
type,
icon,
classNames: mergedClassNames,
styles: mergedStyles
}, content)
});
};
//#endregion
//#region node_modules/antd/es/message/util.js
function getMotion$2(prefixCls, transitionName) {
return { motionName: transitionName ?? `${prefixCls}-move-up` };
}
/** Wrap message open with promise like function */
function wrapPromiseFn(openFn) {
let closeFn;
const closePromise = new Promise((resolve) => {
closeFn = openFn(() => {
resolve(true);
});
});
const result = () => {
closeFn?.();
};
result.then = (filled, rejected) => closePromise.then(filled, rejected);
result.promise = closePromise;
return result;
}
//#endregion
//#region node_modules/antd/es/message/useMessage.js
var DEFAULT_OFFSET$1 = 8;
var DEFAULT_DURATION$1 = 3;
var Wrapper$1 = ({ children, prefixCls }) => {
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$61(prefixCls, rootCls);
return /* @__PURE__ */ import_react.createElement(NotificationProvider, { classNames: { list: clsx(hashId, cssVarCls, rootCls) } }, children);
};
var renderNotifications$1 = (node, { prefixCls, key }) => /* @__PURE__ */ import_react.createElement(Wrapper$1, {
prefixCls,
key
}, node);
var Holder$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { top, prefixCls: staticPrefixCls, getContainer: staticGetContainer, maxCount, duration = DEFAULT_DURATION$1, rtl, transitionName, onAllRemoved, pauseOnHover = true } = props;
const { getPrefixCls, direction, getPopupContainer } = useComponentConfig("message");
const { message } = import_react.useContext(ConfigContext);
const prefixCls = staticPrefixCls || getPrefixCls("message");
const getStyle = () => ({
left: "50%",
transform: "translateX(-50%)",
top: top ?? DEFAULT_OFFSET$1
});
const getClassName = () => clsx({ [`${prefixCls}-rtl`]: rtl ?? direction === "rtl" });
const getNotificationMotion = () => getMotion$2(prefixCls, transitionName);
const [mergedClassNames, mergedStyles] = useMergeSemantic([props?.classNames, message?.classNames], [props?.styles, message?.styles], { props });
const [api, holder] = useNotification$1({
prefixCls,
style: getStyle,
className: getClassName,
motion: getNotificationMotion,
closable: false,
duration,
getContainer: () => staticGetContainer?.() || getPopupContainer?.() || document.body,
maxCount,
onAllRemoved,
renderNotifications: renderNotifications$1,
pauseOnHover
});
import_react.useImperativeHandle(ref, () => ({
...api,
prefixCls,
message,
classNames: mergedClassNames,
styles: mergedStyles
}));
return holder;
});
var keyIndex = 0;
function useInternalMessage(messageConfig) {
const holderRef = import_react.useRef(null);
const warning = devUseWarning("Message");
return [import_react.useMemo(() => {
const close = (key) => {
holderRef.current?.close(key);
};
const open = (config) => {
if (!holderRef.current) {
warning(false, "usage", "You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.");
const fakeResult = () => {};
fakeResult.then = () => {};
return fakeResult;
}
const { open: originOpen, prefixCls, message, classNames: originClassNames, styles: originStyles } = holderRef.current;
const contextClassName = message?.className || {};
const contextStyle = message?.style || {};
const rawContextClassNames = message?.classNames || {};
const rawContextStyles = message?.styles || {};
const noticePrefixCls = `${prefixCls}-notice`;
const { content, icon, type, key, className, style, onClose, classNames: configClassNames = {}, styles = {}, ...restConfig } = config;
let mergedKey = key;
if (!isNonNullable(mergedKey)) {
keyIndex += 1;
mergedKey = `antd-message-${keyIndex}`;
}
const contextConfig = {
...messageConfig,
...config
};
const contextClassNames = resolveStyleOrClass(rawContextClassNames, { props: contextConfig });
const semanticClassNames = resolveStyleOrClass(configClassNames, { props: contextConfig });
const contextStyles = resolveStyleOrClass(rawContextStyles, { props: contextConfig });
const semanticStyles = resolveStyleOrClass(styles, { props: contextConfig });
const mergedClassNames = mergeClassNames(void 0, contextClassNames, semanticClassNames, originClassNames);
const mergedStyles = mergeStyles(contextStyles, semanticStyles, originStyles);
return wrapPromiseFn((resolve) => {
originOpen({
...restConfig,
key: mergedKey,
content: /* @__PURE__ */ import_react.createElement(PureContent$1, {
prefixCls,
type,
icon,
classNames: mergedClassNames,
styles: mergedStyles
}, content),
placement: "top",
className: clsx({ [`${noticePrefixCls}-${type}`]: type }, className, contextClassName, mergedClassNames.root),
style: {
...mergedStyles.root,
...contextStyle,
...style
},
onClose: () => {
onClose?.();
resolve();
}
});
return () => {
close(mergedKey);
};
});
};
const destroy = (key) => {
if (key !== void 0) close(key);
else holderRef.current?.destroy();
};
const clone = {
open,
destroy
};
[
"info",
"success",
"warning",
"error",
"loading"
].forEach((type) => {
const typeOpen = (jointContent, duration, onClose) => {
let config;
if (isPlainObject(jointContent) && "content" in jointContent) config = jointContent;
else config = { content: jointContent };
let mergedDuration;
let mergedOnClose;
if (typeof duration === "function") mergedOnClose = duration;
else {
mergedDuration = duration;
mergedOnClose = onClose;
}
return open({
onClose: mergedOnClose,
duration: mergedDuration,
...config,
type
});
};
clone[type] = typeOpen;
});
return clone;
}, []), /* @__PURE__ */ import_react.createElement(Holder$1, {
key: "message-holder",
...messageConfig,
ref: holderRef
})];
}
function useMessage(messageConfig) {
return useInternalMessage(messageConfig);
}
//#endregion
//#region node_modules/@rc-component/util/es/React/render.js
var import_client = require_client();
var MARK = "__rc_react_root__";
function render(node, container) {
const root = container[MARK] || (0, import_client.createRoot)(container);
root.render(node);
container[MARK] = root;
}
async function unmount(container) {
return Promise.resolve().then(() => {
container[MARK]?.unmount();
delete container[MARK];
});
}
//#endregion
//#region node_modules/antd/es/_util/motion.js
var getCollapsedHeight = () => ({
height: 0,
opacity: 0
});
var getRealHeight = (node) => ({
height: node?.scrollHeight ?? 0,
opacity: node ? 1 : 0
});
var getCurrentHeight = (node) => ({ height: node?.offsetHeight ?? 0 });
var isTransitionEvent = (event) => {
return isPlainObject(event) && "propertyName" in event;
};
var skipOpacityTransition = (_, event) => {
return event?.deadline === true || (isTransitionEvent(event) ? event.propertyName === "height" : false);
};
var initCollapseMotion = (rootCls = "ant") => ({
motionName: `${rootCls}-motion-collapse`,
onAppearStart: getCollapsedHeight,
onEnterStart: getCollapsedHeight,
onAppearActive: getRealHeight,
onEnterActive: getRealHeight,
onLeaveStart: getCurrentHeight,
onLeaveActive: getCollapsedHeight,
onAppearEnd: skipOpacityTransition,
onEnterEnd: skipOpacityTransition,
onLeaveEnd: skipOpacityTransition,
motionDeadline: 500
});
var getTransitionName = (rootPrefixCls, motion, transitionName) => {
if (transitionName !== void 0) return transitionName;
return `${rootPrefixCls}-${motion}`;
};
//#endregion
//#region node_modules/antd/es/_util/wave/style.js
var genWaveStyle = (token) => {
const { componentCls, colorPrimary, motionDurationSlow, motionEaseInOut, motionEaseOutCirc, antCls } = token;
const [, varRef] = genCssVar(antCls, "wave");
return { [componentCls]: {
position: "absolute",
background: "transparent",
pointerEvents: "none",
boxSizing: "border-box",
color: varRef("color", colorPrimary),
boxShadow: `0 0 0 0 currentcolor`,
opacity: .2,
"&.wave-motion-appear": {
transition: [`box-shadow 0.4s`, `opacity 2s`].map((prop) => `${prop} ${motionEaseOutCirc}`).join(","),
"&-active": {
boxShadow: `0 0 0 6px currentcolor`,
opacity: 0
},
"&.wave-quick": { transition: [`box-shadow`, `opacity`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(",") }
}
} };
};
var style_default$60 = genComponentStyleHook("Wave", genWaveStyle);
//#endregion
//#region node_modules/antd/es/_util/wave/interface.js
var TARGET_CLS = `ant-wave-target`;
//#endregion
//#region node_modules/antd/es/_util/wave/util.js
function isValidWaveColor(color) {
return color && typeof color === "string" && color !== "#fff" && color !== "#ffffff" && color !== "rgb(255, 255, 255)" && color !== "rgba(255, 255, 255, 1)" && !/rgba\((?:\d*, ){3}0\)/.test(color) && color !== "transparent" && color !== "canvastext";
}
function getTargetWaveColor(node, colorSource = null) {
const style = getComputedStyle(node);
const { borderTopColor, borderColor, backgroundColor } = style;
if (colorSource && isValidWaveColor(style[colorSource])) return style[colorSource];
return [
borderTopColor,
borderColor,
backgroundColor
].find(isValidWaveColor) ?? null;
}
//#endregion
//#region node_modules/antd/es/_util/wave/WaveEffect.js
function validateNum(value) {
return Number.isNaN(value) ? 0 : value;
}
var WaveEffect = (props) => {
const { className, target, component, colorSource } = props;
const divRef = import_react.useRef(null);
const { getPrefixCls } = import_react.useContext(ConfigContext);
const [varName] = genCssVar(getPrefixCls(), "wave");
const [waveColor, setWaveColor] = import_react.useState(null);
const [borderRadius, setBorderRadius] = import_react.useState([]);
const [left, setLeft] = import_react.useState(0);
const [top, setTop] = import_react.useState(0);
const [width, setWidth] = import_react.useState(0);
const [height, setHeight] = import_react.useState(0);
const [enabled, setEnabled] = import_react.useState(false);
const waveStyle = {
left,
top,
width,
height,
borderRadius: borderRadius.map((radius) => `${radius}px`).join(" ")
};
if (waveColor) waveStyle[varName("color")] = waveColor;
function syncPos() {
const nodeStyle = getComputedStyle(target);
setWaveColor(getTargetWaveColor(target, colorSource));
const isStatic = nodeStyle.position === "static";
const { borderLeftWidth, borderTopWidth } = nodeStyle;
setLeft(isStatic ? target.offsetLeft : validateNum(-Number.parseFloat(borderLeftWidth)));
setTop(isStatic ? target.offsetTop : validateNum(-Number.parseFloat(borderTopWidth)));
setWidth(target.offsetWidth);
setHeight(target.offsetHeight);
const { borderTopLeftRadius, borderTopRightRadius, borderBottomLeftRadius, borderBottomRightRadius } = nodeStyle;
setBorderRadius([
borderTopLeftRadius,
borderTopRightRadius,
borderBottomRightRadius,
borderBottomLeftRadius
].map((radius) => validateNum(Number.parseFloat(radius))));
}
import_react.useEffect(() => {
if (target) {
const id = wrapperRaf(() => {
syncPos();
setEnabled(true);
});
let resizeObserver;
if (typeof ResizeObserver !== "undefined") {
resizeObserver = new ResizeObserver(syncPos);
resizeObserver.observe(target);
}
return () => {
wrapperRaf.cancel(id);
resizeObserver?.disconnect();
};
}
}, [target]);
if (!enabled) return null;
const isSmallComponent = (component === "Checkbox" || component === "Radio") && target?.classList.contains(TARGET_CLS);
return /* @__PURE__ */ import_react.createElement(es_default$28, {
visible: true,
motionAppear: true,
motionName: "wave-motion",
motionDeadline: 5e3,
onAppearEnd: (_, event) => {
if (event.deadline || event.propertyName === "opacity") {
const holder = divRef.current?.parentElement;
unmount(holder).then(() => {
holder?.remove();
});
}
return false;
}
}, ({ className: motionClassName }, ref) => /* @__PURE__ */ import_react.createElement("div", {
ref: composeRef(divRef, ref),
className: clsx(className, motionClassName, { "wave-quick": isSmallComponent }),
style: waveStyle
}));
};
var showWaveEffect = (target, info) => {
const { component } = info;
if (component === "Checkbox" && !target.querySelector("input")?.checked) return;
const holder = document.createElement("div");
holder.style.position = "absolute";
holder.style.left = "0px";
holder.style.top = "0px";
target?.insertBefore(holder, target?.firstChild);
render(/* @__PURE__ */ import_react.createElement(WaveEffect, {
...info,
target
}), holder);
};
//#endregion
//#region node_modules/antd/es/_util/wave/useWave.js
var useWave = (nodeRef, className, component, colorSource) => {
const { wave } = import_react.useContext(ConfigContext);
const [, token, hashId] = useToken$1();
const showWave = useEvent((event) => {
const node = nodeRef.current;
if (wave?.disabled || !node) return;
const targetNode = node.querySelector(`.${TARGET_CLS}`) || node;
const { showEffect } = wave || {};
(showEffect || showWaveEffect)(targetNode, {
className,
token,
component,
event,
hashId,
colorSource
});
});
const rafIdRef = import_react.useRef(null);
import_react.useEffect(() => () => {
wrapperRaf.cancel(rafIdRef.current);
}, []);
const showDebounceWave = (event) => {
wrapperRaf.cancel(rafIdRef.current);
rafIdRef.current = wrapperRaf(() => {
showWave(event);
});
};
return showDebounceWave;
};
//#endregion
//#region node_modules/antd/es/_util/wave/index.js
var Wave = (props) => {
const { children, disabled, component, colorSource } = props;
const { getPrefixCls } = (0, import_react.useContext)(ConfigContext);
const containerRef = (0, import_react.useRef)(null);
const prefixCls = getPrefixCls("wave");
const showWave = useWave(containerRef, clsx(prefixCls, style_default$60(prefixCls)), component, colorSource);
import_react.useEffect(() => {
const node = containerRef.current;
if (!node || node.nodeType !== window.Node.ELEMENT_NODE || disabled) return;
const onClick = (e) => {
if (!isVisible_default(e.target) || !node.getAttribute || node.getAttribute("disabled") || node.disabled || node.className.includes("disabled") && !node.className.includes("disabled:") || node.getAttribute("aria-disabled") === "true" || node.className.includes("-leave")) return;
showWave(e);
};
node.addEventListener("click", onClick, true);
return () => {
node.removeEventListener("click", onClick, true);
};
}, [disabled]);
if (!/* @__PURE__ */ import_react.isValidElement(children)) return children ?? null;
return cloneElement$1(children, { ref: supportRef(children) ? composeRef(getNodeRef(children), containerRef) : containerRef });
};
Wave.displayName = "Wave";
//#endregion
//#region node_modules/antd/es/config-provider/hooks/useSize.js
var useSize = (customSize) => {
const size = import_react.useContext(SizeContext);
return import_react.useMemo(() => {
if (!customSize) return size;
if (typeof customSize === "string") return customSize ?? size;
if (typeof customSize === "function") return customSize(size);
return size;
}, [customSize, size]);
};
//#endregion
//#region node_modules/antd/es/space/style/compact.js
var genSpaceCompactStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
display: "inline-flex",
"&-block": {
display: "flex",
width: "100%"
},
"&-vertical": { flexDirection: "column" },
"&-rtl": { direction: "rtl" }
} };
};
var compact_default$1 = genStyleHooks(["Space", "Compact"], genSpaceCompactStyle, () => ({}), { resetStyle: false });
//#endregion
//#region node_modules/antd/es/space/Compact.js
var SpaceCompactItemContext = /* @__PURE__ */ import_react.createContext(null);
var useCompactItemContext = (prefixCls, direction) => {
const compactItemContext = import_react.useContext(SpaceCompactItemContext);
const compactItemClassnames = import_react.useMemo(() => {
if (!compactItemContext) return "";
const { compactDirection, isFirstItem, isLastItem } = compactItemContext;
const separator = compactDirection === "vertical" ? "-vertical-" : "-";
return clsx(`${prefixCls}-compact${separator}item`, {
[`${prefixCls}-compact${separator}first-item`]: isFirstItem,
[`${prefixCls}-compact${separator}last-item`]: isLastItem,
[`${prefixCls}-compact${separator}item-rtl`]: direction === "rtl"
});
}, [
prefixCls,
direction,
compactItemContext
]);
return {
compactSize: compactItemContext?.compactSize,
compactDirection: compactItemContext?.compactDirection,
compactItemClassnames
};
};
var NoCompactStyle = (props) => {
const { children } = props;
return /* @__PURE__ */ import_react.createElement(SpaceCompactItemContext.Provider, { value: null }, children);
};
var CompactItem = (props) => {
const { children, ...others } = props;
return /* @__PURE__ */ import_react.createElement(SpaceCompactItemContext.Provider, { value: import_react.useMemo(() => others, [others]) }, children);
};
var Compact = (props) => {
const { getPrefixCls, direction: directionConfig } = import_react.useContext(ConfigContext);
const { size, direction, orientation, block, prefixCls: customizePrefixCls, className, rootClassName, children, vertical, ...restProps } = props;
devUseWarning("Space.Compact").deprecated(!direction, "direction", "orientation");
const [mergedOrientation, mergedVertical] = useOrientation(orientation, vertical, direction);
const mergedSize = useSize((ctx) => size ?? ctx);
const prefixCls = getPrefixCls("space-compact", customizePrefixCls);
const [hashId] = compact_default$1(prefixCls);
const clx = clsx(prefixCls, hashId, {
[`${prefixCls}-rtl`]: directionConfig === "rtl",
[`${prefixCls}-block`]: block,
[`${prefixCls}-vertical`]: mergedVertical
}, className, rootClassName);
const compactItemContext = import_react.useContext(SpaceCompactItemContext);
const childNodes = toArray$8(children);
const nodes = import_react.useMemo(() => childNodes.map((child, i) => {
const key = child?.key || `${prefixCls}-item-${i}`;
return /* @__PURE__ */ import_react.createElement(CompactItem, {
key,
compactSize: mergedSize,
compactDirection: mergedOrientation,
isFirstItem: i === 0 && (!compactItemContext || compactItemContext?.isFirstItem),
isLastItem: i === childNodes.length - 1 && (!compactItemContext || compactItemContext?.isLastItem)
}, child);
}), [
childNodes,
compactItemContext,
mergedOrientation,
mergedSize,
prefixCls
]);
if (childNodes.length === 0) return null;
return /* @__PURE__ */ import_react.createElement("div", {
className: clx,
...restProps
}, nodes);
};
//#endregion
//#region node_modules/antd/es/button/ButtonGroup.js
var GroupSizeContext = /* @__PURE__ */ import_react.createContext(void 0);
var ButtonGroup = (props) => {
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, size, className, ...others } = props;
const prefixCls = getPrefixCls("btn-group", customizePrefixCls);
const [, , hashId] = useToken$1();
const sizeCls = import_react.useMemo(() => {
switch (size) {
case "large": return "lg";
case "small": return "sm";
default: return "";
}
}, [size]);
{
const warning = devUseWarning("Button.Group");
warning.deprecated(false, "Button.Group", "Space.Compact");
warning(!size || [
"large",
"medium",
"small"
].includes(size), "usage", "Invalid prop `size`.");
}
const classes = clsx(prefixCls, {
[`${prefixCls}-${sizeCls}`]: sizeCls,
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, hashId);
return /* @__PURE__ */ import_react.createElement(GroupSizeContext.Provider, { value: size }, /* @__PURE__ */ import_react.createElement("div", {
...others,
className: classes
}));
};
//#endregion
//#region node_modules/antd/es/button/buttonHelpers.js
var rxTwoCNChar = /^[\u4E00-\u9FA5]{2}$/;
var isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
function convertLegacyProps(type) {
if (type === "danger") return { danger: true };
return { type };
}
function isUnBorderedButtonVariant(type) {
return type === "text" || type === "link";
}
function splitCNCharsBySpace(child, needInserted, style, className) {
if (!isNonNullable(child) || child === "") return;
const SPACE = needInserted ? " " : "";
if (typeof child !== "string" && typeof child !== "number" && isString(child.type) && isTwoCNChar(child.props.children)) return cloneElement$1(child, (oriProps) => {
const mergedCls = clsx(oriProps.className, className) || void 0;
const mergedStyle = {
...style,
...oriProps.style
};
return {
...oriProps,
children: oriProps.children.split("").join(SPACE),
className: mergedCls,
style: mergedStyle
};
});
if (isString(child)) return /* @__PURE__ */ import_react.createElement("span", {
className,
style
}, isTwoCNChar(child) ? child.split("").join(SPACE) : child);
if (isFragment(child)) return /* @__PURE__ */ import_react.createElement("span", {
className,
style
}, child);
return cloneElement$1(child, (oriProps) => ({
...oriProps,
className: clsx(oriProps.className, className) || void 0,
style: {
...oriProps.style,
...style
}
}));
}
function spaceChildren(children, needInserted, style, className) {
let isPrevChildPure = false;
const childList = [];
import_react.Children.forEach(children, (child) => {
const type = typeof child;
const isCurrentChildPure = type === "string" || type === "number";
if (isPrevChildPure && isCurrentChildPure) {
const lastIndex = childList.length - 1;
childList[lastIndex] = `${childList[lastIndex]}${child}`;
} else childList.push(child);
isPrevChildPure = isCurrentChildPure;
});
return import_react.Children.map(childList, (child) => splitCNCharsBySpace(child, needInserted, style, className));
}
[
"default",
"primary",
"danger"
].concat(_toConsumableArray$8(PresetColors));
//#endregion
//#region node_modules/antd/es/button/IconWrapper.js
var IconWrapper = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { className, style, children, prefixCls } = props;
const iconWrapperCls = clsx(`${prefixCls}-icon`, className);
return /* @__PURE__ */ import_react.createElement("span", {
ref,
className: iconWrapperCls,
style
}, children);
});
//#endregion
//#region node_modules/antd/es/button/DefaultLoadingIcon.js
var InnerLoadingIcon = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls, className, style, iconClassName } = props;
const mergedIconCls = clsx(`${prefixCls}-loading-icon`, className);
return /* @__PURE__ */ import_react.createElement(IconWrapper, {
prefixCls,
className: mergedIconCls,
style,
ref
}, /* @__PURE__ */ import_react.createElement(RefIcon$5, { className: iconClassName }));
});
var getCollapsedWidth = () => ({
width: 0,
opacity: 0,
transform: "scale(0)"
});
var getRealWidth = (node) => ({
width: node.scrollWidth,
opacity: 1,
transform: "scale(1)"
});
var DefaultLoadingIcon = (props) => {
const { prefixCls, loading, existIcon, className, style, mount } = props;
const visible = !!loading;
if (existIcon) return /* @__PURE__ */ import_react.createElement(InnerLoadingIcon, {
prefixCls,
className,
style
});
return /* @__PURE__ */ import_react.createElement(es_default$28, {
visible,
motionName: `${prefixCls}-loading-icon-motion`,
motionAppear: !mount,
motionEnter: !mount,
motionLeave: !mount,
removeOnLeave: true,
onAppearStart: getCollapsedWidth,
onAppearActive: getRealWidth,
onEnterStart: getCollapsedWidth,
onEnterActive: getRealWidth,
onLeaveStart: getRealWidth,
onLeaveActive: getCollapsedWidth
}, ({ className: motionCls, style: motionStyle }, ref) => {
const mergedStyle = {
...style,
...motionStyle
};
return /* @__PURE__ */ import_react.createElement(InnerLoadingIcon, {
prefixCls,
className: clsx(className, motionCls),
style: mergedStyle,
ref
});
});
};
//#endregion
//#region node_modules/antd/es/style/motion/collapse.js
var genCollapseMotion = (token) => {
const { componentCls, antCls, motionDurationMid, motionEaseInOut } = token;
return { [componentCls]: {
[`${antCls}-motion-collapse-legacy`]: {
overflow: "hidden",
"&-active": { transition: `${["height", "opacity"].map((prop) => `${prop} ${motionDurationMid} ${motionEaseInOut}`).join(", ")} !important` }
},
[`${antCls}-motion-collapse`]: {
overflow: "hidden",
transition: `${["height", "opacity"].map((prop) => `${prop} ${motionDurationMid} ${motionEaseInOut}`).join(", ")} !important`
}
} };
};
//#endregion
//#region node_modules/antd/es/style/motion/motion.js
var initMotionCommon = (duration) => ({
animationDuration: duration,
animationFillMode: "both"
});
var initMotion = (motionCls, inKeyframes, outKeyframes, duration, sameLevel = false) => {
const sameLevelPrefix = sameLevel ? "&" : "";
return {
[`
${sameLevelPrefix}${motionCls}-enter,
${sameLevelPrefix}${motionCls}-appear
`]: {
...initMotionCommon(duration),
animationPlayState: "paused"
},
[`${sameLevelPrefix}${motionCls}-leave`]: {
...initMotionCommon(duration),
animationPlayState: "paused"
},
[`
${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
`]: {
animationName: inKeyframes,
animationPlayState: "running"
},
[`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
animationName: outKeyframes,
animationPlayState: "running",
pointerEvents: "none"
}
};
};
//#endregion
//#region node_modules/antd/es/style/motion/fade.js
var fadeIn = new Keyframe("antFadeIn", {
"0%": { opacity: 0 },
"100%": { opacity: 1 }
});
var fadeOut = new Keyframe("antFadeOut", {
"0%": { opacity: 1 },
"100%": { opacity: 0 }
});
/**
* Initialize fade motion styles
*
* Generates CSS styles for fade in/out transition animations when elements are shown/hidden.
* Supports enter, appear, and leave animation states.
*
* @param token - Object containing design tokens and CSS class prefix
* @param sameLevel - Controls CSS selector nesting behavior:
* - `false` (default): Generates descendant selectors like `.ant-fade-enter`, `.ant-fade-appear`
* - `true`: Generates same-level selectors with `&` prefix like `&.ant-fade-enter`, `&.ant-fade-appear`
* Use `true` when the motion classes are applied to the same element as the parent selector,
* Use `false` when the motion classes are applied to child elements
* @returns CSS interpolation object containing fade motion styles
*
* @example
* ```ts
* // For child elements (default behavior)
* const fadeStyles = initFadeMotion(token);
* // Generates: .parent .ant-fade-enter { ... }
*
* // For same element
* const sameLevelFadeStyles = initFadeMotion(token, true);
* // Generates: .parent.ant-fade-enter { ... }
* ```
*/
var initFadeMotion = (token, sameLevel = false) => {
const { antCls } = token;
const motionCls = `${antCls}-fade`;
const sameLevelPrefix = sameLevel ? "&" : "";
return [initMotion(motionCls, fadeIn, fadeOut, token.motionDurationMid, sameLevel), {
[`
${sameLevelPrefix}${motionCls}-enter,
${sameLevelPrefix}${motionCls}-appear
`]: {
opacity: 0,
animationTimingFunction: "linear"
},
[`${sameLevelPrefix}${motionCls}-leave`]: { animationTimingFunction: "linear" }
}];
};
//#endregion
//#region node_modules/antd/es/style/motion/move.js
var moveDownIn = new Keyframe("antMoveDownIn", {
"0%": {
transform: "translate3d(0, 100%, 0)",
transformOrigin: "0 0",
opacity: 0
},
"100%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
}
});
var moveDownOut = new Keyframe("antMoveDownOut", {
"0%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
},
"100%": {
transform: "translate3d(0, 100%, 0)",
transformOrigin: "0 0",
opacity: 0
}
});
var moveLeftIn = new Keyframe("antMoveLeftIn", {
"0%": {
transform: "translate3d(-100%, 0, 0)",
transformOrigin: "0 0",
opacity: 0
},
"100%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
}
});
var moveLeftOut = new Keyframe("antMoveLeftOut", {
"0%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
},
"100%": {
transform: "translate3d(-100%, 0, 0)",
transformOrigin: "0 0",
opacity: 0
}
});
var moveRightIn = new Keyframe("antMoveRightIn", {
"0%": {
transform: "translate3d(100%, 0, 0)",
transformOrigin: "0 0",
opacity: 0
},
"100%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
}
});
var moveRightOut = new Keyframe("antMoveRightOut", {
"0%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
},
"100%": {
transform: "translate3d(100%, 0, 0)",
transformOrigin: "0 0",
opacity: 0
}
});
var moveMotion = {
"move-up": {
inKeyframes: new Keyframe("antMoveUpIn", {
"0%": {
transform: "translate3d(0, -100%, 0)",
transformOrigin: "0 0",
opacity: 0
},
"100%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
}
}),
outKeyframes: new Keyframe("antMoveUpOut", {
"0%": {
transform: "translate3d(0, 0, 0)",
transformOrigin: "0 0",
opacity: 1
},
"100%": {
transform: "translate3d(0, -100%, 0)",
transformOrigin: "0 0",
opacity: 0
}
})
},
"move-down": {
inKeyframes: moveDownIn,
outKeyframes: moveDownOut
},
"move-left": {
inKeyframes: moveLeftIn,
outKeyframes: moveLeftOut
},
"move-right": {
inKeyframes: moveRightIn,
outKeyframes: moveRightOut
}
};
var initMoveMotion = (token, motionName) => {
const { antCls } = token;
const motionCls = `${antCls}-${motionName}`;
const { inKeyframes, outKeyframes } = moveMotion[motionName];
return [initMotion(motionCls, inKeyframes, outKeyframes, token.motionDurationMid), {
[`
${motionCls}-enter,
${motionCls}-appear
`]: {
opacity: 0,
animationTimingFunction: token.motionEaseOutCirc
},
[`${motionCls}-leave`]: { animationTimingFunction: token.motionEaseInOutCirc }
}];
};
//#endregion
//#region node_modules/antd/es/style/motion/slide.js
var slideUpIn = new Keyframe("antSlideUpIn", {
"0%": {
transform: "scaleY(0.8)",
transformOrigin: "0% 0%",
opacity: 0
},
"100%": {
transform: "scaleY(1)",
transformOrigin: "0% 0%",
opacity: 1
}
});
var slideUpOut = new Keyframe("antSlideUpOut", {
"0%": {
transform: "scaleY(1)",
transformOrigin: "0% 0%",
opacity: 1
},
"100%": {
transform: "scaleY(0.8)",
transformOrigin: "0% 0%",
opacity: 0
}
});
var slideDownIn = new Keyframe("antSlideDownIn", {
"0%": {
transform: "scaleY(0.8)",
transformOrigin: "100% 100%",
opacity: 0
},
"100%": {
transform: "scaleY(1)",
transformOrigin: "100% 100%",
opacity: 1
}
});
var slideDownOut = new Keyframe("antSlideDownOut", {
"0%": {
transform: "scaleY(1)",
transformOrigin: "100% 100%",
opacity: 1
},
"100%": {
transform: "scaleY(0.8)",
transformOrigin: "100% 100%",
opacity: 0
}
});
var slideLeftIn = new Keyframe("antSlideLeftIn", {
"0%": {
transform: "scaleX(0.8)",
transformOrigin: "0% 0%",
opacity: 0
},
"100%": {
transform: "scaleX(1)",
transformOrigin: "0% 0%",
opacity: 1
}
});
var slideLeftOut = new Keyframe("antSlideLeftOut", {
"0%": {
transform: "scaleX(1)",
transformOrigin: "0% 0%",
opacity: 1
},
"100%": {
transform: "scaleX(0.8)",
transformOrigin: "0% 0%",
opacity: 0
}
});
var slideRightIn = new Keyframe("antSlideRightIn", {
"0%": {
transform: "scaleX(0.8)",
transformOrigin: "100% 0%",
opacity: 0
},
"100%": {
transform: "scaleX(1)",
transformOrigin: "100% 0%",
opacity: 1
}
});
var slideRightOut = new Keyframe("antSlideRightOut", {
"0%": {
transform: "scaleX(1)",
transformOrigin: "100% 0%",
opacity: 1
},
"100%": {
transform: "scaleX(0.8)",
transformOrigin: "100% 0%",
opacity: 0
}
});
var slideMotion = {
"slide-up": {
inKeyframes: slideUpIn,
outKeyframes: slideUpOut
},
"slide-down": {
inKeyframes: slideDownIn,
outKeyframes: slideDownOut
},
"slide-left": {
inKeyframes: slideLeftIn,
outKeyframes: slideLeftOut
},
"slide-right": {
inKeyframes: slideRightIn,
outKeyframes: slideRightOut
}
};
var initSlideMotion = (token, motionName) => {
const { antCls } = token;
const motionCls = `${antCls}-${motionName}`;
const { inKeyframes, outKeyframes } = slideMotion[motionName];
return [initMotion(motionCls, inKeyframes, outKeyframes, token.motionDurationMid), {
[`
${motionCls}-enter,
${motionCls}-appear
`]: {
transform: "scale(0)",
transformOrigin: "0% 0%",
opacity: 0,
animationTimingFunction: token.motionEaseOutQuint,
"&-prepare": { transform: "scale(1)" }
},
[`${motionCls}-leave`]: { animationTimingFunction: token.motionEaseInQuint }
}];
};
//#endregion
//#region node_modules/antd/es/style/motion/util.js
var genNoMotionStyle = () => {
return { "@media (prefers-reduced-motion: reduce)": {
transition: "none",
animation: "none"
} };
};
//#endregion
//#region node_modules/antd/es/style/motion/zoom.js
var zoomIn = new Keyframe("antZoomIn", {
"0%": {
transform: "scale(0.2)",
opacity: 0
},
"100%": {
transform: "scale(1)",
opacity: 1
}
});
var zoomOut = new Keyframe("antZoomOut", {
"0%": { transform: "scale(1)" },
"100%": {
transform: "scale(0.2)",
opacity: 0
}
});
var zoomBigIn = new Keyframe("antZoomBigIn", {
"0%": {
transform: "scale(0.8)",
opacity: 0
},
"100%": {
transform: "scale(1)",
opacity: 1
}
});
var zoomBigOut = new Keyframe("antZoomBigOut", {
"0%": { transform: "scale(1)" },
"100%": {
transform: "scale(0.8)",
opacity: 0
}
});
var zoomUpIn = new Keyframe("antZoomUpIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "50% 0%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "50% 0%"
}
});
var zoomUpOut = new Keyframe("antZoomUpOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "50% 0%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "50% 0%",
opacity: 0
}
});
var zoomLeftIn = new Keyframe("antZoomLeftIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "0% 50%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "0% 50%"
}
});
var zoomLeftOut = new Keyframe("antZoomLeftOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "0% 50%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "0% 50%",
opacity: 0
}
});
var zoomRightIn = new Keyframe("antZoomRightIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "100% 50%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "100% 50%"
}
});
var zoomRightOut = new Keyframe("antZoomRightOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "100% 50%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "100% 50%",
opacity: 0
}
});
var zoomDownIn = new Keyframe("antZoomDownIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "50% 100%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "50% 100%"
}
});
var zoomDownOut = new Keyframe("antZoomDownOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "50% 100%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "50% 100%",
opacity: 0
}
});
var zoomMotion = {
zoom: {
inKeyframes: zoomIn,
outKeyframes: zoomOut
},
"zoom-big": {
inKeyframes: zoomBigIn,
outKeyframes: zoomBigOut
},
"zoom-big-fast": {
inKeyframes: zoomBigIn,
outKeyframes: zoomBigOut
},
"zoom-left": {
inKeyframes: zoomLeftIn,
outKeyframes: zoomLeftOut
},
"zoom-right": {
inKeyframes: zoomRightIn,
outKeyframes: zoomRightOut
},
"zoom-up": {
inKeyframes: zoomUpIn,
outKeyframes: zoomUpOut
},
"zoom-down": {
inKeyframes: zoomDownIn,
outKeyframes: zoomDownOut
}
};
var initZoomMotion = (token, motionName) => {
const { antCls } = token;
const motionCls = `${antCls}-${motionName}`;
const { inKeyframes, outKeyframes } = zoomMotion[motionName];
return [initMotion(motionCls, inKeyframes, outKeyframes, motionName === "zoom-big-fast" ? token.motionDurationFast : token.motionDurationMid), {
[`
${motionCls}-enter,
${motionCls}-appear
`]: {
transform: "scale(0)",
opacity: 0,
animationTimingFunction: token.motionEaseOutCirc,
"&-prepare": { transform: "none" }
},
[`${motionCls}-leave`]: { animationTimingFunction: token.motionEaseInOutCirc }
}];
};
//#endregion
//#region node_modules/antd/es/button/style/group.js
var genButtonBorderStyle = (buttonTypeCls, borderColor) => ({ [`> span, > ${buttonTypeCls}`]: {
"&:not(:last-child)": { [`&, & > ${buttonTypeCls}`]: { "&:not(:disabled)": { borderInlineEndColor: borderColor } } },
"&:not(:first-child)": { [`&, & > ${buttonTypeCls}`]: { "&:not(:disabled)": { borderInlineStartColor: borderColor } } }
} });
var genGroupStyle$3 = (token) => {
const { componentCls, fontSize, lineWidth, groupBorderColor, colorErrorHover } = token;
return { [`${componentCls}-group`]: [
{
position: "relative",
display: "inline-flex",
[`> span, > ${componentCls}`]: {
"&:not(:last-child)": { [`&, & > ${componentCls}`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
} },
"&:not(:first-child)": {
marginInlineStart: token.calc(lineWidth).mul(-1).equal(),
[`&, & > ${componentCls}`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
}
},
[componentCls]: {
position: "relative",
zIndex: 1,
"&:hover, &:focus, &:active": { zIndex: 2 },
"&[disabled]": { zIndex: 0 }
},
[`${componentCls}-icon-only`]: { fontSize }
},
genButtonBorderStyle(`${componentCls}-primary`, groupBorderColor),
genButtonBorderStyle(`${componentCls}-danger`, colorErrorHover)
] };
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/color.js
var getRoundNumber$1 = (value) => Math.round(Number(value || 0));
var convertHsb2Hsv = (color) => {
if (color instanceof FastColor) return color;
if (color && typeof color === "object" && "h" in color && "b" in color) {
const { b, ...resets } = color;
return {
...resets,
v: b
};
}
if (typeof color === "string" && /hsb/.test(color)) return color.replace(/hsb/, "hsv");
return color;
};
var Color = class extends FastColor {
constructor(color) {
super(convertHsb2Hsv(color));
}
toHsbString() {
const hsb = this.toHsb();
const saturation = getRoundNumber$1(hsb.s * 100);
const lightness = getRoundNumber$1(hsb.b * 100);
const hue = getRoundNumber$1(hsb.h);
const alpha = hsb.a;
const hsbString = `hsb(${hue}, ${saturation}%, ${lightness}%)`;
const hsbaString = `hsba(${hue}, ${saturation}%, ${lightness}%, ${alpha.toFixed(alpha === 0 ? 0 : 2)})`;
return alpha === 1 ? hsbString : hsbaString;
}
toHsb() {
const { v, ...resets } = this.toHsv();
return {
...resets,
b: v,
a: this.a
};
}
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/util.js
var ColorPickerPrefixCls = "rc-color-picker";
var generateColor$1 = (color) => {
if (color instanceof Color) return color;
return new Color(color);
};
var defaultColor = generateColor$1("#1677ff");
var calculateColor = (props) => {
const { offset, targetRef, containerRef, color, type } = props;
const { width, height } = containerRef.current.getBoundingClientRect();
const { width: targetWidth, height: targetHeight } = targetRef.current.getBoundingClientRect();
const centerOffsetX = targetWidth / 2;
const centerOffsetY = targetHeight / 2;
const saturation = (offset.x + centerOffsetX) / width;
const bright = 1 - (offset.y + centerOffsetY) / height;
const hsb = color.toHsb();
const alphaOffset = saturation;
const hueOffset = (offset.x + centerOffsetX) / width * 360;
if (type) switch (type) {
case "hue": return generateColor$1({
...hsb,
h: hueOffset <= 0 ? 0 : hueOffset
});
case "alpha": return generateColor$1({
...hsb,
a: alphaOffset <= 0 ? 0 : alphaOffset
});
}
return generateColor$1({
h: hsb.h,
s: saturation <= 0 ? 0 : saturation,
b: bright >= 1 ? 1 : bright,
a: hsb.a
});
};
var calcOffset = (color, type) => {
const hsb = color.toHsb();
switch (type) {
case "hue": return {
x: hsb.h / 360 * 100,
y: 50
};
case "alpha": return {
x: color.a * 100,
y: 50
};
default: return {
x: hsb.s * 100,
y: (1 - hsb.b) * 100
};
}
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/components/ColorBlock.js
var ColorBlock = ({ color, prefixCls, className, style, innerClassName, innerStyle, onClick }) => {
const colorBlockCls = `${prefixCls}-color-block`;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(colorBlockCls, className),
style,
onClick
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${colorBlockCls}-inner`, innerClassName),
style: {
background: color,
...innerStyle
}
}));
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/hooks/useColorDrag.js
function getPosition$2(e) {
const obj = "touches" in e ? e.touches[0] : e;
const scrollXOffset = document.documentElement.scrollLeft || document.body.scrollLeft || window.pageXOffset;
const scrollYOffset = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset;
return {
pageX: obj.pageX - scrollXOffset,
pageY: obj.pageY - scrollYOffset
};
}
function useColorDrag(props) {
const { targetRef, containerRef, direction, onDragChange, onDragChangeComplete, calculate, color, disabledDrag } = props;
const [offsetValue, setOffsetValue] = (0, import_react.useState)({
x: 0,
y: 0
});
const mouseMoveRef = (0, import_react.useRef)(null);
const mouseUpRef = (0, import_react.useRef)(null);
(0, import_react.useEffect)(() => {
setOffsetValue(calculate());
}, [color]);
(0, import_react.useEffect)(() => () => {
document.removeEventListener("mousemove", mouseMoveRef.current);
document.removeEventListener("mouseup", mouseUpRef.current);
document.removeEventListener("touchmove", mouseMoveRef.current);
document.removeEventListener("touchend", mouseUpRef.current);
mouseMoveRef.current = null;
mouseUpRef.current = null;
}, []);
const updateOffset = (e) => {
const { pageX, pageY } = getPosition$2(e);
const { x: rectX, y: rectY, width, height } = containerRef.current.getBoundingClientRect();
const { width: targetWidth, height: targetHeight } = targetRef.current.getBoundingClientRect();
const centerOffsetX = targetWidth / 2;
const centerOffsetY = targetHeight / 2;
const offsetX = Math.max(0, Math.min(pageX - rectX, width)) - centerOffsetX;
const offsetY = Math.max(0, Math.min(pageY - rectY, height)) - centerOffsetY;
const calcOffset = {
x: offsetX,
y: direction === "x" ? offsetValue.y : offsetY
};
if (targetWidth === 0 && targetHeight === 0 || targetWidth !== targetHeight) return false;
onDragChange?.(calcOffset);
};
const onDragMove = (e) => {
e.preventDefault();
updateOffset(e);
};
const onDragStop = (e) => {
e.preventDefault();
document.removeEventListener("mousemove", mouseMoveRef.current);
document.removeEventListener("mouseup", mouseUpRef.current);
document.removeEventListener("touchmove", mouseMoveRef.current);
document.removeEventListener("touchend", mouseUpRef.current);
mouseMoveRef.current = null;
mouseUpRef.current = null;
onDragChangeComplete?.();
};
const onDragStart = (e) => {
document.removeEventListener("mousemove", mouseMoveRef.current);
document.removeEventListener("mouseup", mouseUpRef.current);
if (disabledDrag) return;
updateOffset(e);
document.addEventListener("mousemove", onDragMove);
document.addEventListener("mouseup", onDragStop);
document.addEventListener("touchmove", onDragMove);
document.addEventListener("touchend", onDragStop);
mouseMoveRef.current = onDragMove;
mouseUpRef.current = onDragStop;
};
return [offsetValue, onDragStart];
}
//#endregion
//#region node_modules/@rc-component/color-picker/es/components/Handler.js
var Handler = ({ size = "default", color, prefixCls }) => {
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-handler`, { [`${prefixCls}-handler-sm`]: size === "small" }),
style: { backgroundColor: color }
});
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/components/Palette.js
var Palette = ({ children, style, prefixCls }) => {
return /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-palette`,
style: {
position: "relative",
...style
}
}, children);
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/components/Transform.js
var Transform = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { children, x, y } = props;
return /* @__PURE__ */ import_react.createElement("div", {
ref,
style: {
position: "absolute",
left: `${x}%`,
top: `${y}%`,
zIndex: 1,
transform: "translate(-50%, -50%)"
}
}, children);
});
//#endregion
//#region node_modules/@rc-component/color-picker/es/components/Picker.js
var Picker$1 = ({ color, onChange, prefixCls, onChangeComplete, disabled }) => {
const pickerRef = (0, import_react.useRef)();
const transformRef = (0, import_react.useRef)();
const colorRef = (0, import_react.useRef)(color);
const [offset, dragStartHandle] = useColorDrag({
color,
containerRef: pickerRef,
targetRef: transformRef,
calculate: () => calcOffset(color),
onDragChange: useEvent((offsetValue) => {
const calcColor = calculateColor({
offset: offsetValue,
targetRef: transformRef,
containerRef: pickerRef,
color
});
colorRef.current = calcColor;
onChange(calcColor);
}),
onDragChangeComplete: () => onChangeComplete?.(colorRef.current),
disabledDrag: disabled
});
return /* @__PURE__ */ import_react.createElement("div", {
ref: pickerRef,
className: `${prefixCls}-select`,
onMouseDown: dragStartHandle,
onTouchStart: dragStartHandle
}, /* @__PURE__ */ import_react.createElement(Palette, { prefixCls }, /* @__PURE__ */ import_react.createElement(Transform, {
x: offset.x,
y: offset.y,
ref: transformRef
}, /* @__PURE__ */ import_react.createElement(Handler, {
color: color.toRgbString(),
prefixCls
})), /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-saturation`,
style: {
backgroundColor: `hsl(${color.toHsb().h},100%, 50%)`,
backgroundImage: "linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"
}
})));
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/hooks/useColorState.js
var useColorState = (defaultValue, value) => {
const [mergedValue, setValue] = useControlledState(defaultValue, value);
return [(0, import_react.useMemo)(() => generateColor$1(mergedValue), [mergedValue]), setValue];
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/components/Gradient.js
var Gradient = ({ colors, children, direction = "to right", type, prefixCls }) => {
const gradientColors = (0, import_react.useMemo)(() => colors.map((color, idx) => {
let result = generateColor$1(color);
if (type === "alpha" && idx === colors.length - 1) result = new Color(result.setA(1));
return result.toRgbString();
}).join(","), [colors, type]);
return /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-gradient`,
style: {
position: "absolute",
inset: 0,
background: `linear-gradient(${direction}, ${gradientColors})`
}
}, children);
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/components/Slider.js
var Slider$3 = (props) => {
const { prefixCls, colors, disabled, onChange, onChangeComplete, color, type } = props;
const sliderRef = (0, import_react.useRef)(null);
const transformRef = (0, import_react.useRef)(null);
const colorRef = (0, import_react.useRef)(color);
const getValue = (c) => {
return type === "hue" ? c.getHue() : c.a * 100;
};
const [offset, dragStartHandle] = useColorDrag({
color,
targetRef: transformRef,
containerRef: sliderRef,
calculate: () => calcOffset(color, type),
onDragChange: useEvent((offsetValue) => {
const calcColor = calculateColor({
offset: offsetValue,
targetRef: transformRef,
containerRef: sliderRef,
color,
type
});
colorRef.current = calcColor;
onChange(getValue(calcColor));
}),
onDragChangeComplete() {
onChangeComplete(getValue(colorRef.current));
},
direction: "x",
disabledDrag: disabled
});
const handleColor = import_react.useMemo(() => {
if (type === "hue") {
const hsb = color.toHsb();
hsb.s = 1;
hsb.b = 1;
hsb.a = 1;
return new Color(hsb);
}
return color;
}, [color, type]);
const gradientList = import_react.useMemo(() => colors.map((info) => `${info.color} ${info.percent}%`), [colors]);
return /* @__PURE__ */ import_react.createElement("div", {
ref: sliderRef,
className: clsx(`${prefixCls}-slider`, `${prefixCls}-slider-${type}`),
onMouseDown: dragStartHandle,
onTouchStart: dragStartHandle
}, /* @__PURE__ */ import_react.createElement(Palette, { prefixCls }, /* @__PURE__ */ import_react.createElement(Transform, {
x: offset.x,
y: offset.y,
ref: transformRef
}, /* @__PURE__ */ import_react.createElement(Handler, {
size: "small",
color: handleColor.toHexString(),
prefixCls
})), /* @__PURE__ */ import_react.createElement(Gradient, {
colors: gradientList,
type,
prefixCls
})));
};
//#endregion
//#region node_modules/@rc-component/color-picker/es/hooks/useComponent.js
function useComponent(components) {
return import_react.useMemo(() => {
const { slider } = components || {};
return [slider || Slider$3];
}, [components]);
}
//#endregion
//#region node_modules/@rc-component/color-picker/es/ColorPicker.js
function _extends$92() {
_extends$92 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$92.apply(this, arguments);
}
var HUE_COLORS = [
{
color: "rgb(255, 0, 0)",
percent: 0
},
{
color: "rgb(255, 255, 0)",
percent: 17
},
{
color: "rgb(0, 255, 0)",
percent: 33
},
{
color: "rgb(0, 255, 255)",
percent: 50
},
{
color: "rgb(0, 0, 255)",
percent: 67
},
{
color: "rgb(255, 0, 255)",
percent: 83
},
{
color: "rgb(255, 0, 0)",
percent: 100
}
];
var ColorPicker$1 = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { value, defaultValue, prefixCls = ColorPickerPrefixCls, onChange, onChangeComplete, className, style, panelRender, disabledAlpha = false, disabled = false, components } = props;
const [Slider] = useComponent(components);
const [colorValue, setColorValue] = useColorState(defaultValue || defaultColor, value);
const alphaColor = (0, import_react.useMemo)(() => colorValue.setA(1).toRgbString(), [colorValue]);
const handleChange = (data, type) => {
if (!value) setColorValue(data);
onChange?.(data, type);
};
const getHueColor = (hue) => new Color(colorValue.setHue(hue));
const getAlphaColor = (alpha) => new Color(colorValue.setA(alpha / 100));
const onHueChange = (hue) => {
handleChange(getHueColor(hue), {
type: "hue",
value: hue
});
};
const onAlphaChange = (alpha) => {
handleChange(getAlphaColor(alpha), {
type: "alpha",
value: alpha
});
};
const onHueChangeComplete = (hue) => {
if (onChangeComplete) onChangeComplete(getHueColor(hue));
};
const onAlphaChangeComplete = (alpha) => {
if (onChangeComplete) onChangeComplete(getAlphaColor(alpha));
};
const mergeCls = clsx(`${prefixCls}-panel`, className, { [`${prefixCls}-panel-disabled`]: disabled });
const sharedSliderProps = {
prefixCls,
disabled,
color: colorValue
};
const defaultPanel = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(Picker$1, _extends$92({ onChange: handleChange }, sharedSliderProps, { onChangeComplete })), /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-slider-container` }, /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-slider-group`, { [`${prefixCls}-slider-group-disabled-alpha`]: disabledAlpha }) }, /* @__PURE__ */ import_react.createElement(Slider, _extends$92({}, sharedSliderProps, {
type: "hue",
colors: HUE_COLORS,
min: 0,
max: 359,
value: colorValue.getHue(),
onChange: onHueChange,
onChangeComplete: onHueChangeComplete
})), !disabledAlpha && /* @__PURE__ */ import_react.createElement(Slider, _extends$92({}, sharedSliderProps, {
type: "alpha",
colors: [{
percent: 0,
color: "rgba(255, 0, 4, 0)"
}, {
percent: 100,
color: alphaColor
}],
min: 0,
max: 100,
value: colorValue.a * 100,
onChange: onAlphaChange,
onChangeComplete: onAlphaChangeComplete
}))), /* @__PURE__ */ import_react.createElement(ColorBlock, {
color: colorValue.toRgbString(),
prefixCls
})));
return /* @__PURE__ */ import_react.createElement("div", {
className: mergeCls,
style,
ref
}, typeof panelRender === "function" ? panelRender(defaultPanel) : defaultPanel);
});
ColorPicker$1.displayName = "ColorPicker";
//#endregion
//#region node_modules/@rc-component/color-picker/es/index.js
var es_default$25 = ColorPicker$1;
//#endregion
//#region node_modules/antd/es/color-picker/color.js
var toHexFormat = (value, alpha) => value?.replace(/[^0-9a-f]/gi, "").slice(0, alpha ? 8 : 6) || "";
var getHex = (value, alpha) => value ? toHexFormat(value, alpha) : "";
var AggregationColor = /* @__PURE__ */ function() {
function AggregationColor(color) {
_classCallCheck$1(this, AggregationColor);
this.cleared = false;
if (color instanceof AggregationColor) {
this.metaColor = color.metaColor.clone();
this.colors = color.colors?.map((info) => ({
color: new AggregationColor(info.color),
percent: info.percent
}));
this.cleared = color.cleared;
return;
}
const isArray = Array.isArray(color);
if (isArray && color.length) {
this.colors = color.map(({ color: c, percent }) => ({
color: new AggregationColor(c),
percent
}));
this.metaColor = new Color(this.colors[0].color.metaColor);
} else this.metaColor = new Color(isArray ? "" : color);
if (!color || isArray && !this.colors) {
this.metaColor = this.metaColor.setA(0);
this.cleared = true;
}
}
return _createClass$1(AggregationColor, [
{
key: "toHsb",
value: function toHsb() {
return this.metaColor.toHsb();
}
},
{
key: "toHsbString",
value: function toHsbString() {
return this.metaColor.toHsbString();
}
},
{
key: "toHex",
value: function toHex() {
return getHex(this.toHexString(), this.metaColor.a < 1);
}
},
{
key: "toHexString",
value: function toHexString() {
return this.metaColor.toHexString();
}
},
{
key: "toRgb",
value: function toRgb() {
return this.metaColor.toRgb();
}
},
{
key: "toRgbString",
value: function toRgbString() {
return this.metaColor.toRgbString();
}
},
{
key: "isGradient",
value: function isGradient() {
return !!this.colors && !this.cleared;
}
},
{
key: "getColors",
value: function getColors() {
return this.colors || [{
color: this,
percent: 0
}];
}
},
{
key: "toCssString",
value: function toCssString() {
const { colors } = this;
if (colors) return `linear-gradient(90deg, ${colors.map((c) => `${c.color.toRgbString()} ${c.percent}%`).join(", ")})`;
return this.metaColor.toRgbString();
}
},
{
key: "equals",
value: function equals(color) {
if (!color || this.isGradient() !== color.isGradient()) return false;
if (!this.isGradient()) return this.toHexString() === color.toHexString();
return this.colors.length === color.colors.length && this.colors.every((c, i) => {
const target = color.colors[i];
return c.percent === target.percent && c.color.equals(target.color);
});
}
}
]);
}();
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/extends.js
function _extends$91() {
return _extends$91 = Object.assign ? Object.assign.bind() : function(n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends$91.apply(null, arguments);
}
//#endregion
//#region node_modules/@rc-component/collapse/es/PanelContent.js
var PanelContent = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, forceRender, className, style, children, isActive, role, classNames: customizeClassNames, styles } = props;
const [rendered, setRendered] = import_react.useState(isActive || forceRender);
import_react.useEffect(() => {
if (forceRender || isActive) setRendered(true);
}, [forceRender, isActive]);
if (!rendered) return null;
return /* @__PURE__ */ import_react.createElement("div", {
ref,
className: clsx(`${prefixCls}-panel`, {
[`${prefixCls}-panel-active`]: isActive,
[`${prefixCls}-panel-inactive`]: !isActive
}, className),
style,
role
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-body`, customizeClassNames?.body),
style: styles?.body
}, children));
});
PanelContent.displayName = "PanelContent";
//#endregion
//#region node_modules/@rc-component/collapse/es/Panel.js
var CollapsePanel$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { showArrow = true, headerClass, isActive, onItemClick, forceRender, className, classNames: customizeClassNames = {}, styles = {}, prefixCls, collapsible, accordion, panelKey, extra, header, expandIcon, openMotion, destroyOnHidden, children, ...resetProps } = props;
const disabled = collapsible === "disabled";
const ifExtraExist = extra !== null && extra !== void 0 && typeof extra !== "boolean";
const collapsibleProps = {
onClick: () => {
onItemClick?.(panelKey);
},
onKeyDown: (e) => {
if (e.key === "Enter" || e.keyCode === KeyCode.ENTER || e.which === KeyCode.ENTER) onItemClick?.(panelKey);
},
role: accordion ? "tab" : "button",
["aria-expanded"]: isActive,
["aria-disabled"]: disabled,
tabIndex: disabled ? -1 : 0
};
const iconNodeInner = typeof expandIcon === "function" ? expandIcon(props) : /* @__PURE__ */ import_react.createElement("i", { className: "arrow" });
const iconNode = iconNodeInner && /* @__PURE__ */ import_react.createElement("div", _extends$91({
className: clsx(`${prefixCls}-expand-icon`, customizeClassNames?.icon),
style: styles?.icon
}, ["header", "icon"].includes(collapsible) ? collapsibleProps : {}), iconNodeInner);
const collapsePanelClassNames = clsx(`${prefixCls}-item`, {
[`${prefixCls}-item-active`]: isActive,
[`${prefixCls}-item-disabled`]: disabled
}, className);
const headerProps = {
className: clsx(headerClass, `${prefixCls}-header`, { [`${prefixCls}-collapsible-${collapsible}`]: !!collapsible }, customizeClassNames?.header),
style: styles?.header,
...["header", "icon"].includes(collapsible) ? {} : collapsibleProps
};
return /* @__PURE__ */ import_react.createElement("div", _extends$91({}, resetProps, {
ref,
className: collapsePanelClassNames
}), /* @__PURE__ */ import_react.createElement("div", headerProps, showArrow && iconNode, /* @__PURE__ */ import_react.createElement("span", _extends$91({
className: clsx(`${prefixCls}-title`, customizeClassNames?.title),
style: styles?.title
}, collapsible === "header" ? collapsibleProps : {}), header), ifExtraExist && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-extra` }, extra)), /* @__PURE__ */ import_react.createElement(es_default$28, _extends$91({
visible: isActive,
leavedClassName: `${prefixCls}-panel-hidden`
}, openMotion, {
forceRender,
removeOnLeave: destroyOnHidden
}), ({ className: motionClassName, style: motionStyle }, motionRef) => {
return /* @__PURE__ */ import_react.createElement(PanelContent, {
ref: motionRef,
prefixCls,
className: motionClassName,
classNames: customizeClassNames,
style: motionStyle,
styles,
isActive,
forceRender,
role: accordion ? "tabpanel" : void 0
}, children);
}));
});
//#endregion
//#region node_modules/@rc-component/collapse/es/hooks/useItems.js
function mergeSemantic(src, tgt, mergeFn) {
if (!src || !tgt) return src || tgt;
const keys = Array.from(new Set([...Object.keys(src), ...Object.keys(tgt)]));
const result = {};
keys.forEach((key) => {
result[key] = mergeFn(src[key], tgt[key]);
});
return result;
}
function mergeSemanticClassNames(src, tgt) {
return mergeSemantic(src, tgt, (a, b) => clsx(a, b));
}
function mergeSemanticStyles(src, tgt) {
return mergeSemantic(src, tgt, (a, b) => ({
...a,
...b
}));
}
var convertItemsToNodes$1 = (items, props) => {
const { prefixCls, accordion, collapsible, destroyOnHidden, onItemClick, activeKey, openMotion, expandIcon, classNames: collapseClassNames, styles: collapseStyles } = props;
return items.map((item, index) => {
const { children, label, key: rawKey, collapsible: rawCollapsible, onItemClick: rawOnItemClick, destroyOnHidden: rawDestroyOnHidden, classNames, styles, ...restProps } = item;
const key = String(rawKey ?? index);
const mergeCollapsible = rawCollapsible ?? collapsible;
const mergedDestroyOnHidden = rawDestroyOnHidden ?? destroyOnHidden;
const handleItemClick = (value) => {
if (mergeCollapsible === "disabled") return;
onItemClick(value);
rawOnItemClick?.(value);
};
let isActive = false;
if (accordion) isActive = activeKey[0] === key;
else isActive = activeKey.indexOf(key) > -1;
return /* @__PURE__ */ import_react.createElement(CollapsePanel$1, _extends$91({}, restProps, {
classNames: mergeSemanticClassNames(collapseClassNames, classNames),
styles: mergeSemanticStyles(collapseStyles, styles),
prefixCls,
key,
panelKey: key,
isActive,
accordion,
openMotion,
expandIcon,
header: label,
collapsible: mergeCollapsible,
onItemClick: handleItemClick,
destroyOnHidden: mergedDestroyOnHidden
}), children);
});
};
/**
* @deprecated The next major version will be removed
*/
var getNewChild = (child, index, props) => {
if (!child) return null;
const { prefixCls, accordion, collapsible, destroyOnHidden, onItemClick, activeKey, openMotion, expandIcon, classNames: collapseClassNames, styles } = props;
const key = child.key || String(index);
const { header, headerClass, destroyOnHidden: childDestroyOnHidden, collapsible: childCollapsible, onItemClick: childOnItemClick } = child.props;
let isActive = false;
if (accordion) isActive = activeKey[0] === key;
else isActive = activeKey.indexOf(key) > -1;
const mergeCollapsible = childCollapsible ?? collapsible;
const handleItemClick = (value) => {
if (mergeCollapsible === "disabled") return;
onItemClick(value);
childOnItemClick?.(value);
};
const childProps = {
key,
panelKey: key,
header,
headerClass,
classNames: collapseClassNames,
styles,
isActive,
prefixCls,
destroyOnHidden: childDestroyOnHidden ?? destroyOnHidden,
openMotion,
accordion,
children: child.props.children,
onItemClick: handleItemClick,
expandIcon,
collapsible: mergeCollapsible
};
if (typeof child.type === "string") return child;
Object.keys(childProps).forEach((propName) => {
if (typeof childProps[propName] === "undefined") delete childProps[propName];
});
return /* @__PURE__ */ import_react.cloneElement(child, childProps);
};
function useItems$4(items, rawChildren, props) {
if (Array.isArray(items)) return convertItemsToNodes$1(items, props);
return toArray$8(rawChildren).map((child, index) => getNewChild(child, index, props));
}
//#endregion
//#region node_modules/@rc-component/collapse/es/Collapse.js
function getActiveKeysArray(activeKey) {
let currentActiveKey = activeKey;
if (!Array.isArray(currentActiveKey)) {
const activeKeyType = typeof currentActiveKey;
currentActiveKey = activeKeyType === "number" || activeKeyType === "string" ? [currentActiveKey] : [];
}
return currentActiveKey.map((key) => String(key));
}
var Collapse_default$1 = Object.assign(/* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls = "rc-collapse", destroyOnHidden = false, style, accordion, className, children, collapsible, openMotion, expandIcon, activeKey: rawActiveKey, defaultActiveKey, onChange, items, classNames: customizeClassNames, styles } = props;
const collapseClassName = clsx(prefixCls, className);
const [internalActiveKey, setActiveKey] = useControlledState(defaultActiveKey, rawActiveKey);
const activeKey = getActiveKeysArray(internalActiveKey);
const triggerActiveKey = useEvent((next) => {
const nextKeys = getActiveKeysArray(next);
setActiveKey(nextKeys);
onChange?.(nextKeys);
});
const onItemClick = (key) => {
if (accordion) triggerActiveKey(activeKey[0] === key ? [] : [key]);
else triggerActiveKey(activeKey.includes(key) ? activeKey.filter((item) => item !== key) : [...activeKey, key]);
};
warningOnce(!children, "[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");
const mergedChildren = useItems$4(items, children, {
prefixCls,
accordion,
openMotion,
expandIcon,
collapsible,
destroyOnHidden,
onItemClick,
activeKey,
classNames: customizeClassNames,
styles
});
return /* @__PURE__ */ import_react.createElement("div", _extends$91({
ref,
className: collapseClassName,
style,
role: accordion ? "tablist" : void 0
}, pickAttrs(props, {
aria: true,
data: true
})), mergedChildren);
}), {
/**
* @deprecated use `items` instead, will be removed in `v4.0.0`
*/
Panel: CollapsePanel$1 });
//#endregion
//#region node_modules/@rc-component/collapse/es/index.js
var es_default$24 = Collapse_default$1;
/**
* @deprecated use `items` instead, will be removed in `v4.0.0`
*/
var { Panel: Panel$4 } = Collapse_default$1;
//#endregion
//#region node_modules/antd/es/collapse/CollapsePanel.js
var CollapsePanel = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
devUseWarning("Collapse.Panel").deprecated(!("disabled" in props), "disabled", "collapsible=\"disabled\"");
const { getPrefixCls } = import_react.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className, showArrow = true } = props;
const prefixCls = getPrefixCls("collapse", customizePrefixCls);
const collapsePanelClassName = clsx({ [`${prefixCls}-no-arrow`]: !showArrow }, className);
return /* @__PURE__ */ import_react.createElement(es_default$24.Panel, {
ref,
...props,
prefixCls,
className: collapsePanelClassName
});
});
//#endregion
//#region node_modules/antd/es/collapse/style/index.js
var genBaseStyle$17 = (token) => {
const { componentCls, contentBg, padding, headerBg, headerPadding, collapseHeaderPaddingSM, collapseHeaderPaddingLG, collapsePanelBorderRadius, lineWidth, lineType, colorBorder, colorText, colorTextHeading, colorTextDisabled, fontSizeLG, lineHeight, lineHeightLG, marginSM, paddingSM, paddingLG, paddingXS, motionDurationSlow, fontSizeIcon, contentPadding, fontHeight, fontHeightLG } = token;
const borderBase = `${unit$1(lineWidth)} ${lineType} ${colorBorder}`;
return { [componentCls]: {
...resetComponent(token),
backgroundColor: headerBg,
border: borderBase,
borderRadius: collapsePanelBorderRadius,
"&-rtl": { direction: "rtl" },
[`& > ${componentCls}-item`]: {
borderBottom: borderBase,
"&:first-child": { [`
&,
& > ${componentCls}-header`]: { borderRadius: `${unit$1(collapsePanelBorderRadius)} ${unit$1(collapsePanelBorderRadius)} 0 0` } },
"&:last-child": { [`
&,
& > ${componentCls}-header`]: { borderRadius: `0 0 ${unit$1(collapsePanelBorderRadius)} ${unit$1(collapsePanelBorderRadius)}` } },
[`> ${componentCls}-header`]: {
position: "relative",
display: "flex",
flexWrap: "nowrap",
alignItems: "flex-start",
padding: headerPadding,
color: colorTextHeading,
lineHeight,
cursor: "pointer",
transition: `all ${motionDurationSlow}, visibility 0s`,
...genFocusStyle(token),
[`> ${componentCls}-title`]: { flex: "auto" },
[`${componentCls}-expand-icon`]: {
height: fontHeight,
display: "flex",
alignItems: "center",
marginInlineEnd: marginSM
},
[`${componentCls}-arrow`]: {
...resetIcon(),
fontSize: fontSizeIcon,
transition: `transform ${motionDurationSlow}`,
svg: { transition: `transform ${motionDurationSlow}` }
},
[`${componentCls}-title`]: { marginInlineEnd: "auto" }
},
[`${componentCls}-collapsible-header`]: {
cursor: "default",
[`${componentCls}-title`]: {
flex: "none",
cursor: "pointer"
},
[`${componentCls}-expand-icon`]: { cursor: "pointer" }
},
[`${componentCls}-collapsible-icon`]: {
cursor: "unset",
[`${componentCls}-expand-icon`]: { cursor: "pointer" }
}
},
[`${componentCls}-panel`]: {
color: colorText,
backgroundColor: contentBg,
borderTop: borderBase,
[`& > ${componentCls}-body`]: { padding: contentPadding },
"&-hidden": { display: "none" }
},
"&-small": { [`> ${componentCls}-item`]: {
[`> ${componentCls}-header`]: {
padding: collapseHeaderPaddingSM,
paddingInlineStart: paddingXS,
[`> ${componentCls}-expand-icon`]: { marginInlineStart: token.calc(paddingSM).sub(paddingXS).equal() }
},
[`> ${componentCls}-panel > ${componentCls}-body`]: { padding: paddingSM }
} },
"&-large": { [`> ${componentCls}-item`]: {
fontSize: fontSizeLG,
lineHeight: lineHeightLG,
[`> ${componentCls}-header`]: {
padding: collapseHeaderPaddingLG,
paddingInlineStart: padding,
[`> ${componentCls}-expand-icon`]: {
height: fontHeightLG,
marginInlineStart: token.calc(paddingLG).sub(padding).equal()
}
},
[`> ${componentCls}-panel > ${componentCls}-body`]: { padding: paddingLG }
} },
[`${componentCls}-item:last-child`]: {
borderBottom: 0,
[`> ${componentCls}-panel`]: { borderRadius: `0 0 ${unit$1(collapsePanelBorderRadius)} ${unit$1(collapsePanelBorderRadius)}` }
},
[`& ${componentCls}-item-disabled > ${componentCls}-header`]: { "&, & > .arrow": {
color: colorTextDisabled,
cursor: "not-allowed"
} },
[`&${componentCls}-icon-placement-end`]: { [`& > ${componentCls}-item`]: { [`> ${componentCls}-header`]: { [`${componentCls}-expand-icon`]: {
order: 1,
marginInlineEnd: 0,
marginInlineStart: marginSM
} } } }
} };
};
var genArrowStyle = (token) => {
const { componentCls } = token;
const fixedSelector = `> ${componentCls}-item > ${componentCls}-header ${componentCls}-arrow`;
return { [`${componentCls}-rtl`]: { [fixedSelector]: { transform: `rotate(180deg)` } } };
};
var genBorderlessStyle$1 = (token) => {
const { componentCls, headerBg, borderlessContentPadding, borderlessContentBg, colorBorder } = token;
return { [`${componentCls}-borderless`]: {
backgroundColor: headerBg,
border: 0,
[`> ${componentCls}-item`]: { borderBottom: `1px solid ${colorBorder}` },
[`
> ${componentCls}-item:last-child,
> ${componentCls}-item:last-child ${componentCls}-header
`]: { borderRadius: 0 },
[`> ${componentCls}-item:last-child`]: { borderBottom: 0 },
[`> ${componentCls}-item > ${componentCls}-panel`]: {
backgroundColor: borderlessContentBg,
borderTop: 0
},
[`> ${componentCls}-item > ${componentCls}-panel > ${componentCls}-body`]: { padding: borderlessContentPadding }
} };
};
var genGhostStyle = (token) => {
const { componentCls, paddingSM } = token;
return { [`${componentCls}-ghost`]: {
backgroundColor: "transparent",
border: 0,
[`> ${componentCls}-item`]: {
borderBottom: 0,
[`> ${componentCls}-panel`]: {
backgroundColor: "transparent",
border: 0,
[`> ${componentCls}-body`]: { paddingBlock: paddingSM }
}
}
} };
};
var prepareComponentToken$53 = (token) => ({
headerPadding: `${token.paddingSM}px ${token.padding}px`,
headerBg: token.colorFillAlter,
contentPadding: `${token.padding}px 16px`,
contentBg: token.colorBgContainer,
borderlessContentPadding: `${token.paddingXXS}px 16px ${token.padding}px`,
borderlessContentBg: "transparent"
});
var style_default$59 = genStyleHooks("Collapse", (token) => {
const collapseToken = merge(token, {
collapseHeaderPaddingSM: `${unit$1(token.paddingXS)} ${unit$1(token.paddingSM)}`,
collapseHeaderPaddingLG: `${unit$1(token.padding)} ${unit$1(token.paddingLG)}`,
collapsePanelBorderRadius: token.borderRadiusLG
});
return [
genBaseStyle$17(collapseToken),
genBorderlessStyle$1(collapseToken),
genGhostStyle(collapseToken),
genArrowStyle(collapseToken),
genCollapseMotion(collapseToken)
];
}, prepareComponentToken$53);
//#endregion
//#region node_modules/antd/es/collapse/Collapse.js
var Collapse = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { getPrefixCls, direction, expandIcon: contextExpandIcon, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("collapse");
const { prefixCls: customizePrefixCls, className, rootClassName, style, bordered = true, ghost, size: customizeSize, expandIconPlacement, expandIconPosition, children, destroyInactivePanel, destroyOnHidden, expandIcon, classNames, styles } = props;
const mergedSize = useSize((ctx) => customizeSize ?? ctx ?? "middle");
const prefixCls = getPrefixCls("collapse", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const [hashId, cssVarCls] = style_default$59(prefixCls);
const mergedPlacement = expandIconPlacement ?? expandIconPosition ?? "start";
const mergedProps = {
...props,
size: mergedSize,
bordered,
expandIconPlacement: mergedPlacement
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const mergedExpandIcon = expandIcon ?? contextExpandIcon;
{
const warning = devUseWarning("Collapse");
[["destroyInactivePanel", "destroyOnHidden"], ["expandIconPosition", "expandIconPlacement"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const renderExpandIcon = import_react.useCallback((panelProps = {}) => {
return cloneElement$1(typeof mergedExpandIcon === "function" ? mergedExpandIcon(panelProps) : /* @__PURE__ */ import_react.createElement(RefIcon$6, {
rotate: panelProps.isActive ? direction === "rtl" ? -90 : 90 : void 0,
"aria-label": panelProps.isActive ? "expanded" : "collapsed"
}), (oriProps) => ({ className: clsx(oriProps.className, `${prefixCls}-arrow`) }));
}, [
mergedExpandIcon,
prefixCls,
direction
]);
const collapseClassName = clsx(`${prefixCls}-icon-placement-${mergedPlacement}`, {
[`${prefixCls}-borderless`]: !bordered,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-ghost`]: !!ghost,
[`${prefixCls}-large`]: mergedSize === "large",
[`${prefixCls}-small`]: mergedSize === "small"
}, contextClassName, className, rootClassName, hashId, cssVarCls, mergedClassNames.root);
const openMotion = import_react.useMemo(() => ({
...initCollapseMotion(rootPrefixCls),
motionAppear: false,
leavedClassName: `${prefixCls}-panel-hidden`
}), [rootPrefixCls, prefixCls]);
const items = import_react.useMemo(() => {
if (children) return toArray$8(children).map((child) => child);
return null;
}, [children]);
return /* @__PURE__ */ import_react.createElement(es_default$24, {
ref,
openMotion,
...omit(props, ["rootClassName"]),
expandIcon: renderExpandIcon,
prefixCls,
className: collapseClassName,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
classNames: mergedClassNames,
styles: mergedStyles,
destroyOnHidden: destroyOnHidden ?? destroyInactivePanel
}, items);
});
Collapse.displayName = "Collapse";
//#endregion
//#region node_modules/antd/es/collapse/index.js
var collapse_default = Object.assign(Collapse, { Panel: CollapsePanel });
//#endregion
//#region node_modules/antd/es/color-picker/util.js
var generateColor = (color) => {
if (color instanceof AggregationColor) return color;
return new AggregationColor(color);
};
var getRoundNumber = (value) => Math.round(Number(value || 0));
var getColorAlpha = (color) => getRoundNumber(color.toHsb().a * 100);
/** Return the color whose `alpha` is 1 */
var genAlphaColor = (color, alpha) => {
const rgba = color.toRgb();
if (!rgba.r && !rgba.g && !rgba.b) {
const hsba = color.toHsb();
hsba.a = alpha || 1;
return generateColor(hsba);
}
rgba.a = alpha || 1;
return generateColor(rgba);
};
/**
* Get percent position color. e.g. [10%-#fff, 20%-#000], 15% => #888
*/
var getGradientPercentColor = (colors, percent) => {
const filledColors = [{
percent: 0,
color: colors[0].color
}].concat(_toConsumableArray$8(colors), [{
percent: 100,
color: colors[colors.length - 1].color
}]);
for (let i = 0; i < filledColors.length - 1; i += 1) {
const startPtg = filledColors[i].percent;
const endPtg = filledColors[i + 1].percent;
const startColor = filledColors[i].color;
const endColor = filledColors[i + 1].color;
if (startPtg <= percent && percent <= endPtg) {
const dist = endPtg - startPtg;
if (dist === 0) return startColor;
const ratio = (percent - startPtg) / dist * 100;
const startRcColor = new Color(startColor);
const endRcColor = new Color(endColor);
return startRcColor.mix(endRcColor, ratio).toRgbString();
}
}
/* istanbul ignore next */
return "";
};
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorPresets.js
var genPresetColor = (list) => list.map((value) => {
value.colors = value.colors.map(generateColor);
return value;
});
var isBright = (value, bgColorToken) => {
const { r, g, b, a } = value.toRgb();
const hsv = new Color(value.toRgbString()).onBackground(bgColorToken).toHsv();
if (a <= .5) return hsv.v > .5;
return r * .299 + g * .587 + b * .114 > 192;
};
var genCollapsePanelKey = (preset, index) => {
return `panel-${preset.key ?? index}`;
};
var ColorPresets = ({ prefixCls, presets, value: color, onChange }) => {
const [locale] = useLocale$1("ColorPicker");
const [, token] = useToken$1();
const presetsValue = (0, import_react.useMemo)(() => genPresetColor(presets), [presets]);
const colorPresetsPrefixCls = `${prefixCls}-presets`;
const activeKeys = (0, import_react.useMemo)(() => presetsValue.reduce((acc, preset, index) => {
const { defaultOpen = true } = preset;
if (defaultOpen) acc.push(genCollapsePanelKey(preset, index));
return acc;
}, []), [presetsValue]);
const handleClick = (colorValue) => {
onChange?.(colorValue);
};
const items = presetsValue.map((preset, index) => ({
key: genCollapsePanelKey(preset, index),
label: /* @__PURE__ */ import_react.createElement("div", { className: `${colorPresetsPrefixCls}-label` }, preset?.label),
children: /* @__PURE__ */ import_react.createElement("div", { className: `${colorPresetsPrefixCls}-items` }, Array.isArray(preset?.colors) && preset.colors?.length > 0 ? preset.colors.map((presetColor, index) => {
const colorInst = generateColor(presetColor);
return /* @__PURE__ */ import_react.createElement(ColorBlock, {
key: `preset-${index}-${presetColor.toHexString()}`,
color: colorInst.toCssString(),
prefixCls,
className: clsx(`${colorPresetsPrefixCls}-color`, {
[`${colorPresetsPrefixCls}-color-checked`]: presetColor.toCssString() === color?.toCssString(),
[`${colorPresetsPrefixCls}-color-bright`]: isBright(presetColor, token.colorBgElevated)
}),
onClick: () => handleClick(presetColor)
});
}) : /* @__PURE__ */ import_react.createElement("span", { className: `${colorPresetsPrefixCls}-empty` }, locale.presetEmpty))
}));
return /* @__PURE__ */ import_react.createElement("div", { className: colorPresetsPrefixCls }, /* @__PURE__ */ import_react.createElement(collapse_default, {
defaultActiveKey: activeKeys,
ghost: true,
items
}));
};
//#endregion
//#region node_modules/antd/es/button/style/token.js
var prepareToken$5 = (token) => {
const { paddingInline, onlyIconSize, borderColorDisabled } = token;
return merge(token, {
buttonPaddingHorizontal: paddingInline,
buttonPaddingVertical: 0,
buttonIconOnlyFontSize: onlyIconSize,
colorBorderDisabled: borderColorDisabled
});
};
var prepareComponentToken$52 = (token) => {
const contentFontSize = token.contentFontSize ?? token.fontSize;
const contentFontSizeSM = token.contentFontSizeSM ?? token.fontSize;
const contentFontSizeLG = token.contentFontSizeLG ?? token.fontSizeLG;
const contentLineHeight = token.contentLineHeight ?? getLineHeight(contentFontSize);
const contentLineHeightSM = token.contentLineHeightSM ?? getLineHeight(contentFontSizeSM);
const contentLineHeightLG = token.contentLineHeightLG ?? getLineHeight(contentFontSizeLG);
const solidTextColor = isBright(new AggregationColor(token.colorBgSolid), "#fff") ? "#000" : "#fff";
const shadowColorTokens = PresetColors.reduce((prev, colorKey) => ({
...prev,
[`${colorKey}ShadowColor`]: `0 ${unit$1(token.controlOutlineWidth)} 0 ${getAlphaColor$1(token[`${colorKey}1`], token.colorBgContainer)}`
}), {});
const defaultBgDisabled = token.colorBgContainerDisabled;
const dashedBgDisabled = token.colorBgContainerDisabled;
return {
...shadowColorTokens,
fontWeight: 400,
iconGap: token.marginXS,
defaultShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlTmpOutline}`,
primaryShadow: `0 ${token.controlOutlineWidth}px 0 ${token.controlOutline}`,
dangerShadow: `0 ${token.controlOutlineWidth}px 0 ${token.colorErrorOutline}`,
primaryColor: token.colorTextLightSolid,
dangerColor: token.colorTextLightSolid,
borderColorDisabled: token.colorBorderDisabled,
defaultGhostColor: token.colorBgContainer,
ghostBg: "transparent",
defaultGhostBorderColor: token.colorBgContainer,
paddingInline: token.paddingContentHorizontal - token.lineWidth,
paddingInlineLG: token.paddingContentHorizontal - token.lineWidth,
paddingInlineSM: 8 - token.lineWidth,
onlyIconSize: "inherit",
onlyIconSizeSM: "inherit",
onlyIconSizeLG: "inherit",
groupBorderColor: token.colorPrimaryHover,
linkHoverBg: "transparent",
textTextColor: token.colorText,
textTextHoverColor: token.colorText,
textTextActiveColor: token.colorText,
textHoverBg: token.colorFillTertiary,
defaultColor: token.colorText,
defaultBg: token.colorBgContainer,
defaultBorderColor: token.colorBorder,
defaultBorderColorDisabled: token.colorBorder,
defaultHoverBg: token.colorBgContainer,
defaultHoverColor: token.colorPrimaryHover,
defaultHoverBorderColor: token.colorPrimaryHover,
defaultActiveBg: token.colorBgContainer,
defaultActiveColor: token.colorPrimaryActive,
defaultActiveBorderColor: token.colorPrimaryActive,
solidTextColor,
contentFontSize,
contentFontSizeSM,
contentFontSizeLG,
contentLineHeight,
contentLineHeightSM,
contentLineHeightLG,
paddingBlock: Math.max((token.controlHeight - contentFontSize * contentLineHeight) / 2 - token.lineWidth, 0),
paddingBlockSM: Math.max((token.controlHeightSM - contentFontSizeSM * contentLineHeightSM) / 2 - token.lineWidth, 0),
paddingBlockLG: Math.max((token.controlHeightLG - contentFontSizeLG * contentLineHeightLG) / 2 - token.lineWidth, 0),
defaultBgDisabled,
dashedBgDisabled
};
};
//#endregion
//#region node_modules/antd/es/button/style/variant.js
var genVariantStyle = (token) => {
const { componentCls, antCls, lineWidth } = token;
const [varName, varRef] = genCssVar(antCls, "btn");
return { [componentCls]: [
{
[varName("border-width")]: lineWidth,
[varName("border-color")]: "#000",
[varName("border-color-hover")]: varRef("border-color"),
[varName("border-color-active")]: varRef("border-color"),
[varName("border-color-disabled")]: varRef("border-color"),
[varName("border-style")]: "solid",
[varName("text-color")]: "#000",
[varName("text-color-hover")]: varRef("text-color"),
[varName("text-color-active")]: varRef("text-color"),
[varName("text-color-disabled")]: varRef("text-color"),
[varName("bg-color")]: "#ddd",
[varName("bg-color-hover")]: varRef("bg-color"),
[varName("bg-color-active")]: varRef("bg-color"),
[varName("bg-color-disabled")]: token.colorBgContainerDisabled,
[varName("bg-color-container")]: token.colorBgContainer,
[varName("shadow")]: "none"
},
{
border: [
varRef("border-width"),
varRef("border-style"),
varRef("border-color")
].join(" "),
color: varRef("text-color"),
backgroundColor: varRef("bg-color"),
[`&:not(:disabled):not(${componentCls}-disabled)`]: {
"&:hover": {
border: [
varRef("border-width"),
varRef("border-style"),
varRef("border-color-hover")
].join(" "),
color: varRef("text-color-hover"),
backgroundColor: varRef("bg-color-hover")
},
"&:active": {
border: [
varRef("border-width"),
varRef("border-style"),
varRef("border-color-active")
].join(" "),
color: varRef("text-color-active"),
backgroundColor: varRef("bg-color-active")
}
}
},
{
[`&${componentCls}-variant-solid`]: {
[varName("solid-bg-color")]: varRef("color-base"),
[varName("solid-bg-color-hover")]: varRef("color-hover"),
[varName("solid-bg-color-active")]: varRef("color-active"),
[varName("border-color")]: "transparent",
[varName("text-color")]: token.colorTextLightSolid,
[varName("bg-color")]: varRef("solid-bg-color"),
[varName("bg-color-hover")]: varRef("solid-bg-color-hover"),
[varName("bg-color-active")]: varRef("solid-bg-color-active"),
boxShadow: varRef("shadow")
},
[`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
[varName("border-color")]: varRef("color-base"),
[varName("border-color-hover")]: varRef("color-hover"),
[varName("border-color-active")]: varRef("color-active"),
[varName("bg-color")]: varRef("bg-color-container"),
[varName("text-color")]: varRef("color-base"),
[varName("text-color-hover")]: varRef("color-hover"),
[varName("text-color-active")]: varRef("color-active"),
boxShadow: varRef("shadow")
},
[`&${componentCls}-variant-dashed`]: {
[varName("border-style")]: "dashed",
[varName("bg-color-disabled")]: token.dashedBgDisabled
},
[`&${componentCls}-variant-filled`]: {
[varName("border-color")]: "transparent",
[varName("text-color")]: varRef("color-base"),
[varName("bg-color")]: varRef("color-light"),
[varName("bg-color-hover")]: varRef("color-light-hover"),
[varName("bg-color-active")]: varRef("color-light-active")
},
[`&${componentCls}-variant-text, &${componentCls}-variant-link`]: {
[varName("border-color")]: "transparent",
[varName("text-color")]: varRef("color-base"),
[varName("text-color-hover")]: varRef("color-hover"),
[varName("text-color-active")]: varRef("color-active"),
[varName("bg-color")]: "transparent",
[varName("bg-color-hover")]: "transparent",
[varName("bg-color-active")]: "transparent",
[`&:disabled, &${token.componentCls}-disabled`]: {
background: "transparent",
borderColor: "transparent"
}
},
[`&${componentCls}-variant-text`]: {
[varName("bg-color-hover")]: varRef("color-light"),
[varName("bg-color-active")]: varRef("color-light-active")
}
},
{
[`&${componentCls}-variant-link`]: {
[varName("color-base")]: token.colorLink,
[varName("color-hover")]: token.colorLinkHover,
[varName("color-active")]: token.colorLinkActive,
[varName("bg-color-hover")]: token.linkHoverBg
},
[`&${componentCls}-color-primary`]: {
[varName("color-base")]: token.colorPrimary,
[varName("color-hover")]: token.colorPrimaryHover,
[varName("color-active")]: token.colorPrimaryActive,
[varName("color-light")]: token.colorPrimaryBg,
[varName("color-light-hover")]: token.colorPrimaryBgHover,
[varName("color-light-active")]: token.colorPrimaryBorder,
[varName("shadow")]: token.primaryShadow,
[`&${componentCls}-variant-solid`]: {
[varName("text-color")]: token.primaryColor,
[varName("text-color-hover")]: varRef("text-color"),
[varName("text-color-active")]: varRef("text-color")
}
},
[`&${componentCls}-color-dangerous`]: {
[varName("color-base")]: token.colorError,
[varName("color-hover")]: token.colorErrorHover,
[varName("color-active")]: token.colorErrorActive,
[varName("color-light")]: token.colorErrorBg,
[varName("color-light-hover")]: token.colorErrorBgFilledHover,
[varName("color-light-active")]: token.colorErrorBgActive,
[varName("shadow")]: token.dangerShadow,
[`&${componentCls}-variant-solid`]: {
[varName("text-color")]: token.dangerColor,
[varName("text-color-hover")]: varRef("text-color"),
[varName("text-color-active")]: varRef("text-color")
}
},
[`&${componentCls}-color-default`]: {
[varName("solid-bg-color")]: token.colorBgSolid,
[varName("solid-bg-color-hover")]: token.colorBgSolidHover,
[varName("solid-bg-color-active")]: token.colorBgSolidActive,
[varName("color-base")]: token.defaultBorderColor,
[varName("color-hover")]: token.defaultHoverBorderColor,
[varName("color-active")]: token.defaultActiveBorderColor,
[varName("color-light")]: token.colorFillTertiary,
[varName("color-light-hover")]: token.colorFillSecondary,
[varName("color-light-active")]: token.colorFill,
[varName("text-color")]: token.defaultColor,
[varName("text-color-hover")]: token.defaultHoverColor,
[varName("text-color-active")]: token.defaultActiveColor,
[varName("shadow")]: token.defaultShadow,
[`&${componentCls}-variant-outlined`]: { [varName("bg-color-disabled")]: token.defaultBgDisabled },
[`&${componentCls}-variant-solid`]: {
[varName("text-color")]: token.solidTextColor,
[varName("text-color-hover")]: varRef("text-color"),
[varName("text-color-active")]: varRef("text-color")
},
[`&${componentCls}-variant-filled, &${componentCls}-variant-text`]: {
[varName("text-color-hover")]: varRef("text-color"),
[varName("text-color-active")]: varRef("text-color")
},
[`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
[varName("text-color")]: token.defaultColor,
[varName("text-color-hover")]: token.defaultHoverColor,
[varName("text-color-active")]: token.defaultActiveColor,
[varName("bg-color-container")]: token.defaultBg,
[varName("bg-color-hover")]: token.defaultHoverBg,
[varName("bg-color-active")]: token.defaultActiveBg
},
[`&${componentCls}-variant-text`]: {
[varName("text-color")]: token.textTextColor,
[varName("text-color-hover")]: token.textTextHoverColor,
[varName("text-color-active")]: token.textTextActiveColor,
[varName("bg-color-hover")]: token.textHoverBg
},
[`&${componentCls}-background-ghost`]: { [`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
[varName("text-color")]: token.defaultGhostColor,
[varName("border-color")]: token.defaultGhostBorderColor
} }
}
},
PresetColors.map((colorKey) => {
const darkColor = token[`${colorKey}6`];
const lightColor = token[`${colorKey}1`];
const hoverColor = token[`${colorKey}Hover`];
const lightHoverColor = token[`${colorKey}2`];
const lightActiveColor = token[`${colorKey}3`];
const activeColor = token[`${colorKey}Active`];
const shadowColor = token[`${colorKey}ShadowColor`];
return { [`&${componentCls}-color-${colorKey}`]: {
[varName("color-base")]: darkColor,
[varName("color-hover")]: hoverColor,
[varName("color-active")]: activeColor,
[varName("color-light")]: lightColor,
[varName("color-light-hover")]: lightHoverColor,
[varName("color-light-active")]: lightActiveColor,
[varName("shadow")]: shadowColor
} };
}),
{ [`&:disabled, &${token.componentCls}-disabled`]: {
cursor: "not-allowed",
borderColor: token.colorBorderDisabled,
background: varRef("bg-color-disabled"),
color: token.colorTextDisabled,
boxShadow: "none"
} },
{ [`&${componentCls}-background-ghost`]: {
[varName("bg-color")]: token.ghostBg,
[varName("bg-color-hover")]: token.ghostBg,
[varName("bg-color-active")]: token.ghostBg,
[varName("shadow")]: "none",
[`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
[varName("bg-color-hover")]: token.ghostBg,
[varName("bg-color-active")]: token.ghostBg
}
} }
] };
};
//#endregion
//#region node_modules/antd/es/button/style/index.js
var genSharedButtonStyle = (token) => {
const { componentCls, iconCls, fontWeight, opacityLoading, motionDurationSlow, motionEaseInOut, iconGap, calc } = token;
return { [componentCls]: {
outline: "none",
position: "relative",
display: "inline-flex",
gap: iconGap,
alignItems: "center",
justifyContent: "center",
fontWeight,
whiteSpace: "nowrap",
textAlign: "center",
backgroundImage: "none",
cursor: "pointer",
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
userSelect: "none",
touchAction: "manipulation",
...genNoMotionStyle(),
"&:disabled > *": { pointerEvents: "none" },
[`${componentCls}-icon > svg`]: resetIcon(),
"> a": { color: "currentColor" },
"&:not(:disabled)": genFocusStyle(token),
[`&${componentCls}-two-chinese-chars::first-letter`]: { letterSpacing: "0.34em" },
[`&${componentCls}-two-chinese-chars > *:not(${iconCls})`]: {
marginInlineEnd: "-0.34em",
letterSpacing: "0.34em"
},
[`&${componentCls}-icon-only`]: {
paddingInline: 0,
[`&${componentCls}-compact-item`]: { flex: "none" }
},
[`&${componentCls}-loading`]: {
opacity: opacityLoading,
cursor: "default"
},
[`${componentCls}-loading-icon`]: { transition: [
"width",
"opacity",
"margin"
].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(",") },
[`&:not(${componentCls}-icon-end)`]: { [`${componentCls}-loading-icon-motion`]: {
"&-appear-start, &-enter-start": { marginInlineEnd: calc(iconGap).mul(-1).equal() },
"&-appear-active, &-enter-active": { marginInlineEnd: 0 },
"&-leave-start": { marginInlineEnd: 0 },
"&-leave-active": { marginInlineEnd: calc(iconGap).mul(-1).equal() }
} },
"&-icon-end": {
flexDirection: "row-reverse",
[`${componentCls}-loading-icon-motion`]: {
"&-appear-start, &-enter-start": { marginInlineStart: calc(iconGap).mul(-1).equal() },
"&-appear-active, &-enter-active": { marginInlineStart: 0 },
"&-leave-start": { marginInlineStart: 0 },
"&-leave-active": { marginInlineStart: calc(iconGap).mul(-1).equal() }
}
}
} };
};
var genCircleButtonStyle = (token) => ({
minWidth: token.controlHeight,
paddingInline: 0,
borderRadius: "50%"
});
var genButtonStyle = (token, prefixCls = "") => {
const { componentCls, controlHeight, fontSize, borderRadius, buttonPaddingHorizontal, iconCls, buttonPaddingVertical, buttonIconOnlyFontSize } = token;
return [
{ [prefixCls]: {
fontSize,
height: controlHeight,
padding: `${unit$1(buttonPaddingVertical)} ${unit$1(buttonPaddingHorizontal)}`,
borderRadius,
[`&${componentCls}-icon-only`]: {
width: controlHeight,
[iconCls]: { fontSize: buttonIconOnlyFontSize }
}
} },
{ [`${componentCls}${componentCls}-circle${prefixCls}`]: genCircleButtonStyle(token) },
{ [`${componentCls}${componentCls}-round${prefixCls}`]: {
borderRadius: token.controlHeight,
[`&:not(${componentCls}-icon-only)`]: { paddingInline: token.buttonPaddingHorizontal }
} }
];
};
var genSizeBaseButtonStyle = (token) => {
return genButtonStyle(merge(token, { fontSize: token.contentFontSize }), token.componentCls);
};
var genSizeSmallButtonStyle = (token) => {
return genButtonStyle(merge(token, {
controlHeight: token.controlHeightSM,
fontSize: token.contentFontSizeSM,
padding: token.paddingXS,
buttonPaddingHorizontal: token.paddingInlineSM,
buttonPaddingVertical: 0,
borderRadius: token.borderRadiusSM,
buttonIconOnlyFontSize: token.onlyIconSizeSM
}), `${token.componentCls}-sm`);
};
var genSizeLargeButtonStyle = (token) => {
return genButtonStyle(merge(token, {
controlHeight: token.controlHeightLG,
fontSize: token.contentFontSizeLG,
buttonPaddingHorizontal: token.paddingInlineLG,
buttonPaddingVertical: 0,
borderRadius: token.borderRadiusLG,
buttonIconOnlyFontSize: token.onlyIconSizeLG
}), `${token.componentCls}-lg`);
};
var genBlockButtonStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: { [`&${componentCls}-block`]: { width: "100%" } } };
};
var style_default$58 = genStyleHooks("Button", (token) => {
const buttonToken = prepareToken$5(token);
return [
genSharedButtonStyle(buttonToken),
genSizeBaseButtonStyle(buttonToken),
genSizeSmallButtonStyle(buttonToken),
genSizeLargeButtonStyle(buttonToken),
genBlockButtonStyle(buttonToken),
genVariantStyle(buttonToken),
genGroupStyle$3(buttonToken)
];
}, prepareComponentToken$52, { unitless: {
fontWeight: true,
contentLineHeight: true,
contentLineHeightSM: true,
contentLineHeightLG: true
} });
//#endregion
//#region node_modules/antd/es/style/compact-item.js
function compactItemBorder(token, parentCls, options, prefixCls) {
const { focusElCls, focus, borderElCls } = options;
const childCombinator = borderElCls ? "> *" : "";
const hoverEffects = [
"hover",
focus ? "focus" : null,
"active"
].filter(Boolean).map((n) => `&:${n} ${childCombinator}`).join(",");
return {
[`&-item:not(${parentCls}-last-item)`]: { marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal() },
[`&-item:not(${prefixCls}-status-success)`]: { zIndex: 2 },
"&-item": {
[hoverEffects]: { zIndex: 3 },
...focusElCls ? { [`&${focusElCls}`]: { zIndex: 3 } } : {},
[`&[disabled] ${childCombinator}`]: { zIndex: 0 }
}
};
}
function compactItemBorderRadius(prefixCls, parentCls, options) {
const { borderElCls } = options;
const childCombinator = borderElCls ? `> ${borderElCls}` : "";
return {
[`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: { borderRadius: 0 },
[`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: { [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
} },
[`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: { [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
} }
};
}
function genCompactItemStyle(token, options = { focus: true }) {
const { componentCls } = token;
const { componentCls: customizePrefixCls } = options;
const mergedComponentCls = customizePrefixCls || componentCls;
const compactCls = `${mergedComponentCls}-compact`;
return { [compactCls]: {
...compactItemBorder(token, compactCls, options, mergedComponentCls),
...compactItemBorderRadius(mergedComponentCls, compactCls, options)
} };
}
//#endregion
//#region node_modules/antd/es/style/compact-item-vertical.js
function compactItemVerticalBorder(token, parentCls, prefixCls) {
return {
[`&-item:not(${parentCls}-last-item)`]: { marginBottom: token.calc(token.lineWidth).mul(-1).equal() },
[`&-item:not(${prefixCls}-status-success)`]: { zIndex: 2 },
"&-item": {
"&:hover,&:focus,&:active": { zIndex: 3 },
"&[disabled]": { zIndex: 0 }
}
};
}
function compactItemBorderVerticalRadius(prefixCls, parentCls) {
return {
[`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: { borderRadius: 0 },
[`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: { [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
borderEndEndRadius: 0,
borderEndStartRadius: 0
} },
[`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: { [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
borderStartStartRadius: 0,
borderStartEndRadius: 0
} }
};
}
function genCompactItemVerticalStyle(token) {
const compactCls = `${token.componentCls}-compact-vertical`;
return { [compactCls]: {
...compactItemVerticalBorder(token, compactCls, token.componentCls),
...compactItemBorderVerticalRadius(token.componentCls, compactCls)
} };
}
//#endregion
//#region node_modules/antd/es/button/style/compact.js
var genButtonCompactStyle = (token) => {
const { antCls, componentCls, lineWidth, calc, colorBgContainer } = token;
const solidSelector = `${componentCls}-variant-solid:not([disabled])`;
const insetOffset = calc(lineWidth).mul(-1).equal();
const [varName, varRef] = genCssVar(antCls, "btn");
const getCompactBorderStyle = (vertical) => {
return { [`${componentCls}-compact${vertical ? "-vertical" : ""}-item`]: {
[varName("compact-connect-border-color")]: varRef("bg-color-hover"),
[`&${solidSelector}`]: {
transition: `none`,
[`& + ${solidSelector}:before`]: [{
position: "absolute",
backgroundColor: varRef("compact-connect-border-color"),
content: "\"\""
}, vertical ? {
top: insetOffset,
insetInline: insetOffset,
height: lineWidth
} : {
insetBlock: insetOffset,
insetInlineStart: insetOffset,
width: lineWidth
}],
"&:hover:before": { display: "none" }
}
} };
};
return [
getCompactBorderStyle(),
getCompactBorderStyle(true),
{ [`${solidSelector}${componentCls}-color-default`]: { [varName("compact-connect-border-color")]: `color-mix(in srgb, ${varRef("bg-color-hover")} 75%, ${colorBgContainer})` } }
];
};
var compact_default = genSubStyleComponent(["Button", "compact"], (token) => {
const buttonToken = prepareToken$5(token);
return [
genCompactItemStyle(buttonToken),
genCompactItemVerticalStyle(buttonToken),
genButtonCompactStyle(buttonToken)
];
}, prepareComponentToken$52);
//#endregion
//#region node_modules/antd/es/button/Button.js
function getLoadingConfig(loading) {
if (isPlainObject(loading)) {
let delay = loading?.delay;
delay = isNumber(delay) ? delay : 0;
return {
loading: delay <= 0,
delay
};
}
return {
loading: !!loading,
delay: 0
};
}
var ButtonTypeMap = {
default: ["default", "outlined"],
primary: ["primary", "solid"],
dashed: ["default", "dashed"],
link: ["link", "link"],
text: ["default", "text"]
};
var Button = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { _skipSemantic, loading = false, prefixCls: customizePrefixCls, color, variant, type, danger = false, shape: customizeShape, size: customizeSize, disabled: customDisabled, className, rootClassName, children, icon, iconPosition, iconPlacement, ghost = false, block = false, htmlType = "button", classNames, styles, style, autoInsertSpace, autoFocus, ...rest } = props;
const childNodes = toArray$8(children);
const mergedType = type || "default";
const { getPrefixCls, direction, autoInsertSpace: contextAutoInsertSpace, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, loadingIcon: contextLoadingIcon, shape: contextShape, color: contextColor, variant: contextVariant } = useComponentConfig("button");
const mergedShape = customizeShape || contextShape || "default";
const [parsedColor, parsedVariant] = (0, import_react.useMemo)(() => {
if (color && variant) return [color, variant];
if (type || danger) {
const colorVariantPair = ButtonTypeMap[mergedType] || [];
if (danger) return ["danger", colorVariantPair[1]];
return colorVariantPair;
}
if (contextColor && contextVariant) return [contextColor, contextVariant];
return ["default", "outlined"];
}, [
color,
variant,
type,
danger,
contextColor,
contextVariant,
mergedType
]);
const [mergedColor, mergedVariant] = (0, import_react.useMemo)(() => {
if (ghost && parsedVariant === "solid") return [parsedColor, "outlined"];
return [parsedColor, parsedVariant];
}, [
parsedColor,
parsedVariant,
ghost
]);
const isDanger = mergedColor === "danger";
const mergedColorText = isDanger ? "dangerous" : mergedColor;
const mergedInsertSpace = autoInsertSpace ?? contextAutoInsertSpace ?? true;
const prefixCls = getPrefixCls("btn", customizePrefixCls);
const [hashId, cssVarCls] = style_default$58(prefixCls);
const disabled = (0, import_react.useContext)(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const groupSize = (0, import_react.useContext)(GroupSizeContext);
const loadingOrDelay = (0, import_react.useMemo)(() => getLoadingConfig(loading), [loading]);
const [innerLoading, setInnerLoading] = (0, import_react.useState)(loadingOrDelay.loading);
const [hasTwoCNChar, setHasTwoCNChar] = (0, import_react.useState)(false);
const buttonRef = (0, import_react.useRef)(null);
const mergedRef = useComposeRef(ref, buttonRef);
const needInserted = childNodes.length === 1 && !icon && !isUnBorderedButtonVariant(mergedVariant);
const isMountRef = (0, import_react.useRef)(true);
import_react.useEffect(() => {
isMountRef.current = false;
return () => {
isMountRef.current = true;
};
}, []);
useLayoutEffect$1(() => {
let delayTimer = null;
if (loadingOrDelay.delay > 0) delayTimer = setTimeout(() => {
delayTimer = null;
setInnerLoading(true);
}, loadingOrDelay.delay);
else setInnerLoading(loadingOrDelay.loading);
function cleanupTimer() {
if (delayTimer) {
clearTimeout(delayTimer);
delayTimer = null;
}
}
return cleanupTimer;
}, [loadingOrDelay.delay, loadingOrDelay.loading]);
(0, import_react.useEffect)(() => {
if (!buttonRef.current || !mergedInsertSpace) return;
const buttonText = buttonRef.current.textContent || "";
if (needInserted && isTwoCNChar(buttonText)) {
if (!hasTwoCNChar) setHasTwoCNChar(true);
} else if (hasTwoCNChar) setHasTwoCNChar(false);
});
(0, import_react.useEffect)(() => {
if (autoFocus && buttonRef.current) buttonRef.current.focus();
}, []);
const handleClick = import_react.useCallback((e) => {
if (innerLoading || mergedDisabled) {
e.preventDefault();
return;
}
props.onClick?.("href" in props ? e : e);
}, [
props.onClick,
innerLoading,
mergedDisabled
]);
{
const warning = devUseWarning("Button");
warning(!(typeof icon === "string" && icon.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`);
warning(!(ghost && isUnBorderedButtonVariant(mergedVariant)), "usage", "`link` or `text` button can't be a `ghost` button.");
warning.deprecated(!iconPosition, "iconPosition", "iconPlacement");
}
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const sizeFullName = useSize((ctxSize) => customizeSize ?? compactSize ?? groupSize ?? ctxSize);
const iconType = innerLoading ? "loading" : icon;
const mergedIconPlacement = iconPlacement ?? iconPosition ?? "start";
const linkButtonRestProps = omit(rest, ["navigate"]);
const mergedProps = {
...props,
type: mergedType,
color: mergedColor,
variant: mergedVariant,
danger: isDanger,
shape: mergedShape,
size: sizeFullName,
disabled: mergedDisabled,
loading: innerLoading,
iconPlacement: mergedIconPlacement
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([_skipSemantic ? void 0 : contextClassNames, classNames], [_skipSemantic ? void 0 : contextStyles, styles], { props: mergedProps });
const classes = clsx(prefixCls, hashId, cssVarCls, {
[`${prefixCls}-${mergedShape}`]: mergedShape !== "default" && mergedShape !== "square" && mergedShape,
[`${prefixCls}-${mergedType}`]: mergedType,
[`${prefixCls}-dangerous`]: danger,
[`${prefixCls}-color-${mergedColorText}`]: mergedColorText,
[`${prefixCls}-variant-${mergedVariant}`]: mergedVariant,
[`${prefixCls}-lg`]: sizeFullName === "large",
[`${prefixCls}-sm`]: sizeFullName === "small",
[`${prefixCls}-icon-only`]: !children && children !== 0 && !!iconType,
[`${prefixCls}-background-ghost`]: ghost && !isUnBorderedButtonVariant(mergedVariant),
[`${prefixCls}-loading`]: innerLoading,
[`${prefixCls}-two-chinese-chars`]: hasTwoCNChar && mergedInsertSpace && !innerLoading,
[`${prefixCls}-block`]: block,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-icon-end`]: mergedIconPlacement === "end"
}, compactItemClassnames, className, rootClassName, contextClassName, mergedClassNames.root);
const fullStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
const iconSharedProps = {
className: mergedClassNames.icon,
style: mergedStyles.icon
};
/**
* Extract icon node
* If there is a custom icon and not in loading state: show custom icon
*/
const iconWrapperElement = (child) => /* @__PURE__ */ import_react.createElement(IconWrapper, {
prefixCls,
...iconSharedProps
}, child);
const defaultLoadingIconElement = /* @__PURE__ */ import_react.createElement(DefaultLoadingIcon, {
existIcon: !!icon,
prefixCls,
loading: innerLoading,
mount: isMountRef.current,
...iconSharedProps
});
const mergedLoadingIcon = isPlainObject(loading) ? loading.icon || contextLoadingIcon : contextLoadingIcon;
/**
* Using if-else statements can improve code readability without affecting future expansion.
*/
let iconNode;
if (icon && !innerLoading) iconNode = iconWrapperElement(icon);
else if (loading && mergedLoadingIcon) iconNode = iconWrapperElement(mergedLoadingIcon);
else iconNode = defaultLoadingIconElement;
const contentNode = isNonNullable(children) ? spaceChildren(children, needInserted && mergedInsertSpace, mergedStyles.content, mergedClassNames.content) : null;
if (linkButtonRestProps.href !== void 0) return /* @__PURE__ */ import_react.createElement("a", {
...linkButtonRestProps,
className: clsx(classes, { [`${prefixCls}-disabled`]: mergedDisabled }),
href: mergedDisabled ? void 0 : linkButtonRestProps.href,
style: fullStyle,
onClick: handleClick,
ref: mergedRef,
tabIndex: mergedDisabled ? -1 : 0,
"aria-disabled": mergedDisabled
}, iconNode, contentNode);
let buttonNode = /* @__PURE__ */ import_react.createElement("button", {
...rest,
type: htmlType,
className: classes,
style: fullStyle,
onClick: handleClick,
disabled: mergedDisabled,
ref: mergedRef
}, iconNode, contentNode, compactItemClassnames && /* @__PURE__ */ import_react.createElement(compact_default, { prefixCls }));
if (!isUnBorderedButtonVariant(mergedVariant)) buttonNode = /* @__PURE__ */ import_react.createElement(Wave, {
component: "Button",
disabled: innerLoading
}, buttonNode);
return buttonNode;
});
Button.Group = ButtonGroup;
Button.__ANT_BUTTON = true;
Button.displayName = "Button";
//#endregion
//#region node_modules/antd/es/_util/ActionButton.js
var ActionButton = (props) => {
const { type, children, prefixCls, buttonProps, close, autoFocus, emitEvent, isSilent, quitOnNullishReturnValue, actionFn } = props;
const clickedRef = import_react.useRef(false);
const buttonRef = import_react.useRef(null);
const [loading, setLoading] = useSafeState(false);
const onInternalClose = (...args) => {
close?.(...args);
};
import_react.useEffect(() => {
let timeoutId = null;
if (autoFocus) timeoutId = setTimeout(() => {
buttonRef.current?.focus({ preventScroll: true });
});
return () => {
if (timeoutId) clearTimeout(timeoutId);
};
}, [autoFocus]);
const handlePromiseOnOk = (returnValueOfOnOk) => {
if (!isThenable(returnValueOfOnOk)) return;
setLoading(true);
returnValueOfOnOk.then((...args) => {
setLoading(false, true);
onInternalClose.apply(void 0, args);
clickedRef.current = false;
}, (e) => {
setLoading(false, true);
clickedRef.current = false;
if (isSilent?.()) return;
return Promise.reject(e);
});
};
const onClick = (e) => {
if (clickedRef.current) return;
clickedRef.current = true;
if (!actionFn) {
onInternalClose();
return;
}
let returnValueOfOnOk;
if (emitEvent) {
returnValueOfOnOk = actionFn(e);
if (quitOnNullishReturnValue && !isThenable(returnValueOfOnOk)) {
clickedRef.current = false;
onInternalClose(e);
return;
}
} else if (actionFn.length) {
returnValueOfOnOk = actionFn(close);
clickedRef.current = false;
} else {
returnValueOfOnOk = actionFn();
if (!isThenable(returnValueOfOnOk)) {
onInternalClose();
return;
}
}
handlePromiseOnOk(returnValueOfOnOk);
};
return /* @__PURE__ */ import_react.createElement(Button, {
...convertLegacyProps(type),
onClick,
loading,
prefixCls,
...buttonProps,
ref: buttonRef
}, children);
};
//#endregion
//#region node_modules/antd/es/modal/context.js
var ModalContext = /* @__PURE__ */ import_react.createContext({});
var { Provider: ModalContextProvider } = ModalContext;
//#endregion
//#region node_modules/antd/es/modal/components/ConfirmCancelBtn.js
var ConfirmCancelBtn = () => {
const { autoFocusButton, cancelButtonProps, cancelTextLocale, isSilent, mergedOkCancel, rootPrefixCls, close, onCancel, onConfirm, onClose } = (0, import_react.useContext)(ModalContext);
return mergedOkCancel ? /* @__PURE__ */ import_react.createElement(ActionButton, {
isSilent,
actionFn: onCancel,
close: (...args) => {
close?.(...args);
onConfirm?.(false);
onClose?.();
},
autoFocus: autoFocusButton === "cancel",
buttonProps: cancelButtonProps,
prefixCls: `${rootPrefixCls}-btn`
}, cancelTextLocale) : null;
};
//#endregion
//#region node_modules/antd/es/modal/components/ConfirmOkBtn.js
var ConfirmOkBtn = () => {
const { autoFocusButton, close, isSilent, okButtonProps, rootPrefixCls, okTextLocale, okType, onConfirm, onOk, onClose } = (0, import_react.useContext)(ModalContext);
return /* @__PURE__ */ import_react.createElement(ActionButton, {
isSilent,
type: okType || "primary",
actionFn: onOk,
close: (...args) => {
close?.(...args);
onConfirm?.(true);
onClose?.();
},
autoFocus: autoFocusButton === "ok",
buttonProps: okButtonProps,
prefixCls: `${rootPrefixCls}-btn`
}, okTextLocale);
};
//#endregion
//#region node_modules/@rc-component/dialog/es/context.js
var RefContext$1 = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/dialog/es/util.js
function getMotionName(prefixCls, transitionName, animationName) {
let motionName = transitionName;
if (!motionName && animationName) motionName = `${prefixCls}-${animationName}`;
return motionName;
}
function getScroll$1(w, top) {
let ret = w[`page${top ? "Y" : "X"}Offset`];
const method = `scroll${top ? "Top" : "Left"}`;
if (typeof ret !== "number") {
const d = w.document;
ret = d.documentElement[method];
if (typeof ret !== "number") ret = d.body[method];
}
return ret;
}
function offset$1(el) {
const rect = el.getBoundingClientRect();
const pos = {
left: rect.left,
top: rect.top
};
const doc = el.ownerDocument;
const w = doc.defaultView || doc.parentWindow;
pos.left += getScroll$1(w);
pos.top += getScroll$1(w, true);
return pos;
}
//#endregion
//#region node_modules/@rc-component/util/es/Dom/focus.js
function focusable(node, includePositive = false) {
if (isVisible_default(node)) {
const nodeName = node.nodeName.toLowerCase();
const isFocusableElement = [
"input",
"select",
"textarea",
"button"
].includes(nodeName) || node.isContentEditable || nodeName === "a" && !!node.getAttribute("href");
const tabIndexAttr = node.getAttribute("tabindex");
const tabIndexNum = Number(tabIndexAttr);
let tabIndex = null;
if (tabIndexAttr && !Number.isNaN(tabIndexNum)) tabIndex = tabIndexNum;
else if (isFocusableElement && tabIndex === null) tabIndex = 0;
if (isFocusableElement && node.disabled) tabIndex = null;
return tabIndex !== null && (tabIndex >= 0 || includePositive && tabIndex < 0);
}
return false;
}
function getFocusNodeList(node, includePositive = false) {
const res = [...node.querySelectorAll("*")].filter((child) => {
return focusable(child, includePositive);
});
if (focusable(node, includePositive)) res.unshift(node);
return res;
}
/**
* Focus element and set cursor position for input/textarea elements.
*/
function triggerFocus(element, option) {
if (!element) return;
element.focus(option);
const { cursor } = option || {};
if (cursor && (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement)) {
const len = element.value.length;
switch (cursor) {
case "start":
element.setSelectionRange(0, 0);
break;
case "end":
element.setSelectionRange(len, len);
break;
default: element.setSelectionRange(0, len);
}
}
}
var lastFocusElement = null;
var focusElements = [];
var idToElementMap = /* @__PURE__ */ new Map();
var ignoredElementMap = /* @__PURE__ */ new Map();
function getLastElement() {
return focusElements[focusElements.length - 1];
}
function isIgnoredElement(element) {
const lastElement = getLastElement();
if (element && lastElement) {
let lockId;
for (const [id, ele] of idToElementMap.entries()) if (ele === lastElement) {
lockId = id;
break;
}
const ignoredEle = ignoredElementMap.get(lockId);
return !!ignoredEle && (ignoredEle === element || ignoredEle.contains(element));
}
return false;
}
function hasFocus(element) {
const { activeElement } = document;
return element === activeElement || element.contains(activeElement);
}
function syncFocus() {
const lastElement = getLastElement();
const { activeElement } = document;
if (isIgnoredElement(activeElement)) return;
if (lastElement && !hasFocus(lastElement)) {
const focusableList = getFocusNodeList(lastElement);
(focusableList.includes(lastFocusElement) ? lastFocusElement : focusableList[0])?.focus({ preventScroll: true });
} else lastFocusElement = activeElement;
}
function onWindowKeyDown(e) {
if (e.key === "Tab") {
const { activeElement } = document;
const focusableList = getFocusNodeList(getLastElement());
const last = focusableList[focusableList.length - 1];
if (e.shiftKey && activeElement === focusableList[0]) lastFocusElement = last;
else if (!e.shiftKey && activeElement === last) lastFocusElement = focusableList[0];
}
}
/**
* Lock focus in the element.
* It will force back to the first focusable element when focus leaves the element.
* @param id - A stable ID for this lock instance
*/
function lockFocus(element, id) {
if (element) {
idToElementMap.set(id, element);
focusElements = focusElements.filter((ele) => ele !== element);
focusElements.push(element);
window.addEventListener("focusin", syncFocus);
window.addEventListener("keydown", onWindowKeyDown, true);
syncFocus();
}
return () => {
lastFocusElement = null;
focusElements = focusElements.filter((ele) => ele !== element);
idToElementMap.delete(id);
ignoredElementMap.delete(id);
if (focusElements.length === 0) {
window.removeEventListener("focusin", syncFocus);
window.removeEventListener("keydown", onWindowKeyDown, true);
}
};
}
/**
* Retry an effect until it reports ready.
* When `ready` is `false`, it will schedule one more effect cycle and call `func` again
* with the next `retryTimes`.
*/
function useRetryEffect(func, deps) {
const retryTimesRef = (0, import_react.useRef)(0);
const [retryMark, setRetryMark] = (0, import_react.useState)(0);
(0, import_react.useEffect)(() => {
retryTimesRef.current = 0;
}, deps);
(0, import_react.useEffect)(() => {
const [clearFn, ready] = func(retryTimesRef.current);
if (!ready) {
retryTimesRef.current += 1;
setRetryMark((count) => count + 1);
}
return clearFn;
}, [...deps, retryMark]);
}
/**
* Lock focus within an element.
* When locked, focus will be restricted to focusable elements within the specified element.
* If multiple elements are locked, only the last locked element will be effective.
* @returns A function to mark an element as ignored, which will temporarily allow focus on that element even if it's outside the locked area.
*/
function useLockFocus(lock, getElement) {
const id = useId_default();
const getElementRef = (0, import_react.useRef)(getElement);
getElementRef.current = getElement;
const lockEffect = (retryTimes) => {
if (!lock) return [void 0, true];
const element = getElementRef.current();
if (element) return [lockFocus(element, id), true];
return [void 0, retryTimes >= 1];
};
useRetryEffect(lockEffect, [id, lock]);
const ignoreElement = (ele) => {
if (ele) ignoredElementMap.set(id, ele);
};
return [ignoreElement];
}
//#endregion
//#region node_modules/@rc-component/dialog/es/Dialog/Content/MemoChildren.js
var MemoChildren_default = /* @__PURE__ */ import_react.memo(({ children }) => children, (_, { shouldUpdate }) => !shouldUpdate);
//#endregion
//#region node_modules/@rc-component/dialog/es/Dialog/Content/Panel.js
function _extends$90() {
_extends$90 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$90.apply(this, arguments);
}
var Panel$3 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, className, style, title, ariaId, footer, closable, closeIcon, onClose, children, bodyStyle, bodyProps, modalRender, onMouseDown, onMouseUp, holderRef, visible, forceRender, width, height, classNames: modalClassNames, styles: modalStyles, isFixedPos, focusTrap } = props;
const { panel: panelRef } = import_react.useContext(RefContext$1);
const internalRef = (0, import_react.useRef)(null);
const mergedRef = useComposeRef(holderRef, panelRef, internalRef);
const [ignoreElement] = useLockFocus(visible && isFixedPos && focusTrap !== false, () => internalRef.current);
import_react.useImperativeHandle(ref, () => ({ focus: () => {
internalRef.current?.focus({ preventScroll: true });
} }));
const contentStyle = {};
if (width !== void 0) contentStyle.width = width;
if (height !== void 0) contentStyle.height = height;
const footerNode = footer ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-footer`, modalClassNames?.footer),
style: { ...modalStyles?.footer }
}, footer) : null;
const headerNode = title ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-header`, modalClassNames?.header),
style: { ...modalStyles?.header }
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, modalClassNames?.title),
id: ariaId,
style: { ...modalStyles?.title }
}, title)) : null;
const closableObj = (0, import_react.useMemo)(() => {
if (typeof closable === "object" && closable !== null) return closable;
if (closable) return { closeIcon: closeIcon ?? /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-close-x` }) };
return {};
}, [
closable,
closeIcon,
prefixCls
]);
const ariaProps = pickAttrs(closableObj, true);
const closeBtnIsDisabled = typeof closable === "object" && closable.disabled;
const closerNode = closable ? /* @__PURE__ */ import_react.createElement("button", _extends$90({
type: "button",
onClick: onClose,
"aria-label": "Close"
}, ariaProps, {
className: `${prefixCls}-close`,
disabled: closeBtnIsDisabled
}), closableObj.closeIcon) : null;
const content = /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-container`, modalClassNames?.container),
style: modalStyles?.container
}, closerNode, headerNode, /* @__PURE__ */ import_react.createElement("div", _extends$90({
className: clsx(`${prefixCls}-body`, modalClassNames?.body),
style: {
...bodyStyle,
...modalStyles?.body
}
}, bodyProps), children), footerNode);
return /* @__PURE__ */ import_react.createElement("div", {
key: "dialog-element",
role: "dialog",
"aria-labelledby": title ? ariaId : null,
"aria-modal": "true",
ref: mergedRef,
style: {
...style,
...contentStyle
},
className: clsx(prefixCls, className),
onMouseDown,
onMouseUp,
tabIndex: -1,
onFocus: (e) => {
ignoreElement(e.target);
}
}, /* @__PURE__ */ import_react.createElement(MemoChildren_default, { shouldUpdate: visible || forceRender }, modalRender ? modalRender(content) : content));
});
Panel$3.displayName = "Panel";
//#endregion
//#region node_modules/@rc-component/dialog/es/Dialog/Content/index.js
function _extends$89() {
_extends$89 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$89.apply(this, arguments);
}
var Content$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, title, style, className, visible, forceRender, destroyOnHidden, motionName, ariaId, onVisibleChanged, mousePosition } = props;
const dialogRef = (0, import_react.useRef)(null);
const panelRef = (0, import_react.useRef)(null);
import_react.useImperativeHandle(ref, () => ({
...panelRef.current,
inMotion: dialogRef.current.inMotion,
enableMotion: dialogRef.current.enableMotion
}));
const [transformOrigin, setTransformOrigin] = import_react.useState();
const contentStyle = {};
if (transformOrigin) contentStyle.transformOrigin = transformOrigin;
function onPrepare() {
if (!dialogRef.current?.nativeElement) return;
const elementOffset = offset$1(dialogRef.current.nativeElement);
setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? `${mousePosition.x - elementOffset.left}px ${mousePosition.y - elementOffset.top}px` : "");
}
return /* @__PURE__ */ import_react.createElement(es_default$28, {
visible,
onVisibleChanged,
onAppearPrepare: onPrepare,
onEnterPrepare: onPrepare,
forceRender,
motionName,
removeOnLeave: destroyOnHidden,
ref: dialogRef
}, ({ className: motionClassName, style: motionStyle }, motionRef) => /* @__PURE__ */ import_react.createElement(Panel$3, _extends$89({}, props, {
ref: panelRef,
title,
ariaId,
prefixCls,
holderRef: motionRef,
style: {
...motionStyle,
...style,
...contentStyle
},
className: clsx(className, motionClassName)
})));
});
Content$1.displayName = "Content";
//#endregion
//#region node_modules/@rc-component/dialog/es/Dialog/Mask.js
function _extends$88() {
_extends$88 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$88.apply(this, arguments);
}
var Mask$1 = (props) => {
const { prefixCls, style, visible, maskProps, motionName, className } = props;
return /* @__PURE__ */ import_react.createElement(es_default$28, {
key: "mask",
visible,
motionName,
leavedClassName: `${prefixCls}-mask-hidden`
}, ({ className: motionClassName, style: motionStyle }, ref) => /* @__PURE__ */ import_react.createElement("div", _extends$88({
ref,
style: {
...motionStyle,
...style
},
className: clsx(`${prefixCls}-mask`, motionClassName, className)
}, maskProps)));
};
//#endregion
//#region node_modules/@rc-component/dialog/es/Dialog/index.js
function _extends$87() {
_extends$87 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$87.apply(this, arguments);
}
var Dialog = (props) => {
const { prefixCls = "rc-dialog", zIndex, visible = false, focusTriggerAfterClose = true, wrapStyle, wrapClassName, wrapProps, onClose, afterOpenChange, afterClose, transitionName, animation, closable = true, mask = true, maskTransitionName, maskAnimation, maskClosable = true, maskStyle, maskProps, rootClassName, rootStyle, classNames: modalClassNames, styles: modalStyles } = props;
[
"wrapStyle",
"bodyStyle",
"maskStyle"
].forEach((prop) => {
warning$2(!(prop in props), `${prop} is deprecated, please use styles instead.`);
});
if ("wrapClassName" in props) warning$2(false, `wrapClassName is deprecated, please use classNames instead.`);
const lastOutSideActiveElementRef = (0, import_react.useRef)(null);
const wrapperRef = (0, import_react.useRef)(null);
const contentRef = (0, import_react.useRef)(null);
const [animatedVisible, setAnimatedVisible] = import_react.useState(visible);
const [isFixedPos, setIsFixedPos] = import_react.useState(false);
const ariaId = useId_default();
function saveLastOutSideActiveElementRef() {
if (!contains(wrapperRef.current, document.activeElement)) lastOutSideActiveElementRef.current = document.activeElement;
}
function focusDialogContent() {
if (!contains(wrapperRef.current, document.activeElement)) contentRef.current?.focus();
}
function doClose() {
setAnimatedVisible(false);
if (mask && lastOutSideActiveElementRef.current && focusTriggerAfterClose) {
try {
lastOutSideActiveElementRef.current.focus({ preventScroll: true });
} catch (e) {}
lastOutSideActiveElementRef.current = null;
}
if (animatedVisible) afterClose?.();
}
function onDialogVisibleChanged(newVisible) {
if (newVisible) focusDialogContent();
else doClose();
afterOpenChange?.(newVisible);
}
function onInternalClose(e) {
onClose?.(e);
}
const mouseDownOnMaskRef = (0, import_react.useRef)(false);
let onWrapperClick = null;
if (maskClosable) onWrapperClick = (e) => {
if (wrapperRef.current === e.target && mouseDownOnMaskRef.current) onInternalClose(e);
};
function onWrapperMouseDown(e) {
mouseDownOnMaskRef.current = e.target === wrapperRef.current;
}
(0, import_react.useEffect)(() => {
if (visible) {
mouseDownOnMaskRef.current = false;
setAnimatedVisible(true);
saveLastOutSideActiveElementRef();
if (wrapperRef.current) setIsFixedPos(getComputedStyle(wrapperRef.current).position === "fixed");
} else if (animatedVisible && contentRef.current.enableMotion() && !contentRef.current.inMotion()) doClose();
}, [visible]);
const mergedStyle = {
zIndex,
...wrapStyle,
...modalStyles?.wrapper,
display: !animatedVisible ? "none" : null
};
return /* @__PURE__ */ import_react.createElement("div", _extends$87({
className: clsx(`${prefixCls}-root`, rootClassName),
style: rootStyle
}, pickAttrs(props, { data: true })), /* @__PURE__ */ import_react.createElement(Mask$1, {
prefixCls,
visible: mask && visible,
motionName: getMotionName(prefixCls, maskTransitionName, maskAnimation),
style: {
zIndex,
...maskStyle,
...modalStyles?.mask
},
maskProps,
className: modalClassNames?.mask
}), /* @__PURE__ */ import_react.createElement("div", _extends$87({
className: clsx(`${prefixCls}-wrap`, wrapClassName, modalClassNames?.wrapper),
ref: wrapperRef,
onClick: onWrapperClick,
onMouseDown: onWrapperMouseDown,
style: mergedStyle
}, wrapProps), /* @__PURE__ */ import_react.createElement(Content$1, _extends$87({}, props, {
isFixedPos,
ref: contentRef,
closable,
ariaId,
prefixCls,
visible: visible && animatedVisible,
onClose: onInternalClose,
onVisibleChanged: onDialogVisibleChanged,
motionName: getMotionName(prefixCls, transitionName, animation)
}))));
};
//#endregion
//#region node_modules/@rc-component/dialog/es/DialogWrap.js
function _extends$86() {
_extends$86 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$86.apply(this, arguments);
}
var DialogWrap = (props) => {
const { visible, getContainer, forceRender, destroyOnHidden = false, afterClose, closable, panelRef, keyboard = true, onClose } = props;
const [animatedVisible, setAnimatedVisible] = import_react.useState(visible);
const refContext = import_react.useMemo(() => ({ panel: panelRef }), [panelRef]);
const onEsc = ({ top, event }) => {
if (top && keyboard) {
event.stopPropagation();
onClose?.(event);
return;
}
};
import_react.useEffect(() => {
if (visible) setAnimatedVisible(true);
}, [visible]);
if (!forceRender && destroyOnHidden && !animatedVisible) return null;
return /* @__PURE__ */ import_react.createElement(RefContext$1.Provider, { value: refContext }, /* @__PURE__ */ import_react.createElement(es_default$27, {
open: visible || forceRender || animatedVisible,
onEsc,
autoDestroy: false,
getContainer,
autoLock: visible || animatedVisible
}, /* @__PURE__ */ import_react.createElement(Dialog, _extends$86({}, props, {
destroyOnHidden,
afterClose: () => {
const { afterClose: closableAfterClose } = (closable && typeof closable === "object" ? closable : {}) || {};
closableAfterClose?.();
afterClose?.();
setAnimatedVisible(false);
}
}))));
};
DialogWrap.displayName = "Dialog";
//#endregion
//#region node_modules/@rc-component/dialog/es/index.js
var es_default$23 = DialogWrap;
//#endregion
//#region node_modules/@rc-component/form/es/FieldContext.js
var HOOK_MARK = "RC_FORM_INTERNAL_HOOKS";
var warningFunc = () => {
warningOnce(false, "Can not find FormContext. Please make sure you wrap Field under Form.");
};
var Context = /* @__PURE__ */ import_react.createContext({
getFieldValue: warningFunc,
getFieldsValue: warningFunc,
getFieldError: warningFunc,
getFieldWarning: warningFunc,
getFieldsError: warningFunc,
isFieldsTouched: warningFunc,
isFieldTouched: warningFunc,
isFieldValidating: warningFunc,
isFieldsValidating: warningFunc,
resetFields: warningFunc,
setFields: warningFunc,
setFieldValue: warningFunc,
setFieldsValue: warningFunc,
validateFields: warningFunc,
submit: warningFunc,
getInternalHooks: () => {
warningFunc();
return {
dispatch: warningFunc,
initEntityValue: warningFunc,
registerField: warningFunc,
useSubscribe: warningFunc,
setInitialValues: warningFunc,
destroyForm: warningFunc,
setCallbacks: warningFunc,
registerWatch: warningFunc,
getFields: warningFunc,
setValidateMessages: warningFunc,
setPreserve: warningFunc,
getInitialValue: warningFunc
};
}
});
//#endregion
//#region node_modules/@rc-component/form/es/ListContext.js
var ListContext$1 = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/form/es/utils/typeUtil.js
function toArray$6(value) {
if (value === void 0 || value === null) return [];
return Array.isArray(value) ? value : [value];
}
function isFormInstance(form) {
return form && !!form._init;
}
//#endregion
//#region node_modules/@rc-component/async-validator/es/messages.js
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",
tel: "%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 clone() {
var cloned = JSON.parse(JSON.stringify(this));
cloned.clone = this.clone;
return cloned;
}
};
}
var messages = newMessages();
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
function _isNativeFunction(t) {
try {
return -1 !== Function.toString.call(t).indexOf("[native code]");
} catch (n) {
return "function" == typeof t;
}
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/construct.js
function _construct(t, e, r) {
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
var o = [null];
o.push.apply(o, e);
var p = new (t.bind.apply(t, o))();
return r && _setPrototypeOf(p, r.prototype), p;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
function _wrapNativeSuper(t) {
var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
return _wrapNativeSuper = function _wrapNativeSuper(t) {
if (null === t || !_isNativeFunction(t)) return t;
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
if (void 0 !== r) {
if (r.has(t)) return r.get(t);
r.set(t, Wrapper);
}
function Wrapper() {
return _construct(t, arguments, _getPrototypeOf(this).constructor);
}
return Wrapper.prototype = Object.create(t.prototype, { constructor: {
value: Wrapper,
enumerable: !1,
writable: !0,
configurable: !0
} }), _setPrototypeOf(Wrapper, t);
}, _wrapNativeSuper(t);
}
//#endregion
//#region node_modules/@rc-component/async-validator/es/util.js
var formatRegExp = /%[sdj%]/g;
var warning = function warning() {};
if (typeof process !== "undefined" && process.env && typeof window !== "undefined" && typeof document !== "undefined") warning = function warning(type, errors) {
if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
if (errors.every(function(e) {
return typeof e === "string";
})) console.warn(type, 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(template) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
var i = 0;
var len = args.length;
if (typeof template === "function") return template.apply(null, args);
if (typeof template === "string") return template.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 template;
}
function isNativeStringType(type) {
return type === "string" || type === "url" || type === "hex" || type === "email" || type === "date" || type === "pattern" || type === "tel";
}
function isEmptyValue(value, type) {
if (value === void 0 || value === null) return true;
if (type === "array" && Array.isArray(value) && !value.length) return true;
if (isNativeStringType(type) && 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, _toConsumableArray$8(errors || []));
total++;
if (total === arrLength) callback(results);
}
arr.forEach(function(a) {
func(a, count);
});
}
function asyncSerialArray(arr, func, callback) {
var index = 0;
var arrLength = arr.length;
function next(errors) {
if (errors && errors.length) {
callback(errors);
return;
}
var original = index;
index = index + 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, _toConsumableArray$8(objArr[k] || []));
});
return ret;
}
var AsyncValidationError = /* @__PURE__ */ function(_Error) {
_inherits(AsyncValidationError, _Error);
var _super = _createSuper(AsyncValidationError);
function AsyncValidationError(errors, fields) {
var _this;
_classCallCheck$1(this, AsyncValidationError);
_this = _super.call(this, "Async Validation Error");
_defineProperty$28(_assertThisInitialized(_this), "errors", void 0);
_defineProperty$28(_assertThisInitialized(_this), "fields", void 0);
_this.errors = errors;
_this.fields = fields;
return _this;
}
return _createClass$1(AsyncValidationError);
}(/* @__PURE__ */ _wrapNativeSuper(Error));
function asyncMap(objArr, option, func, callback, source) {
if (option.first) {
var _pending = new Promise(function(resolve, reject) {
asyncSerialArray(flattenObjArr(objArr), func, function next(errors) {
callback(errors);
return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
});
});
_pending.catch(function(e) {
return e;
});
return _pending;
}
var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
var objArrKeys = Object.keys(objArr);
var objArrLength = objArrKeys.length;
var total = 0;
var results = [];
var pending = new Promise(function(resolve, reject) {
var next = function next(errors) {
results.push.apply(results, errors);
total++;
if (total === objArrLength) {
callback(results);
return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
}
};
if (!objArrKeys.length) {
callback(results);
resolve(source);
}
objArrKeys.forEach(function(key) {
var arr = objArr[key];
if (firstFields.indexOf(key) !== -1) asyncSerialArray(arr, func, next);
else asyncParallelArray(arr, func, next);
});
});
pending.catch(function(e) {
return e;
});
return pending;
}
function isErrorObj(obj) {
return !!(obj && obj.message !== void 0);
}
function getValue(value, path) {
var v = value;
for (var i = 0; i < path.length; i++) {
if (v == void 0) return v;
v = v[path[i]];
}
return v;
}
function complementError(rule, source) {
return function(oe) {
var fieldValue;
if (rule.fullFields) fieldValue = getValue(source, rule.fullFields);
else fieldValue = source[oe.field || rule.fullField];
if (isErrorObj(oe)) {
oe.field = oe.field || rule.fullField;
oe.fieldValue = fieldValue;
return oe;
}
return {
message: typeof oe === "function" ? oe() : oe,
fieldValue,
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$30(value) === "object" && _typeof$30(target[s]) === "object") target[s] = _objectSpread2(_objectSpread2({}, target[s]), value);
else target[s] = value;
}
}
return target;
}
//#endregion
//#region node_modules/@rc-component/async-validator/es/rule/enum.js
var ENUM$1 = "enum";
var enumerable$1 = function enumerable(rule, value, source, errors, options) {
rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
if (rule[ENUM$1].indexOf(value) === -1) errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/rule/pattern.js
var pattern$2 = function pattern(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") {
if (!new RegExp(rule.pattern).test(value)) errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
}
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/rule/range.js
var range = 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 key = null;
var num = typeof value === "number";
var str = typeof value === "string";
var arr = Array.isArray(value);
if (num) key = "number";
else if (str) key = "string";
else if (arr) key = "array";
if (!key) 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[key].len, rule.fullField, rule.len));
} else if (min && !max && val < rule.min) errors.push(format(options.messages[key].min, rule.fullField, rule.min));
else if (max && !min && val > rule.max) errors.push(format(options.messages[key].max, rule.fullField, rule.max));
else if (min && max && (val < rule.min || val > rule.max)) errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/rule/required.js
var required$1 = function required(rule, value, source, errors, options, type) {
if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) errors.push(format(options.messages.required, rule.fullField));
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/rule/url.js
var urlReg;
var url_default = (function() {
if (urlReg) return urlReg;
var word = "[a-fA-F\\d:]";
var b = function b(options) {
return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=".concat(word, ")|(?<=").concat(word, ")(?=\\s|$))") : "";
};
var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
var v6seg = "[a-fA-F\\d]{1,4}";
var v6List = [
"(?:".concat(v6seg, ":){7}(?:").concat(v6seg, "|:)"),
"(?:".concat(v6seg, ":){6}(?:").concat(v4, "|:").concat(v6seg, "|:)"),
"(?:".concat(v6seg, ":){5}(?::").concat(v4, "|(?::").concat(v6seg, "){1,2}|:)"),
"(?:".concat(v6seg, ":){4}(?:(?::").concat(v6seg, "){0,1}:").concat(v4, "|(?::").concat(v6seg, "){1,3}|:)"),
"(?:".concat(v6seg, ":){3}(?:(?::").concat(v6seg, "){0,2}:").concat(v4, "|(?::").concat(v6seg, "){1,4}|:)"),
"(?:".concat(v6seg, ":){2}(?:(?::").concat(v6seg, "){0,3}:").concat(v4, "|(?::").concat(v6seg, "){1,5}|:)"),
"(?:".concat(v6seg, ":){1}(?:(?::").concat(v6seg, "){0,4}:").concat(v4, "|(?::").concat(v6seg, "){1,6}|:)"),
"(?::(?:(?::".concat(v6seg, "){0,5}:").concat(v4, "|(?::").concat(v6seg, "){1,7}|:))")
];
var v6 = "(?:".concat(v6List.join("|"), ")").concat("(?:%[0-9a-zA-Z]{1,})?");
var v46Exact = new RegExp("(?:^".concat(v4, "$)|(?:^").concat(v6, "$)"));
var v4exact = new RegExp("^".concat(v4, "$"));
var v6exact = new RegExp("^".concat(v6, "$"));
var ip = function ip(options) {
return options && options.exact ? v46Exact : new RegExp("(?:".concat(b(options)).concat(v4).concat(b(options), ")|(?:").concat(b(options)).concat(v6).concat(b(options), ")"), "g");
};
ip.v4 = function(options) {
return options && options.exact ? v4exact : new RegExp("".concat(b(options)).concat(v4).concat(b(options)), "g");
};
ip.v6 = function(options) {
return options && options.exact ? v6exact : new RegExp("".concat(b(options)).concat(v6).concat(b(options)), "g");
};
var protocol = "(?:(?:[a-z]+:)?//)";
var auth = "(?:\\S+(?::\\S*)?@)?";
var ipv4 = ip.v4().source;
var ipv6 = ip.v6().source;
var regex = "(?:".concat(protocol, "|www\\.)").concat(auth, "(?:localhost|").concat(ipv4, "|").concat(ipv6, "|").concat("(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)").concat("(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*").concat("(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", ")").concat("(?::\\d{2,5})?").concat("(?:[/?#][^\\s\"]*)?");
urlReg = new RegExp("(?:^".concat(regex, "$)"), "i");
return urlReg;
});
//#endregion
//#region node_modules/@rc-component/async-validator/es/rule/type.js
var pattern$1 = {
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
/**
* Phone number regex, support country code, brackets, spaces, and dashes (or non-breaking hyphen \u2011).
* @see https://regexr.com/3c53v
* @see https://ihateregex.io/expr/phone/
* @see https://developers.google.com/style/phone-numbers using non-breaking hyphen \u2011
*/
tel: /^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,
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$30(value) === "object" && !types.array(value);
},
method: function method(value) {
return typeof value === "function";
},
email: function email(value) {
return typeof value === "string" && value.length <= 320 && !!value.match(pattern$1.email);
},
tel: function tel(value) {
return typeof value === "string" && value.length <= 32 && !!value.match(pattern$1.tel);
},
url: function url(value) {
return typeof value === "string" && value.length <= 2048 && !!value.match(url_default());
},
hex: function hex(value) {
return typeof value === "string" && !!value.match(pattern$1.hex);
}
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/rule/index.js
var rule_default = {
required: required$1,
whitespace: function whitespace(rule, value, source, errors, options) {
if (/^\s+$/.test(value) || value === "") errors.push(format(options.messages.whitespace, rule.fullField));
},
type: function type(rule, value, source, errors, options) {
if (rule.required && value === void 0) {
required$1(rule, value, source, errors, options);
return;
}
var custom = [
"integer",
"float",
"array",
"regexp",
"object",
"method",
"email",
"tel",
"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$30(value) !== rule.type) errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
},
range,
enum: enumerable$1,
pattern: pattern$2
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/any.js
var any = function any(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/array.js
var array = function array(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if ((value === void 0 || value === null) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options, "array");
if (value !== void 0 && value !== null) {
rule_default.type(rule, value, source, errors, options);
rule_default.range(rule, value, source, errors, options);
}
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/boolean.js
var boolean = function boolean(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (value !== void 0) rule_default.type(rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/date.js
var date = function date(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value, "date") && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (!isEmptyValue(value, "date")) {
var dateObject;
if (value instanceof Date) dateObject = value;
else dateObject = new Date(value);
rule_default.type(rule, dateObject, source, errors, options);
if (dateObject) rule_default.range(rule, dateObject.getTime(), source, errors, options);
}
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/enum.js
var ENUM = "enum";
var enumerable = function enumerable(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (value !== void 0) rule_default[ENUM](rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/float.js
var floatFn = function floatFn(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (value !== void 0) {
rule_default.type(rule, value, source, errors, options);
rule_default.range(rule, value, source, errors, options);
}
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/integer.js
var integer = function integer(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (value !== void 0) {
rule_default.type(rule, value, source, errors, options);
rule_default.range(rule, value, source, errors, options);
}
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/method.js
var method = function method(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (value !== void 0) rule_default.type(rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/number.js
var number = function number(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (value === "") value = void 0;
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (value !== void 0) {
rule_default.type(rule, value, source, errors, options);
rule_default.range(rule, value, source, errors, options);
}
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/object.js
var object = function object(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (value !== void 0) rule_default.type(rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/pattern.js
var pattern = function pattern(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value, "string") && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (!isEmptyValue(value, "string")) rule_default.pattern(rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/regexp.js
var regexp = function regexp(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options);
if (!isEmptyValue(value)) rule_default.type(rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/required.js
var required = function required(rule, value, callback, source, options) {
var errors = [];
var type = Array.isArray(value) ? "array" : _typeof$30(value);
rule_default.required(rule, value, source, errors, options, type);
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/string.js
var string = function string(rule, value, callback, source, options) {
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value, "string") && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options, "string");
if (!isEmptyValue(value, "string")) {
rule_default.type(rule, value, source, errors, options);
rule_default.range(rule, value, source, errors, options);
rule_default.pattern(rule, value, source, errors, options);
if (rule.whitespace === true) rule_default.whitespace(rule, value, source, errors, options);
}
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/type.js
var type = function type(rule, value, callback, source, options) {
var ruleType = rule.type;
var errors = [];
if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
if (isEmptyValue(value, ruleType) && !rule.required) return callback();
rule_default.required(rule, value, source, errors, options, ruleType);
if (!isEmptyValue(value, ruleType)) rule_default.type(rule, value, source, errors, options);
}
callback(errors);
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/validator/index.js
var validator_default = {
string,
method,
number,
boolean,
regexp,
integer,
float: floatFn,
array,
object,
enum: enumerable,
pattern,
date,
url: type,
hex: type,
email: type,
tel: type,
required,
any
};
//#endregion
//#region node_modules/@rc-component/async-validator/es/index.js
/**
* Encapsulates a validation schema.
*
* @param descriptor An object declaring validation rules
* for this schema.
*/
var Schema = /* @__PURE__ */ function() {
function Schema(descriptor) {
_classCallCheck$1(this, Schema);
_defineProperty$28(this, "rules", null);
_defineProperty$28(this, "_messages", messages);
this.define(descriptor);
}
_createClass$1(Schema, [
{
key: "define",
value: function define(rules) {
var _this = this;
if (!rules) throw new Error("Cannot configure a schema with no rules");
if (_typeof$30(rules) !== "object" || Array.isArray(rules)) throw new Error("Rules must be an object");
this.rules = {};
Object.keys(rules).forEach(function(name) {
var item = rules[name];
_this.rules[name] = Array.isArray(item) ? item : [item];
});
}
},
{
key: "messages",
value: function messages(_messages) {
if (_messages) this._messages = deepMerge(newMessages(), _messages);
return this._messages;
}
},
{
key: "validate",
value: function validate(source_) {
var _this2 = this;
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var oc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {};
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(null, source);
return Promise.resolve(source);
}
function complete(results) {
var errors = [];
var fields = {};
function add(e) {
if (Array.isArray(e)) {
var _errors;
errors = (_errors = errors).concat.apply(_errors, _toConsumableArray$8(e));
} else errors.push(e);
}
for (var i = 0; i < results.length; i++) add(results[i]);
if (!errors.length) callback(null, source);
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 series = {};
(options.keys || Object.keys(this.rules)).forEach(function(z) {
var arr = _this2.rules[z];
var value = source[z];
arr.forEach(function(r) {
var rule = r;
if (typeof rule.transform === "function") {
if (source === source_) source = _objectSpread2({}, source);
value = source[z] = rule.transform(value);
if (value !== void 0 && value !== null) rule.type = rule.type || (Array.isArray(value) ? "array" : _typeof$30(value));
}
if (typeof rule === "function") rule = { validator: rule };
else rule = _objectSpread2({}, rule);
rule.validator = _this2.getValidationMethod(rule);
if (!rule.validator) return;
rule.field = z;
rule.fullField = rule.fullField || z;
rule.type = _this2.getType(rule);
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$30(rule.fields) === "object" || _typeof$30(rule.defaultField) === "object");
deep = deep && (rule.required || !rule.required && data.value);
rule.field = data.field;
function addFullField(key, schema) {
return _objectSpread2(_objectSpread2({}, schema), {}, {
fullField: "".concat(rule.fullField, ".").concat(key),
fullFields: rule.fullFields ? [].concat(_toConsumableArray$8(rule.fullFields), [key]) : [key]
});
}
function cb() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
var errorList = Array.isArray(e) ? e : [e];
if (!options.suppressWarning && errorList.length) Schema.warning("async-validator:", errorList);
if (errorList.length && rule.message !== void 0 && rule.message !== null) errorList = [].concat(rule.message);
var filledErrors = errorList.map(complementError(rule, source));
if (options.first && filledErrors.length) {
errorFields[rule.field] = 1;
return doIt(filledErrors);
}
if (!deep) doIt(filledErrors);
else {
if (rule.required && !data.value) {
if (rule.message !== void 0) filledErrors = [].concat(rule.message).map(complementError(rule, source));
else if (options.error) filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
return doIt(filledErrors);
}
var fieldsSchema = {};
if (rule.defaultField) Object.keys(data.value).map(function(key) {
fieldsSchema[key] = rule.defaultField;
});
fieldsSchema = _objectSpread2(_objectSpread2({}, fieldsSchema), data.rule.fields);
var paredFieldsSchema = {};
Object.keys(fieldsSchema).forEach(function(field) {
var fieldSchema = fieldsSchema[field];
paredFieldsSchema[field] = (Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema]).map(addFullField.bind(null, field));
});
var schema = new Schema(paredFieldsSchema);
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 (filledErrors && filledErrors.length) finalErrors.push.apply(finalErrors, _toConsumableArray$8(filledErrors));
if (errs && errs.length) finalErrors.push.apply(finalErrors, _toConsumableArray$8(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) {
try {
res = rule.validator(rule, data.value, cb, data.source, options);
} catch (error) {
var _console$error, _console;
(_console$error = (_console = console).error) === null || _console$error === void 0 || _console$error.call(_console, error);
if (!options.suppressValidatorError) setTimeout(function() {
throw error;
}, 0);
cb(error.message);
}
if (res === true) cb();
else if (res === false) cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || "".concat(rule.fullField || 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);
}, source);
}
},
{
key: "getType",
value: function getType(rule) {
if (rule.type === void 0 && rule.pattern instanceof RegExp) rule.type = "pattern";
if (typeof rule.validator !== "function" && rule.type && !validator_default.hasOwnProperty(rule.type)) throw new Error(format("Unknown rule type %s", rule.type));
return rule.type || "string";
}
},
{
key: "getValidationMethod",
value: 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 validator_default.required;
return validator_default[this.getType(rule)] || void 0;
}
}
]);
return Schema;
}();
_defineProperty$28(Schema, "register", function register(type, validator) {
if (typeof validator !== "function") throw new Error("Cannot register a validator by type, validator is not a function");
validator_default[type] = validator;
});
_defineProperty$28(Schema, "warning", warning);
_defineProperty$28(Schema, "messages", messages);
_defineProperty$28(Schema, "validators", validator_default);
//#endregion
//#region node_modules/@rc-component/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,
tel: 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}" }
};
//#endregion
//#region node_modules/@rc-component/form/es/utils/validateUtil.js
var AsyncValidator = Schema;
/**
* Replace with template.
* `I'm ${name}` + { name: 'bamboo' } = I'm bamboo
*/
function replaceMessage(template, kv) {
return template.replace(/\\?\$\{\w+\}/g, (str) => {
if (str.startsWith("\\")) return str.slice(1);
return kv[str.slice(2, -1)];
});
}
var CODE_LOGIC_ERROR = "CODE_LOGIC_ERROR";
async function validateRule(name, value, rule, options, messageVariables) {
const cloneRule = { ...rule };
delete cloneRule.ruleIndex;
AsyncValidator.warning = () => void 0;
if (cloneRule.validator) {
const originValidator = cloneRule.validator;
cloneRule.validator = (...args) => {
try {
return originValidator(...args);
} catch (error) {
console.error(error);
return Promise.reject(CODE_LOGIC_ERROR);
}
};
}
let subRuleField = null;
if (cloneRule && cloneRule.type === "array" && cloneRule.defaultField) {
subRuleField = cloneRule.defaultField;
delete cloneRule.defaultField;
}
const validator = new AsyncValidator({ [name]: [cloneRule] });
const messages = merge$1(defaultValidateMessages, options.validateMessages);
validator.messages(messages);
let result = [];
try {
await Promise.resolve(validator.validate({ [name]: value }, { ...options }));
} catch (errObj) {
if (errObj.errors) result = errObj.errors.map(({ message }, index) => {
const mergedMessage = message === CODE_LOGIC_ERROR ? messages.default : message;
return /* @__PURE__ */ import_react.isValidElement(mergedMessage) ? /* @__PURE__ */ import_react.cloneElement(mergedMessage, { key: `error_${index}` }) : mergedMessage;
});
}
if (!result.length && subRuleField && Array.isArray(value) && value.length > 0) return (await Promise.all(value.map((subValue, i) => validateRule(`${name}.${i}`, subValue, subRuleField, options, messageVariables)))).reduce((prev, errors) => [...prev, ...errors], []);
const kv = {
...rule,
name,
enum: (rule.enum || []).join(", "),
...messageVariables
};
return result.map((error) => {
if (typeof error === "string") return replaceMessage(error, kv);
return error;
});
}
/**
* We use `async-validator` to validate the value.
* But only check one value in a time to avoid namePath validate issue.
*/
function validateRules(namePath, value, rules, options, validateFirst, messageVariables) {
const name = namePath.join(".");
const filledRules = rules.map((currentRule, ruleIndex) => {
const originValidatorFunc = currentRule.validator;
const cloneRule = {
...currentRule,
ruleIndex
};
if (originValidatorFunc) cloneRule.validator = (rule, val, callback) => {
let hasPromise = false;
const wrappedCallback = (...args) => {
Promise.resolve().then(() => {
warningOnce(!hasPromise, "Your validator function has already return a promise. `callback` will be ignored.");
if (!hasPromise) callback(...args);
});
};
const promise = originValidatorFunc(rule, val, wrappedCallback);
hasPromise = promise && typeof promise.then === "function" && typeof promise.catch === "function";
/**
* 1. Use promise as the first priority.
* 2. If promise not exist, use callback with warning instead
*/
warningOnce(hasPromise, "`callback` is deprecated. Please return a promise instead.");
if (hasPromise) promise.then(() => {
callback();
}).catch((err) => {
callback(err || " ");
});
};
return cloneRule;
}).sort(({ warningOnly: w1, ruleIndex: i1 }, { warningOnly: w2, ruleIndex: i2 }) => {
if (!!w1 === !!w2) return i1 - i2;
if (w1) return 1;
return -1;
});
let summaryPromise;
if (validateFirst === true) summaryPromise = new Promise(async (resolve, reject) => {
for (let i = 0; i < filledRules.length; i += 1) {
const rule = filledRules[i];
const errors = await validateRule(name, value, rule, options, messageVariables);
if (errors.length) {
reject([{
errors,
rule
}]);
return;
}
}
resolve([]);
});
else {
const rulePromises = filledRules.map((rule) => validateRule(name, value, rule, options, messageVariables).then((errors) => ({
errors,
rule
})));
summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then((errors) => {
return Promise.reject(errors);
});
}
summaryPromise.catch((e) => e);
return summaryPromise;
}
async function finishOnAllFailed(rulePromises) {
return Promise.all(rulePromises).then((errorsList) => {
return [].concat(...errorsList);
});
}
async function finishOnFirstFailed(rulePromises) {
let count = 0;
return new Promise((resolve) => {
rulePromises.forEach((promise) => {
promise.then((ruleError) => {
if (ruleError.errors.length) resolve([ruleError]);
count += 1;
if (count === rulePromises.length) resolve([]);
});
});
});
}
//#endregion
//#region node_modules/@rc-component/form/es/utils/valueUtil.js
/**
* Convert name to internal supported format.
* This function should keep since we still thinking if need support like `a.b.c` format.
* 'a' => ['a']
* 123 => [123]
* ['a', 123] => ['a', 123]
*/
function getNamePath(path) {
return toArray$6(path);
}
/**
* Create a new store object that contains only the values referenced by
* the provided list of name paths.
*/
function cloneByNamePathList(store, namePathList) {
let newStore = {};
namePathList.forEach((namePath) => {
const value = get(store, namePath);
newStore = set(newStore, namePath, value);
});
return newStore;
}
/**
* Check if `namePathList` includes `namePath`.
* @param namePathList A list of `InternalNamePath[]`
* @param namePath Compare `InternalNamePath`
* @param partialMatch True will make `[a, b]` match `[a, b, c]`
*/
function containsNamePath(namePathList, namePath, partialMatch = false) {
return namePathList && namePathList.some((path) => matchNamePath(namePath, path, partialMatch));
}
/**
* Check if `namePath` is super set or equal of `subNamePath`.
* @param namePath A list of `InternalNamePath[]`
* @param subNamePath Compare `InternalNamePath`
* @param partialMatch Default false. True will make `[a, b]` match `[a, b, c]`
*/
function matchNamePath(namePath, subNamePath, partialMatch = false) {
if (!namePath || !subNamePath) return false;
if (!partialMatch && namePath.length !== subNamePath.length) return false;
return subNamePath.every((nameUnit, i) => namePath[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;
const sourceKeys = Object.keys(source);
const targetKeys = Object.keys(target);
return [...new Set([...sourceKeys, ...targetKeys])].every((key) => {
const sourceValue = source[key];
const targetValue = target[key];
if (typeof sourceValue === "function" && typeof targetValue === "function") return true;
return sourceValue === targetValue;
});
}
function defaultGetValueFromEvent(valuePropName, ...args) {
const event = args[0];
if (event && event.target && typeof event.target === "object" && valuePropName in event.target) return event.target[valuePropName];
return event;
}
/**
* Moves an array item from one position in an array to another.
*
* Note: This is a pure function so a new array will be returned, instead
* of altering the array argument.
*
* @param array Array in which to move an item. (required)
* @param moveIndex The index of the item to move. (required)
* @param toIndex The index to move item at moveIndex to. (required)
*/
function move(array, moveIndex, toIndex) {
const { length } = array;
if (moveIndex < 0 || moveIndex >= length || toIndex < 0 || toIndex >= length) return array;
const item = array[moveIndex];
const diff = moveIndex - toIndex;
if (diff > 0) return [
...array.slice(0, toIndex),
item,
...array.slice(toIndex, moveIndex),
...array.slice(moveIndex + 1, length)
];
if (diff < 0) return [
...array.slice(0, moveIndex),
...array.slice(moveIndex + 1, toIndex + 1),
item,
...array.slice(toIndex + 1, length)
];
return array;
}
//#endregion
//#region node_modules/@rc-component/form/es/hooks/useNotifyWatch.js
/**
* Call action with delay in macro task.
*/
var macroTask$1 = (fn) => {
const channel = new MessageChannel();
channel.port1.onmessage = fn;
channel.port2.postMessage(null);
};
var WatcherCenter = class {
namePathList = [];
taskId = 0;
watcherList = /* @__PURE__ */ new Set();
form;
constructor(form) {
this.form = form;
}
register(callback) {
this.watcherList.add(callback);
return () => {
this.watcherList.delete(callback);
};
}
notify(namePath) {
namePath.forEach((path) => {
if (this.namePathList.every((exist) => !matchNamePath(exist, path))) this.namePathList.push(path);
});
this.doBatch();
}
doBatch() {
this.taskId += 1;
const currentId = this.taskId;
macroTask$1(() => {
if (currentId === this.taskId && this.watcherList.size) {
const formInst = this.form.getForm();
const values = formInst.getFieldsValue();
const allValues = formInst.getFieldsValue(true);
this.watcherList.forEach((callback) => {
callback(values, allValues, this.namePathList);
});
this.namePathList = [];
}
});
}
};
//#endregion
//#region node_modules/@rc-component/form/es/utils/delayUtil.js
async function delayFrame() {
return new Promise((resolve) => {
macroTask$1(() => {
wrapperRaf(() => {
resolve();
});
});
});
}
//#endregion
//#region node_modules/@rc-component/form/es/Field.js
function _extends$85() {
_extends$85 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$85.apply(this, arguments);
}
var EMPTY_ERRORS = [];
var EMPTY_WARNINGS = [];
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 = class extends import_react.Component {
static contextType = Context;
state = { resetCount: 0 };
cancelRegisterFunc = null;
mounted = false;
/**
* Follow state should not management in State since it will async update by React.
* This makes first render of form can not get correct state value.
*/
touched = false;
/**
* Mark when touched & validated. Currently only used for `dependencies`.
* Note that we do not think field with `initialValue` is dirty
* but this will be by `isFieldDirty` func.
*/
dirty = false;
validatePromise;
prevValidating;
errors = EMPTY_ERRORS;
warnings = EMPTY_WARNINGS;
constructor(props) {
super(props);
if (props.fieldContext) {
const { getInternalHooks } = props.fieldContext;
const { initEntityValue } = getInternalHooks(HOOK_MARK);
initEntityValue(this);
}
}
componentDidMount() {
const { shouldUpdate, fieldContext } = this.props;
this.mounted = true;
if (fieldContext) {
const { getInternalHooks } = fieldContext;
const { registerField } = getInternalHooks(HOOK_MARK);
this.cancelRegisterFunc = registerField(this);
}
if (shouldUpdate === true) this.reRender();
}
componentWillUnmount() {
this.cancelRegister();
this.triggerMetaEvent(true);
this.mounted = false;
}
cancelRegister = () => {
const { preserve, isListField, name } = this.props;
if (this.cancelRegisterFunc) this.cancelRegisterFunc(isListField, preserve, getNamePath(name));
this.cancelRegisterFunc = null;
};
getNamePath = () => {
const { name, fieldContext } = this.props;
const { prefixName = [] } = fieldContext;
return name !== void 0 ? [...prefixName, ...name] : [];
};
getRules = () => {
const { rules = [], fieldContext } = this.props;
return rules.map((rule) => {
if (typeof rule === "function") return rule(fieldContext);
return rule;
});
};
reRender() {
if (!this.mounted) return;
this.forceUpdate();
}
refresh = () => {
if (!this.mounted) return;
/**
* Clean up current node.
*/
this.setState(({ resetCount }) => ({ resetCount: resetCount + 1 }));
};
metaCache = null;
triggerMetaEvent = (destroy) => {
const { onMetaChange } = this.props;
if (onMetaChange) {
const meta = {
...this.getMeta(),
destroy
};
if (!isEqual(this.metaCache, meta)) onMetaChange(meta);
this.metaCache = meta;
} else this.metaCache = null;
};
onStoreChange = (prevStore, namePathList, info) => {
const { shouldUpdate, dependencies = [], onReset } = this.props;
const { store } = info;
const namePath = this.getNamePath();
const prevValue = this.getValue(prevStore);
const curValue = this.getValue(store);
const namePathMatch = namePathList && containsNamePath(namePathList, namePath);
if (info.type === "valueUpdate" && info.source === "external" && !isEqual(prevValue, curValue)) {
this.touched = true;
this.dirty = true;
this.validatePromise = null;
this.errors = EMPTY_ERRORS;
this.warnings = EMPTY_WARNINGS;
this.triggerMetaEvent();
}
switch (info.type) {
case "reset":
if (!namePathList || namePathMatch) {
this.touched = false;
this.dirty = false;
this.validatePromise = void 0;
this.errors = EMPTY_ERRORS;
this.warnings = EMPTY_WARNINGS;
this.triggerMetaEvent();
onReset?.();
this.refresh();
return;
}
break;
/**
* In case field with `preserve = false` nest deps like:
* - A = 1 => show B
* - B = 1 => show C
* - Reset A, need clean B, C
*/
case "remove":
if (shouldUpdate && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
this.reRender();
return;
}
break;
case "setField": {
const { data } = info;
if (namePathMatch) {
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 || EMPTY_ERRORS;
if ("warnings" in data) this.warnings = data.warnings || EMPTY_WARNINGS;
this.dirty = true;
this.triggerMetaEvent();
this.reRender();
return;
} else if ("value" in data && containsNamePath(namePathList, namePath, true)) {
this.reRender();
return;
}
if (shouldUpdate && !namePath.length && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
this.reRender();
return;
}
break;
}
case "dependenciesUpdate":
if (dependencies.map(getNamePath).some((dependency) => 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();
};
validateRules = (options) => {
const namePath = this.getNamePath();
const currentValue = this.getValue();
const { triggerName, validateOnly = false, delayFrame: showDelayFrame } = options || {};
const rootPromise = Promise.resolve().then(async () => {
if (!this.mounted) return [];
const { validateFirst = false, messageVariables, validateDebounce } = this.props;
if (showDelayFrame) await delayFrame();
let filteredRules = this.getRules();
if (triggerName) filteredRules = filteredRules.filter((rule) => rule).filter((rule) => {
const { validateTrigger } = rule;
if (!validateTrigger) return true;
return toArray$6(validateTrigger).includes(triggerName);
});
if (validateDebounce && triggerName) {
await new Promise((resolve) => {
setTimeout(resolve, validateDebounce);
});
if (this.validatePromise !== rootPromise) return [];
}
const promise = validateRules(namePath, currentValue, filteredRules, options, validateFirst, messageVariables);
promise.catch((e) => e).then((ruleErrors = EMPTY_ERRORS) => {
if (this.validatePromise === rootPromise) {
this.validatePromise = null;
const nextErrors = [];
const nextWarnings = [];
ruleErrors.forEach?.(({ rule: { warningOnly }, errors = EMPTY_ERRORS }) => {
if (warningOnly) nextWarnings.push(...errors);
else nextErrors.push(...errors);
});
this.errors = nextErrors;
this.warnings = nextWarnings;
this.triggerMetaEvent();
this.reRender();
}
});
return promise;
});
if (validateOnly) return rootPromise;
this.validatePromise = rootPromise;
this.dirty = true;
this.errors = EMPTY_ERRORS;
this.warnings = EMPTY_WARNINGS;
this.triggerMetaEvent();
this.reRender();
return rootPromise;
};
isFieldValidating = () => !!this.validatePromise;
isFieldTouched = () => this.touched;
isFieldDirty = () => {
if (this.dirty || this.props.initialValue !== void 0) return true;
const { fieldContext } = this.props;
const { getInitialValue } = fieldContext.getInternalHooks(HOOK_MARK);
if (getInitialValue(this.getNamePath()) !== void 0) return true;
return false;
};
getErrors = () => this.errors;
getWarnings = () => this.warnings;
isListField = () => this.props.isListField;
isList = () => this.props.isList;
isPreserve = () => this.props.preserve;
getMeta = () => {
this.prevValidating = this.isFieldValidating();
return {
touched: this.isFieldTouched(),
validating: this.prevValidating,
errors: this.errors,
warnings: this.warnings,
name: this.getNamePath(),
validated: this.validatePromise === null
};
};
getOnlyChild = (children) => {
if (typeof children === "function") {
const meta = this.getMeta();
return {
...this.getOnlyChild(children(this.getControlled(), meta, this.props.fieldContext)),
isFunction: true
};
}
const childList = toArray$8(children);
if (childList.length !== 1 || !/* @__PURE__ */ import_react.isValidElement(childList[0])) return {
child: childList,
isFunction: false
};
return {
child: childList[0],
isFunction: false
};
};
getValue = (store) => {
const { getFieldsValue } = this.props.fieldContext;
const namePath = this.getNamePath();
return get(store || getFieldsValue(true), namePath);
};
getControlled = (childProps = {}) => {
const { name, trigger = "onChange", validateTrigger, getValueFromEvent, normalize, valuePropName = "value", getValueProps, fieldContext } = this.props;
const mergedValidateTrigger = validateTrigger !== void 0 ? validateTrigger : fieldContext.validateTrigger;
const namePath = this.getNamePath();
const { getInternalHooks, getFieldsValue } = fieldContext;
const { dispatch } = getInternalHooks(HOOK_MARK);
const value = this.getValue();
const mergedGetValueProps = getValueProps || ((val) => ({ [valuePropName]: val }));
const originTriggerFunc = childProps[trigger];
const valueProps = name !== void 0 ? mergedGetValueProps(value) : {};
if (valueProps) Object.keys(valueProps).forEach((key) => {
warningOnce(typeof valueProps[key] !== "function", `It's not recommended to generate dynamic function prop by \`getValueProps\`. Please pass it to child component directly (prop: ${key})`);
});
const control = {
...childProps,
...valueProps
};
control[trigger] = (...args) => {
this.touched = true;
this.dirty = true;
this.triggerMetaEvent();
let newValue;
if (getValueFromEvent) newValue = getValueFromEvent(...args);
else newValue = defaultGetValueFromEvent(valuePropName, ...args);
if (normalize) newValue = normalize(newValue, value, getFieldsValue(true));
if (newValue !== value) dispatch({
type: "updateValue",
namePath,
value: newValue
});
if (originTriggerFunc) originTriggerFunc(...args);
};
toArray$6(mergedValidateTrigger || []).forEach((triggerName) => {
const originTrigger = control[triggerName];
control[triggerName] = (...args) => {
if (originTrigger) originTrigger(...args);
const { rules } = this.props;
if (rules && rules.length) dispatch({
type: "validateField",
namePath,
triggerName
});
};
});
return control;
};
render() {
const { resetCount } = this.state;
const { children } = this.props;
const { child, isFunction } = this.getOnlyChild(children);
let returnChildNode;
if (isFunction) returnChildNode = child;
else if (/* @__PURE__ */ import_react.isValidElement(child)) returnChildNode = /* @__PURE__ */ import_react.cloneElement(child, this.getControlled(child.props));
else {
warningOnce(!child, "`children` of Field is not validate ReactElement.");
returnChildNode = child;
}
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, { key: resetCount }, returnChildNode);
}
};
function WrapperField({ name, ...restProps }) {
const fieldContext = import_react.useContext(Context);
const listContext = import_react.useContext(ListContext$1);
const namePath = name !== void 0 ? getNamePath(name) : void 0;
const isMergedListField = restProps.isListField ?? !!listContext;
let key = "keep";
if (!isMergedListField) key = `_${(namePath || []).join("_")}`;
if (restProps.preserve === false && isMergedListField && namePath.length <= 1) warningOnce(false, "`preserve` should not apply on Form.List fields.");
return /* @__PURE__ */ import_react.createElement(Field, _extends$85({
key,
name: namePath,
isListField: isMergedListField
}, restProps, { fieldContext }));
}
//#endregion
//#region node_modules/@rc-component/form/es/List.js
function List$2({ name, initialValue, children, rules, validateTrigger, isListField }) {
const context = import_react.useContext(Context);
const wrapperListContext = import_react.useContext(ListContext$1);
const keyManager = import_react.useRef({
keys: [],
id: 0
}).current;
const prefixName = import_react.useMemo(() => {
return [...getNamePath(context.prefixName) || [], ...getNamePath(name)];
}, [context.prefixName, name]);
const fieldContext = import_react.useMemo(() => ({
...context,
prefixName
}), [context, prefixName]);
const listContext = import_react.useMemo(() => ({ getKey: (namePath) => {
const len = prefixName.length;
const pathName = namePath[len];
return [keyManager.keys[pathName], namePath.slice(len + 1)];
} }), [keyManager, prefixName]);
if (typeof children !== "function") {
warningOnce(false, "Form.List only accepts function as children.");
return null;
}
const shouldUpdate = (prevValue, nextValue, { source }) => {
if (source === "internal") return false;
return prevValue !== nextValue;
};
return /* @__PURE__ */ import_react.createElement(ListContext$1.Provider, { value: listContext }, /* @__PURE__ */ import_react.createElement(Context.Provider, { value: fieldContext }, /* @__PURE__ */ import_react.createElement(WrapperField, {
name: [],
shouldUpdate,
rules,
validateTrigger,
initialValue,
isList: true,
isListField: isListField ?? !!wrapperListContext
}, ({ value = [], onChange }, meta) => {
const { getFieldValue } = context;
const getNewValue = () => {
return getFieldValue(prefixName || []) || [];
};
/**
* Always get latest value in case user update fields by `form` api.
*/
const operations = {
add: (defaultValue, index) => {
const newValue = getNewValue();
if (index >= 0 && index <= newValue.length) {
keyManager.keys = [
...keyManager.keys.slice(0, index),
keyManager.id,
...keyManager.keys.slice(index)
];
onChange([
...newValue.slice(0, index),
defaultValue,
...newValue.slice(index)
]);
} else {
if (index < 0 || index > newValue.length) warningOnce(false, "The second parameter of the add function should be a valid positive number.");
keyManager.keys = [...keyManager.keys, keyManager.id];
onChange([...newValue, defaultValue]);
}
keyManager.id += 1;
},
remove: (index) => {
const newValue = getNewValue();
const indexSet = new Set(Array.isArray(index) ? index : [index]);
if (indexSet.size <= 0) return;
keyManager.keys = keyManager.keys.filter((_, keysIndex) => !indexSet.has(keysIndex));
onChange(newValue.filter((_, valueIndex) => !indexSet.has(valueIndex)));
},
move(from, to) {
if (from === to) return;
const 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));
}
};
let listValue = value || [];
if (!Array.isArray(listValue)) {
listValue = [];
warningOnce(false, `Current value of '${prefixName.join(" > ")}' is not an array type.`);
}
return children(listValue.map((__, index) => {
let key = keyManager.keys[index];
if (key === void 0) {
keyManager.keys[index] = keyManager.id;
key = keyManager.keys[index];
keyManager.id += 1;
}
return {
name: index,
key,
isListField: true
};
}), operations, meta);
})));
}
//#endregion
//#region node_modules/@rc-component/form/es/utils/asyncUtil.js
function allPromiseFinish(promiseList) {
let hasError = false;
let count = promiseList.length;
const results = [];
if (!promiseList.length) return Promise.resolve([]);
return new Promise((resolve, reject) => {
promiseList.forEach((promise, index) => {
promise.catch((e) => {
hasError = true;
return e;
}).then((result) => {
count -= 1;
results[index] = result;
if (count > 0) return;
if (hasError) reject(results);
resolve(results);
});
});
});
}
//#endregion
//#region node_modules/@rc-component/form/es/utils/NameMap.js
var SPLIT = "__@field_split__";
/**
* Convert name path into string to fast the fetch speed of Map.
*/
function normalize(namePath) {
return namePath.map((cell) => `${typeof cell}:${cell}`).join(SPLIT);
}
/**
* NameMap like a `Map` but accepts `string[]` as key.
*/
var NameMap = class {
kvs = /* @__PURE__ */ new Map();
set(key, value) {
this.kvs.set(normalize(key), value);
}
get(key) {
return this.kvs.get(normalize(key));
}
getAsPrefix(key) {
const normalizedKey = normalize(key);
const normalizedPrefix = normalizedKey + SPLIT;
const results = [];
const current = this.kvs.get(normalizedKey);
if (current !== void 0) results.push(current);
this.kvs.forEach((value, itemNormalizedKey) => {
if (itemNormalizedKey.startsWith(normalizedPrefix)) results.push(value);
});
return results;
}
update(key, updater) {
const next = updater(this.get(key));
if (!next) this.delete(key);
else this.set(key, next);
}
delete(key) {
this.kvs.delete(normalize(key));
}
map(callback) {
return [...this.kvs.entries()].map(([key, value]) => {
return callback({
key: key.split(SPLIT).map((cell) => {
const [, type, unit] = cell.match(/^([^:]*):(.*)$/);
return type === "number" ? Number(unit) : unit;
}),
value
});
});
}
toJSON() {
const json = {};
this.map(({ key, value }) => {
json[key.join(".")] = value;
return null;
});
return json;
}
};
//#endregion
//#region node_modules/@rc-component/form/es/hooks/useForm.js
var FormStore = class {
formHooked = false;
forceRootUpdate;
subscribable = true;
store = {};
fieldEntities = [];
initialValues = {};
callbacks = {};
validateMessages = null;
preserve = null;
lastValidatePromise = null;
watcherCenter = new WatcherCenter(this);
constructor(forceRootUpdate) {
this.forceRootUpdate = forceRootUpdate;
}
getForm = () => ({
getFieldValue: this.getFieldValue,
getFieldsValue: this.getFieldsValue,
getFieldError: this.getFieldError,
getFieldWarning: this.getFieldWarning,
getFieldsError: this.getFieldsError,
isFieldsTouched: this.isFieldsTouched,
isFieldTouched: this.isFieldTouched,
isFieldValidating: this.isFieldValidating,
isFieldsValidating: this.isFieldsValidating,
resetFields: this.resetFields,
setFields: this.setFields,
setFieldValue: this.setFieldValue,
setFieldsValue: this.setFieldsValue,
validateFields: this.validateFields,
submit: this.submit,
_init: true,
getInternalHooks: this.getInternalHooks
});
getInternalHooks = (key) => {
if (key === "RC_FORM_INTERNAL_HOOKS") {
this.formHooked = true;
return {
dispatch: this.dispatch,
initEntityValue: this.initEntityValue,
registerField: this.registerField,
useSubscribe: this.useSubscribe,
setInitialValues: this.setInitialValues,
destroyForm: this.destroyForm,
setCallbacks: this.setCallbacks,
setValidateMessages: this.setValidateMessages,
getFields: this.getFields,
setPreserve: this.setPreserve,
getInitialValue: this.getInitialValue,
registerWatch: this.registerWatch
};
}
warningOnce(false, "`getInternalHooks` is internal usage. Should not call directly.");
return null;
};
useSubscribe = (subscribable) => {
this.subscribable = subscribable;
};
/**
* Record prev Form unmount fieldEntities which config preserve false.
* This need to be refill with initialValues instead of store value.
*/
prevWithoutPreserves = null;
/**
* First time `setInitialValues` should update store with initial value
*/
setInitialValues = (initialValues, init) => {
this.initialValues = initialValues || {};
if (init) {
let nextStore = merge$1(initialValues, this.store);
this.prevWithoutPreserves?.map(({ key: namePath }) => {
nextStore = set(nextStore, namePath, get(initialValues, namePath));
});
this.prevWithoutPreserves = null;
this.updateStore(nextStore);
}
};
destroyForm = (clearOnDestroy) => {
if (clearOnDestroy) this.updateStore({});
else {
const prevWithoutPreserves = new NameMap();
this.getFieldEntities(true).forEach((entity) => {
if (!this.isMergedPreserve(entity.isPreserve())) prevWithoutPreserves.set(entity.getNamePath(), true);
});
this.prevWithoutPreserves = prevWithoutPreserves;
}
};
getInitialValue = (namePath) => {
const initValue = get(this.initialValues, namePath);
return namePath.length ? merge$1(initValue) : initValue;
};
setCallbacks = (callbacks) => {
this.callbacks = callbacks;
};
setValidateMessages = (validateMessages) => {
this.validateMessages = validateMessages;
};
setPreserve = (preserve) => {
this.preserve = preserve;
};
registerWatch = (callback) => {
return this.watcherCenter.register(callback);
};
notifyWatch = (namePath = []) => {
this.watcherCenter.notify(namePath);
};
timeoutId = null;
warningUnhooked = () => {
if (!this.timeoutId && typeof window !== "undefined") this.timeoutId = setTimeout(() => {
this.timeoutId = null;
if (!this.formHooked) warningOnce(false, "Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?");
});
};
updateStore = (nextStore) => {
this.store = nextStore;
};
/**
* Get registered field entities.
* @param pure Only return field which has a `name`. Default: false
*/
getFieldEntities = (pure = false) => {
if (!pure) return this.fieldEntities;
return this.fieldEntities.filter((field) => field.getNamePath().length);
};
/**
* Get a map of registered field entities with their name path as the key.
* @param pure Only include fields which have a `name`. Default: false
* @returns A NameMap containing field entities indexed by their name paths
*/
getFieldsMap = (pure = false) => {
const cache = new NameMap();
this.getFieldEntities(pure).forEach((field) => {
const namePath = field.getNamePath();
cache.set(namePath, field);
});
return cache;
};
/**
* Get field entities based on a list of name paths.
* @param nameList - Array of name paths to search for. If not provided, returns all field entities with names.
* @param includesSubNamePath - Whether to include fields that have the given name path as a prefix.
*/
getFieldEntitiesForNamePathList = (nameList, includesSubNamePath = false) => {
if (!nameList) return this.getFieldEntities(true);
const cache = this.getFieldsMap(true);
if (!includesSubNamePath) return nameList.map((name) => {
const namePath = getNamePath(name);
return cache.get(namePath) || { INVALIDATE_NAME_PATH: getNamePath(name) };
});
return nameList.flatMap((name) => {
const namePath = getNamePath(name);
const fields = cache.getAsPrefix(namePath);
if (fields.length) return fields;
return [{ INVALIDATE_NAME_PATH: namePath }];
});
};
getFieldsValue = (nameList, filterFunc) => {
this.warningUnhooked();
let mergedNameList;
let mergedFilterFunc;
if (nameList === true || Array.isArray(nameList)) {
mergedNameList = nameList;
mergedFilterFunc = filterFunc;
} else if (nameList && typeof nameList === "object") mergedFilterFunc = nameList.filter;
if (mergedNameList === true && !mergedFilterFunc) return this.store;
const fieldEntities = this.getFieldEntitiesForNamePathList(Array.isArray(mergedNameList) ? mergedNameList : null, true);
const filteredNameList = [];
const listNamePaths = [];
fieldEntities.forEach((entity) => {
const namePath = entity.INVALIDATE_NAME_PATH || entity.getNamePath();
if (entity.isList?.()) {
listNamePaths.push(namePath);
return;
}
if (!mergedFilterFunc) filteredNameList.push(namePath);
else {
const meta = "getMeta" in entity ? entity.getMeta() : null;
if (mergedFilterFunc(meta)) filteredNameList.push(namePath);
}
});
let mergedValues = cloneByNamePathList(this.store, filteredNameList.map(getNamePath));
listNamePaths.forEach((namePath) => {
if (!get(mergedValues, namePath)) mergedValues = set(mergedValues, namePath, []);
});
return mergedValues;
};
getFieldValue = (name) => {
this.warningUnhooked();
const namePath = getNamePath(name);
return get(this.store, namePath);
};
getFieldsError = (nameList) => {
this.warningUnhooked();
return this.getFieldEntitiesForNamePathList(nameList).map((entity, index) => {
if (entity && !entity.INVALIDATE_NAME_PATH) return {
name: entity.getNamePath(),
errors: entity.getErrors(),
warnings: entity.getWarnings()
};
return {
name: getNamePath(nameList[index]),
errors: [],
warnings: []
};
});
};
getFieldError = (name) => {
this.warningUnhooked();
const namePath = getNamePath(name);
return this.getFieldsError([namePath])[0].errors;
};
getFieldWarning = (name) => {
this.warningUnhooked();
const namePath = getNamePath(name);
return this.getFieldsError([namePath])[0].warnings;
};
isFieldsTouched = (...args) => {
this.warningUnhooked();
const [arg0, arg1] = args;
let namePathList;
let 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;
}
const fieldEntities = this.getFieldEntities(true);
const isFieldTouched = (field) => field.isFieldTouched();
if (!namePathList) return isAllFieldsTouched ? fieldEntities.every((entity) => isFieldTouched(entity) || entity.isList()) : fieldEntities.some(isFieldTouched);
const map = new NameMap();
namePathList.forEach((shortNamePath) => {
map.set(shortNamePath, []);
});
fieldEntities.forEach((field) => {
const fieldNamePath = field.getNamePath();
namePathList.forEach((shortNamePath) => {
if (shortNamePath.every((nameUnit, i) => fieldNamePath[i] === nameUnit)) map.update(shortNamePath, (list) => [...list, field]);
});
});
const isNamePathListTouched = (entities) => entities.some(isFieldTouched);
const namePathListEntities = map.map(({ value }) => value);
return isAllFieldsTouched ? namePathListEntities.every(isNamePathListTouched) : namePathListEntities.some(isNamePathListTouched);
};
isFieldTouched = (name) => {
this.warningUnhooked();
return this.isFieldsTouched([name]);
};
isFieldsValidating = (nameList) => {
this.warningUnhooked();
const fieldEntities = this.getFieldEntities();
if (!nameList) return fieldEntities.some((testField) => testField.isFieldValidating());
const namePathList = nameList.map(getNamePath);
return fieldEntities.some((testField) => {
return containsNamePath(namePathList, testField.getNamePath()) && testField.isFieldValidating();
});
};
isFieldValidating = (name) => {
this.warningUnhooked();
return this.isFieldsValidating([name]);
};
/**
* Reset Field with field `initialValue` prop.
* Can pass `entities` or `namePathList` or just nothing.
*/
resetWithFieldInitialValue = (info = {}) => {
const cache = new NameMap();
const fieldEntities = this.getFieldEntities(true);
fieldEntities.forEach((field) => {
const { initialValue } = field.props;
const namePath = field.getNamePath();
if (initialValue !== void 0) {
const records = cache.get(namePath) || /* @__PURE__ */ new Set();
records.add({
entity: field,
value: initialValue
});
cache.set(namePath, records);
}
});
const resetWithFields = (entities) => {
entities.forEach((field) => {
const { initialValue } = field.props;
if (initialValue !== void 0) {
const namePath = field.getNamePath();
if (this.getInitialValue(namePath) !== void 0) warningOnce(false, `Form already set 'initialValues' with path '${namePath.join(".")}'. Field can not overwrite it.`);
else {
const records = cache.get(namePath);
if (records && records.size > 1) warningOnce(false, `Multiple Field with path '${namePath.join(".")}' set 'initialValue'. Can not decide which one to pick.`);
else if (records) {
const originValue = this.getFieldValue(namePath);
if (!field.isListField() && (!info.skipExist || originValue === void 0)) this.updateStore(set(this.store, namePath, [...records][0].value));
}
}
}
});
};
let requiredFieldEntities;
if (info.entities) requiredFieldEntities = info.entities;
else if (info.namePathList) {
requiredFieldEntities = [];
info.namePathList.forEach((namePath) => {
const records = cache.get(namePath);
if (records) requiredFieldEntities.push(...[...records].map((r) => r.entity));
});
} else requiredFieldEntities = fieldEntities;
resetWithFields(requiredFieldEntities);
};
resetFields = (nameList) => {
this.warningUnhooked();
const prevStore = this.store;
if (!nameList) {
this.updateStore(merge$1(this.initialValues));
this.resetWithFieldInitialValue();
this.notifyObservers(prevStore, null, { type: "reset" });
this.notifyWatch();
return;
}
const namePathList = nameList.map(getNamePath);
namePathList.forEach((namePath) => {
const initialValue = this.getInitialValue(namePath);
this.updateStore(set(this.store, namePath, initialValue));
});
this.resetWithFieldInitialValue({ namePathList });
this.notifyObservers(prevStore, namePathList, { type: "reset" });
this.notifyWatch(namePathList);
};
setFields = (fields) => {
this.warningUnhooked();
const prevStore = this.store;
const namePathList = [];
fields.forEach((fieldData) => {
const { name, ...data } = fieldData;
const namePath = getNamePath(name);
namePathList.push(namePath);
if ("value" in data) this.updateStore(set(this.store, namePath, data.value));
this.notifyObservers(prevStore, [namePath], {
type: "setField",
data: fieldData
});
});
this.notifyWatch(namePathList);
};
getFields = () => {
return this.getFieldEntities(true).map((field) => {
const namePath = field.getNamePath();
const fieldData = {
...field.getMeta(),
name: namePath,
value: this.getFieldValue(namePath)
};
Object.defineProperty(fieldData, "originRCField", { value: true });
return fieldData;
});
};
/**
* This only trigger when a field is on constructor to avoid we get initialValue too late
*/
initEntityValue = (entity) => {
const { initialValue } = entity.props;
if (initialValue !== void 0) {
const namePath = entity.getNamePath();
if (get(this.store, namePath) === void 0) this.updateStore(set(this.store, namePath, initialValue));
}
};
isMergedPreserve = (fieldPreserve) => {
return (fieldPreserve !== void 0 ? fieldPreserve : this.preserve) ?? true;
};
registerField = (entity) => {
this.fieldEntities.push(entity);
const namePath = entity.getNamePath();
this.notifyWatch([namePath]);
if (entity.props.initialValue !== void 0) {
const prevStore = this.store;
this.resetWithFieldInitialValue({
entities: [entity],
skipExist: true
});
this.notifyObservers(prevStore, [entity.getNamePath()], {
type: "valueUpdate",
source: "internal"
});
}
return (isListField, preserve, subNamePath = []) => {
this.fieldEntities = this.fieldEntities.filter((item) => item !== entity);
if (!this.isMergedPreserve(preserve) && (!isListField || subNamePath.length > 1)) {
const defaultValue = isListField ? void 0 : this.getInitialValue(namePath);
if (namePath.length && this.getFieldValue(namePath) !== defaultValue && this.fieldEntities.every((field) => !matchNamePath(field.getNamePath(), namePath))) {
const prevStore = this.store;
this.updateStore(set(prevStore, namePath, defaultValue, true));
this.notifyObservers(prevStore, [namePath], { type: "remove" });
this.triggerDependenciesUpdate(prevStore, namePath);
}
}
this.notifyWatch([namePath]);
};
};
dispatch = (action) => {
switch (action.type) {
case "updateValue": {
const { namePath, value } = action;
this.updateValue(namePath, value);
break;
}
case "validateField": {
const { namePath, triggerName } = action;
this.validateFields([namePath], { triggerName });
break;
}
default:
}
};
notifyObservers = (prevStore, namePathList, info) => {
if (this.subscribable) {
const mergedInfo = {
...info,
store: this.getFieldsValue(true)
};
this.getFieldEntities().forEach(({ onStoreChange }) => {
onStoreChange(prevStore, namePathList, mergedInfo);
});
} else this.forceRootUpdate();
};
/**
* Notify dependencies children with parent update
* We need delay to trigger validate in case Field is under render props
*/
triggerDependenciesUpdate = (prevStore, namePath) => {
const childrenFields = this.getDependencyChildrenFields(namePath);
if (childrenFields.length) this.validateFields(childrenFields, { delayFrame: true });
this.notifyObservers(prevStore, childrenFields, {
type: "dependenciesUpdate",
relatedFields: [namePath, ...childrenFields]
});
return childrenFields;
};
updateValue = (name, value) => {
const namePath = getNamePath(name);
const prevStore = this.store;
this.updateStore(set(this.store, namePath, value));
this.notifyObservers(prevStore, [namePath], {
type: "valueUpdate",
source: "internal"
});
this.notifyWatch([namePath]);
const childrenFields = this.triggerDependenciesUpdate(prevStore, namePath);
const { onValuesChange } = this.callbacks;
if (onValuesChange) {
const changedValues = cloneByNamePathList(this.store, [namePath]);
onValuesChange(changedValues, set(this.getFieldsValue(), namePath, get(changedValues, namePath)));
}
this.triggerOnFieldsChange([namePath, ...childrenFields]);
};
setFieldsValue = (store) => {
this.warningUnhooked();
const prevStore = this.store;
if (store) {
const nextStore = merge$1(this.store, store);
this.updateStore(nextStore);
}
this.notifyObservers(prevStore, null, {
type: "valueUpdate",
source: "external"
});
this.notifyWatch();
};
setFieldValue = (name, value) => {
this.setFields([{
name,
value,
errors: [],
warnings: [],
touched: true
}]);
};
getDependencyChildrenFields = (rootNamePath) => {
const children = /* @__PURE__ */ new Set();
const childrenFields = [];
const dependencies2fields = new NameMap();
/**
* Generate maps
* Can use cache to save perf if user report performance issue with this
*/
this.getFieldEntities().forEach((field) => {
const { dependencies } = field.props;
(dependencies || []).forEach((dependency) => {
const dependencyNamePath = getNamePath(dependency);
dependencies2fields.update(dependencyNamePath, (fields = /* @__PURE__ */ new Set()) => {
fields.add(field);
return fields;
});
});
});
const fillChildren = (namePath) => {
(dependencies2fields.get(namePath) || /* @__PURE__ */ new Set()).forEach((field) => {
if (!children.has(field)) {
children.add(field);
const fieldNamePath = field.getNamePath();
if (field.isFieldDirty() && fieldNamePath.length) {
childrenFields.push(fieldNamePath);
fillChildren(fieldNamePath);
}
}
});
};
fillChildren(rootNamePath);
return childrenFields;
};
triggerOnFieldsChange = (namePathList, filedErrors) => {
const { onFieldsChange } = this.callbacks;
if (onFieldsChange) {
const fields = this.getFields();
/**
* Fill errors since `fields` may be replaced by controlled fields
*/
if (filedErrors) {
const cache = new NameMap();
filedErrors.forEach(({ name, errors }) => {
cache.set(name, errors);
});
fields.forEach((field) => {
field.errors = cache.get(field.name) || field.errors;
});
}
const changedFields = fields.filter(({ name: fieldName }) => containsNamePath(namePathList, fieldName));
if (changedFields.length) onFieldsChange(changedFields, fields);
}
};
validateFields = (arg1, arg2) => {
this.warningUnhooked();
let nameList;
let options;
if (Array.isArray(arg1) || typeof arg1 === "string" || typeof arg2 === "string") {
nameList = arg1;
options = arg2;
} else options = arg1;
const provideNameList = !!nameList;
const namePathList = provideNameList ? nameList.map(getNamePath) : [];
const finalValueNamePathList = [...namePathList];
const promiseList = [];
const TMP_SPLIT = String(Date.now());
const validateNamePathList = /* @__PURE__ */ new Set();
const { recursive, dirty } = options || {};
this.getFieldEntities(true).forEach((field) => {
const fieldNamePath = field.getNamePath();
if (!provideNameList) {
if (!field.isList() || !namePathList.some((name) => matchNamePath(name, fieldNamePath, true))) finalValueNamePathList.push(fieldNamePath);
namePathList.push(fieldNamePath);
}
if (!field.props.rules || !field.props.rules.length) return;
if (dirty && !field.isFieldDirty()) return;
validateNamePathList.add(fieldNamePath.join(TMP_SPLIT));
if (!provideNameList || containsNamePath(namePathList, fieldNamePath, recursive)) {
const promise = field.validateRules({
validateMessages: {
...defaultValidateMessages,
...this.validateMessages
},
...options
});
promiseList.push(promise.then(() => ({
name: fieldNamePath,
errors: [],
warnings: []
})).catch((ruleErrors) => {
const mergedErrors = [];
const mergedWarnings = [];
ruleErrors.forEach?.(({ rule: { warningOnly }, errors }) => {
if (warningOnly) mergedWarnings.push(...errors);
else mergedErrors.push(...errors);
});
if (mergedErrors.length) return Promise.reject({
name: fieldNamePath,
errors: mergedErrors,
warnings: mergedWarnings
});
return {
name: fieldNamePath,
errors: mergedErrors,
warnings: mergedWarnings
};
}));
}
});
const summaryPromise = allPromiseFinish(promiseList);
this.lastValidatePromise = summaryPromise;
summaryPromise.catch((results) => results).then((results) => {
const resultNamePathList = results.map(({ name }) => name);
this.notifyObservers(this.store, resultNamePathList, { type: "validateFinish" });
this.triggerOnFieldsChange(resultNamePathList, results);
});
const returnPromise = summaryPromise.then(() => {
if (this.lastValidatePromise === summaryPromise) return Promise.resolve(this.getFieldsValue(finalValueNamePathList));
return Promise.reject([]);
}).catch((results) => {
const errorList = results.filter((result) => result && result.errors.length);
const errorMessage = errorList[0]?.errors?.[0];
return Promise.reject({
message: errorMessage,
values: this.getFieldsValue(namePathList),
errorFields: errorList,
outOfDate: this.lastValidatePromise !== summaryPromise
});
});
returnPromise.catch((e) => e);
const triggerNamePathList = namePathList.filter((namePath) => validateNamePathList.has(namePath.join(TMP_SPLIT)));
this.triggerOnFieldsChange(triggerNamePathList);
return returnPromise;
};
submit = () => {
this.warningUnhooked();
this.validateFields().then((values) => {
const { onFinish } = this.callbacks;
if (onFinish) try {
onFinish(values);
} catch (err) {
console.error(err);
}
}).catch((e) => {
const { onFinishFailed } = this.callbacks;
if (onFinishFailed) onFinishFailed(e);
});
};
};
function useForm$1(form) {
const formRef = import_react.useRef(null);
const [, forceUpdate] = import_react.useState({});
if (!formRef.current) if (form) formRef.current = form;
else {
const forceReRender = () => {
forceUpdate({});
};
formRef.current = new FormStore(forceReRender).getForm();
}
return [formRef.current];
}
//#endregion
//#region node_modules/@rc-component/form/es/FormContext.js
var FormContext$1 = /* @__PURE__ */ import_react.createContext({
triggerFormChange: () => {},
triggerFormFinish: () => {},
registerForm: () => {},
unregisterForm: () => {}
});
var FormProvider$1 = ({ validateMessages, onFormChange, onFormFinish, children }) => {
const formContext = import_react.useContext(FormContext$1);
const formsRef = import_react.useRef({});
return /* @__PURE__ */ import_react.createElement(FormContext$1.Provider, { value: {
...formContext,
validateMessages: {
...formContext.validateMessages,
...validateMessages
},
triggerFormChange: (name, changedFields) => {
if (onFormChange) onFormChange(name, {
changedFields,
forms: formsRef.current
});
formContext.triggerFormChange(name, changedFields);
},
triggerFormFinish: (name, values) => {
if (onFormFinish) onFormFinish(name, {
values,
forms: formsRef.current
});
formContext.triggerFormFinish(name, values);
},
registerForm: (name, form) => {
if (name) formsRef.current = {
...formsRef.current,
[name]: form
};
formContext.registerForm(name, form);
},
unregisterForm: (name) => {
const newForms = { ...formsRef.current };
delete newForms[name];
formsRef.current = newForms;
formContext.unregisterForm(name);
}
} }, children);
};
//#endregion
//#region node_modules/@rc-component/form/es/Form.js
function _extends$84() {
_extends$84 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$84.apply(this, arguments);
}
var Form$2 = ({ name, initialValues, fields, form, preserve, children, component: Component = "form", validateMessages, validateTrigger = "onChange", onValuesChange, onFieldsChange, onFinish, onFinishFailed, clearOnDestroy, ...restProps }, ref) => {
const nativeElementRef = import_react.useRef(null);
const formContext = import_react.useContext(FormContext$1);
const [formInstance] = useForm$1(form);
const { useSubscribe, setInitialValues, setCallbacks, setValidateMessages, setPreserve, destroyForm } = formInstance.getInternalHooks(HOOK_MARK);
import_react.useImperativeHandle(ref, () => ({
...formInstance,
nativeElement: nativeElementRef.current
}));
import_react.useEffect(() => {
formContext.registerForm(name, formInstance);
return () => {
formContext.unregisterForm(name);
};
}, [
formContext,
formInstance,
name
]);
setValidateMessages({
...formContext.validateMessages,
...validateMessages
});
setCallbacks({
onValuesChange,
onFieldsChange: (changedFields, ...rest) => {
formContext.triggerFormChange(name, changedFields);
if (onFieldsChange) onFieldsChange(changedFields, ...rest);
},
onFinish: (values) => {
formContext.triggerFormFinish(name, values);
if (onFinish) onFinish(values);
},
onFinishFailed
});
setPreserve(preserve);
const mountRef = import_react.useRef(null);
setInitialValues(initialValues, !mountRef.current);
if (!mountRef.current) mountRef.current = true;
import_react.useEffect(() => () => destroyForm(clearOnDestroy), []);
let childrenNode;
const childrenRenderProps = typeof children === "function";
if (childrenRenderProps) childrenNode = children(formInstance.getFieldsValue(true), formInstance);
else childrenNode = children;
useSubscribe(!childrenRenderProps);
const prevFieldsRef = import_react.useRef(null);
import_react.useEffect(() => {
if (!isSimilar(prevFieldsRef.current || [], fields || [])) formInstance.setFields(fields || []);
prevFieldsRef.current = fields;
}, [fields, formInstance]);
const formContextValue = import_react.useMemo(() => ({
...formInstance,
validateTrigger
}), [formInstance, validateTrigger]);
const wrapperNode = /* @__PURE__ */ import_react.createElement(ListContext$1.Provider, { value: null }, /* @__PURE__ */ import_react.createElement(Context.Provider, { value: formContextValue }, childrenNode));
if (Component === false) return wrapperNode;
return /* @__PURE__ */ import_react.createElement(Component, _extends$84({}, restProps, {
ref: nativeElementRef,
onSubmit: (event) => {
event.preventDefault();
event.stopPropagation();
formInstance.submit();
},
onReset: (event) => {
event.preventDefault();
formInstance.resetFields();
restProps.onReset?.(event);
}
}), wrapperNode);
};
//#endregion
//#region node_modules/@rc-component/form/es/hooks/useWatch.js
function stringify$1(value) {
try {
return JSON.stringify(value);
} catch {
return Math.random();
}
}
function useWatch(...args) {
const [dependencies, _form = {}] = args;
const options = isFormInstance(_form) ? { form: _form } : _form;
const form = options.form;
const [value, setValue] = (0, import_react.useState)(() => typeof dependencies === "function" ? dependencies({}) : void 0);
const valueStr = (0, import_react.useMemo)(() => stringify$1(value), [value]);
const valueStrRef = (0, import_react.useRef)(valueStr);
valueStrRef.current = valueStr;
const fieldContext = (0, import_react.useContext)(Context);
const formInstance = form || fieldContext;
const isValidForm = formInstance && formInstance._init;
warningOnce(args.length === 2 ? form ? isValidForm : true : isValidForm, "useWatch requires a form instance since it can not auto detect from context.");
const { getFieldsValue, getInternalHooks } = formInstance;
const { registerWatch } = getInternalHooks(HOOK_MARK);
const triggerUpdate = useEvent((values, allValues) => {
const watchValue = options.preserve ? allValues ?? getFieldsValue(true) : values ?? getFieldsValue();
const nextValue = typeof dependencies === "function" ? dependencies(watchValue) : get(watchValue, getNamePath(dependencies));
if (stringify$1(value) !== stringify$1(nextValue)) setValue(nextValue);
});
(0, import_react.useEffect)(() => {
if (!isValidForm) return;
triggerUpdate();
}, [isValidForm, typeof dependencies === "function" ? dependencies : JSON.stringify(dependencies)]);
(0, import_react.useEffect)(() => {
if (!isValidForm) return;
return registerWatch((values, allValues) => {
triggerUpdate(values, allValues);
});
}, [isValidForm]);
return value;
}
//#endregion
//#region node_modules/@rc-component/form/es/index.js
var RefForm = /* @__PURE__ */ import_react.forwardRef(Form$2);
RefForm.FormProvider = FormProvider$1;
RefForm.Field = WrapperField;
RefForm.List = List$2;
RefForm.useForm = useForm$1;
RefForm.useWatch = useWatch;
//#endregion
//#region node_modules/antd/es/form/context.js
var FormContext = /* @__PURE__ */ import_react.createContext({
labelAlign: "right",
layout: "horizontal",
itemRef: () => {}
});
var NoStyleItemContext = /* @__PURE__ */ import_react.createContext(null);
var FormProvider = (props) => {
const providerProps = omit(props, ["prefixCls"]);
return /* @__PURE__ */ import_react.createElement(FormProvider$1, { ...providerProps });
};
var FormItemPrefixContext = /* @__PURE__ */ import_react.createContext({ prefixCls: "" });
var FormItemInputContext = /* @__PURE__ */ import_react.createContext({});
FormItemInputContext.displayName = "FormItemInputContext";
var NoFormStyle = ({ children, status, override }) => {
const formItemInputContext = import_react.useContext(FormItemInputContext);
const newFormItemInputContext = import_react.useMemo(() => {
const newContext = { ...formItemInputContext };
if (override) delete newContext.isFormItemInput;
if (status) {
delete newContext.status;
delete newContext.hasFeedback;
delete newContext.feedbackIcon;
}
return newContext;
}, [
status,
override,
formItemInputContext
]);
return /* @__PURE__ */ import_react.createElement(FormItemInputContext.Provider, { value: newFormItemInputContext }, children);
};
var VariantContext = /* @__PURE__ */ import_react.createContext(void 0);
//#endregion
//#region node_modules/antd/es/_util/ContextIsolator.js
var ContextIsolator = (props) => {
const { space, form, children } = props;
if (!isNonNullable(children)) return null;
let result = children;
if (form) result = /* @__PURE__ */ import_react.createElement(NoFormStyle, {
override: true,
status: true
}, result);
if (space) result = /* @__PURE__ */ import_react.createElement(NoCompactStyle, null, result);
return result;
};
//#endregion
//#region node_modules/@rc-component/util/es/Dom/styleChecker.js
var isStyleNameSupport = (styleName) => {
if (canUseDom() && window.document.documentElement) {
const styleNameList = Array.isArray(styleName) ? styleName : [styleName];
const { documentElement } = window.document;
return styleNameList.some((name) => name in documentElement.style);
}
return false;
};
var isStyleValueSupport = (styleName, value) => {
if (!isStyleNameSupport(styleName)) return false;
const ele = document.createElement("div");
const origin = ele.style[styleName];
ele.style[styleName] = value;
return ele.style[styleName] !== origin;
};
function isStyleSupport(styleName, styleValue) {
if (!Array.isArray(styleName) && styleValue !== void 0) return isStyleValueSupport(styleName, styleValue);
return isStyleNameSupport(styleName);
}
//#endregion
//#region node_modules/antd/es/_util/styleChecker.js
var canUseDocElement = () => canUseDom() && window.document.documentElement;
//#endregion
//#region node_modules/antd/es/drawer/useFocusable.js
function useFocusable$1(focusable, defaultTrap, legacyFocusTriggerAfterClose) {
return (0, import_react.useMemo)(() => {
return {
trap: defaultTrap ?? true,
focusTriggerAfterClose: legacyFocusTriggerAfterClose ?? true,
...focusable
};
}, [
focusable,
defaultTrap,
legacyFocusTriggerAfterClose
]);
}
//#endregion
//#region node_modules/antd/es/skeleton/Element.js
var Element$1 = (props) => {
const { prefixCls, className, style, size, shape } = props;
devUseWarning("Skeleton").deprecated(size !== "default", "size=\"default\"", "size=\"medium\"");
const sizeCls = clsx({
[`${prefixCls}-lg`]: size === "large",
[`${prefixCls}-sm`]: size === "small"
});
const shapeCls = clsx({
[`${prefixCls}-circle`]: shape === "circle",
[`${prefixCls}-square`]: shape === "square",
[`${prefixCls}-round`]: shape === "round"
});
const sizeStyle = import_react.useMemo(() => isNumber(size) ? {
width: size,
height: size,
lineHeight: `${size}px`
} : {}, [size]);
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(prefixCls, sizeCls, shapeCls, className),
style: {
...sizeStyle,
...style
}
});
};
//#endregion
//#region node_modules/antd/es/skeleton/style/index.js
var skeletonClsLoading = new Keyframe(`ant-skeleton-loading`, {
"0%": { backgroundPosition: "100% 50%" },
"100%": { backgroundPosition: "0 50%" }
});
var genSkeletonElementCommonSize = (size) => ({
height: size,
lineHeight: unit$1(size)
});
var genSkeletonElementSize = (size) => ({
width: size,
...genSkeletonElementCommonSize(size)
});
var genSkeletonColor = (token) => ({
background: token.skeletonLoadingBackground,
backgroundSize: "400% 100%",
animationName: skeletonClsLoading,
animationDuration: token.skeletonLoadingMotionDuration,
animationTimingFunction: "ease",
animationIterationCount: "infinite"
});
var genSkeletonElementInputSize = (size, calc) => ({
width: calc(size).mul(5).equal(),
minWidth: calc(size).mul(5).equal(),
...genSkeletonElementCommonSize(size)
});
var genSkeletonElementAvatar = (token) => {
const { skeletonAvatarCls, gradientFromColor, controlHeight, controlHeightLG, controlHeightSM } = token;
return {
[skeletonAvatarCls]: {
display: "inline-block",
verticalAlign: "top",
background: gradientFromColor,
...genSkeletonElementSize(controlHeight)
},
[`${skeletonAvatarCls}${skeletonAvatarCls}-circle`]: { borderRadius: "50%" },
[`${skeletonAvatarCls}${skeletonAvatarCls}-lg`]: { ...genSkeletonElementSize(controlHeightLG) },
[`${skeletonAvatarCls}${skeletonAvatarCls}-sm`]: { ...genSkeletonElementSize(controlHeightSM) }
};
};
var genSkeletonElementInput = (token) => {
const { controlHeight, borderRadiusSM, skeletonInputCls, controlHeightLG, controlHeightSM, gradientFromColor, calc } = token;
return {
[skeletonInputCls]: {
display: "inline-block",
verticalAlign: "top",
background: gradientFromColor,
borderRadius: borderRadiusSM,
...genSkeletonElementInputSize(controlHeight, calc)
},
[`${skeletonInputCls}-lg`]: { ...genSkeletonElementInputSize(controlHeightLG, calc) },
[`${skeletonInputCls}-sm`]: { ...genSkeletonElementInputSize(controlHeightSM, calc) }
};
};
var genSkeletonElementShape = (token) => {
const { gradientFromColor, borderRadiusSM, imageSizeBase, calc } = token;
return {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
verticalAlign: "middle",
background: gradientFromColor,
borderRadius: borderRadiusSM,
...genSkeletonElementSize(calc(imageSizeBase).mul(2).equal())
};
};
var genSkeletonElementNode = (token) => {
return { [token.skeletonNodeCls]: { ...genSkeletonElementShape(token) } };
};
var genSkeletonElementImage = (token) => {
const { skeletonImageCls, imageSizeBase, calc } = token;
return {
[skeletonImageCls]: {
...genSkeletonElementShape(token),
[`${skeletonImageCls}-path`]: { fill: "#bfbfbf" },
[`${skeletonImageCls}-svg`]: {
...genSkeletonElementSize(imageSizeBase),
maxWidth: calc(imageSizeBase).mul(4).equal(),
maxHeight: calc(imageSizeBase).mul(4).equal()
},
[`${skeletonImageCls}-svg${skeletonImageCls}-svg-circle`]: { borderRadius: "50%" }
},
[`${skeletonImageCls}${skeletonImageCls}-circle`]: { borderRadius: "50%" }
};
};
var genSkeletonElementButtonShape = (token, size, buttonCls) => {
const { skeletonButtonCls } = token;
return {
[`${buttonCls}${skeletonButtonCls}-circle`]: {
width: size,
minWidth: size,
borderRadius: "50%"
},
[`${buttonCls}${skeletonButtonCls}-round`]: { borderRadius: size }
};
};
var genSkeletonElementButtonSize = (size, calc) => ({
width: calc(size).mul(2).equal(),
minWidth: calc(size).mul(2).equal(),
...genSkeletonElementCommonSize(size)
});
var genSkeletonElementButton = (token) => {
const { borderRadiusSM, skeletonButtonCls, controlHeight, controlHeightLG, controlHeightSM, gradientFromColor, calc } = token;
return {
[skeletonButtonCls]: {
display: "inline-block",
verticalAlign: "top",
background: gradientFromColor,
borderRadius: borderRadiusSM,
width: calc(controlHeight).mul(2).equal(),
minWidth: calc(controlHeight).mul(2).equal(),
...genSkeletonElementButtonSize(controlHeight, calc)
},
...genSkeletonElementButtonShape(token, controlHeight, skeletonButtonCls),
[`${skeletonButtonCls}-lg`]: { ...genSkeletonElementButtonSize(controlHeightLG, calc) },
...genSkeletonElementButtonShape(token, controlHeightLG, `${skeletonButtonCls}-lg`),
[`${skeletonButtonCls}-sm`]: { ...genSkeletonElementButtonSize(controlHeightSM, calc) },
...genSkeletonElementButtonShape(token, controlHeightSM, `${skeletonButtonCls}-sm`)
};
};
var genBaseStyle$16 = (token) => {
const { componentCls, skeletonAvatarCls, skeletonTitleCls, skeletonParagraphCls, skeletonButtonCls, skeletonInputCls, skeletonNodeCls, skeletonImageCls, controlHeight, controlHeightLG, controlHeightSM, gradientFromColor, padding, marginSM, borderRadius, titleHeight, blockRadius, paragraphLiHeight, controlHeightXS, paragraphMarginTop } = token;
return {
[componentCls]: {
display: "table",
width: "100%",
[`${componentCls}-header`]: {
display: "table-cell",
paddingInlineEnd: padding,
verticalAlign: "top",
[skeletonAvatarCls]: {
display: "inline-block",
verticalAlign: "top",
background: gradientFromColor,
...genSkeletonElementSize(controlHeight)
},
[`${skeletonAvatarCls}-circle`]: { borderRadius: "50%" },
[`${skeletonAvatarCls}-lg`]: { ...genSkeletonElementSize(controlHeightLG) },
[`${skeletonAvatarCls}-sm`]: { ...genSkeletonElementSize(controlHeightSM) }
},
[`${componentCls}-section`]: {
display: "table-cell",
width: "100%",
verticalAlign: "top",
[skeletonTitleCls]: {
width: "100%",
height: titleHeight,
background: gradientFromColor,
borderRadius: blockRadius,
[`+ ${skeletonParagraphCls}`]: { marginBlockStart: controlHeightSM }
},
[skeletonParagraphCls]: {
padding: 0,
"> li": {
width: "100%",
height: paragraphLiHeight,
listStyle: "none",
background: gradientFromColor,
borderRadius: blockRadius,
"+ li": { marginBlockStart: controlHeightXS }
}
},
[`${skeletonParagraphCls}> li:last-child:not(:first-child):not(:nth-child(2))`]: { width: "61%" }
},
[`&-round ${componentCls}-section`]: { [`${skeletonTitleCls}, ${skeletonParagraphCls} > li`]: { borderRadius } }
},
[`${componentCls}-with-avatar ${componentCls}-section`]: { [skeletonTitleCls]: {
marginBlockStart: marginSM,
[`+ ${skeletonParagraphCls}`]: { marginBlockStart: paragraphMarginTop }
} },
[`${componentCls}${componentCls}-element`]: {
display: "inline-block",
width: "auto",
...genSkeletonElementButton(token),
...genSkeletonElementAvatar(token),
...genSkeletonElementInput(token),
...genSkeletonElementNode(token),
...genSkeletonElementImage(token)
},
[`${componentCls}${componentCls}-block`]: {
width: "100%",
[skeletonButtonCls]: { width: "100%" },
[skeletonInputCls]: { width: "100%" }
},
[`${componentCls}${componentCls}-active`]: { [`
${skeletonTitleCls},
${skeletonParagraphCls} > li,
${skeletonAvatarCls},
${skeletonButtonCls},
${skeletonInputCls},
${skeletonNodeCls},
${skeletonImageCls}
`]: { ...genSkeletonColor(token) } }
};
};
var prepareComponentToken$51 = (token) => {
const { colorFillContent, colorFill } = token;
const gradientFromColor = colorFillContent;
const gradientToColor = colorFill;
return {
color: gradientFromColor,
colorGradientEnd: gradientToColor,
gradientFromColor,
gradientToColor,
titleHeight: token.controlHeight / 2,
blockRadius: token.borderRadiusSM,
paragraphMarginTop: token.marginLG + token.marginXXS,
paragraphLiHeight: token.controlHeight / 2
};
};
var style_default$57 = genStyleHooks("Skeleton", (token) => {
const { componentCls, calc } = token;
return genBaseStyle$16(merge(token, {
skeletonAvatarCls: `${componentCls}-avatar`,
skeletonTitleCls: `${componentCls}-title`,
skeletonParagraphCls: `${componentCls}-paragraph`,
skeletonButtonCls: `${componentCls}-button`,
skeletonInputCls: `${componentCls}-input`,
skeletonNodeCls: `${componentCls}-node`,
skeletonImageCls: `${componentCls}-image`,
imageSizeBase: calc(token.controlHeight).mul(1.5).equal(),
borderRadius: 100,
skeletonLoadingBackground: `linear-gradient(90deg, ${token.gradientFromColor} 25%, ${token.gradientToColor} 37%, ${token.gradientFromColor} 63%)`,
skeletonLoadingMotionDuration: "1.4s"
}));
}, prepareComponentToken$51, { deprecatedTokens: [["color", "gradientFromColor"], ["colorGradientEnd", "gradientToColor"]] });
//#endregion
//#region node_modules/antd/es/skeleton/Avatar.js
var SkeletonAvatar = (props) => {
const { prefixCls: customizePrefixCls, className, classNames, rootClassName, active, style, styles, shape = "circle", size: customSize, ...rest } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
const [hashId, cssVarCls] = style_default$57(prefixCls);
const mergedSize = useSize((ctx) => customSize ?? ctx);
const cls = clsx(prefixCls, `${prefixCls}-element`, { [`${prefixCls}-active`]: active }, classNames?.root, className, rootClassName, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style: styles?.root
}, /* @__PURE__ */ import_react.createElement(Element$1, {
prefixCls: `${prefixCls}-avatar`,
className: classNames?.content,
style: {
...styles?.content,
...style
},
shape,
size: mergedSize,
...rest
}));
};
//#endregion
//#region node_modules/antd/es/skeleton/Button.js
var SkeletonButton = (props) => {
const { prefixCls: customizePrefixCls, className, rootClassName, classNames, active, style, styles, block = false, size: customSize, ...rest } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
const [hashId, cssVarCls] = style_default$57(prefixCls);
const mergedSize = useSize((ctx) => customSize ?? ctx);
const cls = clsx(prefixCls, `${prefixCls}-element`, {
[`${prefixCls}-active`]: active,
[`${prefixCls}-block`]: block
}, classNames?.root, className, rootClassName, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style: styles?.root
}, /* @__PURE__ */ import_react.createElement(Element$1, {
prefixCls: `${prefixCls}-button`,
className: classNames?.content,
style: {
...styles?.content,
...style
},
size: mergedSize,
...rest
}));
};
//#endregion
//#region node_modules/antd/es/skeleton/Node.js
var SkeletonNode = (props) => {
const { prefixCls: customizePrefixCls, className, classNames, rootClassName, internalClassName, style, styles, active, children } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
const [hashId, cssVarCls] = style_default$57(prefixCls);
const cls = clsx(prefixCls, `${prefixCls}-element`, { [`${prefixCls}-active`]: active }, hashId, classNames?.root, className, rootClassName, cssVarCls);
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style: styles?.root
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(classNames?.content, internalClassName || `${prefixCls}-node`),
style: {
...styles?.content,
...style
}
}, children));
};
//#endregion
//#region node_modules/antd/es/skeleton/Image.js
var SkeletonImage = (props) => {
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("skeleton", props.prefixCls);
return /* @__PURE__ */ import_react.createElement(SkeletonNode, {
...props,
internalClassName: `${prefixCls}-image`
}, /* @__PURE__ */ import_react.createElement("svg", {
viewBox: "0 0 1098 1024",
xmlns: "http://www.w3.org/2000/svg",
className: `${prefixCls}-image-svg`
}, /* @__PURE__ */ import_react.createElement("title", null, "Image placeholder"), /* @__PURE__ */ import_react.createElement("path", {
d: "M365.7 329.1q0 45.8-32 77.7t-77.7 32-77.7-32-32-77.7 32-77.6 77.7-32 77.7 32 32 77.6M951 548.6v256H146.3V694.9L329 512l91.5 91.4L713 311zm54.8-402.3H91.4q-7.4 0-12.8 5.4T73 164.6v694.8q0 7.5 5.5 12.9t12.8 5.4h914.3q7.5 0 12.9-5.4t5.4-12.9V164.6q0-7.5-5.4-12.9t-12.9-5.4m91.4 18.3v694.8q0 37.8-26.8 64.6t-64.6 26.9H91.4q-37.7 0-64.6-26.9T0 859.4V164.6q0-37.8 26.8-64.6T91.4 73h914.3q37.8 0 64.6 26.9t26.8 64.6",
className: `${prefixCls}-image-path`
})));
};
//#endregion
//#region node_modules/antd/es/skeleton/Input.js
var SkeletonInput = (props) => {
const { prefixCls: customizePrefixCls, className, classNames, rootClassName, active, block, style, styles, size: customSize, ...rest } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
const [hashId, cssVarCls] = style_default$57(prefixCls);
const mergedSize = useSize((ctx) => customSize ?? ctx);
const cls = clsx(prefixCls, `${prefixCls}-element`, {
[`${prefixCls}-active`]: active,
[`${prefixCls}-block`]: block
}, classNames?.root, className, rootClassName, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style: styles?.root
}, /* @__PURE__ */ import_react.createElement(Element$1, {
prefixCls: `${prefixCls}-input`,
className: classNames?.content,
style: {
...styles?.content,
...style
},
size: mergedSize,
...rest
}));
};
//#endregion
//#region node_modules/antd/es/skeleton/Paragraph.js
var getWidth$1 = (index, props) => {
const { width, rows = 2 } = props;
if (Array.isArray(width)) return width[index];
if (rows - 1 === index) return width;
};
var Paragraph$1 = (props) => {
const { prefixCls, className, style, rows = 0 } = props;
const rowList = Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ import_react.createElement("li", {
key: index,
style: { width: getWidth$1(index, props) }
}));
return /* @__PURE__ */ import_react.createElement("ul", {
className: clsx(prefixCls, className),
style
}, rowList);
};
//#endregion
//#region node_modules/antd/es/skeleton/Title.js
var Title$1 = ({ prefixCls, className, width, style }) => /* @__PURE__ */ import_react.createElement("h3", {
className: clsx(prefixCls, className),
style: {
width,
...style
}
});
//#endregion
//#region node_modules/antd/es/skeleton/Skeleton.js
function getComponentProps(prop) {
if (isPlainObject(prop)) return prop;
return {};
}
function getAvatarBasicProps(hasTitle, hasParagraph) {
if (hasTitle && !hasParagraph) return {
size: "large",
shape: "square"
};
return {
size: "large",
shape: "circle"
};
}
function getTitleBasicProps(hasAvatar, hasParagraph) {
if (!hasAvatar && hasParagraph) return { width: "38%" };
if (hasAvatar && hasParagraph) return { width: "50%" };
return {};
}
function getParagraphBasicProps(hasAvatar, hasTitle) {
const basicProps = {};
if (!hasAvatar || !hasTitle) basicProps.width = "61%";
if (!hasAvatar && hasTitle) basicProps.rows = 3;
else basicProps.rows = 2;
return basicProps;
}
var Skeleton = (props) => {
const { prefixCls: customizePrefixCls, loading, className, rootClassName, classNames, style, styles, children, avatar = false, title = true, paragraph = true, active, round } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("skeleton");
const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
const [hashId, cssVarCls] = style_default$57(prefixCls);
const mergedProps = {
...props,
avatar,
title,
paragraph
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
if (loading || !("loading" in props)) {
const hasAvatar = !!avatar;
const hasTitle = !!title;
const hasParagraph = !!paragraph;
let avatarNode;
if (hasAvatar) {
const avatarProps = {
className: mergedClassNames.avatar,
prefixCls: `${prefixCls}-avatar`,
...getAvatarBasicProps(hasTitle, hasParagraph),
...getComponentProps(avatar),
style: mergedStyles.avatar
};
avatarNode = /* @__PURE__ */ import_react.createElement("div", {
className: clsx(mergedClassNames.header, `${prefixCls}-header`),
style: mergedStyles.header
}, /* @__PURE__ */ import_react.createElement(Element$1, { ...avatarProps }));
}
let contentNode;
if (hasTitle || hasParagraph) {
let $title;
if (hasTitle) {
const titleProps = {
className: mergedClassNames.title,
prefixCls: `${prefixCls}-title`,
...getTitleBasicProps(hasAvatar, hasParagraph),
...getComponentProps(title),
style: mergedStyles.title
};
$title = /* @__PURE__ */ import_react.createElement(Title$1, { ...titleProps });
}
let paragraphNode;
if (hasParagraph) {
const paragraphProps = {
className: mergedClassNames.paragraph,
prefixCls: `${prefixCls}-paragraph`,
...getParagraphBasicProps(hasAvatar, hasTitle),
...getComponentProps(paragraph),
style: mergedStyles.paragraph
};
paragraphNode = /* @__PURE__ */ import_react.createElement(Paragraph$1, { ...paragraphProps });
}
contentNode = /* @__PURE__ */ import_react.createElement("div", {
className: clsx(mergedClassNames.section, `${prefixCls}-section`),
style: mergedStyles.section
}, $title, paragraphNode);
}
const cls = clsx(prefixCls, {
[`${prefixCls}-with-avatar`]: hasAvatar,
[`${prefixCls}-active`]: active,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-round`]: round
}, mergedClassNames.root, contextClassName, className, rootClassName, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style: {
...mergedStyles.root,
...contextStyle,
...style
}
}, avatarNode, contentNode);
}
return children ?? null;
};
Skeleton.Button = SkeletonButton;
Skeleton.Avatar = SkeletonAvatar;
Skeleton.Input = SkeletonInput;
Skeleton.Image = SkeletonImage;
Skeleton.Node = SkeletonNode;
Skeleton.displayName = "Skeleton";
//#endregion
//#region node_modules/antd/es/skeleton/index.js
var skeleton_default = Skeleton;
//#endregion
//#region node_modules/antd/es/watermark/context.js
function voidFunc() {}
var WatermarkContext = /* @__PURE__ */ import_react.createContext({
add: voidFunc,
remove: voidFunc
});
function usePanelRef(panelSelector) {
const watermark = import_react.useContext(WatermarkContext);
const panelEleRef = import_react.useRef(null);
return useEvent((ele) => {
if (ele) {
const innerContentEle = panelSelector ? ele.querySelector(panelSelector) : ele;
if (innerContentEle) {
watermark.add(innerContentEle);
panelEleRef.current = innerContentEle;
}
} else watermark.remove(panelEleRef.current);
});
}
//#endregion
//#region node_modules/antd/es/modal/components/NormalCancelBtn.js
var NormalCancelBtn = () => {
const { cancelButtonProps, cancelTextLocale, onCancel } = (0, import_react.useContext)(ModalContext);
return /* @__PURE__ */ import_react.createElement(Button, {
onClick: onCancel,
...cancelButtonProps
}, cancelTextLocale);
};
//#endregion
//#region node_modules/antd/es/modal/components/NormalOkBtn.js
var NormalOkBtn = () => {
const { confirmLoading, okButtonProps, okType, okTextLocale, onOk } = (0, import_react.useContext)(ModalContext);
return /* @__PURE__ */ import_react.createElement(Button, {
...convertLegacyProps(okType),
loading: confirmLoading,
onClick: onOk,
...okButtonProps
}, okTextLocale);
};
//#endregion
//#region node_modules/antd/es/modal/shared.js
function renderCloseIcon(prefixCls, closeIcon) {
return /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-close-x` }, closeIcon || /* @__PURE__ */ import_react.createElement(RefIcon, { className: `${prefixCls}-close-icon` }));
}
var Footer$4 = (props) => {
const { okText, okType = "primary", cancelText, confirmLoading, onOk, onCancel, okButtonProps, cancelButtonProps, footer } = props;
const [locale] = useLocale$1("Modal", getConfirmLocale());
const okTextLocale = okText || locale?.okText;
const cancelTextLocale = cancelText || locale?.cancelText;
const memoizedValue = import_react.useMemo(() => {
return {
confirmLoading,
okButtonProps,
cancelButtonProps,
okTextLocale,
cancelTextLocale,
okType,
onOk,
onCancel
};
}, [
confirmLoading,
okButtonProps,
cancelButtonProps,
okTextLocale,
cancelTextLocale,
okType,
onOk,
onCancel
]);
let footerNode;
if (typeof footer === "function" || typeof footer === "undefined") {
footerNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(NormalCancelBtn, null), /* @__PURE__ */ import_react.createElement(NormalOkBtn, null));
if (typeof footer === "function") footerNode = footer(footerNode, {
OkBtn: NormalOkBtn,
CancelBtn: NormalCancelBtn
});
footerNode = /* @__PURE__ */ import_react.createElement(ModalContextProvider, { value: memoizedValue }, footerNode);
} else footerNode = footer;
return /* @__PURE__ */ import_react.createElement(DisabledContextProvider, { disabled: false }, footerNode);
};
//#endregion
//#region node_modules/antd/es/grid/style/index.js
var genGridRowStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
display: "flex",
flexFlow: "row wrap",
minWidth: 0,
"&::before, &::after": { display: "flex" },
"&-no-wrap": { flexWrap: "nowrap" },
"&-start": { justifyContent: "flex-start" },
"&-center": { justifyContent: "center" },
"&-end": { justifyContent: "flex-end" },
"&-space-between": { justifyContent: "space-between" },
"&-space-around": { justifyContent: "space-around" },
"&-space-evenly": { justifyContent: "space-evenly" },
"&-top": { alignItems: "flex-start" },
"&-middle": { alignItems: "center" },
"&-bottom": { alignItems: "flex-end" }
} };
};
var genGridColStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
position: "relative",
maxWidth: "100%",
minHeight: 1
} };
};
var genLoopGridColumnsStyle = (token, sizeCls) => {
const { componentCls, gridColumns, antCls } = token;
const [gridVarName, gridVarRef] = genCssVar(antCls, "grid");
const [, colVarRef] = genCssVar(antCls, "col");
const gridColumnsStyle = {};
for (let i = gridColumns; i >= 0; i--) if (i === 0) {
gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = { display: "none" };
gridColumnsStyle[`${componentCls}-push-${i}`] = { insetInlineStart: "auto" };
gridColumnsStyle[`${componentCls}-pull-${i}`] = { insetInlineEnd: "auto" };
gridColumnsStyle[`${componentCls}${sizeCls}-push-${i}`] = { insetInlineStart: "auto" };
gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i}`] = { insetInlineEnd: "auto" };
gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = { marginInlineStart: 0 };
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = { order: 0 };
} else {
gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = [{
[gridVarName("display")]: "block",
display: "block"
}, {
display: gridVarRef("display"),
flex: `0 0 ${i / gridColumns * 100}%`,
maxWidth: `${i / gridColumns * 100}%`
}];
gridColumnsStyle[`${componentCls}${sizeCls}-push-${i}`] = { insetInlineStart: `${i / gridColumns * 100}%` };
gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i}`] = { insetInlineEnd: `${i / gridColumns * 100}%` };
gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = { marginInlineStart: `${i / gridColumns * 100}%` };
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = { order: i };
}
gridColumnsStyle[`${componentCls}${sizeCls}-flex`] = { flex: colVarRef(`${sizeCls.replace(/-/, "")}-flex`) };
return gridColumnsStyle;
};
var genGridStyle = (token, sizeCls) => genLoopGridColumnsStyle(token, sizeCls);
var genGridMediaStyle = (token, screenSize, sizeCls) => ({ [`@media (min-width: ${unit$1(screenSize)})`]: { ...genGridStyle(token, sizeCls) } });
var prepareRowComponentToken = () => ({});
var prepareColComponentToken = () => ({});
var useRowStyle = genStyleHooks("Grid", genGridRowStyle, prepareRowComponentToken);
var getMediaSize = (token) => {
return {
xs: token.screenXSMin,
sm: token.screenSMMin,
md: token.screenMDMin,
lg: token.screenLGMin,
xl: token.screenXLMin,
xxl: token.screenXXLMin,
xxxl: token.screenXXXLMin
};
};
var useColStyle = genStyleHooks("Grid", (token) => {
const gridToken = merge(token, { gridColumns: 24 });
const gridMediaSizesMap = getMediaSize(gridToken);
delete gridMediaSizesMap.xs;
return [
genGridColStyle(gridToken),
genGridStyle(gridToken, ""),
genGridStyle(gridToken, "-xs"),
Object.keys(gridMediaSizesMap).map((key) => genGridMediaStyle(gridToken, gridMediaSizesMap[key], `-${key}`)).reduce((pre, cur) => ({
...pre,
...cur
}), {})
];
}, prepareColComponentToken);
//#endregion
//#region node_modules/antd/es/modal/style/index.js
function box(position) {
return {
position,
inset: 0
};
}
var genModalMaskStyle = (token) => {
const { componentCls, antCls } = token;
return [{ [`${componentCls}-root`]: {
[`${componentCls}${antCls}-zoom-enter, ${componentCls}${antCls}-zoom-appear`]: {
transform: "none",
opacity: 0,
animationDuration: token.motionDurationSlow,
userSelect: "none"
},
[`${componentCls}${antCls}-zoom-leave ${componentCls}-container`]: { pointerEvents: "none" },
[`${componentCls}-mask`]: {
...box("fixed"),
zIndex: token.zIndexPopupBase,
height: "100%",
backgroundColor: token.colorBgMask,
pointerEvents: "none",
[`&${componentCls}-mask-blur`]: { backdropFilter: "blur(4px)" },
[`${componentCls}-hidden`]: { display: "none" }
},
[`${componentCls}-wrap`]: {
...box("fixed"),
zIndex: token.zIndexPopupBase,
overflow: "auto",
outline: 0,
WebkitOverflowScrolling: "touch"
}
} }, { [`${componentCls}-root`]: initFadeMotion(token) }];
};
var genModalStyle = (token) => {
const { componentCls, motionDurationMid } = token;
return [
{ [`${componentCls}-root`]: {
[`${componentCls}-wrap-rtl`]: { direction: "rtl" },
[`${componentCls}-centered`]: {
textAlign: "center",
"&::before": {
display: "inline-block",
width: 0,
height: "100%",
verticalAlign: "middle",
content: "\"\""
},
[componentCls]: {
top: 0,
display: "inline-block",
paddingBottom: 0,
textAlign: "start",
verticalAlign: "middle"
}
},
[`@media (max-width: ${token.screenSMMax}px)`]: {
[componentCls]: {
maxWidth: "calc(100vw - 16px)",
margin: `${unit$1(token.marginXS)} auto`
},
[`${componentCls}-centered`]: { [componentCls]: { flex: 1 } }
}
} },
{ [componentCls]: {
...resetComponent(token),
pointerEvents: "none",
position: "relative",
top: 100,
width: "auto",
maxWidth: `calc(100vw - ${unit$1(token.calc(token.margin).mul(2).equal())})`,
margin: "0 auto",
"&:focus-visible": {
borderRadius: token.borderRadiusLG,
...genFocusOutline(token)
},
[`${componentCls}-title`]: {
margin: 0,
color: token.titleColor,
fontWeight: token.fontWeightStrong,
fontSize: token.titleFontSize,
lineHeight: token.titleLineHeight,
wordWrap: "break-word"
},
[`${componentCls}-container`]: {
position: "relative",
backgroundColor: token.contentBg,
backgroundClip: "padding-box",
border: 0,
borderRadius: token.borderRadiusLG,
boxShadow: token.boxShadow,
pointerEvents: "auto",
padding: token.contentPadding
},
[`${componentCls}-close`]: {
position: "absolute",
top: token.calc(token.modalHeaderHeight).sub(token.modalCloseBtnSize).div(2).equal(),
insetInlineEnd: token.calc(token.modalHeaderHeight).sub(token.modalCloseBtnSize).div(2).equal(),
zIndex: token.calc(token.zIndexPopupBase).add(10).equal(),
padding: 0,
color: token.modalCloseIconColor,
fontWeight: token.fontWeightStrong,
lineHeight: 1,
textDecoration: "none",
background: "transparent",
borderRadius: token.borderRadiusSM,
width: token.modalCloseBtnSize,
height: token.modalCloseBtnSize,
border: 0,
outline: 0,
cursor: "pointer",
transition: ["color", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
"&-x": {
display: "flex",
fontSize: token.fontSizeLG,
fontStyle: "normal",
lineHeight: unit$1(token.modalCloseBtnSize),
justifyContent: "center",
textTransform: "none",
textRendering: "auto"
},
"&:disabled": { pointerEvents: "none" },
"&:hover": {
color: token.modalCloseIconHoverColor,
backgroundColor: token.colorBgTextHover,
textDecoration: "none"
},
"&:active": { backgroundColor: token.colorBgTextActive },
...genFocusStyle(token)
},
[`${componentCls}-header`]: {
color: token.colorText,
background: token.headerBg,
borderRadius: `${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)} 0 0`,
marginBottom: token.headerMarginBottom,
padding: token.headerPadding,
borderBottom: token.headerBorderBottom
},
[`${componentCls}-body`]: {
fontSize: token.fontSize,
lineHeight: token.lineHeight,
wordWrap: "break-word",
padding: token.bodyPadding,
[`${componentCls}-body-skeleton`]: {
width: "100%",
height: "100%",
display: "flex",
justifyContent: "center",
alignItems: "center",
margin: `${unit$1(token.margin)} auto`
}
},
[`${componentCls}-footer`]: {
textAlign: "end",
background: token.footerBg,
marginTop: token.footerMarginTop,
padding: token.footerPadding,
borderTop: token.footerBorderTop,
borderRadius: token.footerBorderRadius,
[`> ${token.antCls}-btn + ${token.antCls}-btn`]: { marginInlineStart: token.marginXS }
},
[`${componentCls}-open`]: { overflow: "hidden" }
} },
{ [`${componentCls}-pure-panel`]: {
top: "auto",
padding: 0,
display: "flex",
flexDirection: "column",
[`${componentCls}-container,
${componentCls}-body,
${componentCls}-confirm-body-wrapper`]: {
display: "flex",
flexDirection: "column",
flex: "auto"
},
[`${componentCls}-confirm-body`]: { marginBottom: "auto" }
} }
];
};
var genRTLStyle$1 = (token) => {
const { componentCls } = token;
return { [`${componentCls}-root`]: { [`${componentCls}-wrap-rtl`]: {
direction: "rtl",
[`${componentCls}-confirm-body`]: { direction: "rtl" }
} } };
};
var genResponsiveWidthStyle = (token) => {
const { componentCls } = token;
const oriGridMediaSizesMap = getMediaSize(token);
const gridMediaSizesMap = { ...oriGridMediaSizesMap };
delete gridMediaSizesMap.xs;
const cssVarPrefix = `--${componentCls.replace(".", "")}-`;
const responsiveStyles = Object.keys(gridMediaSizesMap).map((key) => ({ [`@media (min-width: ${unit$1(gridMediaSizesMap[key])})`]: { width: `var(${cssVarPrefix}${key}-width)` } }));
return { [`${componentCls}-root`]: { [componentCls]: [].concat(_toConsumableArray$8(Object.keys(oriGridMediaSizesMap).map((currentKey, index) => {
const previousKey = Object.keys(oriGridMediaSizesMap)[index - 1];
return previousKey ? { [`${cssVarPrefix}${currentKey}-width`]: `var(${cssVarPrefix}${previousKey}-width)` } : null;
})), [{ width: `var(${cssVarPrefix}xs-width)` }], _toConsumableArray$8(responsiveStyles)) } };
};
var prepareToken$4 = (token) => {
const headerPaddingVertical = token.padding;
const headerFontSize = token.fontSizeHeading5;
const headerLineHeight = token.lineHeightHeading5;
return merge(token, {
modalHeaderHeight: token.calc(token.calc(headerLineHeight).mul(headerFontSize).equal()).add(token.calc(headerPaddingVertical).mul(2).equal()).equal(),
modalFooterBorderColorSplit: token.colorSplit,
modalFooterBorderStyle: token.lineType,
modalFooterBorderWidth: token.lineWidth,
modalCloseIconColor: token.colorIcon,
modalCloseIconHoverColor: token.colorIconHover,
modalCloseBtnSize: token.controlHeight,
modalConfirmIconSize: token.fontHeight,
modalTitleHeight: token.calc(token.titleFontSize).mul(token.titleLineHeight).equal()
});
};
var prepareComponentToken$50 = (token) => ({
footerBg: "transparent",
headerBg: "transparent",
titleLineHeight: token.lineHeightHeading5,
titleFontSize: token.fontSizeHeading5,
contentBg: token.colorBgElevated,
titleColor: token.colorTextHeading,
contentPadding: token.wireframe ? 0 : `${unit$1(token.paddingMD)} ${unit$1(token.paddingContentHorizontalLG)}`,
headerPadding: token.wireframe ? `${unit$1(token.padding)} ${unit$1(token.paddingLG)}` : 0,
headerBorderBottom: token.wireframe ? `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}` : "none",
headerMarginBottom: token.wireframe ? 0 : token.marginXS,
bodyPadding: token.wireframe ? token.paddingLG : 0,
footerPadding: token.wireframe ? `${unit$1(token.paddingXS)} ${unit$1(token.padding)}` : 0,
footerBorderTop: token.wireframe ? `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}` : "none",
footerBorderRadius: token.wireframe ? `0 0 ${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)}` : 0,
footerMarginTop: token.wireframe ? 0 : token.marginSM,
confirmBodyPadding: token.wireframe ? `${unit$1(token.padding * 2)} ${unit$1(token.padding * 2)} ${unit$1(token.paddingLG)}` : 0,
confirmIconMarginInlineEnd: token.wireframe ? token.margin : token.marginSM,
confirmBtnsMarginTop: token.wireframe ? token.marginLG : token.marginSM,
mask: true
});
var style_default$56 = genStyleHooks("Modal", (token) => {
const modalToken = prepareToken$4(token);
return [
genModalStyle(modalToken),
genRTLStyle$1(modalToken),
genModalMaskStyle(modalToken),
initZoomMotion(modalToken, "zoom"),
genResponsiveWidthStyle(modalToken)
];
}, prepareComponentToken$50, { unitless: { titleLineHeight: true } });
//#endregion
//#region node_modules/antd/es/modal/Modal.js
var mousePosition;
var getClickPosition = (e) => {
mousePosition = {
x: e.pageX,
y: e.pageY
};
setTimeout(() => {
mousePosition = null;
}, 100);
};
if (canUseDocElement()) document.documentElement.addEventListener("click", getClickPosition, true);
var Modal$1 = (props) => {
const { prefixCls: customizePrefixCls, className, rootClassName, open, wrapClassName, centered, getContainer, style, width = 520, footer, classNames, styles, children, loading, confirmLoading, zIndex: customizeZIndex, mousePosition: customizeMousePosition, onOk, onCancel, okButtonProps, cancelButtonProps, destroyOnHidden, destroyOnClose, panelRef = null, closable, mask: modalMask, modalRender, maskClosable, focusTriggerAfterClose, focusable, ...restProps } = props;
const { getPopupContainer: getContextPopupContainer, getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, centered: contextCentered, cancelButtonProps: contextCancelButtonProps, okButtonProps: contextOkButtonProps, mask: contextMask } = useComponentConfig("modal");
const { modal: modalContext } = import_react.useContext(ConfigContext);
const [closableAfterClose, onClose] = import_react.useMemo(() => {
if (typeof closable === "boolean") return [void 0, void 0];
return [closable?.afterClose, closable?.onClose];
}, [closable]);
const prefixCls = getPrefixCls("modal", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const [mergedMask, maskBlurClassName, mergeMaskClosable] = useMergedMask(modalMask, contextMask, prefixCls, maskClosable);
const mergedFocusable = useFocusable$1(focusable, mergedMask, focusTriggerAfterClose);
const handleCancel = (e) => {
if (confirmLoading) return;
onCancel?.(e);
onClose?.();
};
const handleOk = (e) => {
onOk?.(e);
onClose?.();
};
{
const warning = devUseWarning("Modal");
[
["bodyStyle", "styles.body"],
["maskStyle", "styles.mask"],
["destroyOnClose", "destroyOnHidden"],
["autoFocusButton", "focusable.autoFocusButton"],
["focusTriggerAfterClose", "focusable.focusTriggerAfterClose"],
["maskClosable", "mask.closable"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$56(prefixCls, rootCls);
const wrapClassNameExtended = clsx(wrapClassName, {
[`${prefixCls}-centered`]: centered ?? contextCentered,
[`${prefixCls}-wrap-rtl`]: direction === "rtl"
});
const dialogFooter = footer !== null && !loading ? /* @__PURE__ */ import_react.createElement(Footer$4, {
...props,
okButtonProps: {
...contextOkButtonProps,
...okButtonProps
},
onOk: handleOk,
cancelButtonProps: {
...contextCancelButtonProps,
...cancelButtonProps
},
onCancel: handleCancel
}) : null;
const [rawClosable, mergedCloseIcon, closeBtnIsDisabled, ariaProps] = useClosable$1(pickClosable(props), pickClosable(modalContext), {
closable: true,
closeIcon: /* @__PURE__ */ import_react.createElement(RefIcon, { className: `${prefixCls}-close-icon` }),
closeIconRender: (icon) => renderCloseIcon(prefixCls, icon)
});
const mergedClosable = rawClosable ? {
disabled: closeBtnIsDisabled,
closeIcon: mergedCloseIcon,
afterClose: closableAfterClose,
...ariaProps
} : false;
const mergedModalRender = modalRender ? (node) => /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-render` }, modalRender(node)) : void 0;
const mergedPanelRef = composeRef(panelRef, usePanelRef(`.${prefixCls}-${modalRender ? "render" : "container"}`));
const [zIndex, contextZIndex] = useZIndex("Modal", customizeZIndex);
const mergedProps = {
...props,
width,
panelRef,
focusTriggerAfterClose: mergedFocusable.focusTriggerAfterClose,
focusable: mergedFocusable,
mask: mergedMask,
maskClosable: mergeMaskClosable,
zIndex
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([
contextClassNames,
classNames,
maskBlurClassName
], [contextStyles, styles], { props: mergedProps });
const [numWidth, responsiveWidth] = import_react.useMemo(() => {
if (isPlainObject(width)) return [void 0, width];
return [width, void 0];
}, [width]);
const responsiveWidthVars = import_react.useMemo(() => {
const vars = {};
if (responsiveWidth) Object.keys(responsiveWidth).forEach((breakpoint) => {
const breakpointWidth = responsiveWidth[breakpoint];
if (isNonNullable(breakpointWidth)) vars[`--${prefixCls}-${breakpoint}-width`] = isNumber(breakpointWidth) ? `${breakpointWidth}px` : breakpointWidth;
});
return vars;
}, [prefixCls, responsiveWidth]);
return /* @__PURE__ */ import_react.createElement(ContextIsolator, {
form: true,
space: true
}, /* @__PURE__ */ import_react.createElement(ZIndexContext.Provider, { value: contextZIndex }, /* @__PURE__ */ import_react.createElement(es_default$23, {
width: numWidth,
...restProps,
zIndex,
getContainer: getContainer === void 0 ? getContextPopupContainer : getContainer,
prefixCls,
rootClassName: clsx(hashId, rootClassName, cssVarCls, rootCls, mergedClassNames.root),
rootStyle: mergedStyles.root,
footer: dialogFooter,
visible: open,
mousePosition: customizeMousePosition ?? mousePosition,
onClose: handleCancel,
closable: mergedClosable,
closeIcon: mergedCloseIcon,
transitionName: getTransitionName(rootPrefixCls, "zoom", props.transitionName),
maskTransitionName: getTransitionName(rootPrefixCls, "fade", props.maskTransitionName),
mask: mergedMask,
maskClosable: mergeMaskClosable,
className: clsx(hashId, className, contextClassName),
style: {
...contextStyle,
...style,
...responsiveWidthVars
},
classNames: {
...mergedClassNames,
wrapper: clsx(mergedClassNames.wrapper, wrapClassNameExtended)
},
styles: mergedStyles,
panelRef: mergedPanelRef,
destroyOnHidden: destroyOnHidden ?? destroyOnClose,
modalRender: mergedModalRender,
focusTriggerAfterClose: mergedFocusable.focusTriggerAfterClose,
focusTrap: mergedFocusable.trap
}, loading ? /* @__PURE__ */ import_react.createElement(skeleton_default, {
active: true,
title: false,
paragraph: { rows: 4 },
className: `${prefixCls}-body-skeleton`
}) : children)));
};
//#endregion
//#region node_modules/antd/es/modal/style/confirm.js
var genModalConfirmStyle = (token) => {
const { componentCls, titleFontSize, titleLineHeight, modalConfirmIconSize, fontSize, lineHeight, modalTitleHeight, fontHeight, confirmBodyPadding } = token;
const confirmComponentCls = `${componentCls}-confirm`;
return {
[confirmComponentCls]: {
"&-rtl": { direction: "rtl" },
[`${token.antCls}-modal-header`]: { display: "none" },
[`${confirmComponentCls}-body-wrapper`]: { ...clearFix() },
[`&${componentCls} ${componentCls}-body`]: { padding: confirmBodyPadding },
[`${confirmComponentCls}-body`]: {
display: "flex",
flexWrap: "nowrap",
alignItems: "start",
[`> ${token.iconCls}`]: {
flex: "none",
fontSize: modalConfirmIconSize,
marginInlineEnd: token.confirmIconMarginInlineEnd,
marginTop: token.calc(token.calc(fontHeight).sub(modalConfirmIconSize).equal()).div(2).equal()
},
[`&-has-title > ${token.iconCls}`]: { marginTop: token.calc(token.calc(modalTitleHeight).sub(modalConfirmIconSize).equal()).div(2).equal() }
},
[`${confirmComponentCls}-paragraph`]: {
display: "flex",
flexDirection: "column",
flex: "auto",
rowGap: token.marginXS,
maxWidth: `calc(100% - ${unit$1(token.marginSM)})`
},
[`${confirmComponentCls}-body-no-icon ${confirmComponentCls}-paragraph`]: { maxWidth: "100%" },
[`${token.iconCls} + ${confirmComponentCls}-paragraph`]: { maxWidth: `calc(100% - ${unit$1(token.calc(token.modalConfirmIconSize).add(token.marginSM).equal())})` },
[`${confirmComponentCls}-title`]: {
color: token.colorTextHeading,
fontWeight: token.fontWeightStrong,
fontSize: titleFontSize,
lineHeight: titleLineHeight
},
[`${confirmComponentCls}-container`]: {
color: token.colorText,
fontSize,
lineHeight
},
[`${confirmComponentCls}-btns`]: {
textAlign: "end",
marginTop: token.confirmBtnsMarginTop,
[`${token.antCls}-btn + ${token.antCls}-btn`]: {
marginBottom: 0,
marginInlineStart: token.marginXS
}
}
},
[`${confirmComponentCls}-error ${confirmComponentCls}-body > ${token.iconCls}`]: { color: token.colorError },
[`${confirmComponentCls}-warning ${confirmComponentCls}-body > ${token.iconCls},
${confirmComponentCls}-confirm ${confirmComponentCls}-body > ${token.iconCls}`]: { color: token.colorWarning },
[`${confirmComponentCls}-info ${confirmComponentCls}-body > ${token.iconCls}`]: { color: token.colorInfo },
[`${confirmComponentCls}-success ${confirmComponentCls}-body > ${token.iconCls}`]: { color: token.colorSuccess }
};
};
var confirm_default = genSubStyleComponent(["Modal", "confirm"], (token) => {
return genModalConfirmStyle(prepareToken$4(token));
}, prepareComponentToken$50, { order: -1e3 });
//#endregion
//#region node_modules/antd/es/modal/ConfirmDialog.js
var ConfirmContent = (props) => {
const { prefixCls, icon, okText, cancelText, confirmPrefixCls, type, okCancel, footer, locale: staticLocale, autoFocusButton, focusable, ...restProps } = props;
devUseWarning("Modal")(!(typeof icon === "string" && icon.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`);
let mergedIcon = icon;
if (!icon && icon !== null) switch (type) {
case "info":
mergedIcon = /* @__PURE__ */ import_react.createElement(RefIcon$2, null);
break;
case "success":
mergedIcon = /* @__PURE__ */ import_react.createElement(RefIcon$1, null);
break;
case "error":
mergedIcon = /* @__PURE__ */ import_react.createElement(RefIcon$3, null);
break;
default: mergedIcon = /* @__PURE__ */ import_react.createElement(RefIcon$4, null);
}
const mergedOkCancel = okCancel ?? type === "confirm";
const mergedAutoFocusButton = import_react.useMemo(() => {
const base = focusable?.autoFocusButton || autoFocusButton;
return base || base === null ? base : "ok";
}, [autoFocusButton, focusable?.autoFocusButton]);
const [locale] = useLocale$1("Modal");
const mergedLocale = staticLocale || locale;
const okTextLocale = okText || (mergedOkCancel ? mergedLocale?.okText : mergedLocale?.justOkText);
const cancelTextLocale = cancelText || mergedLocale?.cancelText;
const { closable } = restProps;
const { onClose } = isPlainObject(closable) ? closable : {};
const memoizedValue = import_react.useMemo(() => {
return {
autoFocusButton: mergedAutoFocusButton,
cancelTextLocale,
okTextLocale,
mergedOkCancel,
onClose,
...restProps
};
}, [
mergedAutoFocusButton,
cancelTextLocale,
okTextLocale,
mergedOkCancel,
onClose,
restProps
]);
const footerOriginNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(ConfirmCancelBtn, null), /* @__PURE__ */ import_react.createElement(ConfirmOkBtn, null));
const hasTitle = isNonNullable(props.title) && props.title !== "";
const hasIcon = isNonNullable(mergedIcon);
const bodyCls = `${confirmPrefixCls}-body`;
return /* @__PURE__ */ import_react.createElement("div", { className: `${confirmPrefixCls}-body-wrapper` }, /* @__PURE__ */ import_react.createElement("div", { className: clsx(bodyCls, {
[`${bodyCls}-has-title`]: hasTitle,
[`${bodyCls}-no-icon`]: !hasIcon
}) }, mergedIcon, /* @__PURE__ */ import_react.createElement("div", { className: `${confirmPrefixCls}-paragraph` }, hasTitle && /* @__PURE__ */ import_react.createElement("span", { className: `${confirmPrefixCls}-title` }, props.title), /* @__PURE__ */ import_react.createElement("div", { className: `${confirmPrefixCls}-content` }, props.content))), footer === void 0 || typeof footer === "function" ? /* @__PURE__ */ import_react.createElement(ModalContextProvider, { value: memoizedValue }, /* @__PURE__ */ import_react.createElement("div", { className: `${confirmPrefixCls}-btns` }, typeof footer === "function" ? footer(footerOriginNode, {
OkBtn: ConfirmOkBtn,
CancelBtn: ConfirmCancelBtn
}) : footerOriginNode)) : footer, /* @__PURE__ */ import_react.createElement(confirm_default, { prefixCls }));
};
var ConfirmDialog = (props) => {
const { close, zIndex, maskStyle, direction, prefixCls, wrapClassName, rootPrefixCls, bodyStyle, closable = false, onConfirm, styles, title, mask, maskClosable, okButtonProps, cancelButtonProps } = props;
const { cancelButtonProps: contextCancelButtonProps, okButtonProps: contextOkButtonProps } = useComponentConfig("modal");
{
const warning = devUseWarning("Modal");
[["bodyStyle", "styles.body"], ["maskStyle", "styles.mask"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const confirmPrefixCls = `${prefixCls}-confirm`;
const width = props.width || 416;
const style = props.style || {};
const classString = clsx(confirmPrefixCls, `${confirmPrefixCls}-${props.type}`, { [`${confirmPrefixCls}-rtl`]: direction === "rtl" }, props.className);
const mergedMask = import_react.useMemo(() => {
const nextMaskConfig = normalizeMaskConfig(mask, maskClosable);
nextMaskConfig.closable ?? (nextMaskConfig.closable = false);
return nextMaskConfig;
}, [mask, maskClosable]);
const [, token] = useToken$1();
const mergedZIndex = import_react.useMemo(() => {
if (zIndex !== void 0) return zIndex;
return token.zIndexPopupBase + CONTAINER_MAX_OFFSET;
}, [zIndex, token]);
return /* @__PURE__ */ import_react.createElement(Modal$1, {
...props,
className: classString,
wrapClassName: clsx({ [`${confirmPrefixCls}-centered`]: !!props.centered }, wrapClassName),
onCancel: () => {
close?.({ triggerCancel: true });
onConfirm?.(false);
},
title,
footer: null,
transitionName: getTransitionName(rootPrefixCls || "", "zoom", props.transitionName),
maskTransitionName: getTransitionName(rootPrefixCls || "", "fade", props.maskTransitionName),
mask: mergedMask,
style,
styles: {
body: bodyStyle,
mask: maskStyle,
...styles
},
width,
zIndex: mergedZIndex,
closable
}, /* @__PURE__ */ import_react.createElement(ConfirmContent, {
...props,
confirmPrefixCls,
okButtonProps: {
...contextOkButtonProps,
...okButtonProps
},
cancelButtonProps: {
...contextCancelButtonProps,
...cancelButtonProps
}
}));
};
var ConfirmDialogWrapper$1 = (props) => {
const { rootPrefixCls, iconPrefixCls, direction, theme } = props;
return /* @__PURE__ */ import_react.createElement(ConfigProvider, {
prefixCls: rootPrefixCls,
iconPrefixCls,
direction,
theme
}, /* @__PURE__ */ import_react.createElement(ConfirmDialog, { ...props }));
};
ConfirmDialog.displayName = "ConfirmDialog";
ConfirmDialogWrapper$1.displayName = "ConfirmDialogWrapper";
//#endregion
//#region node_modules/antd/es/modal/destroyFns.js
var destroyFns = [];
//#endregion
//#region node_modules/antd/es/modal/confirm.js
var defaultRootPrefixCls = "";
function getRootPrefixCls() {
return defaultRootPrefixCls;
}
var ConfirmDialogWrapper = (props) => {
const { prefixCls: customizePrefixCls, getContainer, direction } = props;
const runtimeLocale = getConfirmLocale();
const config = (0, import_react.useContext)(ConfigContext);
const rootPrefixCls = getRootPrefixCls() || config.getPrefixCls();
const prefixCls = customizePrefixCls || `${rootPrefixCls}-modal`;
let mergedGetContainer = getContainer;
if (mergedGetContainer === false) {
mergedGetContainer = void 0;
warning$1(false, "Modal", "Static method not support `getContainer` to be `false` since it do not have context env.");
}
return /* @__PURE__ */ import_react.createElement(ConfirmDialogWrapper$1, {
...props,
rootPrefixCls,
prefixCls,
iconPrefixCls: config.iconPrefixCls,
theme: config.theme,
direction: direction ?? config.direction,
locale: config.locale?.Modal ?? runtimeLocale,
getContainer: mergedGetContainer
});
};
function confirm(config) {
const global = globalConfig();
if (!global.holderRender) warnContext("Modal");
const container = document.createDocumentFragment();
let currentConfig = {
...config,
close,
open: true
};
let timeoutId;
function destroy(...args) {
if (args.some((param) => param?.triggerCancel)) config.onCancel?.(() => {}, ...args.slice(1));
for (let i = 0; i < destroyFns.length; i++) if (destroyFns[i] === close) {
destroyFns.splice(i, 1);
break;
}
unmount(container).then(() => {});
}
const scheduleRender = (props) => {
clearTimeout(timeoutId);
/**
* https://github.com/ant-design/ant-design/issues/23623
*
* Sync render blocks React event. Let's make this async.
*/
timeoutId = setTimeout(() => {
const rootPrefixCls = global.getPrefixCls(void 0, getRootPrefixCls());
const iconPrefixCls = global.getIconPrefixCls();
const theme = global.getTheme();
const dom = /* @__PURE__ */ import_react.createElement(ConfirmDialogWrapper, { ...props });
render(/* @__PURE__ */ import_react.createElement(ConfigProvider, {
prefixCls: rootPrefixCls,
iconPrefixCls,
theme
}, typeof global.holderRender === "function" ? global.holderRender(dom) : dom), container);
});
};
function close(...args) {
currentConfig = {
...currentConfig,
open: false,
afterClose: () => {
if (typeof config.afterClose === "function") config.afterClose();
destroy.apply(this, args);
}
};
scheduleRender(currentConfig);
}
function update(configUpdate) {
if (typeof configUpdate === "function") currentConfig = configUpdate(currentConfig);
else currentConfig = {
...currentConfig,
...configUpdate
};
scheduleRender(currentConfig);
}
scheduleRender(currentConfig);
destroyFns.push(close);
return {
destroy: close,
update
};
}
function withWarn(props) {
return {
...props,
type: "warning"
};
}
function withInfo(props) {
return {
...props,
type: "info"
};
}
function withSuccess(props) {
return {
...props,
type: "success"
};
}
function withError(props) {
return {
...props,
type: "error"
};
}
function withConfirm(props) {
return {
...props,
type: "confirm"
};
}
function modalGlobalConfig({ rootPrefixCls }) {
warning$1(false, "Modal", "Modal.config is deprecated. Please use ConfigProvider.config instead.");
defaultRootPrefixCls = rootPrefixCls;
}
//#endregion
//#region node_modules/antd/es/modal/useModal/HookModal.js
var HookModal = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { afterClose: hookAfterClose, config, ...restProps } = props;
const [open, setOpen] = import_react.useState(true);
const [innerConfig, setInnerConfig] = import_react.useState(config);
const { direction, getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("modal");
const rootPrefixCls = getPrefixCls();
const afterClose = () => {
hookAfterClose();
innerConfig.afterClose?.();
};
const close = (...args) => {
setOpen(false);
if (args.some((param) => param?.triggerCancel)) innerConfig.onCancel?.(() => {}, ...args.slice(1));
};
import_react.useImperativeHandle(ref, () => ({
destroy: close,
update: (newConfig) => {
setInnerConfig((originConfig) => {
const nextConfig = typeof newConfig === "function" ? newConfig(originConfig) : newConfig;
return {
...originConfig,
...nextConfig
};
});
}
}));
const mergedOkCancel = innerConfig.okCancel ?? innerConfig.type === "confirm";
const [contextLocale] = useLocale$1("Modal", localeValues.Modal);
return /* @__PURE__ */ import_react.createElement(ConfirmDialogWrapper$1, {
prefixCls,
rootPrefixCls,
...innerConfig,
close,
open,
afterClose,
okText: innerConfig.okText || (mergedOkCancel ? contextLocale?.okText : contextLocale?.justOkText),
direction: innerConfig.direction || direction,
cancelText: innerConfig.cancelText || contextLocale?.cancelText,
...restProps
});
});
//#endregion
//#region node_modules/antd/es/modal/useModal/index.js
var uuid$1 = 0;
var ElementsHolder = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef((_props, ref) => {
const [elements, patchElement] = usePatchElement();
import_react.useImperativeHandle(ref, () => ({ patchElement }), [patchElement]);
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, elements);
}));
function useModal() {
const holderRef = import_react.useRef(null);
const [actionQueue, setActionQueue] = import_react.useState([]);
import_react.useEffect(() => {
if (actionQueue.length) {
_toConsumableArray$8(actionQueue).forEach((action) => {
action();
});
setActionQueue([]);
}
}, [actionQueue]);
const getConfirmFunc = import_react.useCallback((withFunc) => function hookConfirm(config) {
uuid$1 += 1;
const modalRef = /* @__PURE__ */ import_react.createRef();
let resolvePromise;
const promise = new Promise((resolve) => {
resolvePromise = resolve;
});
let silent = false;
let closeFunc;
const modal = /* @__PURE__ */ import_react.createElement(HookModal, {
key: `modal-${uuid$1}`,
config: withFunc(config),
ref: modalRef,
afterClose: () => {
closeFunc?.();
},
isSilent: () => silent,
onConfirm: (confirmed) => {
resolvePromise(confirmed);
}
});
closeFunc = holderRef.current?.patchElement(modal);
if (closeFunc) destroyFns.push(closeFunc);
return {
destroy: () => {
function destroyAction() {
modalRef.current?.destroy();
}
if (modalRef.current) destroyAction();
else setActionQueue((prev) => [].concat(_toConsumableArray$8(prev), [destroyAction]));
},
update: (newConfig) => {
function updateAction() {
modalRef.current?.update(newConfig);
}
if (modalRef.current) updateAction();
else setActionQueue((prev) => [].concat(_toConsumableArray$8(prev), [updateAction]));
},
then: (resolve) => {
silent = true;
return promise.then(resolve);
}
};
}, []);
return [import_react.useMemo(() => ({
info: getConfirmFunc(withInfo),
success: getConfirmFunc(withSuccess),
error: getConfirmFunc(withError),
warning: getConfirmFunc(withWarn),
confirm: getConfirmFunc(withConfirm)
}), [getConfirmFunc]), /* @__PURE__ */ import_react.createElement(ElementsHolder, {
key: "modal-holder",
ref: holderRef
})];
}
//#endregion
//#region node_modules/antd/es/notification/style/placement.js
var genNotificationPlacementStyle = (token) => {
const { componentCls, notificationMarginEdge, animationMaxHeight } = token;
const noticeCls = `${componentCls}-notice`;
const rightFadeIn = new Keyframe("antNotificationFadeIn", {
"0%": {
transform: `translate3d(100%, 0, 0)`,
opacity: 0
},
"100%": {
transform: `translate3d(0, 0, 0)`,
opacity: 1
}
});
const topFadeIn = new Keyframe("antNotificationTopFadeIn", {
"0%": {
top: -animationMaxHeight,
opacity: 0
},
"100%": {
top: 0,
opacity: 1
}
});
const bottomFadeIn = new Keyframe("antNotificationBottomFadeIn", {
"0%": {
bottom: token.calc(animationMaxHeight).mul(-1).equal(),
opacity: 0
},
"100%": {
bottom: 0,
opacity: 1
}
});
const leftFadeIn = new Keyframe("antNotificationLeftFadeIn", {
"0%": {
transform: `translate3d(-100%, 0, 0)`,
opacity: 0
},
"100%": {
transform: `translate3d(0, 0, 0)`,
opacity: 1
}
});
return { [componentCls]: {
[`&${componentCls}-top, &${componentCls}-bottom`]: {
marginInline: 0,
[noticeCls]: { marginInline: "auto auto" }
},
[`&${componentCls}-top`]: { [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: topFadeIn } },
[`&${componentCls}-bottom`]: { [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: bottomFadeIn } },
[`&${componentCls}-topRight, &${componentCls}-bottomRight`]: { [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: rightFadeIn } },
[`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: {
marginRight: {
value: 0,
_skip_check_: true
},
marginLeft: {
value: notificationMarginEdge,
_skip_check_: true
},
[noticeCls]: {
marginInlineEnd: "auto",
marginInlineStart: 0
},
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationName: leftFadeIn }
}
} };
};
//#endregion
//#region node_modules/antd/es/notification/interface.js
var NotificationPlacements = [
"top",
"topLeft",
"topRight",
"bottom",
"bottomLeft",
"bottomRight"
];
//#endregion
//#region node_modules/antd/es/notification/style/stack.js
var placementAlignProperty = {
topLeft: "left",
topRight: "right",
bottomLeft: "left",
bottomRight: "right",
top: "left",
bottom: "left"
};
var genPlacementStackStyle = (token, placement) => {
const { componentCls } = token;
return { [`${componentCls}-${placement}`]: { [`&${componentCls}-stack > ${componentCls}-notice-wrapper`]: {
[placement.startsWith("top") ? "top" : "bottom"]: 0,
[placementAlignProperty[placement]]: {
value: 0,
_skip_check_: true
}
} } };
};
var genStackChildrenStyle = (token) => {
const childrenStyle = {};
for (let i = 1; i < token.notificationStackLayer; i++) childrenStyle[`&:nth-last-child(${i + 1})`] = {
overflow: "hidden",
[`& > ${token.componentCls}-notice`]: {
opacity: 0,
transition: `opacity ${token.motionDurationMid}`
}
};
return {
[`&:not(:nth-last-child(-n+${token.notificationStackLayer}))`]: {
opacity: 0,
overflow: "hidden",
color: "transparent",
pointerEvents: "none"
},
...childrenStyle
};
};
var genStackedNoticeStyle = (token) => {
const childrenStyle = {};
for (let i = 1; i < token.notificationStackLayer; i++) childrenStyle[`&:nth-last-child(${i + 1})`] = {
background: token.colorBgBlur,
backdropFilter: "blur(10px)",
"-webkit-backdrop-filter": "blur(10px)"
};
return childrenStyle;
};
var genStackStyle = (token) => {
const { componentCls } = token;
return {
[`${componentCls}-stack`]: { [`& > ${componentCls}-notice-wrapper`]: {
transition: `transform ${token.motionDurationSlow}, backdrop-filter 0s`,
willChange: "transform, opacity",
position: "absolute",
...genStackChildrenStyle(token)
} },
[`${componentCls}-stack:not(${componentCls}-stack-expanded)`]: { [`& > ${componentCls}-notice-wrapper`]: { ...genStackedNoticeStyle(token) } },
[`${componentCls}-stack${componentCls}-stack-expanded`]: { [`& > ${componentCls}-notice-wrapper`]: {
"&:not(:nth-last-child(-n + 1))": {
opacity: 1,
overflow: "unset",
color: "inherit",
pointerEvents: "auto",
[`& > ${token.componentCls}-notice`]: { opacity: 1 }
},
"&:after": {
content: "\"\"",
position: "absolute",
height: token.margin,
width: "100%",
insetInline: 0,
bottom: token.calc(token.margin).mul(-1).equal(),
background: "transparent",
pointerEvents: "auto"
}
} },
...NotificationPlacements.map((placement) => genPlacementStackStyle(token, placement)).reduce((acc, cur) => ({
...acc,
...cur
}), {})
};
};
//#endregion
//#region node_modules/antd/es/notification/style/index.js
var genNoticeStyle = (token) => {
const { iconCls, componentCls, boxShadow, fontSizeLG, notificationMarginBottom, borderRadiusLG, colorSuccess, colorInfo, colorWarning, colorError, colorTextHeading, notificationBg, notificationPadding, notificationMarginEdge, progressBg, notificationProgressHeight, fontSize, lineHeight, width, notificationIconSize, colorText, colorSuccessBg, colorErrorBg, colorInfoBg, colorWarningBg, motionDurationMid } = token;
const noticeCls = `${componentCls}-notice`;
return {
position: "relative",
marginBottom: notificationMarginBottom,
marginInlineStart: "auto",
background: notificationBg,
borderRadius: borderRadiusLG,
boxShadow,
[noticeCls]: {
padding: notificationPadding,
width,
maxWidth: `calc(100vw - ${unit$1(token.calc(notificationMarginEdge).mul(2).equal())})`,
lineHeight,
wordWrap: "break-word",
borderRadius: borderRadiusLG,
overflow: "hidden",
"&-success": colorSuccessBg ? { background: colorSuccessBg } : {},
"&-error": colorErrorBg ? { background: colorErrorBg } : {},
"&-info": colorInfoBg ? { background: colorInfoBg } : {},
"&-warning": colorWarningBg ? { background: colorWarningBg } : {}
},
[`${noticeCls}-title`]: {
marginBottom: token.marginXS,
color: colorTextHeading,
fontSize: fontSizeLG,
lineHeight: token.lineHeightLG
},
[`${noticeCls}-description`]: {
fontSize,
color: colorText,
marginTop: token.marginXS,
"&:first-child": {
marginTop: 0,
marginInlineEnd: token.marginSM
}
},
[`${noticeCls}-closable ${noticeCls}-title`]: { paddingInlineEnd: token.paddingLG },
[`${noticeCls}-with-icon ${noticeCls}-title`]: {
marginBottom: token.marginXS,
marginInlineStart: token.calc(token.marginSM).add(notificationIconSize).equal(),
fontSize: fontSizeLG
},
[`${noticeCls}-with-icon ${noticeCls}-description`]: {
marginInlineStart: token.calc(token.marginSM).add(notificationIconSize).equal(),
fontSize
},
[`${noticeCls}-icon`]: {
position: "absolute",
fontSize: notificationIconSize,
lineHeight: 1,
[`&-success${iconCls}`]: { color: colorSuccess },
[`&-info${iconCls}`]: { color: colorInfo },
[`&-warning${iconCls}`]: { color: colorWarning },
[`&-error${iconCls}`]: { color: colorError }
},
[`${noticeCls}-close`]: {
position: "absolute",
top: token.notificationPaddingVertical,
insetInlineEnd: token.notificationPaddingHorizontal,
color: token.colorIcon,
outline: "none",
width: token.notificationCloseButtonSize,
height: token.notificationCloseButtonSize,
borderRadius: token.borderRadiusSM,
transition: ["color", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
display: "flex",
alignItems: "center",
justifyContent: "center",
background: "none",
border: "none",
"&:hover": {
color: token.colorIconHover,
backgroundColor: token.colorBgTextHover
},
"&:active": { backgroundColor: token.colorBgTextActive },
...genFocusStyle(token)
},
[`${noticeCls}-progress`]: {
position: "absolute",
display: "block",
appearance: "none",
inlineSize: `calc(100% - ${unit$1(borderRadiusLG)} * 2)`,
left: {
_skip_check_: true,
value: borderRadiusLG
},
right: {
_skip_check_: true,
value: borderRadiusLG
},
bottom: 0,
blockSize: notificationProgressHeight,
border: 0,
"&, &::-webkit-progress-bar": {
borderRadius: borderRadiusLG,
backgroundColor: `rgba(0, 0, 0, 0.04)`
},
"&::-moz-progress-bar": { background: progressBg },
"&::-webkit-progress-value": {
borderRadius: borderRadiusLG,
background: progressBg
}
},
[`${noticeCls}-actions`]: {
float: "right",
marginTop: token.marginSM
}
};
};
var genNotificationStyle = (token) => {
const { componentCls, notificationMarginBottom, notificationMarginEdge, motionDurationMid, motionEaseInOut } = token;
const noticeCls = `${componentCls}-notice`;
const fadeOut = new Keyframe("antNotificationFadeOut", {
"0%": {
maxHeight: token.animationMaxHeight,
marginBottom: notificationMarginBottom
},
"100%": {
maxHeight: 0,
marginBottom: 0,
paddingTop: 0,
paddingBottom: 0,
opacity: 0
}
});
return [{ [componentCls]: {
...resetComponent(token),
position: "fixed",
zIndex: token.zIndexPopup,
marginRight: {
value: notificationMarginEdge,
_skip_check_: true
},
[`${componentCls}-hook-holder`]: { position: "relative" },
[`${componentCls}-fade-appear-prepare`]: { opacity: "0 !important" },
[`${componentCls}-fade-enter, ${componentCls}-fade-appear`]: {
animationDuration: token.motionDurationMid,
animationTimingFunction: motionEaseInOut,
animationFillMode: "both",
opacity: 0,
animationPlayState: "paused"
},
[`${componentCls}-fade-leave`]: {
animationTimingFunction: motionEaseInOut,
animationFillMode: "both",
animationDuration: motionDurationMid,
animationPlayState: "paused"
},
[`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: { animationPlayState: "running" },
[`${componentCls}-fade-leave${componentCls}-fade-leave-active`]: {
animationName: fadeOut,
animationPlayState: "running"
},
"&-rtl": {
direction: "rtl",
[`${noticeCls}-actions`]: { float: "left" }
}
} }, { [componentCls]: { [`${noticeCls}-wrapper`]: genNoticeStyle(token) } }];
};
var prepareComponentToken$49 = (token) => ({
zIndexPopup: token.zIndexPopupBase + CONTAINER_MAX_OFFSET + 50,
width: 384,
progressBg: `linear-gradient(90deg, ${token.colorPrimaryBorderHover}, ${token.colorPrimary})`,
colorSuccessBg: void 0,
colorErrorBg: void 0,
colorInfoBg: void 0,
colorWarningBg: void 0
});
var prepareNotificationToken = (token) => {
const notificationPaddingVertical = token.paddingMD;
const notificationPaddingHorizontal = token.paddingLG;
return merge(token, {
notificationBg: token.colorBgElevated,
notificationPaddingVertical,
notificationPaddingHorizontal,
notificationIconSize: token.calc(token.fontSizeLG).mul(token.lineHeightLG).equal(),
notificationCloseButtonSize: token.calc(token.controlHeightLG).mul(.55).equal(),
notificationMarginBottom: token.margin,
notificationPadding: `${unit$1(token.paddingMD)} ${unit$1(token.paddingContentHorizontalLG)}`,
notificationMarginEdge: token.marginLG,
animationMaxHeight: 150,
notificationStackLayer: 3,
notificationProgressHeight: 2
});
};
var style_default$55 = genStyleHooks("Notification", (token) => {
const notificationToken = prepareNotificationToken(token);
return [
genNotificationStyle(notificationToken),
genNotificationPlacementStyle(notificationToken),
genStackStyle(notificationToken)
];
}, prepareComponentToken$49);
//#endregion
//#region node_modules/antd/es/notification/style/pure-panel.js
var pure_panel_default = genSubStyleComponent(["Notification", "PurePanel"], (token) => {
const noticeCls = `${token.componentCls}-notice`;
const notificationToken = prepareNotificationToken(token);
return { [`${noticeCls}-pure-panel`]: {
...genNoticeStyle(notificationToken),
width: notificationToken.width,
maxWidth: `calc(100vw - ${unit$1(token.calc(notificationToken.notificationMarginEdge).mul(2).equal())})`,
margin: 0
} };
}, prepareComponentToken$49);
//#endregion
//#region node_modules/antd/es/notification/PurePanel.js
function getCloseIcon(prefixCls, closeIcon) {
if (closeIcon === null || closeIcon === false) return null;
return closeIcon || /* @__PURE__ */ import_react.createElement(RefIcon, { className: `${prefixCls}-close-icon` });
}
var typeToIcon = {
success: RefIcon$1,
info: RefIcon$2,
error: RefIcon$3,
warning: RefIcon$4
};
var PureContent = (props) => {
const { prefixCls, icon, type, title, description, actions, role = "alert", styles, classNames: pureContentCls } = props;
let iconNode = null;
if (icon) iconNode = /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-icon`, pureContentCls.icon),
style: styles.icon
}, icon);
else if (type) iconNode = /* @__PURE__ */ import_react.createElement(typeToIcon[type] || null, {
className: clsx(`${prefixCls}-icon`, pureContentCls.icon, `${prefixCls}-icon-${type}`),
style: styles.icon
});
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx({ [`${prefixCls}-with-icon`]: iconNode }),
role
}, iconNode, title && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, pureContentCls.title),
style: styles.title
}, title), description && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-description`, pureContentCls.description),
style: styles.description
}, description), actions && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-actions`, pureContentCls.actions),
style: styles.actions
}, actions));
};
/** @private Internal Component. Do not use in your production. */
var PurePanel$13 = (props) => {
const { prefixCls: staticPrefixCls, icon, type, message, title, description, btn, actions, closeIcon: _closeIcon, className: notificationClassName, style, styles, classNames: notificationClassNames, closable, ...restProps } = props;
const { getPrefixCls, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("notification");
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, notificationClassNames], [contextStyles, styles], { props });
const { notification: notificationContext } = import_react.useContext(ConfigContext);
const mergedActions = actions ?? btn;
{
const warning = devUseWarning("Notification");
[["btn", "actions"], ["message", "title"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const mergedTitle = title ?? message;
const prefixCls = staticPrefixCls || getPrefixCls("notification");
const noticePrefixCls = `${prefixCls}-notice`;
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$55(prefixCls, rootCls);
const [rawClosable, mergedCloseIcon, , ariaProps] = useClosable$1(pickClosable(props), pickClosable(notificationContext), {
closable: true,
closeIcon: /* @__PURE__ */ import_react.createElement(RefIcon, { className: `${prefixCls}-close-icon` }),
closeIconRender: (icon) => getCloseIcon(prefixCls, icon)
});
const mergedClosable = rawClosable ? {
onClose: isPlainObject(closable) ? closable?.onClose : void 0,
closeIcon: mergedCloseIcon,
...ariaProps
} : false;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${noticePrefixCls}-pure-panel`, hashId, notificationClassName, cssVarCls, rootCls, mergedClassNames.root),
style: mergedStyles.root
}, /* @__PURE__ */ import_react.createElement(pure_panel_default, { prefixCls }), /* @__PURE__ */ import_react.createElement(Notify, {
style: {
...contextStyle,
...style
},
...restProps,
prefixCls,
eventKey: "pure",
duration: null,
closable: mergedClosable,
className: clsx(notificationClassName, contextClassName),
content: /* @__PURE__ */ import_react.createElement(PureContent, {
classNames: mergedClassNames,
styles: mergedStyles,
prefixCls: noticePrefixCls,
icon,
type,
title: mergedTitle,
description,
actions: mergedActions
})
}));
};
//#endregion
//#region node_modules/antd/es/notification/util.js
function getPlacementStyle(placement, top, bottom) {
let style;
switch (placement) {
case "top":
style = {
left: "50%",
transform: "translateX(-50%)",
right: "auto",
top,
bottom: "auto"
};
break;
case "topLeft":
style = {
left: 0,
top,
bottom: "auto"
};
break;
case "topRight":
style = {
right: 0,
top,
bottom: "auto"
};
break;
case "bottom":
style = {
left: "50%",
transform: "translateX(-50%)",
right: "auto",
top: "auto",
bottom
};
break;
case "bottomLeft":
style = {
left: 0,
top: "auto",
bottom
};
break;
default:
style = {
right: 0,
top: "auto",
bottom
};
break;
}
return style;
}
function getMotion$1(prefixCls) {
return { motionName: `${prefixCls}-fade` };
}
function getCloseIconConfig(closeIcon, notificationConfig, notification) {
if (typeof closeIcon !== "undefined") return closeIcon;
if (typeof notificationConfig?.closeIcon !== "undefined") return notificationConfig.closeIcon;
return notification?.closeIcon;
}
//#endregion
//#region node_modules/antd/es/notification/useNotification.js
var DEFAULT_OFFSET = 24;
var DEFAULT_DURATION = 4.5;
var DEFAULT_PLACEMENT = "topRight";
var Wrapper = ({ children, prefixCls }) => {
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$55(prefixCls, rootCls);
return /* @__PURE__ */ import_react.createElement(NotificationProvider, { classNames: { list: clsx(hashId, cssVarCls, rootCls) } }, children);
};
var renderNotifications = (node, { prefixCls, key }) => /* @__PURE__ */ import_react.createElement(Wrapper, {
prefixCls,
key
}, node);
var Holder = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { top, bottom, prefixCls: staticPrefixCls, getContainer: staticGetContainer, maxCount, rtl, onAllRemoved, stack, duration = DEFAULT_DURATION, pauseOnHover = true, showProgress } = props;
const { getPrefixCls, getPopupContainer, direction } = useComponentConfig("notification");
const { notification } = (0, import_react.useContext)(ConfigContext);
const [, token] = useToken$1();
const prefixCls = staticPrefixCls || getPrefixCls("notification");
const mergedDuration = (0, import_react.useMemo)(() => isNumber(duration) && duration > 0 ? duration : false, [duration]);
const getStyle = (placement) => getPlacementStyle(placement, top ?? DEFAULT_OFFSET, bottom ?? DEFAULT_OFFSET);
const getClassName = () => clsx({ [`${prefixCls}-rtl`]: rtl ?? direction === "rtl" });
const getNotificationMotion = () => getMotion$1(prefixCls);
const [api, holder] = useNotification$1({
prefixCls,
style: getStyle,
className: getClassName,
motion: getNotificationMotion,
closable: { closeIcon: getCloseIcon(prefixCls) },
duration: mergedDuration,
getContainer: () => staticGetContainer?.() || getPopupContainer?.() || document.body,
maxCount,
pauseOnHover,
showProgress,
onAllRemoved,
renderNotifications,
stack: stack === false ? false : {
threshold: isPlainObject(stack) ? stack?.threshold : void 0,
offset: 8,
gap: token.margin
}
});
const [mergedClassNames, mergedStyles] = useMergeSemantic([notification?.classNames, props?.classNames], [notification?.styles, props?.styles], { props });
import_react.useImperativeHandle(ref, () => ({
...api,
prefixCls,
notification,
classNames: mergedClassNames,
styles: mergedStyles
}));
return holder;
});
function useInternalNotification(notificationConfig) {
const holderRef = import_react.useRef(null);
const warning = devUseWarning("Notification");
const { notification: notificationContext } = import_react.useContext(ConfigContext);
return [import_react.useMemo(() => {
const open = (config) => {
if (!holderRef.current) {
warning(false, "usage", "You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.");
return;
}
const { open: originOpen, prefixCls, notification, classNames: originClassNames, styles: originStyles } = holderRef.current;
const contextClassName = notification?.className || {};
const contextStyle = notification?.style || {};
const noticePrefixCls = `${prefixCls}-notice`;
const { title, message, description, icon, type, btn, actions, className, style, role = "alert", closeIcon, closable, classNames: configClassNames = {}, styles = {}, ...restConfig } = config;
[["btn", "actions"], ["message", "title"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in config), deprecatedName, newName);
});
const mergedTitle = title ?? message;
const mergedActions = actions ?? btn;
const realCloseIcon = getCloseIcon(noticePrefixCls, getCloseIconConfig(closeIcon, notificationConfig, notification));
const [rawClosable, mergedCloseIcon, , ariaProps] = computeClosable(pickClosable({
...notificationConfig || {},
...config
}), pickClosable(notificationContext), {
closable: true,
closeIcon: realCloseIcon
});
const mergedClosable = rawClosable ? {
onClose: isPlainObject(closable) ? closable.onClose : void 0,
closeIcon: mergedCloseIcon,
...ariaProps
} : false;
const semanticClassNames = resolveStyleOrClass(configClassNames, { props: config });
const semanticStyles = resolveStyleOrClass(styles, { props: config });
const mergedClassNames = mergeClassNames(void 0, originClassNames, semanticClassNames);
const mergedStyles = mergeStyles(originStyles, semanticStyles);
return originOpen({
placement: notificationConfig?.placement ?? DEFAULT_PLACEMENT,
...restConfig,
content: /* @__PURE__ */ import_react.createElement(PureContent, {
prefixCls: noticePrefixCls,
icon,
type,
title: mergedTitle,
description,
actions: mergedActions,
role,
classNames: mergedClassNames,
styles: mergedStyles
}),
className: clsx({ [`${noticePrefixCls}-${type}`]: type }, className, contextClassName, mergedClassNames.root),
style: {
...contextStyle,
...mergedStyles.root,
...style
},
closable: mergedClosable
});
};
const destroy = (key) => {
if (key !== void 0) holderRef.current?.close(key);
else holderRef.current?.destroy();
};
const clone = {
open,
destroy
};
[
"success",
"info",
"warning",
"error"
].forEach((type) => {
clone[type] = (config) => open({
...config,
type
});
});
return clone;
}, [notificationConfig, notificationContext]), /* @__PURE__ */ import_react.createElement(Holder, {
key: "notification-holder",
...notificationConfig,
ref: holderRef
})];
}
function useNotification(notificationConfig) {
return useInternalNotification(notificationConfig);
}
//#endregion
//#region node_modules/antd/es/app/context.js
var AppConfigContext = /* @__PURE__ */ import_react.createContext({});
var AppContext = /* @__PURE__ */ import_react.createContext({
message: {},
notification: {},
modal: {}
});
//#endregion
//#region node_modules/antd/es/app/style/index.js
var genBaseStyle$15 = (token) => {
const { componentCls, colorText, fontSize, lineHeight, fontFamily } = token;
return { [componentCls]: {
color: colorText,
fontSize,
lineHeight,
fontFamily,
[`&${componentCls}-rtl`]: { direction: "rtl" }
} };
};
var prepareComponentToken$48 = () => ({});
var style_default$54 = genStyleHooks("App", genBaseStyle$15, prepareComponentToken$48);
//#endregion
//#region node_modules/antd/es/app/App.js
var App$1 = (props) => {
const { prefixCls: customizePrefixCls, children, className, rootClassName, message, notification, style, component = "div" } = props;
const { direction, getPrefixCls, className: contextClassName, style: contextStyle } = useComponentConfig("app");
const prefixCls = getPrefixCls("app", customizePrefixCls);
const [hashId, cssVarCls] = style_default$54(prefixCls);
const customClassName = clsx(hashId, prefixCls, className, rootClassName, cssVarCls, { [`${prefixCls}-rtl`]: direction === "rtl" });
const appConfig = (0, import_react.useContext)(AppConfigContext);
const mergedAppConfig = import_react.useMemo(() => ({
message: {
...appConfig.message,
...message
},
notification: {
...appConfig.notification,
...notification
}
}), [
message,
notification,
appConfig.message,
appConfig.notification
]);
const [messageApi, messageContextHolder] = useMessage(mergedAppConfig.message);
const [notificationApi, notificationContextHolder] = useNotification(mergedAppConfig.notification);
const [ModalApi, ModalContextHolder] = useModal();
const memoizedContextValue = import_react.useMemo(() => ({
message: messageApi,
notification: notificationApi,
modal: ModalApi
}), [
messageApi,
notificationApi,
ModalApi
]);
devUseWarning("App")(!(cssVarCls && component === false), "usage", "When using cssVar, ensure `component` is assigned a valid React component string.");
const Component = component === false ? import_react.Fragment : component;
const rootProps = {
className: clsx(contextClassName, customClassName),
style: {
...contextStyle,
...style
}
};
return /* @__PURE__ */ import_react.createElement(AppContext.Provider, { value: memoizedContextValue }, /* @__PURE__ */ import_react.createElement(AppConfigContext.Provider, { value: mergedAppConfig }, /* @__PURE__ */ import_react.createElement(Component, { ...component === false ? void 0 : rootProps }, ModalContextHolder, messageContextHolder, notificationContextHolder, children)));
};
App$1.displayName = "App";
//#endregion
//#region node_modules/antd/es/app/useApp.js
var useApp = () => import_react.useContext(AppContext);
//#endregion
//#region node_modules/antd/es/app/index.js
var App = App$1;
App.useApp = useApp;
//#endregion
//#region node_modules/antd/es/_util/PurePanel.js
function withPureRenderTheme(Component) {
return (props) => /* @__PURE__ */ import_react.createElement(ConfigProvider, { theme: { token: {
motion: false,
zIndexPopupBase: 0
} } }, /* @__PURE__ */ import_react.createElement(Component, { ...props }));
}
/* istanbul ignore next */
var genPurePanel = (Component, alignPropName, postProps, defaultPrefixCls, getDropdownCls) => {
const PurePanel = (props) => {
const { prefixCls: customizePrefixCls, style } = props;
const holderRef = import_react.useRef(null);
const [popupHeight, setPopupHeight] = import_react.useState(0);
const [popupWidth, setPopupWidth] = import_react.useState(0);
const [open, setOpen] = useControlledState(false, props.open);
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls(defaultPrefixCls || "select", customizePrefixCls);
import_react.useEffect(() => {
setOpen(true);
if (typeof ResizeObserver !== "undefined") {
const resizeObserver = new ResizeObserver((entries) => {
const element = entries[0].target;
setPopupHeight(element.offsetHeight + 8);
setPopupWidth(element.offsetWidth);
});
const interval = setInterval(() => {
const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;
const popup = holderRef.current?.querySelector(dropdownCls);
if (popup) {
clearInterval(interval);
resizeObserver.observe(popup);
}
}, 10);
return () => {
clearInterval(interval);
resizeObserver.disconnect();
};
}
}, [prefixCls]);
let mergedProps = {
...props,
style: {
...style,
margin: 0
},
open,
getPopupContainer: () => holderRef.current
};
if (postProps) mergedProps = postProps(mergedProps);
if (alignPropName) mergedProps = {
...mergedProps,
[alignPropName]: { overflow: {
adjustX: false,
adjustY: false
} }
};
const mergedStyle = {
paddingBottom: popupHeight,
position: "relative",
minWidth: popupWidth
};
return /* @__PURE__ */ import_react.createElement("div", {
ref: holderRef,
style: mergedStyle
}, /* @__PURE__ */ import_react.createElement(Component, { ...mergedProps }));
};
return withPureRenderTheme(PurePanel);
};
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useAllowClear.js
var useAllowClear = (prefixCls, displayValues, allowClear, clearIcon, disabled = false, mergedSearchValue, mode) => {
const allowClearConfig = (0, import_react.useMemo)(() => {
if (typeof allowClear === "boolean") return { allowClear };
if (allowClear && typeof allowClear === "object") return allowClear;
return { allowClear: false };
}, [allowClear]);
return (0, import_react.useMemo)(() => {
const mergedAllowClear = !disabled && allowClearConfig.allowClear !== false && (displayValues.length || mergedSearchValue) && !(mode === "combobox" && mergedSearchValue === "");
return {
allowClear: mergedAllowClear,
clearIcon: mergedAllowClear ? allowClearConfig.clearIcon || clearIcon || "×" : null
};
}, [
allowClearConfig,
clearIcon,
disabled,
displayValues.length,
mergedSearchValue,
mode
]);
};
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useBaseProps.js
/**
* BaseSelect provide some parsed data into context.
* You can use this hooks to get them.
*/
var BaseSelectContext = /* @__PURE__ */ import_react.createContext(null);
function useBaseProps() {
return import_react.useContext(BaseSelectContext);
}
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useLock.js
/**
* Locker return cached mark.
* If set to `true`, will return `true` in a short time even if set `false`.
* If set to `false` and then set to `true`, will change to `true`.
* And after time duration, it will back to `null` automatically.
*/
function useLock(duration = 250) {
const lockRef = import_react.useRef(null);
const timeoutRef = import_react.useRef(null);
import_react.useEffect(() => () => {
window.clearTimeout(timeoutRef.current);
}, []);
function doLock(locked) {
if (locked || lockRef.current === null) lockRef.current = locked;
window.clearTimeout(timeoutRef.current);
timeoutRef.current = window.setTimeout(() => {
lockRef.current = null;
}, duration);
}
return [() => lockRef.current, doLock];
}
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useSelectTriggerControl.js
function isInside(elements, target) {
return elements.filter((element) => element).some((element) => element.contains(target) || element === target);
}
function useSelectTriggerControl(elements, open, triggerOpen, customizedTrigger) {
const onGlobalMouseDown = useEvent((event) => {
if (customizedTrigger) return;
let target = event.target;
if (target.shadowRoot && event.composed) target = event.composedPath()[0] || target;
if (event._ori_target) target = event._ori_target;
if (open && !isInside(elements(), target)) triggerOpen(false);
});
import_react.useEffect(() => {
window.addEventListener("mousedown", onGlobalMouseDown);
return () => window.removeEventListener("mousedown", onGlobalMouseDown);
}, [onGlobalMouseDown]);
}
//#endregion
//#region node_modules/@rc-component/select/es/SelectTrigger.js
function _extends$83() {
_extends$83 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$83.apply(this, arguments);
}
var getBuiltInPlacements$1 = (popupMatchSelectWidth) => {
const adjustX = popupMatchSelectWidth === true ? 0 : 1;
return {
bottomLeft: {
points: ["tl", "bl"],
offset: [0, 4],
overflow: {
adjustX,
adjustY: 1
},
htmlRegion: "scroll"
},
bottomRight: {
points: ["tr", "br"],
offset: [0, 4],
overflow: {
adjustX,
adjustY: 1
},
htmlRegion: "scroll"
},
topLeft: {
points: ["bl", "tl"],
offset: [0, -4],
overflow: {
adjustX,
adjustY: 1
},
htmlRegion: "scroll"
},
topRight: {
points: ["br", "tr"],
offset: [0, -4],
overflow: {
adjustX,
adjustY: 1
},
htmlRegion: "scroll"
}
};
};
var SelectTrigger = (props, ref) => {
const { prefixCls, disabled, visible, children, popupElement, animation, transitionName, popupStyle, popupClassName, direction = "ltr", placement, builtinPlacements, popupMatchSelectWidth, popupRender, popupAlign, getPopupContainer, empty, onPopupVisibleChange, onPopupMouseEnter, onPopupMouseDown, onPopupBlur, ...restProps } = props;
const popupPrefixCls = `${prefixCls}-dropdown`;
let popupNode = popupElement;
if (popupRender) popupNode = popupRender(popupElement);
const mergedBuiltinPlacements = import_react.useMemo(() => builtinPlacements || getBuiltInPlacements$1(popupMatchSelectWidth), [builtinPlacements, popupMatchSelectWidth]);
const mergedTransitionName = animation ? `${popupPrefixCls}-${animation}` : transitionName;
const isNumberPopupWidth = typeof popupMatchSelectWidth === "number";
const stretch = import_react.useMemo(() => {
if (isNumberPopupWidth) return null;
return popupMatchSelectWidth === false ? "minWidth" : "width";
}, [popupMatchSelectWidth, isNumberPopupWidth]);
let mergedPopupStyle = popupStyle;
if (isNumberPopupWidth) mergedPopupStyle = {
...popupStyle,
width: popupMatchSelectWidth
};
const triggerPopupRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({ getPopupElement: () => triggerPopupRef.current?.popupElement }));
return /* @__PURE__ */ import_react.createElement(es_default$26, _extends$83({}, restProps, {
showAction: onPopupVisibleChange ? ["click"] : [],
hideAction: onPopupVisibleChange ? ["click"] : [],
popupPlacement: placement || (direction === "rtl" ? "bottomRight" : "bottomLeft"),
builtinPlacements: mergedBuiltinPlacements,
prefixCls: popupPrefixCls,
popupMotion: { motionName: mergedTransitionName },
popup: /* @__PURE__ */ import_react.createElement("div", {
onMouseEnter: onPopupMouseEnter,
onMouseDown: onPopupMouseDown,
onBlur: onPopupBlur
}, popupNode),
ref: triggerPopupRef,
stretch,
popupAlign,
popupVisible: visible,
getPopupContainer,
popupClassName: clsx(popupClassName, { [`${popupPrefixCls}-empty`]: empty }),
popupStyle: mergedPopupStyle,
onPopupVisibleChange
}), children);
};
var RefSelectTrigger = /* @__PURE__ */ import_react.forwardRef(SelectTrigger);
RefSelectTrigger.displayName = "SelectTrigger";
//#endregion
//#region node_modules/@rc-component/select/es/utils/valueUtil.js
function getKey$2(data, index) {
const { key } = data;
let value;
if ("value" in data) ({value} = data);
if (key !== null && key !== void 0) return key;
if (value !== void 0) return value;
return `rc-index-key-${index}`;
}
function isValidCount(value) {
return typeof value !== "undefined" && !Number.isNaN(value);
}
function fillFieldNames$3(fieldNames, childrenAsData) {
const { label, value, options, groupLabel } = fieldNames || {};
const mergedLabel = label || (childrenAsData ? "children" : "label");
return {
label: mergedLabel,
value: value || "value",
options: options || "options",
groupLabel: groupLabel || mergedLabel
};
}
/**
* Flat options into flatten list.
* We use `optionOnly` here is aim to avoid user use nested option group.
* Here is simply set `key` to the index if not provided.
*/
function flattenOptions(options, { fieldNames, childrenAsData } = {}) {
const flattenList = [];
const { label: fieldLabel, value: fieldValue, options: fieldOptions, groupLabel } = fillFieldNames$3(fieldNames, false);
function dig(list, isGroupOption) {
if (!Array.isArray(list)) return;
list.forEach((data) => {
if (isGroupOption || !(fieldOptions in data)) {
const value = data[fieldValue];
flattenList.push({
key: getKey$2(data, flattenList.length),
groupOption: isGroupOption,
data,
label: data[fieldLabel],
value
});
} else {
let grpLabel = data[groupLabel];
if (grpLabel === void 0 && childrenAsData) grpLabel = data.label;
flattenList.push({
key: getKey$2(data, flattenList.length),
group: true,
data,
label: grpLabel
});
dig(data[fieldOptions], true);
}
});
}
dig(options, false);
return flattenList;
}
/**
* Inject `props` into `option` for legacy usage
*/
function injectPropsWithOption(option) {
const newOption = { ...option };
if (!("props" in newOption)) Object.defineProperty(newOption, "props", { get() {
warningOnce(false, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`.");
return newOption;
} });
return newOption;
}
var getSeparatedContent = (text, tokens, end) => {
if (!tokens || !tokens.length) return null;
let match = false;
const separate = (str, [token, ...restTokens]) => {
if (!token) return [str];
const list = str.split(token);
match = match || list.length > 1;
return list.reduce((prevList, unitStr) => [...prevList, ...separate(unitStr, restTokens)], []).filter(Boolean);
};
const list = separate(text, tokens);
if (match) return typeof end !== "undefined" ? list.slice(0, end) : list;
else return null;
};
//#endregion
//#region node_modules/@rc-component/select/es/BaseSelect/Polite.js
function Polite(props) {
const { visible, values } = props;
if (!visible) return null;
const MAX_COUNT = 50;
return /* @__PURE__ */ import_react.createElement("span", {
"aria-live": "polite",
style: {
width: 0,
height: 0,
position: "absolute",
overflow: "hidden",
opacity: 0
}
}, `${values.slice(0, MAX_COUNT).map(({ label, value }) => ["number", "string"].includes(typeof label) ? label : value).join(", ")}`, values.length > MAX_COUNT ? ", ..." : null);
}
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useOpen.js
var internalMacroTask = (fn) => {
const channel = new MessageChannel();
channel.port1.onmessage = fn;
channel.port2.postMessage(null);
};
var macroTask = (fn, times = 1) => {
if (times <= 0) {
fn();
return;
}
internalMacroTask(() => {
macroTask(fn, times - 1);
});
};
/**
* Trigger by latest open call, if nextOpen is undefined, means toggle.
* `weak` means this call can be ignored if previous call exists.
*/
/**
* When `open` is controlled, follow the controlled value;
* Otherwise use uncontrolled logic.
* Setting `open` takes effect immediately,
* but setting it to `false` is delayed via MessageChannel.
*
* SSR handling: During SSR, `open` is always false to avoid Portal issues.
* On client-side hydration, it syncs with the actual open state.
*/
function useOpen$1(defaultOpen, propOpen, onOpen, postOpen) {
const [rendered, setRendered] = (0, import_react.useState)(false);
(0, import_react.useEffect)(() => {
setRendered(true);
}, []);
const [stateOpen, internalSetOpen] = useControlledState(defaultOpen, propOpen);
const [lock, setLock] = (0, import_react.useState)(false);
const ssrSafeOpen = rendered ? stateOpen : false;
const mergedOpen = postOpen(ssrSafeOpen);
const taskIdRef = (0, import_react.useRef)(0);
const triggerEvent = useEvent((nextOpen) => {
if (onOpen && mergedOpen !== nextOpen) onOpen(nextOpen);
internalSetOpen(nextOpen);
});
return [
ssrSafeOpen,
mergedOpen,
useEvent((nextOpen, config = {}) => {
const { cancelFun } = config;
taskIdRef.current += 1;
const id = taskIdRef.current;
const nextOpenVal = typeof nextOpen === "boolean" ? nextOpen : !mergedOpen;
setLock(!nextOpenVal);
function triggerUpdate() {
if (id === taskIdRef.current && !cancelFun?.()) {
triggerEvent(nextOpenVal);
setLock(false);
}
}
if (nextOpenVal) triggerUpdate();
else macroTask(() => {
triggerUpdate();
});
}),
lock
];
}
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/Affix.js
function Affix$1(props) {
const { children, ...restProps } = props;
if (!children) return null;
return /* @__PURE__ */ import_react.createElement("div", restProps, children);
}
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/context.js
var SelectInputContext = /* @__PURE__ */ import_react.createContext(null);
function useSelectInputContext() {
return import_react.useContext(SelectInputContext);
}
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/Input.js
var Input$4 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { onChange, onKeyDown, onBlur, style, syncWidth, value, className, autoComplete, ...restProps } = props;
const { prefixCls, mode, onSearch, onSearchSubmit, onInputBlur, autoFocus, tokenWithEnter, placeholder, components: { input: InputComponent = "input" } } = useSelectInputContext();
const { id, classNames, styles, open, activeDescendantId, role, disabled } = useBaseProps() || {};
const inputCls = clsx(`${prefixCls}-input`, classNames?.input, className);
const compositionStatusRef = import_react.useRef(false);
const pastedTextRef = import_react.useRef(null);
const inputRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => inputRef.current);
const handleChange = (event) => {
let { value: nextVal } = event.target;
if (tokenWithEnter && pastedTextRef.current && /[\r\n]/.test(pastedTextRef.current)) {
const replacedText = pastedTextRef.current.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
nextVal = nextVal.replace(replacedText, pastedTextRef.current);
}
pastedTextRef.current = null;
if (onSearch) onSearch(nextVal, true, compositionStatusRef.current);
onChange?.(event);
};
const handleKeyDown = (event) => {
const { key } = event;
const { value: nextVal } = event.currentTarget;
if (key === "Enter" && mode === "tags" && !open && !compositionStatusRef.current && onSearchSubmit) onSearchSubmit(nextVal);
onKeyDown?.(event);
};
const handleBlur = (event) => {
onInputBlur?.();
onBlur?.(event);
};
const handleCompositionStart = () => {
compositionStatusRef.current = true;
};
const handleCompositionEnd = (event) => {
compositionStatusRef.current = false;
if (mode !== "combobox") {
const { value: nextVal } = event.currentTarget;
onSearch?.(nextVal, true, false);
}
};
const handlePaste = (event) => {
const { clipboardData } = event;
pastedTextRef.current = clipboardData?.getData("text") || "";
};
const [widthCssVar, setWidthCssVar] = import_react.useState(void 0);
useLayoutEffect$1(() => {
const input = inputRef.current;
if (syncWidth && input) {
input.style.width = "0px";
const scrollWidth = input.scrollWidth;
setWidthCssVar(scrollWidth);
input.style.width = "";
}
}, [syncWidth, value]);
const sharedInputProps = {
id,
type: mode === "combobox" ? "text" : "search",
...restProps,
ref: inputRef,
style: {
...styles?.input,
...style,
"--select-input-width": widthCssVar
},
autoFocus,
autoComplete: autoComplete || "off",
className: inputCls,
disabled,
value: value || "",
onChange: handleChange,
onKeyDown: handleKeyDown,
onBlur: handleBlur,
onPaste: handlePaste,
onCompositionStart: handleCompositionStart,
onCompositionEnd: handleCompositionEnd,
role: role || "combobox",
"aria-expanded": open || false,
"aria-haspopup": "listbox",
"aria-owns": open ? `${id}_list` : void 0,
"aria-autocomplete": "list",
"aria-controls": open ? `${id}_list` : void 0,
"aria-activedescendant": open ? activeDescendantId : void 0
};
if (/* @__PURE__ */ import_react.isValidElement(InputComponent)) {
const existingProps = InputComponent.props || {};
const mergedProps = {
placeholder: props.placeholder || placeholder,
...sharedInputProps,
...existingProps
};
Object.keys(existingProps).forEach((key) => {
const existingValue = existingProps[key];
if (typeof existingValue === "function") mergedProps[key] = (...args) => {
existingValue(...args);
sharedInputProps[key]?.(...args);
};
});
mergedProps.ref = composeRef(InputComponent.ref, sharedInputProps.ref);
return /* @__PURE__ */ import_react.cloneElement(InputComponent, mergedProps);
}
const Component = InputComponent;
return /* @__PURE__ */ import_react.createElement(Component, sharedInputProps);
});
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/Content/Placeholder.js
function Placeholder$1(props) {
const { prefixCls, placeholder, displayValues } = useSelectInputContext();
const { classNames, styles } = useBaseProps();
const { show = true } = props;
if (displayValues.length) return null;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-placeholder`, classNames?.placeholder),
style: {
visibility: show ? "visible" : "hidden",
...styles?.placeholder
}
}, placeholder);
}
//#endregion
//#region node_modules/@rc-component/select/es/SelectContext.js
/**
* SelectContext is only used for Select. BaseSelect should not consume this context.
*/
var SelectContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/select/es/utils/commonUtil.js
function toArray$5(value) {
if (Array.isArray(value)) return value;
return value !== void 0 ? [value] : [];
}
typeof window !== "undefined" && window.document && window.document.documentElement;
function hasValue(value) {
return value !== void 0 && value !== null;
}
/** combo mode no value judgment function */
function isComboNoValue(value) {
return !value && value !== 0;
}
function isTitleType$1(title) {
return ["string", "number"].includes(typeof title);
}
function getTitle(item) {
let title = void 0;
if (item) {
if (isTitleType$1(item.title)) title = item.title.toString();
else if (isTitleType$1(item.label)) title = item.label.toString();
}
return title;
}
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/Content/SingleContent.js
function _extends$82() {
_extends$82 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$82.apply(this, arguments);
}
var SingleContent = /* @__PURE__ */ import_react.forwardRef(({ inputProps }, ref) => {
const { prefixCls, searchValue, activeValue, displayValues, maxLength, mode, components } = useSelectInputContext();
const { triggerOpen, title: rootTitle, showSearch, classNames, styles } = useBaseProps();
const selectContext = import_react.useContext(SelectContext);
const [inputChanged, setInputChanged] = import_react.useState(false);
const combobox = mode === "combobox";
const displayValue = displayValues[0];
const mergedSearchValue = import_react.useMemo(() => {
if (combobox && activeValue && !inputChanged && triggerOpen) return activeValue;
return showSearch ? searchValue : "";
}, [
combobox,
activeValue,
inputChanged,
triggerOpen,
searchValue,
showSearch
]);
const [optionClassName, optionStyle, optionTitle, hasOptionStyle] = import_react.useMemo(() => {
let className;
let style;
let titleValue;
if (displayValue && selectContext?.flattenOptions) {
const option = selectContext.flattenOptions.find((opt) => opt.value === displayValue.value);
if (option?.data) {
className = option.data.className;
style = option.data.style;
titleValue = getTitle(option.data);
}
}
if (displayValue && !titleValue) titleValue = getTitle(displayValue);
if (rootTitle !== void 0) titleValue = rootTitle;
return [
className,
style,
titleValue,
!!className || !!style
];
}, [
displayValue,
selectContext?.flattenOptions,
rootTitle
]);
import_react.useEffect(() => {
if (combobox) setInputChanged(false);
}, [combobox, activeValue]);
const showHasValueCls = displayValue && displayValue.label !== null && displayValue.label !== void 0 && String(displayValue.label).trim() !== "";
const renderValue = !(combobox && components?.input) ? displayValue ? hasOptionStyle ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-content-value`, optionClassName),
style: {
...mergedSearchValue ? { visibility: "hidden" } : {},
...optionStyle
},
title: optionTitle
}, displayValue.label) : displayValue.label : /* @__PURE__ */ import_react.createElement(Placeholder$1, { show: !mergedSearchValue }) : null;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-content`, showHasValueCls && `${prefixCls}-content-has-value`, mergedSearchValue && `${prefixCls}-content-has-search-value`, hasOptionStyle && `${prefixCls}-content-has-option-style`, classNames?.content),
style: styles?.content,
title: hasOptionStyle ? void 0 : optionTitle
}, renderValue, /* @__PURE__ */ import_react.createElement(Input$4, _extends$82({ ref }, inputProps, {
value: mergedSearchValue,
maxLength: mode === "combobox" ? maxLength : void 0,
onChange: (e) => {
setInputChanged(true);
inputProps.onChange?.(e);
}
})));
});
//#endregion
//#region node_modules/@rc-component/overflow/es/Item.js
var UNDEFINED = void 0;
function InternalItem(props, ref) {
const { prefixCls, invalidate, item, renderItem, responsive, responsiveDisabled, registerSize, itemKey, className, style, children, display, order, component: Component = "div", ...restProps } = props;
const mergedHidden = responsive && !display;
function internalRegisterSize(width) {
registerSize(itemKey, width);
}
import_react.useEffect(() => () => {
internalRegisterSize(null);
}, []);
const childNode = renderItem && item !== UNDEFINED ? renderItem(item, { index: order }) : children;
let overflowStyle;
if (!invalidate) overflowStyle = {
opacity: mergedHidden ? 0 : 1,
height: mergedHidden ? 0 : UNDEFINED,
overflowY: mergedHidden ? "hidden" : UNDEFINED,
order: responsive ? order : UNDEFINED,
pointerEvents: mergedHidden ? "none" : UNDEFINED,
position: mergedHidden ? "absolute" : UNDEFINED
};
const overflowProps = {};
if (mergedHidden) overflowProps["aria-hidden"] = true;
let itemNode = /* @__PURE__ */ import_react.createElement(Component, _extends$91({
className: clsx(!invalidate && prefixCls, className),
style: {
...overflowStyle,
...style
}
}, overflowProps, restProps, { ref }), childNode);
if (responsive) itemNode = /* @__PURE__ */ import_react.createElement(RefResizeObserver, {
onResize: ({ offsetWidth }) => {
internalRegisterSize(offsetWidth);
},
disabled: responsiveDisabled
}, itemNode);
return itemNode;
}
var Item$3 = /* @__PURE__ */ import_react.forwardRef(InternalItem);
Item$3.displayName = "Item";
//#endregion
//#region node_modules/@rc-component/overflow/es/hooks/channelUpdate.js
function channelUpdate(callback) {
if (typeof MessageChannel === "undefined") wrapperRaf(callback);
else {
const channel = new MessageChannel();
channel.port1.onmessage = () => callback();
channel.port2.postMessage(void 0);
}
}
//#endregion
//#region node_modules/@rc-component/overflow/es/hooks/useEffectState.js
/**
* Batcher for record any `useEffectState` need update.
*/
function useBatcher() {
const updateFuncRef = import_react.useRef(null);
const notifyEffectUpdate = (callback) => {
if (!updateFuncRef.current) {
updateFuncRef.current = [];
channelUpdate(() => {
(0, import_react_dom.unstable_batchedUpdates)(() => {
updateFuncRef.current.forEach((fn) => {
fn();
});
updateFuncRef.current = null;
});
});
}
updateFuncRef.current.push(callback);
};
return notifyEffectUpdate;
}
/**
* Trigger state update by `useLayoutEffect` to save perf.
*/
function useEffectState$1(notifyEffectUpdate, defaultValue) {
const [stateValue, setStateValue] = import_react.useState(defaultValue);
return [stateValue, useEvent((nextValue) => {
notifyEffectUpdate(() => {
setStateValue(nextValue);
});
})];
}
//#endregion
//#region node_modules/@rc-component/overflow/es/context.js
var OverflowContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/overflow/es/RawItem.js
var InternalRawItem = (props, ref) => {
const context = import_react.useContext(OverflowContext);
if (!context) {
const { component: Component = "div", ...restProps } = props;
return /* @__PURE__ */ import_react.createElement(Component, _extends$91({}, restProps, { ref }));
}
const { className: contextClassName, ...restContext } = context;
const { className, ...restProps } = props;
return /* @__PURE__ */ import_react.createElement(OverflowContext.Provider, { value: null }, /* @__PURE__ */ import_react.createElement(Item$3, _extends$91({
ref,
className: clsx(contextClassName, className)
}, restContext, restProps)));
};
var RawItem = /* @__PURE__ */ import_react.forwardRef(InternalRawItem);
RawItem.displayName = "RawItem";
//#endregion
//#region node_modules/@rc-component/overflow/es/Overflow.js
var RESPONSIVE = "responsive";
var INVALIDATE = "invalidate";
function defaultRenderRest(omittedItems) {
return `+ ${omittedItems.length} ...`;
}
function Overflow(props, ref) {
const { prefixCls = "rc-overflow", data = [], renderItem, renderRawItem, itemKey, itemWidth = 10, ssr, style, className, maxCount, renderRest, renderRawRest, prefix, suffix, component: Component = "div", itemComponent, onVisibleChange, ...restProps } = props;
const fullySSR = ssr === "full";
const notifyEffectUpdate = useBatcher();
const [containerWidth, setContainerWidth] = useEffectState$1(notifyEffectUpdate, null);
const mergedContainerWidth = containerWidth || 0;
const [itemWidths, setItemWidths] = useEffectState$1(notifyEffectUpdate, /* @__PURE__ */ new Map());
const [prevRestWidth, setPrevRestWidth] = useEffectState$1(notifyEffectUpdate, 0);
const [restWidth, setRestWidth] = useEffectState$1(notifyEffectUpdate, 0);
const [prefixWidth, setPrefixWidth] = useEffectState$1(notifyEffectUpdate, 0);
const [suffixWidth, setSuffixWidth] = useEffectState$1(notifyEffectUpdate, 0);
const [suffixFixedStart, setSuffixFixedStart] = (0, import_react.useState)(null);
const [displayCount, setDisplayCount] = (0, import_react.useState)(null);
const mergedDisplayCount = import_react.useMemo(() => {
if (displayCount === null && fullySSR) return Number.MAX_SAFE_INTEGER;
return displayCount || 0;
}, [displayCount, containerWidth]);
const [restReady, setRestReady] = (0, import_react.useState)(false);
const itemPrefixCls = `${prefixCls}-item`;
const mergedRestWidth = Math.max(prevRestWidth, restWidth);
const isResponsive = maxCount === RESPONSIVE;
const shouldResponsive = data.length && isResponsive;
const invalidate = maxCount === INVALIDATE;
/**
* When is `responsive`, we will always render rest node to get the real width of it for calculation
*/
const showRest = shouldResponsive || typeof maxCount === "number" && data.length > maxCount;
const mergedData = (0, import_react.useMemo)(() => {
let items = data;
if (shouldResponsive) if (containerWidth === null && fullySSR) items = data;
else items = data.slice(0, Math.min(data.length, mergedContainerWidth / itemWidth));
else if (typeof maxCount === "number") items = data.slice(0, maxCount);
return items;
}, [
data,
itemWidth,
containerWidth,
maxCount,
shouldResponsive
]);
const omittedItems = (0, import_react.useMemo)(() => {
if (shouldResponsive) return data.slice(mergedDisplayCount + 1);
return data.slice(mergedData.length);
}, [
data,
mergedData,
shouldResponsive,
mergedDisplayCount
]);
const getKey = (0, import_react.useCallback)((item, index) => {
if (typeof itemKey === "function") return itemKey(item);
return (itemKey && item?.[itemKey]) ?? index;
}, [itemKey]);
const mergedRenderItem = (0, import_react.useCallback)(renderItem || ((item) => item), [renderItem]);
function updateDisplayCount(count, suffixFixedStartVal, notReady) {
if (displayCount === count && (suffixFixedStartVal === void 0 || suffixFixedStartVal === suffixFixedStart)) return;
setDisplayCount(count);
if (!notReady) {
setRestReady(count < data.length - 1);
onVisibleChange?.(count);
}
if (suffixFixedStartVal !== void 0) setSuffixFixedStart(suffixFixedStartVal);
}
function onOverflowResize(_, element) {
setContainerWidth(element.clientWidth);
}
function registerSize(key, width) {
setItemWidths((origin) => {
const clone = new Map(origin);
if (width === null) clone.delete(key);
else clone.set(key, width);
return clone;
});
}
function registerOverflowSize(_, width) {
setRestWidth(width);
setPrevRestWidth(restWidth);
}
function registerPrefixSize(_, width) {
setPrefixWidth(width);
}
function registerSuffixSize(_, width) {
setSuffixWidth(width);
}
function getItemWidth(index) {
return itemWidths.get(getKey(mergedData[index], index));
}
useLayoutEffect$1(() => {
if (mergedContainerWidth && typeof mergedRestWidth === "number" && mergedData) {
let totalWidth = prefixWidth + suffixWidth;
const len = mergedData.length;
const lastIndex = len - 1;
if (!len) {
updateDisplayCount(0, null);
return;
}
for (let i = 0; i < len; i += 1) {
let currentItemWidth = getItemWidth(i);
if (fullySSR) currentItemWidth = currentItemWidth || 0;
if (currentItemWidth === void 0) {
updateDisplayCount(i - 1, void 0, true);
break;
}
totalWidth += currentItemWidth;
if (lastIndex === 0 && totalWidth <= mergedContainerWidth || i === lastIndex - 1 && totalWidth + getItemWidth(lastIndex) <= mergedContainerWidth) {
updateDisplayCount(lastIndex, null);
break;
} else if (totalWidth + mergedRestWidth > mergedContainerWidth) {
updateDisplayCount(i - 1, totalWidth - currentItemWidth - suffixWidth + restWidth);
break;
}
}
if (suffix && getItemWidth(0) + suffixWidth > mergedContainerWidth) setSuffixFixedStart(null);
}
}, [
mergedContainerWidth,
itemWidths,
restWidth,
prefixWidth,
suffixWidth,
getKey,
mergedData
]);
const displayRest = restReady && !!omittedItems.length;
let suffixStyle = {};
if (suffixFixedStart !== null && shouldResponsive) suffixStyle = {
position: "absolute",
top: 0,
insetInlineStart: suffixFixedStart
};
const itemSharedProps = {
prefixCls: itemPrefixCls,
responsive: shouldResponsive,
component: itemComponent,
invalidate
};
const internalRenderItemNode = renderRawItem ? (item, index) => {
const key = getKey(item, index);
return /* @__PURE__ */ import_react.createElement(OverflowContext.Provider, {
key,
value: {
...itemSharedProps,
order: index,
item,
itemKey: key,
registerSize,
display: index <= mergedDisplayCount
}
}, renderRawItem(item, index));
} : (item, index) => {
const key = getKey(item, index);
return /* @__PURE__ */ import_react.createElement(Item$3, _extends$91({}, itemSharedProps, {
order: index,
key,
item,
renderItem: mergedRenderItem,
itemKey: key,
registerSize,
display: index <= mergedDisplayCount
}));
};
const restContextProps = {
order: displayRest ? mergedDisplayCount : Number.MAX_SAFE_INTEGER,
className: `${itemPrefixCls}-rest`,
registerSize: registerOverflowSize,
display: displayRest
};
const mergedRenderRest = renderRest || defaultRenderRest;
const restNode = renderRawRest ? /* @__PURE__ */ import_react.createElement(OverflowContext.Provider, { value: {
...itemSharedProps,
...restContextProps
} }, renderRawRest(omittedItems)) : /* @__PURE__ */ import_react.createElement(Item$3, _extends$91({}, itemSharedProps, restContextProps), typeof mergedRenderRest === "function" ? mergedRenderRest(omittedItems) : mergedRenderRest);
const overflowNode = /* @__PURE__ */ import_react.createElement(Component, _extends$91({
className: clsx(!invalidate && prefixCls, className),
style,
ref
}, restProps), prefix && /* @__PURE__ */ import_react.createElement(Item$3, _extends$91({}, itemSharedProps, {
responsive: isResponsive,
responsiveDisabled: !shouldResponsive,
order: -1,
className: `${itemPrefixCls}-prefix`,
registerSize: registerPrefixSize,
display: true
}), prefix), mergedData.map(internalRenderItemNode), showRest ? restNode : null, suffix && /* @__PURE__ */ import_react.createElement(Item$3, _extends$91({}, itemSharedProps, {
responsive: isResponsive,
responsiveDisabled: !shouldResponsive,
order: mergedDisplayCount,
className: `${itemPrefixCls}-suffix`,
registerSize: registerSuffixSize,
display: true,
style: suffixStyle
}), suffix));
return isResponsive ? /* @__PURE__ */ import_react.createElement(RefResizeObserver, {
onResize: onOverflowResize,
disabled: !shouldResponsive
}, overflowNode) : overflowNode;
}
var ForwardOverflow = /* @__PURE__ */ import_react.forwardRef(Overflow);
ForwardOverflow.Item = RawItem;
ForwardOverflow.RESPONSIVE = RESPONSIVE;
ForwardOverflow.INVALIDATE = INVALIDATE;
ForwardOverflow.displayName = "Overflow";
//#endregion
//#region node_modules/@rc-component/overflow/es/index.js
var es_default$22 = ForwardOverflow;
//#endregion
//#region node_modules/@rc-component/select/es/TransBtn.js
/**
* Small wrapper for Select icons (clear/arrow/etc.).
* Prevents default mousedown to avoid blurring or caret moves, and
* renders a custom icon or a fallback icon span.
*
* DOM structure:
*
* { icon || {children} }
*
*/
var TransBtn = (props) => {
const { className, style, customizeIcon, customizeIconProps, children, onMouseDown, onClick } = props;
const icon = typeof customizeIcon === "function" ? customizeIcon(customizeIconProps) : customizeIcon;
return /* @__PURE__ */ import_react.createElement("span", {
className,
onMouseDown: (event) => {
event.preventDefault();
onMouseDown?.(event);
},
style: {
userSelect: "none",
WebkitUserSelect: "none",
...style
},
unselectable: "on",
onClick,
"aria-hidden": true
}, icon !== void 0 ? icon : /* @__PURE__ */ import_react.createElement("span", { className: clsx(className.split(/\s+/).map((cls) => `${cls}-icon`)) }, children));
};
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/Content/MultipleContent.js
function _extends$81() {
_extends$81 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$81.apply(this, arguments);
}
function itemKey$1(value) {
return value.key ?? value.value;
}
var onPreventMouseDown = (event) => {
event.preventDefault();
event.stopPropagation();
};
var MultipleContent_default = /* @__PURE__ */ import_react.forwardRef(function MultipleContent({ inputProps }, ref) {
const { prefixCls, displayValues, searchValue, mode, onSelectorRemove, removeIcon: removeIconFromContext } = useSelectInputContext();
const { disabled, showSearch, triggerOpen, rawOpen, toggleOpen, autoClearSearchValue, tagRender: tagRenderFromContext, maxTagPlaceholder: maxTagPlaceholderFromContext, maxTagTextLength, maxTagCount, classNames, styles } = useBaseProps();
const selectionItemPrefixCls = `${prefixCls}-selection-item`;
let computedSearchValue = searchValue;
if (!rawOpen && mode === "multiple" && autoClearSearchValue !== false) computedSearchValue = "";
const inputValue = showSearch ? computedSearchValue || "" : "";
const inputEditable = showSearch && !disabled;
const removeIcon = removeIconFromContext ?? "×";
const maxTagPlaceholder = maxTagPlaceholderFromContext ?? ((omittedValues) => `+ ${omittedValues.length} ...`);
const tagRender = tagRenderFromContext;
const onToggleOpen = (newOpen) => {
toggleOpen(newOpen);
};
const onRemove = (value) => {
onSelectorRemove?.(value);
};
const defaultRenderSelector = (item, content, itemDisabled, closable, onClose) => /* @__PURE__ */ import_react.createElement("span", {
title: getTitle(item),
className: clsx(selectionItemPrefixCls, { [`${selectionItemPrefixCls}-disabled`]: itemDisabled }, classNames?.item),
style: styles?.item
}, /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${selectionItemPrefixCls}-content`, classNames?.itemContent),
style: styles?.itemContent
}, content), closable && /* @__PURE__ */ import_react.createElement(TransBtn, {
className: clsx(`${selectionItemPrefixCls}-remove`, classNames?.itemRemove),
style: styles?.itemRemove,
onMouseDown: onPreventMouseDown,
onClick: onClose,
customizeIcon: removeIcon
}, "×"));
const customizeRenderSelector = (value, content, itemDisabled, closable, onClose, isMaxTag, info) => {
const onMouseDown = (e) => {
onPreventMouseDown(e);
onToggleOpen(!triggerOpen);
};
return /* @__PURE__ */ import_react.createElement("span", { onMouseDown }, tagRender({
label: content,
value,
index: info?.index,
disabled: itemDisabled,
closable,
onClose,
isMaxTag: !!isMaxTag
}));
};
const renderItem = (valueItem, info) => {
const { disabled: itemDisabled, label, value } = valueItem;
const closable = !disabled && !itemDisabled;
let displayLabel = label;
if (typeof maxTagTextLength === "number") {
if (typeof label === "string" || typeof label === "number") {
const strLabel = String(displayLabel);
if (strLabel.length > maxTagTextLength) displayLabel = `${strLabel.slice(0, maxTagTextLength)}...`;
}
}
const onClose = (event) => {
if (event) event.stopPropagation();
onRemove(valueItem);
};
return typeof tagRender === "function" ? customizeRenderSelector(value, displayLabel, itemDisabled, closable, onClose, void 0, info) : defaultRenderSelector(valueItem, displayLabel, itemDisabled, closable, onClose);
};
const renderRest = (omittedValues) => {
if (!displayValues.length) return null;
const content = typeof maxTagPlaceholder === "function" ? maxTagPlaceholder(omittedValues) : maxTagPlaceholder;
return typeof tagRender === "function" ? customizeRenderSelector(void 0, content, false, false, void 0, true) : defaultRenderSelector({ title: content }, content, false);
};
return /* @__PURE__ */ import_react.createElement(es_default$22, {
prefixCls: `${prefixCls}-content`,
className: classNames?.content,
style: styles?.content,
prefix: !displayValues.length && !inputValue && /* @__PURE__ */ import_react.createElement(Placeholder$1, null),
data: displayValues,
renderItem,
renderRest,
suffix: /* @__PURE__ */ import_react.createElement(Input$4, _extends$81({
ref,
disabled,
readOnly: !inputEditable
}, inputProps, {
value: inputValue || "",
syncWidth: true
})),
itemKey: itemKey$1,
maxCount: maxTagCount
});
});
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/Content/index.js
var SelectContent = /* @__PURE__ */ import_react.forwardRef(function SelectContent(_, ref) {
const { multiple, onInputKeyDown, tabIndex } = useSelectInputContext();
const baseProps = useBaseProps();
const { showSearch } = baseProps;
const sharedInputProps = {
...pickAttrs(baseProps, { aria: true }),
onKeyDown: onInputKeyDown,
readOnly: !showSearch,
tabIndex
};
if (multiple) return /* @__PURE__ */ import_react.createElement(MultipleContent_default, {
ref,
inputProps: sharedInputProps
});
return /* @__PURE__ */ import_react.createElement(SingleContent, {
ref,
inputProps: sharedInputProps
});
});
//#endregion
//#region node_modules/@rc-component/select/es/utils/keyUtil.js
/** keyCode Judgment function */
function isValidateOpenKey(currentKeyCode) {
return currentKeyCode && ![
KeyCode.ESC,
KeyCode.SHIFT,
KeyCode.BACKSPACE,
KeyCode.TAB,
KeyCode.WIN_KEY,
KeyCode.ALT,
KeyCode.META,
KeyCode.WIN_KEY_RIGHT,
KeyCode.CTRL,
KeyCode.SEMICOLON,
KeyCode.EQUALS,
KeyCode.CAPS_LOCK,
KeyCode.CONTEXT_MENU,
KeyCode.UP,
KeyCode.LEFT,
KeyCode.RIGHT,
KeyCode.F1,
KeyCode.F2,
KeyCode.F3,
KeyCode.F4,
KeyCode.F5,
KeyCode.F6,
KeyCode.F7,
KeyCode.F8,
KeyCode.F9,
KeyCode.F10,
KeyCode.F11,
KeyCode.F12
].includes(currentKeyCode);
}
//#endregion
//#region node_modules/@rc-component/select/es/SelectInput/index.js
function _extends$80() {
_extends$80 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$80.apply(this, arguments);
}
var DEFAULT_OMIT_PROPS = [
"value",
"onChange",
"removeIcon",
"placeholder",
"maxTagCount",
"maxTagTextLength",
"maxTagPlaceholder",
"choiceTransitionName",
"onInputKeyDown",
"onPopupScroll",
"tabIndex",
"activeValue",
"onSelectorRemove",
"focused"
];
var SelectInput_default = /* @__PURE__ */ import_react.forwardRef(function SelectInput(props, ref) {
const { prefixCls, className, style, prefix, suffix, clearIcon, children, multiple, displayValues, placeholder, mode, searchValue, onSearch, onSearchSubmit, onInputBlur, maxLength, autoFocus, onMouseDown, onClearMouseDown, onInputKeyDown, onSelectorRemove, tokenWithEnter, components, ...restProps } = props;
const { triggerOpen, toggleOpen, showSearch, disabled, loading, classNames, styles } = useBaseProps();
const rootRef = import_react.useRef(null);
const inputRef = import_react.useRef(null);
const onInternalInputKeyDown = useEvent((event) => {
const { which } = event;
const isTextAreaElement = inputRef.current instanceof HTMLTextAreaElement;
if (!isTextAreaElement && triggerOpen && (which === KeyCode.UP || which === KeyCode.DOWN)) event.preventDefault();
if (onInputKeyDown) onInputKeyDown(event);
if (isTextAreaElement && !triggerOpen && ~[
KeyCode.UP,
KeyCode.DOWN,
KeyCode.LEFT,
KeyCode.RIGHT
].indexOf(which)) return;
if (!(event.ctrlKey || event.altKey || event.metaKey) && isValidateOpenKey(which)) toggleOpen(true);
});
import_react.useImperativeHandle(ref, () => {
return {
focus: (options) => {
(inputRef.current || rootRef.current).focus?.(options);
},
blur: () => {
(inputRef.current || rootRef.current).blur?.();
},
nativeElement: getDOM(rootRef.current)
};
});
const onInternalMouseDown = useEvent((event) => {
if (!disabled) {
const inputDOM = getDOM(inputRef.current);
event.nativeEvent._ori_target = inputDOM;
const isClickOnInput = inputDOM === event.target || inputDOM?.contains(event.target);
if (inputDOM && !isClickOnInput) event.preventDefault();
const shouldPreventClose = triggerOpen && !multiple && (mode === "combobox" || showSearch) || triggerOpen && multiple && isClickOnInput;
if (!event.nativeEvent._select_lazy) {
inputRef.current?.focus();
if (!shouldPreventClose) toggleOpen();
} else if (triggerOpen) toggleOpen(false);
}
onMouseDown?.(event);
});
const { root: RootComponent } = components;
const domProps = omit(restProps, DEFAULT_OMIT_PROPS);
const ariaProps = pickAttrs(domProps, { aria: true });
const ariaKeys = Object.keys(ariaProps);
const contextValue = {
...props,
onInputKeyDown: onInternalInputKeyDown
};
if (RootComponent) {
const originProps = RootComponent.props || {};
const mergedProps = {
...originProps,
...domProps
};
Object.keys(originProps).forEach((key) => {
const originVal = originProps[key];
const domVal = domProps[key];
if (typeof originVal === "function" && typeof domVal === "function") mergedProps[key] = (...args) => {
domVal(...args);
originVal(...args);
};
});
if (/* @__PURE__ */ import_react.isValidElement(RootComponent)) return /* @__PURE__ */ import_react.cloneElement(RootComponent, {
...mergedProps,
ref: composeRef(RootComponent.ref, rootRef)
});
return /* @__PURE__ */ import_react.createElement(RootComponent, _extends$80({}, mergedProps, { ref: rootRef }));
}
return /* @__PURE__ */ import_react.createElement(SelectInputContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.createElement("div", _extends$80({}, omit(domProps, ariaKeys), {
ref: rootRef,
className,
style,
onMouseDown: onInternalMouseDown
}), /* @__PURE__ */ import_react.createElement(Affix$1, {
className: clsx(`${prefixCls}-prefix`, classNames?.prefix),
style: styles?.prefix
}, prefix), /* @__PURE__ */ import_react.createElement(SelectContent, { ref: inputRef }), /* @__PURE__ */ import_react.createElement(Affix$1, {
className: clsx(`${prefixCls}-suffix`, { [`${prefixCls}-suffix-loading`]: loading }, classNames?.suffix),
style: styles?.suffix
}, suffix), clearIcon && /* @__PURE__ */ import_react.createElement(Affix$1, {
className: clsx(`${prefixCls}-clear`, classNames?.clear),
style: styles?.clear,
onMouseDown: (e) => {
e.nativeEvent._select_lazy = true;
onClearMouseDown?.(e);
}
}, clearIcon), children));
});
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useComponents.js
function useComponents$1(components, getInputElement, getRawInputElement) {
return import_react.useMemo(() => {
let { root, input } = components || {};
if (getRawInputElement) root = getRawInputElement();
if (getInputElement) input = getInputElement();
return {
root,
input
};
}, [
components,
getInputElement,
getRawInputElement
]);
}
//#endregion
//#region node_modules/@rc-component/select/es/BaseSelect/index.js
function _extends$79() {
_extends$79 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$79.apply(this, arguments);
}
/**
* ZombieJ:
* We are currently refactoring the semantic structure of the component. Changelog:
* - Remove `suffixIcon` and change to `suffix`.
* - Add `components.root` for replacing response element.
* - Remove `getInputElement` and `getRawInputElement` since we can use `components.input` instead.
*/
var isMultiple = (mode) => mode === "tags" || mode === "multiple";
var BaseSelect = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { id, prefixCls, className, styles, classNames, showSearch, tagRender, showScrollBar = "optional", direction, omitDomProps, displayValues, onDisplayValuesChange, emptyOptions, notFoundContent = "Not Found", onClear, maxCount, placeholder, mode, disabled, loading, getInputElement, getRawInputElement, open, defaultOpen, onPopupVisibleChange, activeValue, onActiveValueChange, activeDescendantId, searchValue, autoClearSearchValue, onSearch, onSearchSplit, tokenSeparators, allowClear, prefix, suffix, suffixIcon, clearIcon, OptionList, animation, transitionName, popupStyle, popupClassName, popupMatchSelectWidth, popupRender, popupAlign, placement, builtinPlacements, getPopupContainer, showAction = [], onFocus, onBlur, onKeyUp, onKeyDown, onMouseDown, components, ...restProps } = props;
const multiple = isMultiple(mode);
const containerRef = import_react.useRef(null);
const triggerRef = import_react.useRef(null);
const listRef = import_react.useRef(null);
/** Used for component focused management */
const [focused, setFocused] = import_react.useState(false);
import_react.useImperativeHandle(ref, () => ({
focus: containerRef.current?.focus,
blur: containerRef.current?.blur,
scrollTo: (arg) => listRef.current?.scrollTo(arg),
nativeElement: getDOM(containerRef.current)
}));
const mergedComponents = useComponents$1(components, getInputElement, getRawInputElement);
const mergedSearchValue = import_react.useMemo(() => {
if (mode !== "combobox") return searchValue;
const val = displayValues[0]?.value;
return typeof val === "string" || typeof val === "number" ? String(val) : "";
}, [
searchValue,
mode,
displayValues
]);
const customizeInputElement = mode === "combobox" && typeof getInputElement === "function" && getInputElement() || null;
const emptyListContent = !notFoundContent && emptyOptions;
const [rawOpen, mergedOpen, triggerOpen, lockOptions] = useOpen$1(defaultOpen || false, open, onPopupVisibleChange, (nextOpen) => disabled || emptyListContent ? false : nextOpen);
const tokenWithEnter = import_react.useMemo(() => (tokenSeparators || []).some((tokenSeparator) => ["\n", "\r\n"].includes(tokenSeparator)), [tokenSeparators]);
const onInternalSearch = (searchText, fromTyping, isCompositing) => {
if (multiple && isValidCount(maxCount) && displayValues.length >= maxCount) return;
let ret = true;
let newSearchText = searchText;
onActiveValueChange?.(null);
const separatedList = getSeparatedContent(searchText, tokenSeparators, isValidCount(maxCount) ? maxCount - displayValues.length : void 0);
const patchLabels = isCompositing ? null : separatedList;
if (mode !== "combobox" && patchLabels) {
newSearchText = "";
onSearchSplit?.(patchLabels);
triggerOpen(false);
ret = false;
}
if (onSearch && mergedSearchValue !== newSearchText) onSearch(newSearchText, { source: fromTyping ? "typing" : "effect" });
if (searchText && fromTyping && ret) triggerOpen(true);
return ret;
};
const onInternalSearchSubmit = (searchText) => {
if (!searchText || !searchText.trim()) return;
onSearch(searchText, { source: "submit" });
};
import_react.useEffect(() => {
if (!rawOpen && !multiple && mode !== "combobox") onInternalSearch("", false, false);
}, [rawOpen]);
import_react.useEffect(() => {
if (disabled) {
triggerOpen(false);
setFocused(false);
}
}, [disabled, mergedOpen]);
/**
* We record input value here to check if can press to clean up by backspace
* - null: Key is not down, this is reset by key up
* - true: Search text is empty when first time backspace down
* - false: Search text is not empty when first time backspace down
*/
const [getClearLock, setClearLock] = useLock();
const keyLockRef = import_react.useRef(false);
const onInternalKeyDown = (event) => {
const clearLock = getClearLock();
const { key } = event;
const isEnterKey = key === "Enter";
const isSpaceKey = key === " ";
if (isEnterKey || isSpaceKey) {
const isCombobox = mode === "combobox";
if (isSpaceKey && !(isCombobox || showSearch) || isEnterKey && !isCombobox) event.preventDefault();
if (!mergedOpen) triggerOpen(true);
}
setClearLock(!!mergedSearchValue);
if (key === "Backspace" && !clearLock && multiple && !mergedSearchValue && displayValues.length) {
const cloneDisplayValues = [...displayValues];
let removedDisplayValue = null;
for (let i = cloneDisplayValues.length - 1; i >= 0; i -= 1) {
const current = cloneDisplayValues[i];
if (!current.disabled) {
cloneDisplayValues.splice(i, 1);
removedDisplayValue = current;
break;
}
}
if (removedDisplayValue) onDisplayValuesChange(cloneDisplayValues, {
type: "remove",
values: [removedDisplayValue]
});
}
if (mergedOpen && (!isEnterKey || !keyLockRef.current) && !isSpaceKey) {
if (isEnterKey) keyLockRef.current = true;
listRef.current?.onKeyDown(event);
}
onKeyDown?.(event);
};
const onInternalKeyUp = (event, ...rest) => {
if (mergedOpen) listRef.current?.onKeyUp(event, ...rest);
if (event.key === "Enter") keyLockRef.current = false;
onKeyUp?.(event, ...rest);
};
const onSelectorRemove = useEvent((val) => {
onDisplayValuesChange(displayValues.filter((i) => i !== val), {
type: "remove",
values: [val]
});
});
const onInputBlur = () => {
keyLockRef.current = false;
};
const getSelectElements = () => [getDOM(containerRef.current), triggerRef.current?.getPopupElement()];
useSelectTriggerControl(getSelectElements, mergedOpen, triggerOpen, !!mergedComponents.root);
const internalMouseDownRef = import_react.useRef(false);
const onInternalFocus = (event) => {
setFocused(true);
if (!disabled) {
if (showAction.includes("focus")) triggerOpen(true);
onFocus?.(event);
}
};
const onRootBlur = () => {
if (mergedOpen && !internalMouseDownRef.current) triggerOpen(false, { cancelFun: () => isInside(getSelectElements(), document.activeElement) });
};
const onInternalBlur = (event) => {
setFocused(false);
if (mergedSearchValue) {
if (mode === "tags") onSearch(mergedSearchValue, { source: "submit" });
else if (mode === "multiple") onSearch("", { source: "blur" });
}
onRootBlur();
if (!disabled) onBlur?.(event);
};
const onRootMouseDown = (event, ...restArgs) => {
const { target } = event;
if ((triggerRef.current?.getPopupElement())?.contains(target) && triggerOpen) triggerOpen(true);
onMouseDown?.(event, ...restArgs);
internalMouseDownRef.current = true;
macroTask(() => {
internalMouseDownRef.current = false;
});
};
const [, forceUpdate] = import_react.useState({});
function onPopupMouseEnter() {
forceUpdate({});
}
let onTriggerVisibleChange;
if (!!mergedComponents.root) onTriggerVisibleChange = (newOpen) => {
triggerOpen(newOpen);
};
const baseSelectContext = import_react.useMemo(() => ({
...props,
notFoundContent,
open: mergedOpen,
triggerOpen: mergedOpen,
rawOpen,
id,
showSearch,
multiple,
toggleOpen: triggerOpen,
showScrollBar,
styles,
classNames,
lockOptions
}), [
props,
notFoundContent,
triggerOpen,
id,
showSearch,
multiple,
mergedOpen,
rawOpen,
showScrollBar,
styles,
classNames,
lockOptions
]);
const mergedSuffixIcon = import_react.useMemo(() => {
const nextSuffix = suffix ?? suffixIcon;
if (typeof nextSuffix === "function") return nextSuffix({
searchValue: mergedSearchValue,
open: mergedOpen,
focused,
showSearch,
loading
});
return nextSuffix;
}, [
suffix,
suffixIcon,
mergedSearchValue,
mergedOpen,
focused,
showSearch,
loading
]);
const onClearMouseDown = () => {
onClear?.();
containerRef.current?.focus();
onDisplayValuesChange([], {
type: "clear",
values: displayValues
});
onInternalSearch("", false, false);
};
const { allowClear: mergedAllowClear, clearIcon: clearNode } = useAllowClear(prefixCls, displayValues, allowClear, clearIcon, disabled, mergedSearchValue, mode);
const optionList = /* @__PURE__ */ import_react.createElement(OptionList, { ref: listRef });
const mergedClassName = clsx(prefixCls, className, {
[`${prefixCls}-focused`]: focused,
[`${prefixCls}-multiple`]: multiple,
[`${prefixCls}-single`]: !multiple,
[`${prefixCls}-allow-clear`]: mergedAllowClear,
[`${prefixCls}-show-arrow`]: mergedSuffixIcon !== void 0 && mergedSuffixIcon !== null,
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-loading`]: loading,
[`${prefixCls}-open`]: mergedOpen,
[`${prefixCls}-customize-input`]: customizeInputElement,
[`${prefixCls}-show-search`]: showSearch
});
let renderNode = /* @__PURE__ */ import_react.createElement(SelectInput_default, _extends$79({}, restProps, {
ref: containerRef,
prefixCls,
className: mergedClassName,
focused,
prefix,
suffix: mergedSuffixIcon,
clearIcon: clearNode,
multiple,
mode,
displayValues,
placeholder,
searchValue: mergedSearchValue,
activeValue,
onSearch: onInternalSearch,
onSearchSubmit: onInternalSearchSubmit,
onInputBlur,
onFocus: onInternalFocus,
onBlur: onInternalBlur,
onClearMouseDown,
onKeyDown: onInternalKeyDown,
onKeyUp: onInternalKeyUp,
onSelectorRemove,
tokenWithEnter,
onMouseDown: onRootMouseDown,
components: mergedComponents
}));
renderNode = /* @__PURE__ */ import_react.createElement(RefSelectTrigger, {
ref: triggerRef,
disabled,
prefixCls,
visible: mergedOpen,
popupElement: optionList,
animation,
transitionName,
popupStyle,
popupClassName,
direction,
popupMatchSelectWidth,
popupRender,
popupAlign,
placement,
builtinPlacements,
getPopupContainer,
empty: emptyOptions,
onPopupVisibleChange: onTriggerVisibleChange,
onPopupMouseEnter,
onPopupMouseDown: onRootMouseDown,
onPopupBlur: onRootBlur
}, renderNode);
return /* @__PURE__ */ import_react.createElement(BaseSelectContext.Provider, { value: baseSelectContext }, /* @__PURE__ */ import_react.createElement(Polite, {
visible: focused && !mergedOpen,
values: displayValues
}), renderNode);
});
BaseSelect.displayName = "BaseSelect";
//#endregion
//#region node_modules/@rc-component/select/es/OptGroup.js
/* istanbul ignore file */
/** This is a placeholder, not real render in dom */
var OptGroup = () => null;
OptGroup.isSelectOptGroup = true;
//#endregion
//#region node_modules/@rc-component/select/es/Option.js
/* istanbul ignore file */
/** This is a placeholder, not real render in dom */
var Option$4 = () => null;
Option$4.isSelectOption = true;
//#endregion
//#region node_modules/@rc-component/virtual-list/es/Filler.js
/**
* Fill component to provided the scroll content real height.
*/
var Filler = /* @__PURE__ */ import_react.forwardRef(({ height, offsetY, offsetX, children, prefixCls, onInnerResize, innerProps, rtl, extra }, ref) => {
let outerStyle = {};
let innerStyle = {
display: "flex",
flexDirection: "column"
};
if (offsetY !== void 0) {
outerStyle = {
height,
position: "relative",
overflow: "hidden"
};
innerStyle = {
...innerStyle,
transform: `translateY(${offsetY}px)`,
[rtl ? "marginRight" : "marginLeft"]: -offsetX,
position: "absolute",
left: 0,
right: 0,
top: 0
};
}
return /* @__PURE__ */ import_react.createElement("div", { style: outerStyle }, /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: ({ offsetHeight }) => {
if (offsetHeight && onInnerResize) onInnerResize();
} }, /* @__PURE__ */ import_react.createElement("div", _extends$91({
style: innerStyle,
className: clsx({ [`${prefixCls}-holder-inner`]: prefixCls }),
ref
}, innerProps), children, extra)));
});
Filler.displayName = "Filler";
//#endregion
//#region node_modules/@rc-component/virtual-list/es/Item.js
function Item$2({ children, setRef }) {
const refFunc = import_react.useCallback((node) => {
setRef(node);
}, []);
return /* @__PURE__ */ import_react.cloneElement(children, { ref: refFunc });
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useChildren.js
function useChildren$1(list, startIndex, endIndex, scrollWidth, offsetX, setNodeRef, renderFunc, { getKey }) {
return list.slice(startIndex, endIndex + 1).map((item, index) => {
const node = renderFunc(item, startIndex + index, {
style: { width: scrollWidth },
offsetX
});
const key = getKey(item);
return /* @__PURE__ */ import_react.createElement(Item$2, {
key,
setRef: (ele) => setNodeRef(item, ele)
}, node);
});
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/utils/algorithmUtil.js
/**
* We assume that 2 list has only 1 item diff and others keeping the order.
* So we can use dichotomy algorithm to find changed one.
*/
function findListDiffIndex(originList, targetList, getKey) {
const originLen = originList.length;
const targetLen = targetList.length;
let shortList;
let longList;
if (originLen === 0 && targetLen === 0) return null;
if (originLen < targetLen) {
shortList = originList;
longList = targetList;
} else {
shortList = targetList;
longList = originList;
}
const notExistKey = { __EMPTY_ITEM__: true };
function getItemKey(item) {
if (item !== void 0) return getKey(item);
return notExistKey;
}
let diffIndex = null;
let multiple = Math.abs(originLen - targetLen) !== 1;
for (let i = 0; i < longList.length; i += 1) {
const shortKey = getItemKey(shortList[i]);
if (shortKey !== getItemKey(longList[i])) {
diffIndex = i;
multiple = multiple || shortKey !== getItemKey(longList[i + 1]);
break;
}
}
return diffIndex === null ? null : {
index: diffIndex,
multiple
};
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useDiffItem.js
function useDiffItem(data, getKey, onDiff) {
const [prevData, setPrevData] = import_react.useState(data);
const [diffItem, setDiffItem] = import_react.useState(null);
import_react.useEffect(() => {
const diff = findListDiffIndex(prevData || [], data || [], getKey);
if (diff?.index !== void 0) {
onDiff?.(diff.index);
setDiffItem(data[diff.index]);
}
setPrevData(data);
}, [data]);
return [diffItem];
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/utils/isFirefox.js
var isFF = typeof navigator === "object" && /Firefox/i.test(navigator.userAgent);
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useOriginScroll.js
var useOriginScroll_default = ((isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight) => {
const lockRef = (0, import_react.useRef)(false);
const lockTimeoutRef = (0, import_react.useRef)(null);
function lockScroll() {
clearTimeout(lockTimeoutRef.current);
lockRef.current = true;
lockTimeoutRef.current = setTimeout(() => {
lockRef.current = false;
}, 50);
}
const scrollPingRef = (0, import_react.useRef)({
top: isScrollAtTop,
bottom: isScrollAtBottom,
left: isScrollAtLeft,
right: isScrollAtRight
});
scrollPingRef.current.top = isScrollAtTop;
scrollPingRef.current.bottom = isScrollAtBottom;
scrollPingRef.current.left = isScrollAtLeft;
scrollPingRef.current.right = isScrollAtRight;
return (isHorizontal, delta, smoothOffset = false) => {
const originScroll = isHorizontal ? delta < 0 && scrollPingRef.current.left || delta > 0 && scrollPingRef.current.right : delta < 0 && scrollPingRef.current.top || delta > 0 && scrollPingRef.current.bottom;
if (smoothOffset && originScroll) {
clearTimeout(lockTimeoutRef.current);
lockRef.current = false;
} else if (!originScroll || lockRef.current) lockScroll();
return !lockRef.current && originScroll;
};
});
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useFrameWheel.js
function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight, horizontalScroll, onWheelDelta) {
const offsetRef = (0, import_react.useRef)(0);
const nextFrameRef = (0, import_react.useRef)(null);
const wheelValueRef = (0, import_react.useRef)(null);
const isMouseScrollRef = (0, import_react.useRef)(false);
const originScroll = useOriginScroll_default(isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight);
function onWheelY(e, deltaY) {
wrapperRaf.cancel(nextFrameRef.current);
if (originScroll(false, deltaY)) return;
const event = e;
if (!event._virtualHandled) event._virtualHandled = true;
else return;
offsetRef.current += deltaY;
wheelValueRef.current = deltaY;
if (!isFF) event.preventDefault();
nextFrameRef.current = wrapperRaf(() => {
const patchMultiple = isMouseScrollRef.current ? 10 : 1;
onWheelDelta(offsetRef.current * patchMultiple, false);
offsetRef.current = 0;
});
}
function onWheelX(event, deltaX) {
onWheelDelta(deltaX, true);
if (!isFF) event.preventDefault();
}
const wheelDirectionRef = (0, import_react.useRef)(null);
const wheelDirectionCleanRef = (0, import_react.useRef)(null);
function onWheel(event) {
if (!inVirtual) return;
wrapperRaf.cancel(wheelDirectionCleanRef.current);
wheelDirectionCleanRef.current = wrapperRaf(() => {
wheelDirectionRef.current = null;
}, 2);
const { deltaX, deltaY, shiftKey } = event;
let mergedDeltaX = deltaX;
let mergedDeltaY = deltaY;
if (wheelDirectionRef.current === "sx" || !wheelDirectionRef.current && (shiftKey || false) && deltaY && !deltaX) {
mergedDeltaX = deltaY;
mergedDeltaY = 0;
wheelDirectionRef.current = "sx";
}
const absX = Math.abs(mergedDeltaX);
const absY = Math.abs(mergedDeltaY);
if (wheelDirectionRef.current === null) wheelDirectionRef.current = horizontalScroll && absX > absY ? "x" : "y";
if (wheelDirectionRef.current === "y") onWheelY(event, mergedDeltaY);
else onWheelX(event, mergedDeltaX);
}
function onFireFoxScroll(event) {
if (!inVirtual) return;
isMouseScrollRef.current = event.detail === wheelValueRef.current;
}
return [onWheel, onFireFoxScroll];
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useGetSize.js
/**
* Size info need loop query for the `heights` which will has the perf issue.
* Let cache result for each render phase.
*/
function useGetSize(mergedData, getKey, heights, itemHeight) {
const [key2Index, bottomList] = import_react.useMemo(() => [/* @__PURE__ */ new Map(), []], [
mergedData,
heights.id,
itemHeight
]);
const getSize = (startKey, endKey = startKey) => {
let startIndex = key2Index.get(startKey);
let endIndex = key2Index.get(endKey);
if (startIndex === void 0 || endIndex === void 0) {
const dataLen = mergedData.length;
for (let i = bottomList.length; i < dataLen; i += 1) {
const item = mergedData[i];
const key = getKey(item);
key2Index.set(key, i);
const cacheHeight = heights.get(key) ?? itemHeight;
bottomList[i] = (bottomList[i - 1] || 0) + cacheHeight;
if (key === startKey) startIndex = i;
if (key === endKey) endIndex = i;
if (startIndex !== void 0 && endIndex !== void 0) break;
}
}
return {
top: bottomList[startIndex - 1] || 0,
bottom: bottomList[endIndex]
};
};
return getSize;
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/utils/CacheMap.js
var CacheMap = class {
maps;
id = 0;
diffRecords = /* @__PURE__ */ new Map();
constructor() {
this.maps = Object.create(null);
}
set(key, value) {
this.diffRecords.set(key, this.maps[key]);
this.maps[key] = value;
this.id += 1;
}
get(key) {
return this.maps[key];
}
/**
* CacheMap will record the key changed.
* To help to know what's update in the next render.
*/
resetRecord() {
this.diffRecords.clear();
}
getRecord() {
return this.diffRecords;
}
};
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useHeights.js
function parseNumber(value) {
const num = parseFloat(value);
return isNaN(num) ? 0 : num;
}
function useHeights(getKey, onItemAdd, onItemRemove) {
const [updatedMark, setUpdatedMark] = import_react.useState(0);
const instanceRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
const heightsRef = (0, import_react.useRef)(new CacheMap());
const promiseIdRef = (0, import_react.useRef)(0);
function cancelRaf() {
promiseIdRef.current += 1;
}
function collectHeight(sync = false) {
cancelRaf();
const doCollect = () => {
let changed = false;
instanceRef.current.forEach((element, key) => {
if (element && element.offsetParent) {
const { offsetHeight } = element;
const { marginTop, marginBottom } = getComputedStyle(element);
const marginTopNum = parseNumber(marginTop);
const marginBottomNum = parseNumber(marginBottom);
const totalHeight = offsetHeight + marginTopNum + marginBottomNum;
if (heightsRef.current.get(key) !== totalHeight) {
heightsRef.current.set(key, totalHeight);
changed = true;
}
}
});
if (changed) setUpdatedMark((c) => c + 1);
};
if (sync) doCollect();
else {
promiseIdRef.current += 1;
const id = promiseIdRef.current;
Promise.resolve().then(() => {
if (id === promiseIdRef.current) doCollect();
});
}
}
function setInstanceRef(item, instance) {
const key = getKey(item);
const origin = instanceRef.current.get(key);
if (instance) {
instanceRef.current.set(key, instance);
collectHeight();
} else instanceRef.current.delete(key);
if (!origin !== !instance) if (instance) onItemAdd?.(item);
else onItemRemove?.(item);
}
(0, import_react.useEffect)(() => {
return cancelRaf;
}, []);
return [
setInstanceRef,
collectHeight,
heightsRef.current,
updatedMark
];
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useMobileTouchMove.js
var SMOOTH_PTG = 14 / 15;
function useMobileTouchMove(inVirtual, listRef, callback) {
const touchedRef = (0, import_react.useRef)(false);
const touchXRef = (0, import_react.useRef)(0);
const touchYRef = (0, import_react.useRef)(0);
const elementRef = (0, import_react.useRef)(null);
const intervalRef = (0, import_react.useRef)(null);
let cleanUpEvents;
const onTouchMove = (e) => {
if (touchedRef.current) {
const currentX = Math.ceil(e.touches[0].pageX);
const currentY = Math.ceil(e.touches[0].pageY);
let offsetX = touchXRef.current - currentX;
let offsetY = touchYRef.current - currentY;
const isHorizontal = Math.abs(offsetX) > Math.abs(offsetY);
if (isHorizontal) touchXRef.current = currentX;
else touchYRef.current = currentY;
const scrollHandled = callback(isHorizontal, isHorizontal ? offsetX : offsetY, false, e);
if (scrollHandled) e.preventDefault();
clearInterval(intervalRef.current);
if (scrollHandled) intervalRef.current = setInterval(() => {
if (isHorizontal) offsetX *= SMOOTH_PTG;
else offsetY *= SMOOTH_PTG;
const offset = Math.floor(isHorizontal ? offsetX : offsetY);
if (!callback(isHorizontal, offset, true) || Math.abs(offset) <= .1) clearInterval(intervalRef.current);
}, 16);
}
};
const onTouchEnd = () => {
touchedRef.current = false;
cleanUpEvents();
};
const onTouchStart = (e) => {
cleanUpEvents();
if (e.touches.length === 1 && !touchedRef.current) {
touchedRef.current = true;
touchXRef.current = Math.ceil(e.touches[0].pageX);
touchYRef.current = Math.ceil(e.touches[0].pageY);
elementRef.current = e.target;
elementRef.current.addEventListener("touchmove", onTouchMove, { passive: false });
elementRef.current.addEventListener("touchend", onTouchEnd, { passive: true });
}
};
cleanUpEvents = () => {
if (elementRef.current) {
elementRef.current.removeEventListener("touchmove", onTouchMove);
elementRef.current.removeEventListener("touchend", onTouchEnd);
}
};
useLayoutEffect$1(() => {
if (inVirtual) listRef.current.addEventListener("touchstart", onTouchStart, { passive: true });
return () => {
listRef.current?.removeEventListener("touchstart", onTouchStart);
cleanUpEvents();
clearInterval(intervalRef.current);
};
}, [inVirtual]);
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useScrollDrag.js
function smoothScrollOffset(offset) {
return Math.floor(offset ** .5);
}
function getPageXY(e, horizontal) {
return ("touches" in e ? e.touches[0] : e)[horizontal ? "pageX" : "pageY"] - window[horizontal ? "scrollX" : "scrollY"];
}
function useScrollDrag(inVirtual, componentRef, onScrollOffset) {
import_react.useEffect(() => {
const ele = componentRef.current;
if (inVirtual && ele) {
let mouseDownLock = false;
let rafId;
let offset;
const stopScroll = () => {
wrapperRaf.cancel(rafId);
};
const continueScroll = () => {
stopScroll();
rafId = wrapperRaf(() => {
onScrollOffset(offset);
continueScroll();
});
};
const clearDragState = () => {
mouseDownLock = false;
stopScroll();
};
const onMouseDown = (e) => {
if (e.target.draggable || e.button !== 0) return;
const event = e;
if (!event._virtualHandled) {
event._virtualHandled = true;
mouseDownLock = true;
}
};
const onMouseMove = (e) => {
if (mouseDownLock) {
const mouseY = getPageXY(e, false);
const { top, bottom } = ele.getBoundingClientRect();
if (mouseY <= top) {
offset = -smoothScrollOffset(top - mouseY);
continueScroll();
} else if (mouseY >= bottom) {
offset = smoothScrollOffset(mouseY - bottom);
continueScroll();
} else stopScroll();
}
};
ele.addEventListener("mousedown", onMouseDown);
ele.ownerDocument.addEventListener("mouseup", clearDragState);
ele.ownerDocument.addEventListener("mousemove", onMouseMove);
ele.ownerDocument.addEventListener("dragend", clearDragState);
return () => {
ele.removeEventListener("mousedown", onMouseDown);
ele.ownerDocument.removeEventListener("mouseup", clearDragState);
ele.ownerDocument.removeEventListener("mousemove", onMouseMove);
ele.ownerDocument.removeEventListener("dragend", clearDragState);
stopScroll();
};
}
}, [inVirtual]);
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/hooks/useScrollTo.js
var MAX_TIMES = 10;
function useScrollTo$1(containerRef, data, heights, itemHeight, getKey, collectHeight, syncScrollTop, triggerFlash) {
const scrollRef = import_react.useRef();
const [syncState, setSyncState] = import_react.useState(null);
useLayoutEffect$1(() => {
if (syncState && syncState.times < MAX_TIMES) {
if (!containerRef.current) {
setSyncState((ori) => ({ ...ori }));
return;
}
collectHeight();
const { targetAlign, originAlign, index, offset } = syncState;
const height = containerRef.current.clientHeight;
let needCollectHeight = false;
let newTargetAlign = targetAlign;
let targetTop = null;
if (height) {
const mergedAlign = targetAlign || originAlign;
let stackTop = 0;
let itemTop = 0;
let itemBottom = 0;
const maxLen = Math.min(data.length - 1, index);
for (let i = 0; i <= maxLen; i += 1) {
const key = getKey(data[i]);
itemTop = stackTop;
const cacheHeight = heights.get(key);
itemBottom = itemTop + (cacheHeight === void 0 ? itemHeight : cacheHeight);
stackTop = itemBottom;
}
let leftHeight = mergedAlign === "top" ? offset : height - offset;
for (let i = maxLen; i >= 0; i -= 1) {
const key = getKey(data[i]);
const cacheHeight = heights.get(key);
if (cacheHeight === void 0) {
needCollectHeight = true;
break;
}
leftHeight -= cacheHeight;
if (leftHeight <= 0) break;
}
switch (mergedAlign) {
case "top":
targetTop = itemTop - offset;
break;
case "bottom":
targetTop = itemBottom - height + offset;
break;
default: {
const { scrollTop } = containerRef.current;
const scrollBottom = scrollTop + height;
if (itemTop < scrollTop) newTargetAlign = "top";
else if (itemBottom > scrollBottom) newTargetAlign = "bottom";
}
}
if (targetTop !== null) syncScrollTop(targetTop);
if (targetTop !== syncState.lastTop) needCollectHeight = true;
}
if (needCollectHeight) setSyncState({
...syncState,
times: syncState.times + 1,
targetAlign: newTargetAlign,
lastTop: targetTop
});
} else if (syncState?.times === MAX_TIMES) warningOnce(false, "Seems `scrollTo` with `rc-virtual-list` reach the max limitation. Please fire issue for us. Thanks.");
}, [syncState, containerRef.current]);
return (arg) => {
if (arg === null || arg === void 0) {
triggerFlash();
return;
}
wrapperRaf.cancel(scrollRef.current);
if (typeof arg === "number") syncScrollTop(arg);
else if (arg && typeof arg === "object") {
let index;
const { align } = arg;
if ("index" in arg) ({index} = arg);
else index = data.findIndex((item) => getKey(item) === arg.key);
const { offset = 0 } = arg;
setSyncState({
times: 0,
index,
offset,
originAlign: align
});
}
};
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/ScrollBar.js
var ScrollBar = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, rtl, scrollOffset, scrollRange, onStartMove, onStopMove, onScroll, horizontal, spinSize, containerSize, style, thumbStyle: propsThumbStyle, showScrollBar } = props;
const [dragging, setDragging] = import_react.useState(false);
const [pageXY, setPageXY] = import_react.useState(null);
const [startTop, setStartTop] = import_react.useState(null);
const isLTR = !rtl;
const scrollbarRef = import_react.useRef();
const thumbRef = import_react.useRef();
const [visible, setVisible] = import_react.useState(showScrollBar);
const visibleTimeoutRef = import_react.useRef();
const delayHidden = () => {
if (showScrollBar === true || showScrollBar === false) return;
clearTimeout(visibleTimeoutRef.current);
setVisible(true);
visibleTimeoutRef.current = setTimeout(() => {
setVisible(false);
}, 3e3);
};
const enableScrollRange = scrollRange - containerSize || 0;
const enableOffsetRange = containerSize - spinSize || 0;
const top = import_react.useMemo(() => {
if (scrollOffset === 0 || enableScrollRange === 0) return 0;
return scrollOffset / enableScrollRange * enableOffsetRange;
}, [
scrollOffset,
enableScrollRange,
enableOffsetRange
]);
const onContainerMouseDown = (e) => {
e.stopPropagation();
e.preventDefault();
};
const stateRef = import_react.useRef({
top,
dragging,
pageY: pageXY,
startTop
});
stateRef.current = {
top,
dragging,
pageY: pageXY,
startTop
};
const onThumbMouseDown = (e) => {
setDragging(true);
setPageXY(getPageXY(e, horizontal));
setStartTop(stateRef.current.top);
onStartMove();
e.stopPropagation();
e.preventDefault();
};
import_react.useEffect(() => {
const onScrollbarTouchStart = (e) => {
e.preventDefault();
};
const scrollbarEle = scrollbarRef.current;
const thumbEle = thumbRef.current;
scrollbarEle.addEventListener("touchstart", onScrollbarTouchStart, { passive: false });
thumbEle.addEventListener("touchstart", onThumbMouseDown, { passive: false });
return () => {
scrollbarEle.removeEventListener("touchstart", onScrollbarTouchStart);
thumbEle.removeEventListener("touchstart", onThumbMouseDown);
};
}, []);
const enableScrollRangeRef = import_react.useRef();
enableScrollRangeRef.current = enableScrollRange;
const enableOffsetRangeRef = import_react.useRef();
enableOffsetRangeRef.current = enableOffsetRange;
import_react.useEffect(() => {
if (dragging) {
let moveRafId;
const onMouseMove = (e) => {
const { dragging: stateDragging, pageY: statePageY, startTop: stateStartTop } = stateRef.current;
wrapperRaf.cancel(moveRafId);
const rect = scrollbarRef.current.getBoundingClientRect();
const scale = containerSize / (horizontal ? rect.width : rect.height);
if (stateDragging) {
const offset = (getPageXY(e, horizontal) - statePageY) * scale;
let newTop = stateStartTop;
if (!isLTR && horizontal) newTop -= offset;
else newTop += offset;
const tmpEnableScrollRange = enableScrollRangeRef.current;
const tmpEnableOffsetRange = enableOffsetRangeRef.current;
const ptg = tmpEnableOffsetRange ? newTop / tmpEnableOffsetRange : 0;
let newScrollTop = Math.ceil(ptg * tmpEnableScrollRange);
newScrollTop = Math.max(newScrollTop, 0);
newScrollTop = Math.min(newScrollTop, tmpEnableScrollRange);
moveRafId = wrapperRaf(() => {
onScroll(newScrollTop, horizontal);
});
}
};
const onMouseUp = () => {
setDragging(false);
onStopMove();
};
window.addEventListener("mousemove", onMouseMove, { passive: true });
window.addEventListener("touchmove", onMouseMove, { passive: true });
window.addEventListener("mouseup", onMouseUp, { passive: true });
window.addEventListener("touchend", onMouseUp, { passive: true });
return () => {
window.removeEventListener("mousemove", onMouseMove);
window.removeEventListener("touchmove", onMouseMove);
window.removeEventListener("mouseup", onMouseUp);
window.removeEventListener("touchend", onMouseUp);
wrapperRaf.cancel(moveRafId);
};
}
}, [dragging]);
import_react.useEffect(() => {
delayHidden();
return () => {
clearTimeout(visibleTimeoutRef.current);
};
}, [scrollOffset]);
import_react.useImperativeHandle(ref, () => ({ delayHidden }));
const scrollbarPrefixCls = `${prefixCls}-scrollbar`;
const containerStyle = {
position: "absolute",
visibility: visible ? null : "hidden"
};
const thumbStyle = {
position: "absolute",
borderRadius: 99,
background: "var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",
cursor: "pointer",
userSelect: "none"
};
if (horizontal) {
Object.assign(containerStyle, {
height: 8,
left: 0,
right: 0,
bottom: 0
});
Object.assign(thumbStyle, {
height: "100%",
width: spinSize,
[isLTR ? "left" : "right"]: top
});
} else {
Object.assign(containerStyle, {
width: 8,
top: 0,
bottom: 0,
[isLTR ? "right" : "left"]: 0
});
Object.assign(thumbStyle, {
width: "100%",
height: spinSize,
top
});
}
return /* @__PURE__ */ import_react.createElement("div", {
ref: scrollbarRef,
className: clsx(scrollbarPrefixCls, {
[`${scrollbarPrefixCls}-horizontal`]: horizontal,
[`${scrollbarPrefixCls}-vertical`]: !horizontal,
[`${scrollbarPrefixCls}-visible`]: visible
}),
style: {
...containerStyle,
...style
},
onMouseDown: onContainerMouseDown,
onMouseMove: delayHidden
}, /* @__PURE__ */ import_react.createElement("div", {
ref: thumbRef,
className: clsx(`${scrollbarPrefixCls}-thumb`, { [`${scrollbarPrefixCls}-thumb-moving`]: dragging }),
style: {
...thumbStyle,
...propsThumbStyle
},
onMouseDown: onThumbMouseDown
}));
});
ScrollBar.displayName = "ScrollBar";
//#endregion
//#region node_modules/@rc-component/virtual-list/es/utils/scrollbarUtil.js
var MIN_SIZE = 20;
function getSpinSize(containerSize = 0, scrollRange = 0) {
let baseSize = containerSize / scrollRange * containerSize;
if (isNaN(baseSize)) baseSize = 0;
baseSize = Math.max(baseSize, MIN_SIZE);
return Math.floor(baseSize);
}
//#endregion
//#region node_modules/@rc-component/virtual-list/es/List.js
var EMPTY_DATA$1 = [];
var ScrollStyle = {
overflowY: "auto",
overflowAnchor: "none"
};
function RawList(props, ref) {
const { prefixCls = "rc-virtual-list", className, height, itemHeight, fullHeight = true, style, data, children, itemKey, virtual, direction, scrollWidth, component: Component = "div", onScroll, onVirtualScroll, onVisibleChange, innerProps, extraRender, styles, showScrollBar = "optional", ...restProps } = props;
const getKey = import_react.useCallback((item) => {
if (typeof itemKey === "function") return itemKey(item);
return item?.[itemKey];
}, [itemKey]);
const [setInstanceRef, collectHeight, heights, heightUpdatedMark] = useHeights(getKey, null, null);
const useVirtual = !!(virtual !== false && height && itemHeight);
const containerHeight = import_react.useMemo(() => Object.values(heights.maps).reduce((total, curr) => total + curr, 0), [heights.id, heights.maps]);
const inVirtual = useVirtual && data && (Math.max(itemHeight * data.length, containerHeight) > height || !!scrollWidth);
const isRTL = direction === "rtl";
const mergedClassName = clsx(prefixCls, { [`${prefixCls}-rtl`]: isRTL }, className);
const mergedData = data || EMPTY_DATA$1;
const componentRef = (0, import_react.useRef)();
const fillerInnerRef = (0, import_react.useRef)();
const containerRef = (0, import_react.useRef)();
const [offsetTop, setOffsetTop] = (0, import_react.useState)(0);
const [offsetLeft, setOffsetLeft] = (0, import_react.useState)(0);
const [scrollMoving, setScrollMoving] = (0, import_react.useState)(false);
const onScrollbarStartMove = () => {
setScrollMoving(true);
};
const onScrollbarStopMove = () => {
setScrollMoving(false);
};
const sharedConfig = { getKey };
function syncScrollTop(newTop) {
setOffsetTop((origin) => {
let value;
if (typeof newTop === "function") value = newTop(origin);
else value = newTop;
const alignedTop = keepInRange(value);
componentRef.current.scrollTop = alignedTop;
return alignedTop;
});
}
const rangeRef = (0, import_react.useRef)({
start: 0,
end: mergedData.length
});
const diffItemRef = (0, import_react.useRef)();
const [diffItem] = useDiffItem(mergedData, getKey);
diffItemRef.current = diffItem;
const { scrollHeight, start, end, offset: fillerOffset } = import_react.useMemo(() => {
if (!useVirtual) return {
scrollHeight: void 0,
start: 0,
end: mergedData.length - 1,
offset: void 0
};
if (!inVirtual) return {
scrollHeight: fillerInnerRef.current?.offsetHeight || 0,
start: 0,
end: mergedData.length - 1,
offset: void 0
};
let itemTop = 0;
let startIndex;
let startOffset;
let endIndex;
const dataLen = mergedData.length;
for (let i = 0; i < dataLen; i += 1) {
const item = mergedData[i];
const key = getKey(item);
const cacheHeight = heights.get(key);
const currentItemBottom = itemTop + (cacheHeight === void 0 ? itemHeight : cacheHeight);
if (currentItemBottom >= offsetTop && startIndex === void 0) {
startIndex = i;
startOffset = itemTop;
}
if (currentItemBottom > offsetTop + height && endIndex === void 0) endIndex = i;
itemTop = currentItemBottom;
}
if (startIndex === void 0) {
startIndex = 0;
startOffset = 0;
endIndex = Math.ceil(height / itemHeight);
}
if (endIndex === void 0) endIndex = mergedData.length - 1;
endIndex = Math.min(endIndex + 1, mergedData.length - 1);
return {
scrollHeight: itemTop,
start: startIndex,
end: endIndex,
offset: startOffset
};
}, [
inVirtual,
useVirtual,
offsetTop,
mergedData,
heightUpdatedMark,
height
]);
rangeRef.current.start = start;
rangeRef.current.end = end;
import_react.useLayoutEffect(() => {
const changedRecord = heights.getRecord();
if (changedRecord.size === 1) {
const recordKey = Array.from(changedRecord.keys())[0];
const prevCacheHeight = changedRecord.get(recordKey);
const startItem = mergedData[start];
if (startItem && prevCacheHeight === void 0) {
if (getKey(startItem) === recordKey) {
const diffHeight = heights.get(recordKey) - itemHeight;
syncScrollTop((ori) => {
return ori + diffHeight;
});
}
}
}
heights.resetRecord();
}, [scrollHeight]);
const [size, setSize] = import_react.useState({
width: 0,
height
});
const onHolderResize = (sizeInfo) => {
setSize({
width: sizeInfo.offsetWidth,
height: sizeInfo.offsetHeight
});
};
const verticalScrollBarRef = (0, import_react.useRef)();
const horizontalScrollBarRef = (0, import_react.useRef)();
const horizontalScrollBarSpinSize = import_react.useMemo(() => getSpinSize(size.width, scrollWidth), [size.width, scrollWidth]);
const verticalScrollBarSpinSize = import_react.useMemo(() => getSpinSize(size.height, scrollHeight), [size.height, scrollHeight]);
const maxScrollHeight = scrollHeight - height;
const maxScrollHeightRef = (0, import_react.useRef)(maxScrollHeight);
maxScrollHeightRef.current = maxScrollHeight;
function keepInRange(newScrollTop) {
let newTop = newScrollTop;
if (!Number.isNaN(maxScrollHeightRef.current)) newTop = Math.min(newTop, maxScrollHeightRef.current);
newTop = Math.max(newTop, 0);
return newTop;
}
const isScrollAtTop = offsetTop <= 0;
const isScrollAtBottom = offsetTop >= maxScrollHeight;
const isScrollAtLeft = offsetLeft <= 0;
const isScrollAtRight = offsetLeft >= scrollWidth;
const originScroll = useOriginScroll_default(isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight);
const getVirtualScrollInfo = () => ({
x: isRTL ? -offsetLeft : offsetLeft,
y: offsetTop
});
const lastVirtualScrollInfoRef = (0, import_react.useRef)(getVirtualScrollInfo());
const triggerScroll = useEvent((params) => {
if (onVirtualScroll) {
const nextInfo = {
...getVirtualScrollInfo(),
...params
};
if (lastVirtualScrollInfoRef.current.x !== nextInfo.x || lastVirtualScrollInfoRef.current.y !== nextInfo.y) {
onVirtualScroll(nextInfo);
lastVirtualScrollInfoRef.current = nextInfo;
}
}
});
function onScrollBar(newScrollOffset, horizontal) {
const newOffset = newScrollOffset;
if (horizontal) {
(0, import_react_dom.flushSync)(() => {
setOffsetLeft(newOffset);
});
triggerScroll();
} else syncScrollTop(newOffset);
}
function onFallbackScroll(e) {
const { scrollTop: newScrollTop } = e.currentTarget;
if (newScrollTop !== offsetTop) syncScrollTop(newScrollTop);
onScroll?.(e);
triggerScroll();
}
const keepInHorizontalRange = (nextOffsetLeft) => {
let tmpOffsetLeft = nextOffsetLeft;
const max = !!scrollWidth ? scrollWidth - size.width : 0;
tmpOffsetLeft = Math.max(tmpOffsetLeft, 0);
tmpOffsetLeft = Math.min(tmpOffsetLeft, max);
return tmpOffsetLeft;
};
const onWheelDelta = useEvent((offsetXY, fromHorizontal) => {
if (fromHorizontal) {
(0, import_react_dom.flushSync)(() => {
setOffsetLeft((left) => {
return keepInHorizontalRange(left + (isRTL ? -offsetXY : offsetXY));
});
});
triggerScroll();
} else syncScrollTop((top) => {
return top + offsetXY;
});
});
const [onRawWheel, onFireFoxScroll] = useFrameWheel(useVirtual, isScrollAtTop, isScrollAtBottom, isScrollAtLeft, isScrollAtRight, !!scrollWidth, onWheelDelta);
useMobileTouchMove(useVirtual, componentRef, (isHorizontal, delta, smoothOffset, e) => {
const event = e;
if (originScroll(isHorizontal, delta, smoothOffset)) return false;
if (!event || !event._virtualHandled) {
if (event) event._virtualHandled = true;
onRawWheel({
preventDefault() {},
deltaX: isHorizontal ? delta : 0,
deltaY: isHorizontal ? 0 : delta
});
return true;
}
return false;
});
useScrollDrag(inVirtual, componentRef, (offset) => {
syncScrollTop((top) => top + offset);
});
useLayoutEffect$1(() => {
function onMozMousePixelScroll(e) {
const scrollingUpAtTop = isScrollAtTop && e.detail < 0;
const scrollingDownAtBottom = isScrollAtBottom && e.detail > 0;
if (useVirtual && !scrollingUpAtTop && !scrollingDownAtBottom) e.preventDefault();
}
const componentEle = componentRef.current;
componentEle.addEventListener("wheel", onRawWheel, { passive: false });
componentEle.addEventListener("DOMMouseScroll", onFireFoxScroll, { passive: true });
componentEle.addEventListener("MozMousePixelScroll", onMozMousePixelScroll, { passive: false });
return () => {
componentEle.removeEventListener("wheel", onRawWheel);
componentEle.removeEventListener("DOMMouseScroll", onFireFoxScroll);
componentEle.removeEventListener("MozMousePixelScroll", onMozMousePixelScroll);
};
}, [
useVirtual,
isScrollAtTop,
isScrollAtBottom
]);
useLayoutEffect$1(() => {
if (scrollWidth) {
const newOffsetLeft = keepInHorizontalRange(offsetLeft);
setOffsetLeft(newOffsetLeft);
triggerScroll({ x: newOffsetLeft });
}
}, [size.width, scrollWidth]);
const delayHideScrollBar = () => {
verticalScrollBarRef.current?.delayHidden();
horizontalScrollBarRef.current?.delayHidden();
};
const scrollTo = useScrollTo$1(componentRef, mergedData, heights, itemHeight, getKey, () => collectHeight(true), syncScrollTop, delayHideScrollBar);
import_react.useImperativeHandle(ref, () => ({
nativeElement: containerRef.current,
getScrollInfo: getVirtualScrollInfo,
scrollTo: (config) => {
function isPosScroll(arg) {
return arg && typeof arg === "object" && ("left" in arg || "top" in arg);
}
if (isPosScroll(config)) {
if (config.left !== void 0) setOffsetLeft(keepInHorizontalRange(config.left));
scrollTo(config.top);
} else scrollTo(config);
}
}));
/** We need told outside that some list not rendered */
useLayoutEffect$1(() => {
if (onVisibleChange) onVisibleChange(mergedData.slice(start, end + 1), mergedData);
}, [
start,
end,
mergedData
]);
const getSize = useGetSize(mergedData, getKey, heights, itemHeight);
const extraContent = extraRender?.({
start,
end,
virtual: inVirtual,
offsetX: offsetLeft,
offsetY: fillerOffset,
rtl: isRTL,
getSize
});
const listChildren = useChildren$1(mergedData, start, end, scrollWidth, offsetLeft, setInstanceRef, children, sharedConfig);
let componentStyle = null;
if (height) {
componentStyle = {
[fullHeight ? "height" : "maxHeight"]: height,
...ScrollStyle
};
if (useVirtual) {
componentStyle.overflowY = "hidden";
if (scrollWidth) componentStyle.overflowX = "hidden";
if (scrollMoving) componentStyle.pointerEvents = "none";
}
}
const containerProps = {};
if (isRTL) containerProps.dir = "rtl";
return /* @__PURE__ */ import_react.createElement("div", _extends$91({
ref: containerRef,
style: {
...style,
position: "relative"
},
className: mergedClassName
}, containerProps, restProps), /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: onHolderResize }, /* @__PURE__ */ import_react.createElement(Component, {
className: `${prefixCls}-holder`,
style: componentStyle,
ref: componentRef,
onScroll: onFallbackScroll,
onMouseEnter: delayHideScrollBar
}, /* @__PURE__ */ import_react.createElement(Filler, {
prefixCls,
height: scrollHeight,
offsetX: offsetLeft,
offsetY: fillerOffset,
scrollWidth,
onInnerResize: collectHeight,
ref: fillerInnerRef,
innerProps,
rtl: isRTL,
extra: extraContent
}, listChildren))), inVirtual && scrollHeight > height && /* @__PURE__ */ import_react.createElement(ScrollBar, {
ref: verticalScrollBarRef,
prefixCls,
scrollOffset: offsetTop,
scrollRange: scrollHeight,
rtl: isRTL,
onScroll: onScrollBar,
onStartMove: onScrollbarStartMove,
onStopMove: onScrollbarStopMove,
spinSize: verticalScrollBarSpinSize,
containerSize: size.height,
style: styles?.verticalScrollBar,
thumbStyle: styles?.verticalScrollBarThumb,
showScrollBar
}), inVirtual && scrollWidth > size.width && /* @__PURE__ */ import_react.createElement(ScrollBar, {
ref: horizontalScrollBarRef,
prefixCls,
scrollOffset: offsetLeft,
scrollRange: scrollWidth,
rtl: isRTL,
onScroll: onScrollBar,
onStartMove: onScrollbarStartMove,
onStopMove: onScrollbarStopMove,
spinSize: horizontalScrollBarSpinSize,
containerSize: size.width,
horizontal: true,
style: styles?.horizontalScrollBar,
thumbStyle: styles?.horizontalScrollBarThumb,
showScrollBar
}));
}
var List$1 = /* @__PURE__ */ import_react.forwardRef(RawList);
List$1.displayName = "List";
//#endregion
//#region node_modules/@rc-component/virtual-list/es/index.js
var es_default$21 = List$1;
//#endregion
//#region node_modules/@rc-component/select/es/utils/platformUtil.js
/* istanbul ignore file */
function isPlatformMac() {
return /(mac\sos|macintosh)/i.test(navigator.appVersion);
}
//#endregion
//#region node_modules/@rc-component/select/es/OptionList.js
function _extends$78() {
_extends$78 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$78.apply(this, arguments);
}
function isTitleType(content) {
return typeof content === "string" || typeof content === "number";
}
/**
* Using virtual list of option display.
* Will fallback to dom if use customize render.
*/
var OptionList$1 = (_, ref) => {
const { prefixCls, id, open, multiple, mode, searchValue, toggleOpen, notFoundContent, onPopupScroll, showScrollBar, lockOptions } = useBaseProps();
const { maxCount, flattenOptions, onActiveValue, defaultActiveFirstOption, onSelect, menuItemSelectedIcon, rawValues, fieldNames, virtual, direction, listHeight, listItemHeight, optionRender, classNames: contextClassNames, styles: contextStyles } = import_react.useContext(SelectContext);
const itemPrefixCls = `${prefixCls}-item`;
const memoFlattenOptions = useMemo$44(() => flattenOptions, [open, lockOptions], (prev, next) => next[0] && !next[1]);
const listRef = import_react.useRef(null);
const overMaxCount = import_react.useMemo(() => multiple && isValidCount(maxCount) && rawValues?.size >= maxCount, [
multiple,
maxCount,
rawValues?.size
]);
const onListMouseDown = (event) => {
event.preventDefault();
};
const scrollIntoView = (args) => {
listRef.current?.scrollTo(typeof args === "number" ? { index: args } : args);
};
const isSelected = import_react.useCallback((value) => {
if (mode === "combobox") return false;
return rawValues.has(value);
}, [
mode,
[...rawValues].toString(),
rawValues.size
]);
const getEnabledActiveIndex = (index, offset = 1) => {
const len = memoFlattenOptions.length;
for (let i = 0; i < len; i += 1) {
const current = (index + i * offset + len) % len;
const { group, data } = memoFlattenOptions[current] || {};
if (!group && !data?.disabled && (isSelected(data.value) || !overMaxCount)) return current;
}
return -1;
};
const [activeIndex, setActiveIndex] = import_react.useState(() => getEnabledActiveIndex(0));
const setActive = (index, fromKeyboard = false) => {
setActiveIndex(index);
const info = { source: fromKeyboard ? "keyboard" : "mouse" };
const flattenItem = memoFlattenOptions[index];
if (!flattenItem) {
onActiveValue(null, -1, info);
return;
}
onActiveValue(flattenItem.value, index, info);
};
(0, import_react.useEffect)(() => {
setActive(defaultActiveFirstOption !== false ? getEnabledActiveIndex(0) : -1);
}, [memoFlattenOptions.length, searchValue]);
const isAriaSelected = import_react.useCallback((value) => {
if (mode === "combobox") return String(value).toLowerCase() === searchValue.toLowerCase();
return rawValues.has(value);
}, [
mode,
searchValue,
[...rawValues].toString(),
rawValues.size
]);
(0, import_react.useEffect)(() => {
/**
* React will skip `onChange` when component update.
* `setActive` function will call root accessibility state update which makes re-render.
* So we need to delay to let Input component trigger onChange first.
*/
let timeoutId;
if (!multiple && open && rawValues.size === 1) {
const value = Array.from(rawValues)[0];
const index = memoFlattenOptions.findIndex(({ data }) => searchValue ? String(data.value).startsWith(searchValue) : data.value === value);
if (index !== -1) {
setActive(index);
timeoutId = setTimeout(() => {
scrollIntoView(index);
});
}
}
if (open) listRef.current?.scrollTo(void 0);
return () => clearTimeout(timeoutId);
}, [open, searchValue]);
const onSelectValue = (value) => {
if (value !== void 0) onSelect(value, { selected: !rawValues.has(value) });
if (!multiple) toggleOpen(false);
};
import_react.useImperativeHandle(ref, () => ({
onKeyDown: (event) => {
const { which, ctrlKey } = event;
switch (which) {
case KeyCode.N:
case KeyCode.P:
case KeyCode.UP:
case KeyCode.DOWN: {
let offset = 0;
if (which === KeyCode.UP) offset = -1;
else if (which === KeyCode.DOWN) offset = 1;
else if (isPlatformMac() && ctrlKey) {
if (which === KeyCode.N) offset = 1;
else if (which === KeyCode.P) offset = -1;
}
if (offset !== 0) {
const nextActiveIndex = getEnabledActiveIndex(activeIndex + offset, offset);
scrollIntoView(nextActiveIndex);
setActive(nextActiveIndex, true);
}
break;
}
case KeyCode.TAB:
case KeyCode.ENTER: {
const item = memoFlattenOptions[activeIndex];
if (!item || item.data.disabled) return onSelectValue(void 0);
if (!overMaxCount || rawValues.has(item.value)) onSelectValue(item.value);
else onSelectValue(void 0);
if (open) event.preventDefault();
break;
}
case KeyCode.ESC:
toggleOpen(false);
if (open) event.stopPropagation();
}
},
onKeyUp: () => {},
scrollTo: (index) => {
scrollIntoView(index);
}
}));
if (memoFlattenOptions.length === 0) return /* @__PURE__ */ import_react.createElement("div", {
role: "listbox",
id: `${id}_list`,
className: `${itemPrefixCls}-empty`,
onMouseDown: onListMouseDown
}, notFoundContent);
const omitFieldNameList = Object.keys(fieldNames).map((key) => fieldNames[key]);
const getLabel = (item) => item.label;
function getItemAriaProps(item, index) {
const { group } = item;
return {
role: group ? "presentation" : "option",
id: `${id}_list_${index}`
};
}
const renderItem = (index) => {
const item = memoFlattenOptions[index];
if (!item) return null;
const itemData = item.data || {};
const { value, disabled } = itemData;
const { group } = item;
const attrs = pickAttrs(itemData, true);
const mergedLabel = getLabel(item);
return item ? /* @__PURE__ */ import_react.createElement("div", _extends$78({ "aria-label": typeof mergedLabel === "string" && !group ? mergedLabel : null }, attrs, { key: index }, getItemAriaProps(item, index), {
"aria-selected": isAriaSelected(value),
"aria-disabled": disabled
}), value) : null;
};
const a11yProps = {
role: "listbox",
id: `${id}_list`
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, virtual && /* @__PURE__ */ import_react.createElement("div", _extends$78({}, a11yProps, { style: {
height: 0,
width: 0,
overflow: "hidden"
} }), renderItem(activeIndex - 1), renderItem(activeIndex), renderItem(activeIndex + 1)), /* @__PURE__ */ import_react.createElement(es_default$21, {
itemKey: "key",
ref: listRef,
data: memoFlattenOptions,
height: listHeight,
itemHeight: listItemHeight,
fullHeight: false,
onMouseDown: onListMouseDown,
onScroll: onPopupScroll,
virtual,
direction,
innerProps: virtual ? null : a11yProps,
showScrollBar,
className: contextClassNames?.popup?.list,
style: contextStyles?.popup?.list
}, (item, itemIndex) => {
const { group, groupOption, data, label, value } = item;
const { key } = data;
if (group) {
const groupTitle = data.title ?? (isTitleType(label) ? label.toString() : void 0);
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(itemPrefixCls, `${itemPrefixCls}-group`, data.className),
title: groupTitle
}, label !== void 0 ? label : key);
}
const { disabled, title, children, style, className, ...otherProps } = data;
const passedProps = omit(otherProps, omitFieldNameList);
const selected = isSelected(value);
const mergedDisabled = disabled || !selected && overMaxCount;
const optionPrefixCls = `${itemPrefixCls}-option`;
const optionClassName = clsx(itemPrefixCls, optionPrefixCls, className, contextClassNames?.popup?.listItem, {
[`${optionPrefixCls}-grouped`]: groupOption,
[`${optionPrefixCls}-active`]: activeIndex === itemIndex && !mergedDisabled,
[`${optionPrefixCls}-disabled`]: mergedDisabled,
[`${optionPrefixCls}-selected`]: selected
});
const mergedLabel = getLabel(item);
const iconVisible = !menuItemSelectedIcon || typeof menuItemSelectedIcon === "function" || selected;
const content = typeof mergedLabel === "number" ? mergedLabel : mergedLabel || value;
let optionTitle = isTitleType(content) ? content.toString() : void 0;
if (title !== void 0) optionTitle = title;
return /* @__PURE__ */ import_react.createElement("div", _extends$78({}, pickAttrs(passedProps), !virtual ? getItemAriaProps(item, itemIndex) : {}, {
"aria-selected": virtual ? void 0 : isAriaSelected(value),
"aria-disabled": mergedDisabled,
className: optionClassName,
title: optionTitle,
onMouseMove: () => {
if (activeIndex === itemIndex || mergedDisabled) return;
setActive(itemIndex);
},
onClick: () => {
if (!mergedDisabled) onSelectValue(value);
},
style: {
...contextStyles?.popup?.listItem,
...style
}
}), /* @__PURE__ */ import_react.createElement("div", { className: `${optionPrefixCls}-content` }, typeof optionRender === "function" ? optionRender(item, { index: itemIndex }) : content), /* @__PURE__ */ import_react.isValidElement(menuItemSelectedIcon) || selected, iconVisible && /* @__PURE__ */ import_react.createElement(TransBtn, {
className: `${itemPrefixCls}-option-state`,
customizeIcon: menuItemSelectedIcon,
customizeIconProps: {
value,
disabled: mergedDisabled,
isSelected: selected
}
}, selected ? "✓" : null));
}));
};
var RefOptionList$2 = /* @__PURE__ */ import_react.forwardRef(OptionList$1);
RefOptionList$2.displayName = "OptionList";
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useCache.js
/**
* Cache `value` related LabeledValue & options.
*/
var useCache_default$1 = ((labeledValues, valueOptions) => {
const cacheRef = import_react.useRef({
values: /* @__PURE__ */ new Map(),
options: /* @__PURE__ */ new Map()
});
return [import_react.useMemo(() => {
const { values: prevValueCache, options: prevOptionCache } = cacheRef.current;
const patchedValues = labeledValues.map((item) => {
if (item.label === void 0) return {
...item,
label: prevValueCache.get(item.value)?.label
};
return item;
});
const valueCache = /* @__PURE__ */ new Map();
const optionCache = /* @__PURE__ */ new Map();
patchedValues.forEach((item) => {
valueCache.set(item.value, item);
optionCache.set(item.value, valueOptions.get(item.value) || prevOptionCache.get(item.value));
});
cacheRef.current.values = valueCache;
cacheRef.current.options = optionCache;
return patchedValues;
}, [labeledValues, valueOptions]), import_react.useCallback((val) => valueOptions.get(val) || cacheRef.current.options.get(val), [valueOptions])];
});
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useFilterOptions.js
function includes(test, search) {
return toArray$5(test).join("").toUpperCase().includes(search);
}
var useFilterOptions_default = ((options, fieldNames, searchValue, filterOption, optionFilterProp) => {
return import_react.useMemo(() => {
if (!searchValue || filterOption === false) return options;
const { options: fieldOptions, label: fieldLabel, value: fieldValue } = fieldNames;
const filteredOptions = [];
const customizeFilter = typeof filterOption === "function";
const upperSearch = searchValue.toUpperCase();
const filterFunc = customizeFilter ? filterOption : (_, option) => {
if (optionFilterProp && optionFilterProp.length) return optionFilterProp.some((prop) => includes(option[prop], upperSearch));
if (option[fieldOptions]) return includes(option[fieldLabel !== "children" ? fieldLabel : "label"], upperSearch);
return includes(option[fieldValue], upperSearch);
};
const wrapOption = customizeFilter ? (opt) => injectPropsWithOption(opt) : (opt) => opt;
options.forEach((item) => {
if (item[fieldOptions]) {
if (filterFunc(searchValue, wrapOption(item))) filteredOptions.push(item);
else {
const subOptions = item[fieldOptions].filter((subItem) => filterFunc(searchValue, wrapOption(subItem)));
if (subOptions.length) filteredOptions.push({
...item,
[fieldOptions]: subOptions
});
}
return;
}
if (filterFunc(searchValue, wrapOption(item))) filteredOptions.push(item);
});
return filteredOptions;
}, [
options,
filterOption,
optionFilterProp,
searchValue,
fieldNames
]);
});
//#endregion
//#region node_modules/@rc-component/select/es/utils/legacyUtil.js
function convertNodeToOption(node) {
const { key, props: { children, value, ...restProps } } = node;
return {
key,
value: value !== void 0 ? value : key,
children,
...restProps
};
}
function convertChildrenToData$1(nodes, optionOnly = false) {
return toArray$8(nodes).map((node, index) => {
if (!/* @__PURE__ */ import_react.isValidElement(node) || !node.type) return null;
const { type: { isSelectOptGroup }, key, props: { children, ...restProps } } = node;
if (optionOnly || !isSelectOptGroup) return convertNodeToOption(node);
return {
key: `__RC_SELECT_GRP__${key === null ? index : key}__`,
label: key,
...restProps,
options: convertChildrenToData$1(children)
};
}).filter((data) => data);
}
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useOptions.js
/**
* Parse `children` to `options` if `options` is not provided.
* Then flatten the `options`.
*/
var useOptions$1 = (options, children, fieldNames, optionFilterProp, optionLabelProp) => {
return import_react.useMemo(() => {
let mergedOptions = options;
if (!options) mergedOptions = convertChildrenToData$1(children);
const valueOptions = /* @__PURE__ */ new Map();
const labelOptions = /* @__PURE__ */ new Map();
const setLabelOptions = (labelOptionsMap, option, key) => {
if (key && typeof key === "string") labelOptionsMap.set(option[key], option);
};
const dig = (optionList, isChildren = false) => {
for (let i = 0; i < optionList.length; i += 1) {
const option = optionList[i];
if (!option[fieldNames.options] || isChildren) {
valueOptions.set(option[fieldNames.value], option);
setLabelOptions(labelOptions, option, fieldNames.label);
optionFilterProp.forEach((prop) => {
setLabelOptions(labelOptions, option, prop);
});
setLabelOptions(labelOptions, option, optionLabelProp);
} else dig(option[fieldNames.options], true);
}
};
dig(mergedOptions);
return {
options: mergedOptions,
valueOptions,
labelOptions
};
}, [
options,
children,
fieldNames,
optionFilterProp,
optionLabelProp
]);
};
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useRefFunc.js
/**
* Same as `React.useCallback` but always return a memoized function
* but redirect to real function.
*/
function useRefFunc$1(callback) {
const funcRef = import_react.useRef();
funcRef.current = callback;
return import_react.useCallback((...args) => {
return funcRef.current(...args);
}, []);
}
//#endregion
//#region node_modules/@rc-component/select/es/utils/warningPropsUtil.js
function warningProps$1(props) {
const { mode, options, children, backfill, allowClear, placeholder, getInputElement, showSearch, onSearch, defaultOpen, autoFocus, labelInValue, value, optionLabelProp } = props;
const multiple = isMultiple(mode);
const mergedShowSearch = showSearch !== void 0 ? showSearch : multiple || mode === "combobox";
const mergedOptions = options || convertChildrenToData$1(children);
warningOnce(mode !== "tags" || mergedOptions.every((opt) => !opt.disabled), "Please avoid setting option to disabled in tags mode since user can always type text as tag.");
if (mode === "tags" || mode === "combobox") warningOnce(!mergedOptions.some((item) => {
if (item.options) return item.options.some((opt) => typeof ("value" in opt ? opt.value : opt.key) === "number");
return typeof ("value" in item ? item.value : item.key) === "number";
}), "`value` of Option should not use number type when `mode` is `tags` or `combobox`.");
warningOnce(mode !== "combobox" || !optionLabelProp, "`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly.");
warningOnce(mode === "combobox" || !backfill, "`backfill` only works with `combobox` mode.");
warningOnce(mode === "combobox" || !getInputElement, "`getInputElement` only work with `combobox` mode.");
noteOnce(mode !== "combobox" || !getInputElement || !allowClear || !placeholder, "Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`.");
if (onSearch && !mergedShowSearch && mode !== "combobox" && mode !== "tags") warningOnce(false, "`onSearch` should work with `showSearch` instead of use alone.");
noteOnce(!defaultOpen || autoFocus, "`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed.");
if (value !== void 0 && value !== null) {
const values = toArray$5(value);
warningOnce(!labelInValue || values.every((val) => typeof val === "object" && ("key" in val || "value" in val)), "`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`");
warningOnce(!multiple || Array.isArray(value), "`value` should be array when `mode` is `multiple` or `tags`");
}
if (children) {
let invalidateChildType = null;
toArray$8(children).some((node) => {
if (!/* @__PURE__ */ import_react.isValidElement(node) || !node.type) return false;
const { type } = node;
if (type.isSelectOption) return false;
if (type.isSelectOptGroup) {
if (toArray$8(node.props.children).every((subNode) => {
if (!/* @__PURE__ */ import_react.isValidElement(subNode) || !node.type || subNode.type.isSelectOption) return true;
invalidateChildType = subNode.type;
return false;
})) return false;
return true;
}
invalidateChildType = type;
return true;
});
if (invalidateChildType) warningOnce(false, `\`children\` should be \`Select.Option\` or \`Select.OptGroup\` instead of \`${invalidateChildType.displayName || invalidateChildType.name || invalidateChildType}\`.`);
}
}
function warningNullOptions$1(options, fieldNames) {
if (options) {
const recursiveOptions = (optionsList, inGroup = false) => {
for (let i = 0; i < optionsList.length; i++) {
const option = optionsList[i];
if (option[fieldNames?.value] === null) {
warningOnce(false, "`value` in Select options should not be `null`.");
return true;
}
if (!inGroup && Array.isArray(option[fieldNames?.options]) && recursiveOptions(option[fieldNames?.options], true)) break;
}
};
recursiveOptions(options);
}
}
//#endregion
//#region node_modules/@rc-component/select/es/hooks/useSearchConfig.js
function useSearchConfig$2(showSearch, props, mode) {
const { filterOption, searchValue, optionFilterProp, filterSort, onSearch, autoClearSearchValue } = props;
return import_react.useMemo(() => {
const isObject = typeof showSearch === "object";
const searchConfig = {
filterOption,
searchValue,
optionFilterProp,
filterSort,
onSearch,
autoClearSearchValue,
...isObject ? showSearch : {}
};
return [isObject || mode === "combobox" || mode === "tags" || mode === "multiple" && showSearch === void 0 ? true : showSearch, searchConfig];
}, [
mode,
showSearch,
filterOption,
searchValue,
optionFilterProp,
filterSort,
onSearch,
autoClearSearchValue
]);
}
//#endregion
//#region node_modules/@rc-component/select/es/Select.js
/**
* To match accessibility requirement, we always provide an input in the component.
* Other element will not set `tabIndex` to avoid `onBlur` sequence problem.
* For focused select, we set `aria-live="polite"` to update the accessibility content.
*
* ref:
* - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions
*
* New api:
* - listHeight
* - listItemHeight
* - component
*
* Remove deprecated api:
* - multiple
* - tags
* - combobox
* - firstActiveValue
* - dropdownMenuStyle
* - openClassName (Not list in api)
*
* Update:
* - `backfill` only support `combobox` mode
* - `combobox` mode not support `labelInValue` since it's meaningless
* - `getInputElement` only support `combobox` mode
* - `onChange` return OptionData instead of ReactNode
* - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode
* - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option
* - `combobox` mode not support `optionLabelProp`
*/
function _extends$77() {
_extends$77 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$77.apply(this, arguments);
}
var OMIT_DOM_PROPS = ["inputValue"];
function isRawValue$1(value) {
return !value || typeof value !== "object";
}
var Select$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { id, mode, prefixCls = "rc-select", backfill, fieldNames, showSearch, searchValue: legacySearchValue, onSearch: legacyOnSearch, autoClearSearchValue: legacyAutoClearSearchValue, filterOption: legacyFilterOption, optionFilterProp: legacyOptionFilterProp, filterSort: legacyFilterSort, onSelect, onDeselect, onActive, popupMatchSelectWidth = true, optionLabelProp, options, optionRender, children, defaultActiveFirstOption, menuItemSelectedIcon, virtual, direction, listHeight = 200, listItemHeight = 20, labelRender, value, defaultValue, labelInValue, onChange, maxCount, classNames, styles, ...restProps } = props;
const [mergedShowSearch, searchConfig] = useSearchConfig$2(showSearch, {
searchValue: legacySearchValue,
onSearch: legacyOnSearch,
autoClearSearchValue: legacyAutoClearSearchValue,
filterOption: legacyFilterOption,
optionFilterProp: legacyOptionFilterProp,
filterSort: legacyFilterSort
}, mode);
const { filterOption, searchValue, optionFilterProp, filterSort, onSearch, autoClearSearchValue = true } = searchConfig;
const normalizedOptionFilterProp = import_react.useMemo(() => {
if (!optionFilterProp) return [];
return Array.isArray(optionFilterProp) ? optionFilterProp : [optionFilterProp];
}, [optionFilterProp]);
const mergedId = useId_default(id);
const multiple = isMultiple(mode);
const childrenAsData = !!(!options && children);
const mergedFilterOption = import_react.useMemo(() => {
if (filterOption === void 0 && mode === "combobox") return false;
return filterOption;
}, [filterOption, mode]);
const mergedFieldNames = import_react.useMemo(() => fillFieldNames$3(fieldNames, childrenAsData), [JSON.stringify(fieldNames), childrenAsData]);
const [internalSearchValue, setSearchValue] = useControlledState("", searchValue);
const mergedSearchValue = internalSearchValue || "";
const parsedOptions = useOptions$1(options, children, mergedFieldNames, normalizedOptionFilterProp, optionLabelProp);
const { valueOptions, labelOptions, options: mergedOptions } = parsedOptions;
const convert2LabelValues = import_react.useCallback((draftValues) => {
return toArray$5(draftValues).map((val) => {
let rawValue;
let rawLabel;
let rawDisabled;
let rawTitle;
if (isRawValue$1(val)) rawValue = val;
else {
rawLabel = val.label;
rawValue = val.value;
}
const option = valueOptions.get(rawValue);
if (option) {
if (rawLabel === void 0) rawLabel = option?.[optionLabelProp || mergedFieldNames.label];
rawDisabled = option?.disabled;
rawTitle = option?.title;
if (!optionLabelProp) {
const optionLabel = option?.[mergedFieldNames.label];
if (optionLabel !== void 0 && !/* @__PURE__ */ import_react.isValidElement(optionLabel) && !/* @__PURE__ */ import_react.isValidElement(rawLabel) && optionLabel !== rawLabel) warningOnce(false, "`label` of `value` is not same as `label` in Select options.");
}
}
return {
label: rawLabel,
value: rawValue,
key: rawValue,
disabled: rawDisabled,
title: rawTitle
};
});
}, [
mergedFieldNames,
optionLabelProp,
valueOptions
]);
const [internalValue, setInternalValue] = useControlledState(defaultValue, value);
const [mergedValues, getMixedOption] = useCache_default$1(import_react.useMemo(() => {
const values = convert2LabelValues(multiple && internalValue === null ? [] : internalValue);
if (mode === "combobox" && isComboNoValue(values[0]?.value)) return [];
return values;
}, [
internalValue,
convert2LabelValues,
mode,
multiple
]), valueOptions);
const displayValues = import_react.useMemo(() => {
if (!mode && mergedValues.length === 1) {
const firstValue = mergedValues[0];
if (firstValue.value === null && (firstValue.label === null || firstValue.label === void 0)) return [];
}
return mergedValues.map((item) => ({
...item,
label: (typeof labelRender === "function" ? labelRender(item) : item.label) ?? item.value
}));
}, [
mode,
mergedValues,
labelRender
]);
/** Convert `displayValues` to raw value type set */
const rawValues = import_react.useMemo(() => new Set(mergedValues.map((val) => val.value)), [mergedValues]);
import_react.useEffect(() => {
if (mode === "combobox") {
const strValue = mergedValues[0]?.value;
setSearchValue(hasValue(strValue) ? String(strValue) : "");
}
}, [mergedValues]);
const createTagOption = useRefFunc$1((val, label) => {
const mergedLabel = label ?? val;
return {
[mergedFieldNames.value]: val,
[mergedFieldNames.label]: mergedLabel
};
});
const filteredOptions = useFilterOptions_default(import_react.useMemo(() => {
if (mode !== "tags") return mergedOptions;
const cloneOptions = [...mergedOptions];
const existOptions = (val) => valueOptions.has(val);
[...mergedValues].sort((a, b) => a.value < b.value ? -1 : 1).forEach((item) => {
const val = item.value;
if (!existOptions(val)) cloneOptions.push(createTagOption(val, item.label));
});
return cloneOptions;
}, [
createTagOption,
mergedOptions,
valueOptions,
mergedValues,
mode
]), mergedFieldNames, mergedSearchValue, mergedFilterOption, normalizedOptionFilterProp);
const filledSearchOptions = import_react.useMemo(() => {
const hasItemMatchingSearch = (item) => {
if (normalizedOptionFilterProp.length) return normalizedOptionFilterProp.some((prop) => item?.[prop] === mergedSearchValue);
return item?.value === mergedSearchValue;
};
if (mode !== "tags" || !mergedSearchValue || filteredOptions.some((item) => hasItemMatchingSearch(item))) return filteredOptions;
if (filteredOptions.some((item) => item[mergedFieldNames.value] === mergedSearchValue)) return filteredOptions;
return [createTagOption(mergedSearchValue), ...filteredOptions];
}, [
createTagOption,
normalizedOptionFilterProp,
mode,
filteredOptions,
mergedSearchValue,
mergedFieldNames
]);
const sorter = (inputOptions) => {
return [...inputOptions].sort((a, b) => filterSort(a, b, { searchValue: mergedSearchValue })).map((item) => {
if (Array.isArray(item.options)) return {
...item,
options: item.options.length > 0 ? sorter(item.options) : item.options
};
return item;
});
};
const orderedFilteredOptions = import_react.useMemo(() => {
if (!filterSort) return filledSearchOptions;
return sorter(filledSearchOptions);
}, [
filledSearchOptions,
filterSort,
mergedSearchValue
]);
const displayOptions = import_react.useMemo(() => flattenOptions(orderedFilteredOptions, {
fieldNames: mergedFieldNames,
childrenAsData
}), [
orderedFilteredOptions,
mergedFieldNames,
childrenAsData
]);
const triggerChange = (values) => {
const labeledValues = convert2LabelValues(values);
setInternalValue(labeledValues);
if (onChange && (labeledValues.length !== mergedValues.length || labeledValues.some((newVal, index) => mergedValues[index]?.value !== newVal?.value))) {
const returnValues = labelInValue ? labeledValues.map(({ label: l, value: v }) => ({
label: l,
value: v
})) : labeledValues.map((v) => v.value);
const returnOptions = labeledValues.map((v) => injectPropsWithOption(getMixedOption(v.value)));
onChange(multiple ? returnValues : returnValues[0], multiple ? returnOptions : returnOptions[0]);
}
};
const [activeValue, setActiveValue] = import_react.useState(null);
const [accessibilityIndex, setAccessibilityIndex] = import_react.useState(0);
const mergedDefaultActiveFirstOption = defaultActiveFirstOption !== void 0 ? defaultActiveFirstOption : mode !== "combobox";
const activeEventRef = import_react.useRef();
const onActiveValue = import_react.useCallback((active, index, { source = "keyboard" } = {}) => {
setAccessibilityIndex(index);
if (backfill && mode === "combobox" && active !== null && source === "keyboard") setActiveValue(String(active));
const promise = Promise.resolve().then(() => {
if (activeEventRef.current === promise) onActive?.(active);
});
activeEventRef.current = promise;
}, [
backfill,
mode,
onActive
]);
const triggerSelect = (val, selected, type) => {
const getSelectEnt = () => {
const option = getMixedOption(val);
return [labelInValue ? {
label: option?.[mergedFieldNames.label],
value: val
} : val, injectPropsWithOption(option)];
};
if (selected && onSelect) {
const [wrappedValue, option] = getSelectEnt();
onSelect(wrappedValue, option);
} else if (!selected && onDeselect && type !== "clear") {
const [wrappedValue, option] = getSelectEnt();
onDeselect(wrappedValue, option);
}
};
const onInternalSelect = useRefFunc$1((val, info) => {
let cloneValues;
const mergedSelect = multiple ? info.selected : true;
if (mergedSelect) cloneValues = multiple ? [...mergedValues, val] : [val];
else cloneValues = mergedValues.filter((v) => v.value !== val);
triggerChange(cloneValues);
triggerSelect(val, mergedSelect);
if (mode === "combobox") setActiveValue("");
else if (!isMultiple || autoClearSearchValue) {
setSearchValue("");
setActiveValue("");
}
});
const onDisplayValuesChange = (nextValues, info) => {
triggerChange(nextValues);
const { type, values } = info;
if (type === "remove" || type === "clear") values.forEach((item) => {
triggerSelect(item.value, false, type);
});
};
const onInternalSearch = (searchText, info) => {
setSearchValue(searchText);
setActiveValue(null);
if (info.source === "submit") {
const formatted = (searchText || "").trim();
if (formatted) {
triggerChange(Array.from(new Set([...rawValues, formatted])));
triggerSelect(formatted, true);
setSearchValue("");
}
return;
}
if (info.source !== "blur") {
if (mode === "combobox") triggerChange(searchText);
onSearch?.(searchText);
}
};
const onInternalSearchSplit = (words) => {
let patchValues = words;
if (mode !== "tags") patchValues = words.map((word) => {
return labelOptions.get(word)?.value;
}).filter((val) => val !== void 0);
const newRawValues = Array.from(new Set([...rawValues, ...patchValues]));
triggerChange(newRawValues);
newRawValues.forEach((newRawValue) => {
triggerSelect(newRawValue, true);
});
};
const selectContext = import_react.useMemo(() => {
const realVirtual = virtual !== false && popupMatchSelectWidth !== false;
return {
...parsedOptions,
flattenOptions: displayOptions,
onActiveValue,
defaultActiveFirstOption: mergedDefaultActiveFirstOption,
onSelect: onInternalSelect,
menuItemSelectedIcon,
rawValues,
fieldNames: mergedFieldNames,
virtual: realVirtual,
direction,
listHeight,
listItemHeight,
childrenAsData,
maxCount,
optionRender,
classNames,
styles
};
}, [
maxCount,
parsedOptions,
displayOptions,
onActiveValue,
mergedDefaultActiveFirstOption,
onInternalSelect,
menuItemSelectedIcon,
rawValues,
mergedFieldNames,
virtual,
popupMatchSelectWidth,
direction,
listHeight,
listItemHeight,
childrenAsData,
optionRender,
classNames,
styles
]);
warningProps$1(props);
warningNullOptions$1(mergedOptions, mergedFieldNames);
return /* @__PURE__ */ import_react.createElement(SelectContext.Provider, { value: selectContext }, /* @__PURE__ */ import_react.createElement(BaseSelect, _extends$77({}, restProps, {
id: mergedId,
prefixCls,
ref,
omitDomProps: OMIT_DOM_PROPS,
mode,
classNames,
styles,
displayValues,
onDisplayValuesChange,
maxCount,
direction,
showSearch: mergedShowSearch,
searchValue: mergedSearchValue,
onSearch: onInternalSearch,
autoClearSearchValue,
onSearchSplit: onInternalSearchSplit,
popupMatchSelectWidth,
OptionList: RefOptionList$2,
emptyOptions: !displayOptions.length,
activeValue,
activeDescendantId: `${mergedId}_list_${accessibilityIndex}`
})));
});
Select$1.displayName = "Select";
var TypedSelect = Select$1;
TypedSelect.Option = Option$4;
TypedSelect.OptGroup = OptGroup;
//#endregion
//#region node_modules/@rc-component/select/es/index.js
var es_default$20 = TypedSelect;
//#endregion
//#region node_modules/antd/es/_util/statusUtils.js
var getStatusClassNames = (prefixCls, status, hasFeedback) => {
return clsx({
[`${prefixCls}-status-success`]: status === "success",
[`${prefixCls}-status-warning`]: status === "warning",
[`${prefixCls}-status-error`]: status === "error",
[`${prefixCls}-status-validating`]: status === "validating",
[`${prefixCls}-has-feedback`]: hasFeedback
});
};
var getMergedStatus = (contextStatus, customStatus) => customStatus || contextStatus;
//#endregion
//#region node_modules/antd/es/empty/empty.js
var Empty$1 = () => {
const [, token] = useToken$1();
const [locale] = useLocale$1("Empty");
const themeStyle = new FastColor(token.colorBgBase).toHsl().l < .5 ? { opacity: .65 } : {};
return /* @__PURE__ */ import_react.createElement("svg", {
style: themeStyle,
width: "184",
height: "152",
viewBox: "0 0 184 152",
xmlns: "http://www.w3.org/2000/svg"
}, /* @__PURE__ */ import_react.createElement("title", null, locale?.description || "Empty"), /* @__PURE__ */ import_react.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */ import_react.createElement("g", { transform: "translate(24 31.7)" }, /* @__PURE__ */ import_react.createElement("ellipse", {
fillOpacity: ".8",
fill: "#F5F5F7",
cx: "67.8",
cy: "106.9",
rx: "67.8",
ry: "12.7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#aeb8c2",
d: "M122 69.7 98.1 40.2a6 6 0 0 0-4.6-2.2H42.1a6 6 0 0 0-4.6 2.2l-24 29.5V85H122z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#f5f5f7",
d: "M33.8 0h68a4 4 0 0 1 4 4v93.3a4 4 0 0 1-4 4h-68a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#dce0e6",
d: "M42.7 10h50.2a2 2 0 0 1 2 2v25a2 2 0 0 1-2 2H42.7a2 2 0 0 1-2-2V12a2 2 0 0 1 2-2m.2 39.8h49.8a2.3 2.3 0 1 1 0 4.5H42.9a2.3 2.3 0 0 1 0-4.5m0 11.7h49.8a2.3 2.3 0 1 1 0 4.6H42.9a2.3 2.3 0 0 1 0-4.6m79 43.5a7 7 0 0 1-6.8 5.4H20.5a7 7 0 0 1-6.7-5.4l-.2-1.8V69.7h26.3c2.9 0 5.2 2.4 5.2 5.4s2.4 5.4 5.3 5.4h34.8c2.9 0 5.3-2.4 5.3-5.4s2.3-5.4 5.2-5.4H122v33.5q0 1-.2 1.8"
})), /* @__PURE__ */ import_react.createElement("path", {
fill: "#dce0e6",
d: "m149.1 33.3-6.8 2.6a1 1 0 0 1-1.3-1.2l2-6.2q-4.1-4.5-4.2-10.4c0-10 10.1-18.1 22.6-18.1S184 8.1 184 18.1s-10.1 18-22.6 18q-6.8 0-12.3-2.8"
}), /* @__PURE__ */ import_react.createElement("g", {
fill: "#fff",
transform: "translate(149.7 15.4)"
}, /* @__PURE__ */ import_react.createElement("circle", {
cx: "20.7",
cy: "3.2",
r: "2.8"
}), /* @__PURE__ */ import_react.createElement("path", { d: "M5.7 5.6H0L2.9.7zM9.3.7h5v5h-5z" }))));
};
Empty$1.displayName = "EmptyImage";
//#endregion
//#region node_modules/antd/es/empty/simple.js
var Simple = () => {
const [, token] = useToken$1();
const [locale] = useLocale$1("Empty");
const { colorFill, colorFillTertiary, colorFillQuaternary, colorBgContainer } = token;
const { borderColor, shadowColor, contentColor } = (0, import_react.useMemo)(() => ({
borderColor: new FastColor(colorFill).onBackground(colorBgContainer).toHexString(),
shadowColor: new FastColor(colorFillTertiary).onBackground(colorBgContainer).toHexString(),
contentColor: new FastColor(colorFillQuaternary).onBackground(colorBgContainer).toHexString()
}), [
colorFill,
colorFillTertiary,
colorFillQuaternary,
colorBgContainer
]);
return /* @__PURE__ */ import_react.createElement("svg", {
width: "64",
height: "41",
viewBox: "0 0 64 41",
xmlns: "http://www.w3.org/2000/svg"
}, /* @__PURE__ */ import_react.createElement("title", null, locale?.description || "Empty"), /* @__PURE__ */ import_react.createElement("g", {
transform: "translate(0 1)",
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */ import_react.createElement("ellipse", {
fill: shadowColor,
cx: "32",
cy: "33",
rx: "32",
ry: "7"
}), /* @__PURE__ */ import_react.createElement("g", {
fillRule: "nonzero",
stroke: borderColor
}, /* @__PURE__ */ import_react.createElement("path", { d: "M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z" }), /* @__PURE__ */ import_react.createElement("path", {
d: "M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3",
fill: contentColor
}))));
};
Simple.displayName = "SimpleImage";
//#endregion
//#region node_modules/antd/es/empty/style/index.js
var genSharedEmptyStyle = (token) => {
const { componentCls, margin, marginXS, marginXL, fontSize, lineHeight } = token;
return { [componentCls]: {
marginInline: marginXS,
fontSize,
lineHeight,
textAlign: "center",
[`${componentCls}-image`]: {
height: token.emptyImgHeight,
marginBottom: marginXS,
opacity: token.opacityImage,
img: { height: "100%" },
svg: {
maxWidth: "100%",
height: "100%",
margin: "auto"
}
},
[`${componentCls}-description`]: { color: token.colorTextDescription },
[`${componentCls}-footer`]: { marginTop: margin },
"&-normal": {
marginBlock: marginXL,
color: token.colorTextDescription,
[`${componentCls}-description`]: { color: token.colorTextDescription },
[`${componentCls}-image`]: { height: token.emptyImgHeightMD }
},
"&-small": {
marginBlock: marginXS,
color: token.colorTextDescription,
[`${componentCls}-image`]: { height: token.emptyImgHeightSM }
}
} };
};
var style_default$53 = genStyleHooks("Empty", (token) => {
const { componentCls, controlHeightLG, calc } = token;
return genSharedEmptyStyle(merge(token, {
emptyImgCls: `${componentCls}-img`,
emptyImgHeight: calc(controlHeightLG).mul(2.5).equal(),
emptyImgHeightMD: controlHeightLG,
emptyImgHeightSM: calc(controlHeightLG).mul(.875).equal()
}));
});
//#endregion
//#region node_modules/antd/es/empty/index.js
var defaultEmptyImg = /* @__PURE__ */ import_react.createElement(Empty$1, null);
var simpleEmptyImg = /* @__PURE__ */ import_react.createElement(Simple, null);
var Empty = (props) => {
const { className, rootClassName, prefixCls: customizePrefixCls, image, description, children, imageStyle, style, classNames, styles, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, image: contextImage } = useComponentConfig("empty");
const prefixCls = getPrefixCls("empty", customizePrefixCls);
const [hashId, cssVarCls] = style_default$53(prefixCls);
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props });
const [locale] = useLocale$1("Empty");
const des = typeof description !== "undefined" ? description : locale?.description;
const alt = typeof des === "string" ? des : "empty";
const mergedImage = image ?? contextImage ?? defaultEmptyImg;
let imageNode = null;
if (typeof mergedImage === "string") imageNode = /* @__PURE__ */ import_react.createElement("img", {
draggable: false,
alt,
src: mergedImage
});
else imageNode = mergedImage;
{
const warning = devUseWarning("Empty");
[["imageStyle", "styles.image"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(hashId, cssVarCls, prefixCls, contextClassName, {
[`${prefixCls}-normal`]: mergedImage === simpleEmptyImg,
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, rootClassName, mergedClassNames.root),
style: {
...mergedStyles.root,
...contextStyle,
...style
},
...restProps
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-image`, mergedClassNames.image),
style: {
...imageStyle,
...mergedStyles.image
}
}, imageNode), des && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-description`, mergedClassNames.description),
style: mergedStyles.description
}, des), children && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-footer`, mergedClassNames.footer),
style: mergedStyles.footer
}, children));
};
Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg;
Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg;
Empty.displayName = "Empty";
//#endregion
//#region node_modules/antd/es/config-provider/defaultRenderEmpty.js
var DefaultRenderEmpty = (props) => {
const { componentName } = props;
const { getPrefixCls } = (0, import_react.useContext)(ConfigContext);
const prefix = getPrefixCls("empty");
switch (componentName) {
case "Table":
case "List": return /* @__PURE__ */ import_react.createElement(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE });
case "Select":
case "TreeSelect":
case "Cascader":
case "Transfer":
case "Mentions": return /* @__PURE__ */ import_react.createElement(Empty, {
image: Empty.PRESENTED_IMAGE_SIMPLE,
className: `${prefix}-small`
});
/**
* This type of component should satisfy the nullish coalescing operator(??) on the left-hand side.
* to let the component itself implement the logic.
* For example `Table.filter`.
*/
case "Table.filter": return null;
default: return /* @__PURE__ */ import_react.createElement(Empty, null);
}
};
//#endregion
//#region node_modules/antd/es/form/hooks/useVariants.js
/**
* Compatible for legacy `bordered` prop.
*/
var useVariant = (component, variant, legacyBordered) => {
const { variant: configVariant, [component]: componentConfig } = import_react.useContext(ConfigContext);
const ctxVariant = import_react.useContext(VariantContext);
const configComponentVariant = componentConfig?.variant;
let mergedVariant;
if (typeof variant !== "undefined") mergedVariant = variant;
else if (legacyBordered === false) mergedVariant = "borderless";
else mergedVariant = ctxVariant ?? configComponentVariant ?? configVariant ?? "outlined";
const enableVariantCls = Variants.includes(mergedVariant);
return [mergedVariant, enableVariantCls];
};
//#endregion
//#region node_modules/antd/es/select/mergedBuiltinPlacements.js
var getBuiltInPlacements = (popupOverflow) => {
const sharedConfig = {
overflow: {
adjustX: true,
adjustY: true,
shiftY: true
},
htmlRegion: popupOverflow === "scroll" ? "scroll" : "visible",
dynamicInset: true
};
return {
bottomLeft: {
...sharedConfig,
points: ["tl", "bl"],
offset: [0, 4]
},
bottomRight: {
...sharedConfig,
points: ["tr", "br"],
offset: [0, 4]
},
topLeft: {
...sharedConfig,
points: ["bl", "tl"],
offset: [0, -4]
},
topRight: {
...sharedConfig,
points: ["br", "tr"],
offset: [0, -4]
}
};
};
function mergedBuiltinPlacements(buildInPlacements, popupOverflow) {
return buildInPlacements || getBuiltInPlacements(popupOverflow);
}
//#endregion
//#region node_modules/antd/es/select/style/dropdown.js
var genItemStyle = (token) => {
const { optionHeight, optionFontSize, optionLineHeight, optionPadding } = token;
return {
position: "relative",
display: "block",
minHeight: optionHeight,
padding: optionPadding,
color: token.colorText,
fontWeight: "normal",
fontSize: optionFontSize,
lineHeight: optionLineHeight,
boxSizing: "border-box"
};
};
var genSingleStyle = (token) => {
const { antCls, componentCls } = token;
const selectItemCls = `${componentCls}-item`;
const slideUpEnterActive = `&${antCls}-slide-up-enter${antCls}-slide-up-enter-active`;
const slideUpAppearActive = `&${antCls}-slide-up-appear${antCls}-slide-up-appear-active`;
const slideUpLeaveActive = `&${antCls}-slide-up-leave${antCls}-slide-up-leave-active`;
const dropdownPlacementCls = `${componentCls}-dropdown-placement-`;
const selectedItemCls = `${selectItemCls}-option-selected`;
return [
{ [`${componentCls}-dropdown`]: {
...resetComponent(token),
position: "absolute",
top: -9999,
zIndex: token.zIndexPopup,
boxSizing: "border-box",
padding: token.paddingXXS,
overflow: "hidden",
fontSize: token.fontSize,
fontVariant: "initial",
backgroundColor: token.colorBgElevated,
borderRadius: token.borderRadiusLG,
outline: "none",
boxShadow: token.boxShadowSecondary,
[`
${slideUpEnterActive}${dropdownPlacementCls}bottomLeft,
${slideUpAppearActive}${dropdownPlacementCls}bottomLeft
`]: { animationName: slideUpIn },
[`
${slideUpEnterActive}${dropdownPlacementCls}topLeft,
${slideUpAppearActive}${dropdownPlacementCls}topLeft,
${slideUpEnterActive}${dropdownPlacementCls}topRight,
${slideUpAppearActive}${dropdownPlacementCls}topRight
`]: { animationName: slideDownIn },
[`${slideUpLeaveActive}${dropdownPlacementCls}bottomLeft`]: { animationName: slideUpOut },
[`
${slideUpLeaveActive}${dropdownPlacementCls}topLeft,
${slideUpLeaveActive}${dropdownPlacementCls}topRight
`]: { animationName: slideDownOut },
"&-hidden": { display: "none" },
[selectItemCls]: {
...genItemStyle(token),
cursor: "pointer",
transition: `background-color ${token.motionDurationSlow} ease`,
borderRadius: token.borderRadiusSM,
"&-group": {
color: token.colorTextDescription,
fontSize: token.fontSizeSM,
cursor: "default"
},
"&-option": {
display: "flex",
"&-content": {
flex: "auto",
...textEllipsis
},
"&-state": {
flex: "none",
display: "flex",
alignItems: "center"
},
[`&-active:not(${selectItemCls}-option-disabled)`]: { backgroundColor: token.optionActiveBg },
[`&-selected:not(${selectItemCls}-option-disabled)`]: {
color: token.optionSelectedColor,
fontWeight: token.optionSelectedFontWeight,
backgroundColor: token.optionSelectedBg,
[`${selectItemCls}-option-state`]: { color: token.colorPrimary }
},
"&-disabled": {
[`&${selectItemCls}-option-selected`]: { backgroundColor: token.colorBgContainerDisabled },
color: token.colorTextDisabled,
cursor: "not-allowed"
},
"&-grouped": { paddingInlineStart: token.calc(token.controlPaddingHorizontal).mul(2).equal() }
},
"&-empty": {
...genItemStyle(token),
color: token.colorTextDisabled
}
},
[`${selectedItemCls}:has(+ ${selectedItemCls})`]: {
borderEndStartRadius: 0,
borderEndEndRadius: 0,
[`& + ${selectedItemCls}`]: {
borderStartStartRadius: 0,
borderStartEndRadius: 0
}
},
"&-rtl": { direction: "rtl" }
} },
initSlideMotion(token, "slide-up"),
initSlideMotion(token, "slide-down"),
initMoveMotion(token, "move-up"),
initMoveMotion(token, "move-down")
];
};
//#endregion
//#region node_modules/antd/es/select/style/select-input-customize.js
var genSelectInputCustomizeStyle = (token) => {
const { componentCls } = token;
return { [`&${componentCls}-customize`]: {
border: 0,
padding: 0,
fontSize: "inherit",
lineHeight: "inherit",
[`${componentCls}-placeholder`]: { display: "none" },
[`${componentCls}-content`]: {
margin: 0,
padding: 0,
"&-value": { display: "none" }
}
} };
};
//#endregion
//#region node_modules/antd/es/select/style/select-input-multiple.js
var FIXED_INPUT_MIN_WIDTH = 4;
var genSelectInputMultipleStyle = (token) => {
const { componentCls, calc, iconCls, paddingXS, paddingXXS, INTERNAL_FIXED_ITEM_MARGIN, lineWidth, colorIcon, colorIconHover, inputPaddingHorizontalBase, antCls } = token;
const [varName, varRef] = genCssVar(antCls, "select");
return { "&-multiple": {
[varName("multi-item-background")]: token.multipleItemBg,
[varName("multi-item-border-color")]: "transparent",
[varName("multi-item-border-radius")]: token.borderRadiusSM,
[varName("multi-item-height")]: token.multipleItemHeight,
[varName("multi-padding-base")]: `calc((${varRef("height")} - ${varRef("multi-item-height")}) / 2)`,
[varName("multi-padding-vertical")]: `calc(${varRef("multi-padding-base")} - ${INTERNAL_FIXED_ITEM_MARGIN} - ${lineWidth})`,
[varName("multi-item-padding-horizontal")]: `calc(${inputPaddingHorizontalBase} - ${varRef("multi-padding-vertical")} - ${lineWidth} * 2)`,
paddingBlock: varRef("multi-padding-vertical"),
paddingInlineStart: `calc(${varRef("multi-padding-base")} - ${lineWidth})`,
[`${componentCls}-prefix`]: { marginInlineStart: varRef("multi-item-padding-horizontal") },
[`${componentCls}-prefix + ${componentCls}-content`]: {
[`${componentCls}-placeholder`]: { insetInlineStart: 0 },
[`${componentCls}-content-item${componentCls}-content-item-suffix`]: { marginInlineStart: 0 }
},
[`${componentCls}-placeholder`]: {
position: "absolute",
lineHeight: varRef("line-height"),
insetInlineStart: varRef("multi-item-padding-horizontal"),
width: `calc(100% - ${varRef("multi-item-padding-horizontal")})`,
top: "50%",
transform: "translateY(-50%)"
},
[`${componentCls}-content`]: {
flexWrap: "wrap",
alignItems: "center",
lineHeight: 1,
"&-item-prefix": { height: varRef("font-size") },
"&-item": {
lineHeight: 1,
maxWidth: `calc(100% - ${FIXED_INPUT_MIN_WIDTH}px)`
},
[`${componentCls}-content-item-prefix + ${componentCls}-content-item-suffix,
${componentCls}-content-item-suffix:first-child`]: { marginInlineStart: varRef("multi-item-padding-horizontal") },
[`${componentCls}-selection-item`]: {
lineHeight: `calc(${varRef("multi-item-height")} - ${lineWidth} * 2)`,
border: `${lineWidth} solid ${varRef("multi-item-border-color")}`,
display: "flex",
marginBlock: INTERNAL_FIXED_ITEM_MARGIN,
marginInlineEnd: calc(INTERNAL_FIXED_ITEM_MARGIN).mul(2).equal(),
background: varRef("multi-item-background"),
borderRadius: varRef("multi-item-border-radius"),
paddingInlineStart: paddingXS,
paddingInlineEnd: paddingXXS,
transition: [
"height",
"line-height",
"padding"
].map((key) => `${key} ${token.motionDurationSlow}`).join(","),
"&-content": {
...textEllipsis,
marginInlineEnd: paddingXXS
},
"&-remove": {
...resetIcon(),
display: "inline-flex",
alignItems: "center",
color: colorIcon,
fontWeight: "bold",
fontSize: 10,
lineHeight: "inherit",
cursor: "pointer",
[`> ${iconCls}`]: { verticalAlign: "-0.2em" },
"&:hover": { color: colorIconHover }
}
},
[`${componentCls}-input`]: {
lineHeight: calc(INTERNAL_FIXED_ITEM_MARGIN).mul(2).add(varRef("multi-item-height")).equal(),
width: `calc(var(--select-input-width, 0) * 1px)`,
minWidth: FIXED_INPUT_MIN_WIDTH,
maxWidth: "100%",
transition: `line-height ${token.motionDurationSlow}`
}
},
[`&${componentCls}-sm`]: {
[varName("multi-item-height")]: token.multipleItemHeightSM,
[varName("multi-item-border-radius")]: token.borderRadiusXS
},
[`&${componentCls}-lg`]: {
[varName("multi-item-height")]: token.multipleItemHeightLG,
[varName("multi-item-border-radius")]: token.borderRadius
},
[`&${componentCls}-filled`]: {
[varName("multi-item-border-color")]: token.colorSplit,
[varName("multi-item-background")]: token.colorBgContainer,
[`&${componentCls}-disabled`]: { [varName("multi-item-border-color")]: "transparent" }
}
} };
};
//#endregion
//#region node_modules/antd/es/select/style/select-input.js
/** Set CSS variables and hover/focus styles for a Select input based on provided colors. */
var genSelectInputVariableStyle = (token, colors) => {
const { componentCls, antCls } = token;
const [varName] = genCssVar(antCls, "select");
const { border, borderHover, borderActive, borderOutline } = colors;
const baseBG = colors.background || token.selectorBg || token.colorBgContainer;
return {
[varName("border-color")]: border,
[varName("background-color")]: baseBG,
[varName("color")]: colors.color || token.colorText,
[`&:not(${componentCls}-disabled)`]: {
"&:hover": {
[varName("border-color")]: borderHover,
[varName("background-color")]: colors.backgroundHover || baseBG
},
[`&${componentCls}-focused`]: {
[varName("border-color")]: borderActive,
[varName("background-color")]: colors.backgroundActive || baseBG,
boxShadow: `0 0 0 ${unit$1(token.controlOutlineWidth)} ${borderOutline}`
}
},
[`&${componentCls}-disabled`]: {
[varName("border-color")]: colors.borderDisabled || colors.border,
[varName("background-color")]: colors.backgroundDisabled || colors.background
}
};
};
/** Generate variant-scoped variable styles and status overrides for a Select input. */
var genSelectInputVariantStyle = (token, variant, colors, errorColors = {}, warningColors = {}, patchStyle) => {
const { componentCls } = token;
return { [`&${componentCls}-${variant}`]: [
genSelectInputVariableStyle(token, colors),
{
[`&${componentCls}-status-error`]: genSelectInputVariableStyle(token, {
...colors,
color: errorColors.color || token.colorError,
...errorColors
}),
[`&${componentCls}-status-warning`]: genSelectInputVariableStyle(token, {
...colors,
color: warningColors.color || token.colorWarning,
...warningColors
})
},
patchStyle
] };
};
var genSelectInputStyle = (token) => {
const { componentCls, fontHeight, controlHeight, iconCls, antCls, calc } = token;
const [varName, varRef] = genCssVar(antCls, "select");
return { [componentCls]: [
{
[varName("border-radius")]: token.borderRadius,
[varName("border-color")]: "#000",
[varName("border-size")]: token.lineWidth,
[varName("background-color")]: token.colorBgContainer,
[varName("font-size")]: token.fontSize,
[varName("line-height")]: token.lineHeight,
[varName("font-height")]: fontHeight,
[varName("color")]: token.colorText,
[varName("height")]: controlHeight,
[varName("padding-horizontal")]: calc(token.paddingSM).sub(token.lineWidth).equal(),
[varName("padding-vertical")]: `calc((${varRef("height")} - ${varRef("font-height")}) / 2 - ${varRef("border-size")})`,
...resetComponent(token, true),
display: "inline-flex",
flexWrap: "nowrap",
position: "relative",
transition: `all ${token.motionDurationSlow}`,
alignItems: "flex-start",
outline: 0,
cursor: "pointer",
borderRadius: varRef("border-radius"),
borderWidth: varRef("border-size"),
borderStyle: token.lineType,
borderColor: varRef("border-color"),
background: varRef("background-color"),
fontSize: varRef("font-size"),
lineHeight: varRef("line-height"),
color: varRef("color"),
paddingInline: varRef("padding-horizontal"),
paddingBlock: varRef("padding-vertical"),
[`${componentCls}-prefix`]: {
flex: "none",
lineHeight: 1
},
[`${componentCls}-placeholder`]: {
...textEllipsis,
color: token.colorTextPlaceholder,
pointerEvents: "none",
zIndex: 1
},
[`${componentCls}-content`]: {
flex: "auto",
minWidth: 0,
position: "relative",
display: "flex",
marginInlineEnd: calc(token.paddingXXS).mul(1.5).equal(),
"&:before": {
content: "\"\\a0\"",
width: 0,
overflow: "hidden"
},
"&-value": { visibility: "inherit" },
"input[readonly]": {
cursor: "inherit",
caretColor: "transparent"
}
},
[`${componentCls}-suffix`]: {
flex: "none",
color: token.colorTextQuaternary,
fontSize: token.fontSizeIcon,
lineHeight: 1,
"> :not(:last-child)": { marginInlineEnd: token.marginXS }
},
[`${componentCls}-prefix, ${componentCls}-suffix`]: {
alignSelf: "center",
[iconCls]: { verticalAlign: "top" }
},
"&-disabled": {
background: token.colorBgContainerDisabled,
color: token.colorTextDisabled,
cursor: "not-allowed",
input: { cursor: "not-allowed" }
},
"&-sm": {
[varName("height")]: token.controlHeightSM,
[varName("padding-horizontal")]: calc(token.paddingXS).sub(token.lineWidth).equal(),
[varName("border-radius")]: token.borderRadiusSM,
[`${componentCls}-clear`]: { insetInlineEnd: varRef("padding-horizontal") }
},
"&-lg": {
[varName("height")]: token.controlHeightLG,
[varName("font-size")]: token.fontSizeLG,
[varName("line-height")]: token.lineHeightLG,
[varName("font-height")]: token.fontHeightLG,
[varName("border-radius")]: token.borderRadiusLG
}
},
{ [`&:not(${componentCls}-customize)`]: { [`${componentCls}-input`]: {
outline: "none",
background: "transparent",
appearance: "none",
border: 0,
margin: 0,
padding: 0,
color: varRef("color"),
"&::-webkit-search-cancel-button": {
display: "none",
appearance: "none"
}
} } },
{ [`&-single:not(${componentCls}-customize)`]: {
[`${componentCls}-input`]: {
position: "absolute",
inset: 0,
lineHeight: `calc(${varRef("font-height")} + ${varRef("padding-vertical")} * 2)`
},
[`${componentCls}-content`]: {
...textEllipsis,
alignSelf: "center",
"&-has-value": {
display: "block",
"&:before": { display: "none" }
},
"&-has-search-value": { color: "transparent" },
"&-value": {
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`,
zIndex: 1
}
},
[`&${componentCls}-open ${componentCls}-content`]: {
color: token.colorTextPlaceholder,
"&-has-search-value": { color: "transparent" }
}
} },
{ [`&-show-search:not(${componentCls}-customize-input):not(${componentCls}-disabled)`]: { cursor: "text" } },
genSelectInputMultipleStyle(token),
genSelectInputVariantStyle(token, "outlined", {
border: token.colorBorder,
borderHover: token.hoverBorderColor,
borderActive: token.activeBorderColor,
borderOutline: token.activeOutlineColor,
borderDisabled: token.colorBorderDisabled
}, {
border: token.colorError,
borderHover: token.colorErrorHover,
borderActive: token.colorError,
borderOutline: token.colorErrorOutline
}, {
border: token.colorWarning,
borderHover: token.colorWarningHover,
borderActive: token.colorWarning,
borderOutline: token.colorWarningOutline
}),
genSelectInputVariantStyle(token, "filled", {
border: "transparent",
borderHover: "transparent",
borderActive: token.activeBorderColor,
borderOutline: "transparent",
borderDisabled: token.colorBorderDisabled,
background: token.colorFillTertiary,
backgroundHover: token.colorFillSecondary,
backgroundActive: token.colorBgContainer
}, {
background: token.colorErrorBg,
backgroundHover: token.colorErrorBgHover,
borderActive: token.colorError
}, {
background: token.colorWarningBg,
backgroundHover: token.colorWarningBgHover,
borderActive: token.colorWarning
}),
genSelectInputVariantStyle(token, "borderless", {
border: "transparent",
borderHover: "transparent",
borderActive: "transparent",
borderOutline: "transparent",
background: "transparent"
}),
genSelectInputVariantStyle(token, "underlined", {
border: token.colorBorder,
borderHover: token.hoverBorderColor,
borderActive: token.activeBorderColor,
borderOutline: "transparent"
}, {
border: token.colorError,
borderHover: token.colorErrorHover,
borderActive: token.colorError
}, {
border: token.colorWarning,
borderHover: token.colorWarningHover,
borderActive: token.colorWarning
}, {
borderRadius: 0,
borderTopColor: "transparent",
borderInlineColor: "transparent"
}),
genSelectInputCustomizeStyle(token)
] };
};
//#endregion
//#region node_modules/antd/es/select/style/token.js
var prepareComponentToken$47 = (token) => {
const { fontSize, lineHeight, lineWidth, controlHeight, controlHeightSM, controlHeightLG, paddingXXS, controlPaddingHorizontal, zIndexPopupBase, colorText, fontWeightStrong, controlItemBgActive, controlItemBgHover, colorBgContainer, colorFillSecondary, colorBgContainerDisabled, colorTextDisabled, colorPrimaryHover, colorPrimary, controlOutline } = token;
const dblPaddingXXS = paddingXXS * 2;
const dblLineWidth = lineWidth * 2;
const multipleItemHeight = Math.min(controlHeight - dblPaddingXXS, controlHeight - dblLineWidth);
const multipleItemHeightSM = Math.min(controlHeightSM - dblPaddingXXS, controlHeightSM - dblLineWidth);
const multipleItemHeightLG = Math.min(controlHeightLG - dblPaddingXXS, controlHeightLG - dblLineWidth);
return {
INTERNAL_FIXED_ITEM_MARGIN: Math.floor(paddingXXS / 2),
zIndexPopup: zIndexPopupBase + 50,
optionSelectedColor: colorText,
optionSelectedFontWeight: fontWeightStrong,
optionSelectedBg: controlItemBgActive,
optionActiveBg: controlItemBgHover,
optionPadding: `${(controlHeight - fontSize * lineHeight) / 2}px ${controlPaddingHorizontal}px`,
optionFontSize: fontSize,
optionLineHeight: lineHeight,
optionHeight: controlHeight,
selectorBg: colorBgContainer,
clearBg: colorBgContainer,
singleItemHeightLG: controlHeightLG,
multipleItemBg: colorFillSecondary,
multipleItemBorderColor: "transparent",
multipleItemHeight,
multipleItemHeightSM,
multipleItemHeightLG,
multipleSelectorBgDisabled: colorBgContainerDisabled,
multipleItemColorDisabled: colorTextDisabled,
multipleItemBorderColorDisabled: "transparent",
showArrowPaddingInlineEnd: Math.ceil(token.fontSize * 1.25),
hoverBorderColor: colorPrimaryHover,
activeBorderColor: colorPrimary,
activeOutlineColor: controlOutline,
selectAffixPadding: paddingXXS
};
};
//#endregion
//#region node_modules/antd/es/select/style/index.js
var genBaseStyle$14 = (token) => {
const { antCls, componentCls, motionDurationMid, inputPaddingHorizontalBase } = token;
const hoverShowClearStyle = { [`${componentCls}-clear`]: {
opacity: 1,
background: token.colorBgBase,
borderRadius: "50%"
} };
return {
[componentCls]: {
...resetComponent(token),
[`${componentCls}-selection-item`]: {
flex: 1,
fontWeight: "normal",
position: "relative",
userSelect: "none",
...textEllipsis,
[`> ${antCls}-typography`]: { display: "inline" }
},
[`${componentCls}-prefix`]: {
flex: "none",
marginInlineEnd: token.selectAffixPadding
},
[`${componentCls}-clear`]: {
position: "absolute",
top: "50%",
insetInlineStart: "auto",
insetInlineEnd: inputPaddingHorizontalBase,
zIndex: 1,
display: "inline-block",
width: token.fontSizeIcon,
height: token.fontSizeIcon,
marginTop: token.calc(token.fontSizeIcon).mul(-1).div(2).equal(),
color: token.colorTextQuaternary,
fontSize: token.fontSizeIcon,
fontStyle: "normal",
lineHeight: 1,
textAlign: "center",
textTransform: "none",
cursor: "pointer",
opacity: 0,
transition: ["color", "opacity"].map((prop) => `${prop} ${motionDurationMid} ease`).join(", "),
textRendering: "auto",
transform: "translateZ(0)",
"&:before": { display: "block" },
"&:hover": { color: token.colorIcon }
},
"@media(hover:none)": hoverShowClearStyle,
"&:hover": hoverShowClearStyle
},
[`${componentCls}-status`]: { "&-error, &-warning, &-success, &-validating": { [`&${componentCls}-has-feedback`]: { [`${componentCls}-clear`]: { insetInlineEnd: token.calc(inputPaddingHorizontalBase).add(token.fontSize).add(token.paddingXS).equal() } } } }
};
};
var genSelectStyle = (token) => {
const { componentCls } = token;
return [
{ [componentCls]: { [`&${componentCls}-in-form-item`]: { width: "100%" } } },
genBaseStyle$14(token),
genSingleStyle(token),
{ [`${componentCls}-rtl`]: { direction: "rtl" } },
genCompactItemStyle(token, { focusElCls: `${componentCls}-focused` })
];
};
var style_default$52 = genStyleHooks("Select", (token, { rootPrefixCls }) => {
const selectToken = merge(token, {
rootPrefixCls,
inputPaddingHorizontalBase: token.calc(token.paddingSM).sub(token.lineWidth).equal(),
multipleSelectItemHeight: token.multipleItemHeight,
selectHeight: token.controlHeight
});
return [genSelectStyle(selectToken), genSelectInputStyle(selectToken)];
}, prepareComponentToken$47, { unitless: {
optionLineHeight: true,
optionSelectedFontWeight: true
} });
//#endregion
//#region node_modules/antd/es/select/useIcons.js
function useIcons$2({ suffixIcon, clearIcon, menuItemSelectedIcon, removeIcon, loading, loadingIcon, multiple, hasFeedback, showSuffixIcon, feedbackIcon, showArrow, componentName }) {
devUseWarning(componentName).deprecated(!clearIcon, "clearIcon", "allowClear={{ clearIcon: React.ReactNode }}");
const mergedClearIcon = clearIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$3, null);
const getSuffixIconNode = (arrowIcon) => {
if (suffixIcon === null && !hasFeedback && !showArrow) return null;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, showSuffixIcon !== false && arrowIcon, hasFeedback && feedbackIcon);
};
let mergedSuffixIcon = null;
if (suffixIcon !== void 0) mergedSuffixIcon = getSuffixIconNode(suffixIcon);
else if (loading) mergedSuffixIcon = getSuffixIconNode(loadingIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$5, { spin: true }));
else mergedSuffixIcon = ({ open, showSearch }) => {
if (open && showSearch) return getSuffixIconNode(/* @__PURE__ */ import_react.createElement(RefIcon$7, null));
return getSuffixIconNode(/* @__PURE__ */ import_react.createElement(RefIcon$8, null));
};
let mergedItemIcon = null;
if (menuItemSelectedIcon !== void 0) mergedItemIcon = menuItemSelectedIcon;
else if (multiple) mergedItemIcon = /* @__PURE__ */ import_react.createElement(RefIcon$9, null);
else mergedItemIcon = null;
let mergedRemoveIcon = null;
if (removeIcon !== void 0) mergedRemoveIcon = removeIcon;
else mergedRemoveIcon = /* @__PURE__ */ import_react.createElement(RefIcon, null);
return {
clearIcon: mergedClearIcon,
suffixIcon: mergedSuffixIcon,
itemIcon: mergedItemIcon,
removeIcon: mergedRemoveIcon
};
}
//#endregion
//#region node_modules/antd/es/select/usePopupRender.js
function usePopupRender(renderFn) {
return import_react.useMemo(() => {
if (!renderFn) return;
return (...args) => /* @__PURE__ */ import_react.createElement(ContextIsolator, { space: true }, renderFn.apply(void 0, args));
}, [renderFn]);
}
//#endregion
//#region node_modules/antd/es/select/useShowArrow.js
/**
* Since Select, TreeSelect, Cascader is same Select like component.
* We just use same hook to handle this logic.
*
* If `suffixIcon` is not equal to `null`, always show it.
*/
function useShowArrow(suffixIcon, showArrow) {
return showArrow !== void 0 ? showArrow : suffixIcon !== null;
}
//#endregion
//#region node_modules/antd/es/select/index.js
var SECRET_COMBOBOX_MODE_DO_NOT_USE = "SECRET_COMBOBOX_MODE_DO_NOT_USE";
var InternalSelect = (props, ref) => {
const { prefixCls: customizePrefixCls, bordered, className, rootClassName, getPopupContainer, popupClassName, dropdownClassName, listHeight = 256, placement, listItemHeight: customListItemHeight, size: customizeSize, disabled: customDisabled, notFoundContent, status: customStatus, builtinPlacements, dropdownMatchSelectWidth, popupMatchSelectWidth, direction: propDirection, style, allowClear, variant: customizeVariant, popupStyle, dropdownStyle, transitionName, tagRender, maxCount, prefix, dropdownRender, popupRender, onDropdownVisibleChange, onOpenChange, styles, classNames, ...rest } = props;
const { getPopupContainer: getContextPopupContainer, getPrefixCls, renderEmpty, direction: contextDirection, virtual, popupMatchSelectWidth: contextPopupMatchSelectWidth, popupOverflow } = import_react.useContext(ConfigContext);
const { showSearch, style: contextStyle, styles: contextStyles, className: contextClassName, classNames: contextClassNames } = useComponentConfig("select");
const [, token] = useToken$1();
const listItemHeight = customListItemHeight ?? token?.controlHeight;
const prefixCls = getPrefixCls("select", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const direction = propDirection ?? contextDirection;
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const [variant, enableVariantCls] = useVariant("select", customizeVariant, bordered);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$52(prefixCls, rootCls);
const mode = import_react.useMemo(() => {
const { mode: m } = props;
if (m === "combobox") return;
if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) return "combobox";
return m;
}, [props.mode]);
const isMultiple = mode === "multiple" || mode === "tags";
const showSuffixIcon = useShowArrow(props.suffixIcon, props.showArrow);
const mergedPopupMatchSelectWidth = popupMatchSelectWidth ?? dropdownMatchSelectWidth ?? contextPopupMatchSelectWidth;
const mergedPopupRender = usePopupRender(popupRender || dropdownRender);
const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
const { status: contextStatus, hasFeedback, isFormItemInput, feedbackIcon } = import_react.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
let mergedNotFound;
if (notFoundContent !== void 0) mergedNotFound = notFoundContent;
else if (mode === "combobox") mergedNotFound = null;
else mergedNotFound = renderEmpty?.("Select") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "Select" });
const { suffixIcon, itemIcon, removeIcon, clearIcon } = useIcons$2({
...rest,
multiple: isMultiple,
hasFeedback,
feedbackIcon,
showSuffixIcon,
prefixCls,
componentName: "Select"
});
const mergedAllowClear = allowClear === true ? { clearIcon } : allowClear;
const selectProps = omit(rest, ["suffixIcon", "itemIcon"]);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const mergedProps = {
...props,
variant,
status: mergedStatus,
disabled: mergedDisabled,
size: mergedSize
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { popup: { _default: "root" } });
const mergedPopupClassName = clsx(mergedClassNames.popup?.root, popupClassName, dropdownClassName, { [`${prefixCls}-dropdown-${direction}`]: direction === "rtl" }, rootClassName, cssVarCls, rootCls, hashId);
const mergedPopupStyle = {
...mergedStyles.popup?.root,
...popupStyle ?? dropdownStyle
};
const mergedClassName = clsx({
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-${variant}`]: enableVariantCls,
[`${prefixCls}-in-form-item`]: isFormItemInput
}, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, contextClassName, className, mergedClassNames.root, rootClassName, cssVarCls, rootCls, hashId);
const memoPlacement = import_react.useMemo(() => {
if (placement !== void 0) return placement;
return direction === "rtl" ? "bottomRight" : "bottomLeft";
}, [placement, direction]);
{
const warning = devUseWarning("Select");
Object.entries({
dropdownMatchSelectWidth: "popupMatchSelectWidth",
dropdownStyle: "styles.popup.root",
dropdownClassName: "classNames.popup.root",
popupClassName: "classNames.popup.root",
dropdownRender: "popupRender",
onDropdownVisibleChange: "onOpenChange",
bordered: "variant"
}).forEach(([oldProp, newProp]) => {
warning.deprecated(!(oldProp in props), oldProp, newProp);
});
warning(!("showArrow" in props), "deprecated", "`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.");
warning(!(typeof maxCount !== "undefined" && !isMultiple), "usage", "`maxCount` only works with mode `multiple` or `tags`");
}
const [zIndex] = useZIndex("SelectLike", mergedStyles.popup?.root?.zIndex ?? mergedPopupStyle?.zIndex);
return /* @__PURE__ */ import_react.createElement(es_default$20, {
ref,
virtual,
classNames: mergedClassNames,
styles: mergedStyles,
showSearch,
...selectProps,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
popupMatchSelectWidth: mergedPopupMatchSelectWidth,
transitionName: getTransitionName(rootPrefixCls, "slide-up", transitionName),
builtinPlacements: mergedBuiltinPlacements(builtinPlacements, popupOverflow),
listHeight,
listItemHeight,
mode,
prefixCls,
placement: memoPlacement,
direction,
prefix,
suffixIcon,
menuItemSelectedIcon: itemIcon,
removeIcon,
allowClear: mergedAllowClear,
notFoundContent: mergedNotFound,
className: mergedClassName,
getPopupContainer: getPopupContainer || getContextPopupContainer,
popupClassName: mergedPopupClassName,
disabled: mergedDisabled,
popupStyle: {
...mergedStyles.popup?.root,
...mergedPopupStyle,
zIndex
},
maxCount: isMultiple ? maxCount : void 0,
tagRender: isMultiple ? tagRender : void 0,
popupRender: mergedPopupRender,
onPopupVisibleChange: mergedOnOpenChange
});
};
InternalSelect.displayName = "Select";
var Select = /* @__PURE__ */ import_react.forwardRef(InternalSelect);
/* istanbul ignore next */
var PurePanel$12 = genPurePanel(Select, "popupAlign");
Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
Select.Option = Option$4;
Select.OptGroup = OptGroup;
Select._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$12;
Select.displayName = "Select";
//#endregion
//#region node_modules/antd/es/auto-complete/AutoComplete.js
var { Option: Option$3 } = Select;
function isSelectOptionOrSelectOptGroup(child) {
return child?.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
}
var AutoComplete$1 = (props, ref) => {
const { prefixCls: customizePrefixCls, className, style, popupClassName, dropdownClassName, children, dataSource, rootClassName, dropdownStyle, dropdownRender, popupRender, onDropdownVisibleChange, onOpenChange, styles, classNames, popupMatchSelectWidth, dropdownMatchSelectWidth } = props;
const childNodes = toArray$8(children);
const mergedPopupRender = popupRender || dropdownRender;
const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
const mergedPopupMatchSelectWidth = popupMatchSelectWidth ?? dropdownMatchSelectWidth;
let customizeInput;
if (childNodes.length === 1 && /* @__PURE__ */ import_react.isValidElement(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) [customizeInput] = childNodes;
const getInputElement = customizeInput ? () => customizeInput : void 0;
let optionChildren;
if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) optionChildren = children;
else optionChildren = dataSource ? dataSource.map((item) => {
if (/* @__PURE__ */ import_react.isValidElement(item)) return item;
switch (typeof item) {
case "string": return /* @__PURE__ */ import_react.createElement(Option$3, {
key: item,
value: item
}, item);
case "object": {
const { value: optionValue } = item;
return /* @__PURE__ */ import_react.createElement(Option$3, {
key: optionValue,
value: optionValue
}, item.text);
}
default: return;
}
}) : [];
{
const warning = devUseWarning("AutoComplete");
warning(!customizeInput || !("size" in props), "usage", "You need to control style self instead of setting `size` when using customize input.");
Object.entries({
dropdownMatchSelectWidth: "popupMatchSelectWidth",
dropdownStyle: "styles.popup.root",
dropdownClassName: "classNames.popup.root",
popupClassName: "classNames.popup.root",
dropdownRender: "popupRender",
onDropdownVisibleChange: "onOpenChange",
dataSource: "options"
}).forEach(([oldProp, newProp]) => {
warning.deprecated(!(oldProp in props), oldProp, newProp);
});
}
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("select", customizePrefixCls);
const mergedProps = {
...props,
popupRender: mergedPopupRender,
onOpenChange: mergedOnOpenChange,
popupMatchSelectWidth: mergedPopupMatchSelectWidth
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([classNames], [styles], { props: mergedProps }, { popup: { _default: "root" } });
const finalClassNames = import_react.useMemo(() => ({
root: clsx(`${prefixCls}-auto-complete`, className, rootClassName, mergedClassNames.root, { [`${prefixCls}-customize`]: customizeInput }),
prefix: mergedClassNames.prefix,
input: mergedClassNames.input,
placeholder: mergedClassNames.placeholder,
content: mergedClassNames.content,
popup: {
root: clsx(popupClassName, dropdownClassName, mergedClassNames.popup?.root),
list: mergedClassNames.popup?.list,
listItem: mergedClassNames.popup?.listItem
}
}), [
prefixCls,
className,
rootClassName,
mergedClassNames,
popupClassName,
dropdownClassName
]);
const finalStyles = import_react.useMemo(() => ({
root: {
...mergedStyles.root,
...style
},
input: mergedStyles.input,
prefix: mergedStyles.prefix,
placeholder: mergedStyles.placeholder,
content: mergedStyles.content,
popup: {
root: {
...dropdownStyle,
...mergedStyles.popup?.root
},
list: mergedStyles.popup?.list,
listItem: mergedStyles.popup?.listItem
}
}), [
mergedStyles,
style,
dropdownStyle
]);
return /* @__PURE__ */ import_react.createElement(Select, {
ref,
suffixIcon: null,
...omit(props, [
"dataSource",
"dropdownClassName",
"popupClassName"
]),
prefixCls,
classNames: finalClassNames,
styles: finalStyles,
mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE,
popupRender: mergedPopupRender,
onPopupVisibleChange: mergedOnOpenChange,
popupMatchSelectWidth: mergedPopupMatchSelectWidth,
getInputElement
}, optionChildren);
};
var RefAutoComplete = /* @__PURE__ */ import_react.forwardRef(AutoComplete$1);
RefAutoComplete.displayName = "AutoComplete";
//#endregion
//#region node_modules/antd/es/auto-complete/index.js
var { Option: Option$2 } = Select;
/* istanbul ignore next */
var PurePanel$11 = genPurePanel(RefAutoComplete, "popupAlign", (props) => omit(props, ["visible"]));
var AutoComplete = RefAutoComplete;
AutoComplete.Option = Option$2;
AutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$11;
//#endregion
//#region node_modules/antd/es/_util/responsiveObserver.js
var responsiveArray = [
"xxxl",
"xxl",
"xl",
"lg",
"md",
"sm",
"xs"
];
var responsiveArrayReversed = [].concat(responsiveArray).reverse();
var getResponsiveMap = (token) => ({
xs: `(max-width: ${token.screenXSMax}px)`,
sm: `(min-width: ${token.screenSM}px)`,
md: `(min-width: ${token.screenMD}px)`,
lg: `(min-width: ${token.screenLG}px)`,
xl: `(min-width: ${token.screenXL}px)`,
xxl: `(min-width: ${token.screenXXL}px)`,
xxxl: `(min-width: ${token.screenXXXL}px)`
});
/**
* Ensures that the breakpoints token are valid, in good order
* For each breakpoint : screenMin <= screen <= screenMax and screenMax <= nextScreenMin
*/
var validateBreakpoints = (token) => {
const indexableToken = token;
const revBreakpoints = [].concat(responsiveArray).reverse();
revBreakpoints.forEach((breakpoint, i) => {
const breakpointUpper = breakpoint.toUpperCase();
const screenMin = `screen${breakpointUpper}Min`;
const screen = `screen${breakpointUpper}`;
if (!(indexableToken[screenMin] <= indexableToken[screen])) throw new Error(`${screenMin}<=${screen} fails : !(${indexableToken[screenMin]}<=${indexableToken[screen]})`);
if (i < revBreakpoints.length - 1) {
const screenMax = `screen${breakpointUpper}Max`;
if (!(indexableToken[screen] <= indexableToken[screenMax])) throw new Error(`${screen}<=${screenMax} fails : !(${indexableToken[screen]}<=${indexableToken[screenMax]})`);
const nextScreenMin = `screen${revBreakpoints[i + 1].toUpperCase()}Min`;
if (!(indexableToken[screenMax] <= indexableToken[nextScreenMin])) throw new Error(`${screenMax}<=${nextScreenMin} fails : !(${indexableToken[screenMax]}<=${indexableToken[nextScreenMin]})`);
}
});
return token;
};
var matchScreen = (screens, screenSizes) => {
if (!screenSizes) return;
for (const breakpoint of responsiveArray) if (screens[breakpoint] && screenSizes?.[breakpoint] !== void 0) return screenSizes[breakpoint];
};
var useResponsiveObserver = () => {
const [, token] = useToken$1();
const responsiveMap = getResponsiveMap(validateBreakpoints(token));
return import_react.useMemo(() => {
const subscribers = /* @__PURE__ */ new Map();
let subUid = -1;
let screens = {};
return {
responsiveMap,
matchHandlers: {},
dispatch(pointMap) {
screens = pointMap;
subscribers.forEach((func) => {
func(screens);
});
return subscribers.size >= 1;
},
subscribe(func) {
if (!subscribers.size) this.register();
subUid += 1;
subscribers.set(subUid, func);
func(screens);
return subUid;
},
unsubscribe(paramToken) {
subscribers.delete(paramToken);
if (!subscribers.size) this.unregister();
},
register() {
Object.entries(responsiveMap).forEach(([screen, mediaQuery]) => {
const listener = ({ matches }) => {
this.dispatch({
...screens,
[screen]: matches
});
};
const mql = window.matchMedia(mediaQuery);
if (typeof mql?.addEventListener === "function") mql.addEventListener("change", listener);
this.matchHandlers[mediaQuery] = {
mql,
listener
};
listener(mql);
});
},
unregister() {
Object.values(responsiveMap).forEach((mediaQuery) => {
const handler = this.matchHandlers[mediaQuery];
if (typeof handler?.mql?.removeEventListener === "function") handler.mql.removeEventListener("change", handler?.listener);
});
subscribers.clear();
}
};
}, [responsiveMap]);
};
//#endregion
//#region node_modules/antd/es/grid/hooks/useBreakpoint.js
function useBreakpoint$1(refreshOnChange = true, defaultScreens = {}) {
const screensRef = (0, import_react.useRef)(defaultScreens);
const [, forceUpdate] = useForceUpdate();
const responsiveObserver = useResponsiveObserver();
useLayoutEffect$1(() => {
const token = responsiveObserver.subscribe((supportScreens) => {
screensRef.current = supportScreens;
if (refreshOnChange) forceUpdate();
});
return () => responsiveObserver.unsubscribe(token);
}, []);
return screensRef.current;
}
//#endregion
//#region node_modules/antd/es/avatar/AvatarContext.js
var AvatarContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/antd/es/avatar/style/index.js
var genBaseStyle$13 = (token) => {
const { antCls, componentCls, iconCls, avatarBg, avatarColor, containerSize, containerSizeLG, containerSizeSM, textFontSize, textFontSizeLG, textFontSizeSM, iconFontSize, iconFontSizeLG, iconFontSizeSM, borderRadius, borderRadiusLG, borderRadiusSM, lineWidth, lineType } = token;
const avatarSizeStyle = (size, fontSize, iconFontSize, radius) => ({
width: size,
height: size,
borderRadius: "50%",
fontSize,
[`&${componentCls}-square`]: { borderRadius: radius },
[`&${componentCls}-icon`]: {
fontSize: iconFontSize,
[`> ${iconCls}`]: { margin: 0 }
}
});
return { [componentCls]: {
...resetComponent(token),
position: "relative",
display: "inline-flex",
justifyContent: "center",
alignItems: "center",
overflow: "hidden",
color: avatarColor,
whiteSpace: "nowrap",
textAlign: "center",
verticalAlign: "middle",
background: avatarBg,
border: `${unit$1(lineWidth)} ${lineType} transparent`,
"&-image": { background: "transparent" },
[`${antCls}-image-img`]: { display: "block" },
...avatarSizeStyle(containerSize, textFontSize, iconFontSize, borderRadius),
"&-lg": { ...avatarSizeStyle(containerSizeLG, textFontSizeLG, iconFontSizeLG, borderRadiusLG) },
"&-sm": { ...avatarSizeStyle(containerSizeSM, textFontSizeSM, iconFontSizeSM, borderRadiusSM) },
"> img": {
display: "block",
width: "100%",
height: "100%",
objectFit: "cover"
}
} };
};
var genGroupStyle$2 = (token) => {
const { componentCls, groupBorderColor, groupOverlapping, groupSpace } = token;
return {
[`${componentCls}-group`]: {
display: "inline-flex",
[componentCls]: { borderColor: groupBorderColor },
"> *:not(:first-child)": { marginInlineStart: groupOverlapping }
},
[`${componentCls}-group-popover`]: { [`${componentCls} + ${componentCls}`]: { marginInlineStart: groupSpace } }
};
};
var prepareComponentToken$46 = (token) => {
const { controlHeight, controlHeightLG, controlHeightSM, fontSize, fontSizeLG, fontSizeXL, fontSizeHeading3, marginXS, marginXXS, colorBorderBg } = token;
return {
containerSize: controlHeight,
containerSizeLG: controlHeightLG,
containerSizeSM: controlHeightSM,
textFontSize: fontSize,
textFontSizeLG: fontSize,
textFontSizeSM: fontSize,
iconFontSize: Math.round((fontSizeLG + fontSizeXL) / 2),
iconFontSizeLG: fontSizeHeading3,
iconFontSizeSM: fontSize,
groupSpace: marginXXS,
groupOverlapping: -marginXS,
groupBorderColor: colorBorderBg
};
};
var style_default$51 = genStyleHooks("Avatar", (token) => {
const { colorTextLightSolid, colorTextPlaceholder } = token;
const avatarToken = merge(token, {
avatarBg: colorTextPlaceholder,
avatarColor: colorTextLightSolid
});
return [genBaseStyle$13(avatarToken), genGroupStyle$2(avatarToken)];
}, prepareComponentToken$46);
//#endregion
//#region node_modules/antd/es/avatar/Avatar.js
var Avatar$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, shape, size: customSize, src, srcSet, icon, className, rootClassName, style, alt, draggable, children, crossOrigin, gap = 4, onError, ...others } = props;
const [scale, setScale] = import_react.useState(1);
const [mounted, setMounted] = import_react.useState(false);
const [isImgExist, setIsImgExist] = import_react.useState(true);
const avatarNodeRef = import_react.useRef(null);
const avatarChildrenRef = import_react.useRef(null);
const avatarNodeMergedRef = composeRef(ref, avatarNodeRef);
const { getPrefixCls, className: contextClassName, style: contextStyle } = useComponentConfig("avatar");
const avatarCtx = import_react.useContext(AvatarContext);
const setScaleParam = () => {
if (!avatarChildrenRef.current || !avatarNodeRef.current) return;
const childrenWidth = avatarChildrenRef.current.offsetWidth;
const nodeWidth = avatarNodeRef.current.offsetWidth;
if (childrenWidth !== 0 && nodeWidth !== 0) {
if (gap * 2 < nodeWidth) setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
}
};
import_react.useEffect(() => {
setMounted(true);
}, []);
import_react.useEffect(() => {
setIsImgExist(true);
setScale(1);
}, [src]);
import_react.useEffect(setScaleParam, [gap]);
const handleImgLoadError = () => {
if (onError?.() !== false) setIsImgExist(false);
};
const size = useSize((ctxSize) => customSize ?? avatarCtx?.size ?? ctxSize ?? "medium");
const screens = useBreakpoint$1(Object.keys(isPlainObject(size) ? size || {} : {}).some((key) => responsiveArray.includes(key)));
const responsiveSizeStyle = import_react.useMemo(() => {
if (!isPlainObject(size)) return {};
const currentSize = size[responsiveArray.find((screen) => screens[screen])];
return currentSize ? {
width: currentSize,
height: currentSize,
fontSize: currentSize && (icon || children) ? currentSize / 2 : 18
} : {};
}, [
screens,
size,
icon,
children
]);
devUseWarning("Avatar")(!(typeof icon === "string" && icon.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`);
const prefixCls = getPrefixCls("avatar", customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$51(prefixCls, rootCls);
const sizeCls = clsx({
[`${prefixCls}-lg`]: size === "large",
[`${prefixCls}-sm`]: size === "small"
});
const hasImageElement = /* @__PURE__ */ import_react.isValidElement(src);
const classString = clsx(prefixCls, sizeCls, contextClassName, `${prefixCls}-${shape || avatarCtx?.shape || "circle"}`, {
[`${prefixCls}-image`]: hasImageElement || src && isImgExist,
[`${prefixCls}-icon`]: !!icon
}, cssVarCls, rootCls, className, rootClassName, hashId);
const sizeStyle = isNumber(size) ? {
width: size,
height: size,
fontSize: icon ? size / 2 : 18
} : {};
let childrenToRender;
if (typeof src === "string" && isImgExist) childrenToRender = /* @__PURE__ */ import_react.createElement("img", {
src,
draggable,
srcSet,
onError: handleImgLoadError,
alt,
crossOrigin
});
else if (hasImageElement) childrenToRender = src;
else if (icon) childrenToRender = icon;
else if (mounted || scale !== 1) {
const transformString = `scale(${scale})`;
const childrenStyle = {
msTransform: transformString,
WebkitTransform: transformString,
transform: transformString
};
childrenToRender = /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: setScaleParam }, /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-string`,
ref: avatarChildrenRef,
style: childrenStyle
}, children));
} else childrenToRender = /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-string`,
style: { opacity: 0 },
ref: avatarChildrenRef
}, children);
return /* @__PURE__ */ import_react.createElement("span", {
...others,
style: {
...sizeStyle,
...responsiveSizeStyle,
...contextStyle,
...style
},
className: classString,
ref: avatarNodeMergedRef
}, childrenToRender);
});
Avatar$1.displayName = "Avatar";
//#endregion
//#region node_modules/antd/es/_util/getRenderPropValue.js
var getRenderPropValue = (propValue) => {
if (!propValue) return null;
return typeof propValue === "function" ? propValue() : propValue;
};
//#endregion
//#region node_modules/@rc-component/tooltip/es/Popup.js
var Popup$1 = (props) => {
const { children, prefixCls, id, classNames, styles, className, style } = props;
return /* @__PURE__ */ import_react.createElement("div", {
id,
className: clsx(`${prefixCls}-container`, classNames?.container, className),
style: {
...styles?.container,
...style
},
role: "tooltip"
}, typeof children === "function" ? children() : children);
};
//#endregion
//#region node_modules/@rc-component/tooltip/es/placements.js
var autoAdjustOverflowTopBottom = {
shiftX: 64,
adjustY: 1
};
var autoAdjustOverflowLeftRight = {
adjustX: 1,
shiftY: true
};
var targetOffset$2 = [0, 0];
var placements$3 = {
left: {
points: ["cr", "cl"],
overflow: autoAdjustOverflowLeftRight,
offset: [-4, 0],
targetOffset: targetOffset$2
},
right: {
points: ["cl", "cr"],
overflow: autoAdjustOverflowLeftRight,
offset: [4, 0],
targetOffset: targetOffset$2
},
top: {
points: ["bc", "tc"],
overflow: autoAdjustOverflowTopBottom,
offset: [0, -4],
targetOffset: targetOffset$2
},
bottom: {
points: ["tc", "bc"],
overflow: autoAdjustOverflowTopBottom,
offset: [0, 4],
targetOffset: targetOffset$2
},
topLeft: {
points: ["bl", "tl"],
overflow: autoAdjustOverflowTopBottom,
offset: [0, -4],
targetOffset: targetOffset$2
},
leftTop: {
points: ["tr", "tl"],
overflow: autoAdjustOverflowLeftRight,
offset: [-4, 0],
targetOffset: targetOffset$2
},
topRight: {
points: ["br", "tr"],
overflow: autoAdjustOverflowTopBottom,
offset: [0, -4],
targetOffset: targetOffset$2
},
rightTop: {
points: ["tl", "tr"],
overflow: autoAdjustOverflowLeftRight,
offset: [4, 0],
targetOffset: targetOffset$2
},
bottomRight: {
points: ["tr", "br"],
overflow: autoAdjustOverflowTopBottom,
offset: [0, 4],
targetOffset: targetOffset$2
},
rightBottom: {
points: ["bl", "br"],
overflow: autoAdjustOverflowLeftRight,
offset: [4, 0],
targetOffset: targetOffset$2
},
bottomLeft: {
points: ["tl", "bl"],
overflow: autoAdjustOverflowTopBottom,
offset: [0, 4],
targetOffset: targetOffset$2
},
leftBottom: {
points: ["br", "bl"],
overflow: autoAdjustOverflowLeftRight,
offset: [-4, 0],
targetOffset: targetOffset$2
}
};
//#endregion
//#region node_modules/@rc-component/tooltip/es/Tooltip.js
function _extends$76() {
_extends$76 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$76.apply(this, arguments);
}
//#endregion
//#region node_modules/@rc-component/tooltip/es/index.js
var es_default$19 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { trigger = ["hover"], mouseEnterDelay = 0, mouseLeaveDelay = .1, prefixCls = "rc-tooltip", children, onVisibleChange, afterVisibleChange, motion, placement = "right", align = {}, destroyOnHidden = false, defaultVisible, getTooltipContainer, arrowContent, overlay, id, showArrow = true, classNames, styles, ...restProps } = props;
const mergedId = useId_default(id);
const triggerRef = (0, import_react.useRef)(null);
(0, import_react.useImperativeHandle)(ref, () => triggerRef.current);
const extraProps = { ...restProps };
if ("visible" in props) extraProps.popupVisible = props.visible;
const mergedArrow = import_react.useMemo(() => {
if (!showArrow) return false;
const arrowConfig = showArrow === true ? {} : showArrow;
return {
...arrowConfig,
className: clsx(arrowConfig.className, classNames?.arrow),
style: {
...arrowConfig.style,
...styles?.arrow
},
content: arrowConfig.content ?? arrowContent
};
}, [
showArrow,
classNames?.arrow,
styles?.arrow,
arrowContent
]);
const getChildren = ({ open }) => {
const child = import_react.Children.only(children);
const ariaProps = { "aria-describedby": overlay && open ? mergedId : void 0 };
return /* @__PURE__ */ import_react.cloneElement(child, ariaProps);
};
return /* @__PURE__ */ import_react.createElement(es_default$26, _extends$76({
popupClassName: classNames?.root,
prefixCls,
popup: /* @__PURE__ */ import_react.createElement(Popup$1, {
key: "content",
prefixCls,
id: mergedId,
classNames,
styles
}, overlay),
action: trigger,
builtinPlacements: placements$3,
popupPlacement: placement,
ref: triggerRef,
popupAlign: align,
getPopupContainer: getTooltipContainer,
onOpenChange: onVisibleChange,
afterOpenChange: afterVisibleChange,
popupMotion: motion,
defaultPopupVisible: defaultVisible,
autoDestroy: destroyOnHidden,
mouseLeaveDelay,
popupStyle: styles?.root,
mouseEnterDelay,
arrow: mergedArrow,
uniqueContainerClassName: classNames?.uniqueContainer,
uniqueContainerStyle: styles?.uniqueContainer
}, extraProps), getChildren);
});
//#endregion
//#region node_modules/antd/es/style/roundedArrow.js
function getArrowToken(token) {
const { sizePopupArrow, borderRadiusXS, borderRadiusOuter } = token;
const unitWidth = sizePopupArrow / 2;
const ax = 0;
const ay = unitWidth;
const bx = borderRadiusOuter * 1 / Math.sqrt(2);
const by = unitWidth - borderRadiusOuter * (1 - 1 / Math.sqrt(2));
const cx = unitWidth - borderRadiusXS * (1 / Math.sqrt(2));
const cy = borderRadiusOuter * (Math.sqrt(2) - 1) + borderRadiusXS * (1 / Math.sqrt(2));
const dx = 2 * unitWidth - cx;
const dy = cy;
const ex = 2 * unitWidth - bx;
const ey = by;
const fx = 2 * unitWidth - ax;
const fy = ay;
const shadowWidth = unitWidth * Math.sqrt(2) + borderRadiusOuter * (Math.sqrt(2) - 2);
const polygonOffset = borderRadiusOuter * (Math.sqrt(2) - 1);
const arrowPolygon = `polygon(${polygonOffset}px 100%, 50% ${polygonOffset}px, ${2 * unitWidth - polygonOffset}px 100%, ${polygonOffset}px 100%)`;
return {
arrowShadowWidth: shadowWidth,
arrowPath: `path('M ${ax} ${ay} A ${borderRadiusOuter} ${borderRadiusOuter} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${borderRadiusXS} ${borderRadiusXS} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${borderRadiusOuter} ${borderRadiusOuter} 0 0 0 ${fx} ${fy} Z')`,
arrowPolygon
};
}
var genRoundedArrow = (token, bgColor, boxShadow) => {
const { sizePopupArrow, arrowPolygon, arrowPath, arrowShadowWidth, borderRadiusXS, calc } = token;
return {
pointerEvents: "none",
width: sizePopupArrow,
height: sizePopupArrow,
overflow: "hidden",
"&::before": {
position: "absolute",
bottom: 0,
insetInlineStart: 0,
width: sizePopupArrow,
height: calc(sizePopupArrow).div(2).equal(),
background: bgColor,
clipPath: {
_multi_value_: true,
value: [arrowPolygon, arrowPath]
},
content: "\"\""
},
"&::after": {
content: "\"\"",
position: "absolute",
width: arrowShadowWidth,
height: arrowShadowWidth,
bottom: 0,
insetInline: 0,
margin: "auto",
borderRadius: {
_skip_check_: true,
value: `0 0 ${unit$1(borderRadiusXS)} 0`
},
transform: "translateY(50%) rotate(-135deg)",
boxShadow,
zIndex: 0,
background: "transparent"
}
};
};
function getArrowOffsetToken(options) {
const { contentRadius, limitVerticalRadius } = options;
const arrowOffset = contentRadius > 12 ? contentRadius + 2 : 12;
return {
arrowOffsetHorizontal: arrowOffset,
arrowOffsetVertical: limitVerticalRadius ? 8 : arrowOffset
};
}
function isInject(valid, code) {
if (!valid) return {};
return code;
}
var getArrowStyle = (token, colorBg, options) => {
const { componentCls, boxShadowPopoverArrow, arrowOffsetVertical, arrowOffsetHorizontal, antCls } = token;
const [varName] = genCssVar(antCls, "tooltip");
const { arrowDistance = 0, arrowPlacement = {
left: true,
right: true,
top: true,
bottom: true
} } = options || {};
return { [componentCls]: {
[`${componentCls}-arrow`]: [{
position: "absolute",
zIndex: 1,
display: "block",
...genRoundedArrow(token, colorBg, boxShadowPopoverArrow),
"&:before": { background: colorBg }
}],
...isInject(!!arrowPlacement.top, {
[[
`&-placement-top > ${componentCls}-arrow`,
`&-placement-topLeft > ${componentCls}-arrow`,
`&-placement-topRight > ${componentCls}-arrow`
].join(",")]: {
bottom: arrowDistance,
transform: "translateY(100%) rotate(180deg)"
},
[`&-placement-top > ${componentCls}-arrow`]: {
left: {
_skip_check_: true,
value: "50%"
},
transform: "translateX(-50%) translateY(100%) rotate(180deg)"
},
"&-placement-topLeft": {
[varName("arrow-offset-x")]: arrowOffsetHorizontal,
[`> ${componentCls}-arrow`]: { left: {
_skip_check_: true,
value: arrowOffsetHorizontal
} }
},
"&-placement-topRight": {
[varName("arrow-offset-x")]: `calc(100% - ${unit$1(arrowOffsetHorizontal)})`,
[`> ${componentCls}-arrow`]: { right: {
_skip_check_: true,
value: arrowOffsetHorizontal
} }
}
}),
...isInject(!!arrowPlacement.bottom, {
[[
`&-placement-bottom > ${componentCls}-arrow`,
`&-placement-bottomLeft > ${componentCls}-arrow`,
`&-placement-bottomRight > ${componentCls}-arrow`
].join(",")]: {
top: arrowDistance,
transform: `translateY(-100%)`
},
[`&-placement-bottom > ${componentCls}-arrow`]: {
left: {
_skip_check_: true,
value: "50%"
},
transform: `translateX(-50%) translateY(-100%)`
},
"&-placement-bottomLeft": {
[varName("arrow-offset-x")]: arrowOffsetHorizontal,
[`> ${componentCls}-arrow`]: { left: {
_skip_check_: true,
value: arrowOffsetHorizontal
} }
},
"&-placement-bottomRight": {
[varName("arrow-offset-x")]: `calc(100% - ${unit$1(arrowOffsetHorizontal)})`,
[`> ${componentCls}-arrow`]: { right: {
_skip_check_: true,
value: arrowOffsetHorizontal
} }
}
}),
...isInject(!!arrowPlacement.left, {
[[
`&-placement-left > ${componentCls}-arrow`,
`&-placement-leftTop > ${componentCls}-arrow`,
`&-placement-leftBottom > ${componentCls}-arrow`
].join(",")]: {
right: {
_skip_check_: true,
value: arrowDistance
},
transform: "translateX(100%) rotate(90deg)"
},
[`&-placement-left > ${componentCls}-arrow`]: {
top: {
_skip_check_: true,
value: "50%"
},
transform: "translateY(-50%) translateX(100%) rotate(90deg)"
},
[`&-placement-leftTop > ${componentCls}-arrow`]: { top: arrowOffsetVertical },
[`&-placement-leftBottom > ${componentCls}-arrow`]: { bottom: arrowOffsetVertical }
}),
...isInject(!!arrowPlacement.right, {
[[
`&-placement-right > ${componentCls}-arrow`,
`&-placement-rightTop > ${componentCls}-arrow`,
`&-placement-rightBottom > ${componentCls}-arrow`
].join(",")]: {
left: {
_skip_check_: true,
value: arrowDistance
},
transform: "translateX(-100%) rotate(-90deg)"
},
[`&-placement-right > ${componentCls}-arrow`]: {
top: {
_skip_check_: true,
value: "50%"
},
transform: "translateY(-50%) translateX(-100%) rotate(-90deg)"
},
[`&-placement-rightTop > ${componentCls}-arrow`]: { top: arrowOffsetVertical },
[`&-placement-rightBottom > ${componentCls}-arrow`]: { bottom: arrowOffsetVertical }
})
} };
};
//#endregion
//#region node_modules/antd/es/_util/placements.js
function getOverflowOptions(placement, arrowOffset, arrowWidth, autoAdjustOverflow) {
if (autoAdjustOverflow === false) return {
adjustX: false,
adjustY: false
};
const overflow = isPlainObject(autoAdjustOverflow) ? autoAdjustOverflow : {};
const baseOverflow = {};
switch (placement) {
case "top":
case "bottom":
baseOverflow.shiftX = arrowOffset.arrowOffsetHorizontal * 2 + arrowWidth;
baseOverflow.shiftY = true;
baseOverflow.adjustY = true;
break;
case "left":
case "right":
baseOverflow.shiftY = arrowOffset.arrowOffsetVertical * 2 + arrowWidth;
baseOverflow.shiftX = true;
baseOverflow.adjustX = true;
break;
}
const mergedOverflow = {
...baseOverflow,
...overflow
};
if (!mergedOverflow.shiftX) mergedOverflow.adjustX = true;
if (!mergedOverflow.shiftY) mergedOverflow.adjustY = true;
return mergedOverflow;
}
var PlacementAlignMap = {
left: { points: ["cr", "cl"] },
right: { points: ["cl", "cr"] },
top: { points: ["bc", "tc"] },
bottom: { points: ["tc", "bc"] },
topLeft: { points: ["bl", "tl"] },
leftTop: { points: ["tr", "tl"] },
topRight: { points: ["br", "tr"] },
rightTop: { points: ["tl", "tr"] },
bottomRight: { points: ["tr", "br"] },
rightBottom: { points: ["bl", "br"] },
bottomLeft: { points: ["tl", "bl"] },
leftBottom: { points: ["br", "bl"] }
};
var ArrowCenterPlacementAlignMap = {
topLeft: { points: ["bl", "tc"] },
leftTop: { points: ["tr", "cl"] },
topRight: { points: ["br", "tc"] },
rightTop: { points: ["tl", "cr"] },
bottomRight: { points: ["tr", "bc"] },
rightBottom: { points: ["bl", "cr"] },
bottomLeft: { points: ["tl", "bc"] },
leftBottom: { points: ["br", "cl"] }
};
var DisableAutoArrowList = new Set([
"topLeft",
"topRight",
"bottomLeft",
"bottomRight",
"leftTop",
"leftBottom",
"rightTop",
"rightBottom"
]);
function getPlacements$1(config) {
const { arrowWidth, autoAdjustOverflow, arrowPointAtCenter, offset, borderRadius, visibleFirst } = config;
const halfArrowWidth = arrowWidth / 2;
const placementMap = {};
const arrowOffset = getArrowOffsetToken({
contentRadius: borderRadius,
limitVerticalRadius: true
});
Object.keys(PlacementAlignMap).forEach((key) => {
const placementInfo = {
...arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key],
offset: [0, 0],
dynamicInset: true
};
placementMap[key] = placementInfo;
if (DisableAutoArrowList.has(key)) placementInfo.autoArrow = false;
switch (key) {
case "top":
case "topLeft":
case "topRight":
placementInfo.offset[1] = -halfArrowWidth - offset;
break;
case "bottom":
case "bottomLeft":
case "bottomRight":
placementInfo.offset[1] = halfArrowWidth + offset;
break;
case "left":
case "leftTop":
case "leftBottom":
placementInfo.offset[0] = -halfArrowWidth - offset;
break;
case "right":
case "rightTop":
case "rightBottom":
placementInfo.offset[0] = halfArrowWidth + offset;
break;
}
if (arrowPointAtCenter) switch (key) {
case "topLeft":
case "bottomLeft":
placementInfo.offset[0] = -arrowOffset.arrowOffsetHorizontal - halfArrowWidth;
break;
case "topRight":
case "bottomRight":
placementInfo.offset[0] = arrowOffset.arrowOffsetHorizontal + halfArrowWidth;
break;
case "leftTop":
case "rightTop":
placementInfo.offset[1] = -arrowOffset.arrowOffsetHorizontal * 2 + halfArrowWidth;
break;
case "leftBottom":
case "rightBottom":
placementInfo.offset[1] = arrowOffset.arrowOffsetHorizontal * 2 - halfArrowWidth;
break;
}
placementInfo.overflow = getOverflowOptions(key, arrowOffset, arrowWidth, autoAdjustOverflow);
if (visibleFirst) placementInfo.htmlRegion = "visibleFirst";
});
return placementMap;
}
//#endregion
//#region node_modules/antd/es/table/TableMeasureRowContext.js
var TableMeasureRowContext = /* @__PURE__ */ import_react.createContext(false);
//#endregion
//#region node_modules/antd/es/tooltip/hook/useMergedArrow.js
var useMergedArrow = (providedArrow, providedContextArrow) => {
const toConfig = (arrow) => typeof arrow === "boolean" ? { show: arrow } : arrow || {};
return import_react.useMemo(() => {
const arrowConfig = toConfig(providedArrow);
const contextArrowConfig = toConfig(providedContextArrow);
return {
...contextArrowConfig,
...arrowConfig,
show: arrowConfig.show ?? contextArrowConfig.show ?? true
};
}, [providedArrow, providedContextArrow]);
};
//#endregion
//#region node_modules/antd/es/tooltip/style/index.js
var FALL_BACK_ORIGIN$1 = "50%";
var genTooltipStyle = (token) => {
const { calc, componentCls, tooltipMaxWidth, tooltipColor, tooltipBg, tooltipBorderRadius, zIndexPopup, controlHeight, boxShadowSecondary, paddingSM, paddingXS, arrowOffsetHorizontal, sizePopupArrow, antCls } = token;
const [varName, varRef] = genCssVar(antCls, "tooltip");
const edgeAlignMinWidth = calc(tooltipBorderRadius).add(sizePopupArrow).add(arrowOffsetHorizontal).equal();
const sharedBodyStyle = {
minWidth: calc(tooltipBorderRadius).mul(2).add(sizePopupArrow).equal(),
minHeight: controlHeight,
padding: `${unit$1(token.calc(paddingSM).div(2).equal())} ${unit$1(paddingXS)}`,
color: varRef("overlay-color", tooltipColor),
textAlign: "start",
textDecoration: "none",
wordWrap: "break-word",
backgroundColor: tooltipBg,
borderRadius: tooltipBorderRadius,
boxShadow: boxShadowSecondary,
boxSizing: "border-box"
};
const sharedTransformOrigin = {
[varName("valid-offset-x")]: varRef("arrow-offset-x", "var(--arrow-x)"),
transformOrigin: [varRef("valid-offset-x", FALL_BACK_ORIGIN$1), `var(--arrow-y, ${FALL_BACK_ORIGIN$1})`].join(" ")
};
return [
{ [componentCls]: {
...resetComponent(token),
position: "absolute",
zIndex: zIndexPopup,
display: "block",
width: "max-content",
maxWidth: tooltipMaxWidth,
visibility: "visible",
...sharedTransformOrigin,
"&-hidden": { display: "none" },
[varName("arrow-background-color")]: tooltipBg,
[`${componentCls}-container`]: [sharedBodyStyle, initFadeMotion(token, true)],
[`&:has(~ ${componentCls}-unique-container)`]: { [`${componentCls}-container`]: {
border: "none",
background: "transparent",
boxShadow: "none"
} },
[[
`&-placement-topLeft`,
`&-placement-topRight`,
`&-placement-bottomLeft`,
`&-placement-bottomRight`
].join(",")]: { minWidth: edgeAlignMinWidth },
[[
`&-placement-left`,
`&-placement-leftTop`,
`&-placement-leftBottom`,
`&-placement-right`,
`&-placement-rightTop`,
`&-placement-rightBottom`
].join(",")]: { [`${componentCls}-inner`]: { borderRadius: token.min(tooltipBorderRadius, 8) } },
[`${componentCls}-content`]: { position: "relative" },
...genPresetColor$1(token, (colorKey, { darkColor }) => ({ [`&${componentCls}-${colorKey}`]: {
[`${componentCls}-container`]: { backgroundColor: darkColor },
[`${componentCls}-arrow`]: { [varName("arrow-background-color")]: darkColor }
} })),
"&-rtl": { direction: "rtl" }
} },
getArrowStyle(token, varRef("arrow-background-color")),
{ [`${componentCls}-pure`]: {
position: "relative",
maxWidth: "none",
margin: token.sizePopupArrow
} },
{ [`${componentCls}-unique-container`]: {
...sharedBodyStyle,
...sharedTransformOrigin,
position: "absolute",
zIndex: calc(zIndexPopup).sub(1).equal(),
"&-hidden": { display: "none" },
"&-visible": { transition: `all ${token.motionDurationSlow}` }
} }
];
};
var prepareComponentToken$45 = (token) => ({
zIndexPopup: token.zIndexPopupBase + 70,
maxWidth: 250,
...getArrowOffsetToken({
contentRadius: token.borderRadius,
limitVerticalRadius: true
}),
...getArrowToken(merge(token, { borderRadiusOuter: Math.min(token.borderRadiusOuter, 4) }))
});
var style_default$50 = (prefixCls, rootCls, injectStyle = true) => {
return genStyleHooks("Tooltip", (token) => {
const { borderRadius, colorTextLightSolid, colorBgSpotlight, maxWidth } = token;
return [genTooltipStyle(merge(token, {
tooltipMaxWidth: maxWidth,
tooltipColor: colorTextLightSolid,
tooltipBorderRadius: borderRadius,
tooltipBg: colorBgSpotlight
})), initZoomMotion(token, "zoom-big-fast")];
}, prepareComponentToken$45, {
resetStyle: false,
injectStyle
})(prefixCls, rootCls);
};
//#endregion
//#region node_modules/antd/es/_util/colors.js
var inverseColors = PresetColors.map((color) => `${color}-inverse`);
var PresetStatusColors = [
"success",
"processing",
"error",
"default",
"warning"
];
/**
* determine if the color keyword belongs to the `Ant Design` {@link PresetColors}.
* @param color color to be judged
* @param includeInverse whether to include reversed colors
*/
function isPresetColor(color, includeInverse = true) {
if (includeInverse) return [].concat(_toConsumableArray$8(inverseColors), _toConsumableArray$8(PresetColors)).includes(color);
return PresetColors.includes(color);
}
function isPresetStatusColor(color) {
return PresetStatusColors.includes(color);
}
//#endregion
//#region node_modules/antd/es/tooltip/util.js
var parseColor = (rootPrefixCls, prefixCls, color) => {
const isInternalColor = isPresetColor(color);
const [varName] = genCssVar(rootPrefixCls, "tooltip");
const className = clsx({ [`${prefixCls}-${color}`]: color && isInternalColor });
const overlayStyle = {};
const arrowStyle = {};
const rgb = generateColor(color).toRgb();
const textColor = (.299 * rgb.r + .587 * rgb.g + .114 * rgb.b) / 255 < .5 ? "#FFF" : "#000";
if (color && !isInternalColor) {
overlayStyle.background = color;
overlayStyle[varName("overlay-color")] = textColor;
arrowStyle[varName("arrow-background-color")] = color;
}
return {
className,
overlayStyle,
arrowStyle
};
};
//#endregion
//#region node_modules/antd/es/tooltip/PurePanel.js
/** @private Internal Component. Do not use in your production. */
var PurePanel$10 = (props) => {
const { prefixCls: customizePrefixCls, className, placement = "top", title, color, overlayInnerStyle, classNames, styles } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$50(prefixCls, rootCls);
const colorInfo = parseColor(rootPrefixCls, prefixCls, color);
const arrowContentStyle = colorInfo.arrowStyle;
const innerStyles = import_react.useMemo(() => {
return { container: {
...overlayInnerStyle,
...colorInfo.overlayStyle
} };
}, [overlayInnerStyle, colorInfo.overlayStyle]);
const mergedProps = {
...props,
placement
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([classNames], [innerStyles, styles], { props: mergedProps });
const rootClassName = clsx(rootCls, hashId, cssVarCls, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className, colorInfo.className);
return /* @__PURE__ */ import_react.createElement("div", {
className: rootClassName,
style: arrowContentStyle
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-arrow` }), /* @__PURE__ */ import_react.createElement(Popup$1, {
...props,
className: hashId,
prefixCls,
classNames: mergedClassNames,
styles: mergedStyles
}, title));
};
//#endregion
//#region node_modules/antd/es/tooltip/index.js
var Tooltip = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, openClassName, getTooltipContainer, color, children, afterOpenChange, arrow: tooltipArrow, destroyTooltipOnHide, destroyOnHidden, title, overlay, trigger, builtinPlacements, autoAdjustOverflow = true, motion, getPopupContainer, placement = "top", mouseEnterDelay = .1, mouseLeaveDelay = .1, rootClassName, styles, classNames, onOpenChange, overlayInnerStyle, overlayStyle, overlayClassName, ...restProps } = props;
const [, token] = useToken$1();
const injectFromPopover = props["data-popover-inject"];
const { getPopupContainer: getContextPopupContainer, getPrefixCls, direction, ...semanticConfig } = useComponentConfig("tooltip");
const { className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, arrow: contextArrow, trigger: contextTrigger } = injectFromPopover ? {} : semanticConfig;
const mergedArrow = useMergedArrow(tooltipArrow, contextArrow);
const mergedShowArrow = mergedArrow.show;
const mergedTrigger = trigger || contextTrigger || "hover";
const mergedGetPopupContainer = getPopupContainer || getContextPopupContainer;
const mergedDestroyOnHidden = destroyOnHidden ?? !!destroyTooltipOnHide;
const inTableMeasureRow = import_react.useContext(TableMeasureRowContext);
const warning = devUseWarning("Tooltip");
const tooltipRef = import_react.useRef(null);
const forceAlign = () => {
tooltipRef.current?.forceAlign();
};
import_react.useImperativeHandle(ref, () => ({
forceAlign,
nativeElement: tooltipRef.current?.nativeElement,
popupElement: tooltipRef.current?.popupElement
}));
[
["overlayStyle", "styles.root"],
["overlayInnerStyle", "styles.container"],
["overlayClassName", "classNames.root"],
["destroyTooltipOnHide", "destroyOnHidden"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
warning(!destroyTooltipOnHide || typeof destroyTooltipOnHide === "boolean", "usage", "`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly.");
const [open, setOpen] = useControlledState(props.defaultOpen ?? false, props.open);
const noTitle = !title && !overlay && title !== 0;
const onInternalOpenChange = (vis) => {
setOpen(noTitle ? false : vis);
if (!noTitle && onOpenChange) onOpenChange(vis);
};
const tooltipPlacements = import_react.useMemo(() => {
return builtinPlacements || getPlacements$1({
arrowPointAtCenter: mergedArrow?.pointAtCenter ?? false,
autoAdjustOverflow,
arrowWidth: mergedShowArrow ? token.sizePopupArrow : 0,
borderRadius: token.borderRadius,
offset: token.marginXXS,
visibleFirst: true
});
}, [
mergedArrow,
builtinPlacements,
token,
mergedShowArrow,
autoAdjustOverflow
]);
const memoOverlay = import_react.useMemo(() => {
if (title === 0) return title;
return overlay || title || "";
}, [overlay, title]);
const memoOverlayWrapper = /* @__PURE__ */ import_react.createElement(ContextIsolator, {
space: true,
form: true
}, typeof memoOverlay === "function" ? memoOverlay() : memoOverlay);
const mergedProps = {
...props,
trigger: mergedTrigger,
builtinPlacements: tooltipPlacements,
getPopupContainer: mergedGetPopupContainer,
destroyOnHidden: mergedDestroyOnHidden
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
let tempOpen = open;
if (!("open" in props) && noTitle || inTableMeasureRow) tempOpen = false;
const child = /* @__PURE__ */ import_react.isValidElement(children) && !isFragment(children) ? children : /* @__PURE__ */ import_react.createElement("span", null, children);
const childProps = child.props;
const childCls = !childProps.className || typeof childProps.className === "string" ? clsx(childProps.className, openClassName || `${prefixCls}-open`) : childProps.className;
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$50(prefixCls, rootCls, !injectFromPopover);
const colorInfo = parseColor(rootPrefixCls, prefixCls, color);
const arrowContentStyle = colorInfo.arrowStyle;
const themeCls = clsx(rootCls, hashId, cssVarCls);
const rootClassNames = clsx(overlayClassName, { [`${prefixCls}-rtl`]: direction === "rtl" }, colorInfo.className, rootClassName, themeCls, contextClassName, mergedClassNames.root);
const [zIndex, contextZIndex] = useZIndex("Tooltip", restProps.zIndex);
const containerStyle = {
...mergedStyles.container,
...overlayInnerStyle,
...colorInfo.overlayStyle
};
const content = /* @__PURE__ */ import_react.createElement(es_default$19, {
unique: true,
...restProps,
zIndex,
showArrow: mergedShowArrow,
placement,
mouseEnterDelay,
mouseLeaveDelay,
prefixCls,
classNames: {
root: rootClassNames,
container: mergedClassNames.container,
arrow: mergedClassNames.arrow,
uniqueContainer: clsx(themeCls, mergedClassNames.container)
},
styles: {
root: {
...arrowContentStyle,
...mergedStyles.root,
...contextStyle,
...overlayStyle
},
container: containerStyle,
uniqueContainer: containerStyle,
arrow: mergedStyles.arrow
},
ref: tooltipRef,
overlay: memoOverlayWrapper,
visible: tempOpen,
onVisibleChange: onInternalOpenChange,
afterVisibleChange: afterOpenChange,
arrowContent: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-arrow-content` }),
motion: {
motionName: getTransitionName(rootPrefixCls, "zoom-big-fast", typeof motion?.motionName === "string" ? motion?.motionName : void 0),
motionDeadline: 1e3
},
trigger: mergedTrigger,
builtinPlacements: tooltipPlacements,
getTooltipContainer: mergedGetPopupContainer,
destroyOnHidden: mergedDestroyOnHidden
}, tempOpen ? cloneElement$1(child, { className: childCls }) : child);
return /* @__PURE__ */ import_react.createElement(ZIndexContext.Provider, { value: contextZIndex }, content);
});
Tooltip.displayName = "Tooltip";
Tooltip._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$10;
Tooltip.UniqueProvider = UniqueProvider;
//#endregion
//#region node_modules/antd/es/popover/style/index.js
var FALL_BACK_ORIGIN = "50%";
var genBaseStyle$12 = (token) => {
const { componentCls, popoverColor, titleMinWidth, fontWeightStrong, innerPadding, boxShadowSecondary, colorTextHeading, borderRadiusLG, zIndexPopup, titleMarginBottom, colorBgElevated, popoverBg, titleBorderBottom, innerContentPadding, titlePadding, antCls } = token;
const [varName, varRef] = genCssVar(antCls, "tooltip");
return [
{ [componentCls]: {
...resetComponent(token),
position: "absolute",
top: 0,
left: {
_skip_check_: true,
value: 0
},
zIndex: zIndexPopup,
fontWeight: "normal",
whiteSpace: "normal",
textAlign: "start",
cursor: "auto",
userSelect: "text",
[varName("valid-offset-x")]: varRef("arrow-offset-x", "var(--arrow-x)"),
transformOrigin: [varRef("valid-offset-x", FALL_BACK_ORIGIN), `var(--arrow-y, ${FALL_BACK_ORIGIN})`].join(" "),
[varName("arrow-background-color")]: colorBgElevated,
width: "max-content",
maxWidth: "100vw",
"&-rtl": { direction: "rtl" },
"&-hidden": { display: "none" },
[`${componentCls}-content`]: { position: "relative" },
[`${componentCls}-container`]: {
backgroundColor: popoverBg,
backgroundClip: "padding-box",
borderRadius: borderRadiusLG,
boxShadow: boxShadowSecondary,
padding: innerPadding
},
[`${componentCls}-title`]: {
minWidth: titleMinWidth,
marginBottom: titleMarginBottom,
color: colorTextHeading,
fontWeight: fontWeightStrong,
borderBottom: titleBorderBottom,
padding: titlePadding
},
[`${componentCls}-content`]: {
color: popoverColor,
padding: innerContentPadding
}
} },
getArrowStyle(token, varRef("arrow-background-color")),
{ [`${componentCls}-pure`]: {
position: "relative",
maxWidth: "none",
margin: token.sizePopupArrow,
display: "inline-block"
} }
];
};
var genColorStyle = (token) => {
const { componentCls, antCls } = token;
const [varName] = genCssVar(antCls, "tooltip");
return { [componentCls]: PresetColors.map((colorKey) => {
const lightColor = token[`${colorKey}6`];
return { [`&${componentCls}-${colorKey}`]: {
[varName("arrow-background-color")]: lightColor,
[`${componentCls}-inner`]: { backgroundColor: lightColor },
[`${componentCls}-arrow`]: { background: "transparent" }
} };
}) };
};
var prepareComponentToken$44 = (token) => {
const { lineWidth, controlHeight, fontHeight, padding, wireframe, zIndexPopupBase, borderRadiusLG, marginXS, lineType, colorSplit, paddingSM } = token;
const titlePaddingBlockDist = controlHeight - fontHeight;
const popoverTitlePaddingBlockTop = titlePaddingBlockDist / 2;
const popoverTitlePaddingBlockBottom = titlePaddingBlockDist / 2 - lineWidth;
const popoverPaddingHorizontal = padding;
return {
titleMinWidth: 177,
zIndexPopup: zIndexPopupBase + 30,
...getArrowToken(token),
...getArrowOffsetToken({
contentRadius: borderRadiusLG,
limitVerticalRadius: true
}),
innerPadding: wireframe ? 0 : 12,
titleMarginBottom: wireframe ? 0 : marginXS,
titlePadding: wireframe ? `${popoverTitlePaddingBlockTop}px ${popoverPaddingHorizontal}px ${popoverTitlePaddingBlockBottom}px` : 0,
titleBorderBottom: wireframe ? `${lineWidth}px ${lineType} ${colorSplit}` : "none",
innerContentPadding: wireframe ? `${paddingSM}px ${popoverPaddingHorizontal}px` : 0
};
};
var style_default$49 = genStyleHooks("Popover", (token) => {
const { colorBgElevated, colorText } = token;
const popoverToken = merge(token, {
popoverBg: colorBgElevated,
popoverColor: colorText
});
return [
genBaseStyle$12(popoverToken),
genColorStyle(popoverToken),
initZoomMotion(popoverToken, "zoom-big")
];
}, prepareComponentToken$44, {
resetStyle: false,
deprecatedTokens: [["width", "titleMinWidth"], ["minWidth", "titleMinWidth"]]
});
//#endregion
//#region node_modules/antd/es/popover/PurePanel.js
var Overlay$2 = (props) => {
const { title, content, prefixCls, classNames, styles } = props;
if (!title && !content) return null;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, title && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, classNames?.title),
style: styles?.title
}, title), content && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-content`, classNames?.content),
style: styles?.content
}, content));
};
var RawPurePanel = (props) => {
const { hashId, prefixCls, className, style, placement = "top", title, content, children, classNames, styles } = props;
const titleNode = getRenderPropValue(title);
const contentNode = getRenderPropValue(content);
const mergedProps = {
...props,
placement
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([classNames], [styles], { props: mergedProps });
const rootClassName = clsx(hashId, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className);
return /* @__PURE__ */ import_react.createElement("div", {
className: rootClassName,
style
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-arrow` }), /* @__PURE__ */ import_react.createElement(Popup$1, {
...props,
className: hashId,
prefixCls,
classNames: mergedClassNames,
styles: mergedStyles
}, children || /* @__PURE__ */ import_react.createElement(Overlay$2, {
prefixCls,
title: titleNode,
content: contentNode,
classNames: mergedClassNames,
styles: mergedStyles
})));
};
var PurePanel$9 = (props) => {
const { prefixCls: customizePrefixCls, className, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("popover", customizePrefixCls);
const [hashId, cssVarCls] = style_default$49(prefixCls);
return /* @__PURE__ */ import_react.createElement(RawPurePanel, {
...restProps,
prefixCls,
hashId,
className: clsx(className, cssVarCls)
});
};
//#endregion
//#region node_modules/antd/es/popover/index.js
var Popover = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, title, content, overlayClassName, placement = "top", trigger, children, mouseEnterDelay = .1, mouseLeaveDelay = .1, onOpenChange, overlayStyle = {}, styles, classNames, motion, arrow: popoverArrow, ...restProps } = props;
const { getPrefixCls, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, arrow: contextArrow, trigger: contextTrigger } = useComponentConfig("popover");
const prefixCls = getPrefixCls("popover", customizePrefixCls);
const [hashId, cssVarCls] = style_default$49(prefixCls);
const rootPrefixCls = getPrefixCls();
const mergedArrow = useMergedArrow(popoverArrow, contextArrow);
const mergedTrigger = trigger || contextTrigger || "hover";
devUseWarning("Popover")(!onOpenChange || onOpenChange.length <= 1, "usage", "The second `onOpenChange` parameter is internal and unsupported. Please lock to a previous version if needed.");
const mergedProps = {
...props,
placement,
trigger: mergedTrigger,
mouseEnterDelay,
mouseLeaveDelay,
overlayStyle,
styles,
classNames
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const rootClassNames = clsx(overlayClassName, hashId, cssVarCls, contextClassName, mergedClassNames.root);
const [open, setOpen] = useControlledState(props.defaultOpen ?? false, props.open);
const settingOpen = (value) => {
setOpen(value);
onOpenChange?.(value);
};
const titleNode = getRenderPropValue(title);
const contentNode = getRenderPropValue(content);
return /* @__PURE__ */ import_react.createElement(Tooltip, {
unique: false,
arrow: mergedArrow,
placement,
trigger: mergedTrigger,
mouseEnterDelay,
mouseLeaveDelay,
...restProps,
prefixCls,
classNames: {
root: rootClassNames,
container: mergedClassNames.container,
arrow: mergedClassNames.arrow
},
styles: {
root: {
...mergedStyles.root,
...contextStyle,
...overlayStyle
},
container: mergedStyles.container,
arrow: mergedStyles.arrow
},
ref,
open,
onOpenChange: settingOpen,
overlay: titleNode || contentNode ? /* @__PURE__ */ import_react.createElement(Overlay$2, {
prefixCls,
title: titleNode,
content: contentNode,
classNames: mergedClassNames,
styles: mergedStyles
}) : null,
motion: { motionName: getTransitionName(rootPrefixCls, "zoom-big", typeof motion?.motionName === "string" ? motion?.motionName : void 0) },
"data-popover-inject": true
}, children);
});
Popover._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$9;
Popover.displayName = "Popover";
//#endregion
//#region node_modules/antd/es/avatar/AvatarGroup.js
var AvatarContextProvider = (props) => {
const { size, shape } = import_react.useContext(AvatarContext);
const avatarContextValue = import_react.useMemo(() => ({
size: props.size || size,
shape: props.shape || shape
}), [
props.size,
props.shape,
size,
shape
]);
return /* @__PURE__ */ import_react.createElement(AvatarContext.Provider, { value: avatarContextValue }, props.children);
};
var AvatarGroup = (props) => {
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className, rootClassName, style, maxCount, maxStyle, size, shape, maxPopoverPlacement, maxPopoverTrigger, children, max } = props;
{
const warning = devUseWarning("Avatar.Group");
[
["maxCount", "max={{ count: number }}"],
["maxStyle", "max={{ style: CSSProperties }}"],
["maxPopoverPlacement", "max={{ popover: PopoverProps }}"],
["maxPopoverTrigger", "max={{ popover: PopoverProps }}"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const prefixCls = getPrefixCls("avatar", customizePrefixCls);
const groupPrefixCls = `${prefixCls}-group`;
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$51(prefixCls, rootCls);
const cls = clsx(groupPrefixCls, { [`${groupPrefixCls}-rtl`]: direction === "rtl" }, cssVarCls, rootCls, className, rootClassName, hashId);
const childrenWithProps = toArray$8(children).map((child, index) => cloneElement$1(child, { key: `avatar-key-${index}` }));
const mergeCount = max?.count || maxCount;
const numOfChildren = childrenWithProps.length;
if (mergeCount && mergeCount < numOfChildren) {
const childrenShow = childrenWithProps.slice(0, mergeCount);
const childrenHidden = childrenWithProps.slice(mergeCount, numOfChildren);
const mergeStyle = max?.style || maxStyle;
const mergePopoverTrigger = max?.popover?.trigger || maxPopoverTrigger || "hover";
const mergePopoverPlacement = max?.popover?.placement || maxPopoverPlacement || "top";
const popoverProps = {
content: childrenHidden,
...max?.popover,
placement: mergePopoverPlacement,
trigger: mergePopoverTrigger,
rootClassName: clsx(`${groupPrefixCls}-popover`, max?.popover?.rootClassName)
};
childrenShow.push(/* @__PURE__ */ import_react.createElement(Popover, {
key: "avatar-popover-key",
destroyOnHidden: true,
...popoverProps
}, /* @__PURE__ */ import_react.createElement(Avatar$1, { style: mergeStyle }, `+${numOfChildren - mergeCount}`)));
return /* @__PURE__ */ import_react.createElement(AvatarContextProvider, {
shape,
size
}, /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style
}, childrenShow));
}
return /* @__PURE__ */ import_react.createElement(AvatarContextProvider, {
shape,
size
}, /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style
}, childrenWithProps));
};
//#endregion
//#region node_modules/antd/es/avatar/index.js
var Avatar = Avatar$1;
Avatar.Group = AvatarGroup;
//#endregion
//#region node_modules/antd/es/back-top/style/index.js
var genSharedBackTopStyle = (token) => {
const { componentCls, backTopFontSize, backTopSize, zIndexPopup } = token;
return { [componentCls]: {
...resetComponent(token),
position: "fixed",
insetInlineEnd: token.backTopInlineEnd,
insetBlockEnd: token.backTopBlockEnd,
zIndex: zIndexPopup,
width: 40,
height: 40,
cursor: "pointer",
"&:empty": { display: "none" },
[`${componentCls}-content`]: {
width: backTopSize,
height: backTopSize,
overflow: "hidden",
color: token.backTopColor,
textAlign: "center",
backgroundColor: token.backTopBackground,
borderRadius: backTopSize,
transition: `all ${token.motionDurationMid}`,
"&:hover": {
backgroundColor: token.backTopHoverBackground,
transition: `all ${token.motionDurationMid}`
}
},
[`${componentCls}-icon`]: {
fontSize: backTopFontSize,
lineHeight: unit$1(backTopSize)
}
} };
};
var genMediaBackTopStyle = (token) => {
const { componentCls, screenMD, screenXS, backTopInlineEndMD, backTopInlineEndXS } = token;
return {
[`@media (max-width: ${unit$1(screenMD)})`]: { [componentCls]: { insetInlineEnd: backTopInlineEndMD } },
[`@media (max-width: ${unit$1(screenXS)})`]: { [componentCls]: { insetInlineEnd: backTopInlineEndXS } }
};
};
var prepareComponentToken$43 = (token) => ({ zIndexPopup: token.zIndexBase + 10 });
var style_default$48 = genStyleHooks("BackTop", (token) => {
const { fontSizeHeading3, colorTextDescription, colorTextLightSolid, colorText, controlHeightLG, calc } = token;
const backTopToken = merge(token, {
backTopBackground: colorTextDescription,
backTopColor: colorTextLightSolid,
backTopHoverBackground: colorText,
backTopFontSize: fontSizeHeading3,
backTopSize: controlHeightLG,
backTopBlockEnd: calc(controlHeightLG).mul(1.25).equal(),
backTopInlineEnd: calc(controlHeightLG).mul(2.5).equal(),
backTopInlineEndMD: calc(controlHeightLG).mul(1.5).equal(),
backTopInlineEndXS: calc(controlHeightLG).mul(.5).equal()
});
return [genSharedBackTopStyle(backTopToken), genMediaBackTopStyle(backTopToken)];
}, prepareComponentToken$43);
//#endregion
//#region node_modules/antd/es/back-top/index.js
/**
* @deprecated Please use `FloatButton.BackTop` instead.
*/
var BackTop = (props) => {
const { prefixCls: customizePrefixCls, className, rootClassName, visibilityHeight = 400, target, onClick, duration = 450, children } = props;
const [visible, setVisible] = import_react.useState(visibilityHeight === 0);
const ref = import_react.useRef(null);
const getDefaultTarget = () => ref.current?.ownerDocument || window;
const handleScroll = throttleByAnimationFrame((e) => {
setVisible(getScroll$2(e.target) >= visibilityHeight);
});
devUseWarning("BackTop").deprecated(false, "BackTop", "FloatButton.BackTop");
import_react.useEffect(() => {
const container = (target || getDefaultTarget)();
handleScroll({ target: container });
container?.addEventListener("scroll", handleScroll);
return () => {
handleScroll.cancel();
container?.removeEventListener("scroll", handleScroll);
};
}, [target]);
const scrollToTop = (e) => {
scrollTo(0, {
getContainer: target || getDefaultTarget,
duration
});
onClick?.(e);
};
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("back-top", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const [hashId, cssVarCls] = style_default$48(prefixCls, useCSSVarCls(prefixCls));
const classString = clsx(hashId, cssVarCls, prefixCls, { [`${prefixCls}-rtl`]: direction === "rtl" }, className, rootClassName);
const divProps = omit(props, [
"prefixCls",
"className",
"rootClassName",
"children",
"visibilityHeight",
"target"
]);
const defaultElement = /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-content` }, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-icon` }, /* @__PURE__ */ import_react.createElement(RefIcon$10, null)));
return /* @__PURE__ */ import_react.createElement("div", {
...divProps,
className: classString,
onClick: scrollToTop,
ref
}, /* @__PURE__ */ import_react.createElement(es_default$28, {
visible,
motionName: `${rootPrefixCls}-fade`
}, ({ className: motionClassName }) => cloneElement$1(children || defaultElement, ({ className: cloneCls }) => ({ className: clsx(motionClassName, cloneCls) }))));
};
BackTop.displayName = "Deprecated.BackTop";
//#endregion
//#region node_modules/antd/es/badge/SingleNumber.js
var UnitNumber = (props) => {
const { prefixCls, value, current, offset = 0 } = props;
let style;
if (offset) style = {
position: "absolute",
top: `${offset}00%`,
left: 0
};
return /* @__PURE__ */ import_react.createElement("span", {
style,
className: clsx(`${prefixCls}-only-unit`, { current })
}, value);
};
function getOffset$3(start, end, unit) {
let index = start;
let offset = 0;
while ((index + 10) % 10 !== end) {
index += unit;
offset += unit;
}
return offset;
}
var SingleNumber = (props) => {
const { prefixCls, count: originCount, value: originValue } = props;
const value = Number(originValue);
const count = Math.abs(originCount);
const [prevValue, setPrevValue] = import_react.useState(value);
const [prevCount, setPrevCount] = import_react.useState(count);
const onTransitionEnd = () => {
setPrevValue(value);
setPrevCount(count);
};
import_react.useEffect(() => {
const timer = setTimeout(onTransitionEnd, 1e3);
return () => clearTimeout(timer);
}, [value]);
let unitNodes;
let offsetStyle;
if (prevValue === value || Number.isNaN(value) || Number.isNaN(prevValue)) {
unitNodes = [/* @__PURE__ */ import_react.createElement(UnitNumber, {
...props,
key: value,
current: true
})];
offsetStyle = { transition: "none" };
} else {
unitNodes = [];
const end = value + 10;
const unitNumberList = [];
for (let index = value; index <= end; index += 1) unitNumberList.push(index);
const unit = prevCount < count ? 1 : -1;
const prevIndex = unitNumberList.findIndex((n) => n % 10 === prevValue);
unitNodes = (unit < 0 ? unitNumberList.slice(0, prevIndex + 1) : unitNumberList.slice(prevIndex)).map((n, index) => {
const singleUnit = n % 10;
return /* @__PURE__ */ import_react.createElement(UnitNumber, {
...props,
key: n,
value: singleUnit,
offset: unit < 0 ? index - prevIndex : index,
current: index === prevIndex
});
});
offsetStyle = { transform: `translateY(${-getOffset$3(prevValue, value, unit)}00%)` };
}
return /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-only`,
style: offsetStyle,
onTransitionEnd
}, unitNodes);
};
//#endregion
//#region node_modules/antd/es/badge/ScrollNumber.js
var ScrollNumber = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, count, className, motionClassName, style, title, show, component: Component = "sup", children, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("scroll-number", customizePrefixCls);
const newProps = {
...restProps,
"data-show": show,
style,
className: clsx(prefixCls, className, motionClassName),
title
};
let numberNodes = count;
if (count && Number(count) % 1 === 0) {
const numberList = String(count).split("");
numberNodes = /* @__PURE__ */ import_react.createElement("bdi", null, numberList.map((num, i) => /* @__PURE__ */ import_react.createElement(SingleNumber, {
prefixCls,
count: Number(count),
value: num,
key: numberList.length - i
})));
}
if (style?.borderColor) newProps.style = {
...style,
boxShadow: `0 0 0 1px ${style.borderColor} inset`
};
if (children) return cloneElement$1(children, (oriProps) => ({ className: clsx(`${prefixCls}-custom-component`, oriProps?.className, motionClassName) }));
return /* @__PURE__ */ import_react.createElement(Component, {
...newProps,
ref
}, numberNodes);
});
//#endregion
//#region node_modules/antd/es/badge/style/index.js
var antStatusProcessing = new Keyframe("antStatusProcessing", {
"0%": {
transform: "scale(0.8)",
opacity: .5
},
"100%": {
transform: "scale(2.4)",
opacity: 0
}
});
var antZoomBadgeIn = new Keyframe("antZoomBadgeIn", {
"0%": {
transform: "scale(0) translate(50%, -50%)",
opacity: 0
},
"100%": { transform: "scale(1) translate(50%, -50%)" }
});
var antZoomBadgeOut = new Keyframe("antZoomBadgeOut", {
"0%": { transform: "scale(1) translate(50%, -50%)" },
"100%": {
transform: "scale(0) translate(50%, -50%)",
opacity: 0
}
});
var antNoWrapperZoomBadgeIn = new Keyframe("antNoWrapperZoomBadgeIn", {
"0%": {
transform: "scale(0)",
opacity: 0
},
"100%": { transform: "scale(1)" }
});
var antNoWrapperZoomBadgeOut = new Keyframe("antNoWrapperZoomBadgeOut", {
"0%": { transform: "scale(1)" },
"100%": {
transform: "scale(0)",
opacity: 0
}
});
var antBadgeLoadingCircle = new Keyframe("antBadgeLoadingCircle", {
"0%": { transformOrigin: "50%" },
"100%": {
transform: "translate(50%, -50%) rotate(360deg)",
transformOrigin: "50%"
}
});
var genSharedBadgeStyle = (token) => {
const { componentCls, iconCls, antCls, badgeShadowSize, textFontSize, textFontSizeSM, statusSize, dotSize, textFontWeight, indicatorHeight, indicatorHeightSM, marginXS, calc } = token;
const numberPrefixCls = `${antCls}-scroll-number`;
const colorPreset = genPresetColor$1(token, (colorKey, { darkColor }) => ({ [`&${componentCls} ${componentCls}-color-${colorKey}`]: {
background: darkColor,
[`&:not(${componentCls}-count)`]: { color: darkColor },
"a:hover &": { background: darkColor }
} }));
return { [componentCls]: {
...resetComponent(token),
position: "relative",
display: "inline-block",
width: "fit-content",
lineHeight: 1,
[`${componentCls}-count`]: {
display: "inline-flex",
justifyContent: "center",
zIndex: token.indicatorZIndex,
minWidth: indicatorHeight,
height: indicatorHeight,
color: token.badgeTextColor,
fontWeight: textFontWeight,
fontSize: textFontSize,
lineHeight: unit$1(indicatorHeight),
whiteSpace: "nowrap",
textAlign: "center",
background: token.badgeColor,
borderRadius: calc(indicatorHeight).div(2).equal(),
boxShadow: `0 0 0 ${unit$1(badgeShadowSize)} ${token.badgeShadowColor}`,
transition: `background-color ${token.motionDurationMid}`,
a: { color: token.badgeTextColor },
"a:hover": { color: token.badgeTextColor },
"a:hover &": { background: token.badgeColorHover }
},
[`${componentCls}-count-sm`]: {
minWidth: indicatorHeightSM,
height: indicatorHeightSM,
fontSize: textFontSizeSM,
lineHeight: unit$1(indicatorHeightSM),
borderRadius: calc(indicatorHeightSM).div(2).equal()
},
[`${componentCls}-multiple-words`]: {
padding: `0 ${unit$1(token.paddingXS)}`,
bdi: { unicodeBidi: "plaintext" }
},
[`${componentCls}-dot`]: {
zIndex: token.indicatorZIndex,
width: dotSize,
minWidth: dotSize,
height: dotSize,
background: token.badgeColor,
borderRadius: "100%",
boxShadow: `0 0 0 ${unit$1(badgeShadowSize)} ${token.badgeShadowColor}`
},
[`${componentCls}-count, ${componentCls}-dot, ${numberPrefixCls}-custom-component`]: {
position: "absolute",
top: 0,
insetInlineEnd: 0,
transform: "translate(50%, -50%)",
transformOrigin: "100% 0%",
[`&${iconCls}-spin`]: {
animationName: antBadgeLoadingCircle,
animationDuration: "1s",
animationIterationCount: "infinite",
animationTimingFunction: "linear"
}
},
[`&${componentCls}-status`]: {
lineHeight: "inherit",
verticalAlign: "baseline",
[`${componentCls}-status-dot`]: {
position: "relative",
top: -1,
display: "inline-block",
width: statusSize,
height: statusSize,
verticalAlign: "middle",
borderRadius: "50%"
},
[`${componentCls}-status-success`]: { backgroundColor: token.colorSuccess },
[`${componentCls}-status-processing`]: {
overflow: "visible",
color: token.colorInfo,
backgroundColor: token.colorInfo,
borderColor: "currentcolor",
"&::after": {
position: "absolute",
top: 0,
insetInlineStart: 0,
width: "100%",
height: "100%",
borderWidth: badgeShadowSize,
borderStyle: "solid",
borderColor: "inherit",
borderRadius: "50%",
animationName: antStatusProcessing,
animationDuration: token.badgeProcessingDuration,
animationIterationCount: "infinite",
animationTimingFunction: "ease-in-out",
content: "\"\""
}
},
[`${componentCls}-status-default`]: { backgroundColor: token.colorTextPlaceholder },
[`${componentCls}-status-error`]: { backgroundColor: token.colorError },
[`${componentCls}-status-warning`]: { backgroundColor: token.colorWarning },
[`${componentCls}-status-text`]: {
marginInlineStart: marginXS,
color: token.colorText,
fontSize: token.fontSize
}
},
...colorPreset,
[`${componentCls}-zoom-appear, ${componentCls}-zoom-enter`]: {
animationName: antZoomBadgeIn,
animationDuration: token.motionDurationSlow,
animationTimingFunction: token.motionEaseOutBack,
animationFillMode: "both"
},
[`${componentCls}-zoom-leave`]: {
animationName: antZoomBadgeOut,
animationDuration: token.motionDurationSlow,
animationTimingFunction: token.motionEaseOutBack,
animationFillMode: "both"
},
[`&${componentCls}-not-a-wrapper`]: {
[`${componentCls}-zoom-appear, ${componentCls}-zoom-enter`]: {
animationName: antNoWrapperZoomBadgeIn,
animationDuration: token.motionDurationSlow,
animationTimingFunction: token.motionEaseOutBack
},
[`${componentCls}-zoom-leave`]: {
animationName: antNoWrapperZoomBadgeOut,
animationDuration: token.motionDurationSlow,
animationTimingFunction: token.motionEaseOutBack
},
[`&:not(${componentCls}-status)`]: { verticalAlign: "middle" },
[`${numberPrefixCls}-custom-component, ${componentCls}-count`]: { transform: "none" },
[`${numberPrefixCls}-custom-component, ${numberPrefixCls}`]: {
position: "relative",
top: "auto",
display: "block",
transformOrigin: "50% 50%"
}
},
[numberPrefixCls]: {
overflow: "hidden",
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack}`,
[`${numberPrefixCls}-only`]: {
position: "relative",
display: "inline-block",
height: indicatorHeight,
transition: `all ${token.motionDurationSlow} ${token.motionEaseOutBack}`,
WebkitTransformStyle: "preserve-3d",
WebkitBackfaceVisibility: "hidden",
[`> p${numberPrefixCls}-only-unit`]: {
height: indicatorHeight,
margin: 0,
WebkitTransformStyle: "preserve-3d",
WebkitBackfaceVisibility: "hidden"
}
},
[`${numberPrefixCls}-symbol`]: { verticalAlign: "top" }
},
"&-rtl": {
direction: "rtl",
[`${componentCls}-count, ${componentCls}-dot, ${numberPrefixCls}-custom-component`]: { transform: "translate(-50%, -50%)" }
}
} };
};
var prepareToken$3 = (token) => {
const { fontHeight, lineWidth, marginXS, colorBorderBg } = token;
const badgeFontHeight = fontHeight;
const badgeShadowSize = lineWidth;
const badgeTextColor = token.colorTextLightSolid;
const badgeColor = token.colorError;
const badgeColorHover = token.colorErrorHover;
return merge(token, {
badgeFontHeight,
badgeShadowSize,
badgeTextColor,
badgeColor,
badgeColorHover,
badgeShadowColor: colorBorderBg,
badgeProcessingDuration: "1.2s",
badgeRibbonOffset: marginXS,
badgeRibbonCornerTransform: "scaleY(0.75)",
badgeRibbonCornerFilter: `brightness(75%)`
});
};
var prepareComponentToken$42 = (token) => {
const { fontSize, lineHeight, fontSizeSM, lineWidth } = token;
return {
indicatorZIndex: "auto",
indicatorHeight: Math.round(fontSize * lineHeight) - 2 * lineWidth,
indicatorHeightSM: fontSize,
dotSize: fontSizeSM / 2,
textFontSize: fontSizeSM,
textFontSizeSM: fontSizeSM,
textFontWeight: "normal",
statusSize: fontSizeSM / 2
};
};
var style_default$47 = genStyleHooks("Badge", (token) => {
return genSharedBadgeStyle(prepareToken$3(token));
}, prepareComponentToken$42);
//#endregion
//#region node_modules/antd/es/badge/Badge.js
var Badge$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, scrollNumberPrefixCls: customizeScrollNumberPrefixCls, children, status, text, color, count = null, overflowCount = 99, dot = false, size = "medium", title, offset, style, className, rootClassName, classNames, styles, showZero = false, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("badge");
const prefixCls = getPrefixCls("badge", customizePrefixCls);
const [hashId, cssVarCls] = style_default$47(prefixCls);
devUseWarning("Badge").deprecated(size !== "default", "size=\"default\"", "size=\"medium\"");
const mergedProps = {
...props,
overflowCount,
size,
dot,
showZero
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const numberedDisplayCount = count > overflowCount ? `${overflowCount}+` : count;
const isZero = numberedDisplayCount === "0" || numberedDisplayCount === 0 || text === "0" || text === 0;
const ignoreCount = count === null || isZero && !showZero;
const hasStatus = (isNonNullable(status) || isNonNullable(color)) && ignoreCount;
const hasStatusValue = isNonNullable(status) || !isZero;
const showAsDot = dot && !isZero;
const mergedCount = showAsDot ? "" : numberedDisplayCount;
const isHidden = (0, import_react.useMemo)(() => {
return ((!isNonNullable(mergedCount) || mergedCount === "") && (!isNonNullable(text) || text === "") || isZero && !showZero) && !showAsDot;
}, [
mergedCount,
isZero,
showZero,
showAsDot,
text
]);
const countRef = (0, import_react.useRef)(count);
if (!isHidden) countRef.current = count;
const livingCount = countRef.current;
const displayCountRef = (0, import_react.useRef)(mergedCount);
if (!isHidden) displayCountRef.current = mergedCount;
const displayCount = displayCountRef.current;
const isDotRef = (0, import_react.useRef)(showAsDot);
if (!isHidden) isDotRef.current = showAsDot;
const mergedStyle = (0, import_react.useMemo)(() => {
if (!offset) return {
...contextStyle,
...style
};
const horizontalOffset = Number.parseInt(offset[0], 10);
return {
marginTop: offset[1],
insetInlineEnd: -horizontalOffset,
...contextStyle,
...style
};
}, [
offset,
style,
contextStyle
]);
const titleNode = title ?? (typeof livingCount === "string" || isNumber(livingCount) ? livingCount : void 0);
const showStatusTextNode = !isHidden && (text === 0 ? showZero : !!text && text !== true);
const statusTextNode = !showStatusTextNode ? null : /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-status-text` }, text);
const displayNode = isPlainObject(livingCount) ? cloneElement$1(livingCount, (oriProps) => ({ style: {
...mergedStyle,
...oriProps.style
} })) : void 0;
const isInternalColor = isPresetColor(color, false);
const statusCls = clsx(mergedClassNames.indicator, {
[`${prefixCls}-status-dot`]: hasStatus,
[`${prefixCls}-status-${status}`]: !!status,
[`${prefixCls}-color-${color}`]: isInternalColor
});
const statusStyle = {};
if (color && !isInternalColor) {
statusStyle.color = color;
statusStyle.background = color;
}
const badgeClassName = clsx(prefixCls, {
[`${prefixCls}-status`]: hasStatus,
[`${prefixCls}-not-a-wrapper`]: !children,
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, rootClassName, contextClassName, mergedClassNames.root, hashId, cssVarCls);
if (!children && hasStatus && (text || hasStatusValue || !ignoreCount)) {
const statusTextColor = mergedStyle.color;
return /* @__PURE__ */ import_react.createElement("span", {
ref,
...restProps,
className: badgeClassName,
style: {
...mergedStyles.root,
...mergedStyle
}
}, /* @__PURE__ */ import_react.createElement("span", {
className: statusCls,
style: {
...mergedStyles.indicator,
...statusStyle
}
}), showStatusTextNode && /* @__PURE__ */ import_react.createElement("span", {
style: { color: statusTextColor },
className: `${prefixCls}-status-text`
}, text));
}
return /* @__PURE__ */ import_react.createElement("span", {
ref,
...restProps,
className: badgeClassName,
style: mergedStyles.root
}, children, /* @__PURE__ */ import_react.createElement(es_default$28, {
visible: !isHidden,
motionName: `${prefixCls}-zoom`,
motionAppear: false,
motionDeadline: 1e3
}, ({ className: motionClassName }) => {
const scrollNumberPrefixCls = getPrefixCls("scroll-number", customizeScrollNumberPrefixCls);
const isDot = isDotRef.current;
const scrollNumberCls = clsx(mergedClassNames.indicator, {
[`${prefixCls}-dot`]: isDot,
[`${prefixCls}-count`]: !isDot,
[`${prefixCls}-count-sm`]: size === "small",
[`${prefixCls}-multiple-words`]: !isDot && displayCount && displayCount.toString().length > 1,
[`${prefixCls}-status-${status}`]: !!status,
[`${prefixCls}-color-${color}`]: isInternalColor
});
let scrollNumberStyle = {
...mergedStyles.indicator,
...mergedStyle
};
if (color && !isInternalColor) {
scrollNumberStyle = scrollNumberStyle || {};
scrollNumberStyle.background = color;
}
return /* @__PURE__ */ import_react.createElement(ScrollNumber, {
prefixCls: scrollNumberPrefixCls,
show: !isHidden,
motionClassName,
className: scrollNumberCls,
count: displayCount,
title: titleNode,
style: scrollNumberStyle,
key: "scrollNumber"
}, displayNode);
}), statusTextNode);
});
Badge$1.displayName = "Badge";
//#endregion
//#region node_modules/antd/es/badge/style/ribbon.js
var genRibbonStyle = (token) => {
const { antCls, badgeFontHeight, marginXS, badgeRibbonOffset, calc } = token;
const ribbonPrefixCls = `${antCls}-ribbon`;
const ribbonWrapperPrefixCls = `${antCls}-ribbon-wrapper`;
const statusRibbonPreset = genPresetColor$1(token, (colorKey, { darkColor }) => ({ [`&${ribbonPrefixCls}-color-${colorKey}`]: {
background: darkColor,
color: darkColor
} }));
return {
[ribbonWrapperPrefixCls]: { position: "relative" },
[ribbonPrefixCls]: {
...resetComponent(token),
position: "absolute",
top: marginXS,
padding: `0 ${unit$1(token.paddingXS)}`,
color: token.colorPrimary,
lineHeight: unit$1(badgeFontHeight),
whiteSpace: "nowrap",
backgroundColor: token.colorPrimary,
borderRadius: token.borderRadiusSM,
[`${ribbonPrefixCls}-content`]: { color: token.badgeTextColor },
[`${ribbonPrefixCls}-corner`]: {
position: "absolute",
top: "100%",
width: badgeRibbonOffset,
height: badgeRibbonOffset,
color: "currentcolor",
border: `${unit$1(calc(badgeRibbonOffset).div(2).equal())} solid`,
transform: token.badgeRibbonCornerTransform,
transformOrigin: "top",
filter: token.badgeRibbonCornerFilter
},
...statusRibbonPreset,
[`&${ribbonPrefixCls}-placement-end`]: {
insetInlineEnd: calc(badgeRibbonOffset).mul(-1).equal(),
borderEndEndRadius: 0,
[`${ribbonPrefixCls}-corner`]: {
insetInlineEnd: 0,
borderInlineEndColor: "transparent",
borderBlockEndColor: "transparent"
}
},
[`&${ribbonPrefixCls}-placement-start`]: {
insetInlineStart: calc(badgeRibbonOffset).mul(-1).equal(),
borderEndStartRadius: 0,
[`${ribbonPrefixCls}-corner`]: {
insetInlineStart: 0,
borderBlockEndColor: "transparent",
borderInlineStartColor: "transparent"
}
},
"&-rtl": { direction: "rtl" }
}
};
};
var ribbon_default = genStyleHooks(["Badge", "Ribbon"], (token) => {
return genRibbonStyle(prepareToken$3(token));
}, prepareComponentToken$42);
//#endregion
//#region node_modules/antd/es/badge/Ribbon.js
var Ribbon = (props) => {
const { className, prefixCls: customizePrefixCls, style, color, children, text, placement = "end", rootClassName, styles, classNames: ribbonClassNames } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("ribbon");
const prefixCls = getPrefixCls("ribbon", customizePrefixCls);
const wrapperCls = `${prefixCls}-wrapper`;
const [hashId, cssVarCls] = ribbon_default(prefixCls, wrapperCls);
const mergedProps = {
...props,
placement
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, ribbonClassNames], [contextStyles, styles], { props: mergedProps });
const colorInPreset = isPresetColor(color, false);
const ribbonCls = clsx(prefixCls, `${prefixCls}-placement-${placement}`, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-color-${color}`]: colorInPreset
}, className, contextClassName, mergedClassNames.indicator);
const colorStyle = {};
const cornerColorStyle = {};
if (color && !colorInPreset) {
colorStyle.background = color;
cornerColorStyle.color = color;
}
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(wrapperCls, rootClassName, hashId, cssVarCls, mergedClassNames.root),
style: mergedStyles.root
}, children, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(ribbonCls, hashId),
style: {
...colorStyle,
...mergedStyles.indicator,
...contextStyle,
...style
}
}, /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-content`, mergedClassNames.content),
style: mergedStyles.content
}, text), /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-corner`,
style: cornerColorStyle
})));
};
Ribbon.displayName = "Ribbon";
//#endregion
//#region node_modules/antd/es/badge/index.js
var Badge = Badge$1;
Badge.Ribbon = Ribbon;
//#endregion
//#region node_modules/antd/es/breadcrumb/BreadcrumbContext.js
var BreadcrumbContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/dropdown/es/hooks/useAccessibility.js
var { ESC: ESC$1, TAB } = KeyCode;
function useAccessibility$1({ visible, triggerRef, onVisibleChange, autoFocus, overlayRef }) {
const focusMenuRef = import_react.useRef(false);
const handleCloseMenuAndReturnFocus = () => {
if (visible) {
triggerRef.current?.focus?.();
onVisibleChange?.(false);
}
};
const focusMenu = () => {
if (overlayRef.current?.focus) {
overlayRef.current.focus();
focusMenuRef.current = true;
return true;
}
return false;
};
const handleKeyDown = (event) => {
switch (event.keyCode) {
case ESC$1:
handleCloseMenuAndReturnFocus();
break;
case TAB: {
let focusResult = false;
if (!focusMenuRef.current) focusResult = focusMenu();
if (focusResult) event.preventDefault();
else handleCloseMenuAndReturnFocus();
break;
}
}
};
import_react.useEffect(() => {
if (visible) {
window.addEventListener("keydown", handleKeyDown);
if (autoFocus) wrapperRaf(focusMenu, 3);
return () => {
window.removeEventListener("keydown", handleKeyDown);
focusMenuRef.current = false;
};
}
return () => {
focusMenuRef.current = false;
};
}, [visible]);
}
//#endregion
//#region node_modules/@rc-component/dropdown/es/Overlay.js
var Overlay$1 = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { overlay, arrow, prefixCls } = props;
const overlayNode = (0, import_react.useMemo)(() => {
let overlayElement;
if (typeof overlay === "function") overlayElement = overlay();
else overlayElement = overlay;
return overlayElement;
}, [overlay]);
const composedRef = composeRef(ref, getNodeRef(overlayNode));
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, arrow && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-arrow` }), /* @__PURE__ */ import_react.cloneElement(overlayNode, { ref: supportRef(overlayNode) ? composedRef : void 0 }));
});
//#endregion
//#region node_modules/@rc-component/dropdown/es/placements.js
var autoAdjustOverflow$1 = {
adjustX: 1,
adjustY: 1
};
var targetOffset$1 = [0, 0];
var placements$2 = {
topLeft: {
points: ["bl", "tl"],
overflow: autoAdjustOverflow$1,
offset: [0, -4],
targetOffset: targetOffset$1
},
top: {
points: ["bc", "tc"],
overflow: autoAdjustOverflow$1,
offset: [0, -4],
targetOffset: targetOffset$1
},
topRight: {
points: ["br", "tr"],
overflow: autoAdjustOverflow$1,
offset: [0, -4],
targetOffset: targetOffset$1
},
bottomLeft: {
points: ["tl", "bl"],
overflow: autoAdjustOverflow$1,
offset: [0, 4],
targetOffset: targetOffset$1
},
bottom: {
points: ["tc", "bc"],
overflow: autoAdjustOverflow$1,
offset: [0, 4],
targetOffset: targetOffset$1
},
bottomRight: {
points: ["tr", "br"],
overflow: autoAdjustOverflow$1,
offset: [0, 4],
targetOffset: targetOffset$1
}
};
//#endregion
//#region node_modules/@rc-component/dropdown/es/Dropdown.js
function _extends$75() {
_extends$75 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$75.apply(this, arguments);
}
//#endregion
//#region node_modules/@rc-component/dropdown/es/index.js
var es_default$18 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { arrow = false, prefixCls = "rc-dropdown", transitionName, animation, align, placement = "bottomLeft", placements = placements$2, getPopupContainer, showAction, hideAction, overlayClassName, overlayStyle, visible, trigger = ["hover"], autoFocus, overlay, children, onVisibleChange, ...otherProps } = props;
const [triggerVisible, setTriggerVisible] = import_react.useState();
const mergedVisible = "visible" in props ? visible : triggerVisible;
const mergedMotionName = animation ? `${prefixCls}-${animation}` : transitionName;
const triggerRef = import_react.useRef(null);
const overlayRef = import_react.useRef(null);
const childRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => triggerRef.current);
const handleVisibleChange = (newVisible) => {
setTriggerVisible(newVisible);
onVisibleChange?.(newVisible);
};
useAccessibility$1({
visible: mergedVisible,
triggerRef: childRef,
onVisibleChange: handleVisibleChange,
autoFocus,
overlayRef
});
const onClick = (e) => {
const { onOverlayClick } = props;
setTriggerVisible(false);
if (onOverlayClick) onOverlayClick(e);
};
const getMenuElement = () => /* @__PURE__ */ import_react.createElement(Overlay$1, {
ref: overlayRef,
overlay,
prefixCls,
arrow
});
const getMenuElementOrLambda = () => {
if (typeof overlay === "function") return getMenuElement;
return getMenuElement();
};
const getMinOverlayWidthMatchTrigger = () => {
const { minOverlayWidthMatchTrigger, alignPoint } = props;
if ("minOverlayWidthMatchTrigger" in props) return minOverlayWidthMatchTrigger;
return !alignPoint;
};
const getOpenClassName = () => {
const { openClassName } = props;
if (openClassName !== void 0) return openClassName;
return `${prefixCls}-open`;
};
const childrenNode = /* @__PURE__ */ import_react.cloneElement(children, {
className: clsx(children.props?.className, mergedVisible && getOpenClassName()),
ref: supportRef(children) ? composeRef(childRef, getNodeRef(children)) : void 0
});
let triggerHideAction = hideAction;
if (!triggerHideAction && trigger.indexOf("contextMenu") !== -1) triggerHideAction = ["click"];
return /* @__PURE__ */ import_react.createElement(es_default$26, _extends$75({ builtinPlacements: placements }, otherProps, {
prefixCls,
ref: triggerRef,
popupClassName: clsx(overlayClassName, { [`${prefixCls}-show-arrow`]: arrow }),
popupStyle: overlayStyle,
action: trigger,
showAction,
hideAction: triggerHideAction,
popupPlacement: placement,
popupAlign: align,
popupMotion: { motionName: mergedMotionName },
popupVisible: mergedVisible,
stretch: getMinOverlayWidthMatchTrigger() ? "minWidth" : "",
popup: getMenuElementOrLambda(),
onOpenChange: handleVisibleChange,
onPopupClick: onClick,
getPopupContainer
}), childrenNode);
});
//#endregion
//#region node_modules/@rc-component/menu/es/context/IdContext.js
var IdContext = /* @__PURE__ */ import_react.createContext(null);
function getMenuId(uuid, eventKey) {
return `${uuid}-${eventKey}`;
}
/**
* Get `data-menu-id`
*/
function useMenuId(eventKey) {
return getMenuId(import_react.useContext(IdContext), eventKey);
}
//#endregion
//#region node_modules/@rc-component/menu/es/context/MenuContext.js
var MenuContext$1 = /* @__PURE__ */ import_react.createContext(null);
function mergeProps(origin, target) {
const clone = { ...origin };
Object.keys(target).forEach((key) => {
const value = target[key];
if (value !== void 0) clone[key] = value;
});
return clone;
}
function InheritableContextProvider({ children, locked, ...restProps }) {
const context = import_react.useContext(MenuContext$1);
const inheritableContext = useMemo$44(() => mergeProps(context, restProps), [context, restProps], (prev, next) => !locked && (prev[0] !== next[0] || !isEqual(prev[1], next[1], true)));
return /* @__PURE__ */ import_react.createElement(MenuContext$1.Provider, { value: inheritableContext }, children);
}
//#endregion
//#region node_modules/@rc-component/menu/es/context/PathContext.js
var EmptyList = [];
var PathRegisterContext = /* @__PURE__ */ import_react.createContext(null);
function useMeasure() {
return import_react.useContext(PathRegisterContext);
}
var PathTrackerContext = /* @__PURE__ */ import_react.createContext(EmptyList);
function useFullPath(eventKey) {
const parentKeyPath = import_react.useContext(PathTrackerContext);
return import_react.useMemo(() => eventKey !== void 0 ? [...parentKeyPath, eventKey] : parentKeyPath, [parentKeyPath, eventKey]);
}
var PathUserContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/menu/es/context/PrivateContext.js
var PrivateContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/menu/es/hooks/useAccessibility.js
var { LEFT, RIGHT, UP, DOWN, ENTER, ESC, HOME, END } = KeyCode;
var ArrowKeys = [
UP,
DOWN,
LEFT,
RIGHT
];
function getOffset$2(mode, isRootLevel, isRtl, which) {
const prev = "prev";
const next = "next";
const children = "children";
const parent = "parent";
if (mode === "inline" && which === ENTER) return { inlineTrigger: true };
const inline = {
[UP]: prev,
[DOWN]: next
};
const horizontal = {
[LEFT]: isRtl ? next : prev,
[RIGHT]: isRtl ? prev : next,
[DOWN]: children,
[ENTER]: children
};
const vertical = {
[UP]: prev,
[DOWN]: next,
[ENTER]: children,
[ESC]: parent,
[LEFT]: isRtl ? children : parent,
[RIGHT]: isRtl ? parent : children
};
switch ({
inline,
horizontal,
vertical,
inlineSub: inline,
horizontalSub: vertical,
verticalSub: vertical
}[`${mode}${isRootLevel ? "" : "Sub"}`]?.[which]) {
case prev: return {
offset: -1,
sibling: true
};
case next: return {
offset: 1,
sibling: true
};
case parent: return {
offset: -1,
sibling: false
};
case children: return {
offset: 1,
sibling: false
};
default: return null;
}
}
function findContainerUL(element) {
let current = element;
while (current) {
if (current.getAttribute("data-menu-list")) return current;
current = current.parentElement;
}
/* istanbul ignore next */
return null;
}
/**
* Find focused element within element set provided
*/
function getFocusElement(activeElement, elements) {
let current = activeElement || document.activeElement;
while (current) {
if (elements.has(current)) return current;
current = current.parentElement;
}
return null;
}
/**
* Get focusable elements from the element set under provided container
*/
function getFocusableElements(container, elements) {
return getFocusNodeList(container, true).filter((ele) => elements.has(ele));
}
function getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offset = 1) {
if (!parentQueryContainer) return null;
const sameLevelFocusableMenuElementList = getFocusableElements(parentQueryContainer, elements);
const count = sameLevelFocusableMenuElementList.length;
let focusIndex = sameLevelFocusableMenuElementList.findIndex((ele) => focusMenuElement === ele);
if (offset < 0) if (focusIndex === -1) focusIndex = count - 1;
else focusIndex -= 1;
else if (offset > 0) focusIndex += 1;
focusIndex = (focusIndex + count) % count;
return sameLevelFocusableMenuElementList[focusIndex];
}
var refreshElements = (keys, id) => {
const elements = /* @__PURE__ */ new Set();
const key2element = /* @__PURE__ */ new Map();
const element2key = /* @__PURE__ */ new Map();
keys.forEach((key) => {
const element = document.querySelector(`[data-menu-id='${getMenuId(id, key)}']`);
if (element) {
elements.add(element);
element2key.set(element, key);
key2element.set(key, element);
}
});
return {
elements,
key2element,
element2key
};
};
function useAccessibility(mode, activeKey, isRtl, id, containerRef, getKeys, getKeyPath, triggerActiveKey, triggerAccessibilityOpen, originOnKeyDown) {
const rafRef = import_react.useRef();
const activeRef = import_react.useRef();
activeRef.current = activeKey;
const cleanRaf = () => {
wrapperRaf.cancel(rafRef.current);
};
import_react.useEffect(() => () => {
cleanRaf();
}, []);
return (e) => {
const { which } = e;
if ([
...ArrowKeys,
ENTER,
ESC,
HOME,
END
].includes(which)) {
const keys = getKeys();
let refreshedElements = refreshElements(keys, id);
const { elements, key2element, element2key } = refreshedElements;
const focusMenuElement = getFocusElement(key2element.get(activeKey), elements);
const focusMenuKey = element2key.get(focusMenuElement);
const offsetObj = getOffset$2(mode, getKeyPath(focusMenuKey, true).length === 1, isRtl, which);
if (!offsetObj && which !== HOME && which !== END) return;
if (ArrowKeys.includes(which) || [HOME, END].includes(which)) e.preventDefault();
const tryFocus = (menuElement) => {
if (menuElement) {
let focusTargetElement = menuElement;
const link = menuElement.querySelector("a");
if (link?.getAttribute("href")) focusTargetElement = link;
const targetKey = element2key.get(menuElement);
triggerActiveKey(targetKey);
/**
* Do not `useEffect` here since `tryFocus` may trigger async
* which makes React sync update the `activeKey`
* that force render before `useRef` set the next activeKey
*/
cleanRaf();
rafRef.current = wrapperRaf(() => {
if (activeRef.current === targetKey) focusTargetElement.focus();
});
}
};
if ([HOME, END].includes(which) || offsetObj.sibling || !focusMenuElement) {
let parentQueryContainer;
if (!focusMenuElement || mode === "inline") parentQueryContainer = containerRef.current;
else parentQueryContainer = findContainerUL(focusMenuElement);
let targetElement;
const focusableElements = getFocusableElements(parentQueryContainer, elements);
if (which === HOME) targetElement = focusableElements[0];
else if (which === END) targetElement = focusableElements[focusableElements.length - 1];
else targetElement = getNextFocusElement(parentQueryContainer, elements, focusMenuElement, offsetObj.offset);
tryFocus(targetElement);
} else if (offsetObj.inlineTrigger) triggerAccessibilityOpen(focusMenuKey);
else if (offsetObj.offset > 0) {
triggerAccessibilityOpen(focusMenuKey, true);
cleanRaf();
rafRef.current = wrapperRaf(() => {
refreshedElements = refreshElements(keys, id);
const controlId = focusMenuElement.getAttribute("aria-controls");
tryFocus(getNextFocusElement(document.getElementById(controlId), refreshedElements.elements));
}, 5);
} else if (offsetObj.offset < 0) {
const keyPath = getKeyPath(focusMenuKey, true);
const parentKey = keyPath[keyPath.length - 2];
const parentMenuElement = key2element.get(parentKey);
triggerAccessibilityOpen(parentKey, false);
tryFocus(parentMenuElement);
}
}
originOnKeyDown?.(e);
};
}
//#endregion
//#region node_modules/@rc-component/menu/es/utils/timeUtil.js
function nextSlice(callback) {
/* istanbul ignore next */
Promise.resolve().then(callback);
}
//#endregion
//#region node_modules/@rc-component/menu/es/hooks/useKeyRecords.js
var PATH_SPLIT = "__RC_UTIL_PATH_SPLIT__";
var getPathStr = (keyPath) => keyPath.join(PATH_SPLIT);
var getPathKeys = (keyPathStr) => keyPathStr.split(PATH_SPLIT);
var OVERFLOW_KEY = "rc-menu-more";
function useKeyRecords() {
const [, internalForceUpdate] = import_react.useState({});
const key2pathRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
const path2keyRef = (0, import_react.useRef)(/* @__PURE__ */ new Map());
const [overflowKeys, setOverflowKeys] = import_react.useState([]);
const updateRef = (0, import_react.useRef)(0);
const destroyRef = (0, import_react.useRef)(false);
const forceUpdate = () => {
if (!destroyRef.current) internalForceUpdate({});
};
const registerPath = (0, import_react.useCallback)((key, keyPath) => {
warningOnce(!key2pathRef.current.has(key), `Duplicated key '${key}' used in Menu by path [${keyPath.join(" > ")}]`);
const connectedPath = getPathStr(keyPath);
path2keyRef.current.set(connectedPath, key);
key2pathRef.current.set(key, connectedPath);
updateRef.current += 1;
const id = updateRef.current;
nextSlice(() => {
if (id === updateRef.current) forceUpdate();
});
}, []);
const unregisterPath = (0, import_react.useCallback)((key, keyPath) => {
const connectedPath = getPathStr(keyPath);
path2keyRef.current.delete(connectedPath);
key2pathRef.current.delete(key);
}, []);
const refreshOverflowKeys = (0, import_react.useCallback)((keys) => {
setOverflowKeys(keys);
}, []);
const getKeyPath = (0, import_react.useCallback)((eventKey, includeOverflow) => {
const keys = getPathKeys(key2pathRef.current.get(eventKey) || "");
if (includeOverflow && overflowKeys.includes(keys[0])) keys.unshift(OVERFLOW_KEY);
return keys;
}, [overflowKeys]);
const isSubPathKey = (0, import_react.useCallback)((pathKeys, eventKey) => pathKeys.filter((item) => item !== void 0).some((pathKey) => {
return getKeyPath(pathKey, true).includes(eventKey);
}), [getKeyPath]);
const getKeys = () => {
const keys = [...key2pathRef.current.keys()];
if (overflowKeys.length) keys.push(OVERFLOW_KEY);
return keys;
};
/**
* Find current key related child path keys
*/
const getSubPathKeys = (0, import_react.useCallback)((key) => {
const connectedPath = `${key2pathRef.current.get(key)}${PATH_SPLIT}`;
const pathKeys = /* @__PURE__ */ new Set();
[...path2keyRef.current.keys()].forEach((pathKey) => {
if (pathKey.startsWith(connectedPath)) pathKeys.add(path2keyRef.current.get(pathKey));
});
return pathKeys;
}, []);
import_react.useEffect(() => () => {
destroyRef.current = true;
}, []);
return {
registerPath,
unregisterPath,
refreshOverflowKeys,
isSubPathKey,
getKeyPath,
getKeys,
getSubPathKeys
};
}
//#endregion
//#region node_modules/@rc-component/menu/es/hooks/useMemoCallback.js
/**
* Cache callback function that always return same ref instead.
* This is used for context optimization.
*/
function useMemoCallback(func) {
const funRef = import_react.useRef(func);
funRef.current = func;
const callback = import_react.useCallback((...args) => funRef.current?.(...args), []);
return func ? callback : void 0;
}
//#endregion
//#region node_modules/@rc-component/menu/es/hooks/useActive.js
function useActive$1(eventKey, disabled, onMouseEnter, onMouseLeave) {
const { activeKey, onActive, onInactive } = import_react.useContext(MenuContext$1);
const ret = { active: activeKey === eventKey };
if (!disabled) {
ret.onMouseEnter = (domEvent) => {
onMouseEnter?.({
key: eventKey,
domEvent
});
onActive(eventKey);
};
ret.onMouseLeave = (domEvent) => {
onMouseLeave?.({
key: eventKey,
domEvent
});
onInactive(eventKey);
};
}
return ret;
}
//#endregion
//#region node_modules/@rc-component/menu/es/hooks/useDirectionStyle.js
function useDirectionStyle(level) {
const { mode, rtl, inlineIndent } = import_react.useContext(MenuContext$1);
if (mode !== "inline") return null;
const len = level;
return rtl ? { paddingRight: len * inlineIndent } : { paddingLeft: len * inlineIndent };
}
//#endregion
//#region node_modules/@rc-component/menu/es/Icon.js
function Icon$2({ icon, props, children }) {
let iconNode;
if (icon === null || icon === false) return null;
if (typeof icon === "function") iconNode = /* @__PURE__ */ import_react.createElement(icon, { ...props });
else if (typeof icon !== "boolean") iconNode = icon;
return iconNode || children || null;
}
//#endregion
//#region node_modules/@rc-component/menu/es/utils/warnUtil.js
/**
* `onClick` event return `info.item` which point to react node directly.
* We should warning this since it will not work on FC.
*/
function warnItemProp({ item, ...restInfo }) {
Object.defineProperty(restInfo, "item", { get: () => {
warningOnce(false, "`info.item` is deprecated since we will move to function component that not provides React Node instance in future.");
return item;
} });
return restInfo;
}
//#endregion
//#region node_modules/@rc-component/menu/es/MenuItem.js
function _extends$74() {
_extends$74 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$74.apply(this, arguments);
}
var LegacyMenuItem = class extends import_react.Component {
render() {
const { title, attribute, elementRef, ...restProps } = this.props;
const passedProps = omit(restProps, [
"eventKey",
"popupClassName",
"popupOffset",
"onTitleClick"
]);
warningOnce(!attribute, "`attribute` of Menu.Item is deprecated. Please pass attribute directly.");
return /* @__PURE__ */ import_react.createElement(es_default$22.Item, _extends$74({}, attribute, { title: typeof title === "string" ? title : void 0 }, passedProps, { ref: elementRef }));
}
};
/**
* Real Menu Item component
*/
var InternalMenuItem = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { style, className, eventKey, warnKey, disabled, itemIcon, children, role, onMouseEnter, onMouseLeave, onClick, onKeyDown, onFocus, ...restProps } = props;
const domDataId = useMenuId(eventKey);
const { prefixCls, onItemClick, disabled: contextDisabled, overflowDisabled, itemIcon: contextItemIcon, selectedKeys, onActive } = import_react.useContext(MenuContext$1);
const { _internalRenderMenuItem } = import_react.useContext(PrivateContext);
const itemCls = `${prefixCls}-item`;
const legacyMenuItemRef = import_react.useRef();
const elementRef = import_react.useRef();
const mergedDisabled = contextDisabled || disabled;
const mergedEleRef = useComposeRef(ref, elementRef);
const connectedKeys = useFullPath(eventKey);
if (warnKey) warningOnce(false, "MenuItem should not leave undefined `key`.");
const getEventInfo = (e) => {
return {
key: eventKey,
keyPath: [...connectedKeys].reverse(),
item: legacyMenuItemRef.current,
domEvent: e
};
};
const mergedItemIcon = itemIcon || contextItemIcon;
const { active, ...activeProps } = useActive$1(eventKey, mergedDisabled, onMouseEnter, onMouseLeave);
const selected = selectedKeys.includes(eventKey);
const directionStyle = useDirectionStyle(connectedKeys.length);
const onInternalClick = (e) => {
if (mergedDisabled) return;
const info = getEventInfo(e);
onClick?.(warnItemProp(info));
onItemClick(info);
};
const onInternalKeyDown = (e) => {
onKeyDown?.(e);
if (e.which === KeyCode.ENTER) {
const info = getEventInfo(e);
onClick?.(warnItemProp(info));
onItemClick(info);
}
};
/**
* Used for accessibility. Helper will focus element without key board.
* We should manually trigger an active
*/
const onInternalFocus = (e) => {
onActive(eventKey);
onFocus?.(e);
};
const optionRoleProps = {};
if (props.role === "option") optionRoleProps["aria-selected"] = selected;
let renderNode = /* @__PURE__ */ import_react.createElement(LegacyMenuItem, _extends$74({
ref: legacyMenuItemRef,
elementRef: mergedEleRef,
role: role === null ? "none" : role || "menuitem",
tabIndex: disabled ? null : -1,
"data-menu-id": overflowDisabled && domDataId ? null : domDataId
}, omit(restProps, ["extra"]), activeProps, optionRoleProps, {
component: "li",
"aria-disabled": disabled,
style: {
...directionStyle,
...style
},
className: clsx(itemCls, {
[`${itemCls}-active`]: active,
[`${itemCls}-selected`]: selected,
[`${itemCls}-disabled`]: mergedDisabled
}, className),
onClick: onInternalClick,
onKeyDown: onInternalKeyDown,
onFocus: onInternalFocus
}), children, /* @__PURE__ */ import_react.createElement(Icon$2, {
props: {
...props,
isSelected: selected
},
icon: mergedItemIcon
}));
if (_internalRenderMenuItem) renderNode = _internalRenderMenuItem(renderNode, props, { selected });
return renderNode;
});
function MenuItem$1(props, ref) {
const { eventKey } = props;
const measure = useMeasure();
const connectedKeyPath = useFullPath(eventKey);
import_react.useEffect(() => {
if (measure) {
measure.registerPath(eventKey, connectedKeyPath);
return () => {
measure.unregisterPath(eventKey, connectedKeyPath);
};
}
}, [connectedKeyPath]);
if (measure) return null;
return /* @__PURE__ */ import_react.createElement(InternalMenuItem, _extends$74({}, props, { ref }));
}
var MenuItem_default = /* @__PURE__ */ import_react.forwardRef(MenuItem$1);
//#endregion
//#region node_modules/@rc-component/menu/es/SubMenu/SubMenuList.js
function _extends$73() {
_extends$73 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$73.apply(this, arguments);
}
var InternalSubMenuList = ({ className, children, ...restProps }, ref) => {
const { prefixCls, mode, rtl } = import_react.useContext(MenuContext$1);
return /* @__PURE__ */ import_react.createElement("ul", _extends$73({
className: clsx(prefixCls, rtl && `${prefixCls}-rtl`, `${prefixCls}-sub`, `${prefixCls}-${mode === "inline" ? "inline" : "vertical"}`, className),
role: "menu"
}, restProps, {
"data-menu-list": true,
ref
}), children);
};
var SubMenuList = /* @__PURE__ */ import_react.forwardRef(InternalSubMenuList);
SubMenuList.displayName = "SubMenuList";
//#endregion
//#region node_modules/@rc-component/menu/es/utils/commonUtil.js
function parseChildren(children, keyPath) {
return toArray$8(children).map((child, index) => {
if (/* @__PURE__ */ import_react.isValidElement(child)) {
const { key } = child;
let eventKey = child.props?.eventKey ?? key;
const emptyKey = eventKey === null || eventKey === void 0;
if (emptyKey) eventKey = `tmp_key-${[...keyPath, index].join("-")}`;
const cloneProps = {
key: eventKey,
eventKey
};
if (emptyKey) cloneProps.warnKey = true;
return /* @__PURE__ */ import_react.cloneElement(child, cloneProps);
}
return child;
});
}
//#endregion
//#region node_modules/@rc-component/menu/es/placements.js
var autoAdjustOverflow = {
adjustX: 1,
adjustY: 1
};
var placements$1 = {
topLeft: {
points: ["bl", "tl"],
overflow: autoAdjustOverflow
},
topRight: {
points: ["br", "tr"],
overflow: autoAdjustOverflow
},
bottomLeft: {
points: ["tl", "bl"],
overflow: autoAdjustOverflow
},
bottomRight: {
points: ["tr", "br"],
overflow: autoAdjustOverflow
},
leftTop: {
points: ["tr", "tl"],
overflow: autoAdjustOverflow
},
leftBottom: {
points: ["br", "bl"],
overflow: autoAdjustOverflow
},
rightTop: {
points: ["tl", "tr"],
overflow: autoAdjustOverflow
},
rightBottom: {
points: ["bl", "br"],
overflow: autoAdjustOverflow
}
};
var placementsRtl = {
topLeft: {
points: ["bl", "tl"],
overflow: autoAdjustOverflow
},
topRight: {
points: ["br", "tr"],
overflow: autoAdjustOverflow
},
bottomLeft: {
points: ["tl", "bl"],
overflow: autoAdjustOverflow
},
bottomRight: {
points: ["tr", "br"],
overflow: autoAdjustOverflow
},
rightTop: {
points: ["tr", "tl"],
overflow: autoAdjustOverflow
},
rightBottom: {
points: ["br", "bl"],
overflow: autoAdjustOverflow
},
leftTop: {
points: ["tl", "tr"],
overflow: autoAdjustOverflow
},
leftBottom: {
points: ["bl", "br"],
overflow: autoAdjustOverflow
}
};
//#endregion
//#region node_modules/@rc-component/menu/es/utils/motionUtil.js
function getMotion(mode, motion, defaultMotions) {
if (motion) return motion;
if (defaultMotions) return defaultMotions[mode] || defaultMotions.other;
}
//#endregion
//#region node_modules/@rc-component/menu/es/SubMenu/PopupTrigger.js
var popupPlacementMap = {
horizontal: "bottomLeft",
vertical: "rightTop",
"vertical-left": "rightTop",
"vertical-right": "leftTop"
};
function PopupTrigger({ prefixCls, visible, children, popup, popupStyle, popupClassName, popupOffset, disabled, mode, onVisibleChange }) {
const { getPopupContainer, rtl, subMenuOpenDelay, subMenuCloseDelay, builtinPlacements, triggerSubMenuAction, forceSubMenuRender, rootClassName, motion, defaultMotions } = import_react.useContext(MenuContext$1);
const [innerVisible, setInnerVisible] = import_react.useState(false);
const placement = rtl ? {
...placementsRtl,
...builtinPlacements
} : {
...placements$1,
...builtinPlacements
};
const popupPlacement = popupPlacementMap[mode];
const targetMotion = getMotion(mode, motion, defaultMotions);
const targetMotionRef = import_react.useRef(targetMotion);
if (mode !== "inline")
/**
* PopupTrigger is only used for vertical and horizontal types.
* When collapsed is unfolded, the inline animation will destroy the vertical animation.
*/
targetMotionRef.current = targetMotion;
const mergedMotion = {
...targetMotionRef.current,
leavedClassName: `${prefixCls}-hidden`,
removeOnLeave: false,
motionAppear: true
};
const visibleRef = import_react.useRef();
import_react.useEffect(() => {
visibleRef.current = wrapperRaf(() => {
setInnerVisible(visible);
});
return () => {
wrapperRaf.cancel(visibleRef.current);
};
}, [visible]);
return /* @__PURE__ */ import_react.createElement(es_default$26, {
prefixCls,
popupClassName: clsx(`${prefixCls}-popup`, { [`${prefixCls}-rtl`]: rtl }, popupClassName, rootClassName),
stretch: mode === "horizontal" ? "minWidth" : null,
getPopupContainer,
builtinPlacements: placement,
popupPlacement,
popupVisible: innerVisible,
popup,
popupStyle,
popupAlign: popupOffset && { offset: popupOffset },
action: disabled ? [] : [triggerSubMenuAction],
mouseEnterDelay: subMenuOpenDelay,
mouseLeaveDelay: subMenuCloseDelay,
onPopupVisibleChange: onVisibleChange,
forceRender: forceSubMenuRender,
popupMotion: mergedMotion,
fresh: true
}, children);
}
//#endregion
//#region node_modules/@rc-component/menu/es/SubMenu/InlineSubMenuList.js
function _extends$72() {
_extends$72 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$72.apply(this, arguments);
}
function InlineSubMenuList({ id, open, keyPath, children }) {
const fixedMode = "inline";
const { prefixCls, forceSubMenuRender, motion, defaultMotions, mode } = import_react.useContext(MenuContext$1);
const sameModeRef = import_react.useRef(false);
sameModeRef.current = mode === fixedMode;
const [destroy, setDestroy] = import_react.useState(!sameModeRef.current);
const mergedOpen = sameModeRef.current ? open : false;
import_react.useEffect(() => {
if (sameModeRef.current) setDestroy(false);
}, [mode]);
const mergedMotion = { ...getMotion(fixedMode, motion, defaultMotions) };
if (keyPath.length > 1) mergedMotion.motionAppear = false;
const originOnVisibleChanged = mergedMotion.onVisibleChanged;
mergedMotion.onVisibleChanged = (newVisible) => {
if (!sameModeRef.current && !newVisible) setDestroy(true);
return originOnVisibleChanged?.(newVisible);
};
if (destroy) return null;
return /* @__PURE__ */ import_react.createElement(InheritableContextProvider, {
mode: fixedMode,
locked: !sameModeRef.current
}, /* @__PURE__ */ import_react.createElement(es_default$28, _extends$72({ visible: mergedOpen }, mergedMotion, {
forceRender: forceSubMenuRender,
removeOnLeave: false,
leavedClassName: `${prefixCls}-hidden`
}), ({ className: motionClassName, style: motionStyle }) => {
return /* @__PURE__ */ import_react.createElement(SubMenuList, {
id,
className: motionClassName,
style: motionStyle
}, children);
}));
}
//#endregion
//#region node_modules/@rc-component/menu/es/SubMenu/index.js
function _extends$71() {
_extends$71 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$71.apply(this, arguments);
}
var InternalSubMenu = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { style, className, styles, classNames: menuClassNames, title, eventKey, warnKey, disabled, internalPopupClose, children, itemIcon, expandIcon, popupClassName, popupOffset, popupStyle, onClick, onMouseEnter, onMouseLeave, onTitleClick, onTitleMouseEnter, onTitleMouseLeave, popupRender: propsPopupRender, ...restProps } = props;
const domDataId = useMenuId(eventKey);
const { prefixCls, mode, openKeys, disabled: contextDisabled, overflowDisabled, activeKey, selectedKeys, itemIcon: contextItemIcon, expandIcon: contextExpandIcon, onItemClick, onOpenChange, onActive, popupRender: contextPopupRender } = import_react.useContext(MenuContext$1);
const { _internalRenderSubMenuItem } = import_react.useContext(PrivateContext);
const { isSubPathKey } = import_react.useContext(PathUserContext);
const connectedPath = useFullPath();
const subMenuPrefixCls = `${prefixCls}-submenu`;
const mergedDisabled = contextDisabled || disabled;
const elementRef = import_react.useRef();
const popupRef = import_react.useRef();
if (warnKey) warningOnce(false, "SubMenu should not leave undefined `key`.");
const mergedItemIcon = itemIcon ?? contextItemIcon;
const mergedExpandIcon = expandIcon ?? contextExpandIcon;
const originOpen = openKeys.includes(eventKey);
const open = !overflowDisabled && originOpen;
const childrenSelected = isSubPathKey(selectedKeys, eventKey);
const { active, ...activeProps } = useActive$1(eventKey, mergedDisabled, onTitleMouseEnter, onTitleMouseLeave);
const [childrenActive, setChildrenActive] = import_react.useState(false);
const triggerChildrenActive = (newActive) => {
if (!mergedDisabled) setChildrenActive(newActive);
};
const onInternalMouseEnter = (domEvent) => {
triggerChildrenActive(true);
onMouseEnter?.({
key: eventKey,
domEvent
});
};
const onInternalMouseLeave = (domEvent) => {
triggerChildrenActive(false);
onMouseLeave?.({
key: eventKey,
domEvent
});
};
const mergedActive = import_react.useMemo(() => {
if (active) return active;
if (mode !== "inline") return childrenActive || isSubPathKey([activeKey], eventKey);
return false;
}, [
mode,
active,
activeKey,
childrenActive,
eventKey,
isSubPathKey
]);
const directionStyle = useDirectionStyle(connectedPath.length);
const onInternalTitleClick = (e) => {
if (mergedDisabled) return;
onTitleClick?.({
key: eventKey,
domEvent: e
});
if (mode === "inline") onOpenChange(eventKey, !originOpen);
};
const onMergedItemClick = useMemoCallback((info) => {
onClick?.(warnItemProp(info));
onItemClick(info);
});
const onPopupVisibleChange = (newVisible) => {
if (mode !== "inline") onOpenChange(eventKey, newVisible);
};
/**
* Used for accessibility. Helper will focus element without key board.
* We should manually trigger an active
*/
const onInternalFocus = () => {
onActive(eventKey);
};
const popupId = domDataId && `${domDataId}-popup`;
const expandIconNode = import_react.useMemo(() => /* @__PURE__ */ import_react.createElement(Icon$2, {
icon: mode !== "horizontal" ? mergedExpandIcon : void 0,
props: {
...props,
isOpen: open,
isSubMenu: true
}
}, /* @__PURE__ */ import_react.createElement("i", { className: `${subMenuPrefixCls}-arrow` })), [
mode,
mergedExpandIcon,
props,
open,
subMenuPrefixCls
]);
let titleNode = /* @__PURE__ */ import_react.createElement("div", _extends$71({
role: "menuitem",
style: directionStyle,
className: `${subMenuPrefixCls}-title`,
tabIndex: mergedDisabled ? null : -1,
ref: elementRef,
title: typeof title === "string" ? title : null,
"data-menu-id": overflowDisabled && domDataId ? null : domDataId,
"aria-expanded": open,
"aria-haspopup": true,
"aria-controls": popupId,
"aria-disabled": mergedDisabled,
onClick: onInternalTitleClick,
onFocus: onInternalFocus
}, activeProps), title, expandIconNode);
const triggerModeRef = import_react.useRef(mode);
if (mode !== "inline" && connectedPath.length > 1) triggerModeRef.current = "vertical";
else triggerModeRef.current = mode;
const popupContentTriggerMode = triggerModeRef.current;
const renderPopupContent = import_react.useMemo(() => {
const originNode = /* @__PURE__ */ import_react.createElement(InheritableContextProvider, {
classNames: menuClassNames,
styles,
mode: popupContentTriggerMode === "horizontal" ? "vertical" : popupContentTriggerMode
}, /* @__PURE__ */ import_react.createElement(SubMenuList, {
id: popupId,
ref: popupRef
}, children));
const mergedPopupRender = propsPopupRender || contextPopupRender;
if (mergedPopupRender) return mergedPopupRender(originNode, {
item: props,
keys: connectedPath
});
return originNode;
}, [
propsPopupRender,
contextPopupRender,
connectedPath,
popupId,
children,
props,
popupContentTriggerMode
]);
if (!overflowDisabled) {
const triggerMode = triggerModeRef.current;
titleNode = /* @__PURE__ */ import_react.createElement(PopupTrigger, {
mode: triggerMode,
prefixCls: subMenuPrefixCls,
visible: !internalPopupClose && open && mode !== "inline",
popupClassName,
popupOffset,
popupStyle,
popup: renderPopupContent,
disabled: mergedDisabled,
onVisibleChange: onPopupVisibleChange
}, titleNode);
}
let listNode = /* @__PURE__ */ import_react.createElement(es_default$22.Item, _extends$71({
ref,
role: "none"
}, restProps, {
component: "li",
style,
className: clsx(subMenuPrefixCls, `${subMenuPrefixCls}-${mode}`, className, {
[`${subMenuPrefixCls}-open`]: open,
[`${subMenuPrefixCls}-active`]: mergedActive,
[`${subMenuPrefixCls}-selected`]: childrenSelected,
[`${subMenuPrefixCls}-disabled`]: mergedDisabled
}),
onMouseEnter: onInternalMouseEnter,
onMouseLeave: onInternalMouseLeave
}), titleNode, !overflowDisabled && /* @__PURE__ */ import_react.createElement(InlineSubMenuList, {
id: popupId,
open,
keyPath: connectedPath
}, children));
if (_internalRenderSubMenuItem) listNode = _internalRenderSubMenuItem(listNode, props, {
selected: childrenSelected,
active: mergedActive,
open,
disabled: mergedDisabled
});
return /* @__PURE__ */ import_react.createElement(InheritableContextProvider, {
classNames: menuClassNames,
styles,
onItemClick: onMergedItemClick,
mode: mode === "horizontal" ? "vertical" : mode,
itemIcon: mergedItemIcon,
expandIcon: mergedExpandIcon
}, listNode);
});
var SubMenu$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { eventKey, children } = props;
const connectedKeyPath = useFullPath(eventKey);
const childList = parseChildren(children, connectedKeyPath);
const measure = useMeasure();
import_react.useEffect(() => {
if (measure) {
measure.registerPath(eventKey, connectedKeyPath);
return () => {
measure.unregisterPath(eventKey, connectedKeyPath);
};
}
}, [connectedKeyPath]);
let renderNode;
if (measure) renderNode = childList;
else renderNode = /* @__PURE__ */ import_react.createElement(InternalSubMenu, _extends$71({ ref }, props), childList);
return /* @__PURE__ */ import_react.createElement(PathTrackerContext.Provider, { value: connectedKeyPath }, renderNode);
});
SubMenu$1.displayName = "SubMenu";
//#endregion
//#region node_modules/@rc-component/menu/es/Divider.js
function Divider$1({ className, style }) {
const { prefixCls } = import_react.useContext(MenuContext$1);
if (useMeasure()) return null;
return /* @__PURE__ */ import_react.createElement("li", {
role: "separator",
className: clsx(`${prefixCls}-item-divider`, className),
style
});
}
//#endregion
//#region node_modules/@rc-component/menu/es/MenuItemGroup.js
function _extends$70() {
_extends$70 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$70.apply(this, arguments);
}
var InternalMenuItemGroup = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { className, title, eventKey, children, ...restProps } = props;
const { prefixCls, classNames: menuClassNames, styles } = import_react.useContext(MenuContext$1);
const groupPrefixCls = `${prefixCls}-item-group`;
return /* @__PURE__ */ import_react.createElement("li", _extends$70({
ref,
role: "presentation"
}, restProps, {
onClick: (e) => e.stopPropagation(),
className: clsx(groupPrefixCls, className)
}), /* @__PURE__ */ import_react.createElement("div", {
role: "presentation",
className: clsx(`${groupPrefixCls}-title`, menuClassNames?.listTitle),
style: styles?.listTitle,
title: typeof title === "string" ? title : void 0
}, title), /* @__PURE__ */ import_react.createElement("ul", {
role: "group",
className: clsx(`${groupPrefixCls}-list`, menuClassNames?.list),
style: styles?.list
}, children));
});
var MenuItemGroup = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { eventKey, children } = props;
const childList = parseChildren(children, useFullPath(eventKey));
if (useMeasure()) return childList;
return /* @__PURE__ */ import_react.createElement(InternalMenuItemGroup, _extends$70({ ref }, omit(props, ["warnKey"])), childList);
});
MenuItemGroup.displayName = "MenuItemGroup";
//#endregion
//#region node_modules/@rc-component/menu/es/utils/nodeUtil.js
function _extends$69() {
_extends$69 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$69.apply(this, arguments);
}
function convertItemsToNodes(list, components, prefixCls) {
const { item: MergedMenuItem, group: MergedMenuItemGroup, submenu: MergedSubMenu, divider: MergedDivider } = components;
return (list || []).map((opt, index) => {
if (opt && typeof opt === "object") {
const { label, children, key, type, extra, ...restProps } = opt;
const mergedKey = key ?? `tmp-${index}`;
if (children || type === "group") {
if (type === "group") return /* @__PURE__ */ import_react.createElement(MergedMenuItemGroup, _extends$69({ key: mergedKey }, restProps, { title: label }), convertItemsToNodes(children, components, prefixCls));
return /* @__PURE__ */ import_react.createElement(MergedSubMenu, _extends$69({ key: mergedKey }, restProps, { title: label }), convertItemsToNodes(children, components, prefixCls));
}
if (type === "divider") return /* @__PURE__ */ import_react.createElement(MergedDivider, _extends$69({ key: mergedKey }, restProps));
return /* @__PURE__ */ import_react.createElement(MergedMenuItem, _extends$69({ key: mergedKey }, restProps, { extra }), label, (!!extra || extra === 0) && /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-item-extra` }, extra));
}
return null;
}).filter((opt) => opt);
}
function parseItems(children, items, keyPath, components, prefixCls) {
let childNodes = children;
const mergedComponents = {
divider: Divider$1,
item: MenuItem_default,
group: MenuItemGroup,
submenu: SubMenu$1,
...components
};
if (items) childNodes = convertItemsToNodes(items, mergedComponents, prefixCls);
return parseChildren(childNodes, keyPath);
}
//#endregion
//#region node_modules/@rc-component/menu/es/Menu.js
function _extends$68() {
_extends$68 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$68.apply(this, arguments);
}
/**
* Menu modify after refactor:
* ## Add
* - disabled
*
* ## Remove
* - openTransitionName
* - openAnimation
* - onDestroy
* - siderCollapsed: Seems antd do not use this prop (Need test in antd)
* - collapsedWidth: Seems this logic should be handle by antd Layout.Sider
*/
var EMPTY_LIST$4 = [];
//#endregion
//#region node_modules/@rc-component/menu/es/index.js
var ExportMenu = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls = "rc-menu", rootClassName, style, className, styles, classNames: menuClassNames, tabIndex = 0, items, children, direction, id, mode = "vertical", inlineCollapsed, disabled, disabledOverflow, subMenuOpenDelay = .1, subMenuCloseDelay = .1, forceSubMenuRender, defaultOpenKeys, openKeys, activeKey, defaultActiveFirst, selectable = true, multiple = false, defaultSelectedKeys, selectedKeys, onSelect, onDeselect, inlineIndent = 24, motion, defaultMotions, triggerSubMenuAction = "hover", builtinPlacements, itemIcon, expandIcon, overflowedIndicator = "...", overflowedIndicatorPopupClassName, getPopupContainer, onClick, onOpenChange, onKeyDown, openAnimation, openTransitionName, _internalRenderMenuItem, _internalRenderSubMenuItem, _internalComponents, popupRender, ...restProps } = props;
const [childList, measureChildList] = import_react.useMemo(() => [parseItems(children, items, EMPTY_LIST$4, _internalComponents, prefixCls), parseItems(children, items, EMPTY_LIST$4, {}, prefixCls)], [
children,
items,
_internalComponents
]);
const [mounted, setMounted] = import_react.useState(false);
const containerRef = import_react.useRef();
const uuid = useId_default(id ? `rc-menu-uuid-${id}` : "rc-menu-uuid");
const isRtl = direction === "rtl";
warningOnce(!openAnimation && !openTransitionName, "`openAnimation` and `openTransitionName` is removed. Please use `motion` or `defaultMotion` instead.");
const [innerOpenKeys, setMergedOpenKeys] = useControlledState(defaultOpenKeys, openKeys);
const mergedOpenKeys = innerOpenKeys || EMPTY_LIST$4;
const triggerOpenKeys = (keys, forceFlush = false) => {
function doUpdate() {
setMergedOpenKeys(keys);
onOpenChange?.(keys);
}
if (forceFlush) (0, import_react_dom.flushSync)(doUpdate);
else doUpdate();
};
const [inlineCacheOpenKeys, setInlineCacheOpenKeys] = import_react.useState(mergedOpenKeys);
const mountRef = import_react.useRef(false);
const [mergedMode, mergedInlineCollapsed] = import_react.useMemo(() => {
if ((mode === "inline" || mode === "vertical") && inlineCollapsed) return ["vertical", inlineCollapsed];
return [mode, false];
}, [mode, inlineCollapsed]);
const isInlineMode = mergedMode === "inline";
const [internalMode, setInternalMode] = import_react.useState(mergedMode);
const [internalInlineCollapsed, setInternalInlineCollapsed] = import_react.useState(mergedInlineCollapsed);
import_react.useEffect(() => {
setInternalMode(mergedMode);
setInternalInlineCollapsed(mergedInlineCollapsed);
if (!mountRef.current) return;
if (isInlineMode) setMergedOpenKeys(inlineCacheOpenKeys);
else triggerOpenKeys(EMPTY_LIST$4);
}, [mergedMode, mergedInlineCollapsed]);
const [lastVisibleIndex, setLastVisibleIndex] = import_react.useState(0);
const allVisible = lastVisibleIndex >= childList.length - 1 || internalMode !== "horizontal" || disabledOverflow;
import_react.useEffect(() => {
if (isInlineMode) setInlineCacheOpenKeys(mergedOpenKeys);
}, [mergedOpenKeys]);
import_react.useEffect(() => {
mountRef.current = true;
return () => {
mountRef.current = false;
};
}, []);
const { registerPath, unregisterPath, refreshOverflowKeys, isSubPathKey, getKeyPath, getKeys, getSubPathKeys } = useKeyRecords();
const registerPathContext = import_react.useMemo(() => ({
registerPath,
unregisterPath
}), [registerPath, unregisterPath]);
const pathUserContext = import_react.useMemo(() => ({ isSubPathKey }), [isSubPathKey]);
import_react.useEffect(() => {
refreshOverflowKeys(allVisible ? EMPTY_LIST$4 : childList.slice(lastVisibleIndex + 1).map((child) => child.key));
}, [lastVisibleIndex, allVisible]);
const [mergedActiveKey, setMergedActiveKey] = useControlledState(activeKey || defaultActiveFirst && childList[0]?.key, activeKey);
const onActive = useMemoCallback((key) => {
setMergedActiveKey(key);
});
const onInactive = useMemoCallback(() => {
setMergedActiveKey(void 0);
});
(0, import_react.useImperativeHandle)(ref, () => {
return {
list: containerRef.current,
focus: (options) => {
const keys = getKeys();
const { elements, key2element, element2key } = refreshElements(keys, uuid);
const focusableElements = getFocusableElements(containerRef.current, elements);
let shouldFocusKey;
if (mergedActiveKey && keys.includes(mergedActiveKey)) shouldFocusKey = mergedActiveKey;
else shouldFocusKey = focusableElements[0] ? element2key.get(focusableElements[0]) : childList.find((node) => !node.props.disabled)?.key;
const elementToFocus = key2element.get(shouldFocusKey);
if (shouldFocusKey && elementToFocus) elementToFocus?.focus?.(options);
},
findItem: ({ key: itemKey }) => {
const { key2element } = refreshElements(getKeys(), uuid);
return key2element.get(itemKey) || null;
}
};
});
const [internalSelectKeys, setMergedSelectKeys] = useControlledState(defaultSelectedKeys || [], selectedKeys);
const mergedSelectKeys = import_react.useMemo(() => {
if (Array.isArray(internalSelectKeys)) return internalSelectKeys;
if (internalSelectKeys === null || internalSelectKeys === void 0) return EMPTY_LIST$4;
return [internalSelectKeys];
}, [internalSelectKeys]);
const triggerSelection = (info) => {
if (selectable) {
const { key: targetKey } = info;
const exist = mergedSelectKeys.includes(targetKey);
let newSelectKeys;
if (multiple) if (exist) newSelectKeys = mergedSelectKeys.filter((key) => key !== targetKey);
else newSelectKeys = [...mergedSelectKeys, targetKey];
else newSelectKeys = [targetKey];
setMergedSelectKeys(newSelectKeys);
const selectInfo = {
...info,
selectedKeys: newSelectKeys
};
if (exist) onDeselect?.(selectInfo);
else onSelect?.(selectInfo);
}
if (!multiple && mergedOpenKeys.length && internalMode !== "inline") triggerOpenKeys(EMPTY_LIST$4);
};
/**
* Click for item. SubMenu do not have selection status
*/
const onInternalClick = useMemoCallback((info) => {
onClick?.(warnItemProp(info));
triggerSelection(info);
});
const onInternalOpenChange = useMemoCallback((key, open) => {
let newOpenKeys = mergedOpenKeys.filter((k) => k !== key);
if (open) newOpenKeys.push(key);
else if (internalMode !== "inline") {
const subPathKeys = getSubPathKeys(key);
newOpenKeys = newOpenKeys.filter((k) => !subPathKeys.has(k));
}
if (!isEqual(mergedOpenKeys, newOpenKeys, true)) triggerOpenKeys(newOpenKeys, true);
});
const triggerAccessibilityOpen = (key, open) => {
onInternalOpenChange(key, open ?? !mergedOpenKeys.includes(key));
};
const onInternalKeyDown = useAccessibility(internalMode, mergedActiveKey, isRtl, uuid, containerRef, getKeys, getKeyPath, setMergedActiveKey, triggerAccessibilityOpen, onKeyDown);
import_react.useEffect(() => {
setMounted(true);
}, []);
const privateContext = import_react.useMemo(() => ({
_internalRenderMenuItem,
_internalRenderSubMenuItem
}), [_internalRenderMenuItem, _internalRenderSubMenuItem]);
const wrappedChildList = internalMode !== "horizontal" || disabledOverflow ? childList : childList.map((child, index) => /* @__PURE__ */ import_react.createElement(InheritableContextProvider, {
key: child.key,
overflowDisabled: index > lastVisibleIndex,
classNames: menuClassNames,
styles
}, child));
const container = /* @__PURE__ */ import_react.createElement(es_default$22, _extends$68({
id,
ref: containerRef,
prefixCls: `${prefixCls}-overflow`,
component: "ul",
itemComponent: MenuItem_default,
className: clsx(prefixCls, `${prefixCls}-root`, `${prefixCls}-${internalMode}`, className, {
[`${prefixCls}-inline-collapsed`]: internalInlineCollapsed,
[`${prefixCls}-rtl`]: isRtl
}, rootClassName),
dir: direction,
style,
role: "menu",
tabIndex,
data: wrappedChildList,
renderRawItem: (node) => node,
renderRawRest: (omitItems) => {
const len = omitItems.length;
const originOmitItems = len ? childList.slice(-len) : null;
return /* @__PURE__ */ import_react.createElement(SubMenu$1, {
eventKey: OVERFLOW_KEY,
title: overflowedIndicator,
disabled: allVisible,
internalPopupClose: len === 0,
popupClassName: overflowedIndicatorPopupClassName
}, originOmitItems);
},
maxCount: internalMode !== "horizontal" || disabledOverflow ? es_default$22.INVALIDATE : es_default$22.RESPONSIVE,
ssr: "full",
"data-menu-list": true,
onVisibleChange: (newLastIndex) => {
setLastVisibleIndex(newLastIndex);
},
onKeyDown: onInternalKeyDown
}, restProps));
return /* @__PURE__ */ import_react.createElement(PrivateContext.Provider, { value: privateContext }, /* @__PURE__ */ import_react.createElement(IdContext.Provider, { value: uuid }, /* @__PURE__ */ import_react.createElement(InheritableContextProvider, {
prefixCls,
rootClassName,
classNames: menuClassNames,
styles,
mode: internalMode,
openKeys: mergedOpenKeys,
rtl: isRtl,
disabled,
motion: mounted ? motion : null,
defaultMotions: mounted ? defaultMotions : null,
activeKey: mergedActiveKey,
onActive,
onInactive,
selectedKeys: mergedSelectKeys,
inlineIndent,
subMenuOpenDelay,
subMenuCloseDelay,
forceSubMenuRender,
builtinPlacements,
triggerSubMenuAction,
getPopupContainer,
itemIcon,
expandIcon,
onItemClick: onInternalClick,
onOpenChange: onInternalOpenChange,
popupRender
}, /* @__PURE__ */ import_react.createElement(PathUserContext.Provider, { value: pathUserContext }, container), /* @__PURE__ */ import_react.createElement("div", {
style: { display: "none" },
"aria-hidden": true
}, /* @__PURE__ */ import_react.createElement(PathRegisterContext.Provider, { value: registerPathContext }, measureChildList)))));
});
ExportMenu.Item = MenuItem_default;
ExportMenu.SubMenu = SubMenu$1;
ExportMenu.ItemGroup = MenuItemGroup;
ExportMenu.Divider = Divider$1;
//#endregion
//#region node_modules/antd/es/layout/context.js
var LayoutContext = /* @__PURE__ */ import_react.createContext({ siderHook: {
addSider: () => null,
removeSider: () => null
} });
//#endregion
//#region node_modules/antd/es/layout/style/index.js
var genLayoutStyle = (token) => {
const { antCls, componentCls, colorText, footerBg, headerHeight, headerPadding, headerColor, footerPadding, fontSize, bodyBg, headerBg } = token;
return {
[componentCls]: {
display: "flex",
flex: "auto",
flexDirection: "column",
minHeight: 0,
background: bodyBg,
"&, *": { boxSizing: "border-box" },
[`&${componentCls}-has-sider`]: {
flexDirection: "row",
[`> ${componentCls}, > ${componentCls}-content`]: { width: 0 }
},
[`${componentCls}-header, &${componentCls}-footer`]: { flex: "0 0 auto" },
"&-rtl": { direction: "rtl" }
},
[`${componentCls}-header`]: {
height: headerHeight,
padding: headerPadding,
color: headerColor,
lineHeight: unit$1(headerHeight),
background: headerBg,
[`${antCls}-menu`]: { lineHeight: "inherit" }
},
[`${componentCls}-footer`]: {
padding: footerPadding,
color: colorText,
fontSize,
background: footerBg
},
[`${componentCls}-content`]: {
flex: "auto",
color: colorText,
minHeight: 0
}
};
};
var prepareComponentToken$41 = (token) => {
const { colorBgLayout, controlHeight, controlHeightLG, colorText, controlHeightSM, marginXXS, colorTextLightSolid, colorBgContainer } = token;
const paddingInline = controlHeightLG * 1.25;
return {
colorBgHeader: "#001529",
colorBgBody: colorBgLayout,
colorBgTrigger: "#002140",
bodyBg: colorBgLayout,
headerBg: "#001529",
headerHeight: controlHeight * 2,
headerPadding: `0 ${paddingInline}px`,
headerColor: colorText,
footerPadding: `${controlHeightSM}px ${paddingInline}px`,
footerBg: colorBgLayout,
siderBg: "#001529",
triggerHeight: controlHeightLG + marginXXS * 2,
triggerBg: "#002140",
triggerColor: colorTextLightSolid,
zeroTriggerWidth: controlHeightLG,
zeroTriggerHeight: controlHeightLG,
lightSiderBg: colorBgContainer,
lightTriggerBg: colorBgContainer,
lightTriggerColor: colorText
};
};
var DEPRECATED_TOKENS = [
["colorBgBody", "bodyBg"],
["colorBgHeader", "headerBg"],
["colorBgTrigger", "triggerBg"]
];
var style_default$46 = genStyleHooks("Layout", genLayoutStyle, prepareComponentToken$41, { deprecatedTokens: DEPRECATED_TOKENS });
//#endregion
//#region node_modules/antd/es/layout/style/sider.js
var genSiderStyle = (token) => {
const { componentCls, siderBg, motionDurationMid, motionDurationSlow, antCls, triggerHeight, triggerColor, triggerBg, headerHeight, zeroTriggerWidth, zeroTriggerHeight, borderRadiusLG, lightSiderBg, lightTriggerColor, lightTriggerBg, bodyBg } = token;
return { [componentCls]: {
position: "relative",
minWidth: 0,
background: siderBg,
transition: `all ${motionDurationMid}, background 0s`,
"&-has-trigger": { paddingBottom: triggerHeight },
"&-right": { order: 1 },
[`${componentCls}-children`]: {
height: "100%",
marginTop: -.1,
paddingTop: .1,
[`${antCls}-menu${antCls}-menu-inline-collapsed`]: { width: "auto" }
},
[`&-zero-width ${componentCls}-children`]: { overflow: "hidden" },
[`${componentCls}-trigger`]: {
position: "fixed",
bottom: 0,
zIndex: 1,
height: triggerHeight,
color: triggerColor,
lineHeight: unit$1(triggerHeight),
textAlign: "center",
background: triggerBg,
cursor: "pointer",
transition: `all ${motionDurationMid}`
},
[`${componentCls}-zero-width-trigger`]: {
position: "absolute",
top: headerHeight,
insetInlineEnd: token.calc(zeroTriggerWidth).mul(-1).equal(),
zIndex: 1,
width: zeroTriggerWidth,
height: zeroTriggerHeight,
color: triggerColor,
fontSize: token.fontSizeXL,
display: "flex",
alignItems: "center",
justifyContent: "center",
background: siderBg,
borderRadius: `0 ${unit$1(borderRadiusLG)} ${unit$1(borderRadiusLG)} 0`,
cursor: "pointer",
transition: `background-color ${motionDurationSlow} ease`,
"&::after": {
position: "absolute",
inset: 0,
background: "transparent",
transition: `all ${motionDurationSlow}`,
content: "\"\""
},
"&:hover::after": { background: `rgba(255, 255, 255, 0.2)` },
"&-right": {
insetInlineStart: token.calc(zeroTriggerWidth).mul(-1).equal(),
borderRadius: `${unit$1(borderRadiusLG)} 0 0 ${unit$1(borderRadiusLG)}`
}
},
"&-light": {
background: lightSiderBg,
[`${componentCls}-trigger`]: {
color: lightTriggerColor,
background: lightTriggerBg
},
[`${componentCls}-zero-width-trigger`]: {
color: lightTriggerColor,
background: lightTriggerBg,
border: `1px solid ${bodyBg}`,
borderInlineStart: 0
}
}
} };
};
var sider_default = genStyleHooks(["Layout", "Sider"], genSiderStyle, prepareComponentToken$41, { deprecatedTokens: DEPRECATED_TOKENS });
//#endregion
//#region node_modules/antd/es/layout/Sider.js
var dimensionMaxMap = {
xs: "479.98px",
sm: "575.98px",
md: "767.98px",
lg: "991.98px",
xl: "1199.98px",
xxl: "1599.98px",
xxxl: `1839.98px`
};
var isNumeric = (val) => !Number.isNaN(Number.parseFloat(val)) && Number.isFinite(Number(val));
var SiderContext = /* @__PURE__ */ import_react.createContext({});
var generateId = (() => {
let i = 0;
return (prefix = "") => {
i += 1;
return `${prefix}${i}`;
};
})();
var Sider = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, trigger, children, defaultCollapsed = false, theme = "dark", style = {}, collapsible = false, reverseArrow = false, width = 200, collapsedWidth = 80, zeroWidthTriggerStyle, breakpoint, onCollapse, onBreakpoint, ...otherProps } = props;
const { siderHook } = (0, import_react.useContext)(LayoutContext);
const [collapsed, setCollapsed] = (0, import_react.useState)("collapsed" in props ? props.collapsed : defaultCollapsed);
const [below, setBelow] = (0, import_react.useState)(false);
(0, import_react.useEffect)(() => {
if ("collapsed" in props) setCollapsed(props.collapsed);
}, [props.collapsed]);
const handleSetCollapsed = (value, type) => {
if (!("collapsed" in props)) setCollapsed(value);
onCollapse?.(value, type);
};
const { getPrefixCls, direction } = (0, import_react.useContext)(ConfigContext);
const prefixCls = getPrefixCls("layout-sider", customizePrefixCls);
const [hashId, cssVarCls] = sider_default(prefixCls);
const responsiveHandlerRef = (0, import_react.useRef)(null);
responsiveHandlerRef.current = (mql) => {
setBelow(mql.matches);
onBreakpoint?.(mql.matches);
if (collapsed !== mql.matches) handleSetCollapsed(mql.matches, "responsive");
};
(0, import_react.useEffect)(() => {
function responsiveHandler(mql) {
return responsiveHandlerRef.current?.(mql);
}
let mql;
if (typeof window?.matchMedia !== "undefined" && breakpoint && breakpoint in dimensionMaxMap) {
mql = window.matchMedia(`screen and (max-width: ${dimensionMaxMap[breakpoint]})`);
if (typeof mql?.addEventListener === "function") mql.addEventListener("change", responsiveHandler);
responsiveHandler(mql);
}
return () => {
if (typeof mql?.removeEventListener === "function") mql.removeEventListener("change", responsiveHandler);
};
}, [breakpoint]);
(0, import_react.useEffect)(() => {
const uniqueId = generateId("ant-sider-");
siderHook.addSider(uniqueId);
return () => siderHook.removeSider(uniqueId);
}, []);
const toggle = () => {
handleSetCollapsed(!collapsed, "clickTrigger");
};
const divProps = omit(otherProps, ["collapsed"]);
const rawWidth = collapsed ? collapsedWidth : width;
const siderWidth = isNumeric(rawWidth) ? `${rawWidth}px` : String(rawWidth);
const zeroWidthTrigger = Number.parseFloat(String(collapsedWidth || 0)) === 0 ? /* @__PURE__ */ import_react.createElement("span", {
onClick: toggle,
className: clsx(`${prefixCls}-zero-width-trigger`, `${prefixCls}-zero-width-trigger-${reverseArrow ? "right" : "left"}`),
style: zeroWidthTriggerStyle
}, trigger || /* @__PURE__ */ import_react.createElement(RefIcon$11, null)) : null;
const reverseIcon = direction === "rtl" === !reverseArrow;
const defaultTrigger = {
expanded: reverseIcon ? /* @__PURE__ */ import_react.createElement(RefIcon$6, null) : /* @__PURE__ */ import_react.createElement(RefIcon$12, null),
collapsed: reverseIcon ? /* @__PURE__ */ import_react.createElement(RefIcon$12, null) : /* @__PURE__ */ import_react.createElement(RefIcon$6, null)
}[collapsed ? "collapsed" : "expanded"];
const triggerDom = trigger !== null ? zeroWidthTrigger || /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-trigger`,
onClick: toggle,
style: { width: siderWidth }
}, trigger || defaultTrigger) : null;
const divStyle = {
...style,
flex: `0 0 ${siderWidth}`,
maxWidth: siderWidth,
minWidth: siderWidth,
width: siderWidth
};
const siderCls = clsx(prefixCls, `${prefixCls}-${theme}`, {
[`${prefixCls}-collapsed`]: !!collapsed,
[`${prefixCls}-has-trigger`]: collapsible && trigger !== null && !zeroWidthTrigger,
[`${prefixCls}-below`]: !!below,
[`${prefixCls}-zero-width`]: Number.parseFloat(siderWidth) === 0
}, className, hashId, cssVarCls);
const contextValue = import_react.useMemo(() => ({ siderCollapsed: collapsed }), [collapsed]);
return /* @__PURE__ */ import_react.createElement(SiderContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.createElement("aside", {
className: siderCls,
...divProps,
style: divStyle,
ref
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-children` }, children), collapsible || below && zeroWidthTrigger ? triggerDom : null));
});
Sider.displayName = "Sider";
//#endregion
//#region node_modules/antd/es/menu/MenuContext.js
var MenuContext = /* @__PURE__ */ (0, import_react.createContext)({
prefixCls: "",
firstLevel: true,
inlineCollapsed: false,
styles: null,
classNames: null
});
//#endregion
//#region node_modules/antd/es/menu/MenuDivider.js
var MenuDivider = (props) => {
const { prefixCls: customizePrefixCls, className, dashed, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const classString = clsx({ [`${getPrefixCls("menu", customizePrefixCls)}-item-divider-dashed`]: !!dashed }, className);
return /* @__PURE__ */ import_react.createElement(Divider$1, {
className: classString,
...restProps
});
};
//#endregion
//#region node_modules/antd/es/menu/MenuItem.js
var MenuItem = (props) => {
const { className, children, icon, title, danger, extra } = props;
const { prefixCls, firstLevel, direction, disableMenuItemTitleTooltip, tooltip, inlineCollapsed: isInlineCollapsed, styles, classNames } = import_react.useContext(MenuContext);
const renderItemChildren = (inlineCollapsed) => {
const label = children?.[0];
const wrapNode = /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-title-content`, firstLevel ? classNames?.itemContent : classNames?.subMenu?.itemContent, { [`${prefixCls}-title-content-with-extra`]: !!extra || extra === 0 }),
style: firstLevel ? styles?.itemContent : styles?.subMenu?.itemContent
}, children);
if (!icon || /* @__PURE__ */ import_react.isValidElement(children) && children.type === "span") {
if (children && inlineCollapsed && firstLevel && typeof label === "string") return /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-inline-collapsed-noicon` }, label.charAt(0));
}
return wrapNode;
};
const { siderCollapsed } = import_react.useContext(SiderContext);
let tooltipTitle = title;
if (typeof title === "undefined") tooltipTitle = firstLevel ? children : "";
else if (title === false) tooltipTitle = "";
const tooltipConfig = tooltip === false ? void 0 : tooltip;
const mergedTooltipTitle = tooltipConfig && tooltipConfig.title !== void 0 ? tooltipConfig.title : tooltipTitle;
const tooltipProps = {
...tooltipConfig ?? null,
title: mergedTooltipTitle
};
if (!siderCollapsed && !isInlineCollapsed) {
tooltipProps.title = null;
tooltipProps.open = false;
}
const childrenLength = toArray$8(children).length;
let returnNode = /* @__PURE__ */ import_react.createElement(MenuItem_default, {
...omit(props, [
"title",
"icon",
"danger"
]),
className: clsx(firstLevel ? classNames?.item : classNames?.subMenu?.item, {
[`${prefixCls}-item-danger`]: danger,
[`${prefixCls}-item-only-child`]: (icon ? childrenLength + 1 : childrenLength) === 1
}, className),
style: {
...firstLevel ? styles?.item : styles?.subMenu?.item,
...props.style
},
title: typeof title === "string" ? title : void 0
}, cloneElement$1(icon, (oriProps) => ({
className: clsx(`${prefixCls}-item-icon`, firstLevel ? classNames?.itemIcon : classNames?.subMenu?.itemIcon, oriProps.className),
style: {
...firstLevel ? styles?.itemIcon : styles?.subMenu?.itemIcon,
...oriProps.style
}
})), renderItemChildren(isInlineCollapsed));
if (!disableMenuItemTitleTooltip && tooltip !== false) {
const mergedTooltipPlacement = tooltipConfig && tooltipConfig.placement ? tooltipConfig.placement : direction === "rtl" ? "left" : "right";
const baseTooltipClassName = `${prefixCls}-inline-collapsed-tooltip`;
const mergeTooltipRootClassName = (classNames) => ({
...classNames,
root: clsx(baseTooltipClassName, classNames?.root)
});
const mergedTooltipClassNames = tooltipConfig && typeof tooltipConfig.classNames === "function" ? (info) => {
return mergeTooltipRootClassName(tooltipConfig.classNames(info));
} : mergeTooltipRootClassName(tooltipConfig?.classNames);
returnNode = /* @__PURE__ */ import_react.createElement(Tooltip, {
...tooltipProps,
placement: mergedTooltipPlacement,
classNames: mergedTooltipClassNames
}, returnNode);
}
return returnNode;
};
//#endregion
//#region node_modules/antd/es/menu/OverrideContext.js
var OverrideContext = /* @__PURE__ */ import_react.createContext(null);
/** @internal Only used for Dropdown component. Do not use this in your production. */
var OverrideProvider = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { children, ...restProps } = props;
const override = import_react.useContext(OverrideContext);
const context = import_react.useMemo(() => ({
...override,
...restProps
}), [
override,
restProps.prefixCls,
restProps.mode,
restProps.selectable,
restProps.rootClassName
]);
const canRef = supportNodeRef(children);
const mergedRef = useComposeRef(ref, canRef ? getNodeRef(children) : null);
return /* @__PURE__ */ import_react.createElement(OverrideContext.Provider, { value: context }, /* @__PURE__ */ import_react.createElement(ContextIsolator, { space: true }, canRef ? /* @__PURE__ */ import_react.cloneElement(children, { ref: mergedRef }) : children));
});
//#endregion
//#region node_modules/antd/es/menu/style/horizontal.js
var getHorizontalStyle = (token) => {
const { componentCls, motionDurationSlow, horizontalLineHeight, colorSplit, lineWidth, lineType, itemPaddingInline } = token;
return { [`${componentCls}-horizontal`]: {
lineHeight: horizontalLineHeight,
border: 0,
borderBottom: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
boxShadow: "none",
"&::after": {
display: "block",
clear: "both",
height: 0,
content: "\"\\20\""
},
[`${componentCls}-item, ${componentCls}-submenu`]: {
position: "relative",
display: "inline-block",
verticalAlign: "bottom",
paddingInline: itemPaddingInline
},
[`> ${componentCls}-item:hover,
> ${componentCls}-item-active,
> ${componentCls}-submenu ${componentCls}-submenu-title:hover`]: { backgroundColor: "transparent" },
[`${componentCls}-item, ${componentCls}-submenu-title`]: { transition: [`border-color`, `background-color`].map((prop) => `${prop} ${motionDurationSlow}`).join(",") },
[`${componentCls}-submenu-arrow`]: { display: "none" }
} };
};
//#endregion
//#region node_modules/antd/es/menu/style/rtl.js
var getRTLStyle = ({ componentCls, menuArrowOffset, calc }) => ({
[`${componentCls}-rtl`]: { direction: "rtl" },
[`${componentCls}-submenu-rtl`]: { transformOrigin: "100% 0" },
[`${componentCls}-rtl${componentCls}-vertical,
${componentCls}-submenu-rtl ${componentCls}-vertical`]: { [`${componentCls}-submenu-arrow`]: {
"&::before": { transform: `rotate(-45deg) translateY(${unit$1(calc(menuArrowOffset).mul(-1).equal())})` },
"&::after": { transform: `rotate(45deg) translateY(${unit$1(menuArrowOffset)})` }
} }
});
//#endregion
//#region node_modules/antd/es/menu/style/theme.js
var accessibilityFocus = (token) => genFocusOutline(token);
var getThemeStyle = (token, themeSuffix) => {
const { componentCls, itemColor, itemSelectedColor, subMenuItemSelectedColor, groupTitleColor, itemBg, subMenuItemBg, itemSelectedBg, activeBarHeight, activeBarWidth, activeBarBorderWidth, motionDurationSlow, motionEaseInOut, motionEaseOut, itemPaddingInline, motionDurationMid, itemHoverColor, lineType, colorSplit, itemDisabledColor, dangerItemColor, dangerItemHoverColor, dangerItemSelectedColor, dangerItemActiveBg, dangerItemSelectedBg, popupBg, itemHoverBg, itemActiveBg, menuSubMenuBg, horizontalItemSelectedColor, horizontalItemSelectedBg, horizontalItemBorderRadius, horizontalItemHoverBg } = token;
return { [`${componentCls}-${themeSuffix}, ${componentCls}-${themeSuffix} > ${componentCls}`]: {
color: itemColor,
background: itemBg,
[`&${componentCls}-root:focus-visible`]: { ...accessibilityFocus(token) },
[`${componentCls}-item`]: { "&-group-title, &-extra": { color: groupTitleColor } },
[`${componentCls}-submenu-selected > ${componentCls}-submenu-title`]: { color: subMenuItemSelectedColor },
[`${componentCls}-item, ${componentCls}-submenu-title`]: {
color: itemColor,
[`&:not(${componentCls}-item-disabled):focus-visible`]: { ...accessibilityFocus(token) }
},
[`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: { color: `${itemDisabledColor} !important` },
[`${componentCls}-item:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: { [`&:hover, > ${componentCls}-submenu-title:hover`]: { color: itemHoverColor } },
[`${componentCls}-submenu:not(${componentCls}-submenu-selected)`]: { [`> ${componentCls}-submenu-title:hover`]: { color: itemHoverColor } },
[`&:not(${componentCls}-horizontal)`]: {
[`${componentCls}-item:not(${componentCls}-item-selected)`]: {
"&:hover": { backgroundColor: itemHoverBg },
"&:active": { backgroundColor: itemActiveBg }
},
[`${componentCls}-submenu-title`]: {
"&:hover": { backgroundColor: itemHoverBg },
"&:active": { backgroundColor: itemActiveBg }
}
},
[`${componentCls}-item-danger`]: {
color: dangerItemColor,
[`&${componentCls}-item:hover`]: { [`&:not(${componentCls}-item-selected):not(${componentCls}-submenu-selected)`]: { color: dangerItemHoverColor } },
[`&${componentCls}-item:active`]: { background: dangerItemActiveBg }
},
[`${componentCls}-item a`]: { "&, &:hover": { color: "inherit" } },
[`${componentCls}-item-selected`]: {
color: itemSelectedColor,
[`&${componentCls}-item-danger`]: { color: dangerItemSelectedColor },
"a, a:hover": { color: "inherit" }
},
[`& ${componentCls}-item-selected`]: {
backgroundColor: itemSelectedBg,
[`&${componentCls}-item-danger`]: { backgroundColor: dangerItemSelectedBg }
},
[`&${componentCls}-submenu > ${componentCls}`]: { backgroundColor: menuSubMenuBg },
[`&${componentCls}-popup > ${componentCls}`]: { backgroundColor: popupBg },
[`&${componentCls}-submenu-popup > ${componentCls}`]: { backgroundColor: popupBg },
[`&${componentCls}-horizontal`]: {
...themeSuffix === "dark" ? { borderBottom: 0 } : {},
[`> ${componentCls}-item, > ${componentCls}-submenu`]: {
top: activeBarBorderWidth,
marginTop: token.calc(activeBarBorderWidth).mul(-1).equal(),
marginBottom: 0,
borderRadius: horizontalItemBorderRadius,
"&::after": {
position: "absolute",
insetInline: itemPaddingInline,
bottom: 0,
borderBottom: `${unit$1(activeBarHeight)} solid transparent`,
transition: `border-color ${motionDurationSlow} ${motionEaseInOut}`,
content: "\"\""
},
"&:hover, &-active, &-open": {
background: horizontalItemHoverBg,
"&::after": {
borderBottomWidth: activeBarHeight,
borderBottomColor: horizontalItemSelectedColor
}
},
"&-selected": {
color: horizontalItemSelectedColor,
backgroundColor: horizontalItemSelectedBg,
"&:hover": { backgroundColor: horizontalItemSelectedBg },
"&::after": {
borderBottomWidth: activeBarHeight,
borderBottomColor: horizontalItemSelectedColor
}
}
}
},
[`&${componentCls}-root`]: { [`&${componentCls}-inline, &${componentCls}-vertical`]: { borderInlineEnd: `${unit$1(activeBarBorderWidth)} ${lineType} ${colorSplit}` } },
[`&${componentCls}-inline`]: {
[`${componentCls}-sub${componentCls}-inline`]: { background: subMenuItemBg },
[`${componentCls}-item`]: {
position: "relative",
"&::after": {
position: "absolute",
insetBlock: 0,
insetInlineEnd: 0,
borderInlineEnd: `${unit$1(activeBarWidth)} solid ${itemSelectedColor}`,
transform: "scaleY(0.0001)",
opacity: 0,
transition: [`transform`, `opacity`].map((prop) => `${prop} ${motionDurationMid} ${motionEaseOut}`).join(","),
content: "\"\""
},
[`&${componentCls}-item-danger`]: { "&::after": { borderInlineEndColor: dangerItemSelectedColor } }
},
[`${componentCls}-selected, ${componentCls}-item-selected`]: { "&::after": {
transform: "scaleY(1)",
opacity: 1,
transition: [`transform`, `opacity`].map((prop) => `${prop} ${motionDurationMid} ${motionEaseInOut}`).join(",")
} }
}
} };
};
//#endregion
//#region node_modules/antd/es/menu/style/vertical.js
var getVerticalInlineStyle = (token) => {
const { componentCls, itemHeight, itemMarginInline, padding, menuArrowSize, marginXS, itemMarginBlock, itemWidth, itemPaddingInline } = token;
const paddingWithArrow = token.calc(menuArrowSize).add(padding).add(marginXS).equal();
return {
[`${componentCls}-item`]: {
position: "relative",
overflow: "hidden"
},
[`${componentCls}-item, ${componentCls}-submenu-title`]: {
height: itemHeight,
lineHeight: unit$1(itemHeight),
paddingInline: itemPaddingInline,
overflow: "hidden",
textOverflow: "ellipsis",
marginInline: itemMarginInline,
marginBlock: itemMarginBlock,
width: itemWidth
},
[`> ${componentCls}-item,
> ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
height: itemHeight,
lineHeight: unit$1(itemHeight)
},
[`${componentCls}-item-group-list ${componentCls}-submenu-title,
${componentCls}-submenu-title`]: { paddingInlineEnd: paddingWithArrow }
};
};
var getVerticalStyle = (token) => {
const { componentCls, iconCls, itemHeight, colorTextLightSolid, dropdownWidth, controlHeightLG, motionEaseOut, paddingXL, itemMarginInline, fontSizeLG, motionDurationFast, motionDurationSlow, paddingXS, boxShadowSecondary, collapsedWidth, collapsedIconSize } = token;
const inlineItemStyle = {
height: itemHeight,
lineHeight: unit$1(itemHeight),
listStylePosition: "inside",
listStyleType: "disc"
};
return [
{
[componentCls]: { "&-inline, &-vertical": {
[`&${componentCls}-root`]: { boxShadow: "none" },
...getVerticalInlineStyle(token)
} },
[`${componentCls}-submenu-popup`]: { [`${componentCls}-vertical`]: {
...getVerticalInlineStyle(token),
boxShadow: boxShadowSecondary
} }
},
{ [`${componentCls}-submenu-popup ${componentCls}-vertical${componentCls}-sub`]: {
minWidth: dropdownWidth,
maxHeight: `calc(100vh - ${unit$1(token.calc(controlHeightLG).mul(2.5).equal())})`,
padding: "0",
overflow: "hidden",
borderInlineEnd: 0,
"&:not([class*='-active'])": {
overflowX: "hidden",
overflowY: "auto"
}
} },
{ [`${componentCls}-inline`]: {
width: "100%",
[`&${componentCls}-root`]: { [`${componentCls}-item, ${componentCls}-submenu-title`]: {
display: "flex",
alignItems: "center",
transition: [
`border-color ${motionDurationSlow}`,
`background-color ${motionDurationSlow}`,
`padding ${motionDurationFast} ${motionEaseOut}`
].join(","),
[`> ${componentCls}-title-content`]: {
flex: "auto",
minWidth: 0,
overflow: "hidden",
textOverflow: "ellipsis"
},
"> *": { flex: "none" }
} },
[`${componentCls}-sub${componentCls}-inline`]: {
padding: 0,
border: 0,
borderRadius: 0,
boxShadow: "none",
[`& > ${componentCls}-submenu > ${componentCls}-submenu-title`]: inlineItemStyle,
[`& ${componentCls}-item-group-title`]: { paddingInlineStart: paddingXL }
},
[`${componentCls}-item`]: inlineItemStyle
} },
{ [`${componentCls}-inline-collapsed`]: {
width: collapsedWidth,
[`&${componentCls}-root`]: { [`${componentCls}-item, ${componentCls}-submenu ${componentCls}-submenu-title`]: { [`> ${componentCls}-inline-collapsed-noicon`]: {
fontSize: fontSizeLG,
textAlign: "center"
} } },
[`> ${componentCls}-item,
> ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-item,
> ${componentCls}-item-group > ${componentCls}-item-group-list > ${componentCls}-submenu > ${componentCls}-submenu-title,
> ${componentCls}-submenu > ${componentCls}-submenu-title`]: {
display: "flex",
alignItems: "center",
justifyContent: "center",
insetInlineStart: 0,
paddingInline: `calc(50% - ${unit$1(token.calc(collapsedIconSize).div(2).equal())} - ${unit$1(itemMarginInline)})`,
textOverflow: "clip",
[`
${componentCls}-submenu-arrow,
${componentCls}-submenu-expand-icon
`]: { opacity: 0 },
[`> ${componentCls}-title-content`]: {
width: 0,
opacity: 0,
overflow: "hidden"
},
[`${componentCls}-item-icon, ${iconCls}`]: {
margin: 0,
fontSize: collapsedIconSize,
lineHeight: unit$1(itemHeight),
"+ span": {
display: "inline-block",
width: 0,
opacity: 0,
overflow: "hidden",
marginInlineStart: 0
}
}
},
[`${componentCls}-item-icon, ${iconCls}`]: { display: "inline-block" },
"&-tooltip": {
pointerEvents: "none",
[`${componentCls}-item-icon, ${iconCls}`]: { display: "none" },
"a, a:hover": { color: colorTextLightSolid }
},
[`${componentCls}-item-group-title`]: {
...textEllipsis,
paddingInline: paddingXS
}
} }
];
};
//#endregion
//#region node_modules/antd/es/menu/style/index.js
var genMenuItemStyle = (token) => {
const { componentCls, motionDurationSlow, motionDurationMid, motionEaseInOut, motionEaseOut, iconCls, iconSize, iconMarginInlineEnd } = token;
return {
[`${componentCls}-item, ${componentCls}-submenu-title`]: {
position: "relative",
display: "block",
margin: 0,
whiteSpace: "nowrap",
cursor: "pointer",
transition: [
`border-color ${motionDurationSlow}`,
`background-color ${motionDurationSlow}`,
`padding calc(${motionDurationSlow} + 0.1s) ${motionEaseInOut}`
].join(","),
[`${componentCls}-item-icon, ${iconCls}`]: {
minWidth: iconSize,
fontSize: iconSize,
transition: [
`font-size ${motionDurationMid} ${motionEaseOut}`,
`margin ${motionDurationSlow} ${motionEaseInOut}`,
`color ${motionDurationSlow}`
].join(","),
"+ span": {
marginInlineStart: iconMarginInlineEnd,
opacity: 1,
transition: [
`opacity ${motionDurationSlow} ${motionEaseInOut}`,
`margin ${motionDurationSlow}`,
`color ${motionDurationSlow}`
].join(",")
}
},
[`${componentCls}-item-icon`]: { ...resetIcon() },
[`&${componentCls}-item-only-child`]: { [`> ${iconCls}, > ${componentCls}-item-icon`]: { marginInlineEnd: 0 } }
},
[`${componentCls}-item-disabled, ${componentCls}-submenu-disabled`]: {
background: "none !important",
cursor: "not-allowed",
"&::after": { borderColor: "transparent !important" },
a: {
color: "inherit !important",
cursor: "not-allowed",
pointerEvents: "none"
},
[`> ${componentCls}-submenu-title`]: {
color: "inherit !important",
cursor: "not-allowed"
}
}
};
};
var genSubMenuArrowStyle = (token) => {
const { componentCls, motionDurationSlow, motionEaseInOut, borderRadius, menuArrowSize, menuArrowOffset } = token;
return { [`${componentCls}-submenu`]: {
"&-expand-icon, &-arrow": {
position: "absolute",
top: "50%",
insetInlineEnd: token.margin,
width: menuArrowSize,
color: "currentcolor",
transform: "translateY(-50%)",
transition: ["transform", "opacity"].map((prop) => `${prop} ${motionDurationSlow}`).join(",")
},
"&-arrow": {
"&::before, &::after": {
position: "absolute",
width: token.calc(menuArrowSize).mul(.6).equal(),
height: token.calc(menuArrowSize).mul(.15).equal(),
backgroundColor: "currentcolor",
borderRadius,
transition: [
`background-color`,
`transform`,
`top`,
`color`
].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(","),
content: "\"\""
},
"&::before": { transform: `rotate(45deg) translateY(${unit$1(token.calc(menuArrowOffset).mul(-1).equal())})` },
"&::after": { transform: `rotate(-45deg) translateY(${unit$1(menuArrowOffset)})` }
}
} };
};
var getBaseStyle = (token) => {
const { antCls, componentCls, fontSize, motionDurationSlow, motionDurationMid, motionEaseInOut, paddingXS, padding, colorSplit, lineWidth, zIndexPopup, borderRadiusLG, subMenuItemBorderRadius, menuArrowSize, menuArrowOffset, lineType, groupTitleLineHeight, groupTitleFontSize } = token;
return [
{
"": { [componentCls]: {
...clearFix(),
"&-hidden": { display: "none" }
} },
[`${componentCls}-submenu-hidden`]: { display: "none" }
},
{ [componentCls]: {
...resetComponent(token),
...clearFix(),
marginBottom: 0,
paddingInlineStart: 0,
fontSize,
lineHeight: 0,
listStyle: "none",
outline: "none",
transition: `width ${motionDurationSlow} cubic-bezier(0.2, 0, 0, 1) 0s`,
"ul, ol": {
margin: 0,
padding: 0,
listStyle: "none"
},
"&-overflow": {
display: "flex",
[`${componentCls}-item`]: { flex: "none" }
},
[`${componentCls}-item, ${componentCls}-submenu, ${componentCls}-submenu-title`]: { borderRadius: token.itemBorderRadius },
[`${componentCls}-item-group-title`]: {
padding: `${unit$1(paddingXS)} ${unit$1(padding)}`,
fontSize: groupTitleFontSize,
lineHeight: groupTitleLineHeight,
transition: `all ${motionDurationSlow}`
},
[`&-horizontal ${componentCls}-submenu`]: { transition: [`border-color`, `background-color`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(",") },
[`${componentCls}-submenu, ${componentCls}-submenu-inline`]: { transition: [
`border-color ${motionDurationSlow}`,
`background-color ${motionDurationSlow}`,
`padding ${motionDurationMid}`
].map((prop) => `${prop} ${motionEaseInOut}`).join(",") },
[`${componentCls}-submenu ${componentCls}-sub`]: {
cursor: "initial",
transition: [`background-color`, `padding`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(",")
},
[`${componentCls}-title-content`]: {
transition: `color ${motionDurationSlow}`,
"&-with-extra": {
display: "inline-flex",
alignItems: "center",
width: "100%"
},
[`> ${antCls}-typography-ellipsis-single-line`]: {
display: "inline",
verticalAlign: "unset"
},
[`${componentCls}-item-extra`]: {
marginInlineStart: "auto",
paddingInlineStart: token.padding
}
},
[`${componentCls}-item a`]: { "&::before": {
position: "absolute",
inset: 0,
backgroundColor: "transparent",
content: "\"\""
} },
[`${componentCls}-item-divider`]: {
overflow: "hidden",
lineHeight: 0,
borderColor: colorSplit,
borderStyle: lineType,
borderWidth: 0,
borderTopWidth: lineWidth,
marginBlock: lineWidth,
padding: 0,
"&-dashed": { borderStyle: "dashed" }
},
...genMenuItemStyle(token),
[`${componentCls}-item-group`]: { [`${componentCls}-item-group-list`]: {
margin: 0,
padding: 0,
[`${componentCls}-item, ${componentCls}-submenu-title`]: { paddingInline: `${unit$1(token.calc(fontSize).mul(2).equal())} ${unit$1(padding)}` }
} },
"&-submenu": {
"&-popup": {
position: "absolute",
zIndex: zIndexPopup,
borderRadius: borderRadiusLG,
boxShadow: "none",
transformOrigin: "0 0",
[`&${componentCls}-submenu`]: { background: "transparent" },
"&::before": {
position: "absolute",
inset: 0,
zIndex: -1,
width: "100%",
height: "100%",
opacity: 0,
content: "\"\""
},
[`> ${componentCls}`]: {
borderRadius: borderRadiusLG,
...genMenuItemStyle(token),
...genSubMenuArrowStyle(token),
[`${componentCls}-item, ${componentCls}-submenu > ${componentCls}-submenu-title`]: { borderRadius: subMenuItemBorderRadius },
[`${componentCls}-submenu-title::after`]: { transition: `transform ${motionDurationSlow} ${motionEaseInOut}` }
}
},
"&-placement-leftTop, &-placement-bottomRight": { transformOrigin: "100% 0" },
"&-placement-leftBottom, &-placement-topRight": { transformOrigin: "100% 100%" },
"&-placement-rightBottom, &-placement-topLeft": { transformOrigin: "0 100%" },
"&-placement-bottomLeft, &-placement-rightTop": { transformOrigin: "0 0" },
"&-placement-leftTop, &-placement-leftBottom": { paddingInlineEnd: token.paddingXS },
"&-placement-rightTop, &-placement-rightBottom": { paddingInlineStart: token.paddingXS },
"&-placement-topRight, &-placement-topLeft": { paddingBottom: token.paddingXS },
"&-placement-bottomRight, &-placement-bottomLeft": { paddingTop: token.paddingXS }
},
...genSubMenuArrowStyle(token),
[`&-inline-collapsed ${componentCls}-submenu-arrow,
&-inline ${componentCls}-submenu-arrow`]: {
"&::before": { transform: `rotate(-45deg) translateX(${unit$1(menuArrowOffset)})` },
"&::after": { transform: `rotate(45deg) translateX(${unit$1(token.calc(menuArrowOffset).mul(-1).equal())})` }
},
[`${componentCls}-submenu-open${componentCls}-submenu-inline > ${componentCls}-submenu-title > ${componentCls}-submenu-arrow`]: {
transform: `translateY(${unit$1(token.calc(menuArrowSize).mul(.2).mul(-1).equal())})`,
"&::after": { transform: `rotate(-45deg) translateX(${unit$1(token.calc(menuArrowOffset).mul(-1).equal())})` },
"&::before": { transform: `rotate(45deg) translateX(${unit$1(menuArrowOffset)})` }
}
} },
{ [`${antCls}-layout-header`]: { [componentCls]: { lineHeight: "inherit" } } }
];
};
var prepareComponentToken$40 = (token) => {
const { colorPrimary, colorError, colorTextDisabled, colorErrorBg, colorText, colorTextDescription, colorBgContainer, colorFillAlter, colorFillContent, lineWidth, lineWidthBold, controlItemBgActive, colorBgTextHover, controlHeightLG, lineHeight, colorBgElevated, marginXXS, padding, fontSize, controlHeightSM, fontSizeLG, colorTextLightSolid, colorErrorHover } = token;
const activeBarWidth = token.activeBarWidth ?? 0;
const activeBarBorderWidth = token.activeBarBorderWidth ?? lineWidth;
const itemMarginInline = token.itemMarginInline ?? token.marginXXS;
const colorTextDark = new FastColor(colorTextLightSolid).setA(.65).toRgbString();
return {
dropdownWidth: 160,
zIndexPopup: token.zIndexPopupBase + 50,
radiusItem: token.borderRadiusLG,
itemBorderRadius: token.borderRadiusLG,
radiusSubMenuItem: token.borderRadiusSM,
subMenuItemBorderRadius: token.borderRadiusSM,
colorItemText: colorText,
itemColor: colorText,
colorItemTextHover: colorText,
itemHoverColor: colorText,
colorItemTextHoverHorizontal: colorPrimary,
horizontalItemHoverColor: colorPrimary,
colorGroupTitle: colorTextDescription,
groupTitleColor: colorTextDescription,
colorItemTextSelected: colorPrimary,
itemSelectedColor: colorPrimary,
subMenuItemSelectedColor: colorPrimary,
colorItemTextSelectedHorizontal: colorPrimary,
horizontalItemSelectedColor: colorPrimary,
colorItemBg: colorBgContainer,
itemBg: colorBgContainer,
colorItemBgHover: colorBgTextHover,
itemHoverBg: colorBgTextHover,
colorItemBgActive: colorFillContent,
itemActiveBg: controlItemBgActive,
colorSubItemBg: colorFillAlter,
subMenuItemBg: colorFillAlter,
colorItemBgSelected: controlItemBgActive,
itemSelectedBg: controlItemBgActive,
colorItemBgSelectedHorizontal: "transparent",
horizontalItemSelectedBg: "transparent",
colorActiveBarWidth: 0,
activeBarWidth,
colorActiveBarHeight: lineWidthBold,
activeBarHeight: lineWidthBold,
colorActiveBarBorderSize: lineWidth,
activeBarBorderWidth,
colorItemTextDisabled: colorTextDisabled,
itemDisabledColor: colorTextDisabled,
colorDangerItemText: colorError,
dangerItemColor: colorError,
colorDangerItemTextHover: colorError,
dangerItemHoverColor: colorError,
colorDangerItemTextSelected: colorError,
dangerItemSelectedColor: colorError,
colorDangerItemBgActive: colorErrorBg,
dangerItemActiveBg: colorErrorBg,
colorDangerItemBgSelected: colorErrorBg,
dangerItemSelectedBg: colorErrorBg,
itemMarginInline,
horizontalItemBorderRadius: 0,
horizontalItemHoverBg: "transparent",
itemHeight: controlHeightLG,
groupTitleLineHeight: lineHeight,
collapsedWidth: controlHeightLG * 2,
popupBg: colorBgElevated,
itemMarginBlock: marginXXS,
itemPaddingInline: padding,
horizontalLineHeight: `${controlHeightLG * 1.15}px`,
iconSize: fontSize,
iconMarginInlineEnd: controlHeightSM - fontSize,
collapsedIconSize: fontSizeLG,
groupTitleFontSize: fontSize,
darkItemDisabledColor: new FastColor(colorTextLightSolid).setA(.25).toRgbString(),
darkItemColor: colorTextDark,
darkDangerItemColor: colorError,
darkItemBg: "#001529",
darkPopupBg: "#001529",
darkSubMenuItemBg: "#000c17",
darkItemSelectedColor: colorTextLightSolid,
darkItemSelectedBg: colorPrimary,
darkDangerItemSelectedBg: colorError,
darkItemHoverBg: "transparent",
darkGroupTitleColor: colorTextDark,
darkItemHoverColor: colorTextLightSolid,
darkDangerItemHoverColor: colorErrorHover,
darkDangerItemSelectedColor: colorTextLightSolid,
darkDangerItemActiveBg: colorError,
itemWidth: activeBarWidth ? `calc(100% + ${activeBarBorderWidth}px)` : `calc(100% - ${itemMarginInline * 2}px)`
};
};
var style_default$45 = (prefixCls, rootCls = prefixCls, injectStyle = true) => {
return genStyleHooks("Menu", (token) => {
const { colorBgElevated, controlHeightLG, fontSize, darkItemColor, darkDangerItemColor, darkItemBg, darkSubMenuItemBg, darkItemSelectedColor, darkItemSelectedBg, darkDangerItemSelectedBg, darkItemHoverBg, darkGroupTitleColor, darkItemHoverColor, darkItemDisabledColor, darkDangerItemHoverColor, darkDangerItemSelectedColor, darkDangerItemActiveBg, popupBg, darkPopupBg } = token;
const menuArrowSize = token.calc(fontSize).div(7).mul(5).equal();
const menuToken = merge(token, {
menuArrowSize,
menuHorizontalHeight: token.calc(controlHeightLG).mul(1.15).equal(),
menuArrowOffset: token.calc(menuArrowSize).mul(.25).equal(),
menuSubMenuBg: colorBgElevated,
calc: token.calc,
popupBg
});
const menuDarkToken = merge(menuToken, {
itemColor: darkItemColor,
itemHoverColor: darkItemHoverColor,
groupTitleColor: darkGroupTitleColor,
itemSelectedColor: darkItemSelectedColor,
subMenuItemSelectedColor: darkItemSelectedColor,
itemBg: darkItemBg,
popupBg: darkPopupBg,
subMenuItemBg: darkSubMenuItemBg,
itemActiveBg: "transparent",
itemSelectedBg: darkItemSelectedBg,
activeBarHeight: 0,
activeBarBorderWidth: 0,
itemHoverBg: darkItemHoverBg,
itemDisabledColor: darkItemDisabledColor,
dangerItemColor: darkDangerItemColor,
dangerItemHoverColor: darkDangerItemHoverColor,
dangerItemSelectedColor: darkDangerItemSelectedColor,
dangerItemActiveBg: darkDangerItemActiveBg,
dangerItemSelectedBg: darkDangerItemSelectedBg,
menuSubMenuBg: darkSubMenuItemBg,
horizontalItemSelectedColor: darkItemSelectedColor,
horizontalItemSelectedBg: darkItemSelectedBg
});
return [
getBaseStyle(menuToken),
getHorizontalStyle(menuToken),
getVerticalStyle(menuToken),
getThemeStyle(menuToken, "light"),
getThemeStyle(menuDarkToken, "dark"),
getRTLStyle(menuToken),
genCollapseMotion(menuToken),
initSlideMotion(menuToken, "slide-up"),
initSlideMotion(menuToken, "slide-down"),
initZoomMotion(menuToken, "zoom-big")
];
}, prepareComponentToken$40, {
deprecatedTokens: [
["colorGroupTitle", "groupTitleColor"],
["radiusItem", "itemBorderRadius"],
["radiusSubMenuItem", "subMenuItemBorderRadius"],
["colorItemText", "itemColor"],
["colorItemTextHover", "itemHoverColor"],
["colorItemTextHoverHorizontal", "horizontalItemHoverColor"],
["colorItemTextSelected", "itemSelectedColor"],
["colorItemTextSelectedHorizontal", "horizontalItemSelectedColor"],
["colorItemTextDisabled", "itemDisabledColor"],
["colorDangerItemText", "dangerItemColor"],
["colorDangerItemTextHover", "dangerItemHoverColor"],
["colorDangerItemTextSelected", "dangerItemSelectedColor"],
["colorDangerItemBgActive", "dangerItemActiveBg"],
["colorDangerItemBgSelected", "dangerItemSelectedBg"],
["colorItemBg", "itemBg"],
["colorItemBgHover", "itemHoverBg"],
["colorSubItemBg", "subMenuItemBg"],
["colorItemBgActive", "itemActiveBg"],
["colorItemBgSelectedHorizontal", "horizontalItemSelectedBg"],
["colorActiveBarWidth", "activeBarWidth"],
["colorActiveBarHeight", "activeBarHeight"],
["colorActiveBarBorderSize", "activeBarBorderWidth"],
["colorItemBgSelected", "itemSelectedBg"]
],
injectStyle,
unitless: { groupTitleLineHeight: true }
})(prefixCls, rootCls);
};
//#endregion
//#region node_modules/antd/es/menu/SubMenu.js
var SubMenu = (props) => {
const { popupClassName, icon, title, theme: customTheme } = props;
const context = import_react.useContext(MenuContext);
const { prefixCls, inlineCollapsed, theme: contextTheme, classNames, styles } = context;
const parentPath = useFullPath();
let titleNode;
if (!icon) titleNode = inlineCollapsed && !parentPath.length && title && typeof title === "string" ? /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-inline-collapsed-noicon` }, title.charAt(0)) : /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-title-content` }, title);
else {
const titleIsSpan = /* @__PURE__ */ import_react.isValidElement(title) && title.type === "span";
titleNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, cloneElement$1(icon, (oriProps) => ({
className: clsx(oriProps.className, `${prefixCls}-item-icon`, classNames?.itemIcon),
style: {
...oriProps.style,
...styles?.itemIcon
}
})), titleIsSpan ? title : /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-title-content` }, title));
}
const contextValue = import_react.useMemo(() => ({
...context,
firstLevel: false
}), [context]);
const [zIndex] = useZIndex("Menu");
return /* @__PURE__ */ import_react.createElement(MenuContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.createElement(SubMenu$1, {
...omit(props, ["icon"]),
title: titleNode,
classNames: {
list: classNames?.subMenu?.list,
listTitle: classNames?.subMenu?.itemTitle
},
styles: {
list: styles?.subMenu?.list,
listTitle: styles?.subMenu?.itemTitle
},
popupClassName: clsx(prefixCls, popupClassName, classNames?.popup?.root, `${prefixCls}-${customTheme || contextTheme}`),
popupStyle: {
zIndex,
...props.popupStyle,
...styles?.popup?.root
}
}));
};
//#endregion
//#region node_modules/antd/es/menu/menu.js
function isEmptyIcon(icon) {
return icon === null || icon === false;
}
var MENU_COMPONENTS = {
item: MenuItem,
submenu: SubMenu,
divider: MenuDivider
};
var InternalMenu = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const override = import_react.useContext(OverrideContext);
const overrideObj = override || {};
const { prefixCls: customizePrefixCls, className, style, theme = "light", expandIcon, _internalDisableMenuItemTitleTooltip, tooltip, inlineCollapsed, siderCollapsed, rootClassName, mode, selectable, onClick, overflowedIndicatorPopupClassName, classNames, styles, ...restProps } = props;
const { menu } = import_react.useContext(ConfigContext);
const { getPrefixCls, getPopupContainer, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("menu");
const rootPrefixCls = getPrefixCls();
const passedProps = omit(restProps, ["collapsedWidth"]);
{
const warning = devUseWarning("Menu");
warning(!("inlineCollapsed" in props && mode !== "inline"), "usage", "`inlineCollapsed` should only be used when `mode` is inline.");
warning.deprecated("items" in props && !props.children, "children", "items");
}
overrideObj.validator?.({ mode });
const onItemClick = useEvent((...args) => {
onClick?.(...args);
overrideObj.onClick?.();
});
const mergedMode = overrideObj.mode || mode;
const mergedSelectable = selectable ?? overrideObj.selectable;
const mergedInlineCollapsed = inlineCollapsed ?? siderCollapsed;
const mergedProps = {
...props,
mode: mergedMode,
inlineCollapsed: mergedInlineCollapsed,
selectable: mergedSelectable,
theme
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, {
popup: { _default: "root" },
subMenu: { _default: "item" }
});
const defaultMotions = {
horizontal: { motionName: `${rootPrefixCls}-slide-up` },
inline: initCollapseMotion(rootPrefixCls),
other: { motionName: `${rootPrefixCls}-zoom-big` }
};
const prefixCls = getPrefixCls("menu", customizePrefixCls || overrideObj.prefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$45(prefixCls, rootCls, !override);
const menuClassName = clsx(`${prefixCls}-${theme}`, contextClassName, className);
const mergedExpandIcon = import_react.useMemo(() => {
if (typeof expandIcon === "function" || isEmptyIcon(expandIcon)) return expandIcon || null;
if (typeof overrideObj.expandIcon === "function" || isEmptyIcon(overrideObj.expandIcon)) return overrideObj.expandIcon || null;
if (typeof menu?.expandIcon === "function" || isEmptyIcon(menu?.expandIcon)) return menu?.expandIcon || null;
const mergedIcon = expandIcon ?? overrideObj?.expandIcon ?? menu?.expandIcon;
return cloneElement$1(mergedIcon, { className: clsx(`${prefixCls}-submenu-expand-icon`, /* @__PURE__ */ import_react.isValidElement(mergedIcon) ? mergedIcon.props?.className : void 0) });
}, [
expandIcon,
overrideObj?.expandIcon,
menu?.expandIcon,
prefixCls
]);
const contextValue = import_react.useMemo(() => ({
prefixCls,
inlineCollapsed: mergedInlineCollapsed || false,
direction,
firstLevel: true,
theme,
mode: mergedMode,
disableMenuItemTitleTooltip: _internalDisableMenuItemTitleTooltip,
tooltip,
classNames: mergedClassNames,
styles: mergedStyles
}), [
prefixCls,
mergedInlineCollapsed,
direction,
_internalDisableMenuItemTitleTooltip,
theme,
mergedMode,
mergedClassNames,
mergedStyles,
tooltip
]);
return /* @__PURE__ */ import_react.createElement(OverrideContext.Provider, { value: null }, /* @__PURE__ */ import_react.createElement(MenuContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.createElement(ExportMenu, {
getPopupContainer,
overflowedIndicator: /* @__PURE__ */ import_react.createElement(RefIcon$13, null),
overflowedIndicatorPopupClassName: clsx(prefixCls, `${prefixCls}-${theme}`, overflowedIndicatorPopupClassName),
classNames: {
list: mergedClassNames.list,
listTitle: mergedClassNames.itemTitle
},
styles: {
list: mergedStyles.list,
listTitle: mergedStyles.itemTitle
},
mode: mergedMode,
selectable: mergedSelectable,
onClick: onItemClick,
...passedProps,
inlineCollapsed: mergedInlineCollapsed,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
className: menuClassName,
prefixCls,
direction,
defaultMotions,
expandIcon: mergedExpandIcon,
ref,
rootClassName: clsx(rootClassName, hashId, overrideObj.rootClassName, cssVarCls, rootCls, mergedClassNames.root),
_internalComponents: MENU_COMPONENTS
})));
});
//#endregion
//#region node_modules/antd/es/menu/index.js
var Menu = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const menuRef = (0, import_react.useRef)(null);
const context = import_react.useContext(SiderContext);
(0, import_react.useImperativeHandle)(ref, () => ({
menu: menuRef.current,
focus: (options) => {
menuRef.current?.focus(options);
}
}));
return /* @__PURE__ */ import_react.createElement(InternalMenu, {
ref: menuRef,
...props,
...context
});
});
Menu.Item = MenuItem;
Menu.SubMenu = SubMenu;
Menu.Divider = MenuDivider;
Menu.ItemGroup = MenuItemGroup;
Menu.displayName = "Menu";
//#endregion
//#region node_modules/antd/es/dropdown/style/status.js
var genStatusStyle$2 = (token) => {
const { componentCls, menuCls, colorError, colorTextLightSolid } = token;
const itemCls = `${menuCls}-item`;
return { [`${componentCls}, ${componentCls}-menu-submenu`]: { [`${menuCls} ${itemCls}`]: { [`&${itemCls}-danger:not(${itemCls}-disabled)`]: {
color: colorError,
"&:hover": {
color: colorTextLightSolid,
backgroundColor: colorError
}
} } } };
};
//#endregion
//#region node_modules/antd/es/dropdown/style/index.js
var genBaseStyle$11 = (token) => {
const { componentCls, menuCls, zIndexPopup, dropdownArrowDistance, sizePopupArrow, antCls, iconCls, motionDurationMid, paddingBlock, fontSize, dropdownEdgeChildPadding, colorTextDisabled, fontSizeIcon, controlPaddingHorizontal, colorBgElevated } = token;
return [
{ [componentCls]: {
position: "absolute",
top: -9999,
left: {
_skip_check_: true,
value: -9999
},
zIndex: zIndexPopup,
display: "block",
"&::before": {
position: "absolute",
insetBlock: token.calc(sizePopupArrow).div(2).sub(dropdownArrowDistance).equal(),
zIndex: -9999,
opacity: 1e-4,
content: "\"\""
},
"&-menu-vertical": {
maxHeight: "100vh",
overflowY: "auto"
},
[`&-trigger${antCls}-btn`]: { [`& > ${iconCls}-down, & > ${antCls}-btn-icon > ${iconCls}-down`]: { fontSize: fontSizeIcon } },
[`${componentCls}-wrap`]: {
position: "relative",
[`${antCls}-btn > ${iconCls}-down`]: { fontSize: fontSizeIcon },
[`${iconCls}-down::before`]: { transition: `transform ${motionDurationMid}` }
},
[`${componentCls}-wrap-open`]: { [`${iconCls}-down::before`]: { transform: `rotate(180deg)` } },
"&-hidden, &-menu-hidden, &-menu-submenu-hidden": { display: "none" },
[`&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomLeft,
&${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomLeft,
&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottom,
&${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottom,
&${antCls}-slide-down-enter${antCls}-slide-down-enter-active${componentCls}-placement-bottomRight,
&${antCls}-slide-down-appear${antCls}-slide-down-appear-active${componentCls}-placement-bottomRight`]: { animationName: slideUpIn },
[`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topLeft,
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topLeft,
&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-top,
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-top,
&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-placement-topRight,
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-placement-topRight`]: { animationName: slideDownIn },
[`&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomLeft,
&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottom,
&${antCls}-slide-down-leave${antCls}-slide-down-leave-active${componentCls}-placement-bottomRight`]: { animationName: slideUpOut },
[`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topLeft,
&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-top,
&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-placement-topRight`]: { animationName: slideDownOut }
} },
getArrowStyle(token, colorBgElevated, { arrowPlacement: {
top: true,
bottom: true
} }),
{
[`${componentCls} ${menuCls}`]: {
position: "relative",
margin: 0
},
[`${menuCls}-submenu-popup`]: {
position: "absolute",
zIndex: zIndexPopup,
background: "transparent",
boxShadow: "none",
transformOrigin: "0 0",
"ul, li": {
listStyle: "none",
margin: 0
}
},
[`${componentCls}, ${componentCls}-menu-submenu`]: {
...resetComponent(token),
[menuCls]: {
padding: dropdownEdgeChildPadding,
listStyleType: "none",
backgroundColor: colorBgElevated,
backgroundClip: "padding-box",
borderRadius: token.borderRadiusLG,
outline: "none",
boxShadow: token.boxShadowSecondary,
...genFocusStyle(token),
"&:empty": {
padding: 0,
boxShadow: "none"
},
[`${menuCls}-item-group-title`]: {
padding: `${unit$1(paddingBlock)} ${unit$1(controlPaddingHorizontal)}`,
color: token.colorTextDescription,
transition: `all ${motionDurationMid}`
},
[`${menuCls}-item`]: {
position: "relative",
display: "flex",
alignItems: "center"
},
[`${menuCls}-item-icon`]: {
minWidth: fontSize,
marginInlineEnd: token.marginXS,
fontSize: token.fontSizeSM
},
[`${menuCls}-title-content`]: {
flex: "auto",
"&-with-extra": {
display: "inline-flex",
alignItems: "center",
width: "100%"
},
"> a": {
color: "inherit",
transition: `all ${motionDurationMid}`,
"&:hover": { color: "inherit" },
"&::after": {
position: "absolute",
inset: 0,
content: "\"\""
}
},
[`${menuCls}-item-extra`]: {
paddingInlineStart: token.padding,
marginInlineStart: "auto",
fontSize: token.fontSizeSM,
color: token.colorTextDescription
}
},
[`${menuCls}-item, ${menuCls}-submenu-title`]: {
display: "flex",
margin: 0,
padding: `${unit$1(paddingBlock)} ${unit$1(controlPaddingHorizontal)}`,
color: token.colorText,
fontWeight: "normal",
fontSize,
lineHeight: token.lineHeight,
cursor: "pointer",
transition: `all ${motionDurationMid}`,
borderRadius: token.borderRadiusSM,
"&:hover, &-active": { backgroundColor: token.controlItemBgHover },
...genFocusStyle(token),
"&-selected": {
color: token.colorPrimary,
backgroundColor: token.controlItemBgActive,
"&:hover, &-active": { backgroundColor: token.controlItemBgActiveHover }
},
"&-disabled": {
color: colorTextDisabled,
cursor: "not-allowed",
"&:hover": {
color: colorTextDisabled,
backgroundColor: colorBgElevated,
cursor: "not-allowed"
},
a: { pointerEvents: "none" }
},
"&-divider": {
height: 1,
margin: `${unit$1(token.marginXXS)} 0`,
overflow: "hidden",
lineHeight: 0,
backgroundColor: token.colorSplit
},
[`${componentCls}-menu-submenu-expand-icon`]: {
position: "absolute",
insetInlineEnd: token.paddingXS,
[`${componentCls}-menu-submenu-arrow-icon`]: {
marginInlineEnd: "0 !important",
color: token.colorIcon,
fontSize: fontSizeIcon,
fontStyle: "normal"
}
}
},
[`${menuCls}-item-group-list`]: {
margin: `0 ${unit$1(token.marginXS)}`,
padding: 0,
listStyle: "none"
},
[`${menuCls}-submenu-title`]: { paddingInlineEnd: token.calc(controlPaddingHorizontal).add(token.fontSizeSM).equal() },
[`${menuCls}-submenu-vertical`]: { position: "relative" },
[`${menuCls}-submenu${menuCls}-submenu-disabled ${componentCls}-menu-submenu-title`]: { [`&, ${componentCls}-menu-submenu-arrow-icon`]: {
color: colorTextDisabled,
backgroundColor: colorBgElevated,
cursor: "not-allowed"
} },
[`${menuCls}-submenu-selected ${componentCls}-menu-submenu-title`]: { color: token.colorPrimary }
}
}
},
[
initSlideMotion(token, "slide-up"),
initSlideMotion(token, "slide-down"),
initMoveMotion(token, "move-up"),
initMoveMotion(token, "move-down"),
initZoomMotion(token, "zoom-big")
]
];
};
var prepareComponentToken$39 = (token) => ({
zIndexPopup: token.zIndexPopupBase + 50,
paddingBlock: (token.controlHeight - token.fontSize * token.lineHeight) / 2,
...getArrowOffsetToken({
contentRadius: token.borderRadiusLG,
limitVerticalRadius: true
}),
...getArrowToken(token)
});
var style_default$44 = genStyleHooks("Dropdown", (token) => {
const { marginXXS, sizePopupArrow, paddingXXS, componentCls } = token;
const dropdownToken = merge(token, {
menuCls: `${componentCls}-menu`,
dropdownArrowDistance: token.calc(sizePopupArrow).div(2).add(marginXXS).equal(),
dropdownEdgeChildPadding: paddingXXS
});
return [genBaseStyle$11(dropdownToken), genStatusStyle$2(dropdownToken)];
}, prepareComponentToken$39, { resetStyle: false });
//#endregion
//#region node_modules/antd/es/dropdown/dropdown.js
var Dropdown$1 = (props) => {
const { menu, arrow, prefixCls: customizePrefixCls, children, trigger, disabled, dropdownRender, popupRender, getPopupContainer, overlayClassName, rootClassName, overlayStyle, open, onOpenChange, mouseEnterDelay = .15, mouseLeaveDelay = .1, autoAdjustOverflow = true, placement = "", transitionName, classNames, styles, destroyPopupOnHide, destroyOnHidden } = props;
const { getPrefixCls, direction, getPopupContainer: getContextPopupContainer, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("dropdown");
const mergedProps = {
...props,
mouseEnterDelay,
mouseLeaveDelay,
autoAdjustOverflow
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const mergedRootStyles = {
...contextStyle,
...overlayStyle,
...mergedStyles.root
};
const mergedPopupRender = popupRender || dropdownRender;
const warning = devUseWarning("Dropdown");
Object.entries({
dropdownRender: "popupRender",
destroyPopupOnHide: "destroyOnHidden",
overlayClassName: "classNames.root",
overlayStyle: "styles.root"
}).forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
if (placement.includes("Center")) warning.deprecated(!placement.includes("Center"), `placement: ${placement}`, `placement: ${placement.slice(0, placement.indexOf("Center"))}`);
const memoTransitionName = import_react.useMemo(() => {
const rootPrefixCls = getPrefixCls();
if (transitionName !== void 0) return transitionName;
if (placement.includes("top")) return `${rootPrefixCls}-slide-down`;
return `${rootPrefixCls}-slide-up`;
}, [
getPrefixCls,
placement,
transitionName
]);
const memoPlacement = import_react.useMemo(() => {
if (!placement) return direction === "rtl" ? "bottomRight" : "bottomLeft";
if (placement.includes("Center")) return placement.slice(0, placement.indexOf("Center"));
return placement;
}, [placement, direction]);
const prefixCls = getPrefixCls("dropdown", customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$44(prefixCls, rootCls);
const [, token] = useToken$1();
const child = import_react.Children.only(isPrimitive(children) ? /* @__PURE__ */ import_react.createElement("span", null, children) : children);
const popupTrigger = cloneElement$1(child, {
className: clsx(`${prefixCls}-trigger`, { [`${prefixCls}-rtl`]: direction === "rtl" }, child.props.className),
disabled: child.props.disabled ?? disabled
});
const triggerActions = disabled ? [] : trigger;
const alignPoint = !!triggerActions?.includes("contextMenu");
const [mergedOpen, setOpen] = useControlledState(false, open);
const onInnerOpenChange = useEvent((nextOpen) => {
onOpenChange?.(nextOpen, { source: "trigger" });
setOpen(nextOpen);
});
const overlayClassNameCustomized = clsx(overlayClassName, rootClassName, hashId, cssVarCls, rootCls, contextClassName, mergedClassNames.root, { [`${prefixCls}-rtl`]: direction === "rtl" });
const builtinPlacements = getPlacements$1({
arrowPointAtCenter: isPlainObject(arrow) && arrow.pointAtCenter,
autoAdjustOverflow,
offset: token.marginXXS,
arrowWidth: arrow ? token.sizePopupArrow : 0,
borderRadius: token.borderRadius
});
const onMenuClick = useEvent(() => {
if (menu?.selectable && menu?.multiple) return;
onOpenChange?.(false, { source: "menu" });
setOpen(false);
});
const renderOverlay = () => {
const menuClassNames = omit(mergedClassNames, ["root"]);
const menuStyles = omit(mergedStyles, ["root"]);
let overlayNode;
if (menu?.items) overlayNode = /* @__PURE__ */ import_react.createElement(Menu, {
...menu,
classNames: {
...menuClassNames,
subMenu: { ...menuClassNames }
},
styles: {
...menuStyles,
subMenu: { ...menuStyles }
}
});
if (mergedPopupRender) overlayNode = mergedPopupRender(overlayNode);
overlayNode = import_react.Children.only(typeof overlayNode === "string" ? /* @__PURE__ */ import_react.createElement("span", null, overlayNode) : overlayNode);
return /* @__PURE__ */ import_react.createElement(OverrideProvider, {
prefixCls: `${prefixCls}-menu`,
rootClassName: clsx(cssVarCls, rootCls),
expandIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-menu-submenu-arrow` }, direction === "rtl" ? /* @__PURE__ */ import_react.createElement(RefIcon$12, { className: `${prefixCls}-menu-submenu-arrow-icon` }) : /* @__PURE__ */ import_react.createElement(RefIcon$6, { className: `${prefixCls}-menu-submenu-arrow-icon` })),
mode: "vertical",
selectable: false,
onClick: onMenuClick,
validator: ({ mode }) => {
warning(!mode || mode === "vertical", "usage", `mode="${mode}" is not supported for Dropdown's Menu.`);
}
}, overlayNode);
};
const [zIndex, contextZIndex] = useZIndex("Dropdown", mergedRootStyles.zIndex);
let renderNode = /* @__PURE__ */ import_react.createElement(es_default$18, {
alignPoint,
...omit(props, ["rootClassName", "onOpenChange"]),
mouseEnterDelay,
mouseLeaveDelay,
visible: mergedOpen,
builtinPlacements,
arrow: !!arrow,
overlayClassName: overlayClassNameCustomized,
prefixCls,
getPopupContainer: getPopupContainer || getContextPopupContainer,
transitionName: memoTransitionName,
trigger: triggerActions,
overlay: renderOverlay,
placement: memoPlacement,
onVisibleChange: onInnerOpenChange,
overlayStyle: {
...mergedRootStyles,
zIndex
},
autoDestroy: destroyOnHidden ?? destroyPopupOnHide
}, popupTrigger);
if (zIndex) renderNode = /* @__PURE__ */ import_react.createElement(ZIndexContext.Provider, { value: contextZIndex }, renderNode);
return renderNode;
};
var PurePanel$8 = genPurePanel(Dropdown$1, "align", void 0, "dropdown", (prefixCls) => prefixCls);
/* istanbul ignore next */
var WrapPurePanel = (props) => /* @__PURE__ */ import_react.createElement(PurePanel$8, { ...props }, /* @__PURE__ */ import_react.createElement("span", null));
Dropdown$1._InternalPanelDoNotUseOrYouWillBeFired = WrapPurePanel;
Dropdown$1.displayName = "Dropdown";
//#endregion
//#region node_modules/antd/es/breadcrumb/BreadcrumbSeparator.js
var BreadcrumbSeparator = ({ children }) => {
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("breadcrumb");
const { classNames: mergedClassNames, styles: mergedStyles } = import_react.useContext(BreadcrumbContext);
return /* @__PURE__ */ import_react.createElement("li", {
className: clsx(`${prefixCls}-separator`, mergedClassNames?.separator),
style: mergedStyles?.separator,
"aria-hidden": "true"
}, children === "" ? children : children || "/");
};
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
//#endregion
//#region node_modules/antd/es/breadcrumb/useItemRender.js
function getBreadcrumbName(route, params) {
if (!isNonNullable(route.title)) return null;
const paramsKeys = Object.keys(params).join("|");
return isPlainObject(route.title) ? route.title : String(route.title).replace(new RegExp(`:(${paramsKeys})`, "g"), (replacement, key) => params[key] || replacement);
}
function renderItem(prefixCls, item, children, href) {
if (!isNonNullable(children)) return null;
const { className, onClick, ...restItem } = item;
const passedProps = {
...pickAttrs(restItem, {
data: true,
aria: true
}),
onClick
};
if (href !== void 0) return /* @__PURE__ */ import_react.createElement("a", {
...passedProps,
className: clsx(`${prefixCls}-link`, className),
href
}, children);
return /* @__PURE__ */ import_react.createElement("span", {
...passedProps,
className: clsx(`${prefixCls}-link`, className)
}, children);
}
function useItemRender(prefixCls, itemRender) {
const mergedItemRender = (item, params, routes, path, href) => {
if (itemRender) return itemRender(item, params, routes, path);
return renderItem(prefixCls, item, getBreadcrumbName(item, params), href);
};
return mergedItemRender;
}
//#endregion
//#region node_modules/antd/es/breadcrumb/BreadcrumbItem.js
var InternalBreadcrumbItem = (props) => {
const { prefixCls, separator = "/", children, menu, dropdownProps, href, dropdownIcon } = props;
const { classNames: mergedClassNames, styles: mergedStyles } = import_react.useContext(BreadcrumbContext);
/** If overlay is have Wrap a Dropdown */
const renderBreadcrumbNode = (breadcrumbItem) => {
if (menu) {
const mergeDropDownProps = { ...dropdownProps };
if (menu) {
const { items, ...menuProps } = menu || {};
mergeDropDownProps.menu = {
...menuProps,
items: items?.map(({ key, title, label, path, ...itemProps }, index) => {
let mergedLabel = label ?? title;
if (path) mergedLabel = /* @__PURE__ */ import_react.createElement("a", { href: `${href}${path}` }, mergedLabel);
return {
...itemProps,
key: key ?? index,
label: mergedLabel
};
})
};
}
return /* @__PURE__ */ import_react.createElement(Dropdown$1, {
placement: "bottom",
...mergeDropDownProps
}, /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-overlay-link` }, breadcrumbItem, dropdownIcon));
}
return breadcrumbItem;
};
const link = renderBreadcrumbNode(children);
if (isNonNullable(link)) return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("li", {
className: clsx(`${prefixCls}-item`, mergedClassNames?.item),
style: mergedStyles?.item
}, link), separator && /* @__PURE__ */ import_react.createElement(BreadcrumbSeparator, null, separator));
return null;
};
var BreadcrumbItem = (props) => {
const { prefixCls: customizePrefixCls, children, href, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("breadcrumb", customizePrefixCls);
return /* @__PURE__ */ import_react.createElement(InternalBreadcrumbItem, {
...restProps,
prefixCls
}, renderItem(prefixCls, restProps, children, href));
};
BreadcrumbItem.__ANT_BREADCRUMB_ITEM = true;
//#endregion
//#region node_modules/antd/es/breadcrumb/style/index.js
var genBreadcrumbStyle = (token) => {
const { componentCls, iconCls, calc } = token;
return { [componentCls]: {
...resetComponent(token),
color: token.itemColor,
fontSize: token.fontSize,
[iconCls]: { fontSize: token.iconFontSize },
ol: {
display: "flex",
flexWrap: "wrap",
margin: 0,
padding: 0,
listStyle: "none"
},
[`${componentCls}-item a`]: {
color: token.linkColor,
transition: `color ${token.motionDurationMid}`,
padding: `0 ${unit$1(token.paddingXXS)}`,
borderRadius: token.borderRadiusSM,
height: token.fontHeight,
display: "inline-block",
marginInline: calc(token.marginXXS).mul(-1).equal(),
"&:hover": {
color: token.linkHoverColor,
backgroundColor: token.colorBgTextHover
},
...genFocusStyle(token)
},
[`${componentCls}-item:last-child`]: { color: token.lastItemColor },
[`${componentCls}-separator`]: {
marginInline: token.separatorMargin,
color: token.separatorColor
},
[`${componentCls}-link`]: { [`
> ${iconCls} + span,
> ${iconCls} + a
`]: { marginInlineStart: token.marginXXS } },
[`${componentCls}-overlay-link`]: {
borderRadius: token.borderRadiusSM,
height: token.fontHeight,
display: "inline-block",
padding: `0 ${unit$1(token.paddingXXS)}`,
marginInline: calc(token.marginXXS).mul(-1).equal(),
[`> ${iconCls}`]: {
marginInlineStart: token.marginXXS,
fontSize: token.fontSizeIcon
},
"&:hover": {
color: token.linkHoverColor,
backgroundColor: token.colorBgTextHover,
a: { color: token.linkHoverColor }
},
a: { "&:hover": { backgroundColor: "transparent" } }
},
[`&${token.componentCls}-rtl`]: { direction: "rtl" }
} };
};
var prepareComponentToken$38 = (token) => ({
itemColor: token.colorTextDescription,
lastItemColor: token.colorText,
iconFontSize: token.fontSize,
linkColor: token.colorTextDescription,
linkHoverColor: token.colorText,
separatorColor: token.colorTextDescription,
separatorMargin: token.marginXS
});
var style_default$43 = genStyleHooks("Breadcrumb", (token) => {
return genBreadcrumbStyle(merge(token, {}));
}, prepareComponentToken$38);
//#endregion
//#region node_modules/antd/es/breadcrumb/useItems.js
function route2item(route) {
const { breadcrumbName, children, ...rest } = route;
const clone = {
title: breadcrumbName,
...rest
};
if (children) clone.menu = { items: children.map(({ breadcrumbName: itemBreadcrumbName, ...itemProps }) => ({
...itemProps,
title: itemBreadcrumbName
})) };
return clone;
}
function useItems$3(items, routes) {
return (0, import_react.useMemo)(() => {
if (items) return items;
if (routes) return routes.map(route2item);
return null;
}, [items, routes]);
}
//#endregion
//#region node_modules/antd/es/breadcrumb/Breadcrumb.js
var getPath = (params, path) => {
if (path === void 0) return path;
let mergedPath = (path || "").replace(/^\//, "");
Object.keys(params).forEach((key) => {
mergedPath = mergedPath.replace(`:${key}`, params[key]);
});
return mergedPath;
};
var Breadcrumb$1 = (props) => {
const { prefixCls: customizePrefixCls, separator, style, className, rootClassName, routes: legacyRoutes, items, children, itemRender, params = {}, classNames, styles, dropdownIcon, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, separator: contextSeparator, dropdownIcon: contextDropdownIcon } = useComponentConfig("breadcrumb");
const mergedSeparator = separator ?? contextSeparator ?? "/";
const mergedDropdownIcon = dropdownIcon ?? contextDropdownIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$8, null);
let crumbs;
const prefixCls = getPrefixCls("breadcrumb", customizePrefixCls);
const [hashId, cssVarCls] = style_default$43(prefixCls);
const mergedItems = useItems$3(items, legacyRoutes);
const mergedProps = import_react.useMemo(() => {
return {
...props,
separator: mergedSeparator
};
}, [props, mergedSeparator]);
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
{
const warning = devUseWarning("Breadcrumb");
warning.deprecated(!legacyRoutes, "routes", "items");
if (!mergedItems || mergedItems.length === 0) {
const childList = toArray$8(children);
warning.deprecated(childList.length === 0, "Breadcrumb.Item and Breadcrumb.Separator", "items");
childList.forEach((element) => {
if (element) warning(element.type && (element.type.__ANT_BREADCRUMB_ITEM === true || element.type.__ANT_BREADCRUMB_SEPARATOR === true), "usage", "Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children");
});
}
}
const mergedItemRender = useItemRender(prefixCls, itemRender);
if (mergedItems && mergedItems.length > 0) {
const paths = [];
const itemRenderRoutes = items || legacyRoutes;
crumbs = mergedItems.map((item, index) => {
const { path, key, type, menu, onClick, className: itemClassName, style, separator: itemSeparator, dropdownProps } = item;
const mergedPath = getPath(params, path);
if (mergedPath !== void 0) paths.push(mergedPath);
const mergedKey = key ?? index;
if (type === "separator") return /* @__PURE__ */ import_react.createElement(BreadcrumbSeparator, { key: mergedKey }, itemSeparator);
const itemProps = {};
const isLastItem = index === mergedItems.length - 1;
if (menu) itemProps.menu = menu;
let { href } = item;
if (paths.length && mergedPath !== void 0) href = `#/${paths.join("/")}`;
return /* @__PURE__ */ import_react.createElement(InternalBreadcrumbItem, {
key: mergedKey,
...itemProps,
...pickAttrs(item, {
data: true,
aria: true
}),
className: itemClassName,
style,
dropdownProps,
dropdownIcon: mergedDropdownIcon,
href,
separator: isLastItem ? "" : mergedSeparator,
onClick,
prefixCls
}, mergedItemRender(item, params, itemRenderRoutes, paths, href));
});
} else if (children) {
const childrenLength = toArray$8(children).length;
crumbs = toArray$8(children).map((element, index) => {
if (!element) return element;
return cloneElement$1(element, {
separator: index === childrenLength - 1 ? "" : mergedSeparator,
key: index
});
});
}
const breadcrumbClassName = clsx(prefixCls, contextClassName, { [`${prefixCls}-rtl`]: direction === "rtl" }, className, rootClassName, mergedClassNames.root, hashId, cssVarCls);
const mergedStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
const memoizedValue = import_react.useMemo(() => ({
classNames: mergedClassNames,
styles: mergedStyles
}), [mergedClassNames, mergedStyles]);
return /* @__PURE__ */ import_react.createElement(BreadcrumbContext.Provider, { value: memoizedValue }, /* @__PURE__ */ import_react.createElement("nav", {
className: breadcrumbClassName,
style: mergedStyle,
...restProps
}, /* @__PURE__ */ import_react.createElement("ol", null, crumbs)));
};
Breadcrumb$1.displayName = "Breadcrumb";
//#endregion
//#region node_modules/antd/es/breadcrumb/index.js
var Breadcrumb = Breadcrumb$1;
Breadcrumb.Item = BreadcrumbItem;
Breadcrumb.Separator = BreadcrumbSeparator;
//#endregion
//#region node_modules/antd/es/button/index.js
var button_default = Button;
//#endregion
//#region node_modules/dayjs/dayjs.min.js
var require_dayjs_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
(function(t, e) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
})(exports, (function() {
"use strict";
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = {
name: "en",
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
ordinal: function(t) {
var e = [
"th",
"st",
"nd",
"rd"
], n = t % 100;
return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
}
}, m = function(t, e, n) {
var r = String(t);
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
}, v = {
s: m,
z: function(t) {
var e = -t.utcOffset(), n = Math.abs(e), r = Math.floor(n / 60), i = n % 60;
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
},
m: function t(e, n) {
if (e.date() < n.date()) return -t(n, e);
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), i = e.clone().add(r, c), s = n - i < 0, u = e.clone().add(r + (s ? -1 : 1), c);
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
},
a: function(t) {
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
},
p: function(t) {
return {
M: c,
y: h,
w: o,
d: a,
D: d,
h: u,
m: s,
s: i,
ms: r,
Q: f
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
},
u: function(t) {
return void 0 === t;
}
}, g = "en", D = {};
D[g] = M;
var p = "$isDayjsObject", S = function(t) {
return t instanceof _ || !(!t || !t[p]);
}, w = function t(e, n, r) {
var i;
if (!e) return g;
if ("string" == typeof e) {
var s = e.toLowerCase();
D[s] && (i = s), n && (D[s] = n, i = s);
var u = e.split("-");
if (!i && u.length > 1) return t(u[0]);
} else {
var a = e.name;
D[a] = e, i = a;
}
return !r && i && (g = i), i || !r && g;
}, O = function(t, e) {
if (S(t)) return t.clone();
var n = "object" == typeof e ? e : {};
return n.date = t, n.args = arguments, new _(n);
}, b = v;
b.l = w, b.i = S, b.w = function(t, e) {
return O(t, {
locale: e.$L,
utc: e.$u,
x: e.$x,
$offset: e.$offset
});
};
var _ = function() {
function M(t) {
this.$L = w(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[p] = !0;
}
var m = M.prototype;
return m.parse = function(t) {
this.$d = function(t) {
var e = t.date, n = t.utc;
if (null === e) return /* @__PURE__ */ new Date(NaN);
if (b.u(e)) return /* @__PURE__ */ new Date();
if (e instanceof Date) return new Date(e);
if ("string" == typeof e && !/Z$/i.test(e)) {
var r = e.match($);
if (r) {
var i = r[2] - 1 || 0, s = (r[7] || "0").substring(0, 3);
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
}
}
return new Date(e);
}(t), this.init();
}, m.init = function() {
var t = this.$d;
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
}, m.$utils = function() {
return b;
}, m.isValid = function() {
return !(this.$d.toString() === l);
}, m.isSame = function(t, e) {
var n = O(t);
return this.startOf(e) <= n && n <= this.endOf(e);
}, m.isAfter = function(t, e) {
return O(t) < this.startOf(e);
}, m.isBefore = function(t, e) {
return this.endOf(e) < O(t);
}, m.$g = function(t, e, n) {
return b.u(t) ? this[e] : this.set(n, t);
}, m.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, m.valueOf = function() {
return this.$d.getTime();
}, m.startOf = function(t, e) {
var n = this, r = !!b.u(e) || e, f = b.p(t), l = function(t, e) {
var i = b.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
return r ? i : i.endOf(a);
}, $ = function(t, e) {
return b.w(n.toDate()[t].apply(n.toDate("s"), (r ? [
0,
0,
0,
0
] : [
23,
59,
59,
999
]).slice(e)), n);
}, y = this.$W, M = this.$M, m = this.$D, v = "set" + (this.$u ? "UTC" : "");
switch (f) {
case h: return r ? l(1, 0) : l(31, 11);
case c: return r ? l(1, M) : l(0, M + 1);
case o:
var g = this.$locale().weekStart || 0, D = (y < g ? y + 7 : y) - g;
return l(r ? m - D : m + (6 - D), M);
case a:
case d: return $(v + "Hours", 0);
case u: return $(v + "Minutes", 1);
case s: return $(v + "Seconds", 2);
case i: return $(v + "Milliseconds", 3);
default: return this.clone();
}
}, m.endOf = function(t) {
return this.startOf(t, !1);
}, m.$set = function(t, e) {
var n, o = b.p(t), f = "set" + (this.$u ? "UTC" : ""), l = (n = {}, n[a] = f + "Date", n[d] = f + "Date", n[c] = f + "Month", n[h] = f + "FullYear", n[u] = f + "Hours", n[s] = f + "Minutes", n[i] = f + "Seconds", n[r] = f + "Milliseconds", n)[o], $ = o === a ? this.$D + (e - this.$W) : e;
if (o === c || o === h) {
var y = this.clone().set(d, 1);
y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
} else l && this.$d[l]($);
return this.init(), this;
}, m.set = function(t, e) {
return this.clone().$set(t, e);
}, m.get = function(t) {
return this[b.p(t)]();
}, m.add = function(r, f) {
var d, l = this;
r = Number(r);
var $ = b.p(f), y = function(t) {
var e = O(l);
return b.w(e.date(e.date() + Math.round(t * r)), l);
};
if ($ === c) return this.set(c, this.$M + r);
if ($ === h) return this.set(h, this.$y + r);
if ($ === a) return y(1);
if ($ === o) return y(7);
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, m = this.$d.getTime() + r * M;
return b.w(m, this);
}, m.subtract = function(t, e) {
return this.add(-1 * t, e);
}, m.format = function(t) {
var e = this, n = this.$locale();
if (!this.isValid()) return n.invalidDate || l;
var r = t || "YYYY-MM-DDTHH:mm:ssZ", i = b.z(this), s = this.$H, u = this.$m, a = this.$M, o = n.weekdays, c = n.months, f = n.meridiem, h = function(t, n, i, s) {
return t && (t[n] || t(e, r)) || i[n].slice(0, s);
}, d = function(t) {
return b.s(s % 12 || 12, t, "0");
}, $ = f || function(t, e, n) {
var r = t < 12 ? "AM" : "PM";
return n ? r.toLowerCase() : r;
};
return r.replace(y, (function(t, r) {
return r || function(t) {
switch (t) {
case "YY": return String(e.$y).slice(-2);
case "YYYY": return b.s(e.$y, 4, "0");
case "M": return a + 1;
case "MM": return b.s(a + 1, 2, "0");
case "MMM": return h(n.monthsShort, a, c, 3);
case "MMMM": return h(c, a);
case "D": return e.$D;
case "DD": return b.s(e.$D, 2, "0");
case "d": return String(e.$W);
case "dd": return h(n.weekdaysMin, e.$W, o, 2);
case "ddd": return h(n.weekdaysShort, e.$W, o, 3);
case "dddd": return o[e.$W];
case "H": return String(s);
case "HH": return b.s(s, 2, "0");
case "h": return d(1);
case "hh": return d(2);
case "a": return $(s, u, !0);
case "A": return $(s, u, !1);
case "m": return String(u);
case "mm": return b.s(u, 2, "0");
case "s": return String(e.$s);
case "ss": return b.s(e.$s, 2, "0");
case "SSS": return b.s(e.$ms, 3, "0");
case "Z": return i;
}
return null;
}(t) || i.replace(":", "");
}));
}, m.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, m.diff = function(r, d, l) {
var $, y = this, M = b.p(d), m = O(r), v = (m.utcOffset() - this.utcOffset()) * e, g = this - m, D = function() {
return b.m(y, m);
};
switch (M) {
case h:
$ = D() / 12;
break;
case c:
$ = D();
break;
case f:
$ = D() / 3;
break;
case o:
$ = (g - v) / 6048e5;
break;
case a:
$ = (g - v) / 864e5;
break;
case u:
$ = g / n;
break;
case s:
$ = g / e;
break;
case i:
$ = g / t;
break;
default: $ = g;
}
return l ? $ : b.a($);
}, m.daysInMonth = function() {
return this.endOf(c).$D;
}, m.$locale = function() {
return D[this.$L];
}, m.locale = function(t, e) {
if (!t) return this.$L;
var n = this.clone(), r = w(t, e, !0);
return r && (n.$L = r), n;
}, m.clone = function() {
return b.w(this.$d, this);
}, m.toDate = function() {
return new Date(this.valueOf());
}, m.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, m.toISOString = function() {
return this.$d.toISOString();
}, m.toString = function() {
return this.$d.toUTCString();
}, M;
}(), k = _.prototype;
return O.prototype = k, [
["$ms", r],
["$s", i],
["$m", s],
["$H", u],
["$W", a],
["$M", c],
["$y", h],
["$D", d]
].forEach((function(t) {
k[t[1]] = function(e) {
return this.$g(e, t[0], t[1]);
};
})), O.extend = function(t, e) {
return t.$i || (t(e, _, O), t.$i = !0), O;
}, O.locale = w, O.isDayjs = S, O.unix = function(t) {
return O(1e3 * t);
}, O.en = D[g], O.Ls = D, O.p = {}, O;
}));
}));
//#endregion
//#region node_modules/dayjs/plugin/weekday.js
var require_weekday = /* @__PURE__ */ __commonJSMin(((exports, module) => {
(function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekday = t();
})(exports, (function() {
"use strict";
return function(e, t) {
t.prototype.weekday = function(e) {
var t = this.$locale().weekStart || 0, i = this.$W, n = (i < t ? i + 7 : i) - t;
return this.$utils().u(e) ? n : this.subtract(n, "day").add(e, "day");
};
};
}));
}));
//#endregion
//#region node_modules/dayjs/plugin/localeData.js
var require_localeData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
(function(n, e) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (n = "undefined" != typeof globalThis ? globalThis : n || self).dayjs_plugin_localeData = e();
})(exports, (function() {
"use strict";
return function(n, e, t) {
var r = e.prototype, o = function(n) {
return n && (n.indexOf ? n : n.s);
}, u = function(n, e, t, r, u) {
var i = n.name ? n : n.$locale(), a = o(i[e]), s = o(i[t]), f = a || s.map((function(n) {
return n.slice(0, r);
}));
if (!u) return f;
var d = i.weekStart;
return f.map((function(n, e) {
return f[(e + (d || 0)) % 7];
}));
}, i = function() {
return t.Ls[t.locale()];
}, a = function(n, e) {
return n.formats[e] || function(n) {
return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(n, e, t) {
return e || t.slice(1);
}));
}(n.formats[e.toUpperCase()]);
}, s = function() {
var n = this;
return {
months: function(e) {
return e ? e.format("MMMM") : u(n, "months");
},
monthsShort: function(e) {
return e ? e.format("MMM") : u(n, "monthsShort", "months", 3);
},
firstDayOfWeek: function() {
return n.$locale().weekStart || 0;
},
weekdays: function(e) {
return e ? e.format("dddd") : u(n, "weekdays");
},
weekdaysMin: function(e) {
return e ? e.format("dd") : u(n, "weekdaysMin", "weekdays", 2);
},
weekdaysShort: function(e) {
return e ? e.format("ddd") : u(n, "weekdaysShort", "weekdays", 3);
},
longDateFormat: function(e) {
return a(n.$locale(), e);
},
meridiem: this.$locale().meridiem,
ordinal: this.$locale().ordinal
};
};
r.localeData = function() {
return s.bind(this)();
}, t.localeData = function() {
var n = i();
return {
firstDayOfWeek: function() {
return n.weekStart || 0;
},
weekdays: function() {
return t.weekdays();
},
weekdaysShort: function() {
return t.weekdaysShort();
},
weekdaysMin: function() {
return t.weekdaysMin();
},
months: function() {
return t.months();
},
monthsShort: function() {
return t.monthsShort();
},
longDateFormat: function(e) {
return a(n, e);
},
meridiem: n.meridiem,
ordinal: n.ordinal
};
}, t.months = function() {
return u(i(), "months");
}, t.monthsShort = function() {
return u(i(), "monthsShort", "months", 3);
}, t.weekdays = function(n) {
return u(i(), "weekdays", null, null, n);
}, t.weekdaysShort = function(n) {
return u(i(), "weekdaysShort", "weekdays", 3, n);
}, t.weekdaysMin = function(n) {
return u(i(), "weekdaysMin", "weekdays", 2, n);
};
};
}));
}));
//#endregion
//#region node_modules/dayjs/plugin/weekOfYear.js
var require_weekOfYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
(function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekOfYear = t();
})(exports, (function() {
"use strict";
var e = "week", t = "year";
return function(i, n, r) {
var f = n.prototype;
f.week = function(i) {
if (void 0 === i && (i = null), null !== i) return this.add(7 * (i - this.week()), "day");
var n = this.$locale().yearStart || 1;
if (11 === this.month() && this.date() > 25) {
var f = r(this).startOf(t).add(1, t).date(n), s = r(this).endOf(e);
if (f.isBefore(s)) return 1;
}
var a = r(this).startOf(t).date(n).startOf(e).subtract(1, "millisecond"), o = this.diff(a, e, !0);
return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
}, f.weeks = function(e) {
return void 0 === e && (e = null), this.week(e);
};
};
}));
}));
//#endregion
//#region node_modules/dayjs/plugin/weekYear.js
var require_weekYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
(function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekYear = t();
})(exports, (function() {
"use strict";
return function(e, t) {
t.prototype.weekYear = function() {
var e = this.month(), t = this.week(), n = this.year();
return 1 === t && 11 === e ? n + 1 : 0 === e && t >= 52 ? n - 1 : n;
};
};
}));
}));
//#endregion
//#region node_modules/dayjs/plugin/advancedFormat.js
var require_advancedFormat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
(function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_advancedFormat = t();
})(exports, (function() {
"use strict";
return function(e, t) {
var r = t.prototype, n = r.format;
r.format = function(e) {
var t = this, r = this.$locale();
if (!this.isValid()) return n.bind(this)(e);
var s = this.$utils(), a = (e || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e) {
switch (e) {
case "Q": return Math.ceil((t.$M + 1) / 3);
case "Do": return r.ordinal(t.$D);
case "gggg": return t.weekYear();
case "GGGG": return t.isoWeekYear();
case "wo": return r.ordinal(t.week(), "W");
case "w":
case "ww": return s.s(t.week(), "w" === e ? 1 : 2, "0");
case "W":
case "WW": return s.s(t.isoWeek(), "W" === e ? 1 : 2, "0");
case "k":
case "kk": return s.s(String(0 === t.$H ? 24 : t.$H), "k" === e ? 1 : 2, "0");
case "X": return Math.floor(t.$d.getTime() / 1e3);
case "x": return t.$d.getTime();
case "z": return "[" + t.offsetName() + "]";
case "zzz": return "[" + t.offsetName("long") + "]";
default: return e;
}
}));
return n.bind(this)(a);
};
};
}));
}));
//#endregion
//#region node_modules/dayjs/plugin/customParseFormat.js
var require_customParseFormat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
(function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
})(exports, (function() {
"use strict";
var e = {
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"
}, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e) {
return (e = +e) + (e > 68 ? 1900 : 2e3);
};
var f = function(e) {
return function(t) {
this[e] = +t;
};
}, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e) {
(this.zone || (this.zone = {})).offset = function(e) {
if (!e) return 0;
if ("Z" === e) return 0;
var t = e.match(/([+-]|\d\d)/g), n = 60 * t[1] + (+t[2] || 0);
return 0 === n ? 0 : "+" === t[0] ? -n : n;
}(e);
}], u = function(e) {
var t = s[e];
return t && (t.indexOf ? t : t.s.concat(t.f));
}, d = function(e, t) {
var n, r = s.meridiem;
if (r) {
for (var i = 1; i <= 24; i += 1) if (e.indexOf(r(i, 0, t)) > -1) {
n = i > 12;
break;
}
} else n = e === (t ? "pm" : "PM");
return n;
}, c = {
A: [o, function(e) {
this.afternoon = d(e, !1);
}],
a: [o, function(e) {
this.afternoon = d(e, !0);
}],
Q: [n, function(e) {
this.month = 3 * (e - 1) + 1;
}],
S: [n, function(e) {
this.milliseconds = 100 * +e;
}],
SS: [r, function(e) {
this.milliseconds = 10 * +e;
}],
SSS: [/\d{3}/, function(e) {
this.milliseconds = +e;
}],
s: [i, f("seconds")],
ss: [i, f("seconds")],
m: [i, f("minutes")],
mm: [i, f("minutes")],
H: [i, f("hours")],
h: [i, f("hours")],
HH: [i, f("hours")],
hh: [i, f("hours")],
D: [i, f("day")],
DD: [r, f("day")],
Do: [o, function(e) {
var t = s.ordinal, n = e.match(/\d+/);
if (this.day = n[0], t) for (var r = 1; r <= 31; r += 1) t(r).replace(/\[|\]/g, "") === e && (this.day = r);
}],
w: [i, f("week")],
ww: [r, f("week")],
M: [i, f("month")],
MM: [r, f("month")],
MMM: [o, function(e) {
var t = u("months"), n = (u("monthsShort") || t.map((function(e) {
return e.slice(0, 3);
}))).indexOf(e) + 1;
if (n < 1) throw new Error();
this.month = n % 12 || n;
}],
MMMM: [o, function(e) {
var t = u("months").indexOf(e) + 1;
if (t < 1) throw new Error();
this.month = t % 12 || t;
}],
Y: [/[+-]?\d+/, f("year")],
YY: [r, function(e) {
this.year = a(e);
}],
YYYY: [/\d{4}/, f("year")],
Z: h,
ZZ: h
};
function l(n) {
var r = n, i = s && s.formats;
for (var o = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t, n, r) {
var o = r && r.toUpperCase();
return n || i[r] || e[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e, t, n) {
return t || n.slice(1);
}));
}))).match(t), a = o.length, f = 0; f < a; f += 1) {
var h = o[f], u = c[h], d = u && u[0], l = u && u[1];
o[f] = l ? {
regex: d,
parser: l
} : h.replace(/^\[|\]$/g, "");
}
return function(e) {
for (var t = {}, n = 0, r = 0; n < a; n += 1) {
var i = o[n];
if ("string" == typeof i) r += i.length;
else {
var s = i.regex, f = i.parser, h = e.slice(r), u = s.exec(h)[0];
f.call(t, u), e = e.replace(u, "");
}
}
return function(e) {
var t = e.afternoon;
if (void 0 !== t) {
var n = e.hours;
t ? n < 12 && (e.hours += 12) : 12 === n && (e.hours = 0), delete e.afternoon;
}
}(t), t;
};
}
return function(e, t, n) {
n.p.customParseFormat = !0, e && e.parseTwoDigitYear && (a = e.parseTwoDigitYear);
var r = t.prototype, i = r.parse;
r.parse = function(e) {
var t = e.date, r = e.utc, o = e.args;
this.$u = r;
var a = o[1];
if ("string" == typeof a) {
var f = !0 === o[2], h = !0 === o[3], u = f || h, d = o[2];
h && (d = o[2]), s = this.$locale(), !f && d && (s = n.Ls[d]), this.$d = function(e, t, n, r) {
try {
if (["x", "X"].indexOf(t) > -1) return /* @__PURE__ */ new Date(("X" === t ? 1e3 : 1) * e);
var i = l(t)(e), o = i.year, s = i.month, a = i.day, f = i.hours, h = i.minutes, u = i.seconds, d = i.milliseconds, c = i.zone, m = i.week, M = /* @__PURE__ */ new Date(), Y = a || (o || s ? 1 : M.getDate()), p = o || M.getFullYear(), v = 0;
o && !s || (v = s > 0 ? s - 1 : M.getMonth());
var D, w = f || 0, g = h || 0, y = u || 0, L = d || 0;
return c ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c.offset * 1e3)) : n ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m && (D = r(D).week(m).toDate()), D);
} catch (e) {
return /* @__PURE__ */ new Date("");
}
}(t, a, r, n), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), u && t != this.format(a) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
} else if (a instanceof Array) for (var c = a.length, m = 1; m <= c; m += 1) {
o[1] = a[m - 1];
var M = n.apply(this, o);
if (M.isValid()) {
this.$d = M.$d, this.$L = M.$L, this.init();
break;
}
m === c && (this.$d = /* @__PURE__ */ new Date(""));
}
else i.call(this, e);
};
};
}));
}));
//#endregion
//#region node_modules/@rc-component/picker/es/generate/dayjs.js
var import_dayjs_min = /* @__PURE__ */ __toESM(require_dayjs_min());
var import_weekday = /* @__PURE__ */ __toESM(require_weekday());
var import_localeData = /* @__PURE__ */ __toESM(require_localeData());
var import_weekOfYear = /* @__PURE__ */ __toESM(require_weekOfYear());
var import_weekYear = /* @__PURE__ */ __toESM(require_weekYear());
var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
var import_customParseFormat = /* @__PURE__ */ __toESM(require_customParseFormat());
import_dayjs_min.default.extend(import_customParseFormat.default);
import_dayjs_min.default.extend(import_advancedFormat.default);
import_dayjs_min.default.extend(import_weekday.default);
import_dayjs_min.default.extend(import_localeData.default);
import_dayjs_min.default.extend(import_weekOfYear.default);
import_dayjs_min.default.extend(import_weekYear.default);
import_dayjs_min.default.extend(function(o, c) {
var proto = c.prototype;
var oldFormat = proto.format;
proto.format = function f(formatStr) {
var str = (formatStr || "").replace("Wo", "wo");
return oldFormat.bind(this)(str);
};
});
var localeMap = {
bn_BD: "bn-bd",
by_BY: "be",
en_GB: "en-gb",
en_US: "en",
fr_BE: "fr",
fr_CA: "fr-ca",
hy_AM: "hy-am",
kmr_IQ: "ku",
nl_BE: "nl-be",
pt_BR: "pt-br",
zh_CN: "zh-cn",
zh_HK: "zh-hk",
zh_TW: "zh-tw"
};
var parseLocale = function parseLocale(locale) {
return localeMap[locale] || locale.split("_")[0];
};
var getUDayjs = function getUDayjs(value) {
if (!import_dayjs_min.default.isDayjs(value) || value instanceof import_dayjs_min.default) return value;
return (0, import_dayjs_min.default)(value.valueOf());
};
var generateConfig = {
getNow: function getNow() {
var now = (0, import_dayjs_min.default)();
if (typeof now.tz === "function") return now.tz();
return now;
},
getFixedDate: function getFixedDate(string) {
return (0, import_dayjs_min.default)(string, ["YYYY-M-DD", "YYYY-MM-DD"]);
},
getEndDate: function getEndDate(date) {
return getUDayjs(date).endOf("month");
},
getWeekDay: function getWeekDay(date) {
var clone = getUDayjs(date).locale("en");
return clone.weekday() + clone.localeData().firstDayOfWeek();
},
getYear: function getYear(date) {
return getUDayjs(date).year();
},
getMonth: function getMonth(date) {
return getUDayjs(date).month();
},
getDate: function getDate(date) {
return getUDayjs(date).date();
},
getHour: function getHour(date) {
return getUDayjs(date).hour();
},
getMinute: function getMinute(date) {
return getUDayjs(date).minute();
},
getSecond: function getSecond(date) {
return getUDayjs(date).second();
},
getMillisecond: function getMillisecond(date) {
return getUDayjs(date).millisecond();
},
addYear: function addYear(date, diff) {
return getUDayjs(date).add(diff, "year");
},
addMonth: function addMonth(date, diff) {
return getUDayjs(date).add(diff, "month");
},
addDate: function addDate(date, diff) {
return getUDayjs(date).add(diff, "day");
},
setYear: function setYear(date, year) {
return getUDayjs(date).year(year);
},
setMonth: function setMonth(date, month) {
return getUDayjs(date).month(month);
},
setDate: function setDate(date, num) {
return getUDayjs(date).date(num);
},
setHour: function setHour(date, hour) {
return getUDayjs(date).hour(hour);
},
setMinute: function setMinute(date, minute) {
return getUDayjs(date).minute(minute);
},
setSecond: function setSecond(date, second) {
return getUDayjs(date).second(second);
},
setMillisecond: function setMillisecond(date, milliseconds) {
return getUDayjs(date).millisecond(milliseconds);
},
isAfter: function isAfter(date1, date2) {
return getUDayjs(date1).isAfter(getUDayjs(date2));
},
isValidate: function isValidate(date) {
return getUDayjs(date).isValid();
},
locale: {
getWeekFirstDay: function getWeekFirstDay(locale) {
return (0, import_dayjs_min.default)().locale(parseLocale(locale)).localeData().firstDayOfWeek();
},
getWeekFirstDate: function getWeekFirstDate(locale, date) {
return getUDayjs(date).locale(parseLocale(locale)).weekday(0);
},
getWeek: function getWeek(locale, date) {
return getUDayjs(date).locale(parseLocale(locale)).week();
},
getShortWeekDays: function getShortWeekDays(locale) {
return (0, import_dayjs_min.default)().locale(parseLocale(locale)).localeData().weekdaysMin();
},
getShortMonths: function getShortMonths(locale) {
return (0, import_dayjs_min.default)().locale(parseLocale(locale)).localeData().monthsShort();
},
format: function format(locale, date, _format) {
return getUDayjs(date).locale(parseLocale(locale)).format(_format);
},
parse: function parse(locale, text, formats) {
var localeStr = parseLocale(locale);
for (var i = 0; i < formats.length; i += 1) {
var format = formats[i];
var formatText = text;
if (format.includes("wo") || format.includes("Wo")) {
var year = formatText.split("-")[0];
var weekStr = formatText.split("-")[1];
var firstWeek = (0, import_dayjs_min.default)(year, "YYYY").startOf("year").locale(localeStr);
for (var j = 0; j <= 52; j += 1) {
var nextWeek = firstWeek.add(j, "week");
if (nextWeek.format("Wo") === weekStr) return nextWeek;
}
return null;
}
var date = (0, import_dayjs_min.default)(formatText, format, true).locale(localeStr);
if (date.isValid()) return date;
}
if (text) {}
return null;
}
}
};
//#endregion
//#region node_modules/@rc-component/picker/es/utils/uiUtil.js
function getRealPlacement(placement, rtl) {
if (placement !== void 0) return placement;
return rtl ? "bottomRight" : "bottomLeft";
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/context.js
var PickerContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/picker/es/PickerTrigger/index.js
function _typeof$28(o) {
"@babel/helpers - typeof";
return _typeof$28 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$28(o);
}
function _defineProperty$26(obj, key, value) {
key = _toPropertyKey$26(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$26(t) {
var i = _toPrimitive$26(t, "string");
return "symbol" == _typeof$28(i) ? i : String(i);
}
function _toPrimitive$26(t, r) {
if ("object" != _typeof$28(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$28(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
var BUILT_IN_PLACEMENTS$1 = {
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 popupElement = _ref.popupElement, popupStyle = _ref.popupStyle, popupClassName = _ref.popupClassName, popupAlign = _ref.popupAlign, transitionName = _ref.transitionName, getPopupContainer = _ref.getPopupContainer, children = _ref.children, range = _ref.range, placement = _ref.placement, _ref$builtinPlacement = _ref.builtinPlacements, builtinPlacements = _ref$builtinPlacement === void 0 ? BUILT_IN_PLACEMENTS$1 : _ref$builtinPlacement, direction = _ref.direction, visible = _ref.visible, onClose = _ref.onClose;
var prefixCls = import_react.useContext(PickerContext).prefixCls;
var dropdownPrefixCls = "".concat(prefixCls, "-dropdown");
var realPlacement = getRealPlacement(placement, direction === "rtl");
return /* @__PURE__ */ import_react.createElement(es_default$26, {
showAction: [],
hideAction: ["click"],
popupPlacement: realPlacement,
builtinPlacements,
prefixCls: dropdownPrefixCls,
popupMotion: { motionName: transitionName },
popup: popupElement,
popupAlign,
popupVisible: visible,
popupClassName: clsx(popupClassName, _defineProperty$26(_defineProperty$26({}, "".concat(dropdownPrefixCls, "-range"), range), "".concat(dropdownPrefixCls, "-rtl"), direction === "rtl")),
popupStyle,
stretch: "minWidth",
getPopupContainer,
onPopupVisibleChange: function onPopupVisibleChange(nextVisible) {
if (!nextVisible) onClose();
}
}, children);
}
//#endregion
//#region node_modules/@rc-component/picker/es/utils/miscUtil.js
function _toConsumableArray$7(arr) {
return _arrayWithoutHoles$7(arr) || _iterableToArray$7(arr) || _unsupportedIterableToArray$33(arr) || _nonIterableSpread$7();
}
function _nonIterableSpread$7() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$33(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$33(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$33(o, minLen);
}
function _iterableToArray$7(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles$7(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$33(arr);
}
function _arrayLikeToArray$33(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function 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(current);
return current;
}
/**
* Convert `value` to array. Will provide `[]` if is null or undefined.
*/
function toArray$4(val) {
if (val === null || val === void 0) return [];
return Array.isArray(val) ? val : [val];
}
function fillIndex(ori, index, value) {
var clone = _toConsumableArray$7(ori);
clone[index] = value;
return clone;
}
/** Pick props from the key list. Will filter empty value */
function pickProps(props, keys) {
var clone = {};
(keys || Object.keys(props)).forEach(function(key) {
if (props[key] !== void 0) clone[key] = props[key];
});
return clone;
}
function getRowFormat(picker, locale, format) {
if (format) return format;
switch (picker) {
case "time": return locale.fieldTimeFormat;
case "datetime": return locale.fieldDateTimeFormat;
case "month": return locale.fieldMonthFormat;
case "year": return locale.fieldYearFormat;
case "quarter": return locale.fieldQuarterFormat;
case "week": return locale.fieldWeekFormat;
default: return locale.fieldDateFormat;
}
}
function getFromDate(calendarValues, activeIndexList, activeIndex) {
var mergedActiveIndex = activeIndex !== void 0 ? activeIndex : activeIndexList[activeIndexList.length - 1];
var firstValuedIndex = activeIndexList.find(function(index) {
return calendarValues[index];
});
return mergedActiveIndex !== firstValuedIndex ? calendarValues[firstValuedIndex] : void 0;
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerTrigger/util.js
function pickTriggerProps(props) {
return pickProps(props, [
"placement",
"builtinPlacements",
"popupAlign",
"getPopupContainer",
"transitionName",
"direction"
]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useCellRender.js
function _typeof$27(o) {
"@babel/helpers - typeof";
return _typeof$27 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$27(o);
}
function ownKeys$16(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$16(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$16(Object(t), !0).forEach(function(r) {
_defineProperty$25(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$16(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$25(obj, key, value) {
key = _toPropertyKey$25(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$25(t) {
var i = _toPrimitive$25(t, "string");
return "symbol" == _typeof$27(i) ? i : String(i);
}
function _toPrimitive$25(t, r) {
if ("object" != _typeof$27(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$27(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function useCellRender$1(cellRender, dateRender, monthCellRender, range) {
warningOnce(!dateRender, "'dateRender' is deprecated. Please use 'cellRender' instead.");
warningOnce(!monthCellRender, "'monthCellRender' is deprecated. Please use 'cellRender' instead.");
var mergedCellRender = import_react.useMemo(function() {
if (cellRender) return cellRender;
return function(current, info) {
var date = current;
if (dateRender && info.type === "date") return dateRender(date, info.today);
if (monthCellRender && info.type === "month") return monthCellRender(date, info.locale);
return info.originNode;
};
}, [
cellRender,
monthCellRender,
dateRender
]);
return import_react.useCallback(function(date, info) {
return mergedCellRender(date, _objectSpread$16(_objectSpread$16({}, info), {}, { range }));
}, [mergedCellRender, range]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useFieldsInvalidate.js
function _slicedToArray$30(arr, i) {
return _arrayWithHoles$30(arr) || _iterableToArrayLimit$30(arr, i) || _unsupportedIterableToArray$32(arr, i) || _nonIterableRest$30();
}
function _nonIterableRest$30() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$32(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$32(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$32(o, minLen);
}
function _arrayLikeToArray$32(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$30(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$30(arr) {
if (Array.isArray(arr)) return arr;
}
/**
* Used to control each fields invalidate status
*/
function useFieldsInvalidate(calendarValue, isInvalidateDate) {
var allowEmpty = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
var _React$useState2 = _slicedToArray$30(import_react.useState([false, false]), 2), fieldsInvalidates = _React$useState2[0], setFieldsInvalidates = _React$useState2[1];
return [import_react.useMemo(function() {
return fieldsInvalidates.map(function(invalid, index) {
if (invalid) return true;
var current = calendarValue[index];
if (!current) return false;
if (!allowEmpty[index] && !current) return true;
if (current && isInvalidateDate(current, { activeIndex: index })) return true;
return false;
});
}, [
calendarValue,
fieldsInvalidates,
isInvalidateDate,
allowEmpty
]), function onSelectorInvalid(invalid, index) {
setFieldsInvalidates(function(ori) {
return fillIndex(ori, index, invalid);
});
}];
}
//#endregion
//#region node_modules/@rc-component/picker/es/hooks/useLocale.js
function _typeof$26(o) {
"@babel/helpers - typeof";
return _typeof$26 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$26(o);
}
function ownKeys$15(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$15(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$15(Object(t), !0).forEach(function(r) {
_defineProperty$24(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$15(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$24(obj, key, value) {
key = _toPropertyKey$24(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$24(t) {
var i = _toPrimitive$24(t, "string");
return "symbol" == _typeof$26(i) ? i : String(i);
}
function _toPrimitive$24(t, r) {
if ("object" != _typeof$26(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$26(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem) {
var timeFormat = "";
var cells = [];
if (showHour) cells.push(showMeridiem ? "hh" : "HH");
if (showMinute) cells.push("mm");
if (showSecond) cells.push("ss");
timeFormat = cells.join(":");
if (showMillisecond) timeFormat += ".SSS";
if (showMeridiem) timeFormat += " A";
return timeFormat;
}
/**
* Used for `useFilledProps` since it already in the React.useMemo
*/
function fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours) {
var fieldDateTimeFormat = locale.fieldDateTimeFormat, fieldDateFormat = locale.fieldDateFormat, fieldTimeFormat = locale.fieldTimeFormat, fieldMonthFormat = locale.fieldMonthFormat, fieldYearFormat = locale.fieldYearFormat, fieldWeekFormat = locale.fieldWeekFormat, fieldQuarterFormat = locale.fieldQuarterFormat, yearFormat = locale.yearFormat, cellYearFormat = locale.cellYearFormat, cellQuarterFormat = locale.cellQuarterFormat, dayFormat = locale.dayFormat, cellDateFormat = locale.cellDateFormat;
var timeFormat = fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, use12Hours);
return _objectSpread$15(_objectSpread$15({}, locale), {}, {
fieldDateTimeFormat: fieldDateTimeFormat || "YYYY-MM-DD ".concat(timeFormat),
fieldDateFormat: fieldDateFormat || "YYYY-MM-DD",
fieldTimeFormat: fieldTimeFormat || timeFormat,
fieldMonthFormat: fieldMonthFormat || "YYYY-MM",
fieldYearFormat: fieldYearFormat || "YYYY",
fieldWeekFormat: fieldWeekFormat || "gggg-wo",
fieldQuarterFormat: fieldQuarterFormat || "YYYY-[Q]Q",
yearFormat: yearFormat || "YYYY",
cellYearFormat: cellYearFormat || "YYYY",
cellQuarterFormat: cellQuarterFormat || "[Q]Q",
cellDateFormat: cellDateFormat || dayFormat || "D"
});
}
/**
* Fill locale format as start up
*/
function useLocale(locale, showProps) {
var showHour = showProps.showHour, showMinute = showProps.showMinute, showSecond = showProps.showSecond, showMillisecond = showProps.showMillisecond, use12Hours = showProps.use12Hours;
return import_react.useMemo(function() {
return fillLocale(locale, showHour, showMinute, showSecond, showMillisecond, use12Hours);
}, [
locale,
showHour,
showMinute,
showSecond,
showMillisecond,
use12Hours
]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/hooks/useTimeConfig.js
function ownKeys$14(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$14(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$14(Object(t), !0).forEach(function(r) {
_defineProperty$23(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$14(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$23(obj, key, value) {
key = _toPropertyKey$23(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$23(t) {
var i = _toPrimitive$23(t, "string");
return "symbol" == _typeof$25(i) ? i : String(i);
}
function _toPrimitive$23(t, r) {
if ("object" != _typeof$25(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$25(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$29(arr, i) {
return _arrayWithHoles$29(arr) || _iterableToArrayLimit$29(arr, i) || _unsupportedIterableToArray$31(arr, i) || _nonIterableRest$29();
}
function _nonIterableRest$29() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$31(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$31(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$31(o, minLen);
}
function _arrayLikeToArray$31(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$29(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$29(arr) {
if (Array.isArray(arr)) return arr;
}
function _typeof$25(o) {
"@babel/helpers - typeof";
return _typeof$25 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$25(o);
}
function checkShow(format, keywords, show) {
return show !== null && show !== void 0 ? show : keywords.some(function(keyword) {
return format.includes(keyword);
});
}
var showTimeKeys = [
"showNow",
"showHour",
"showMinute",
"showSecond",
"showMillisecond",
"use12Hours",
"hourStep",
"minuteStep",
"secondStep",
"millisecondStep",
"hideDisabledOptions",
"defaultValue",
"disabledHours",
"disabledMinutes",
"disabledSeconds",
"disabledMilliseconds",
"disabledTime",
"changeOnScroll",
"defaultOpenValue"
];
/**
* Get SharedTimeProps from props.
*/
function pickTimeProps(props) {
var timeProps = pickProps(props, showTimeKeys);
var format = props.format, picker = props.picker;
var propFormat = null;
if (format) {
propFormat = format;
if (Array.isArray(propFormat)) propFormat = propFormat[0];
propFormat = _typeof$25(propFormat) === "object" ? propFormat.format : propFormat;
}
if (picker === "time") timeProps.format = propFormat;
return [timeProps, propFormat];
}
function isStringFormat(format) {
return format && typeof format === "string";
}
/** Check if all the showXXX is `undefined` */
function existShowConfig(showHour, showMinute, showSecond, showMillisecond) {
return [
showHour,
showMinute,
showSecond,
showMillisecond
].some(function(show) {
return show !== void 0;
});
}
/** Fill the showXXX if needed */
function fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond) {
var parsedShowHour = showHour;
var parsedShowMinute = showMinute;
var parsedShowSecond = showSecond;
if (!hasShowConfig && !parsedShowHour && !parsedShowMinute && !parsedShowSecond && !showMillisecond) {
parsedShowHour = true;
parsedShowMinute = true;
parsedShowSecond = true;
} else if (hasShowConfig) {
var _parsedShowHour, _parsedShowMinute, _parsedShowSecond;
var existFalse = [
parsedShowHour,
parsedShowMinute,
parsedShowSecond
].some(function(show) {
return show === false;
});
var existTrue = [
parsedShowHour,
parsedShowMinute,
parsedShowSecond
].some(function(show) {
return show === true;
});
var defaultShow = existFalse ? true : !existTrue;
parsedShowHour = (_parsedShowHour = parsedShowHour) !== null && _parsedShowHour !== void 0 ? _parsedShowHour : defaultShow;
parsedShowMinute = (_parsedShowMinute = parsedShowMinute) !== null && _parsedShowMinute !== void 0 ? _parsedShowMinute : defaultShow;
parsedShowSecond = (_parsedShowSecond = parsedShowSecond) !== null && _parsedShowSecond !== void 0 ? _parsedShowSecond : defaultShow;
}
return [
parsedShowHour,
parsedShowMinute,
parsedShowSecond,
showMillisecond
];
}
/**
* Get `showHour`, `showMinute`, `showSecond` or other from the props.
* This is pure function, will not get `showXXX` from the `format` prop.
*/
function getTimeProps(componentProps) {
var showTime = componentProps.showTime;
var _pickTimeProps2 = _slicedToArray$29(pickTimeProps(componentProps), 2), pickedProps = _pickTimeProps2[0], propFormat = _pickTimeProps2[1];
var showTimeConfig = showTime && _typeof$25(showTime) === "object" ? showTime : {};
var timeConfig = _objectSpread$14(_objectSpread$14({ defaultOpenValue: showTimeConfig.defaultOpenValue || showTimeConfig.defaultValue }, pickedProps), showTimeConfig);
var showMillisecond = timeConfig.showMillisecond;
var showHour = timeConfig.showHour, showMinute = timeConfig.showMinute, showSecond = timeConfig.showSecond;
var _fillShowConfig2 = _slicedToArray$29(fillShowConfig(existShowConfig(showHour, showMinute, showSecond, showMillisecond), showHour, showMinute, showSecond, showMillisecond), 3);
showHour = _fillShowConfig2[0];
showMinute = _fillShowConfig2[1];
showSecond = _fillShowConfig2[2];
return [
timeConfig,
_objectSpread$14(_objectSpread$14({}, timeConfig), {}, {
showHour,
showMinute,
showSecond,
showMillisecond
}),
timeConfig.format,
propFormat
];
}
function fillShowTimeConfig(picker, showTimeFormat, propFormat, timeConfig, locale) {
if (picker === "datetime" || picker === "time") {
var pickedProps = timeConfig;
var baselineFormat = getRowFormat(picker, locale, null);
var formatList = [showTimeFormat, propFormat];
for (var i = 0; i < formatList.length; i += 1) {
var format = toArray$4(formatList[i])[0];
if (isStringFormat(format)) {
baselineFormat = format;
break;
}
}
var showHour = pickedProps.showHour, showMinute = pickedProps.showMinute, showSecond = pickedProps.showSecond, showMillisecond = pickedProps.showMillisecond;
var use12Hours = pickedProps.use12Hours;
var showMeridiem = checkShow(baselineFormat, [
"a",
"A",
"LT",
"LLL",
"LTS"
], use12Hours);
var hasShowConfig = existShowConfig(showHour, showMinute, showSecond, showMillisecond);
if (!hasShowConfig) {
showHour = checkShow(baselineFormat, [
"H",
"h",
"k",
"LT",
"LLL"
]);
showMinute = checkShow(baselineFormat, [
"m",
"LT",
"LLL"
]);
showSecond = checkShow(baselineFormat, ["s", "LTS"]);
showMillisecond = checkShow(baselineFormat, ["SSS"]);
}
var _fillShowConfig4 = _slicedToArray$29(fillShowConfig(hasShowConfig, showHour, showMinute, showSecond, showMillisecond), 3);
showHour = _fillShowConfig4[0];
showMinute = _fillShowConfig4[1];
showSecond = _fillShowConfig4[2];
var timeFormat = showTimeFormat || fillTimeFormat(showHour, showMinute, showSecond, showMillisecond, showMeridiem);
return _objectSpread$14(_objectSpread$14({}, pickedProps), {}, {
format: timeFormat,
showHour,
showMinute,
showSecond,
showMillisecond,
use12Hours: showMeridiem
});
}
return null;
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/hooks/useClearIcon.js
function _typeof$24(o) {
"@babel/helpers - typeof";
return _typeof$24 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$24(o);
}
/**
* Used for `useFilledProps` since it already in the React.useMemo
*/
function fillClearIcon(prefixCls, allowClear, clearIcon) {
if (clearIcon) warningOnce(false, "`clearIcon` will be removed in future. Please use `allowClear` instead.");
if (allowClear === false) return null;
return (allowClear && _typeof$24(allowClear) === "object" ? allowClear : {}).clearIcon || clearIcon || /* @__PURE__ */ import_react.createElement("span", { className: "".concat(prefixCls, "-clear-btn") });
}
//#endregion
//#region node_modules/@rc-component/picker/es/utils/dateUtil.js
/**
* Wrap the compare logic.
* This will compare the each of value is empty first.
* 1. All is empty, return true.
* 2. One is empty, return false.
* 3. return customize compare logic.
*/
function nullableCompare(value1, value2, oriCompareFn) {
if (!value1 && !value2 || value1 === value2) return true;
if (!value1 || !value2) return false;
return oriCompareFn();
}
function isSameDecade(generateConfig, decade1, decade2) {
return nullableCompare(decade1, decade2, function() {
return Math.floor(generateConfig.getYear(decade1) / 10) === Math.floor(generateConfig.getYear(decade2) / 10);
});
}
function isSameYear$1(generateConfig, year1, year2) {
return nullableCompare(year1, year2, function() {
return generateConfig.getYear(year1) === generateConfig.getYear(year2);
});
}
function getQuarter(generateConfig, date) {
return Math.floor(generateConfig.getMonth(date) / 3) + 1;
}
function isSameQuarter(generateConfig, quarter1, quarter2) {
return nullableCompare(quarter1, quarter2, function() {
return isSameYear$1(generateConfig, quarter1, quarter2) && getQuarter(generateConfig, quarter1) === getQuarter(generateConfig, quarter2);
});
}
function isSameMonth$1(generateConfig, month1, month2) {
return nullableCompare(month1, month2, function() {
return isSameYear$1(generateConfig, month1, month2) && generateConfig.getMonth(month1) === generateConfig.getMonth(month2);
});
}
function isSameDate$1(generateConfig, date1, date2) {
return nullableCompare(date1, date2, function() {
return isSameYear$1(generateConfig, date1, date2) && isSameMonth$1(generateConfig, date1, date2) && generateConfig.getDate(date1) === generateConfig.getDate(date2);
});
}
function isSameTime(generateConfig, time1, time2) {
return nullableCompare(time1, time2, function() {
return generateConfig.getHour(time1) === generateConfig.getHour(time2) && generateConfig.getMinute(time1) === generateConfig.getMinute(time2) && generateConfig.getSecond(time1) === generateConfig.getSecond(time2);
});
}
/**
* Check if the Date is all the same of timestamp
*/
function isSameTimestamp(generateConfig, time1, time2) {
return nullableCompare(time1, time2, function() {
return isSameDate$1(generateConfig, time1, time2) && isSameTime(generateConfig, time1, time2) && generateConfig.getMillisecond(time1) === generateConfig.getMillisecond(time2);
});
}
function isSameWeek(generateConfig, locale, date1, date2) {
return nullableCompare(date1, date2, function() {
return isSameYear$1(generateConfig, generateConfig.locale.getWeekFirstDate(locale, date1), generateConfig.locale.getWeekFirstDate(locale, date2)) && generateConfig.locale.getWeek(locale, date1) === generateConfig.locale.getWeek(locale, date2);
});
}
function isSame(generateConfig, locale, source, target, type) {
switch (type) {
case "date": return isSameDate$1(generateConfig, source, target);
case "week": return isSameWeek(generateConfig, locale.locale, source, target);
case "month": return isSameMonth$1(generateConfig, source, target);
case "quarter": return isSameQuarter(generateConfig, source, target);
case "year": return isSameYear$1(generateConfig, source, target);
case "decade": return isSameDecade(generateConfig, source, target);
case "time": return isSameTime(generateConfig, source, target);
default: return isSameTimestamp(generateConfig, source, target);
}
}
/** Between in date but not equal of date */
function isInRange(generateConfig, startDate, endDate, current) {
if (!startDate || !endDate || !current) return false;
return generateConfig.isAfter(current, startDate) && generateConfig.isAfter(endDate, current);
}
function isSameOrAfter(generateConfig, locale, date1, date2, type) {
if (isSame(generateConfig, locale, date1, date2, type)) return true;
return generateConfig.isAfter(date1, date2);
}
function getWeekStartDate(locale, generateConfig, value) {
var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale);
var monthStartDate = generateConfig.setDate(value, 1);
var startDateWeekDay = generateConfig.getWeekDay(monthStartDate);
var alignStartDate = generateConfig.addDate(monthStartDate, weekFirstDay - startDateWeekDay);
if (generateConfig.getMonth(alignStartDate) === generateConfig.getMonth(value) && generateConfig.getDate(alignStartDate) > 1) alignStartDate = generateConfig.addDate(alignStartDate, -7);
return alignStartDate;
}
function formatValue(value, _ref) {
var generateConfig = _ref.generateConfig, locale = _ref.locale, format = _ref.format;
if (!value) return "";
return typeof format === "function" ? format(value) : generateConfig.locale.format(locale.locale, value, format);
}
/**
* Fill the time info into Date if provided.
*/
function fillTime(generateConfig, date, time) {
var tmpDate = date;
var getFn = [
"getHour",
"getMinute",
"getSecond",
"getMillisecond"
];
[
"setHour",
"setMinute",
"setSecond",
"setMillisecond"
].forEach(function(fn, index) {
if (time) tmpDate = generateConfig[fn](tmpDate, generateConfig[getFn[index]](time));
else tmpDate = generateConfig[fn](tmpDate, 0);
});
return tmpDate;
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useDisabledBoundary.js
/**
* Merge `disabledDate` with `minDate` & `maxDate`.
*/
function useDisabledBoundary(generateConfig, locale, disabledDate, minDate, maxDate) {
return useEvent(function(date, info) {
if (disabledDate && disabledDate(date, info)) return true;
if (minDate && generateConfig.isAfter(minDate, date) && !isSame(generateConfig, locale, minDate, date, info.type)) return true;
if (maxDate && generateConfig.isAfter(date, maxDate) && !isSame(generateConfig, locale, maxDate, date, info.type)) return true;
return false;
});
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useFieldFormat.js
function _typeof$23(o) {
"@babel/helpers - typeof";
return _typeof$23 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$23(o);
}
function useFieldFormat(picker, locale, format) {
return import_react.useMemo(function() {
var formatList = toArray$4(getRowFormat(picker, locale, format));
var firstFormat = formatList[0];
var maskFormat = _typeof$23(firstFormat) === "object" && firstFormat.type === "mask" ? firstFormat.format : null;
return [formatList.map(function(config) {
return typeof config === "string" || typeof config === "function" ? config : config.format;
}), maskFormat];
}, [
picker,
locale,
format
]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useInputReadOnly.js
function useInputReadOnly(formatList, inputReadOnly, multiple) {
if (typeof formatList[0] === "function" || multiple) return true;
return inputReadOnly;
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useInvalidate.js
function _typeof$22(o) {
"@babel/helpers - typeof";
return _typeof$22 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$22(o);
}
function ownKeys$13(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$13(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$13(Object(t), !0).forEach(function(r) {
_defineProperty$22(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$13(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$22(obj, key, value) {
key = _toPropertyKey$22(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$22(t) {
var i = _toPrimitive$22(t, "string");
return "symbol" == _typeof$22(i) ? i : String(i);
}
function _toPrimitive$22(t, r) {
if ("object" != _typeof$22(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$22(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
/**
* Check if provided date is valid for the `disabledDate` & `showTime.disabledTime`.
*/
function useInvalidate(generateConfig, picker, disabledDate, showTime) {
return useEvent(function(date, info) {
var outsideInfo = _objectSpread$13({ type: picker }, info);
delete outsideInfo.activeIndex;
if (!generateConfig.isValidate(date) || disabledDate && disabledDate(date, outsideInfo)) return true;
if ((picker === "date" || picker === "time") && showTime) {
var _showTime$disabledTim;
var range = info && info.activeIndex === 1 ? "end" : "start";
var _ref = ((_showTime$disabledTim = showTime.disabledTime) === null || _showTime$disabledTim === void 0 ? void 0 : _showTime$disabledTim.call(showTime, date, range, { from: outsideInfo.from })) || {}, disabledHours = _ref.disabledHours, disabledMinutes = _ref.disabledMinutes, disabledSeconds = _ref.disabledSeconds, disabledMilliseconds = _ref.disabledMilliseconds;
var legacyDisabledHours = showTime.disabledHours, legacyDisabledMinutes = showTime.disabledMinutes, legacyDisabledSeconds = showTime.disabledSeconds;
var mergedDisabledHours = disabledHours || legacyDisabledHours;
var mergedDisabledMinutes = disabledMinutes || legacyDisabledMinutes;
var mergedDisabledSeconds = disabledSeconds || legacyDisabledSeconds;
var hour = generateConfig.getHour(date);
var minute = generateConfig.getMinute(date);
var second = generateConfig.getSecond(date);
var millisecond = generateConfig.getMillisecond(date);
if (mergedDisabledHours && mergedDisabledHours().includes(hour)) return true;
if (mergedDisabledMinutes && mergedDisabledMinutes(hour).includes(minute)) return true;
if (mergedDisabledSeconds && mergedDisabledSeconds(hour, minute).includes(second)) return true;
if (disabledMilliseconds && disabledMilliseconds(hour, minute, second).includes(millisecond)) return true;
}
return false;
});
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useFilledProps.js
function _typeof$21(o) {
"@babel/helpers - typeof";
return _typeof$21 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$21(o);
}
function ownKeys$12(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$12(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$12(Object(t), !0).forEach(function(r) {
_defineProperty$21(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$12(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$21(obj, key, value) {
key = _toPropertyKey$21(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$21(t) {
var i = _toPrimitive$21(t, "string");
return "symbol" == _typeof$21(i) ? i : String(i);
}
function _toPrimitive$21(t, r) {
if ("object" != _typeof$21(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$21(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$28(arr, i) {
return _arrayWithHoles$28(arr) || _iterableToArrayLimit$28(arr, i) || _unsupportedIterableToArray$30(arr, i) || _nonIterableRest$28();
}
function _nonIterableRest$28() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$30(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$30(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$30(o, minLen);
}
function _arrayLikeToArray$30(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$28(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$28(arr) {
if (Array.isArray(arr)) return arr;
}
function useList(value) {
var fillMode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
return import_react.useMemo(function() {
var list = value ? toArray$4(value) : value;
if (fillMode && list) list[1] = list[1] || list[0];
return list;
}, [value, fillMode]);
}
/**
* Align the outer props with unique typed and fill undefined props.
* This is shared with both RangePicker and Picker. This will do:
* - Convert `value` & `defaultValue` to array
* - handle the legacy props fill like `clearIcon` + `allowClear` = `clearIcon`
*/
function useFilledProps(props, updater) {
var generateConfig = props.generateConfig, locale = props.locale, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "rc-picker" : _props$prefixCls, _props$previewValue = props.previewValue, previewValue = _props$previewValue === void 0 ? "hover" : _props$previewValue, _props$styles = props.styles, styles = _props$styles === void 0 ? {} : _props$styles, _props$classNames = props.classNames, classNames = _props$classNames === void 0 ? {} : _props$classNames, _props$order = props.order, order = _props$order === void 0 ? true : _props$order, _props$components = props.components, components = _props$components === void 0 ? {} : _props$components, inputRender = props.inputRender, allowClear = props.allowClear, clearIcon = props.clearIcon, needConfirm = props.needConfirm, multiple = props.multiple, format = props.format, inputReadOnly = props.inputReadOnly, disabledDate = props.disabledDate, minDate = props.minDate, maxDate = props.maxDate, showTime = props.showTime, value = props.value, defaultValue = props.defaultValue, pickerValue = props.pickerValue, defaultPickerValue = props.defaultPickerValue;
var values = useList(value);
var defaultValues = useList(defaultValue);
var pickerValues = useList(pickerValue);
var defaultPickerValues = useList(defaultPickerValue);
/** Almost same as `picker`, but add `datetime` for `date` with `showTime` */
var internalPicker = picker === "date" && showTime ? "datetime" : picker;
/** The picker is `datetime` or `time` */
var multipleInteractivePicker = internalPicker === "time" || internalPicker === "datetime";
var complexPicker = multipleInteractivePicker || multiple;
var mergedNeedConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : multipleInteractivePicker;
var _getTimeProps2 = _slicedToArray$28(getTimeProps(props), 4), timeProps = _getTimeProps2[0], localeTimeProps = _getTimeProps2[1], showTimeFormat = _getTimeProps2[2], propFormat = _getTimeProps2[3];
var mergedLocale = useLocale(locale, localeTimeProps);
var mergedShowTime = import_react.useMemo(function() {
return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, mergedLocale);
}, [
internalPicker,
showTimeFormat,
propFormat,
timeProps,
mergedLocale
]);
if (picker === "time") {
if ([
"disabledHours",
"disabledMinutes",
"disabledSeconds"
].some(function(key) {
return props[key];
})) warningOnce(false, "'disabledHours', 'disabledMinutes', 'disabledSeconds' will be removed in the next major version, please use 'disabledTime' instead.");
}
var filledProps = import_react.useMemo(function() {
return _objectSpread$12(_objectSpread$12({}, props), {}, {
previewValue,
prefixCls,
locale: mergedLocale,
picker,
styles,
classNames,
order,
components: _objectSpread$12({ input: inputRender }, components),
clearIcon: fillClearIcon(prefixCls, allowClear, clearIcon),
showTime: mergedShowTime,
value: values,
defaultValue: defaultValues,
pickerValue: pickerValues,
defaultPickerValue: defaultPickerValues
}, updater === null || updater === void 0 ? void 0 : updater());
}, [props]);
var _useFieldFormat2 = _slicedToArray$28(useFieldFormat(internalPicker, mergedLocale, format), 2), formatList = _useFieldFormat2[0], maskFormat = _useFieldFormat2[1];
var mergedInputReadOnly = useInputReadOnly(formatList, inputReadOnly, multiple);
var disabledBoundaryDate = useDisabledBoundary(generateConfig, locale, disabledDate, minDate, maxDate);
var isInvalidateDate = useInvalidate(generateConfig, picker, disabledBoundaryDate, mergedShowTime);
return [
import_react.useMemo(function() {
return _objectSpread$12(_objectSpread$12({}, filledProps), {}, {
needConfirm: mergedNeedConfirm,
inputReadOnly: mergedInputReadOnly,
disabledDate: disabledBoundaryDate
});
}, [
filledProps,
mergedNeedConfirm,
mergedInputReadOnly,
disabledBoundaryDate
]),
internalPicker,
complexPicker,
formatList,
maskFormat,
isInvalidateDate
];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useDelayState.js
function _slicedToArray$27(arr, i) {
return _arrayWithHoles$27(arr) || _iterableToArrayLimit$27(arr, i) || _unsupportedIterableToArray$29(arr, i) || _nonIterableRest$27();
}
function _nonIterableRest$27() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$29(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$29(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$29(o, minLen);
}
function _arrayLikeToArray$29(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$27(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$27(arr) {
if (Array.isArray(arr)) return arr;
}
/**
* Will be `true` immediately for next effect.
* But will be `false` for a delay of effect.
*/
function useDelayState(value, defaultValue, onChange) {
var _useControlledState2 = _slicedToArray$27(useControlledState(defaultValue, value), 2), state = _useControlledState2[0], setState = _useControlledState2[1];
var forceUpdate = _slicedToArray$27(import_react.useState({}), 2)[1];
var triggerUpdate = useEvent(function(nextState) {
setState(nextState);
forceUpdate({});
});
var nextValueRef = import_react.useRef(value);
var rafRef = import_react.useRef();
var cancelRaf = function cancelRaf() {
wrapperRaf.cancel(rafRef.current);
};
var doUpdate = useEvent(function() {
triggerUpdate(nextValueRef.current);
if (onChange && state !== nextValueRef.current) onChange(nextValueRef.current);
});
var updateValue = useEvent(function(next, immediately) {
cancelRaf();
nextValueRef.current = next;
if (next || immediately) doUpdate();
else rafRef.current = wrapperRaf(doUpdate);
});
import_react.useEffect(function() {
return cancelRaf;
}, []);
return [state, updateValue];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useOpen.js
function _slicedToArray$26(arr, i) {
return _arrayWithHoles$26(arr) || _iterableToArrayLimit$26(arr, i) || _unsupportedIterableToArray$28(arr, i) || _nonIterableRest$26();
}
function _nonIterableRest$26() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$28(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$28(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$28(o, minLen);
}
function _arrayLikeToArray$28(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$26(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$26(arr) {
if (Array.isArray(arr)) return arr;
}
/**
* Control the open state.
* Will not close if activeElement is on the popup.
*/
function useOpen(open, defaultOpen) {
var disabledList = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
var onOpenChange = arguments.length > 3 ? arguments[3] : void 0;
var _useDelayState2 = _slicedToArray$26(useDelayState(disabledList.every(function(disabled) {
return disabled;
}) ? false : open, defaultOpen || false, onOpenChange), 2), rafOpen = _useDelayState2[0], setRafOpen = _useDelayState2[1];
function setOpen(next) {
var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (!config.inherit || rafOpen) setRafOpen(next, config.force);
}
return [rafOpen, setOpen];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/usePickerRef.js
function usePickerRef(ref) {
var selectorRef = import_react.useRef();
import_react.useImperativeHandle(ref, function() {
var _selectorRef$current;
return {
nativeElement: (_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.nativeElement,
focus: function focus(options) {
var _selectorRef$current2;
(_selectorRef$current2 = selectorRef.current) === null || _selectorRef$current2 === void 0 || _selectorRef$current2.focus(options);
},
blur: function blur() {
var _selectorRef$current3;
(_selectorRef$current3 = selectorRef.current) === null || _selectorRef$current3 === void 0 || _selectorRef$current3.blur();
}
};
});
return selectorRef;
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/usePresets.js
function _slicedToArray$25(arr, i) {
return _arrayWithHoles$25(arr) || _iterableToArrayLimit$25(arr, i) || _unsupportedIterableToArray$27(arr, i) || _nonIterableRest$25();
}
function _nonIterableRest$25() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$27(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$27(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$27(o, minLen);
}
function _arrayLikeToArray$27(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$25(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$25(arr) {
if (Array.isArray(arr)) return arr;
}
function usePresets(presets, legacyRanges) {
return import_react.useMemo(function() {
if (presets) return presets;
if (legacyRanges) {
warningOnce(false, "`ranges` is deprecated. Please use `presets` instead.");
return Object.entries(legacyRanges).map(function(_ref) {
var _ref2 = _slicedToArray$25(_ref, 2);
return {
label: _ref2[0],
value: _ref2[1]
};
});
}
return [];
}, [presets, legacyRanges]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useLockEffect.js
/**
* Trigger `callback` immediately when `condition` is `true`.
* But trigger `callback` in next frame when `condition` is `false`.
*/
function useLockEffect(condition, callback) {
var delayFrames = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
var callbackRef = import_react.useRef(callback);
callbackRef.current = callback;
useLayoutUpdateEffect(function() {
if (condition) callbackRef.current(condition);
else {
var id = wrapperRaf(function() {
callbackRef.current(condition);
}, delayFrames);
return function() {
wrapperRaf.cancel(id);
};
}
}, [condition]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useRangeActive.js
function _slicedToArray$24(arr, i) {
return _arrayWithHoles$24(arr) || _iterableToArrayLimit$24(arr, i) || _unsupportedIterableToArray$26(arr, i) || _nonIterableRest$24();
}
function _nonIterableRest$24() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$26(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$26(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$26(o, minLen);
}
function _arrayLikeToArray$26(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$24(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$24(arr) {
if (Array.isArray(arr)) return arr;
}
/**
* When user first focus one input, any submit will trigger focus another one.
* When second time focus one input, submit will not trigger focus again.
* When click outside to close the panel, trigger event if it can trigger onChange.
*/
function useRangeActive(disabled) {
var empty = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
var mergedOpen = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
var _React$useState2 = _slicedToArray$24(import_react.useState(0), 2), activeIndex = _React$useState2[0], setActiveIndex = _React$useState2[1];
var _React$useState4 = _slicedToArray$24(import_react.useState(false), 2), focused = _React$useState4[0], setFocused = _React$useState4[1];
var activeListRef = import_react.useRef([]);
var submitIndexRef = import_react.useRef(null);
var lastOperationRef = import_react.useRef(null);
var updateSubmitIndex = function updateSubmitIndex(index) {
submitIndexRef.current = index;
};
var hasActiveSubmitValue = function hasActiveSubmitValue(index) {
return submitIndexRef.current === index;
};
var triggerFocus = function triggerFocus(nextFocus) {
setFocused(nextFocus);
};
var lastOperation = function lastOperation(type) {
if (type) lastOperationRef.current = type;
return lastOperationRef.current;
};
var nextActiveIndex = function nextActiveIndex(nextValue) {
var list = activeListRef.current;
var filledActiveSet = new Set(list.filter(function(index) {
return nextValue[index] || empty[index];
}));
var nextIndex = list[list.length - 1] === 0 ? 1 : 0;
if (filledActiveSet.size >= 2 || disabled[nextIndex]) return null;
return nextIndex;
};
useLockEffect(focused || mergedOpen, function() {
if (!focused) {
activeListRef.current = [];
updateSubmitIndex(null);
}
});
import_react.useEffect(function() {
if (focused) activeListRef.current.push(activeIndex);
}, [focused, activeIndex]);
return [
focused,
triggerFocus,
lastOperation,
activeIndex,
setActiveIndex,
nextActiveIndex,
activeListRef.current,
updateSubmitIndex,
hasActiveSubmitValue
];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useRangeDisabledDate.js
function _typeof$20(o) {
"@babel/helpers - typeof";
return _typeof$20 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$20(o);
}
function ownKeys$11(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$11(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$11(Object(t), !0).forEach(function(r) {
_defineProperty$20(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$11(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$20(obj, key, value) {
key = _toPropertyKey$20(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$20(t) {
var i = _toPrimitive$20(t, "string");
return "symbol" == _typeof$20(i) ? i : String(i);
}
function _toPrimitive$20(t, r) {
if ("object" != _typeof$20(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$20(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$23(arr, i) {
return _arrayWithHoles$23(arr) || _iterableToArrayLimit$23(arr, i) || _unsupportedIterableToArray$25(arr, i) || _nonIterableRest$23();
}
function _nonIterableRest$23() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$25(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$25(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$25(o, minLen);
}
function _arrayLikeToArray$25(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$23(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$23(arr) {
if (Array.isArray(arr)) return arr;
}
/**
* RangePicker need additional logic to handle the `disabled` case. e.g.
* [disabled, enabled] should end date not before start date
*/
function useRangeDisabledDate(values, disabled, activeIndexList, generateConfig, locale, disabledDate) {
var activeIndex = activeIndexList[activeIndexList.length - 1];
return function rangeDisabledDate(date, info) {
var _values = _slicedToArray$23(values, 2), start = _values[0], end = _values[1];
var mergedInfo = _objectSpread$11(_objectSpread$11({}, info), {}, { from: getFromDate(values, activeIndexList) });
if (activeIndex === 1 && disabled[0] && start && !isSame(generateConfig, locale, start, date, mergedInfo.type) && generateConfig.isAfter(start, date)) return true;
if (activeIndex === 0 && disabled[1] && end && !isSame(generateConfig, locale, end, date, mergedInfo.type) && generateConfig.isAfter(date, end)) return true;
return disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date, mergedInfo);
};
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useRangePickerValue.js
function _slicedToArray$22(arr, i) {
return _arrayWithHoles$22(arr) || _iterableToArrayLimit$22(arr, i) || _unsupportedIterableToArray$24(arr, i) || _nonIterableRest$22();
}
function _nonIterableRest$22() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$24(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$24(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$24(o, minLen);
}
function _arrayLikeToArray$24(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$22(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$22(arr) {
if (Array.isArray(arr)) return arr;
}
function offsetPanelDate(generateConfig, picker, date, offset) {
switch (picker) {
case "date":
case "week": return generateConfig.addMonth(date, offset);
case "month":
case "quarter": return generateConfig.addYear(date, offset);
case "year": return generateConfig.addYear(date, offset * 10);
case "decade": return generateConfig.addYear(date, offset * 100);
default: return date;
}
}
var EMPTY_LIST$3 = [];
function useRangePickerValue(generateConfig, locale, calendarValue, modes, open, activeIndex, pickerMode, multiplePanel) {
var defaultPickerValue = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : EMPTY_LIST$3;
var pickerValue = arguments.length > 9 && arguments[9] !== void 0 ? arguments[9] : EMPTY_LIST$3;
var timeDefaultValue = arguments.length > 10 && arguments[10] !== void 0 ? arguments[10] : EMPTY_LIST$3;
var onPickerValueChange = arguments.length > 11 ? arguments[11] : void 0;
var minDate = arguments.length > 12 ? arguments[12] : void 0;
var maxDate = arguments.length > 13 ? arguments[13] : void 0;
var isTimePicker = pickerMode === "time";
var mergedActiveIndex = activeIndex || 0;
var getDefaultPickerValue = function getDefaultPickerValue(index) {
var now = generateConfig.getNow();
if (isTimePicker) now = fillTime(generateConfig, now);
return defaultPickerValue[index] || calendarValue[index] || now;
};
var _pickerValue = _slicedToArray$22(pickerValue, 2), startPickerValue = _pickerValue[0], endPickerValue = _pickerValue[1];
var _useControlledState2 = _slicedToArray$22(useControlledState(function() {
return getDefaultPickerValue(0);
}, startPickerValue), 2), mergedStartPickerValue = _useControlledState2[0], setStartPickerValue = _useControlledState2[1];
var _useControlledState4 = _slicedToArray$22(useControlledState(function() {
return getDefaultPickerValue(1);
}, endPickerValue), 2), mergedEndPickerValue = _useControlledState4[0], setEndPickerValue = _useControlledState4[1];
var currentPickerValue = import_react.useMemo(function() {
var current = [mergedStartPickerValue, mergedEndPickerValue][mergedActiveIndex];
return isTimePicker ? current : fillTime(generateConfig, current, timeDefaultValue[mergedActiveIndex]);
}, [
isTimePicker,
mergedStartPickerValue,
mergedEndPickerValue,
mergedActiveIndex,
generateConfig,
timeDefaultValue
]);
var setCurrentPickerValue = function setCurrentPickerValue(nextPickerValue) {
var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "panel";
var updater = [setStartPickerValue, setEndPickerValue][mergedActiveIndex];
updater(nextPickerValue);
var clone = [mergedStartPickerValue, mergedEndPickerValue];
clone[mergedActiveIndex] = nextPickerValue;
if (onPickerValueChange && (!isSame(generateConfig, locale, mergedStartPickerValue, clone[0], pickerMode) || !isSame(generateConfig, locale, mergedEndPickerValue, clone[1], pickerMode))) onPickerValueChange(clone, {
source,
range: mergedActiveIndex === 1 ? "end" : "start",
mode: modes
});
};
/**
* EndDate pickerValue is little different. It should be:
* - If date picker (without time), endDate is not same year & month as startDate
* - pickerValue minus one month
* - Else pass directly
*/
var getEndDatePickerValue = function getEndDatePickerValue(startDate, endDate) {
if (multiplePanel) {
var mode = {
date: "month",
week: "month",
month: "year",
quarter: "year"
}[pickerMode];
if (mode && !isSame(generateConfig, locale, startDate, endDate, mode)) return offsetPanelDate(generateConfig, pickerMode, endDate, -1);
if (pickerMode === "year" && startDate) {
if (Math.floor(generateConfig.getYear(startDate) / 10) !== Math.floor(generateConfig.getYear(endDate) / 10)) return offsetPanelDate(generateConfig, pickerMode, endDate, -1);
}
}
return endDate;
};
var prevActiveIndexRef = import_react.useRef(null);
useLayoutEffect$1(function() {
if (open) {
if (!defaultPickerValue[mergedActiveIndex]) {
var nextPickerValue = isTimePicker ? null : generateConfig.getNow();
/**
* 1. If has prevActiveIndex, use it to avoid panel jump
* 2. If current field has value
* - If `activeIndex` is 1 and `calendarValue[0]` is not same panel as `calendarValue[1]`,
* offset `calendarValue[1]` and set it
* - Else use `calendarValue[activeIndex]`
* 3. If current field has no value but another field has value, use another field value
* 4. Else use now (not any `calendarValue` can ref)
*/
if (prevActiveIndexRef.current !== null && prevActiveIndexRef.current !== mergedActiveIndex) nextPickerValue = [mergedStartPickerValue, mergedEndPickerValue][mergedActiveIndex ^ 1];
else if (calendarValue[mergedActiveIndex]) nextPickerValue = mergedActiveIndex === 0 ? calendarValue[0] : getEndDatePickerValue(calendarValue[0], calendarValue[1]);
else if (calendarValue[mergedActiveIndex ^ 1]) nextPickerValue = calendarValue[mergedActiveIndex ^ 1];
if (nextPickerValue) {
if (minDate && generateConfig.isAfter(minDate, nextPickerValue)) nextPickerValue = minDate;
var offsetPickerValue = multiplePanel ? offsetPanelDate(generateConfig, pickerMode, nextPickerValue, 1) : nextPickerValue;
if (maxDate && generateConfig.isAfter(offsetPickerValue, maxDate)) nextPickerValue = multiplePanel ? offsetPanelDate(generateConfig, pickerMode, maxDate, -1) : maxDate;
setCurrentPickerValue(nextPickerValue, "reset");
}
}
}
}, [
open,
mergedActiveIndex,
calendarValue[mergedActiveIndex]
]);
import_react.useEffect(function() {
if (open) prevActiveIndexRef.current = mergedActiveIndex;
else prevActiveIndexRef.current = null;
}, [open, mergedActiveIndex]);
useLayoutEffect$1(function() {
if (open && defaultPickerValue) {
if (defaultPickerValue[mergedActiveIndex]) setCurrentPickerValue(defaultPickerValue[mergedActiveIndex], "reset");
}
}, [open, mergedActiveIndex]);
return [currentPickerValue, setCurrentPickerValue];
}
//#endregion
//#region node_modules/@rc-component/picker/es/hooks/useSyncState.js
function _slicedToArray$21(arr, i) {
return _arrayWithHoles$21(arr) || _iterableToArrayLimit$21(arr, i) || _unsupportedIterableToArray$23(arr, i) || _nonIterableRest$21();
}
function _nonIterableRest$21() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$23(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$23(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$23(o, minLen);
}
function _arrayLikeToArray$23(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$21(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$21(arr) {
if (Array.isArray(arr)) return arr;
}
/**
* Sync value with state.
* This should only used for internal which not affect outside calculation.
* Since it's not safe for suspense.
*/
function useSyncState$1(defaultValue, controlledValue) {
var valueRef = import_react.useRef(defaultValue);
var forceUpdate = _slicedToArray$21(import_react.useState({}), 2)[1];
var getter = function getter(useControlledValueFirst) {
return useControlledValueFirst && controlledValue !== void 0 ? controlledValue : valueRef.current;
};
return [
getter,
function setter(nextValue) {
valueRef.current = nextValue;
forceUpdate({});
},
getter(true)
];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useRangeValue.js
function _slicedToArray$20(arr, i) {
return _arrayWithHoles$20(arr) || _iterableToArrayLimit$20(arr, i) || _unsupportedIterableToArray$22(arr, i) || _nonIterableRest$20();
}
function _nonIterableRest$20() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArrayLimit$20(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$20(arr) {
if (Array.isArray(arr)) return arr;
}
function _toConsumableArray$6(arr) {
return _arrayWithoutHoles$6(arr) || _iterableToArray$6(arr) || _unsupportedIterableToArray$22(arr) || _nonIterableSpread$6();
}
function _nonIterableSpread$6() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$22(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$22(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$22(o, minLen);
}
function _iterableToArray$6(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles$6(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$22(arr);
}
function _arrayLikeToArray$22(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;
}
var EMPTY_VALUE = [];
function useUtil(generateConfig, locale, formatList) {
return [function getDateTexts(dates) {
return dates.map(function(date) {
return formatValue(date, {
generateConfig,
locale,
format: formatList[0]
});
});
}, function isSameDates(source, target) {
var maxLen = Math.max(source.length, target.length);
var diffIndex = -1;
for (var i = 0; i < maxLen; i += 1) {
var prev = source[i] || null;
var next = target[i] || null;
if (prev !== next && !isSameTimestamp(generateConfig, prev, next)) {
diffIndex = i;
break;
}
}
return [diffIndex < 0, diffIndex !== 0];
}];
}
function orderDates(dates, generateConfig) {
return _toConsumableArray$6(dates).sort(function(a, b) {
return generateConfig.isAfter(a, b) ? 1 : -1;
});
}
/**
* Used for internal value management.
* It should always use `mergedValue` in render logic
*/
function useCalendarValue(mergedValue) {
var _useSyncState2 = _slicedToArray$20(useSyncState$1(mergedValue), 2), calendarValue = _useSyncState2[0], setCalendarValue = _useSyncState2[1];
/** Sync calendarValue & submitValue back with value */
var syncWithValue = useEvent(function() {
setCalendarValue(mergedValue);
});
import_react.useEffect(function() {
syncWithValue();
}, [mergedValue]);
return [calendarValue, setCalendarValue];
}
/**
* Control the internal `value` align with prop `value` and provide a temp `calendarValue` for ui.
* `calendarValue` will be reset when blur & focus & open.
*/
function useInnerValue(generateConfig, locale, formatList, rangeValue, order, defaultValue, value, onCalendarChange, onOk) {
var _useControlledState2 = _slicedToArray$20(useControlledState(defaultValue, value), 2), innerValue = _useControlledState2[0], setInnerValue = _useControlledState2[1];
var mergedValue = innerValue || EMPTY_VALUE;
var _useCalendarValue2 = _slicedToArray$20(useCalendarValue(mergedValue), 2), calendarValue = _useCalendarValue2[0], setCalendarValue = _useCalendarValue2[1];
var _useUtil2 = _slicedToArray$20(useUtil(generateConfig, locale, formatList), 2), getDateTexts = _useUtil2[0], isSameDates = _useUtil2[1];
return [
mergedValue,
setInnerValue,
calendarValue,
useEvent(function(nextCalendarValues) {
var clone = _toConsumableArray$6(nextCalendarValues);
if (rangeValue) for (var i = 0; i < 2; i += 1) clone[i] = clone[i] || null;
else if (order) clone = orderDates(clone.filter(function(date) {
return date;
}), generateConfig);
var _isSameDates2 = _slicedToArray$20(isSameDates(calendarValue(), clone), 2), isSameMergedDates = _isSameDates2[0], isSameStart = _isSameDates2[1];
if (!isSameMergedDates) {
setCalendarValue(clone);
if (onCalendarChange) {
var cellTexts = getDateTexts(clone);
onCalendarChange(clone, cellTexts, { range: isSameStart ? "end" : "start" });
}
}
}),
function triggerOk() {
if (onOk) onOk(calendarValue());
}
];
}
function useRangeValue(info, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, open, isInvalidateDate) {
var generateConfig = info.generateConfig, locale = info.locale, picker = info.picker, onChange = info.onChange, allowEmpty = info.allowEmpty, order = info.order;
var orderOnChange = disabled.some(function(d) {
return d;
}) ? false : order;
var _useUtil4 = _slicedToArray$20(useUtil(generateConfig, locale, formatList), 2), getDateTexts = _useUtil4[0], isSameDates = _useUtil4[1];
var _useSyncState4 = _slicedToArray$20(useSyncState$1(mergedValue), 2), submitValue = _useSyncState4[0], setSubmitValue = _useSyncState4[1];
/** Sync calendarValue & submitValue back with value */
var syncWithValue = useEvent(function() {
setSubmitValue(mergedValue);
});
import_react.useEffect(function() {
syncWithValue();
}, [mergedValue]);
var triggerSubmit = useEvent(function(nextValue) {
var isNullValue = nextValue === null;
var clone = _toConsumableArray$6(nextValue || submitValue());
if (isNullValue) {
var maxLen = Math.max(disabled.length, clone.length);
for (var i = 0; i < maxLen; i += 1) if (!disabled[i]) clone[i] = null;
}
if (orderOnChange && clone[0] && clone[1]) clone = orderDates(clone, generateConfig);
triggerCalendarChange(clone);
var _clone2 = _slicedToArray$20(clone, 2), start = _clone2[0], end = _clone2[1];
var startEmpty = !start;
var endEmpty = !end;
var validateEmptyDateRange = allowEmpty ? (!startEmpty || allowEmpty[0]) && (!endEmpty || allowEmpty[1]) : true;
var validateOrder = !order || startEmpty || endEmpty || isSame(generateConfig, locale, start, end, picker) || generateConfig.isAfter(end, start);
var validateDates = (disabled[0] || !start || !isInvalidateDate(start, { activeIndex: 0 })) && (disabled[1] || !end || !isInvalidateDate(end, {
from: start,
activeIndex: 1
}));
var allPassed = isNullValue || validateEmptyDateRange && validateOrder && validateDates;
if (allPassed) {
setInnerValue(clone);
var isSameMergedDates = _slicedToArray$20(isSameDates(clone, mergedValue), 1)[0];
if (onChange && !isSameMergedDates) {
var everyEmpty = clone.every(function(val) {
return !val;
});
onChange(isNullValue && everyEmpty ? null : clone, everyEmpty ? null : getDateTexts(clone));
}
}
return allPassed;
});
var flushSubmit = useEvent(function(index, needTriggerChange) {
setSubmitValue(fillIndex(submitValue(), index, getCalendarValue()[index]));
if (needTriggerChange) triggerSubmit();
});
var interactiveFinished = !focused && !open;
useLockEffect(!interactiveFinished, function() {
if (interactiveFinished) {
triggerSubmit();
triggerCalendarChange(mergedValue);
syncWithValue();
}
}, 2);
return [flushSubmit, triggerSubmit];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/hooks/useShowNow.js
function useShowNow(picker, mode, showNow, showToday, rangePicker) {
if (mode !== "date" && mode !== "time") return false;
if (showNow !== void 0) return showNow;
if (showToday !== void 0) return showToday;
return !rangePicker && (picker === "date" || picker === "time");
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/TimePanel/TimePanelBody/util.js
function _toConsumableArray$5(arr) {
return _arrayWithoutHoles$5(arr) || _iterableToArray$5(arr) || _unsupportedIterableToArray$21(arr) || _nonIterableSpread$5();
}
function _nonIterableSpread$5() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$21(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$21(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$21(o, minLen);
}
function _iterableToArray$5(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles$5(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$21(arr);
}
function _arrayLikeToArray$21(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function findValidateTime(date, getHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits, generateConfig) {
var nextDate = date;
function alignValidate(getUnitValue, setUnitValue, units) {
var nextValue = generateConfig[getUnitValue](nextDate);
var nextUnit = units.find(function(unit) {
return unit.value === nextValue;
});
if (!nextUnit || nextUnit.disabled) {
var validateUnits = units.filter(function(unit) {
return !unit.disabled;
});
var validateUnit = _toConsumableArray$5(validateUnits).reverse().find(function(unit) {
return unit.value <= nextValue;
}) || validateUnits[0];
if (validateUnit) {
nextValue = validateUnit.value;
nextDate = generateConfig[setUnitValue](nextDate, nextValue);
}
}
return nextValue;
}
var nextHour = alignValidate("getHour", "setHour", getHourUnits());
var nextMinute = alignValidate("getMinute", "setMinute", getMinuteUnits(nextHour));
alignValidate("getMillisecond", "setMillisecond", getMillisecondUnits(nextHour, nextMinute, alignValidate("getSecond", "setSecond", getSecondUnits(nextHour, nextMinute))));
return nextDate;
}
//#endregion
//#region node_modules/@rc-component/picker/es/hooks/useTimeInfo.js
function _typeof$19(o) {
"@babel/helpers - typeof";
return _typeof$19 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$19(o);
}
function ownKeys$10(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$10(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$10(Object(t), !0).forEach(function(r) {
_defineProperty$19(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$10(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$19(obj, key, value) {
key = _toPropertyKey$19(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$19(t) {
var i = _toPrimitive$19(t, "string");
return "symbol" == _typeof$19(i) ? i : String(i);
}
function _toPrimitive$19(t, r) {
if ("object" != _typeof$19(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$19(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$19(arr, i) {
return _arrayWithHoles$19(arr) || _iterableToArrayLimit$19(arr, i) || _unsupportedIterableToArray$20(arr, i) || _nonIterableRest$19();
}
function _nonIterableRest$19() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$20(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$20(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$20(o, minLen);
}
function _arrayLikeToArray$20(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$19(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$19(arr) {
if (Array.isArray(arr)) return arr;
}
function emptyDisabled() {
return [];
}
function generateUnits(start, end) {
var step = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
var hideDisabledOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
var disabledUnits = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : [];
var pad = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 2;
var units = [];
var integerStep = step >= 1 ? step | 0 : 1;
for (var i = start; i <= end; i += integerStep) {
var disabled = disabledUnits.includes(i);
if (!disabled || !hideDisabledOptions) units.push({
label: leftPad(i, pad),
value: i,
disabled
});
}
return units;
}
/**
* Parse time props to get util info
*/
function useTimeInfo(generateConfig) {
var props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var date = arguments.length > 2 ? arguments[2] : void 0;
var _ref = props || {}, use12Hours = _ref.use12Hours, _ref$hourStep = _ref.hourStep, hourStep = _ref$hourStep === void 0 ? 1 : _ref$hourStep, _ref$minuteStep = _ref.minuteStep, minuteStep = _ref$minuteStep === void 0 ? 1 : _ref$minuteStep, _ref$secondStep = _ref.secondStep, secondStep = _ref$secondStep === void 0 ? 1 : _ref$secondStep, _ref$millisecondStep = _ref.millisecondStep, millisecondStep = _ref$millisecondStep === void 0 ? 100 : _ref$millisecondStep, hideDisabledOptions = _ref.hideDisabledOptions, disabledTime = _ref.disabledTime, disabledHours = _ref.disabledHours, disabledMinutes = _ref.disabledMinutes, disabledSeconds = _ref.disabledSeconds;
var mergedDate = import_react.useMemo(function() {
return date || generateConfig.getNow();
}, [date, generateConfig]);
var isHourStepValid = 24 % hourStep === 0;
var isMinuteStepValid = 60 % minuteStep === 0;
var isSecondStepValid = 60 % secondStep === 0;
warningOnce(isHourStepValid, "`hourStep` ".concat(hourStep, " is invalid. It should be a factor of 24."));
warningOnce(isMinuteStepValid, "`minuteStep` ".concat(minuteStep, " is invalid. It should be a factor of 60."));
warningOnce(isSecondStepValid, "`secondStep` ".concat(secondStep, " is invalid. It should be a factor of 60."));
var getDisabledTimes = import_react.useCallback(function(targetDate) {
var disabledConfig = (disabledTime === null || disabledTime === void 0 ? void 0 : disabledTime(targetDate)) || {};
return [
disabledConfig.disabledHours || disabledHours || emptyDisabled,
disabledConfig.disabledMinutes || disabledMinutes || emptyDisabled,
disabledConfig.disabledSeconds || disabledSeconds || emptyDisabled,
disabledConfig.disabledMilliseconds || emptyDisabled
];
}, [
disabledTime,
disabledHours,
disabledMinutes,
disabledSeconds
]);
var _React$useMemo2 = _slicedToArray$19(import_react.useMemo(function() {
return getDisabledTimes(mergedDate);
}, [mergedDate, getDisabledTimes]), 4), mergedDisabledHours = _React$useMemo2[0], mergedDisabledMinutes = _React$useMemo2[1], mergedDisabledSeconds = _React$useMemo2[2], mergedDisabledMilliseconds = _React$useMemo2[3];
var getAllUnits = import_react.useCallback(function(getDisabledHours, getDisabledMinutes, getDisabledSeconds, getDisabledMilliseconds) {
var hours = generateUnits(0, 23, hourStep, hideDisabledOptions, getDisabledHours());
return [
use12Hours ? hours.map(function(unit) {
return _objectSpread$10(_objectSpread$10({}, unit), {}, { label: leftPad(unit.value % 12 || 12, 2) });
}) : hours,
function getMinuteUnits(nextHour) {
return generateUnits(0, 59, minuteStep, hideDisabledOptions, getDisabledMinutes(nextHour));
},
function getSecondUnits(nextHour, nextMinute) {
return generateUnits(0, 59, secondStep, hideDisabledOptions, getDisabledSeconds(nextHour, nextMinute));
},
function getMillisecondUnits(nextHour, nextMinute, nextSecond) {
return generateUnits(0, 999, millisecondStep, hideDisabledOptions, getDisabledMilliseconds(nextHour, nextMinute, nextSecond), 3);
}
];
}, [
hideDisabledOptions,
hourStep,
use12Hours,
millisecondStep,
minuteStep,
secondStep
]);
var _React$useMemo4 = _slicedToArray$19(import_react.useMemo(function() {
return getAllUnits(mergedDisabledHours, mergedDisabledMinutes, mergedDisabledSeconds, mergedDisabledMilliseconds);
}, [
getAllUnits,
mergedDisabledHours,
mergedDisabledMinutes,
mergedDisabledSeconds,
mergedDisabledMilliseconds
]), 4), rowHourUnits = _React$useMemo4[0], getMinuteUnits = _React$useMemo4[1], getSecondUnits = _React$useMemo4[2], getMillisecondUnits = _React$useMemo4[3];
return [
function getValidTime(nextTime, certainDate) {
var getCheckHourUnits = function getCheckHourUnits() {
return rowHourUnits;
};
var getCheckMinuteUnits = getMinuteUnits;
var getCheckSecondUnits = getSecondUnits;
var getCheckMillisecondUnits = getMillisecondUnits;
if (certainDate) {
var _getDisabledTimes2 = _slicedToArray$19(getDisabledTimes(certainDate), 4), targetDisabledHours = _getDisabledTimes2[0], targetDisabledMinutes = _getDisabledTimes2[1], targetDisabledSeconds = _getDisabledTimes2[2], targetDisabledMilliseconds = _getDisabledTimes2[3];
var _getAllUnits2 = _slicedToArray$19(getAllUnits(targetDisabledHours, targetDisabledMinutes, targetDisabledSeconds, targetDisabledMilliseconds), 4), targetRowHourUnits = _getAllUnits2[0], targetGetMinuteUnits = _getAllUnits2[1], targetGetSecondUnits = _getAllUnits2[2], targetGetMillisecondUnits = _getAllUnits2[3];
getCheckHourUnits = function getCheckHourUnits() {
return targetRowHourUnits;
};
getCheckMinuteUnits = targetGetMinuteUnits;
getCheckSecondUnits = targetGetSecondUnits;
getCheckMillisecondUnits = targetGetMillisecondUnits;
}
return findValidateTime(nextTime, getCheckHourUnits, getCheckMinuteUnits, getCheckSecondUnits, getCheckMillisecondUnits, generateConfig);
},
rowHourUnits,
getMinuteUnits,
getSecondUnits,
getMillisecondUnits
];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Popup/Footer.js
function _slicedToArray$18(arr, i) {
return _arrayWithHoles$18(arr) || _iterableToArrayLimit$18(arr, i) || _unsupportedIterableToArray$19(arr, i) || _nonIterableRest$18();
}
function _nonIterableRest$18() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$19(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$19(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$19(o, minLen);
}
function _arrayLikeToArray$19(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$18(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$18(arr) {
if (Array.isArray(arr)) return arr;
}
function Footer$3(props) {
var mode = props.mode, internalMode = props.internalMode, renderExtraFooter = props.renderExtraFooter, showNow = props.showNow, showTime = props.showTime, onSubmit = props.onSubmit, onNow = props.onNow, invalid = props.invalid, needConfirm = props.needConfirm, generateConfig = props.generateConfig, disabledDate = props.disabledDate;
var _React$useContext = import_react.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, locale = _React$useContext.locale, _React$useContext$but = _React$useContext.button, Button = _React$useContext$but === void 0 ? "button" : _React$useContext$but, classNames = _React$useContext.classNames, styles = _React$useContext.styles;
var now = generateConfig.getNow();
var getValidTime = _slicedToArray$18(useTimeInfo(generateConfig, showTime, now), 1)[0];
var extraNode = renderExtraFooter === null || renderExtraFooter === void 0 ? void 0 : renderExtraFooter(mode);
var nowDisabled = disabledDate(now, { type: mode });
var onInternalNow = function onInternalNow() {
if (!nowDisabled) onNow(getValidTime(now));
};
var nowPrefixCls = "".concat(prefixCls, "-now");
var nowBtnPrefixCls = "".concat(nowPrefixCls, "-btn");
var presetNode = showNow && /* @__PURE__ */ import_react.createElement("li", { className: nowPrefixCls }, /* @__PURE__ */ import_react.createElement("a", {
className: clsx(nowBtnPrefixCls, nowDisabled && "".concat(nowBtnPrefixCls, "-disabled")),
"aria-disabled": nowDisabled,
onClick: onInternalNow
}, internalMode === "date" ? locale.today : locale.now));
var okNode = needConfirm && /* @__PURE__ */ import_react.createElement("li", { className: "".concat(prefixCls, "-ok") }, /* @__PURE__ */ import_react.createElement(Button, {
disabled: invalid,
onClick: onSubmit
}, locale.ok));
var rangeNode = (presetNode || okNode) && /* @__PURE__ */ import_react.createElement("ul", { className: "".concat(prefixCls, "-ranges") }, presetNode, okNode);
if (!extraNode && !rangeNode) return null;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx("".concat(prefixCls, "-footer"), classNames.popup.footer),
style: styles.popup.footer
}, extraNode && /* @__PURE__ */ import_react.createElement("div", { className: "".concat(prefixCls, "-footer-extra") }, extraNode), rangeNode);
}
//#endregion
//#region node_modules/@rc-component/picker/es/hooks/useToggleDates.js
function _toConsumableArray$4(arr) {
return _arrayWithoutHoles$4(arr) || _iterableToArray$4(arr) || _unsupportedIterableToArray$18(arr) || _nonIterableSpread$4();
}
function _nonIterableSpread$4() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$18(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$18(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$18(o, minLen);
}
function _iterableToArray$4(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles$4(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$18(arr);
}
function _arrayLikeToArray$18(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;
}
/**
* Toggles the presence of a value in an array.
* If the value exists in the array, removed it.
* Else add it.
*/
function useToggleDates(generateConfig, locale, panelMode) {
function toggleDates(list, target) {
var index = list.findIndex(function(date) {
return isSame(generateConfig, locale, date, target, panelMode);
});
if (index === -1) return [].concat(_toConsumableArray$4(list), [target]);
var sliceList = _toConsumableArray$4(list);
sliceList.splice(index, 1);
return sliceList;
}
return toggleDates;
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/context.js
var SharedPanelContext = /* @__PURE__ */ import_react.createContext(null);
/** Used for each single Panel. e.g. DatePanel */
var PanelContext = /* @__PURE__ */ import_react.createContext(null);
function usePanelContext() {
return import_react.useContext(PanelContext);
}
/**
* Get shared props for the SharedPanelProps interface.
*/
function useInfo(props, panelType) {
var prefixCls = props.prefixCls, generateConfig = props.generateConfig, locale = props.locale, disabledDate = props.disabledDate, minDate = props.minDate, maxDate = props.maxDate, cellRender = props.cellRender, hoverValue = props.hoverValue, hoverRangeValue = props.hoverRangeValue, onHover = props.onHover, values = props.values, pickerValue = props.pickerValue, onSelect = props.onSelect, prevIcon = props.prevIcon, nextIcon = props.nextIcon, superPrevIcon = props.superPrevIcon, superNextIcon = props.superNextIcon;
var _React$useContext = import_react.useContext(SharedPanelContext), classNames = _React$useContext.classNames, styles = _React$useContext.styles;
var now = generateConfig.getNow();
return [{
now,
values,
pickerValue,
prefixCls,
classNames,
styles,
disabledDate,
minDate,
maxDate,
cellRender,
hoverValue,
hoverRangeValue,
onHover,
locale,
generateConfig,
onSelect,
panelType,
prevIcon,
nextIcon,
superPrevIcon,
superNextIcon
}, now];
}
/**
* Internal usage for RangePicker to not to show the operation arrow
*/
var PickerHackContext = /* @__PURE__ */ import_react.createContext({});
PickerHackContext.displayName = "PickerHackContext";
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/PanelBody.js
function _typeof$18(o) {
"@babel/helpers - typeof";
return _typeof$18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$18(o);
}
function ownKeys$9(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$9(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$9(Object(t), !0).forEach(function(r) {
_defineProperty$18(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$18(obj, key, value) {
key = _toPropertyKey$18(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$18(t) {
var i = _toPrimitive$18(t, "string");
return "symbol" == _typeof$18(i) ? i : String(i);
}
function _toPrimitive$18(t, r) {
if ("object" != _typeof$18(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$18(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$17(arr, i) {
return _arrayWithHoles$17(arr) || _iterableToArrayLimit$17(arr, i) || _unsupportedIterableToArray$17(arr, i) || _nonIterableRest$17();
}
function _nonIterableRest$17() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$17(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$17(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$17(o, minLen);
}
function _arrayLikeToArray$17(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$17(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$17(arr) {
if (Array.isArray(arr)) return arr;
}
function PanelBody(props) {
var rowNum = props.rowNum, colNum = props.colNum, baseDate = props.baseDate, getCellDate = props.getCellDate, prefixColumn = props.prefixColumn, rowClassName = props.rowClassName, titleFormat = props.titleFormat, getCellText = props.getCellText, getCellClassName = props.getCellClassName, headerCells = props.headerCells, _props$cellSelection = props.cellSelection, cellSelection = _props$cellSelection === void 0 ? true : _props$cellSelection, disabledDate = props.disabledDate;
var _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, classNames = _usePanelContext.classNames, styles = _usePanelContext.styles, type = _usePanelContext.panelType, now = _usePanelContext.now, contextDisabledDate = _usePanelContext.disabledDate, cellRender = _usePanelContext.cellRender, onHover = _usePanelContext.onHover, hoverValue = _usePanelContext.hoverValue, hoverRangeValue = _usePanelContext.hoverRangeValue, generateConfig = _usePanelContext.generateConfig, values = _usePanelContext.values, locale = _usePanelContext.locale, onSelect = _usePanelContext.onSelect;
var mergedDisabledDate = disabledDate || contextDisabledDate;
var cellPrefixCls = "".concat(prefixCls, "-cell");
var onCellDblClick = import_react.useContext(PickerHackContext).onCellDblClick;
var matchValues = function matchValues(date) {
return values.some(function(singleValue) {
return singleValue && isSame(generateConfig, locale, date, singleValue, type);
});
};
var rows = [];
for (var row = 0; row < rowNum; row += 1) {
var rowNode = [];
var rowStartDate = void 0;
var _loop = function _loop() {
var currentDate = getCellDate(baseDate, row * colNum + col);
var disabled = mergedDisabledDate === null || mergedDisabledDate === void 0 ? void 0 : mergedDisabledDate(currentDate, { type });
if (col === 0) {
rowStartDate = currentDate;
if (prefixColumn) rowNode.push(prefixColumn(rowStartDate));
}
var inRange = false;
var rangeStart = false;
var rangeEnd = false;
if (cellSelection && hoverRangeValue) {
var _hoverRangeValue = _slicedToArray$17(hoverRangeValue, 2), hoverStart = _hoverRangeValue[0], hoverEnd = _hoverRangeValue[1];
inRange = isInRange(generateConfig, hoverStart, hoverEnd, currentDate);
rangeStart = isSame(generateConfig, locale, currentDate, hoverStart, type);
rangeEnd = isSame(generateConfig, locale, currentDate, hoverEnd, type);
}
var title = titleFormat ? formatValue(currentDate, {
locale,
format: titleFormat,
generateConfig
}) : void 0;
var inner = /* @__PURE__ */ import_react.createElement("div", { className: "".concat(cellPrefixCls, "-inner") }, getCellText(currentDate));
rowNode.push(/* @__PURE__ */ import_react.createElement("td", {
key: col,
title,
className: clsx(cellPrefixCls, classNames.item, _objectSpread$9(_defineProperty$18(_defineProperty$18(_defineProperty$18(_defineProperty$18(_defineProperty$18(_defineProperty$18({}, "".concat(cellPrefixCls, "-disabled"), disabled), "".concat(cellPrefixCls, "-hover"), (hoverValue || []).some(function(date) {
return isSame(generateConfig, locale, currentDate, date, type);
})), "".concat(cellPrefixCls, "-in-range"), inRange && !rangeStart && !rangeEnd), "".concat(cellPrefixCls, "-range-start"), rangeStart), "".concat(cellPrefixCls, "-range-end"), rangeEnd), "".concat(prefixCls, "-cell-selected"), !hoverRangeValue && type !== "week" && matchValues(currentDate)), getCellClassName(currentDate))),
style: styles.item,
onClick: function onClick() {
if (!disabled) onSelect(currentDate);
},
onDoubleClick: function onDoubleClick() {
if (!disabled && onCellDblClick) onCellDblClick();
},
onMouseEnter: function onMouseEnter() {
if (!disabled) onHover === null || onHover === void 0 || onHover(currentDate);
},
onMouseLeave: function onMouseLeave() {
if (!disabled) onHover === null || onHover === void 0 || onHover(null);
}
}, cellRender ? cellRender(currentDate, {
prefixCls,
originNode: inner,
today: now,
type,
locale
}) : inner));
};
for (var col = 0; col < colNum; col += 1) _loop();
rows.push(/* @__PURE__ */ import_react.createElement("tr", {
key: row,
className: rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(rowStartDate)
}, rowNode));
}
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx("".concat(prefixCls, "-body"), classNames.body),
style: styles.body
}, /* @__PURE__ */ import_react.createElement("table", {
className: clsx("".concat(prefixCls, "-content"), classNames.content),
style: styles.content
}, headerCells && /* @__PURE__ */ import_react.createElement("thead", null, /* @__PURE__ */ import_react.createElement("tr", null, headerCells)), /* @__PURE__ */ import_react.createElement("tbody", null, rows)));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/PanelHeader.js
var HIDDEN_STYLE$1 = { visibility: "hidden" };
function PanelHeader(props) {
var offset = props.offset, superOffset = props.superOffset, onChange = props.onChange, getStart = props.getStart, getEnd = props.getEnd, children = props.children;
var _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, classNames = _usePanelContext.classNames, styles = _usePanelContext.styles, _usePanelContext$prev = _usePanelContext.prevIcon, prevIcon = _usePanelContext$prev === void 0 ? "‹" : _usePanelContext$prev, _usePanelContext$next = _usePanelContext.nextIcon, nextIcon = _usePanelContext$next === void 0 ? "›" : _usePanelContext$next, _usePanelContext$supe = _usePanelContext.superPrevIcon, superPrevIcon = _usePanelContext$supe === void 0 ? "«" : _usePanelContext$supe, _usePanelContext$supe2 = _usePanelContext.superNextIcon, superNextIcon = _usePanelContext$supe2 === void 0 ? "»" : _usePanelContext$supe2, minDate = _usePanelContext.minDate, maxDate = _usePanelContext.maxDate, generateConfig = _usePanelContext.generateConfig, locale = _usePanelContext.locale, pickerValue = _usePanelContext.pickerValue, type = _usePanelContext.panelType;
var headerPrefixCls = "".concat(prefixCls, "-header");
var _React$useContext = import_react.useContext(PickerHackContext), hidePrev = _React$useContext.hidePrev, hideNext = _React$useContext.hideNext, hideHeader = _React$useContext.hideHeader;
var disabledOffsetPrev = import_react.useMemo(function() {
if (!minDate || !offset || !getEnd) return false;
return !isSameOrAfter(generateConfig, locale, getEnd(offset(-1, pickerValue)), minDate, type);
}, [
minDate,
offset,
pickerValue,
getEnd,
generateConfig,
locale,
type
]);
var disabledSuperOffsetPrev = import_react.useMemo(function() {
if (!minDate || !superOffset || !getEnd) return false;
return !isSameOrAfter(generateConfig, locale, getEnd(superOffset(-1, pickerValue)), minDate, type);
}, [
minDate,
superOffset,
pickerValue,
getEnd,
generateConfig,
locale,
type
]);
var disabledOffsetNext = import_react.useMemo(function() {
if (!maxDate || !offset || !getStart) return false;
return !isSameOrAfter(generateConfig, locale, maxDate, getStart(offset(1, pickerValue)), type);
}, [
maxDate,
offset,
pickerValue,
getStart,
generateConfig,
locale,
type
]);
var disabledSuperOffsetNext = import_react.useMemo(function() {
if (!maxDate || !superOffset || !getStart) return false;
return !isSameOrAfter(generateConfig, locale, maxDate, getStart(superOffset(1, pickerValue)), type);
}, [
maxDate,
superOffset,
pickerValue,
getStart,
generateConfig,
locale,
type
]);
var onOffset = function onOffset(distance) {
if (offset) onChange(offset(distance, pickerValue));
};
var onSuperOffset = function onSuperOffset(distance) {
if (superOffset) onChange(superOffset(distance, pickerValue));
};
if (hideHeader) return null;
var prevBtnCls = "".concat(headerPrefixCls, "-prev-btn");
var nextBtnCls = "".concat(headerPrefixCls, "-next-btn");
var superPrevBtnCls = "".concat(headerPrefixCls, "-super-prev-btn");
var superNextBtnCls = "".concat(headerPrefixCls, "-super-next-btn");
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(headerPrefixCls, classNames.header),
style: styles.header
}, superOffset && /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": locale.previousYear,
onClick: function onClick() {
return onSuperOffset(-1);
},
tabIndex: -1,
className: clsx(superPrevBtnCls, disabledSuperOffsetPrev && "".concat(superPrevBtnCls, "-disabled")),
disabled: disabledSuperOffsetPrev,
style: hidePrev ? HIDDEN_STYLE$1 : {}
}, superPrevIcon), offset && /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": locale.previousMonth,
onClick: function onClick() {
return onOffset(-1);
},
tabIndex: -1,
className: clsx(prevBtnCls, disabledOffsetPrev && "".concat(prevBtnCls, "-disabled")),
disabled: disabledOffsetPrev,
style: hidePrev ? HIDDEN_STYLE$1 : {}
}, prevIcon), /* @__PURE__ */ import_react.createElement("div", { className: "".concat(headerPrefixCls, "-view") }, children), offset && /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": locale.nextMonth,
onClick: function onClick() {
return onOffset(1);
},
tabIndex: -1,
className: clsx(nextBtnCls, disabledOffsetNext && "".concat(nextBtnCls, "-disabled")),
disabled: disabledOffsetNext,
style: hideNext ? HIDDEN_STYLE$1 : {}
}, nextIcon), superOffset && /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": locale.nextYear,
onClick: function onClick() {
return onSuperOffset(1);
},
tabIndex: -1,
className: clsx(superNextBtnCls, disabledSuperOffsetNext && "".concat(superNextBtnCls, "-disabled")),
disabled: disabledSuperOffsetNext,
style: hideNext ? HIDDEN_STYLE$1 : {}
}, superNextIcon));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/DatePanel/index.js
function _typeof$17(o) {
"@babel/helpers - typeof";
return _typeof$17 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$17(o);
}
function _extends$67() {
_extends$67 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$67.apply(this, arguments);
}
function _defineProperty$17(obj, key, value) {
key = _toPropertyKey$17(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$17(t) {
var i = _toPrimitive$17(t, "string");
return "symbol" == _typeof$17(i) ? i : String(i);
}
function _toPrimitive$17(t, r) {
if ("object" != _typeof$17(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$17(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$16(arr, i) {
return _arrayWithHoles$16(arr) || _iterableToArrayLimit$16(arr, i) || _unsupportedIterableToArray$16(arr, i) || _nonIterableRest$16();
}
function _nonIterableRest$16() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$16(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$16(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$16(o, minLen);
}
function _arrayLikeToArray$16(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$16(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$16(arr) {
if (Array.isArray(arr)) return arr;
}
function DatePanel(props) {
var prefixCls = props.prefixCls, _props$panelName = props.panelName, panelName = _props$panelName === void 0 ? "date" : _props$panelName, locale = props.locale, generateConfig = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange, _props$mode = props.mode, mode = _props$mode === void 0 ? "date" : _props$mode, disabledDate = props.disabledDate, onSelect = props.onSelect, onHover = props.onHover, showWeek = props.showWeek;
var panelPrefixCls = "".concat(prefixCls, "-").concat(panelName, "-panel");
var cellPrefixCls = "".concat(prefixCls, "-cell");
var isWeek = mode === "week";
var _useInfo2 = _slicedToArray$16(useInfo(props, mode), 2), info = _useInfo2[0], now = _useInfo2[1];
var weekFirstDay = generateConfig.locale.getWeekFirstDay(locale.locale);
var monthStartDate = generateConfig.setDate(pickerValue, 1);
var baseDate = getWeekStartDate(locale.locale, generateConfig, monthStartDate);
var month = generateConfig.getMonth(pickerValue);
var prefixColumn = (showWeek === void 0 ? isWeek : showWeek) ? function(date) {
var disabled = disabledDate === null || disabledDate === void 0 ? void 0 : disabledDate(date, { type: "week" });
return /* @__PURE__ */ import_react.createElement("td", {
key: "week",
className: clsx(cellPrefixCls, "".concat(cellPrefixCls, "-week"), _defineProperty$17({}, "".concat(cellPrefixCls, "-disabled"), disabled)),
onClick: function onClick() {
if (!disabled) onSelect(date);
},
onMouseEnter: function onMouseEnter() {
if (!disabled) onHover === null || onHover === void 0 || onHover(date);
},
onMouseLeave: function onMouseLeave() {
if (!disabled) onHover === null || onHover === void 0 || onHover(null);
}
}, /* @__PURE__ */ import_react.createElement("div", { className: "".concat(cellPrefixCls, "-inner") }, generateConfig.locale.getWeek(locale.locale, date)));
} : null;
var headerCells = [];
var weekDaysLocale = locale.shortWeekDays || (generateConfig.locale.getShortWeekDays ? generateConfig.locale.getShortWeekDays(locale.locale) : []);
if (prefixColumn) headerCells.push(/* @__PURE__ */ import_react.createElement("th", { key: "empty" }, /* @__PURE__ */ import_react.createElement("span", { style: {
width: 0,
height: 0,
position: "absolute",
overflow: "hidden",
opacity: 0
} }, locale.week)));
for (var i = 0; i < 7; i += 1) headerCells.push(/* @__PURE__ */ import_react.createElement("th", { key: i }, weekDaysLocale[(i + weekFirstDay) % 7]));
var getCellDate = function getCellDate(date, offset) {
return generateConfig.addDate(date, offset);
};
var getCellText = function getCellText(date) {
return formatValue(date, {
locale,
format: locale.cellDateFormat,
generateConfig
});
};
var getCellClassName = function getCellClassName(date) {
return _defineProperty$17(_defineProperty$17({}, "".concat(prefixCls, "-cell-in-view"), isSameMonth$1(generateConfig, date, pickerValue)), "".concat(prefixCls, "-cell-today"), isSameDate$1(generateConfig, date, now));
};
var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);
var yearNode = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": locale.yearSelect,
key: "year",
onClick: function onClick() {
onModeChange("year", pickerValue);
},
tabIndex: -1,
className: "".concat(prefixCls, "-year-btn")
}, formatValue(pickerValue, {
locale,
format: locale.yearFormat,
generateConfig
}));
var monthNode = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": locale.monthSelect,
key: "month",
onClick: function onClick() {
onModeChange("month", pickerValue);
},
tabIndex: -1,
className: "".concat(prefixCls, "-month-btn")
}, locale.monthFormat ? formatValue(pickerValue, {
locale,
format: locale.monthFormat,
generateConfig
}) : monthsLocale[month]);
var monthYearNodes = locale.monthBeforeYear ? [monthNode, yearNode] : [yearNode, monthNode];
return /* @__PURE__ */ import_react.createElement(PanelContext.Provider, { value: info }, /* @__PURE__ */ import_react.createElement("div", { className: clsx(panelPrefixCls, showWeek && "".concat(panelPrefixCls, "-show-week")) }, /* @__PURE__ */ import_react.createElement(PanelHeader, {
offset: function offset(distance) {
return generateConfig.addMonth(pickerValue, distance);
},
superOffset: function superOffset(distance) {
return generateConfig.addYear(pickerValue, distance);
},
onChange: onPickerValueChange,
getStart: function getStart(date) {
return generateConfig.setDate(date, 1);
},
getEnd: function getEnd(date) {
var clone = generateConfig.setDate(date, 1);
clone = generateConfig.addMonth(clone, 1);
return generateConfig.addDate(clone, -1);
}
}, monthYearNodes), /* @__PURE__ */ import_react.createElement(PanelBody, _extends$67({ titleFormat: locale.fieldDateFormat }, props, {
colNum: 7,
rowNum: 6,
baseDate,
headerCells,
getCellDate,
getCellText,
getCellClassName,
prefixColumn,
cellSelection: !isWeek
}))));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/TimePanel/TimePanelBody/useScrollTo.js
var SPEED_PTG = 1 / 3;
function useScrollTo(ulRef, value) {
var scrollingRef = import_react.useRef(false);
var scrollRafRef = import_react.useRef(null);
var scrollDistRef = import_react.useRef(null);
var isScrolling = function isScrolling() {
return scrollingRef.current;
};
var stopScroll = function stopScroll() {
wrapperRaf.cancel(scrollRafRef.current);
scrollingRef.current = false;
};
var scrollRafTimesRef = import_react.useRef();
return [
useEvent(function startScroll() {
var ul = ulRef.current;
scrollDistRef.current = null;
scrollRafTimesRef.current = 0;
if (ul) {
var targetLi = ul.querySelector("[data-value=\"".concat(value, "\"]"));
var firstLi = ul.querySelector("li");
var doScroll = function doScroll() {
stopScroll();
scrollingRef.current = true;
scrollRafTimesRef.current += 1;
var currentTop = ul.scrollTop;
var firstLiTop = firstLi.offsetTop;
var targetLiTop = targetLi.offsetTop;
var targetTop = targetLiTop - firstLiTop;
if (targetLiTop === 0 && targetLi !== firstLi || !isVisible_default(ul)) {
if (scrollRafTimesRef.current <= 5) scrollRafRef.current = wrapperRaf(doScroll);
return;
}
var nextTop = currentTop + (targetTop - currentTop) * SPEED_PTG;
var dist = Math.abs(targetTop - nextTop);
if (scrollDistRef.current !== null && scrollDistRef.current < dist) {
stopScroll();
return;
}
scrollDistRef.current = dist;
if (dist <= 1) {
ul.scrollTop = targetTop;
stopScroll();
return;
}
ul.scrollTop = nextTop;
scrollRafRef.current = wrapperRaf(doScroll);
};
if (targetLi && firstLi) doScroll();
}
}),
stopScroll,
isScrolling
];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/TimePanel/TimePanelBody/TimeColumn.js
function _typeof$16(o) {
"@babel/helpers - typeof";
return _typeof$16 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$16(o);
}
function _defineProperty$16(obj, key, value) {
key = _toPropertyKey$16(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$16(t) {
var i = _toPrimitive$16(t, "string");
return "symbol" == _typeof$16(i) ? i : String(i);
}
function _toPrimitive$16(t, r) {
if ("object" != _typeof$16(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$16(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toConsumableArray$3(arr) {
return _arrayWithoutHoles$3(arr) || _iterableToArray$3(arr) || _unsupportedIterableToArray$15(arr) || _nonIterableSpread$3();
}
function _nonIterableSpread$3() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray$3(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles$3(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$15(arr);
}
function _slicedToArray$15(arr, i) {
return _arrayWithHoles$15(arr) || _iterableToArrayLimit$15(arr, i) || _unsupportedIterableToArray$15(arr, i) || _nonIterableRest$15();
}
function _nonIterableRest$15() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$15(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$15(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$15(o, minLen);
}
function _arrayLikeToArray$15(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$15(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$15(arr) {
if (Array.isArray(arr)) return arr;
}
var SCROLL_DELAY = 300;
function flattenUnits(units) {
return units.map(function(_ref) {
return [
_ref.value,
_ref.label,
_ref.disabled
].join(",");
}).join(";");
}
function TimeColumn(props) {
var units = props.units, value = props.value, optionalValue = props.optionalValue, type = props.type, onChange = props.onChange, onHover = props.onHover, onDblClick = props.onDblClick, changeOnScroll = props.changeOnScroll;
var _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, cellRender = _usePanelContext.cellRender, now = _usePanelContext.now, locale = _usePanelContext.locale, classNames = _usePanelContext.classNames, styles = _usePanelContext.styles;
var panelPrefixCls = "".concat(prefixCls, "-time-panel");
var cellPrefixCls = "".concat(prefixCls, "-time-panel-cell");
var ulRef = import_react.useRef(null);
var checkDelayRef = import_react.useRef();
var clearDelayCheck = function clearDelayCheck() {
clearTimeout(checkDelayRef.current);
};
var _useScrollTo2 = _slicedToArray$15(useScrollTo(ulRef, value !== null && value !== void 0 ? value : optionalValue), 3), syncScroll = _useScrollTo2[0], stopScroll = _useScrollTo2[1], isScrolling = _useScrollTo2[2];
useLayoutEffect$1(function() {
syncScroll();
clearDelayCheck();
return function() {
stopScroll();
clearDelayCheck();
};
}, [
value,
optionalValue,
flattenUnits(units)
]);
var onInternalScroll = function onInternalScroll(event) {
clearDelayCheck();
var target = event.target;
if (!isScrolling() && changeOnScroll) checkDelayRef.current = setTimeout(function() {
var ul = ulRef.current;
var firstLiTop = ul.querySelector("li").offsetTop;
var liDistList = Array.from(ul.querySelectorAll("li")).map(function(li) {
return li.offsetTop - firstLiTop;
}).map(function(top, index) {
if (units[index].disabled) return Number.MAX_SAFE_INTEGER;
return Math.abs(top - target.scrollTop);
});
var minDist = Math.min.apply(Math, _toConsumableArray$3(liDistList));
var targetUnit = units[liDistList.findIndex(function(dist) {
return dist === minDist;
})];
if (targetUnit && !targetUnit.disabled) onChange(targetUnit.value);
}, SCROLL_DELAY);
};
var columnPrefixCls = "".concat(panelPrefixCls, "-column");
return /* @__PURE__ */ import_react.createElement("ul", {
className: columnPrefixCls,
ref: ulRef,
"data-type": type,
onScroll: onInternalScroll
}, units.map(function(_ref2) {
var label = _ref2.label, unitValue = _ref2.value, disabled = _ref2.disabled;
var inner = /* @__PURE__ */ import_react.createElement("div", { className: "".concat(cellPrefixCls, "-inner") }, label);
return /* @__PURE__ */ import_react.createElement("li", {
key: unitValue,
style: styles.item,
className: clsx(cellPrefixCls, classNames.item, _defineProperty$16(_defineProperty$16({}, "".concat(cellPrefixCls, "-selected"), value === unitValue), "".concat(cellPrefixCls, "-disabled"), disabled)),
onClick: function onClick() {
if (!disabled) onChange(unitValue);
},
onDoubleClick: function onDoubleClick() {
if (!disabled && onDblClick) onDblClick();
},
onMouseEnter: function onMouseEnter() {
onHover(unitValue);
},
onMouseLeave: function onMouseLeave() {
onHover(null);
},
"data-value": unitValue
}, cellRender ? cellRender(unitValue, {
prefixCls,
originNode: inner,
today: now,
type: "time",
subType: type,
locale
}) : inner);
}));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/TimePanel/TimePanelBody/index.js
function _extends$66() {
_extends$66 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$66.apply(this, arguments);
}
function _slicedToArray$14(arr, i) {
return _arrayWithHoles$14(arr) || _iterableToArrayLimit$14(arr, i) || _unsupportedIterableToArray$14(arr, i) || _nonIterableRest$14();
}
function _nonIterableRest$14() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$14(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$14(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$14(o, minLen);
}
function _arrayLikeToArray$14(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$14(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$14(arr) {
if (Array.isArray(arr)) return arr;
}
function isAM(hour) {
return hour < 12;
}
function TimePanelBody(props) {
var showHour = props.showHour, showMinute = props.showMinute, showSecond = props.showSecond, showMillisecond = props.showMillisecond, showMeridiem = props.use12Hours, changeOnScroll = props.changeOnScroll;
var _usePanelContext = usePanelContext(), prefixCls = _usePanelContext.prefixCls, classNames = _usePanelContext.classNames, styles = _usePanelContext.styles, values = _usePanelContext.values, generateConfig = _usePanelContext.generateConfig, locale = _usePanelContext.locale, onSelect = _usePanelContext.onSelect, _usePanelContext$onHo = _usePanelContext.onHover, onHover = _usePanelContext$onHo === void 0 ? function() {} : _usePanelContext$onHo, pickerValue = _usePanelContext.pickerValue;
var value = (values === null || values === void 0 ? void 0 : values[0]) || null;
var onCellDblClick = import_react.useContext(PickerHackContext).onCellDblClick;
var _useTimeInfo2 = _slicedToArray$14(useTimeInfo(generateConfig, props, value), 5), getValidTime = _useTimeInfo2[0], rowHourUnits = _useTimeInfo2[1], getMinuteUnits = _useTimeInfo2[2], getSecondUnits = _useTimeInfo2[3], getMillisecondUnits = _useTimeInfo2[4];
var getUnitValue = function getUnitValue(func) {
return [value && generateConfig[func](value), pickerValue && generateConfig[func](pickerValue)];
};
var _getUnitValue2 = _slicedToArray$14(getUnitValue("getHour"), 2), hour = _getUnitValue2[0], pickerHour = _getUnitValue2[1];
var _getUnitValue4 = _slicedToArray$14(getUnitValue("getMinute"), 2), minute = _getUnitValue4[0], pickerMinute = _getUnitValue4[1];
var _getUnitValue6 = _slicedToArray$14(getUnitValue("getSecond"), 2), second = _getUnitValue6[0], pickerSecond = _getUnitValue6[1];
var _getUnitValue8 = _slicedToArray$14(getUnitValue("getMillisecond"), 2), millisecond = _getUnitValue8[0], pickerMillisecond = _getUnitValue8[1];
var meridiem = hour === null ? null : isAM(hour) ? "am" : "pm";
var hourUnits = import_react.useMemo(function() {
if (!showMeridiem) return rowHourUnits;
return isAM(hour) ? rowHourUnits.filter(function(h) {
return isAM(h.value);
}) : rowHourUnits.filter(function(h) {
return !isAM(h.value);
});
}, [
hour,
rowHourUnits,
showMeridiem
]);
var getEnabled = function getEnabled(units, val) {
var _enabledUnits$;
var enabledUnits = units.filter(function(unit) {
return !unit.disabled;
});
return val !== null && val !== void 0 ? val : enabledUnits === null || enabledUnits === void 0 || (_enabledUnits$ = enabledUnits[0]) === null || _enabledUnits$ === void 0 ? void 0 : _enabledUnits$.value;
};
var validHour = getEnabled(rowHourUnits, hour);
var minuteUnits = import_react.useMemo(function() {
return getMinuteUnits(validHour);
}, [getMinuteUnits, validHour]);
var validMinute = getEnabled(minuteUnits, minute);
var secondUnits = import_react.useMemo(function() {
return getSecondUnits(validHour, validMinute);
}, [
getSecondUnits,
validHour,
validMinute
]);
var validSecond = getEnabled(secondUnits, second);
var millisecondUnits = import_react.useMemo(function() {
return getMillisecondUnits(validHour, validMinute, validSecond);
}, [
getMillisecondUnits,
validHour,
validMinute,
validSecond
]);
var validMillisecond = getEnabled(millisecondUnits, millisecond);
var meridiemUnits = import_react.useMemo(function() {
if (!showMeridiem) return [];
var base = generateConfig.getNow();
var amDate = generateConfig.setHour(base, 6);
var pmDate = generateConfig.setHour(base, 18);
var formatMeridiem = function formatMeridiem(date, defaultLabel) {
var cellMeridiemFormat = locale.cellMeridiemFormat;
return cellMeridiemFormat ? formatValue(date, {
generateConfig,
locale,
format: cellMeridiemFormat
}) : defaultLabel;
};
return [{
label: formatMeridiem(amDate, "AM"),
value: "am",
disabled: rowHourUnits.every(function(h) {
return h.disabled || !isAM(h.value);
})
}, {
label: formatMeridiem(pmDate, "PM"),
value: "pm",
disabled: rowHourUnits.every(function(h) {
return h.disabled || isAM(h.value);
})
}];
}, [
rowHourUnits,
showMeridiem,
generateConfig,
locale
]);
/**
* Check if time is validate or will match to validate one
*/
var triggerChange = function triggerChange(nextDate) {
onSelect(getValidTime(nextDate));
};
var triggerDateTmpl = import_react.useMemo(function() {
var tmpl = value || pickerValue || generateConfig.getNow();
var isNotNull = function isNotNull(num) {
return num !== null && num !== void 0;
};
if (isNotNull(hour)) {
tmpl = generateConfig.setHour(tmpl, hour);
tmpl = generateConfig.setMinute(tmpl, minute);
tmpl = generateConfig.setSecond(tmpl, second);
tmpl = generateConfig.setMillisecond(tmpl, millisecond);
} else if (isNotNull(pickerHour)) {
tmpl = generateConfig.setHour(tmpl, pickerHour);
tmpl = generateConfig.setMinute(tmpl, pickerMinute);
tmpl = generateConfig.setSecond(tmpl, pickerSecond);
tmpl = generateConfig.setMillisecond(tmpl, pickerMillisecond);
} else if (isNotNull(validHour)) {
tmpl = generateConfig.setHour(tmpl, validHour);
tmpl = generateConfig.setMinute(tmpl, validMinute);
tmpl = generateConfig.setSecond(tmpl, validSecond);
tmpl = generateConfig.setMillisecond(tmpl, validMillisecond);
}
return tmpl;
}, [
value,
pickerValue,
hour,
minute,
second,
millisecond,
validHour,
validMinute,
validSecond,
validMillisecond,
pickerHour,
pickerMinute,
pickerSecond,
pickerMillisecond,
generateConfig
]);
var fillColumnValue = function fillColumnValue(val, func) {
if (val === null) return null;
return generateConfig[func](triggerDateTmpl, val);
};
var getNextHourTime = function getNextHourTime(val) {
return fillColumnValue(val, "setHour");
};
var getNextMinuteTime = function getNextMinuteTime(val) {
return fillColumnValue(val, "setMinute");
};
var getNextSecondTime = function getNextSecondTime(val) {
return fillColumnValue(val, "setSecond");
};
var getNextMillisecondTime = function getNextMillisecondTime(val) {
return fillColumnValue(val, "setMillisecond");
};
var getMeridiemTime = function getMeridiemTime(val) {
if (val === null) return null;
if (val === "am" && !isAM(hour)) return generateConfig.setHour(triggerDateTmpl, hour - 12);
else if (val === "pm" && isAM(hour)) return generateConfig.setHour(triggerDateTmpl, hour + 12);
return triggerDateTmpl;
};
var onHourChange = function onHourChange(val) {
triggerChange(getNextHourTime(val));
};
var onMinuteChange = function onMinuteChange(val) {
triggerChange(getNextMinuteTime(val));
};
var onSecondChange = function onSecondChange(val) {
triggerChange(getNextSecondTime(val));
};
var onMillisecondChange = function onMillisecondChange(val) {
triggerChange(getNextMillisecondTime(val));
};
var onMeridiemChange = function onMeridiemChange(val) {
triggerChange(getMeridiemTime(val));
};
var onHourHover = function onHourHover(val) {
onHover(getNextHourTime(val));
};
var onMinuteHover = function onMinuteHover(val) {
onHover(getNextMinuteTime(val));
};
var onSecondHover = function onSecondHover(val) {
onHover(getNextSecondTime(val));
};
var onMillisecondHover = function onMillisecondHover(val) {
onHover(getNextMillisecondTime(val));
};
var onMeridiemHover = function onMeridiemHover(val) {
onHover(getMeridiemTime(val));
};
var sharedColumnProps = {
onDblClick: onCellDblClick,
changeOnScroll
};
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx("".concat(prefixCls, "-content"), classNames.content),
style: styles.content
}, showHour && /* @__PURE__ */ import_react.createElement(TimeColumn, _extends$66({
units: hourUnits,
value: hour,
optionalValue: pickerHour,
type: "hour",
onChange: onHourChange,
onHover: onHourHover
}, sharedColumnProps)), showMinute && /* @__PURE__ */ import_react.createElement(TimeColumn, _extends$66({
units: minuteUnits,
value: minute,
optionalValue: pickerMinute,
type: "minute",
onChange: onMinuteChange,
onHover: onMinuteHover
}, sharedColumnProps)), showSecond && /* @__PURE__ */ import_react.createElement(TimeColumn, _extends$66({
units: secondUnits,
value: second,
optionalValue: pickerSecond,
type: "second",
onChange: onSecondChange,
onHover: onSecondHover
}, sharedColumnProps)), showMillisecond && /* @__PURE__ */ import_react.createElement(TimeColumn, _extends$66({
units: millisecondUnits,
value: millisecond,
optionalValue: pickerMillisecond,
type: "millisecond",
onChange: onMillisecondChange,
onHover: onMillisecondHover
}, sharedColumnProps)), showMeridiem && /* @__PURE__ */ import_react.createElement(TimeColumn, _extends$66({
units: meridiemUnits,
value: meridiem,
type: "meridiem",
onChange: onMeridiemChange,
onHover: onMeridiemHover
}, sharedColumnProps)));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/TimePanel/index.js
function _slicedToArray$13(arr, i) {
return _arrayWithHoles$13(arr) || _iterableToArrayLimit$13(arr, i) || _unsupportedIterableToArray$13(arr, i) || _nonIterableRest$13();
}
function _nonIterableRest$13() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$13(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$13(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$13(o, minLen);
}
function _arrayLikeToArray$13(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$13(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$13(arr) {
if (Array.isArray(arr)) return arr;
}
function TimePanel(props) {
var prefixCls = props.prefixCls, value = props.value, locale = props.locale, generateConfig = props.generateConfig, showTime = props.showTime;
var format = (showTime || {}).format;
var panelPrefixCls = "".concat(prefixCls, "-time-panel");
var info = _slicedToArray$13(useInfo(props, "time"), 1)[0];
return /* @__PURE__ */ import_react.createElement(PanelContext.Provider, { value: info }, /* @__PURE__ */ import_react.createElement("div", { className: clsx(panelPrefixCls) }, /* @__PURE__ */ import_react.createElement(PanelHeader, null, value ? formatValue(value, {
locale,
format,
generateConfig
}) : "\xA0"), /* @__PURE__ */ import_react.createElement(TimePanelBody, showTime)));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/DateTimePanel/index.js
function _extends$65() {
_extends$65 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$65.apply(this, arguments);
}
function _slicedToArray$12(arr, i) {
return _arrayWithHoles$12(arr) || _iterableToArrayLimit$12(arr, i) || _unsupportedIterableToArray$12(arr, i) || _nonIterableRest$12();
}
function _nonIterableRest$12() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$12(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$12(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$12(o, minLen);
}
function _arrayLikeToArray$12(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$12(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$12(arr) {
if (Array.isArray(arr)) return arr;
}
function DateTimePanel(props) {
var prefixCls = props.prefixCls, generateConfig = props.generateConfig, showTime = props.showTime, onSelect = props.onSelect, value = props.value, pickerValue = props.pickerValue, onHover = props.onHover;
var panelPrefixCls = "".concat(prefixCls, "-datetime-panel");
var getValidTime = _slicedToArray$12(useTimeInfo(generateConfig, showTime), 1)[0];
var mergeTime = function mergeTime(date) {
if (value) return fillTime(generateConfig, date, value);
return fillTime(generateConfig, date, pickerValue);
};
return /* @__PURE__ */ import_react.createElement("div", { className: panelPrefixCls }, /* @__PURE__ */ import_react.createElement(DatePanel, _extends$65({}, props, {
onSelect: function onDateSelect(date) {
var cloneDate = mergeTime(date);
onSelect(getValidTime(cloneDate, cloneDate));
},
onHover: function onDateHover(date) {
onHover === null || onHover === void 0 || onHover(date ? mergeTime(date) : date);
}
})), /* @__PURE__ */ import_react.createElement(TimePanel, props));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/DecadePanel/index.js
function _typeof$15(o) {
"@babel/helpers - typeof";
return _typeof$15 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$15(o);
}
function _extends$64() {
_extends$64 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$64.apply(this, arguments);
}
function _defineProperty$15(obj, key, value) {
key = _toPropertyKey$15(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$15(t) {
var i = _toPrimitive$15(t, "string");
return "symbol" == _typeof$15(i) ? i : String(i);
}
function _toPrimitive$15(t, r) {
if ("object" != _typeof$15(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$15(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$11(arr, i) {
return _arrayWithHoles$11(arr) || _iterableToArrayLimit$11(arr, i) || _unsupportedIterableToArray$11(arr, i) || _nonIterableRest$11();
}
function _nonIterableRest$11() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$11(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$11(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$11(o, minLen);
}
function _arrayLikeToArray$11(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$11(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$11(arr) {
if (Array.isArray(arr)) return arr;
}
function DecadePanel(props) {
var prefixCls = props.prefixCls, locale = props.locale, generateConfig = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange;
var panelPrefixCls = "".concat(prefixCls, "-decade-panel");
var info = _slicedToArray$11(useInfo(props, "decade"), 1)[0];
var getStartYear = function getStartYear(date) {
var startYear = Math.floor(generateConfig.getYear(date) / 100) * 100;
return generateConfig.setYear(date, startYear);
};
var getEndYear = function getEndYear(date) {
var startYear = getStartYear(date);
return generateConfig.addYear(startYear, 99);
};
var startYearDate = getStartYear(pickerValue);
var endYearDate = getEndYear(pickerValue);
var baseDate = generateConfig.addYear(startYearDate, -10);
var getCellDate = function getCellDate(date, offset) {
return generateConfig.addYear(date, offset * 10);
};
var getCellText = function getCellText(date) {
var cellYearFormat = locale.cellYearFormat;
var startYearStr = formatValue(date, {
locale,
format: cellYearFormat,
generateConfig
});
var endYearStr = formatValue(generateConfig.addYear(date, 9), {
locale,
format: cellYearFormat,
generateConfig
});
return "".concat(startYearStr, "-").concat(endYearStr);
};
var getCellClassName = function getCellClassName(date) {
return _defineProperty$15({}, "".concat(prefixCls, "-cell-in-view"), isSameDecade(generateConfig, date, startYearDate) || isSameDecade(generateConfig, date, endYearDate) || isInRange(generateConfig, startYearDate, endYearDate, date));
};
var mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
var baseStartDate = generateConfig.setDate(currentDate, 1);
var baseStartMonth = generateConfig.setMonth(baseStartDate, 0);
var baseStartYear = generateConfig.setYear(baseStartMonth, Math.floor(generateConfig.getYear(baseStartMonth) / 10) * 10);
var baseEndYear = generateConfig.addYear(baseStartYear, 10);
var baseEndDate = generateConfig.addDate(baseEndYear, -1);
return disabledDate(baseStartYear, disabledInfo) && disabledDate(baseEndDate, disabledInfo);
} : null;
var yearNode = "".concat(formatValue(startYearDate, {
locale,
format: locale.yearFormat,
generateConfig
}), "-").concat(formatValue(endYearDate, {
locale,
format: locale.yearFormat,
generateConfig
}));
return /* @__PURE__ */ import_react.createElement(PanelContext.Provider, { value: info }, /* @__PURE__ */ import_react.createElement("div", { className: panelPrefixCls }, /* @__PURE__ */ import_react.createElement(PanelHeader, {
superOffset: function superOffset(distance) {
return generateConfig.addYear(pickerValue, distance * 100);
},
onChange: onPickerValueChange,
getStart: getStartYear,
getEnd: getEndYear
}, yearNode), /* @__PURE__ */ import_react.createElement(PanelBody, _extends$64({}, props, {
disabledDate: mergedDisabledDate,
colNum: 3,
rowNum: 4,
baseDate,
getCellDate,
getCellText,
getCellClassName
}))));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/MonthPanel/index.js
function _typeof$14(o) {
"@babel/helpers - typeof";
return _typeof$14 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$14(o);
}
function _extends$63() {
_extends$63 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$63.apply(this, arguments);
}
function _defineProperty$14(obj, key, value) {
key = _toPropertyKey$14(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$14(t) {
var i = _toPrimitive$14(t, "string");
return "symbol" == _typeof$14(i) ? i : String(i);
}
function _toPrimitive$14(t, r) {
if ("object" != _typeof$14(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$14(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$10(arr, i) {
return _arrayWithHoles$10(arr) || _iterableToArrayLimit$10(arr, i) || _unsupportedIterableToArray$10(arr, i) || _nonIterableRest$10();
}
function _nonIterableRest$10() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$10(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$10(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$10(o, minLen);
}
function _arrayLikeToArray$10(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$10(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$10(arr) {
if (Array.isArray(arr)) return arr;
}
function MonthPanel(props) {
var prefixCls = props.prefixCls, locale = props.locale, generateConfig = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange;
var panelPrefixCls = "".concat(prefixCls, "-month-panel");
var info = _slicedToArray$10(useInfo(props, "month"), 1)[0];
var baseDate = generateConfig.setMonth(pickerValue, 0);
var monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);
var getCellDate = function getCellDate(date, offset) {
return generateConfig.addMonth(date, offset);
};
var getCellText = function getCellText(date) {
var month = generateConfig.getMonth(date);
return locale.monthFormat ? formatValue(date, {
locale,
format: locale.monthFormat,
generateConfig
}) : monthsLocale[month];
};
var getCellClassName = function getCellClassName() {
return _defineProperty$14({}, "".concat(prefixCls, "-cell-in-view"), true);
};
var mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
var startDate = generateConfig.setDate(currentDate, 1);
var nextMonthStartDate = generateConfig.setMonth(startDate, generateConfig.getMonth(startDate) + 1);
var endDate = generateConfig.addDate(nextMonthStartDate, -1);
return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
} : null;
var yearNode = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
key: "year",
"aria-label": locale.yearSelect,
onClick: function onClick() {
onModeChange("year");
},
tabIndex: -1,
className: "".concat(prefixCls, "-year-btn")
}, formatValue(pickerValue, {
locale,
format: locale.yearFormat,
generateConfig
}));
return /* @__PURE__ */ import_react.createElement(PanelContext.Provider, { value: info }, /* @__PURE__ */ import_react.createElement("div", { className: panelPrefixCls }, /* @__PURE__ */ import_react.createElement(PanelHeader, {
superOffset: function superOffset(distance) {
return generateConfig.addYear(pickerValue, distance);
},
onChange: onPickerValueChange,
getStart: function getStart(date) {
return generateConfig.setMonth(date, 0);
},
getEnd: function getEnd(date) {
return generateConfig.setMonth(date, 11);
}
}, yearNode), /* @__PURE__ */ import_react.createElement(PanelBody, _extends$63({}, props, {
disabledDate: mergedDisabledDate,
titleFormat: locale.fieldMonthFormat,
colNum: 3,
rowNum: 4,
baseDate,
getCellDate,
getCellText,
getCellClassName
}))));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/QuarterPanel/index.js
function _typeof$13(o) {
"@babel/helpers - typeof";
return _typeof$13 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$13(o);
}
function _extends$62() {
_extends$62 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$62.apply(this, arguments);
}
function _defineProperty$13(obj, key, value) {
key = _toPropertyKey$13(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$13(t) {
var i = _toPrimitive$13(t, "string");
return "symbol" == _typeof$13(i) ? i : String(i);
}
function _toPrimitive$13(t, r) {
if ("object" != _typeof$13(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$13(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$9(arr, i) {
return _arrayWithHoles$9(arr) || _iterableToArrayLimit$9(arr, i) || _unsupportedIterableToArray$9(arr, i) || _nonIterableRest$9();
}
function _nonIterableRest$9() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$9(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$9(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$9(o, minLen);
}
function _arrayLikeToArray$9(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$9(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$9(arr) {
if (Array.isArray(arr)) return arr;
}
function QuarterPanel(props) {
var prefixCls = props.prefixCls, locale = props.locale, generateConfig = props.generateConfig, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange;
var panelPrefixCls = "".concat(prefixCls, "-quarter-panel");
var info = _slicedToArray$9(useInfo(props, "quarter"), 1)[0];
var baseDate = generateConfig.setMonth(pickerValue, 0);
var getCellDate = function getCellDate(date, offset) {
return generateConfig.addMonth(date, offset * 3);
};
var getCellText = function getCellText(date) {
return formatValue(date, {
locale,
format: locale.cellQuarterFormat,
generateConfig
});
};
var getCellClassName = function getCellClassName() {
return _defineProperty$13({}, "".concat(prefixCls, "-cell-in-view"), true);
};
var yearNode = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
key: "year",
"aria-label": locale.yearSelect,
onClick: function onClick() {
onModeChange("year");
},
tabIndex: -1,
className: "".concat(prefixCls, "-year-btn")
}, formatValue(pickerValue, {
locale,
format: locale.yearFormat,
generateConfig
}));
return /* @__PURE__ */ import_react.createElement(PanelContext.Provider, { value: info }, /* @__PURE__ */ import_react.createElement("div", { className: panelPrefixCls }, /* @__PURE__ */ import_react.createElement(PanelHeader, {
superOffset: function superOffset(distance) {
return generateConfig.addYear(pickerValue, distance);
},
onChange: onPickerValueChange,
getStart: function getStart(date) {
return generateConfig.setMonth(date, 0);
},
getEnd: function getEnd(date) {
return generateConfig.setMonth(date, 11);
}
}, yearNode), /* @__PURE__ */ import_react.createElement(PanelBody, _extends$62({}, props, {
titleFormat: locale.fieldQuarterFormat,
colNum: 4,
rowNum: 1,
baseDate,
getCellDate,
getCellText,
getCellClassName
}))));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/WeekPanel/index.js
function _typeof$12(o) {
"@babel/helpers - typeof";
return _typeof$12 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$12(o);
}
function _extends$61() {
_extends$61 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$61.apply(this, arguments);
}
function _defineProperty$12(obj, key, value) {
key = _toPropertyKey$12(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$12(t) {
var i = _toPrimitive$12(t, "string");
return "symbol" == _typeof$12(i) ? i : String(i);
}
function _toPrimitive$12(t, r) {
if ("object" != _typeof$12(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$12(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$8(arr, i) {
return _arrayWithHoles$8(arr) || _iterableToArrayLimit$8(arr, i) || _unsupportedIterableToArray$8(arr, i) || _nonIterableRest$8();
}
function _nonIterableRest$8() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$8(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$8(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$8(o, minLen);
}
function _arrayLikeToArray$8(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$8(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$8(arr) {
if (Array.isArray(arr)) return arr;
}
function WeekPanel(props) {
var prefixCls = props.prefixCls, generateConfig = props.generateConfig, locale = props.locale, value = props.value, hoverValue = props.hoverValue, hoverRangeValue = props.hoverRangeValue;
var localeName = locale.locale;
var rowPrefixCls = "".concat(prefixCls, "-week-panel-row");
return /* @__PURE__ */ import_react.createElement(DatePanel, _extends$61({}, props, {
mode: "week",
panelName: "week",
rowClassName: function rowClassName(currentDate) {
var rangeCls = {};
if (hoverRangeValue) {
var _hoverRangeValue = _slicedToArray$8(hoverRangeValue, 2), rangeStart = _hoverRangeValue[0], rangeEnd = _hoverRangeValue[1];
var isRangeStart = isSameWeek(generateConfig, localeName, rangeStart, currentDate);
var isRangeEnd = isSameWeek(generateConfig, localeName, rangeEnd, currentDate);
rangeCls["".concat(rowPrefixCls, "-range-start")] = isRangeStart;
rangeCls["".concat(rowPrefixCls, "-range-end")] = isRangeEnd;
rangeCls["".concat(rowPrefixCls, "-range-hover")] = !isRangeStart && !isRangeEnd && isInRange(generateConfig, rangeStart, rangeEnd, currentDate);
}
if (hoverValue) rangeCls["".concat(rowPrefixCls, "-hover")] = hoverValue.some(function(date) {
return isSameWeek(generateConfig, localeName, currentDate, date);
});
return clsx(rowPrefixCls, _defineProperty$12({}, "".concat(rowPrefixCls, "-selected"), !hoverRangeValue && isSameWeek(generateConfig, localeName, value, currentDate)), rangeCls);
}
}));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/YearPanel/index.js
function _typeof$11(o) {
"@babel/helpers - typeof";
return _typeof$11 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$11(o);
}
function _extends$60() {
_extends$60 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$60.apply(this, arguments);
}
function _defineProperty$11(obj, key, value) {
key = _toPropertyKey$11(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$11(t) {
var i = _toPrimitive$11(t, "string");
return "symbol" == _typeof$11(i) ? i : String(i);
}
function _toPrimitive$11(t, r) {
if ("object" != _typeof$11(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$11(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$7(arr, i) {
return _arrayWithHoles$7(arr) || _iterableToArrayLimit$7(arr, i) || _unsupportedIterableToArray$7(arr, i) || _nonIterableRest$7();
}
function _nonIterableRest$7() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$7(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$7(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$7(o, minLen);
}
function _arrayLikeToArray$7(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$7(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$7(arr) {
if (Array.isArray(arr)) return arr;
}
function YearPanel(props) {
var prefixCls = props.prefixCls, locale = props.locale, generateConfig = props.generateConfig, pickerValue = props.pickerValue, disabledDate = props.disabledDate, onPickerValueChange = props.onPickerValueChange, onModeChange = props.onModeChange;
var panelPrefixCls = "".concat(prefixCls, "-year-panel");
var info = _slicedToArray$7(useInfo(props, "year"), 1)[0];
var getStartYear = function getStartYear(date) {
var startYear = Math.floor(generateConfig.getYear(date) / 10) * 10;
return generateConfig.setYear(date, startYear);
};
var getEndYear = function getEndYear(date) {
var startYear = getStartYear(date);
return generateConfig.addYear(startYear, 9);
};
var startYearDate = getStartYear(pickerValue);
var endYearDate = getEndYear(pickerValue);
var baseDate = generateConfig.addYear(startYearDate, -1);
var getCellDate = function getCellDate(date, offset) {
return generateConfig.addYear(date, offset);
};
var getCellText = function getCellText(date) {
return formatValue(date, {
locale,
format: locale.cellYearFormat,
generateConfig
});
};
var getCellClassName = function getCellClassName(date) {
return _defineProperty$11({}, "".concat(prefixCls, "-cell-in-view"), isSameYear$1(generateConfig, date, startYearDate) || isSameYear$1(generateConfig, date, endYearDate) || isInRange(generateConfig, startYearDate, endYearDate, date));
};
var mergedDisabledDate = disabledDate ? function(currentDate, disabledInfo) {
var startMonth = generateConfig.setMonth(currentDate, 0);
var startDate = generateConfig.setDate(startMonth, 1);
var endMonth = generateConfig.addYear(startDate, 1);
var endDate = generateConfig.addDate(endMonth, -1);
return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
} : null;
var yearNode = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
key: "decade",
"aria-label": locale.decadeSelect,
onClick: function onClick() {
onModeChange("decade");
},
tabIndex: -1,
className: "".concat(prefixCls, "-decade-btn")
}, formatValue(startYearDate, {
locale,
format: locale.yearFormat,
generateConfig
}), "-", formatValue(endYearDate, {
locale,
format: locale.yearFormat,
generateConfig
}));
return /* @__PURE__ */ import_react.createElement(PanelContext.Provider, { value: info }, /* @__PURE__ */ import_react.createElement("div", { className: panelPrefixCls }, /* @__PURE__ */ import_react.createElement(PanelHeader, {
superOffset: function superOffset(distance) {
return generateConfig.addYear(pickerValue, distance * 10);
},
onChange: onPickerValueChange,
getStart: getStartYear,
getEnd: getEndYear
}, yearNode), /* @__PURE__ */ import_react.createElement(PanelBody, _extends$60({}, props, {
disabledDate: mergedDisabledDate,
titleFormat: locale.fieldYearFormat,
colNum: 3,
rowNum: 4,
baseDate,
getCellDate,
getCellText,
getCellClassName
}))));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerPanel/index.js
function _typeof$10(o) {
"@babel/helpers - typeof";
return _typeof$10 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$10(o);
}
function _extends$59() {
_extends$59 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$59.apply(this, arguments);
}
function ownKeys$8(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$8(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$8(Object(t), !0).forEach(function(r) {
_defineProperty$10(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$10(obj, key, value) {
key = _toPropertyKey$10(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$10(t) {
var i = _toPrimitive$10(t, "string");
return "symbol" == _typeof$10(i) ? i : String(i);
}
function _toPrimitive$10(t, r) {
if ("object" != _typeof$10(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$10(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toConsumableArray$2(arr) {
return _arrayWithoutHoles$2(arr) || _iterableToArray$2(arr) || _unsupportedIterableToArray$6(arr) || _nonIterableSpread$2();
}
function _nonIterableSpread$2() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray$2(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles$2(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$6(arr);
}
function _slicedToArray$6(arr, i) {
return _arrayWithHoles$6(arr) || _iterableToArrayLimit$6(arr, i) || _unsupportedIterableToArray$6(arr, i) || _nonIterableRest$6();
}
function _nonIterableRest$6() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$6(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$6(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$6(o, minLen);
}
function _arrayLikeToArray$6(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$6(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$6(arr) {
if (Array.isArray(arr)) return arr;
}
var DefaultComponents = {
date: DatePanel,
datetime: DateTimePanel,
week: WeekPanel,
month: MonthPanel,
quarter: QuarterPanel,
year: YearPanel,
decade: DecadePanel,
time: TimePanel
};
function PickerPanel(props, ref) {
var panelClassNames = props.classNames, panelStyles = props.styles, locale = props.locale, generateConfig = props.generateConfig, direction = props.direction, prefixCls = props.prefixCls, _props$tabIndex = props.tabIndex, tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex, multiple = props.multiple, defaultValue = props.defaultValue, value = props.value, onChange = props.onChange, onSelect = props.onSelect, defaultPickerValue = props.defaultPickerValue, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, mode = props.mode, onPanelChange = props.onPanelChange, _props$picker = props.picker, picker = _props$picker === void 0 ? "date" : _props$picker, showTime = props.showTime, hoverValue = props.hoverValue, hoverRangeValue = props.hoverRangeValue, cellRender = props.cellRender, dateRender = props.dateRender, monthCellRender = props.monthCellRender, _props$components = props.components, components = _props$components === void 0 ? {} : _props$components, hideHeader = props.hideHeader;
var _ref = import_react.useContext(PickerContext) || {}, contextPrefixCls = _ref.prefixCls, pickerClassNames = _ref.classNames, pickerStyles = _ref.styles;
var mergedPrefixCls = contextPrefixCls || prefixCls || "rc-picker";
var rootRef = import_react.useRef();
import_react.useImperativeHandle(ref, function() {
return { nativeElement: rootRef.current };
});
var _getTimeProps2 = _slicedToArray$6(getTimeProps(props), 4), timeProps = _getTimeProps2[0], localeTimeProps = _getTimeProps2[1], showTimeFormat = _getTimeProps2[2], propFormat = _getTimeProps2[3];
var filledLocale = useLocale(locale, localeTimeProps);
var internalPicker = picker === "date" && showTime ? "datetime" : picker;
var mergedShowTime = import_react.useMemo(function() {
return fillShowTimeConfig(internalPicker, showTimeFormat, propFormat, timeProps, filledLocale);
}, [
internalPicker,
showTimeFormat,
propFormat,
timeProps,
filledLocale
]);
var now = generateConfig.getNow();
var _useControlledState2 = _slicedToArray$6(useControlledState(picker || "date", mode), 2), mergedMode = _useControlledState2[0], setMergedMode = _useControlledState2[1];
var internalMode = mergedMode === "date" && mergedShowTime ? "datetime" : mergedMode;
var toggleDates = useToggleDates(generateConfig, locale, internalPicker);
var _useControlledState4 = _slicedToArray$6(useControlledState(defaultValue, value), 2), innerValue = _useControlledState4[0], setMergedValue = _useControlledState4[1];
var mergedValue = import_react.useMemo(function() {
var values = toArray$4(innerValue).filter(function(val) {
return val;
});
return multiple ? values : values.slice(0, 1);
}, [innerValue, multiple]);
var triggerChange = useEvent(function(nextValue) {
setMergedValue(nextValue);
if (onChange && (nextValue === null || mergedValue.length !== nextValue.length || mergedValue.some(function(ori, index) {
return !isSame(generateConfig, locale, ori, nextValue[index], internalPicker);
}))) onChange === null || onChange === void 0 || onChange(multiple ? nextValue : nextValue[0]);
});
var onInternalSelect = useEvent(function(newDate) {
onSelect === null || onSelect === void 0 || onSelect(newDate);
if (mergedMode === picker) triggerChange(multiple ? toggleDates(mergedValue, newDate) : [newDate]);
});
var _useControlledState6 = _slicedToArray$6(useControlledState(defaultPickerValue || mergedValue[0] || now, pickerValue), 2), mergedPickerValue = _useControlledState6[0], setInternalPickerValue = _useControlledState6[1];
import_react.useEffect(function() {
if (mergedValue[0] && !pickerValue) setInternalPickerValue(mergedValue[0]);
}, [mergedValue[0]]);
var triggerPanelChange = function triggerPanelChange(viewDate, nextMode) {
onPanelChange === null || onPanelChange === void 0 || onPanelChange(viewDate || pickerValue, nextMode || mergedMode);
};
var setPickerValue = function setPickerValue(nextPickerValue) {
var triggerPanelEvent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
setInternalPickerValue(nextPickerValue);
onPickerValueChange === null || onPickerValueChange === void 0 || onPickerValueChange(nextPickerValue);
if (triggerPanelEvent) triggerPanelChange(nextPickerValue);
};
var triggerModeChange = function triggerModeChange(nextMode, viewDate) {
setMergedMode(nextMode);
if (viewDate) setPickerValue(viewDate);
triggerPanelChange(viewDate, nextMode);
};
var onPanelValueSelect = function onPanelValueSelect(nextValue) {
onInternalSelect(nextValue);
setPickerValue(nextValue);
if (mergedMode !== picker) {
var decadeYearQueue = ["decade", "year"];
var decadeYearMonthQueue = [].concat(decadeYearQueue, ["month"]);
var queue = {
quarter: [].concat(decadeYearQueue, ["quarter"]),
week: [].concat(_toConsumableArray$2(decadeYearMonthQueue), ["week"]),
date: [].concat(_toConsumableArray$2(decadeYearMonthQueue), ["date"])
}[picker] || decadeYearMonthQueue;
var nextMode = queue[queue.indexOf(mergedMode) + 1];
if (nextMode) triggerModeChange(nextMode, nextValue);
}
};
var hoverRangeDate = import_react.useMemo(function() {
var start;
var end;
if (Array.isArray(hoverRangeValue)) {
var _hoverRangeValue = _slicedToArray$6(hoverRangeValue, 2);
start = _hoverRangeValue[0];
end = _hoverRangeValue[1];
} else start = hoverRangeValue;
if (!start && !end) return null;
start = start || end;
end = end || start;
return generateConfig.isAfter(start, end) ? [end, start] : [start, end];
}, [hoverRangeValue, generateConfig]);
var onInternalCellRender = useCellRender$1(cellRender, dateRender, monthCellRender);
var PanelComponent = components[internalMode] || DefaultComponents[internalMode] || DatePanel;
var sharedPanelContext = import_react.useMemo(function() {
var _ref2, _pickerClassNames$pop, _ref3, _pickerStyles$popup;
return {
classNames: (_ref2 = (_pickerClassNames$pop = pickerClassNames === null || pickerClassNames === void 0 ? void 0 : pickerClassNames.popup) !== null && _pickerClassNames$pop !== void 0 ? _pickerClassNames$pop : panelClassNames) !== null && _ref2 !== void 0 ? _ref2 : {},
styles: (_ref3 = (_pickerStyles$popup = pickerStyles === null || pickerStyles === void 0 ? void 0 : pickerStyles.popup) !== null && _pickerStyles$popup !== void 0 ? _pickerStyles$popup : panelStyles) !== null && _ref3 !== void 0 ? _ref3 : {}
};
}, [
pickerClassNames,
panelClassNames,
pickerStyles,
panelStyles
]);
var parentHackContext = import_react.useContext(PickerHackContext);
var pickerPanelContext = import_react.useMemo(function() {
return _objectSpread$8(_objectSpread$8({}, parentHackContext), {}, { hideHeader });
}, [parentHackContext, hideHeader]);
warningOnce(!mergedValue || mergedValue.every(function(val) {
return generateConfig.isValidate(val);
}), "Invalidate date pass to `value` or `defaultValue`.");
var panelCls = "".concat(mergedPrefixCls, "-panel");
var panelProps = pickProps(props, [
"showWeek",
"prevIcon",
"nextIcon",
"superPrevIcon",
"superNextIcon",
"disabledDate",
"minDate",
"maxDate",
"onHover"
]);
return /* @__PURE__ */ import_react.createElement(SharedPanelContext.Provider, { value: sharedPanelContext }, /* @__PURE__ */ import_react.createElement(PickerHackContext.Provider, { value: pickerPanelContext }, /* @__PURE__ */ import_react.createElement("div", {
ref: rootRef,
tabIndex,
className: clsx(panelCls, _defineProperty$10({}, "".concat(panelCls, "-rtl"), direction === "rtl"))
}, /* @__PURE__ */ import_react.createElement(PanelComponent, _extends$59({}, panelProps, {
showTime: mergedShowTime,
prefixCls: mergedPrefixCls,
locale: filledLocale,
generateConfig,
onModeChange: triggerModeChange,
pickerValue: mergedPickerValue,
onPickerValueChange: function onPickerValueChange(nextPickerValue) {
setPickerValue(nextPickerValue, true);
},
value: mergedValue[0],
onSelect: onPanelValueSelect,
values: mergedValue,
cellRender: onInternalCellRender,
hoverRangeValue: hoverRangeDate,
hoverValue
})))));
}
var RefPanelPicker = /* @__PURE__ */ import_react.memo(/* @__PURE__ */ import_react.forwardRef(PickerPanel));
RefPanelPicker.displayName = "PanelPicker";
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Popup/PopupPanel.js
function _typeof$9(o) {
"@babel/helpers - typeof";
return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$9(o);
}
function _extends$58() {
_extends$58 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$58.apply(this, arguments);
}
function ownKeys$7(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$7(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$7(Object(t), !0).forEach(function(r) {
_defineProperty$9(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$9(obj, key, value) {
key = _toPropertyKey$9(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$9(t) {
var i = _toPrimitive$9(t, "string");
return "symbol" == _typeof$9(i) ? i : String(i);
}
function _toPrimitive$9(t, r) {
if ("object" != _typeof$9(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$9(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function PopupPanel(props) {
var picker = props.picker, multiplePanel = props.multiplePanel, pickerValue = props.pickerValue, onPickerValueChange = props.onPickerValueChange, needConfirm = props.needConfirm, onSubmit = props.onSubmit, range = props.range, hoverValue = props.hoverValue;
var _React$useContext = import_react.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, generateConfig = _React$useContext.generateConfig;
var internalOffsetDate = import_react.useCallback(function(date, offset) {
return offsetPanelDate(generateConfig, picker, date, offset);
}, [generateConfig, picker]);
var nextPickerValue = import_react.useMemo(function() {
return internalOffsetDate(pickerValue, 1);
}, [pickerValue, internalOffsetDate]);
var onSecondPickerValueChange = function onSecondPickerValueChange(nextDate) {
onPickerValueChange(internalOffsetDate(nextDate, -1));
};
var sharedContext = { onCellDblClick: function onCellDblClick() {
if (needConfirm) onSubmit();
} };
var hideHeader = picker === "time";
var pickerProps = _objectSpread$7(_objectSpread$7({}, props), {}, {
hoverValue: null,
hoverRangeValue: null,
hideHeader
});
if (range) pickerProps.hoverRangeValue = hoverValue;
else pickerProps.hoverValue = hoverValue;
if (multiplePanel) return /* @__PURE__ */ import_react.createElement("div", { className: "".concat(prefixCls, "-panels") }, /* @__PURE__ */ import_react.createElement(PickerHackContext.Provider, { value: _objectSpread$7(_objectSpread$7({}, sharedContext), {}, { hideNext: true }) }, /* @__PURE__ */ import_react.createElement(RefPanelPicker, pickerProps)), /* @__PURE__ */ import_react.createElement(PickerHackContext.Provider, { value: _objectSpread$7(_objectSpread$7({}, sharedContext), {}, { hidePrev: true }) }, /* @__PURE__ */ import_react.createElement(RefPanelPicker, _extends$58({}, pickerProps, {
pickerValue: nextPickerValue,
onPickerValueChange: onSecondPickerValueChange
}))));
return /* @__PURE__ */ import_react.createElement(PickerHackContext.Provider, { value: _objectSpread$7({}, sharedContext) }, /* @__PURE__ */ import_react.createElement(RefPanelPicker, pickerProps));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Popup/PresetPanel.js
function executeValue(value) {
return typeof value === "function" ? value() : value;
}
function PresetPanel(props) {
var prefixCls = props.prefixCls, presets = props.presets, _onClick = props.onClick, onHover = props.onHover;
if (!presets.length) return null;
return /* @__PURE__ */ import_react.createElement("div", { className: "".concat(prefixCls, "-presets") }, /* @__PURE__ */ import_react.createElement("ul", null, presets.map(function(_ref, index) {
var label = _ref.label, value = _ref.value;
return /* @__PURE__ */ import_react.createElement("li", {
key: index,
onClick: function onClick() {
_onClick(executeValue(value));
},
onMouseEnter: function onMouseEnter() {
onHover(executeValue(value));
},
onMouseLeave: function onMouseLeave() {
onHover(null);
}
}, label);
})));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Popup/index.js
function _typeof$8(o) {
"@babel/helpers - typeof";
return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$8(o);
}
function ownKeys$6(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$6(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$6(Object(t), !0).forEach(function(r) {
_defineProperty$8(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$8(obj, key, value) {
key = _toPropertyKey$8(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$8(t) {
var i = _toPrimitive$8(t, "string");
return "symbol" == _typeof$8(i) ? i : String(i);
}
function _toPrimitive$8(t, r) {
if ("object" != _typeof$8(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$8(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _extends$57() {
_extends$57 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$57.apply(this, arguments);
}
function _slicedToArray$5(arr, i) {
return _arrayWithHoles$5(arr) || _iterableToArrayLimit$5(arr, i) || _unsupportedIterableToArray$5(arr, i) || _nonIterableRest$5();
}
function _nonIterableRest$5() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$5(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$5(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$5(o, minLen);
}
function _arrayLikeToArray$5(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$5(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$5(arr) {
if (Array.isArray(arr)) return arr;
}
function Popup(props) {
var _classNames$popup, _styles$popup;
var panelRender = props.panelRender, internalMode = props.internalMode, picker = props.picker, showNow = props.showNow, range = props.range, multiple = props.multiple, _props$activeInfo = props.activeInfo, activeInfo = _props$activeInfo === void 0 ? [
0,
0,
0
] : _props$activeInfo, presets = props.presets, onPresetHover = props.onPresetHover, onPresetSubmit = props.onPresetSubmit, onFocus = props.onFocus, onBlur = props.onBlur, onPanelMouseDown = props.onPanelMouseDown, direction = props.direction, value = props.value, onSelect = props.onSelect, isInvalid = props.isInvalid, defaultOpenValue = props.defaultOpenValue, onOk = props.onOk, onSubmit = props.onSubmit, classNames = props.classNames, styles = props.styles;
var prefixCls = import_react.useContext(PickerContext).prefixCls;
var panelPrefixCls = "".concat(prefixCls, "-panel");
var rtl = direction === "rtl";
var arrowRef = import_react.useRef(null);
var wrapperRef = import_react.useRef(null);
var _React$useState2 = _slicedToArray$5(import_react.useState(0), 2), containerWidth = _React$useState2[0], setContainerWidth = _React$useState2[1];
var _React$useState4 = _slicedToArray$5(import_react.useState(0), 2), containerOffset = _React$useState4[0], setContainerOffset = _React$useState4[1];
var _React$useState6 = _slicedToArray$5(import_react.useState(0), 2), arrowOffset = _React$useState6[0], setArrowOffset = _React$useState6[1];
var onResize = function onResize(info) {
if (info.width) setContainerWidth(info.width);
};
var _activeInfo = _slicedToArray$5(activeInfo, 3), activeInputLeft = _activeInfo[0], activeInputRight = _activeInfo[1], selectorWidth = _activeInfo[2];
var _React$useState8 = _slicedToArray$5(import_react.useState(0), 2), retryTimes = _React$useState8[0], setRetryTimes = _React$useState8[1];
import_react.useEffect(function() {
setRetryTimes(10);
}, [activeInputLeft]);
import_react.useEffect(function() {
if (range && wrapperRef.current) {
var _arrowRef$current;
var arrowWidth = ((_arrowRef$current = arrowRef.current) === null || _arrowRef$current === void 0 ? void 0 : _arrowRef$current.offsetWidth) || 0;
var wrapperRect = wrapperRef.current.getBoundingClientRect();
if (!wrapperRect.height || wrapperRect.right < 0) {
setRetryTimes(function(times) {
return Math.max(0, times - 1);
});
return;
}
setArrowOffset((rtl ? activeInputRight - arrowWidth : activeInputLeft) - wrapperRect.left);
if (containerWidth && containerWidth < selectorWidth) {
var offset = rtl ? wrapperRect.right - (activeInputRight - arrowWidth + containerWidth) : activeInputLeft + arrowWidth - wrapperRect.left - containerWidth;
setContainerOffset(Math.max(0, offset));
} else setContainerOffset(0);
}
}, [
retryTimes,
rtl,
containerWidth,
activeInputLeft,
activeInputRight,
selectorWidth,
range
]);
function filterEmpty(list) {
return list.filter(function(item) {
return item;
});
}
var valueList = import_react.useMemo(function() {
return filterEmpty(toArray$4(value));
}, [value]);
var isTimePickerEmptyValue = picker === "time" && !valueList.length;
var footerSubmitValue = import_react.useMemo(function() {
if (isTimePickerEmptyValue) return filterEmpty([defaultOpenValue]);
return valueList;
}, [
isTimePickerEmptyValue,
valueList,
defaultOpenValue
]);
var popupPanelValue = isTimePickerEmptyValue ? defaultOpenValue : valueList;
var disableSubmit = import_react.useMemo(function() {
if (!footerSubmitValue.length) return true;
return footerSubmitValue.some(function(val) {
return isInvalid(val);
});
}, [footerSubmitValue, isInvalid]);
var mergedNodes = /* @__PURE__ */ import_react.createElement("div", { className: "".concat(prefixCls, "-panel-layout") }, /* @__PURE__ */ import_react.createElement(PresetPanel, {
prefixCls,
presets,
onClick: onPresetSubmit,
onHover: onPresetHover
}), /* @__PURE__ */ import_react.createElement("div", null, /* @__PURE__ */ import_react.createElement(PopupPanel, _extends$57({}, props, { value: popupPanelValue })), /* @__PURE__ */ import_react.createElement(Footer$3, _extends$57({}, props, {
showNow: multiple ? false : showNow,
invalid: disableSubmit,
onSubmit: function onFooterSubmit() {
if (isTimePickerEmptyValue) onSelect(defaultOpenValue);
onOk();
onSubmit();
}
}))));
if (panelRender) mergedNodes = panelRender(mergedNodes);
var containerPrefixCls = "".concat(panelPrefixCls, "-container");
var marginLeft = "marginLeft";
var marginRight = "marginRight";
var renderNode = /* @__PURE__ */ import_react.createElement("div", {
onMouseDown: onPanelMouseDown,
tabIndex: -1,
className: clsx(containerPrefixCls, "".concat(prefixCls, "-").concat(internalMode, "-panel-container"), classNames === null || classNames === void 0 || (_classNames$popup = classNames.popup) === null || _classNames$popup === void 0 ? void 0 : _classNames$popup.container),
style: _objectSpread$6(_defineProperty$8(_defineProperty$8({}, rtl ? marginRight : marginLeft, containerOffset), rtl ? marginLeft : marginRight, "auto"), styles === null || styles === void 0 || (_styles$popup = styles.popup) === null || _styles$popup === void 0 ? void 0 : _styles$popup.container),
onFocus,
onBlur
}, mergedNodes);
if (range) renderNode = /* @__PURE__ */ import_react.createElement("div", {
onMouseDown: onPanelMouseDown,
ref: wrapperRef,
className: clsx("".concat(prefixCls, "-range-wrapper"), "".concat(prefixCls, "-").concat(picker, "-range-wrapper"))
}, /* @__PURE__ */ import_react.createElement("div", {
ref: arrowRef,
className: "".concat(prefixCls, "-range-arrow"),
style: { left: arrowOffset }
}), /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize }, renderNode));
return renderNode;
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/hooks/useInputProps.js
function _typeof$7(o) {
"@babel/helpers - typeof";
return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$7(o);
}
function ownKeys$5(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$5(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$5(Object(t), !0).forEach(function(r) {
_defineProperty$7(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$7(obj, key, value) {
key = _toPropertyKey$7(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$7(t) {
var i = _toPrimitive$7(t, "string");
return "symbol" == _typeof$7(i) ? i : String(i);
}
function _toPrimitive$7(t, r) {
if ("object" != _typeof$7(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$7(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function useInputProps(props, postProps) {
var format = props.format, maskFormat = props.maskFormat, generateConfig = props.generateConfig, locale = props.locale, preserveInvalidOnBlur = props.preserveInvalidOnBlur, inputReadOnly = props.inputReadOnly, required = props.required, ariaRequired = props["aria-required"], onSubmit = props.onSubmit, _onFocus = props.onFocus, _onBlur = props.onBlur, onInputChange = props.onInputChange, onInvalid = props.onInvalid, open = props.open, onOpenChange = props.onOpenChange, _onKeyDown = props.onKeyDown, _onChange = props.onChange, activeHelp = props.activeHelp, name = props.name, autoComplete = props.autoComplete, id = props.id, value = props.value, invalid = props.invalid, placeholder = props.placeholder, disabled = props.disabled, activeIndex = props.activeIndex, allHelp = props.allHelp, picker = props.picker;
var parseDate = function parseDate(str, formatStr) {
var parsed = generateConfig.locale.parse(locale.locale, str, [formatStr]);
return parsed && generateConfig.isValidate(parsed) ? parsed : null;
};
var firstFormat = format[0];
var getText = import_react.useCallback(function(date) {
return formatValue(date, {
locale,
format: firstFormat,
generateConfig
});
}, [
locale,
generateConfig,
firstFormat
]);
var valueTexts = import_react.useMemo(function() {
return value.map(getText);
}, [value, getText]);
var size = import_react.useMemo(function() {
var defaultSize = picker === "time" ? 8 : 10;
var length = typeof firstFormat === "function" ? firstFormat(generateConfig.getNow()).length : firstFormat.length;
return Math.max(defaultSize, length) + 2;
}, [
firstFormat,
picker,
generateConfig
]);
var _validateFormat = function validateFormat(text) {
for (var i = 0; i < format.length; i += 1) {
var singleFormat = format[i];
if (typeof singleFormat === "string") {
var parsed = parseDate(text, singleFormat);
if (parsed) return parsed;
}
}
return false;
};
return [function getInputProps(index) {
function getProp(propValue) {
return index !== void 0 ? propValue[index] : propValue;
}
var inputProps = _objectSpread$5(_objectSpread$5({}, pickAttrs(props, {
aria: true,
data: true
})), {}, {
format: maskFormat,
validateFormat: function validateFormat(text) {
return !!_validateFormat(text);
},
preserveInvalidOnBlur,
readOnly: inputReadOnly,
required,
"aria-required": ariaRequired,
name,
autoComplete,
size,
id: getProp(id),
value: getProp(valueTexts) || "",
invalid: getProp(invalid),
placeholder: getProp(placeholder),
active: activeIndex === index,
helped: allHelp || activeHelp && activeIndex === index,
disabled: getProp(disabled),
onFocus: function onFocus(event) {
_onFocus(event, index);
},
onBlur: function onBlur(event) {
_onBlur(event, index);
},
onSubmit,
onChange: function onChange(text) {
onInputChange();
var parsed = _validateFormat(text);
if (parsed) {
onInvalid(false, index);
_onChange(parsed, index);
return;
}
onInvalid(!!text, index);
},
onHelp: function onHelp() {
onOpenChange(true, { index });
},
onKeyDown: function onKeyDown(event) {
var prevented = false;
_onKeyDown === null || _onKeyDown === void 0 || _onKeyDown(event, function() {
warningOnce(false, "`preventDefault` callback is deprecated. Please call `event.preventDefault` directly.");
prevented = true;
});
if (!event.defaultPrevented && !prevented) switch (event.key) {
case "Escape":
onOpenChange(false, { index });
break;
case "Enter":
if (!open) onOpenChange(true);
break;
}
}
}, postProps === null || postProps === void 0 ? void 0 : postProps({ valueTexts }));
Object.keys(inputProps).forEach(function(key) {
if (inputProps[key] === void 0) delete inputProps[key];
});
return inputProps;
}, getText];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/hooks/useRootProps.js
var propNames = ["onMouseEnter", "onMouseLeave"];
function useRootProps(props) {
return import_react.useMemo(function() {
return pickProps(props, propNames);
}, [props]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/Icon.js
var _excluded$6 = ["icon", "type"], _excluded2$1 = ["onClear"];
function _extends$56() {
_extends$56 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$56.apply(this, arguments);
}
function _objectWithoutProperties$4(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose$4(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _objectWithoutPropertiesLoose$4(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function Icon$1(props) {
var icon = props.icon, type = props.type, restProps = _objectWithoutProperties$4(props, _excluded$6);
var _React$useContext = import_react.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, classNames = _React$useContext.classNames, styles = _React$useContext.styles;
return icon ? /* @__PURE__ */ import_react.createElement("span", _extends$56({
className: clsx("".concat(prefixCls, "-").concat(type), classNames.suffix),
style: styles.suffix
}, restProps), icon) : null;
}
function ClearIcon(_ref) {
var onClear = _ref.onClear, restProps = _objectWithoutProperties$4(_ref, _excluded2$1);
return /* @__PURE__ */ import_react.createElement(Icon$1, _extends$56({}, restProps, {
type: "clear",
role: "button",
onMouseDown: function onMouseDown(e) {
e.preventDefault();
},
onClick: function onClick(e) {
e.stopPropagation();
onClear();
}
}));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/MaskFormat.js
function _typeof$6(o) {
"@babel/helpers - typeof";
return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$6(o);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey$6(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", { writable: false });
return Constructor;
}
function _defineProperty$6(obj, key, value) {
key = _toPropertyKey$6(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$6(t) {
var i = _toPrimitive$6(t, "string");
return "symbol" == _typeof$6(i) ? i : String(i);
}
function _toPrimitive$6(t, r) {
if ("object" != _typeof$6(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$6(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
var FORMAT_KEYS = [
"YYYY",
"MM",
"DD",
"HH",
"mm",
"ss",
"SSS"
];
var REPLACE_KEY = "顧";
var MaskFormat = /* @__PURE__ */ function() {
function MaskFormat(format) {
_classCallCheck(this, MaskFormat);
_defineProperty$6(this, "format", void 0);
_defineProperty$6(this, "maskFormat", void 0);
_defineProperty$6(this, "cells", void 0);
_defineProperty$6(this, "maskCells", void 0);
this.format = format;
var replaceKeys = FORMAT_KEYS.map(function(key) {
return "(".concat(key, ")");
}).join("|");
var replaceReg = new RegExp(replaceKeys, "g");
this.maskFormat = format.replace(replaceReg, function(key) {
return REPLACE_KEY.repeat(key.length);
});
var cellReg = new RegExp("(".concat(FORMAT_KEYS.join("|"), ")"));
var strCells = (format.split(cellReg) || []).filter(function(str) {
return str;
});
var offset = 0;
this.cells = strCells.map(function(text) {
var mask = FORMAT_KEYS.includes(text);
var start = offset;
var end = offset + text.length;
offset = end;
return {
text,
mask,
start,
end
};
});
this.maskCells = this.cells.filter(function(cell) {
return cell.mask;
});
}
_createClass(MaskFormat, [
{
key: "getSelection",
value: function getSelection(maskCellIndex) {
var _ref = this.maskCells[maskCellIndex] || {}, start = _ref.start, end = _ref.end;
return [start || 0, end || 0];
}
},
{
key: "match",
value: function match(text) {
for (var i = 0; i < this.maskFormat.length; i += 1) {
var maskChar = this.maskFormat[i];
var textChar = text[i];
if (!textChar || maskChar !== REPLACE_KEY && maskChar !== textChar) return false;
}
return true;
}
},
{
key: "size",
value: function size() {
return this.maskCells.length;
}
},
{
key: "getMaskCellIndex",
value: function getMaskCellIndex(anchorIndex) {
var closetDist = Number.MAX_SAFE_INTEGER;
var closetIndex = 0;
for (var i = 0; i < this.maskCells.length; i += 1) {
var _this$maskCells$i = this.maskCells[i], start = _this$maskCells$i.start, end = _this$maskCells$i.end;
if (anchorIndex >= start && anchorIndex <= end) return i;
var dist = Math.min(Math.abs(anchorIndex - start), Math.abs(anchorIndex - end));
if (dist < closetDist) {
closetDist = dist;
closetIndex = i;
}
}
return closetIndex;
}
}
]);
return MaskFormat;
}();
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/util.js
function getMaskRange(key) {
return {
YYYY: [
0,
9999,
(/* @__PURE__ */ new Date()).getFullYear()
],
MM: [1, 12],
DD: [1, 31],
HH: [0, 23],
mm: [0, 59],
ss: [0, 59],
SSS: [0, 999]
}[key];
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/Input.js
function _typeof$5(o) {
"@babel/helpers - typeof";
return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$5(o);
}
var _excluded$5 = [
"className",
"active",
"showActiveCls",
"suffixIcon",
"format",
"validateFormat",
"onChange",
"onInput",
"helped",
"onHelp",
"onSubmit",
"onKeyDown",
"preserveInvalidOnBlur",
"invalid",
"clearIcon"
];
function _extends$55() {
_extends$55 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$55.apply(this, arguments);
}
function _defineProperty$5(obj, key, value) {
key = _toPropertyKey$5(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$5(t) {
var i = _toPrimitive$5(t, "string");
return "symbol" == _typeof$5(i) ? i : String(i);
}
function _toPrimitive$5(t, r) {
if ("object" != _typeof$5(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$5(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$4(arr, i) {
return _arrayWithHoles$4(arr) || _iterableToArrayLimit$4(arr, i) || _unsupportedIterableToArray$4(arr, i) || _nonIterableRest$4();
}
function _nonIterableRest$4() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$4(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$4(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$4(o, minLen);
}
function _arrayLikeToArray$4(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$4(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$4(arr) {
if (Array.isArray(arr)) return arr;
}
function _objectWithoutProperties$3(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose$3(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _objectWithoutPropertiesLoose$3(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
var Input$3 = /* @__PURE__ */ import_react.forwardRef(function(props, ref) {
var className = props.className, active = props.active, _props$showActiveCls = props.showActiveCls, showActiveCls = _props$showActiveCls === void 0 ? true : _props$showActiveCls, suffixIcon = props.suffixIcon, format = props.format, validateFormat = props.validateFormat, onChange = props.onChange;
props.onInput;
var helped = props.helped, onHelp = props.onHelp, onSubmit = props.onSubmit, onKeyDown = props.onKeyDown, _props$preserveInvali = props.preserveInvalidOnBlur, preserveInvalidOnBlur = _props$preserveInvali === void 0 ? false : _props$preserveInvali, invalid = props.invalid, clearIcon = props.clearIcon, restProps = _objectWithoutProperties$3(props, _excluded$5);
var value = props.value, onFocus = props.onFocus, onBlur = props.onBlur, onMouseUp = props.onMouseUp;
var _React$useContext = import_react.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, _React$useContext$inp = _React$useContext.input, Component = _React$useContext$inp === void 0 ? "input" : _React$useContext$inp, classNames = _React$useContext.classNames, styles = _React$useContext.styles;
var inputPrefixCls = "".concat(prefixCls, "-input");
var _React$useState2 = _slicedToArray$4(import_react.useState(false), 2), focused = _React$useState2[0], setFocused = _React$useState2[1];
var _React$useState4 = _slicedToArray$4(import_react.useState(value), 2), internalInputValue = _React$useState4[0], setInputValue = _React$useState4[1];
var _React$useState6 = _slicedToArray$4(import_react.useState(""), 2), focusCellText = _React$useState6[0], setFocusCellText = _React$useState6[1];
var _React$useState8 = _slicedToArray$4(import_react.useState(null), 2), focusCellIndex = _React$useState8[0], setFocusCellIndex = _React$useState8[1];
var _React$useState10 = _slicedToArray$4(import_react.useState(null), 2), forceSelectionSyncMark = _React$useState10[0], forceSelectionSync = _React$useState10[1];
var inputValue = internalInputValue || "";
import_react.useEffect(function() {
setInputValue(value);
}, [value]);
var holderRef = import_react.useRef(null);
var inputRef = import_react.useRef(null);
var mouseDownRef = import_react.useRef(false);
import_react.useImperativeHandle(ref, function() {
return {
nativeElement: holderRef.current,
inputElement: inputRef.current,
focus: function focus(options) {
inputRef.current.focus(options);
},
blur: function blur() {
inputRef.current.blur();
}
};
});
var maskFormat = import_react.useMemo(function() {
return new MaskFormat(format || "");
}, [format]);
var _React$useMemo2 = _slicedToArray$4(import_react.useMemo(function() {
if (helped) return [0, 0];
return maskFormat.getSelection(focusCellIndex);
}, [
maskFormat,
focusCellIndex,
helped
]), 2), selectionStart = _React$useMemo2[0], selectionEnd = _React$useMemo2[1];
var onModify = function onModify(text) {
if (text && text !== format && text !== value) onHelp();
};
/**
* Triggered by paste, keyDown and focus to show format
*/
var triggerInputChange = useEvent(function(text) {
if (validateFormat(text)) onChange(text);
setInputValue(text);
onModify(text);
});
var onInternalChange = function onInternalChange(event) {
if (!format) {
var text = event.target.value;
onModify(text);
setInputValue(text);
onChange(text);
}
};
var onFormatPaste = function onFormatPaste(event) {
if (mouseDownRef.current) {
event.preventDefault();
return;
}
var pasteText = event.clipboardData.getData("text");
if (validateFormat(pasteText)) triggerInputChange(pasteText);
};
var onFormatMouseDown = function onFormatMouseDown() {
mouseDownRef.current = true;
};
var onFormatMouseUp = function onFormatMouseUp(event) {
var start = event.target.selectionStart;
setFocusCellIndex(maskFormat.getMaskCellIndex(start));
forceSelectionSync({});
onMouseUp === null || onMouseUp === void 0 || onMouseUp(event);
mouseDownRef.current = false;
};
var onFormatFocus = function onFormatFocus(event) {
setFocused(true);
setFocusCellIndex(0);
setFocusCellText("");
onFocus(event);
};
var onSharedBlur = function onSharedBlur(event) {
onBlur(event);
};
var onFormatBlur = function onFormatBlur(event) {
setFocused(false);
onSharedBlur(event);
};
useLockEffect(active, function() {
if (!active && !preserveInvalidOnBlur) setInputValue(value);
});
var onSharedKeyDown = function onSharedKeyDown(event) {
if (event.key === "Enter" && validateFormat(inputValue)) onSubmit();
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
};
var onFormatKeyDown = function onFormatKeyDown(event) {
if (mouseDownRef.current) {
event.preventDefault();
return;
}
onSharedKeyDown(event);
var key = event.key;
var nextCellText = null;
var nextFillText = null;
var maskCellLen = selectionEnd - selectionStart;
var cellFormat = format.slice(selectionStart, selectionEnd);
var offsetCellIndex = function offsetCellIndex(offset) {
setFocusCellIndex(function(idx) {
var nextIndex = idx + offset;
nextIndex = Math.max(nextIndex, 0);
nextIndex = Math.min(nextIndex, maskFormat.size() - 1);
return nextIndex;
});
};
var offsetCellValue = function offsetCellValue(offset) {
var _getMaskRange2 = _slicedToArray$4(getMaskRange(cellFormat), 3), rangeStart = _getMaskRange2[0], rangeEnd = _getMaskRange2[1], rangeDefault = _getMaskRange2[2];
var currentText = inputValue.slice(selectionStart, selectionEnd);
var currentTextNum = Number(currentText);
if (isNaN(currentTextNum)) return String(rangeDefault ? rangeDefault : offset > 0 ? rangeStart : rangeEnd);
var num = currentTextNum + offset;
var range = rangeEnd - rangeStart + 1;
return String(rangeStart + (range + num - rangeStart) % range);
};
switch (key) {
case "Backspace":
case "Delete":
nextCellText = "";
nextFillText = cellFormat;
break;
case "ArrowLeft":
nextCellText = "";
offsetCellIndex(-1);
break;
case "ArrowRight":
nextCellText = "";
offsetCellIndex(1);
break;
case "ArrowUp":
nextCellText = "";
nextFillText = offsetCellValue(1);
break;
case "ArrowDown":
nextCellText = "";
nextFillText = offsetCellValue(-1);
break;
default:
if (!isNaN(Number(key))) {
nextCellText = focusCellText + key;
nextFillText = nextCellText;
}
break;
}
if (nextCellText !== null) {
setFocusCellText(nextCellText);
if (nextCellText.length >= maskCellLen) {
offsetCellIndex(1);
setFocusCellText("");
}
}
if (nextFillText !== null) triggerInputChange((inputValue.slice(0, selectionStart) + leftPad(nextFillText, maskCellLen) + inputValue.slice(selectionEnd)).slice(0, format.length));
forceSelectionSync({});
};
var rafRef = import_react.useRef();
useLayoutEffect$1(function() {
if (!focused || !format || mouseDownRef.current) return;
if (!maskFormat.match(inputValue)) {
triggerInputChange(format);
return;
}
inputRef.current.setSelectionRange(selectionStart, selectionEnd);
rafRef.current = wrapperRaf(function() {
inputRef.current.setSelectionRange(selectionStart, selectionEnd);
});
return function() {
wrapperRaf.cancel(rafRef.current);
};
}, [
maskFormat,
format,
focused,
inputValue,
focusCellIndex,
selectionStart,
selectionEnd,
forceSelectionSyncMark,
triggerInputChange
]);
var inputProps = format ? {
onFocus: onFormatFocus,
onBlur: onFormatBlur,
onKeyDown: onFormatKeyDown,
onMouseDown: onFormatMouseDown,
onMouseUp: onFormatMouseUp,
onPaste: onFormatPaste
} : {};
return /* @__PURE__ */ import_react.createElement("div", {
ref: holderRef,
className: clsx(inputPrefixCls, _defineProperty$5(_defineProperty$5({}, "".concat(inputPrefixCls, "-active"), active && showActiveCls), "".concat(inputPrefixCls, "-placeholder"), helped), className)
}, /* @__PURE__ */ import_react.createElement(Component, _extends$55({
ref: inputRef,
"aria-invalid": invalid,
autoComplete: "off"
}, restProps, {
onKeyDown: onSharedKeyDown,
onBlur: onSharedBlur
}, inputProps, {
value: inputValue,
onChange: onInternalChange,
className: classNames.input,
style: styles.input
})), /* @__PURE__ */ import_react.createElement(Icon$1, {
type: "suffix",
icon: suffixIcon
}), clearIcon);
});
Input$3.displayName = "Input";
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/RangeSelector.js
var _excluded$4 = [
"id",
"prefix",
"clearIcon",
"suffixIcon",
"separator",
"activeIndex",
"activeHelp",
"allHelp",
"focused",
"onFocus",
"onBlur",
"onKeyDown",
"locale",
"generateConfig",
"placeholder",
"className",
"style",
"onClick",
"onClear",
"value",
"onChange",
"onSubmit",
"onInputChange",
"format",
"maskFormat",
"preserveInvalidOnBlur",
"onInvalid",
"disabled",
"invalid",
"inputReadOnly",
"direction",
"onOpenChange",
"onActiveInfo",
"placement",
"onMouseDown",
"required",
"aria-required",
"autoFocus",
"tabIndex"
], _excluded2 = ["index"];
function _extends$54() {
_extends$54 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$54.apply(this, arguments);
}
function ownKeys$4(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$4(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$4(Object(t), !0).forEach(function(r) {
_defineProperty$4(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$4(obj, key, value) {
key = _toPropertyKey$4(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$4(t) {
var i = _toPrimitive$4(t, "string");
return "symbol" == _typeof$4(i) ? i : String(i);
}
function _toPrimitive$4(t, r) {
if ("object" != _typeof$4(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$4(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$3(arr, i) {
return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$3();
}
function _nonIterableRest$3() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$3(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$3(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$3(o, minLen);
}
function _arrayLikeToArray$3(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$3(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$3(arr) {
if (Array.isArray(arr)) return arr;
}
function _typeof$4(o) {
"@babel/helpers - typeof";
return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$4(o);
}
function _objectWithoutProperties$2(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose$2(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _objectWithoutPropertiesLoose$2(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function RangeSelector(props, ref) {
var id = props.id, prefix = props.prefix, clearIcon = props.clearIcon, suffixIcon = props.suffixIcon, _props$separator = props.separator, separator = _props$separator === void 0 ? "~" : _props$separator, activeIndex = props.activeIndex;
props.activeHelp;
props.allHelp;
var focused = props.focused;
props.onFocus;
props.onBlur;
props.onKeyDown;
props.locale;
props.generateConfig;
var placeholder = props.placeholder, className = props.className, style = props.style, onClick = props.onClick, onClear = props.onClear, value = props.value;
props.onChange;
props.onSubmit;
props.onInputChange;
props.format;
props.maskFormat;
props.preserveInvalidOnBlur;
props.onInvalid;
var disabled = props.disabled, invalid = props.invalid;
props.inputReadOnly;
var direction = props.direction;
props.onOpenChange;
var onActiveInfo = props.onActiveInfo;
props.placement;
var _onMouseDown = props.onMouseDown;
props.required;
props["aria-required"];
var autoFocus = props.autoFocus, tabIndex = props.tabIndex, restProps = _objectWithoutProperties$2(props, _excluded$4);
var rtl = direction === "rtl";
var _React$useContext = import_react.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, classNames = _React$useContext.classNames, styles = _React$useContext.styles;
var ids = import_react.useMemo(function() {
if (typeof id === "string") return [id];
var mergedId = id || {};
return [mergedId.start, mergedId.end];
}, [id]);
var rootRef = import_react.useRef();
var inputStartRef = import_react.useRef();
var inputEndRef = import_react.useRef();
var getInput = function getInput(index) {
var _index;
return (_index = [inputStartRef, inputEndRef][index]) === null || _index === void 0 ? void 0 : _index.current;
};
import_react.useImperativeHandle(ref, function() {
return {
nativeElement: rootRef.current,
focus: function focus(options) {
if (_typeof$4(options) === "object") {
var _getInput;
var _ref = options || {}, _ref$index = _ref.index, _index2 = _ref$index === void 0 ? 0 : _ref$index, rest = _objectWithoutProperties$2(_ref, _excluded2);
(_getInput = getInput(_index2)) === null || _getInput === void 0 || _getInput.focus(rest);
} else {
var _getInput2;
(_getInput2 = getInput(options !== null && options !== void 0 ? options : 0)) === null || _getInput2 === void 0 || _getInput2.focus();
}
},
blur: function blur() {
var _getInput3, _getInput4;
(_getInput3 = getInput(0)) === null || _getInput3 === void 0 || _getInput3.blur();
(_getInput4 = getInput(1)) === null || _getInput4 === void 0 || _getInput4.blur();
}
};
});
var rootProps = useRootProps(restProps);
var mergedPlaceholder = import_react.useMemo(function() {
return Array.isArray(placeholder) ? placeholder : [placeholder, placeholder];
}, [placeholder]);
var getInputProps = _slicedToArray$3(useInputProps(_objectSpread$4(_objectSpread$4({}, props), {}, {
id: ids,
placeholder: mergedPlaceholder
})), 1)[0];
var _React$useState2 = _slicedToArray$3(import_react.useState({
position: "absolute",
width: 0
}), 2), activeBarStyle = _React$useState2[0], setActiveBarStyle = _React$useState2[1];
var syncActiveOffset = useEvent(function() {
var input = getInput(activeIndex);
if (input) {
var inputRect = input.nativeElement.getBoundingClientRect();
var parentRect = rootRef.current.getBoundingClientRect();
var rectOffset = inputRect.left - parentRect.left;
setActiveBarStyle(function(ori) {
return _objectSpread$4(_objectSpread$4({}, ori), {}, {
width: inputRect.width,
left: rectOffset
});
});
onActiveInfo([
inputRect.left,
inputRect.right,
parentRect.width
]);
}
});
import_react.useEffect(function() {
syncActiveOffset();
}, [activeIndex]);
var showClear = clearIcon && (value[0] && !disabled[0] || value[1] && !disabled[1]);
var startAutoFocus = autoFocus && !disabled[0];
var endAutoFocus = autoFocus && !startAutoFocus && !disabled[1];
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: syncActiveOffset }, /* @__PURE__ */ import_react.createElement("div", _extends$54({}, rootProps, {
className: clsx(prefixCls, "".concat(prefixCls, "-range"), _defineProperty$4(_defineProperty$4(_defineProperty$4(_defineProperty$4({}, "".concat(prefixCls, "-focused"), focused), "".concat(prefixCls, "-disabled"), disabled.every(function(i) {
return i;
})), "".concat(prefixCls, "-invalid"), invalid.some(function(i) {
return i;
})), "".concat(prefixCls, "-rtl"), rtl), className),
style,
ref: rootRef,
onClick,
onMouseDown: function onMouseDown(e) {
var target = e.target;
if (target !== inputStartRef.current.inputElement && target !== inputEndRef.current.inputElement) e.preventDefault();
_onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(e);
}
}), prefix && /* @__PURE__ */ import_react.createElement("div", {
className: clsx("".concat(prefixCls, "-prefix"), classNames.prefix),
style: styles.prefix
}, prefix), /* @__PURE__ */ import_react.createElement(Input$3, _extends$54({ ref: inputStartRef }, getInputProps(0), {
className: "".concat(prefixCls, "-input-start"),
autoFocus: startAutoFocus,
tabIndex,
"date-range": "start"
})), /* @__PURE__ */ import_react.createElement("div", { className: "".concat(prefixCls, "-range-separator") }, separator), /* @__PURE__ */ import_react.createElement(Input$3, _extends$54({ ref: inputEndRef }, getInputProps(1), {
className: "".concat(prefixCls, "-input-end"),
autoFocus: endAutoFocus,
tabIndex,
"date-range": "end"
})), /* @__PURE__ */ import_react.createElement("div", {
className: "".concat(prefixCls, "-active-bar"),
style: activeBarStyle
}), /* @__PURE__ */ import_react.createElement(Icon$1, {
type: "suffix",
icon: suffixIcon
}), showClear && /* @__PURE__ */ import_react.createElement(ClearIcon, {
icon: clearIcon,
onClear
})));
}
var RefRangeSelector = /* @__PURE__ */ import_react.forwardRef(RangeSelector);
RefRangeSelector.displayName = "RangeSelector";
//#endregion
//#region node_modules/@rc-component/picker/es/hooks/useSemantic.js
function _typeof$3(o) {
"@babel/helpers - typeof";
return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$3(o);
}
function ownKeys$3(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$3(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) {
_defineProperty$3(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$3(obj, key, value) {
key = _toPropertyKey$3(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$3(t) {
var i = _toPrimitive$3(t, "string");
return "symbol" == _typeof$3(i) ? i : String(i);
}
function _toPrimitive$3(t, r) {
if ("object" != _typeof$3(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$3(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
/**
* Convert `classNames` & `styles` to a fully filled object
*/
function useSemantic(classNames, styles) {
return (0, import_react.useMemo)(function() {
return [_objectSpread$3(_objectSpread$3({}, classNames), {}, { popup: (classNames === null || classNames === void 0 ? void 0 : classNames.popup) || {} }), _objectSpread$3(_objectSpread$3({}, styles), {}, { popup: (styles === null || styles === void 0 ? void 0 : styles.popup) || {} })];
}, [classNames, styles]);
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/RangePicker.js
function _typeof$2(o) {
"@babel/helpers - typeof";
return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$2(o);
}
function _extends$53() {
_extends$53 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$53.apply(this, arguments);
}
function _toConsumableArray$1(arr) {
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$2(arr) || _nonIterableSpread$1();
}
function _nonIterableSpread$1() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray$1(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles$1(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$2(arr);
}
function ownKeys$2(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$2(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) {
_defineProperty$2(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$2(obj, key, value) {
key = _toPropertyKey$2(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$2(t) {
var i = _toPrimitive$2(t, "string");
return "symbol" == _typeof$2(i) ? i : String(i);
}
function _toPrimitive$2(t, r) {
if ("object" != _typeof$2(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$2(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$2(arr, i) {
return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest$2();
}
function _nonIterableRest$2() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$2(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$2(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$2(o, minLen);
}
function _arrayLikeToArray$2(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$2(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$2(arr) {
if (Array.isArray(arr)) return arr;
}
function separateConfig(config, defaultConfig) {
var singleConfig = config !== null && config !== void 0 ? config : defaultConfig;
if (Array.isArray(singleConfig)) return singleConfig;
return [singleConfig, singleConfig];
}
/** Used for change event, it should always be not undefined */
function getActiveRange(activeIndex) {
return activeIndex === 1 ? "end" : "start";
}
function RangePicker$1(props, ref) {
var _useFilledProps2 = _slicedToArray$2(useFilledProps(props, function() {
var disabled = props.disabled, allowEmpty = props.allowEmpty;
return {
disabled: separateConfig(disabled, false),
allowEmpty: separateConfig(allowEmpty, false)
};
}), 6), filledProps = _useFilledProps2[0], internalPicker = _useFilledProps2[1], complexPicker = _useFilledProps2[2], formatList = _useFilledProps2[3], maskFormat = _useFilledProps2[4], isInvalidateDate = _useFilledProps2[5];
var prefixCls = filledProps.prefixCls, rootClassName = filledProps.rootClassName, propStyles = filledProps.styles, propClassNames = filledProps.classNames, previewValue = filledProps.previewValue, defaultValue = filledProps.defaultValue, value = filledProps.value, needConfirm = filledProps.needConfirm, onKeyDown = filledProps.onKeyDown, disabled = filledProps.disabled, allowEmpty = filledProps.allowEmpty, disabledDate = filledProps.disabledDate, minDate = filledProps.minDate, maxDate = filledProps.maxDate, defaultOpen = filledProps.defaultOpen, open = filledProps.open, onOpenChange = filledProps.onOpenChange, locale = filledProps.locale, generateConfig = filledProps.generateConfig, picker = filledProps.picker, showNow = filledProps.showNow, showToday = filledProps.showToday, showTime = filledProps.showTime, mode = filledProps.mode, onPanelChange = filledProps.onPanelChange, onCalendarChange = filledProps.onCalendarChange, onOk = filledProps.onOk, defaultPickerValue = filledProps.defaultPickerValue, pickerValue = filledProps.pickerValue, onPickerValueChange = filledProps.onPickerValueChange, inputReadOnly = filledProps.inputReadOnly, suffixIcon = filledProps.suffixIcon, onFocus = filledProps.onFocus, onBlur = filledProps.onBlur, presets = filledProps.presets, ranges = filledProps.ranges, components = filledProps.components, cellRender = filledProps.cellRender, dateRender = filledProps.dateRender, monthCellRender = filledProps.monthCellRender, onClick = filledProps.onClick;
var selectorRef = usePickerRef(ref);
var _useSemantic2 = _slicedToArray$2(useSemantic(propClassNames, propStyles), 2), mergedClassNames = _useSemantic2[0], mergedStyles = _useSemantic2[1];
var _useOpen2 = _slicedToArray$2(useOpen(open, defaultOpen, disabled, onOpenChange), 2), mergedOpen = _useOpen2[0], setMergeOpen = _useOpen2[1];
var triggerOpen = function triggerOpen(nextOpen, config) {
if (disabled.some(function(fieldDisabled) {
return !fieldDisabled;
}) || !nextOpen) setMergeOpen(nextOpen, config);
};
var _useInnerValue2 = _slicedToArray$2(useInnerValue(generateConfig, locale, formatList, true, false, defaultValue, value, onCalendarChange, onOk), 5), mergedValue = _useInnerValue2[0], setInnerValue = _useInnerValue2[1], getCalendarValue = _useInnerValue2[2], triggerCalendarChange = _useInnerValue2[3], triggerOk = _useInnerValue2[4];
var calendarValue = getCalendarValue();
var _useRangeActive2 = _slicedToArray$2(useRangeActive(disabled, allowEmpty, mergedOpen), 9), focused = _useRangeActive2[0], triggerFocus = _useRangeActive2[1], lastOperation = _useRangeActive2[2], activeIndex = _useRangeActive2[3], setActiveIndex = _useRangeActive2[4], nextActiveIndex = _useRangeActive2[5], activeIndexList = _useRangeActive2[6], updateSubmitIndex = _useRangeActive2[7], hasActiveSubmitValue = _useRangeActive2[8];
var onSharedFocus = function onSharedFocus(event, index) {
triggerFocus(true);
onFocus === null || onFocus === void 0 || onFocus(event, { range: getActiveRange(index !== null && index !== void 0 ? index : activeIndex) });
};
var onSharedBlur = function onSharedBlur(event, index) {
triggerFocus(false);
onBlur === null || onBlur === void 0 || onBlur(event, { range: getActiveRange(index !== null && index !== void 0 ? index : activeIndex) });
};
/** Used for Popup panel */
var mergedShowTime = import_react.useMemo(function() {
if (!showTime) return null;
var disabledTime = showTime.disabledTime;
var proxyDisabledTime = disabledTime ? function(date) {
return disabledTime(date, getActiveRange(activeIndex), { from: getFromDate(calendarValue, activeIndexList, activeIndex) });
} : void 0;
return _objectSpread$2(_objectSpread$2({}, showTime), {}, { disabledTime: proxyDisabledTime });
}, [
showTime,
activeIndex,
calendarValue,
activeIndexList
]);
var _useControlledState2 = _slicedToArray$2(useControlledState([picker, picker], mode), 2), modes = _useControlledState2[0], setModes = _useControlledState2[1];
var mergedMode = modes[activeIndex] || picker;
/** Extends from `mergedMode` to patch `datetime` mode */
var internalMode = mergedMode === "date" && mergedShowTime ? "datetime" : mergedMode;
var multiplePanel = internalMode === picker && internalMode !== "time";
var mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday, true);
var _useRangeValue2 = _slicedToArray$2(useRangeValue(filledProps, mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, disabled, formatList, focused, mergedOpen, isInvalidateDate), 2), flushSubmit = _useRangeValue2[0], triggerSubmitChange = _useRangeValue2[1];
var mergedDisabledDate = useRangeDisabledDate(calendarValue, disabled, activeIndexList, generateConfig, locale, disabledDate);
var _useFieldsInvalidate2 = _slicedToArray$2(useFieldsInvalidate(calendarValue, isInvalidateDate, allowEmpty), 2), submitInvalidates = _useFieldsInvalidate2[0], onSelectorInvalid = _useFieldsInvalidate2[1];
var _useRangePickerValue2 = _slicedToArray$2(useRangePickerValue(generateConfig, locale, calendarValue, modes, mergedOpen, activeIndex, internalPicker, multiplePanel, defaultPickerValue, pickerValue, mergedShowTime === null || mergedShowTime === void 0 ? void 0 : mergedShowTime.defaultOpenValue, onPickerValueChange, minDate, maxDate), 2), currentPickerValue = _useRangePickerValue2[0], setCurrentPickerValue = _useRangePickerValue2[1];
var triggerModeChange = useEvent(function(nextPickerValue, nextMode, triggerEvent) {
var clone = fillIndex(modes, activeIndex, nextMode);
if (clone[0] !== modes[0] || clone[1] !== modes[1]) setModes(clone);
if (onPanelChange && triggerEvent !== false) {
var clonePickerValue = _toConsumableArray$1(calendarValue);
if (nextPickerValue) clonePickerValue[activeIndex] = nextPickerValue;
onPanelChange(clonePickerValue, clone);
}
});
var fillCalendarValue = function fillCalendarValue(date, index) {
return fillIndex(calendarValue, index, date);
};
/**
* Trigger by confirm operation.
* This function has already handle the `needConfirm` check logic.
* - Selector: enter key
* - Panel: OK button
*/
var triggerPartConfirm = function triggerPartConfirm(date, skipFocus) {
var nextValue = calendarValue;
if (date) nextValue = fillCalendarValue(date, activeIndex);
updateSubmitIndex(activeIndex);
var nextIndex = nextActiveIndex(nextValue);
triggerCalendarChange(nextValue);
flushSubmit(activeIndex, nextIndex === null);
if (nextIndex === null) triggerOpen(false, { force: true });
else if (!skipFocus) selectorRef.current.focus({ index: nextIndex });
};
var onSelectorClick = function onSelectorClick(event) {
var _activeElement;
var rootNode = event.target.getRootNode();
if (!selectorRef.current.nativeElement.contains((_activeElement = rootNode.activeElement) !== null && _activeElement !== void 0 ? _activeElement : document.activeElement)) {
var enabledIndex = disabled.findIndex(function(d) {
return !d;
});
if (enabledIndex >= 0) selectorRef.current.focus({ index: enabledIndex });
}
triggerOpen(true);
onClick === null || onClick === void 0 || onClick(event);
};
var onSelectorClear = function onSelectorClear() {
triggerSubmitChange(null);
triggerOpen(false, { force: true });
};
var _React$useState2 = _slicedToArray$2(import_react.useState(null), 2), hoverSource = _React$useState2[0], setHoverSource = _React$useState2[1];
var _React$useState4 = _slicedToArray$2(import_react.useState(null), 2), internalHoverValues = _React$useState4[0], setInternalHoverValues = _React$useState4[1];
var hoverValues = import_react.useMemo(function() {
return internalHoverValues || calendarValue;
}, [calendarValue, internalHoverValues]);
import_react.useEffect(function() {
if (!mergedOpen) setInternalHoverValues(null);
}, [mergedOpen]);
var _React$useState6 = _slicedToArray$2(import_react.useState([
0,
0,
0
]), 2), activeInfo = _React$useState6[0], setActiveInfo = _React$useState6[1];
var onSetHover = function onSetHover(date, source) {
if (previewValue !== "hover") return;
setInternalHoverValues(date);
setHoverSource(source);
};
var presetList = usePresets(presets, ranges);
var onPresetHover = function onPresetHover(nextValues) {
onSetHover(nextValues, "preset");
};
var onPresetSubmit = function onPresetSubmit(nextValues) {
if (triggerSubmitChange(nextValues)) {
lastOperation("preset-click");
triggerOpen(false, { force: true });
}
};
var onNow = function onNow(now) {
triggerPartConfirm(now);
};
var onPanelHover = function onPanelHover(date) {
onSetHover(date ? fillCalendarValue(date, activeIndex) : null, "cell");
};
var onPanelFocus = function onPanelFocus(event) {
triggerOpen(true);
onSharedFocus(event);
};
var onPanelMouseDown = function onPanelMouseDown() {
lastOperation("panel");
};
var onPanelSelect = function onPanelSelect(date) {
triggerCalendarChange(fillIndex(calendarValue, activeIndex, date));
if (!needConfirm && !complexPicker && internalPicker === internalMode) triggerPartConfirm(date);
};
var onPopupClose = function onPopupClose() {
triggerOpen(false);
};
var onInternalCellRender = useCellRender$1(cellRender, dateRender, monthCellRender, getActiveRange(activeIndex));
var panelValue = calendarValue[activeIndex] || null;
var isPopupInvalidateDate = useEvent(function(date) {
return isInvalidateDate(date, { activeIndex });
});
var panelProps = import_react.useMemo(function() {
var domProps = pickAttrs(filledProps, false);
return omit(filledProps, [].concat(_toConsumableArray$1(Object.keys(domProps)), [
"onChange",
"onCalendarChange",
"style",
"className",
"onPanelChange",
"disabledTime",
"classNames",
"styles"
]));
}, [filledProps]);
var panel = /* @__PURE__ */ import_react.createElement(Popup, _extends$53({}, panelProps, {
showNow: mergedShowNow,
showTime: mergedShowTime,
range: true,
multiplePanel,
activeInfo,
disabledDate: mergedDisabledDate,
onFocus: onPanelFocus,
onBlur: onSharedBlur,
onPanelMouseDown,
picker,
mode: mergedMode,
internalMode,
onPanelChange: triggerModeChange,
format: maskFormat,
value: panelValue,
isInvalid: isPopupInvalidateDate,
onChange: null,
onSelect: onPanelSelect,
pickerValue: currentPickerValue,
defaultOpenValue: toArray$4(showTime === null || showTime === void 0 ? void 0 : showTime.defaultOpenValue)[activeIndex],
onPickerValueChange: setCurrentPickerValue,
hoverValue: hoverValues,
onHover: onPanelHover,
needConfirm,
onSubmit: triggerPartConfirm,
onOk: triggerOk,
presets: presetList,
onPresetHover,
onPresetSubmit,
onNow,
cellRender: onInternalCellRender,
classNames: mergedClassNames,
styles: mergedStyles
}));
var onSelectorChange = function onSelectorChange(date, index) {
triggerCalendarChange(fillCalendarValue(date, index));
};
var onSelectorInputChange = function onSelectorInputChange() {
lastOperation("input");
};
var onSelectorFocus = function onSelectorFocus(event, index) {
var activeListLen = activeIndexList.length;
var lastActiveIndex = activeIndexList[activeListLen - 1];
if (activeListLen && lastActiveIndex !== index && needConfirm && !allowEmpty[lastActiveIndex] && !hasActiveSubmitValue(lastActiveIndex) && calendarValue[lastActiveIndex]) {
selectorRef.current.focus({ index: lastActiveIndex });
return;
}
lastOperation("input");
triggerOpen(true, { inherit: true });
if (activeIndex !== index && mergedOpen && !needConfirm && complexPicker) triggerPartConfirm(null, true);
setActiveIndex(index);
onSharedFocus(event, index);
};
var onSelectorBlur = function onSelectorBlur(event, index) {
triggerOpen(false);
if (!needConfirm && lastOperation() === "input") flushSubmit(activeIndex, nextActiveIndex(calendarValue) === null);
onSharedBlur(event, index);
};
var onSelectorKeyDown = function onSelectorKeyDown(event, preventDefault) {
if (event.key === "Tab") triggerPartConfirm(null, true);
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, preventDefault);
};
var context = import_react.useMemo(function() {
return {
prefixCls,
locale,
generateConfig,
button: components.button,
input: components.input,
classNames: mergedClassNames,
styles: mergedStyles
};
}, [
prefixCls,
locale,
generateConfig,
components.button,
components.input,
mergedClassNames,
mergedStyles
]);
useLayoutEffect$1(function() {
if (mergedOpen && activeIndex !== void 0) triggerModeChange(null, picker, false);
}, [
mergedOpen,
activeIndex,
picker
]);
useLayoutEffect$1(function() {
var lastOp = lastOperation();
if (!mergedOpen && lastOp === "input") {
triggerOpen(false);
triggerPartConfirm(null, true);
}
if (!mergedOpen && complexPicker && !needConfirm && lastOp === "panel") {
triggerOpen(true);
triggerPartConfirm();
}
}, [mergedOpen]);
var isIndexEmpty = function isIndexEmpty(index) {
return !(value !== null && value !== void 0 && value[index]) && !(defaultValue !== null && defaultValue !== void 0 && defaultValue[index]);
};
if (disabled.some(function(fieldDisabled, index) {
return fieldDisabled && isIndexEmpty(index) && !allowEmpty[index];
})) warningOnce(false, "`disabled` should not set with empty `value`. You should set `allowEmpty` or `value` instead.");
return /* @__PURE__ */ import_react.createElement(PickerContext.Provider, { value: context }, /* @__PURE__ */ import_react.createElement(PickerTrigger, _extends$53({}, pickTriggerProps(filledProps), {
popupElement: panel,
popupStyle: mergedStyles.popup.root,
popupClassName: clsx(rootClassName, mergedClassNames.popup.root),
visible: mergedOpen,
onClose: onPopupClose,
range: true
}), /* @__PURE__ */ import_react.createElement(RefRangeSelector, _extends$53({}, filledProps, {
ref: selectorRef,
className: clsx(filledProps.className, rootClassName, mergedClassNames.root),
style: _objectSpread$2(_objectSpread$2({}, mergedStyles.root), filledProps.style),
suffixIcon,
activeIndex: focused || mergedOpen ? activeIndex : null,
activeHelp: !!internalHoverValues,
allHelp: !!internalHoverValues && hoverSource === "preset",
focused,
onFocus: onSelectorFocus,
onBlur: onSelectorBlur,
onKeyDown: onSelectorKeyDown,
onSubmit: triggerPartConfirm,
value: hoverValues,
maskFormat,
onChange: onSelectorChange,
onInputChange: onSelectorInputChange,
format: formatList,
inputReadOnly,
disabled,
open: mergedOpen,
onOpenChange: triggerOpen,
onClick: onSelectorClick,
onClear: onSelectorClear,
invalid: submitInvalidates,
onInvalid: onSelectorInvalid,
onActiveInfo: setActiveInfo
}))));
}
var RefRangePicker = /* @__PURE__ */ import_react.forwardRef(RangePicker$1);
RefRangePicker.displayName = "RefRangePicker";
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/SingleSelector/MultipleDates.js
function MultipleDates(props) {
var prefixCls = props.prefixCls, value = props.value, onRemove = props.onRemove, _props$removeIcon = props.removeIcon, removeIcon = _props$removeIcon === void 0 ? "×" : _props$removeIcon, formatDate = props.formatDate, disabled = props.disabled, maxTagCount = props.maxTagCount, placeholder = props.placeholder;
var selectorCls = "".concat(prefixCls, "-selector");
var selectionCls = "".concat(prefixCls, "-selection");
var overflowCls = "".concat(selectionCls, "-overflow");
function renderSelector(content, onClose) {
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx("".concat(selectionCls, "-item")),
title: typeof content === "string" ? content : null
}, /* @__PURE__ */ import_react.createElement("span", { className: "".concat(selectionCls, "-item-content") }, content), !disabled && onClose && /* @__PURE__ */ import_react.createElement("span", {
onMouseDown: function onMouseDown(e) {
e.preventDefault();
},
onClick: onClose,
className: "".concat(selectionCls, "-item-remove")
}, removeIcon));
}
function renderItem(date) {
return renderSelector(formatDate(date), function onClose(event) {
if (event) event.stopPropagation();
onRemove(date);
});
}
function renderRest(omittedValues) {
return renderSelector("+ ".concat(omittedValues.length, " ..."));
}
return /* @__PURE__ */ import_react.createElement("div", { className: selectorCls }, /* @__PURE__ */ import_react.createElement(es_default$22, {
prefixCls: overflowCls,
data: value,
renderItem,
renderRest,
itemKey: function itemKey(date) {
return formatDate(date);
},
maxCount: maxTagCount
}), !value.length && /* @__PURE__ */ import_react.createElement("span", { className: "".concat(prefixCls, "-selection-placeholder") }, placeholder));
}
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/Selector/SingleSelector/index.js
function _typeof$1(o) {
"@babel/helpers - typeof";
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof$1(o);
}
var _excluded$3 = [
"id",
"open",
"prefix",
"clearIcon",
"suffixIcon",
"activeHelp",
"allHelp",
"focused",
"onFocus",
"onBlur",
"onKeyDown",
"locale",
"generateConfig",
"placeholder",
"className",
"style",
"onClick",
"onClear",
"internalPicker",
"value",
"onChange",
"onSubmit",
"onInputChange",
"multiple",
"maxTagCount",
"format",
"maskFormat",
"preserveInvalidOnBlur",
"onInvalid",
"disabled",
"invalid",
"inputReadOnly",
"direction",
"onOpenChange",
"onMouseDown",
"required",
"aria-required",
"autoFocus",
"tabIndex",
"removeIcon"
];
function _extends$52() {
_extends$52 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$52.apply(this, arguments);
}
function ownKeys$1(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread$1(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) {
_defineProperty$1(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty$1(obj, key, value) {
key = _toPropertyKey$1(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey$1(t) {
var i = _toPrimitive$1(t, "string");
return "symbol" == _typeof$1(i) ? i : String(i);
}
function _toPrimitive$1(t, r) {
if ("object" != _typeof$1(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof$1(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray$1(arr, i) {
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$1(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$1(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$1(o, minLen);
}
function _arrayLikeToArray$1(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit$1(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles$1(arr) {
if (Array.isArray(arr)) return arr;
}
function _objectWithoutProperties$1(source, excluded) {
if (source == null) return {};
var target = _objectWithoutPropertiesLoose$1(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function _objectWithoutPropertiesLoose$1(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function SingleSelector(props, ref) {
props.id;
var open = props.open, prefix = props.prefix, clearIcon = props.clearIcon, suffixIcon = props.suffixIcon;
props.activeHelp;
props.allHelp;
var focused = props.focused;
props.onFocus;
props.onBlur;
props.onKeyDown;
var locale = props.locale, generateConfig = props.generateConfig, placeholder = props.placeholder, className = props.className, style = props.style, onClick = props.onClick, onClear = props.onClear, internalPicker = props.internalPicker, value = props.value, onChange = props.onChange, onSubmit = props.onSubmit;
props.onInputChange;
var multiple = props.multiple, maxTagCount = props.maxTagCount;
props.format;
props.maskFormat;
props.preserveInvalidOnBlur;
props.onInvalid;
var disabled = props.disabled, invalid = props.invalid;
props.inputReadOnly;
var direction = props.direction;
props.onOpenChange;
var _onMouseDown = props.onMouseDown;
props.required;
props["aria-required"];
var autoFocus = props.autoFocus, tabIndex = props.tabIndex, removeIcon = props.removeIcon, restProps = _objectWithoutProperties$1(props, _excluded$3);
var rtl = direction === "rtl";
var _React$useContext = import_react.useContext(PickerContext), prefixCls = _React$useContext.prefixCls, classNames = _React$useContext.classNames, styles = _React$useContext.styles;
var rootRef = import_react.useRef();
var inputRef = import_react.useRef();
import_react.useImperativeHandle(ref, function() {
return {
nativeElement: rootRef.current,
focus: function focus(options) {
var _inputRef$current;
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus(options);
},
blur: function blur() {
var _inputRef$current2;
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();
}
};
});
var rootProps = useRootProps(restProps);
var onSingleChange = function onSingleChange(date) {
onChange([date]);
};
var onMultipleRemove = function onMultipleRemove(date) {
onChange(value.filter(function(oriDate) {
return oriDate && !isSame(generateConfig, locale, oriDate, date, internalPicker);
}));
if (!open) onSubmit();
};
var _useInputProps2 = _slicedToArray$1(useInputProps(_objectSpread$1(_objectSpread$1({}, props), {}, { onChange: onSingleChange }), function(_ref) {
return {
value: _ref.valueTexts[0] || "",
active: focused
};
}), 2), getInputProps = _useInputProps2[0], getText = _useInputProps2[1];
var showClear = !!(clearIcon && value.length && !disabled);
var selectorNode = multiple ? /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(MultipleDates, {
prefixCls,
value,
onRemove: onMultipleRemove,
formatDate: getText,
maxTagCount,
disabled,
removeIcon,
placeholder
}), /* @__PURE__ */ import_react.createElement("input", {
className: "".concat(prefixCls, "-multiple-input"),
value: value.map(getText).join(","),
ref: inputRef,
readOnly: true,
autoFocus,
tabIndex
}), /* @__PURE__ */ import_react.createElement(Icon$1, {
type: "suffix",
icon: suffixIcon
}), showClear && /* @__PURE__ */ import_react.createElement(ClearIcon, {
icon: clearIcon,
onClear
})) : /* @__PURE__ */ import_react.createElement(Input$3, _extends$52({ ref: inputRef }, getInputProps(), {
autoFocus,
tabIndex,
suffixIcon,
clearIcon: showClear && /* @__PURE__ */ import_react.createElement(ClearIcon, {
icon: clearIcon,
onClear
}),
showActiveCls: false
}));
return /* @__PURE__ */ import_react.createElement("div", _extends$52({}, rootProps, {
className: clsx(prefixCls, _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, "".concat(prefixCls, "-multiple"), multiple), "".concat(prefixCls, "-focused"), focused), "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-invalid"), invalid), "".concat(prefixCls, "-rtl"), rtl), className),
style,
ref: rootRef,
onClick,
onMouseDown: function onMouseDown(e) {
var _inputRef$current3;
if (e.target !== ((_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.inputElement)) e.preventDefault();
_onMouseDown === null || _onMouseDown === void 0 || _onMouseDown(e);
}
}), prefix && /* @__PURE__ */ import_react.createElement("div", {
className: clsx("".concat(prefixCls, "-prefix"), classNames.prefix),
style: styles.prefix
}, prefix), selectorNode);
}
var RefSingleSelector = /* @__PURE__ */ import_react.forwardRef(SingleSelector);
RefSingleSelector.displayName = "SingleSelector";
//#endregion
//#region node_modules/@rc-component/picker/es/PickerInput/SinglePicker.js
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
return typeof o;
} : function(o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function _extends$51() {
_extends$51 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$51.apply(this, arguments);
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
function ownKeys(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function(r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
_defineProperty(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
else obj[key] = value;
return obj;
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : String(i);
}
function _toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e, n, i, u, a = [], f = !0, o = !1;
try {
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
/** Internal usage. For cross function get same aligned props */
function Picker(props, ref) {
var _useFilledProps2 = _slicedToArray(useFilledProps(props), 6), filledProps = _useFilledProps2[0], internalPicker = _useFilledProps2[1], complexPicker = _useFilledProps2[2], formatList = _useFilledProps2[3], maskFormat = _useFilledProps2[4], isInvalidateDate = _useFilledProps2[5];
var _ref = filledProps, prefixCls = _ref.prefixCls, rootClassName = _ref.rootClassName, propStyles = _ref.styles, propClassNames = _ref.classNames, previewValue = _ref.previewValue, order = _ref.order, defaultValue = _ref.defaultValue, value = _ref.value, needConfirm = _ref.needConfirm, onChange = _ref.onChange, onKeyDown = _ref.onKeyDown, disabled = _ref.disabled, disabledDate = _ref.disabledDate, minDate = _ref.minDate, maxDate = _ref.maxDate, defaultOpen = _ref.defaultOpen, open = _ref.open, onOpenChange = _ref.onOpenChange, locale = _ref.locale, generateConfig = _ref.generateConfig, picker = _ref.picker, showNow = _ref.showNow, showToday = _ref.showToday, showTime = _ref.showTime, mode = _ref.mode, onPanelChange = _ref.onPanelChange, onCalendarChange = _ref.onCalendarChange, onOk = _ref.onOk, multiple = _ref.multiple, defaultPickerValue = _ref.defaultPickerValue, pickerValue = _ref.pickerValue, onPickerValueChange = _ref.onPickerValueChange, inputReadOnly = _ref.inputReadOnly, suffixIcon = _ref.suffixIcon, removeIcon = _ref.removeIcon, onFocus = _ref.onFocus, onBlur = _ref.onBlur, presets = _ref.presets, components = _ref.components, cellRender = _ref.cellRender, dateRender = _ref.dateRender, monthCellRender = _ref.monthCellRender, onClick = _ref.onClick;
var selectorRef = usePickerRef(ref);
function pickerParam(values) {
if (values === null) return null;
return multiple ? values : values[0];
}
var toggleDates = useToggleDates(generateConfig, locale, internalPicker);
var _useSemantic2 = _slicedToArray(useSemantic(propClassNames, propStyles), 2), mergedClassNames = _useSemantic2[0], mergedStyles = _useSemantic2[1];
var _useOpen2 = _slicedToArray(useOpen(open, defaultOpen, [disabled], onOpenChange), 2), mergedOpen = _useOpen2[0], triggerOpen = _useOpen2[1];
var _useInnerValue2 = _slicedToArray(useInnerValue(generateConfig, locale, formatList, false, order, defaultValue, value, function onInternalCalendarChange(dates, dateStrings, info) {
if (onCalendarChange) {
var filteredInfo = _objectSpread({}, info);
delete filteredInfo.range;
onCalendarChange(pickerParam(dates), pickerParam(dateStrings), filteredInfo);
}
}, function onInternalOk(dates) {
onOk === null || onOk === void 0 || onOk(pickerParam(dates));
}), 5), mergedValue = _useInnerValue2[0], setInnerValue = _useInnerValue2[1], getCalendarValue = _useInnerValue2[2], triggerCalendarChange = _useInnerValue2[3], triggerOk = _useInnerValue2[4];
var calendarValue = getCalendarValue();
var _useRangeActive2 = _slicedToArray(useRangeActive([disabled]), 4), focused = _useRangeActive2[0], triggerFocus = _useRangeActive2[1], lastOperation = _useRangeActive2[2], activeIndex = _useRangeActive2[3];
var onSharedFocus = function onSharedFocus(event) {
triggerFocus(true);
onFocus === null || onFocus === void 0 || onFocus(event, {});
};
var onSharedBlur = function onSharedBlur(event) {
triggerFocus(false);
onBlur === null || onBlur === void 0 || onBlur(event, {});
};
var _useControlledState2 = _slicedToArray(useControlledState(picker, mode), 2), mergedMode = _useControlledState2[0], setMode = _useControlledState2[1];
/** Extends from `mergedMode` to patch `datetime` mode */
var internalMode = mergedMode === "date" && showTime ? "datetime" : mergedMode;
var mergedShowNow = useShowNow(picker, mergedMode, showNow, showToday);
var onInternalChange = onChange && function(dates, dateStrings) {
onChange(pickerParam(dates), pickerParam(dateStrings));
};
var triggerSubmitChange = _slicedToArray(useRangeValue(_objectSpread(_objectSpread({}, filledProps), {}, { onChange: onInternalChange }), mergedValue, setInnerValue, getCalendarValue, triggerCalendarChange, [], formatList, focused, mergedOpen, isInvalidateDate), 2)[1];
var _useFieldsInvalidate2 = _slicedToArray(useFieldsInvalidate(calendarValue, isInvalidateDate), 2), submitInvalidates = _useFieldsInvalidate2[0], onSelectorInvalid = _useFieldsInvalidate2[1];
var submitInvalidate = import_react.useMemo(function() {
return submitInvalidates.some(function(invalidated) {
return invalidated;
});
}, [submitInvalidates]);
var _useRangePickerValue2 = _slicedToArray(useRangePickerValue(generateConfig, locale, calendarValue, [mergedMode], mergedOpen, activeIndex, internalPicker, false, defaultPickerValue, pickerValue, toArray$4(showTime === null || showTime === void 0 ? void 0 : showTime.defaultOpenValue), function onInternalPickerValueChange(dates, info) {
if (onPickerValueChange) {
var cleanInfo = _objectSpread(_objectSpread({}, info), {}, { mode: info.mode[0] });
delete cleanInfo.range;
onPickerValueChange(dates[0], cleanInfo);
}
}, minDate, maxDate), 2), currentPickerValue = _useRangePickerValue2[0], setCurrentPickerValue = _useRangePickerValue2[1];
var triggerModeChange = useEvent(function(nextPickerValue, nextMode, triggerEvent) {
setMode(nextMode);
if (onPanelChange && triggerEvent !== false) onPanelChange(nextPickerValue || calendarValue[calendarValue.length - 1], nextMode);
});
/**
* Different with RangePicker, confirm should check `multiple` logic.
* This will never provide `date` instead.
*/
var triggerConfirm = function triggerConfirm() {
triggerSubmitChange(getCalendarValue());
triggerOpen(false, { force: true });
};
var onSelectorClick = function onSelectorClick(event) {
if (!disabled && !selectorRef.current.nativeElement.contains(document.activeElement)) selectorRef.current.focus();
triggerOpen(true);
onClick === null || onClick === void 0 || onClick(event);
};
var onSelectorClear = function onSelectorClear() {
triggerSubmitChange(null);
triggerOpen(false, { force: true });
};
var _React$useState2 = _slicedToArray(import_react.useState(null), 2), hoverSource = _React$useState2[0], setHoverSource = _React$useState2[1];
var _React$useState4 = _slicedToArray(import_react.useState(null), 2), internalHoverValue = _React$useState4[0], setInternalHoverValue = _React$useState4[1];
var hoverValues = import_react.useMemo(function() {
var values = [internalHoverValue].concat(_toConsumableArray(calendarValue)).filter(function(date) {
return date;
});
return multiple ? values : values.slice(0, 1);
}, [
calendarValue,
internalHoverValue,
multiple
]);
var selectorValues = import_react.useMemo(function() {
if (!multiple && internalHoverValue) return [internalHoverValue];
return calendarValue.filter(function(date) {
return date;
});
}, [
calendarValue,
internalHoverValue,
multiple
]);
import_react.useEffect(function() {
if (!mergedOpen) setInternalHoverValue(null);
}, [mergedOpen]);
var onSetHover = function onSetHover(date, source) {
if (previewValue !== "hover") return;
setInternalHoverValue(date);
setHoverSource(source);
};
var presetList = usePresets(presets);
var onPresetHover = function onPresetHover(nextValue) {
onSetHover(nextValue, "preset");
};
var onPresetSubmit = function onPresetSubmit(nextValue) {
if (triggerSubmitChange(multiple ? toggleDates(getCalendarValue(), nextValue) : [nextValue]) && !multiple) triggerOpen(false, { force: true });
};
var onNow = function onNow(now) {
onPresetSubmit(now);
};
var onPanelHover = function onPanelHover(date) {
onSetHover(date, "cell");
};
var onPanelFocus = function onPanelFocus(event) {
triggerOpen(true);
onSharedFocus(event);
};
var onPanelSelect = function onPanelSelect(date) {
lastOperation("panel");
if (multiple && internalMode !== picker) return;
triggerCalendarChange(multiple ? toggleDates(getCalendarValue(), date) : [date]);
if (!needConfirm && !complexPicker && internalPicker === internalMode) triggerConfirm();
};
var onPopupClose = function onPopupClose() {
triggerOpen(false);
};
var onInternalCellRender = useCellRender$1(cellRender, dateRender, monthCellRender);
var panelProps = import_react.useMemo(function() {
var domProps = pickAttrs(filledProps, false);
return _objectSpread(_objectSpread({}, omit(filledProps, [].concat(_toConsumableArray(Object.keys(domProps)), [
"onChange",
"onCalendarChange",
"style",
"className",
"onPanelChange",
"classNames",
"styles"
]))), {}, { multiple: filledProps.multiple });
}, [filledProps]);
var panel = /* @__PURE__ */ import_react.createElement(Popup, _extends$51({}, panelProps, {
showNow: mergedShowNow,
showTime,
disabledDate,
onFocus: onPanelFocus,
onBlur: onSharedBlur,
picker,
mode: mergedMode,
internalMode,
onPanelChange: triggerModeChange,
format: maskFormat,
value: calendarValue,
isInvalid: isInvalidateDate,
onChange: null,
onSelect: onPanelSelect,
pickerValue: currentPickerValue,
defaultOpenValue: showTime === null || showTime === void 0 ? void 0 : showTime.defaultOpenValue,
onPickerValueChange: setCurrentPickerValue,
hoverValue: hoverValues,
onHover: onPanelHover,
needConfirm,
onSubmit: triggerConfirm,
onOk: triggerOk,
presets: presetList,
onPresetHover,
onPresetSubmit,
onNow,
cellRender: onInternalCellRender,
classNames: mergedClassNames,
styles: mergedStyles
}));
var onSelectorChange = function onSelectorChange(date) {
triggerCalendarChange(date);
};
var onSelectorInputChange = function onSelectorInputChange() {
lastOperation("input");
};
var onSelectorFocus = function onSelectorFocus(event) {
lastOperation("input");
triggerOpen(true, { inherit: true });
onSharedFocus(event);
};
var onSelectorBlur = function onSelectorBlur(event) {
triggerOpen(false);
onSharedBlur(event);
};
var onSelectorKeyDown = function onSelectorKeyDown(event, preventDefault) {
if (event.key === "Tab") triggerConfirm();
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, preventDefault);
};
var context = import_react.useMemo(function() {
return {
prefixCls,
locale,
generateConfig,
button: components.button,
input: components.input,
classNames: mergedClassNames,
styles: mergedStyles
};
}, [
prefixCls,
locale,
generateConfig,
components.button,
components.input,
mergedClassNames,
mergedStyles
]);
useLayoutEffect$1(function() {
if (mergedOpen && activeIndex !== void 0) triggerModeChange(null, picker, false);
}, [
mergedOpen,
activeIndex,
picker
]);
useLayoutEffect$1(function() {
var lastOp = lastOperation();
if (!mergedOpen && lastOp === "input") {
triggerOpen(false);
triggerConfirm();
}
if (!mergedOpen && complexPicker && !needConfirm && lastOp === "panel") triggerConfirm();
}, [mergedOpen]);
return /* @__PURE__ */ import_react.createElement(PickerContext.Provider, { value: context }, /* @__PURE__ */ import_react.createElement(PickerTrigger, _extends$51({}, pickTriggerProps(filledProps), {
popupElement: panel,
popupStyle: mergedStyles.popup.root,
popupClassName: clsx(rootClassName, mergedClassNames.popup.root),
visible: mergedOpen,
onClose: onPopupClose
}), /* @__PURE__ */ import_react.createElement(RefSingleSelector, _extends$51({}, filledProps, {
ref: selectorRef,
className: clsx(filledProps.className, rootClassName, mergedClassNames.root),
style: _objectSpread(_objectSpread({}, mergedStyles.root), filledProps.style),
suffixIcon,
removeIcon,
activeHelp: !!internalHoverValue,
allHelp: !!internalHoverValue && hoverSource === "preset",
focused,
onFocus: onSelectorFocus,
onBlur: onSelectorBlur,
onKeyDown: onSelectorKeyDown,
onSubmit: triggerConfirm,
value: selectorValues,
maskFormat,
onChange: onSelectorChange,
onInputChange: onSelectorInputChange,
internalPicker,
format: formatList,
inputReadOnly,
disabled,
open: mergedOpen,
onOpenChange: triggerOpen,
onClick: onSelectorClick,
onClear: onSelectorClear,
invalid: submitInvalidate,
onInvalid: function onInvalid(invalid) {
onSelectorInvalid(invalid, 0);
}
}))));
}
var RefPicker = /* @__PURE__ */ import_react.forwardRef(Picker);
RefPicker.displayName = "RefPicker";
//#endregion
//#region node_modules/@rc-component/picker/es/index.js
/**
* What's new?
* - Common
* - [Break] Support special year format, all the year will follow the locale config.
* - Blur all of field will trigger `onChange` if validate
* - Support `preserveInvalidOnBlur` to not to clean input if invalid and remove `changeOnBlur`
* - `pickerValue` is now full controlled
* - `defaultPickerValue` will take effect on every field active with popup opening.
* - [Break] clear button return the event with `onClick`
*
* - Locale
* - Remove `dateFormat` since it's never used
* - Remove `dateTimeFormat` since it's never used
*
* - Picker
* - TimePicker support `changeOnScroll`
* - TimePicker support `millisecond`
* - Support cellMeridiemFormat for AM/PM
* - Get correct `disabledHours` when set `use12Hours`
* - Support `showWeek`
*
* - RangePicker
* - [Break] RangePicker is now not limit the range of clicked field.
* - Trigger `onCalendarChange` when type correct
* - [Break] Not order `value` if given `value` is wrong order.
* - Hover `presets` will show date in input field.
* - [Break] RangePicker go to end field, `pickerValue` will follow the start field if not controlled.
*/
var es_default$17 = RefPicker;
//#endregion
//#region node_modules/antd/es/form/util.js
var formItemNameBlackList = ["parentNode"];
var defaultItemNamePrefixCls = "form_item";
function toArray$3(candidate) {
if (candidate === void 0 || candidate === false) return [];
return Array.isArray(candidate) ? candidate : [candidate];
}
function getFieldId(namePath, formName) {
if (!namePath.length) return;
const mergedId = namePath.join("_");
if (formName) return `${formName}_${mergedId}`;
return formItemNameBlackList.includes(mergedId) ? `${defaultItemNamePrefixCls}_${mergedId}` : mergedId;
}
/**
* Get merged status by meta or passed `validateStatus`.
*/
function getStatus(errors, warnings, meta, defaultValidateStatus, hasFeedback, validateStatus) {
let status = defaultValidateStatus;
if (validateStatus !== void 0) status = validateStatus;
else if (meta.validating) status = "validating";
else if (errors.length) status = "error";
else if (warnings.length) status = "warning";
else if (meta.touched || hasFeedback && meta.validated) status = "success";
return status;
}
//#endregion
//#region node_modules/antd/es/form/hooks/useForm.js
function toNamePathStr(name) {
return toArray$3(name).join("_");
}
function getFieldDOMNode(name, wrapForm) {
const fieldDom = getDOM(wrapForm.getFieldInstance(name));
if (fieldDom) return fieldDom;
const fieldId = getFieldId(toArray$3(name), wrapForm.__INTERNAL__.name);
if (fieldId) return document.getElementById(fieldId);
}
function useForm(form) {
const [rcForm] = useForm$1();
const itemsRef = import_react.useRef({});
const wrapForm = import_react.useMemo(() => form ?? {
...rcForm,
__INTERNAL__: { itemRef: (name) => (node) => {
const namePathStr = toNamePathStr(name);
if (node) itemsRef.current[namePathStr] = node;
else delete itemsRef.current[namePathStr];
} },
scrollToField: (name, options = {}) => {
const { focus, ...restOpt } = options;
const node = getFieldDOMNode(name, wrapForm);
if (node) {
e(node, {
scrollMode: "if-needed",
block: "nearest",
...restOpt
});
if (focus) wrapForm.focusField(name);
}
},
focusField: (name) => {
const itemRef = wrapForm.getFieldInstance(name);
if (typeof itemRef?.focus === "function") itemRef.focus();
else getFieldDOMNode(name, wrapForm)?.focus?.();
},
getFieldInstance: (name) => {
const namePathStr = toNamePathStr(name);
return itemsRef.current[namePathStr];
}
}, [form, rcForm]);
return [wrapForm];
}
//#endregion
//#region node_modules/antd/es/radio/context.js
var RadioGroupContext = /* @__PURE__ */ import_react.createContext(void 0);
var RadioGroupContextProvider = RadioGroupContext.Provider;
var RadioOptionTypeContext = /* @__PURE__ */ import_react.createContext(void 0);
var RadioOptionTypeContextProvider = RadioOptionTypeContext.Provider;
//#endregion
//#region node_modules/@rc-component/checkbox/es/index.js
function _extends$50() {
_extends$50 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$50.apply(this, arguments);
}
var Checkbox$3 = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls = "rc-checkbox", className, style, checked, disabled, defaultChecked = false, type = "checkbox", title, onChange, ...inputProps } = props;
const inputRef = (0, import_react.useRef)(null);
const holderRef = (0, import_react.useRef)(null);
const [rawValue, setRawValue] = useControlledState(defaultChecked, checked);
(0, import_react.useImperativeHandle)(ref, () => ({
focus: (options) => {
inputRef.current?.focus(options);
},
blur: () => {
inputRef.current?.blur();
},
input: inputRef.current,
nativeElement: holderRef.current
}));
const classString = clsx(prefixCls, className, {
[`${prefixCls}-checked`]: rawValue,
[`${prefixCls}-disabled`]: disabled
});
const handleChange = (e) => {
if (disabled) return;
if (!("checked" in props)) setRawValue(e.target.checked);
onChange?.({
target: {
...props,
type,
checked: e.target.checked
},
stopPropagation() {
e.stopPropagation();
},
preventDefault() {
e.preventDefault();
},
nativeEvent: e.nativeEvent
});
};
return /* @__PURE__ */ import_react.createElement("span", {
className: classString,
title,
style,
ref: holderRef
}, /* @__PURE__ */ import_react.createElement("input", _extends$50({}, inputProps, {
className: `${prefixCls}-input`,
ref: inputRef,
onChange: handleChange,
disabled,
checked: !!rawValue,
type
})));
});
//#endregion
//#region node_modules/antd/es/checkbox/useBubbleLock.js
/**
* When click on the label,
* the event will be stopped to prevent the label from being clicked twice.
* label click -> input click -> label click again
*/
function useBubbleLock(onOriginInputClick) {
const labelClickLockRef = import_react.useRef(null);
const clearLock = () => {
wrapperRaf.cancel(labelClickLockRef.current);
labelClickLockRef.current = null;
};
const onLabelClick = () => {
clearLock();
labelClickLockRef.current = wrapperRaf(() => {
labelClickLockRef.current = null;
});
};
const onInputClick = (e) => {
if (labelClickLockRef.current) {
e.stopPropagation();
clearLock();
}
onOriginInputClick?.(e);
};
return [onLabelClick, onInputClick];
}
//#endregion
//#region node_modules/antd/es/radio/style/index.js
var getGroupRadioStyle = (token) => {
const { componentCls, antCls } = token;
const groupPrefixCls = `${componentCls}-group`;
return { [groupPrefixCls]: {
...resetComponent(token),
display: "inline-block",
fontSize: 0,
[`&${groupPrefixCls}-rtl`]: { direction: "rtl" },
[`&${groupPrefixCls}-block`]: { display: "flex" },
[`${antCls}-badge ${antCls}-badge-count`]: { zIndex: 1 },
[`> ${antCls}-badge:not(:first-child) > ${antCls}-button-wrapper`]: { borderInlineStart: "none" },
"&-vertical": {
display: "flex",
flexDirection: "column",
rowGap: token.marginXS,
[`${componentCls}-wrapper`]: { marginInlineEnd: 0 }
}
} };
};
var getRadioBasicStyle = (token) => {
const { componentCls, wrapperMarginInlineEnd, colorPrimary, colorPrimaryHover, radioSize, motionDurationSlow, motionDurationMid, motionEaseInOutCirc, colorBgContainer, colorBorder, lineWidth, colorBgContainerDisabled, colorTextDisabled, paddingXS, dotColorDisabled, dotSize, lineType, radioColor, radioBgColor } = token;
return { [`${componentCls}-wrapper`]: {
...resetComponent(token),
display: "inline-flex",
alignItems: "baseline",
marginInlineStart: 0,
marginInlineEnd: wrapperMarginInlineEnd,
cursor: "pointer",
"&:last-child": { marginInlineEnd: 0 },
[`&${componentCls}-wrapper-rtl`]: { direction: "rtl" },
"&-disabled": {
cursor: "not-allowed",
color: token.colorTextDisabled
},
"&::after": {
display: "inline-block",
width: 0,
overflow: "hidden",
content: "\"\\a0\""
},
"&-block": {
flex: 1,
justifyContent: "center"
},
[componentCls]: {
...resetComponent(token),
position: "relative",
whiteSpace: "nowrap",
lineHeight: 1,
cursor: "pointer",
alignSelf: "center",
boxSizing: "border-box",
display: "block",
width: `calc(${radioSize} * 1px)`,
height: `calc(${radioSize} * 1px)`,
backgroundColor: colorBgContainer,
border: `${unit$1(lineWidth)} ${lineType} ${colorBorder}`,
borderRadius: "50%",
transition: `all ${motionDurationMid}`,
flex: "none",
"&:after": {
content: "\"\"",
position: "absolute",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%) scale(0)",
width: `calc(${dotSize} * 1px)`,
height: `calc(${dotSize} * 1px)`,
backgroundColor: radioColor,
borderRadius: "50%",
transformOrigin: "50% 50%",
opacity: 0,
transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`
},
[`${componentCls}-input`]: {
position: "absolute",
inset: 0,
zIndex: 1,
cursor: "pointer",
opacity: 0,
margin: 0
},
[`&:has(${componentCls}-input:focus-visible)`]: genFocusOutline(token)
},
[`&:hover:not(${componentCls}-wrapper-disabled) ${componentCls}`]: { borderColor: colorPrimary },
[`&:hover ${componentCls}-checked:not(${componentCls}-disabled)`]: {
backgroundColor: colorPrimaryHover,
borderColor: "transparent"
},
[`${componentCls}-checked`]: {
backgroundColor: radioBgColor,
borderColor: colorPrimary,
"&::after": {
transform: `translate(-50%, -50%)`,
opacity: 1
}
},
[`${componentCls}-disabled`]: {
[`&, ${componentCls}-input`]: {
cursor: "not-allowed",
pointerEvents: "none"
},
background: colorBgContainerDisabled,
borderColor: colorBorder,
"&::after": { backgroundColor: dotColorDisabled }
},
[`${componentCls}-disabled + span`]: {
color: colorTextDisabled,
cursor: "not-allowed"
},
[`span${componentCls} + *`]: {
paddingInlineStart: paddingXS,
paddingInlineEnd: paddingXS
}
} };
};
var getRadioButtonStyle = (token) => {
const { buttonColor, controlHeight, componentCls, lineWidth, lineType, colorBorder, motionDurationMid, buttonPaddingInline, fontSize, buttonBg, fontSizeLG, controlHeightLG, controlHeightSM, paddingXS, borderRadius, borderRadiusSM, borderRadiusLG, buttonCheckedBg, buttonSolidCheckedColor, colorTextDisabled, colorBgContainerDisabled, buttonCheckedBgDisabled, buttonCheckedColorDisabled, colorPrimary, colorPrimaryHover, colorPrimaryActive, buttonSolidCheckedBg, buttonSolidCheckedHoverBg, buttonSolidCheckedActiveBg, calc } = token;
return { [`${componentCls}-button-wrapper`]: {
position: "relative",
display: "inline-block",
height: controlHeight,
margin: 0,
paddingInline: buttonPaddingInline,
paddingBlock: 0,
color: buttonColor,
fontSize,
lineHeight: unit$1(calc(controlHeight).sub(calc(lineWidth).mul(2)).equal()),
background: buttonBg,
border: `${unit$1(lineWidth)} ${lineType} ${colorBorder}`,
borderBlockStartWidth: calc(lineWidth).add(.02).equal(),
borderInlineEndWidth: lineWidth,
cursor: "pointer",
transition: [
`color`,
`background-color`,
`box-shadow`
].map((prop) => `${prop} ${motionDurationMid}`).join(","),
a: { color: buttonColor },
[`> ${componentCls}-button`]: {
position: "absolute",
insetBlockStart: 0,
insetInlineStart: 0,
zIndex: -1,
width: "100%",
height: "100%"
},
"&:not(:last-child)": { marginInlineEnd: calc(lineWidth).mul(-1).equal() },
"&:first-child": {
borderInlineStart: `${unit$1(lineWidth)} ${lineType} ${colorBorder}`,
borderStartStartRadius: borderRadius,
borderEndStartRadius: borderRadius
},
"&:last-child": {
borderStartEndRadius: borderRadius,
borderEndEndRadius: borderRadius
},
"&:first-child:last-child": { borderRadius },
[`${componentCls}-group-large &`]: {
height: controlHeightLG,
fontSize: fontSizeLG,
lineHeight: unit$1(calc(controlHeightLG).sub(calc(lineWidth).mul(2)).equal()),
"&:first-child": {
borderStartStartRadius: borderRadiusLG,
borderEndStartRadius: borderRadiusLG
},
"&:last-child": {
borderStartEndRadius: borderRadiusLG,
borderEndEndRadius: borderRadiusLG
}
},
[`${componentCls}-group-small &`]: {
height: controlHeightSM,
paddingInline: calc(paddingXS).sub(lineWidth).equal(),
paddingBlock: 0,
lineHeight: unit$1(calc(controlHeightSM).sub(calc(lineWidth).mul(2)).equal()),
"&:first-child": {
borderStartStartRadius: borderRadiusSM,
borderEndStartRadius: borderRadiusSM
},
"&:last-child": {
borderStartEndRadius: borderRadiusSM,
borderEndEndRadius: borderRadiusSM
}
},
"&:hover": {
position: "relative",
color: colorPrimary
},
"&:has(:focus-visible)": genFocusOutline(token),
[`${componentCls}, input[type='checkbox'], input[type='radio']`]: {
width: 0,
height: 0,
opacity: 0,
pointerEvents: "none"
},
[`&-checked:not(${componentCls}-button-wrapper-disabled)`]: {
zIndex: 1,
color: colorPrimary,
background: buttonCheckedBg,
borderColor: colorPrimary,
"&::before": { backgroundColor: colorPrimary },
"&:first-child": { borderColor: colorPrimary },
"&:hover": {
color: colorPrimaryHover,
borderColor: colorPrimaryHover,
"&::before": { backgroundColor: colorPrimaryHover }
},
"&:active": {
color: colorPrimaryActive,
borderColor: colorPrimaryActive,
"&::before": { backgroundColor: colorPrimaryActive }
}
},
[`${componentCls}-group-solid &-checked:not(${componentCls}-button-wrapper-disabled)`]: {
color: buttonSolidCheckedColor,
background: buttonSolidCheckedBg,
borderColor: buttonSolidCheckedBg,
"&:hover": {
color: buttonSolidCheckedColor,
background: buttonSolidCheckedHoverBg,
borderColor: buttonSolidCheckedHoverBg
},
"&:active": {
color: buttonSolidCheckedColor,
background: buttonSolidCheckedActiveBg,
borderColor: buttonSolidCheckedActiveBg
}
},
"&-disabled": {
color: colorTextDisabled,
backgroundColor: colorBgContainerDisabled,
borderColor: colorBorder,
cursor: "not-allowed",
"&:first-child, &:hover": {
color: colorTextDisabled,
backgroundColor: colorBgContainerDisabled,
borderColor: colorBorder
}
},
[`&-disabled${componentCls}-button-wrapper-checked`]: {
color: buttonCheckedColorDisabled,
backgroundColor: buttonCheckedBgDisabled,
borderColor: colorBorder,
boxShadow: "none"
},
"&-block": {
flex: 1,
textAlign: "center"
}
} };
};
var prepareComponentToken$37 = (token) => {
const { wireframe, padding, marginXS, lineWidth, fontSizeLG, colorText, colorBgContainer, colorTextDisabled, controlItemBgActiveDisabled, colorTextLightSolid, colorPrimary, colorPrimaryHover, colorPrimaryActive, colorWhite } = token;
const dotPadding = 4;
const radioSize = fontSizeLG;
return {
radioSize,
dotSize: wireframe ? radioSize - dotPadding * 2 : radioSize - (dotPadding + lineWidth) * 2,
dotColorDisabled: colorTextDisabled,
buttonSolidCheckedColor: colorTextLightSolid,
buttonSolidCheckedBg: colorPrimary,
buttonSolidCheckedHoverBg: colorPrimaryHover,
buttonSolidCheckedActiveBg: colorPrimaryActive,
buttonBg: colorBgContainer,
buttonCheckedBg: colorBgContainer,
buttonColor: colorText,
buttonCheckedBgDisabled: controlItemBgActiveDisabled,
buttonCheckedColorDisabled: colorTextDisabled,
buttonPaddingInline: padding - lineWidth,
wrapperMarginInlineEnd: marginXS,
radioColor: wireframe ? colorPrimary : colorWhite,
radioBgColor: wireframe ? colorBgContainer : colorPrimary
};
};
var style_default$42 = genStyleHooks("Radio", (token) => {
const { controlOutline, controlOutlineWidth } = token;
const radioFocusShadow = `0 0 0 ${unit$1(controlOutlineWidth)} ${controlOutline}`;
const radioToken = merge(token, {
radioFocusShadow,
radioButtonFocusShadow: radioFocusShadow
});
return [
getGroupRadioStyle(radioToken),
getRadioBasicStyle(radioToken),
getRadioButtonStyle(radioToken)
];
}, prepareComponentToken$37, { unitless: {
radioSize: true,
dotSize: true
} });
//#endregion
//#region node_modules/antd/es/radio/radio.js
var InternalRadio = (props, ref) => {
const groupContext = import_react.useContext(RadioGroupContext);
const radioOptionTypeContext = import_react.useContext(RadioOptionTypeContext);
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("radio");
const mergedRef = composeRef(ref, import_react.useRef(null));
const { isFormItemInput } = import_react.useContext(FormItemInputContext);
devUseWarning("Radio")(!("optionType" in props), "usage", "`optionType` is only support in Radio.Group.");
const onChange = (e) => {
props.onChange?.(e);
groupContext?.onChange?.(e);
};
const { prefixCls: customizePrefixCls, className, rootClassName, children, style, title, classNames, styles, ...restProps } = props;
const radioPrefixCls = getPrefixCls("radio", customizePrefixCls);
const isButtonType = (groupContext?.optionType || radioOptionTypeContext) === "button";
const prefixCls = isButtonType ? `${radioPrefixCls}-button` : radioPrefixCls;
const rootCls = useCSSVarCls(radioPrefixCls);
const [hashId, cssVarCls] = style_default$42(radioPrefixCls, rootCls);
const radioProps = { ...restProps };
const disabled = import_react.useContext(DisabledContext);
let mergedChecked = radioProps.checked;
if (groupContext) {
radioProps.name = groupContext.name;
radioProps.onChange = onChange;
mergedChecked = props.value === groupContext.value;
radioProps.disabled = radioProps.disabled ?? groupContext.disabled;
}
radioProps.disabled = radioProps.disabled ?? disabled;
const mergedProps = {
...props,
...radioProps,
checked: mergedChecked
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const wrapperClassString = clsx(`${prefixCls}-wrapper`, {
[`${prefixCls}-wrapper-checked`]: mergedChecked,
[`${prefixCls}-wrapper-disabled`]: radioProps.disabled,
[`${prefixCls}-wrapper-rtl`]: direction === "rtl",
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput,
[`${prefixCls}-wrapper-block`]: !!groupContext?.block
}, contextClassName, className, rootClassName, mergedClassNames.root, hashId, cssVarCls, rootCls);
const [onLabelClick, onInputClick] = useBubbleLock(radioProps.onClick);
return /* @__PURE__ */ import_react.createElement(Wave, {
component: "Radio",
disabled: radioProps.disabled
}, /* @__PURE__ */ import_react.createElement("label", {
className: wrapperClassString,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
onMouseEnter: props.onMouseEnter,
onMouseLeave: props.onMouseLeave,
title,
onClick: onLabelClick
}, /* @__PURE__ */ import_react.createElement(Checkbox$3, {
...radioProps,
checked: mergedChecked,
className: clsx(mergedClassNames.icon, { [TARGET_CLS]: !isButtonType }),
style: mergedStyles.icon,
type: "radio",
prefixCls,
ref: mergedRef,
onClick: onInputClick
}), children !== void 0 ? /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-label`, mergedClassNames.label),
style: mergedStyles.label
}, children) : null));
};
var Radio$1 = /* @__PURE__ */ import_react.forwardRef(InternalRadio);
Radio$1.displayName = "Radio";
//#endregion
//#region node_modules/antd/es/radio/group.js
var RadioGroup = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const { name: formItemName } = import_react.useContext(FormItemInputContext);
const defaultName = useId_default(toNamePathStr(formItemName));
const { prefixCls: customizePrefixCls, className, rootClassName, options, buttonStyle = "outline", disabled, children, size: customizeSize, style, id, optionType, name = defaultName, defaultValue, value: customizedValue, block = false, onChange, onMouseEnter, onMouseLeave, onFocus, onBlur, orientation, vertical, role = "radiogroup" } = props;
const [value, setValue] = useControlledState(defaultValue, customizedValue);
const onRadioChange = import_react.useCallback((event) => {
const lastValue = value;
const val = event.target.value;
if (!("value" in props)) setValue(val);
if (val !== lastValue) onChange?.(event);
}, [
value,
setValue,
onChange
]);
const prefixCls = getPrefixCls("radio", customizePrefixCls);
const groupPrefixCls = `${prefixCls}-group`;
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$42(prefixCls, rootCls);
let childrenToRender = children;
if (options && options.length > 0) childrenToRender = options.map((option) => {
if (typeof option === "string" || isNumber(option)) return /* @__PURE__ */ import_react.createElement(Radio$1, {
key: option.toString(),
prefixCls,
disabled,
value: option,
checked: value === option
}, option);
return /* @__PURE__ */ import_react.createElement(Radio$1, {
key: `radio-group-value-options-${option.value}`,
prefixCls,
disabled: option.disabled || disabled,
value: option.value,
checked: value === option.value,
title: option.title,
style: option.style,
className: option.className,
id: option.id,
required: option.required
}, option.label);
});
const mergedSize = useSize(customizeSize);
const [, mergedVertical] = useOrientation(orientation, vertical);
const classString = clsx(groupPrefixCls, `${groupPrefixCls}-${buttonStyle}`, {
[`${groupPrefixCls}-large`]: mergedSize === "large",
[`${groupPrefixCls}-small`]: mergedSize === "small",
[`${groupPrefixCls}-rtl`]: direction === "rtl",
[`${groupPrefixCls}-block`]: block
}, className, rootClassName, hashId, cssVarCls, rootCls);
const memoizedValue = import_react.useMemo(() => ({
onChange: onRadioChange,
value,
disabled,
name,
optionType,
block
}), [
onRadioChange,
value,
disabled,
name,
optionType,
block
]);
return /* @__PURE__ */ import_react.createElement("div", {
...pickAttrs(props, {
aria: true,
data: true
}),
role,
className: clsx(classString, { [`${prefixCls}-group-vertical`]: mergedVertical }),
style,
onMouseEnter,
onMouseLeave,
onFocus,
onBlur,
id,
ref
}, /* @__PURE__ */ import_react.createElement(RadioGroupContextProvider, { value: memoizedValue }, childrenToRender));
});
var group_default = /* @__PURE__ */ import_react.memo(RadioGroup);
//#endregion
//#region node_modules/antd/es/radio/radioButton.js
var RadioButton = (props, ref) => {
const { getPrefixCls } = import_react.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, ...radioProps } = props;
const prefixCls = getPrefixCls("radio", customizePrefixCls);
return /* @__PURE__ */ import_react.createElement(RadioOptionTypeContextProvider, { value: "button" }, /* @__PURE__ */ import_react.createElement(Radio$1, {
prefixCls,
...radioProps,
type: "radio",
ref
}));
};
var radioButton_default = /* @__PURE__ */ import_react.forwardRef(RadioButton);
//#endregion
//#region node_modules/antd/es/radio/index.js
var Radio = Radio$1;
Radio.Button = radioButton_default;
Radio.Group = group_default;
Radio.__ANT_RADIO = true;
//#endregion
//#region node_modules/antd/es/calendar/Header.js
var YEAR_SELECT_OFFSET = 10;
var YEAR_SELECT_TOTAL = 20;
function YearSelect(props) {
const { fullscreen, validRange, generateConfig, locale, prefixCls, value, onChange, divRef } = props;
const year = generateConfig.getYear(value || generateConfig.getNow());
let start = year - YEAR_SELECT_OFFSET;
let end = start + YEAR_SELECT_TOTAL;
if (validRange) {
start = generateConfig.getYear(validRange[0]);
end = generateConfig.getYear(validRange[1]) + 1;
}
const suffix = locale && locale.year === "年" ? "年" : "";
const options = [];
for (let index = start; index < end; index++) options.push({
label: `${index}${suffix}`,
value: index
});
return /* @__PURE__ */ import_react.createElement(Select, {
size: fullscreen ? void 0 : "small",
options,
value: year,
className: `${prefixCls}-year-select`,
onChange: (numYear) => {
let newDate = generateConfig.setYear(value, numYear);
if (validRange) {
const [startDate, endDate] = validRange;
const newYear = generateConfig.getYear(newDate);
const newMonth = generateConfig.getMonth(newDate);
if (newYear === generateConfig.getYear(endDate) && newMonth > generateConfig.getMonth(endDate)) newDate = generateConfig.setMonth(newDate, generateConfig.getMonth(endDate));
if (newYear === generateConfig.getYear(startDate) && newMonth < generateConfig.getMonth(startDate)) newDate = generateConfig.setMonth(newDate, generateConfig.getMonth(startDate));
}
onChange(newDate);
},
getPopupContainer: () => divRef.current
});
}
function MonthSelect(props) {
const { prefixCls, fullscreen, validRange, value, generateConfig, locale, onChange, divRef } = props;
const month = generateConfig.getMonth(value || generateConfig.getNow());
let start = 0;
let end = 11;
if (validRange) {
const [rangeStart, rangeEnd] = validRange;
const currentYear = generateConfig.getYear(value);
if (generateConfig.getYear(rangeEnd) === currentYear) end = generateConfig.getMonth(rangeEnd);
if (generateConfig.getYear(rangeStart) === currentYear) start = generateConfig.getMonth(rangeStart);
}
const months = locale.shortMonths || generateConfig.locale.getShortMonths(locale.locale);
const options = [];
for (let index = start; index <= end; index += 1) options.push({
label: months[index],
value: index
});
return /* @__PURE__ */ import_react.createElement(Select, {
size: fullscreen ? void 0 : "small",
className: `${prefixCls}-month-select`,
value: month,
options,
onChange: (newMonth) => {
onChange(generateConfig.setMonth(value, newMonth));
},
getPopupContainer: () => divRef.current
});
}
function ModeSwitch(props) {
const { prefixCls, locale, mode, fullscreen, onModeChange } = props;
return /* @__PURE__ */ import_react.createElement(group_default, {
onChange: ({ target: { value } }) => {
onModeChange(value);
},
value: mode,
size: fullscreen ? void 0 : "small",
className: `${prefixCls}-mode-switch`
}, /* @__PURE__ */ import_react.createElement(radioButton_default, { value: "month" }, locale.month), /* @__PURE__ */ import_react.createElement(radioButton_default, { value: "year" }, locale.year));
}
function CalendarHeader(props) {
const { prefixCls, fullscreen, mode, onChange, onModeChange, className, style } = props;
const divRef = import_react.useRef(null);
const formItemInputContext = (0, import_react.useContext)(FormItemInputContext);
const mergedFormItemInputContext = (0, import_react.useMemo)(() => ({
...formItemInputContext,
isFormItemInput: false
}), [formItemInputContext]);
const sharedProps = {
...props,
fullscreen,
divRef
};
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-header`, className),
style,
ref: divRef
}, /* @__PURE__ */ import_react.createElement(FormItemInputContext.Provider, { value: mergedFormItemInputContext }, /* @__PURE__ */ import_react.createElement(YearSelect, {
...sharedProps,
onChange: (v) => {
onChange(v, "year");
}
}), mode === "month" && /* @__PURE__ */ import_react.createElement(MonthSelect, {
...sharedProps,
onChange: (v) => {
onChange(v, "month");
}
})), /* @__PURE__ */ import_react.createElement(ModeSwitch, {
...sharedProps,
onModeChange
}));
}
//#endregion
//#region node_modules/antd/es/input/style/token.js
function initInputToken(token) {
return merge(token, { inputAffixPadding: token.paddingXXS });
}
var initComponentToken$1 = (token) => {
const { controlHeight, fontSize, lineHeight, lineWidth, controlHeightSM, controlHeightLG, fontSizeLG, lineHeightLG, paddingSM, controlPaddingHorizontalSM, controlPaddingHorizontal, colorFillAlter, colorPrimaryHover, colorPrimary, controlOutlineWidth, controlOutline, colorErrorOutline, colorWarningOutline, colorBgContainer, inputFontSize, inputFontSizeLG, inputFontSizeSM } = token;
const mergedFontSize = inputFontSize || fontSize;
const mergedFontSizeSM = inputFontSizeSM || mergedFontSize;
const mergedFontSizeLG = inputFontSizeLG || fontSizeLG;
const paddingBlock = Math.round((controlHeight - mergedFontSize * lineHeight) / 2 * 10) / 10 - lineWidth;
const paddingBlockSM = Math.round((controlHeightSM - mergedFontSizeSM * lineHeight) / 2 * 10) / 10 - lineWidth;
const paddingBlockLG = Math.ceil((controlHeightLG - mergedFontSizeLG * lineHeightLG) / 2 * 10) / 10 - lineWidth;
return {
paddingBlock: Math.max(paddingBlock, 0),
paddingBlockSM: Math.max(paddingBlockSM, 0),
paddingBlockLG: Math.max(paddingBlockLG, 0),
paddingInline: paddingSM - lineWidth,
paddingInlineSM: controlPaddingHorizontalSM - lineWidth,
paddingInlineLG: controlPaddingHorizontal - lineWidth,
addonBg: colorFillAlter,
activeBorderColor: colorPrimary,
hoverBorderColor: colorPrimaryHover,
activeShadow: `0 0 0 ${controlOutlineWidth}px ${controlOutline}`,
errorActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorErrorOutline}`,
warningActiveShadow: `0 0 0 ${controlOutlineWidth}px ${colorWarningOutline}`,
hoverBg: colorBgContainer,
activeBg: colorBgContainer,
inputFontSize: mergedFontSize,
inputFontSizeLG: mergedFontSizeLG,
inputFontSizeSM: mergedFontSizeSM
};
};
//#endregion
//#region node_modules/antd/es/input/style/variants.js
var genHoverStyle = (token) => ({
borderColor: token.hoverBorderColor,
backgroundColor: token.hoverBg
});
var genDisabledStyle = (token) => ({
color: token.colorTextDisabled,
backgroundColor: token.colorBgContainerDisabled,
borderColor: token.colorBorderDisabled,
boxShadow: "none",
cursor: "not-allowed",
opacity: 1,
"input[disabled], textarea[disabled]": { cursor: "not-allowed" },
"&:hover:not([disabled])": { ...genHoverStyle(merge(token, {
hoverBorderColor: token.colorBorderDisabled,
hoverBg: token.colorBgContainerDisabled
})) }
});
var genBaseOutlinedStyle = (token, options) => ({
background: token.colorBgContainer,
borderWidth: token.lineWidth,
borderStyle: token.lineType,
borderColor: options.borderColor,
"&:hover": {
borderColor: options.hoverBorderColor,
backgroundColor: token.hoverBg
},
"&:focus, &:focus-within": {
borderColor: options.activeBorderColor,
boxShadow: options.activeShadow,
outline: 0,
backgroundColor: token.activeBg
}
});
var genOutlinedStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: {
...genBaseOutlinedStyle(token, options),
[`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: { color: options.affixColor }
},
[`&${token.componentCls}-status-${options.status}${token.componentCls}-disabled`]: { borderColor: options.borderColor }
});
var genOutlinedStyle = (token, extraStyles) => ({ "&-outlined": {
...genBaseOutlinedStyle(token, {
borderColor: token.colorBorder,
hoverBorderColor: token.hoverBorderColor,
activeBorderColor: token.activeBorderColor,
activeShadow: token.activeShadow
}),
[`&${token.componentCls}-disabled, &[disabled]`]: { ...genDisabledStyle(token) },
...genOutlinedStatusStyle(token, {
status: "error",
borderColor: token.colorError,
hoverBorderColor: token.colorErrorBorderHover,
activeBorderColor: token.colorError,
activeShadow: token.errorActiveShadow,
affixColor: token.colorError
}),
...genOutlinedStatusStyle(token, {
status: "warning",
borderColor: token.colorWarning,
hoverBorderColor: token.colorWarningBorderHover,
activeBorderColor: token.colorWarning,
activeShadow: token.warningActiveShadow,
affixColor: token.colorWarning
}),
...extraStyles
} });
var genOutlinedGroupStatusStyle = (token, options) => ({ [`&${token.componentCls}-group-wrapper-status-${options.status}`]: { [`${token.componentCls}-group-addon`]: {
borderColor: options.addonBorderColor,
color: options.addonColor
} } });
var genOutlinedGroupStyle = (token) => ({ "&-outlined": {
[`${token.componentCls}-group`]: {
"&-addon": {
background: token.addonBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
},
"&-addon:first-child": { borderInlineEnd: 0 },
"&-addon:last-child": { borderInlineStart: 0 }
},
...genOutlinedGroupStatusStyle(token, {
status: "error",
addonBorderColor: token.colorError,
addonColor: token.colorErrorText
}),
...genOutlinedGroupStatusStyle(token, {
status: "warning",
addonBorderColor: token.colorWarning,
addonColor: token.colorWarningText
}),
[`&${token.componentCls}-group-wrapper-disabled`]: { [`${token.componentCls}-group-addon`]: { ...genDisabledStyle(token) } }
} });
var genBorderlessStyle = (token, extraStyles) => {
const { componentCls } = token;
return { "&-borderless": {
background: "transparent",
border: "none",
paddingBlock: token.calc(token.paddingBlock).add(token.lineWidth).equal(),
[`&${componentCls}-sm, &${componentCls}-affix-wrapper-sm`]: { paddingBlock: token.calc(token.paddingBlockSM).add(token.lineWidth).equal() },
[`&${componentCls}-lg, &${componentCls}-affix-wrapper-lg`]: { paddingBlock: token.calc(token.paddingBlockLG).add(token.lineWidth).equal() },
"&:focus, &:focus-within": { outline: "none" },
[`&${componentCls}-disabled, &[disabled]`]: {
color: token.colorTextDisabled,
cursor: "not-allowed"
},
[`&${componentCls}-status-error`]: { "&, & input, & textarea": { color: token.colorError } },
[`&${componentCls}-status-warning`]: { "&, & input, & textarea": { color: token.colorWarning } },
...extraStyles
} };
};
var genBaseFilledStyle = (token, options) => ({
background: options.bg,
borderWidth: token.lineWidth,
borderStyle: token.lineType,
borderColor: "transparent",
"input&, & input, textarea&, & textarea": { color: options?.inputColor ?? "unset" },
"&:hover": { background: options.hoverBg },
"&:focus, &:focus-within": {
outline: 0,
borderColor: options.activeBorderColor,
backgroundColor: token.activeBg
}
});
var genFilledStatusStyle = (token, options) => ({ [`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: {
...genBaseFilledStyle(token, options),
[`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: { color: options.affixColor }
} });
var genFilledStyle = (token, extraStyles) => ({ "&-filled": {
...genBaseFilledStyle(token, {
bg: token.colorFillTertiary,
hoverBg: token.colorFillSecondary,
activeBorderColor: token.activeBorderColor,
inputColor: token.colorText
}),
[`&${token.componentCls}-disabled, &[disabled]`]: { ...genDisabledStyle(token) },
...genFilledStatusStyle(token, {
status: "error",
bg: token.colorErrorBg,
hoverBg: token.colorErrorBgHover,
activeBorderColor: token.colorError,
inputColor: token.colorErrorText,
affixColor: token.colorError
}),
...genFilledStatusStyle(token, {
status: "warning",
bg: token.colorWarningBg,
hoverBg: token.colorWarningBgHover,
activeBorderColor: token.colorWarning,
inputColor: token.colorWarningText,
affixColor: token.colorWarning
}),
...extraStyles
} });
var genFilledGroupStatusStyle = (token, options) => ({ [`&${token.componentCls}-group-wrapper-status-${options.status}`]: { [`${token.componentCls}-group-addon`]: {
background: options.addonBg,
color: options.addonColor
} } });
var genFilledGroupStyle = (token) => ({ "&-filled": {
[`${token.componentCls}-group-addon`]: {
background: token.colorFillTertiary,
"&:last-child": { position: "static" }
},
...genFilledGroupStatusStyle(token, {
status: "error",
addonBg: token.colorErrorBg,
addonColor: token.colorErrorText
}),
...genFilledGroupStatusStyle(token, {
status: "warning",
addonBg: token.colorWarningBg,
addonColor: token.colorWarningText
}),
[`&${token.componentCls}-group-wrapper-disabled`]: { [`${token.componentCls}-group`]: {
"&-addon": {
background: token.colorFillTertiary,
color: token.colorTextDisabled
},
"&-addon:first-child": {
borderInlineStart: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderTop: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
},
"&-addon:last-child": {
borderInlineEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderTop: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
}
} }
} });
var genBaseUnderlinedStyle = (token, options) => ({
background: token.colorBgContainer,
borderWidth: `${unit$1(token.lineWidth)} 0`,
borderStyle: `${token.lineType} none`,
borderColor: `transparent transparent ${options.borderColor} transparent`,
borderRadius: 0,
"&:hover": {
borderColor: `transparent transparent ${options.hoverBorderColor} transparent`,
backgroundColor: token.hoverBg
},
"&:focus, &:focus-within": {
borderColor: `transparent transparent ${options.activeBorderColor} transparent`,
outline: 0,
backgroundColor: token.activeBg
}
});
var genUnderlinedStatusStyle = (token, options) => ({
[`&${token.componentCls}-status-${options.status}:not(${token.componentCls}-disabled)`]: {
...genBaseUnderlinedStyle(token, options),
[`${token.componentCls}-prefix, ${token.componentCls}-suffix`]: { color: options.affixColor }
},
[`&${token.componentCls}-status-${options.status}${token.componentCls}-disabled`]: { borderColor: `transparent transparent ${options.borderColor} transparent` }
});
var genUnderlinedStyle = (token, extraStyles) => ({ "&-underlined": {
...genBaseUnderlinedStyle(token, {
borderColor: token.colorBorder,
hoverBorderColor: token.hoverBorderColor,
activeBorderColor: token.activeBorderColor,
activeShadow: token.activeShadow
}),
[`&${token.componentCls}-disabled, &[disabled]`]: {
color: token.colorTextDisabled,
boxShadow: "none",
cursor: "not-allowed",
"&:hover": { borderColor: `transparent transparent ${token.colorBorder} transparent` }
},
"input[disabled], textarea[disabled]": { cursor: "not-allowed" },
...genUnderlinedStatusStyle(token, {
status: "error",
borderColor: token.colorError,
hoverBorderColor: token.colorErrorBorderHover,
activeBorderColor: token.colorError,
activeShadow: token.errorActiveShadow,
affixColor: token.colorError
}),
...genUnderlinedStatusStyle(token, {
status: "warning",
borderColor: token.colorWarning,
hoverBorderColor: token.colorWarningBorderHover,
activeBorderColor: token.colorWarning,
activeShadow: token.warningActiveShadow,
affixColor: token.colorWarning
}),
...extraStyles
} });
//#endregion
//#region node_modules/antd/es/input/style/index.js
var genPlaceholderStyle = (color) => ({
"&::-moz-placeholder": { opacity: 1 },
"&::placeholder": {
color,
userSelect: "none"
},
"&:placeholder-shown": { textOverflow: "ellipsis" }
});
var genInputLargeStyle = (token) => {
const { paddingBlockLG, lineHeightLG, borderRadiusLG, paddingInlineLG } = token;
return {
padding: `${unit$1(paddingBlockLG)} ${unit$1(paddingInlineLG)}`,
fontSize: token.inputFontSizeLG,
lineHeight: lineHeightLG,
borderRadius: borderRadiusLG
};
};
var genInputSmallStyle = (token) => ({
padding: `${unit$1(token.paddingBlockSM)} ${unit$1(token.paddingInlineSM)}`,
fontSize: token.inputFontSizeSM,
borderRadius: token.borderRadiusSM
});
var genBasicInputStyle = (token, option = {}) => ({
position: "relative",
display: "inline-block",
width: "100%",
minWidth: 0,
padding: `${unit$1(token.paddingBlock)} ${unit$1(token.paddingInline)}`,
color: token.colorText,
fontSize: token.inputFontSize,
lineHeight: token.lineHeight,
borderRadius: token.borderRadius,
transition: `all ${token.motionDurationMid}`,
...genPlaceholderStyle(token.colorTextPlaceholder),
"&-lg": {
...genInputLargeStyle(token),
...option.largeStyle
},
"&-sm": {
...genInputSmallStyle(token),
...option.smallStyle
},
"&-rtl, &-textarea-rtl": { direction: "rtl" }
});
var genInputGroupStyle = (token) => {
const { componentCls, antCls } = token;
return {
position: "relative",
display: "table",
width: "100%",
borderCollapse: "separate",
borderSpacing: 0,
"&[class*='col-']": {
paddingInlineEnd: token.paddingXS,
"&:last-child": { paddingInlineEnd: 0 }
},
[`&-lg ${componentCls}, &-lg > ${componentCls}-group-addon`]: { ...genInputLargeStyle(token) },
[`&-sm ${componentCls}, &-sm > ${componentCls}-group-addon`]: { ...genInputSmallStyle(token) },
[`&-lg ${antCls}-select-single`]: { height: token.controlHeightLG },
[`&-sm ${antCls}-select-single`]: { height: token.controlHeightSM },
[`> ${componentCls}`]: {
display: "table-cell",
"&:not(:first-child):not(:last-child)": { borderRadius: 0 }
},
[`${componentCls}-group`]: {
"&-addon, &-wrap": {
display: "table-cell",
width: 1,
whiteSpace: "nowrap",
verticalAlign: "middle",
"&:not(:first-child):not(:last-child)": { borderRadius: 0 }
},
"&-wrap > *": { display: "block !important" },
"&-addon": {
position: "relative",
padding: `0 ${unit$1(token.paddingInline)}`,
color: token.colorText,
fontWeight: "normal",
fontSize: token.inputFontSize,
textAlign: "center",
borderRadius: token.borderRadius,
transition: `all ${token.motionDurationSlow}`,
lineHeight: 1,
[`${antCls}-select`]: {
margin: `${unit$1(token.calc(token.paddingBlock).add(1).mul(-1).equal())} ${unit$1(token.calc(token.paddingInline).mul(-1).equal())}`,
[`&${antCls}-select-single:not(${antCls}-select-customize-input):not(${antCls}-pagination-size-changer)`]: {
backgroundColor: "inherit",
border: `${unit$1(token.lineWidth)} ${token.lineType} transparent`,
boxShadow: "none"
}
},
[`${antCls}-cascader-picker`]: {
margin: `-9px ${unit$1(token.calc(token.paddingInline).mul(-1).equal())}`,
backgroundColor: "transparent",
[`${antCls}-cascader-input`]: {
textAlign: "start",
border: 0,
boxShadow: "none"
}
}
}
},
[componentCls]: {
width: "100%",
marginBottom: 0,
textAlign: "inherit",
"&:focus": {
zIndex: 1,
borderInlineEndWidth: 1
},
"&:hover": {
zIndex: 1,
borderInlineEndWidth: 1
}
},
[`> ${componentCls}:first-child, ${componentCls}-group-addon:first-child`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0,
[`${antCls}-select`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
[`> ${componentCls}-affix-wrapper`]: {
[`&:not(:first-child) ${componentCls}`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
},
[`&:not(:last-child) ${componentCls}`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
}
},
[`> ${componentCls}:last-child, ${componentCls}-group-addon:last-child`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0,
[`${antCls}-select`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
},
[`${componentCls}-affix-wrapper`]: {
"&:not(:last-child)": {
borderStartEndRadius: 0,
borderEndEndRadius: 0
},
"&:not(:first-child)": {
borderStartStartRadius: 0,
borderEndStartRadius: 0
}
},
[`&${componentCls}-group-compact`]: {
display: "block",
...clearFix(),
[`${componentCls}-group-addon, ${componentCls}-group-wrap, > ${componentCls}`]: { "&:not(:first-child):not(:last-child)": {
borderInlineEndWidth: token.lineWidth,
"&:hover, &:focus": { zIndex: 1 }
} },
"& > *": {
display: "inline-flex",
float: "none",
verticalAlign: "top",
borderRadius: 0
},
[`
& > ${componentCls}-affix-wrapper,
& > ${componentCls}-number-affix-wrapper,
& > ${antCls}-picker-range
`]: { display: "inline-flex" },
"& > *:not(:last-child)": {
marginInlineEnd: token.calc(token.lineWidth).mul(-1).equal(),
borderInlineEndWidth: token.lineWidth
},
[componentCls]: { float: "none" },
[`& > ${antCls}-select,
& > ${antCls}-select-auto-complete ${componentCls},
& > ${antCls}-cascader-picker ${componentCls},
& > ${componentCls}-group-wrapper ${componentCls}`]: {
borderInlineEndWidth: token.lineWidth,
borderRadius: 0,
"&:hover, &:focus": { zIndex: 1 }
},
[`& > ${antCls}-select-focused`]: { zIndex: 1 },
[`& > ${antCls}-select > ${antCls}-select-arrow`]: { zIndex: 1 },
[`& > *:first-child,
& > ${antCls}-select:first-child,
& > ${antCls}-select-auto-complete:first-child ${componentCls},
& > ${antCls}-cascader-picker:first-child ${componentCls}`]: {
borderStartStartRadius: token.borderRadius,
borderEndStartRadius: token.borderRadius
},
[`& > *:last-child,
& > ${antCls}-select:last-child,
& > ${antCls}-cascader-picker:last-child ${componentCls},
& > ${antCls}-cascader-picker-focused:last-child ${componentCls}`]: {
borderInlineEndWidth: token.lineWidth,
borderStartEndRadius: token.borderRadius,
borderEndEndRadius: token.borderRadius
},
[`& > ${antCls}-select-auto-complete ${componentCls}`]: { verticalAlign: "top" },
[`${componentCls}-group-wrapper + ${componentCls}-group-wrapper`]: {
marginInlineStart: token.calc(token.lineWidth).mul(-1).equal(),
[`${componentCls}-affix-wrapper`]: {}
}
}
};
};
var genInputStyle$1 = (token) => {
const { componentCls, controlHeightSM, lineWidth, calc } = token;
const colorSmallPadding = calc(controlHeightSM).sub(calc(lineWidth).mul(2)).sub(16).div(2).equal();
return { [componentCls]: {
...resetComponent(token),
...genBasicInputStyle(token),
...genOutlinedStyle(token),
...genFilledStyle(token),
...genBorderlessStyle(token),
...genUnderlinedStyle(token),
"&[type=\"color\"]": {
height: token.controlHeight,
[`&${componentCls}-lg`]: { height: token.controlHeightLG },
[`&${componentCls}-sm`]: {
height: controlHeightSM,
paddingTop: colorSmallPadding,
paddingBottom: colorSmallPadding
}
},
"&[type=\"search\"]::-webkit-search-cancel-button, &[type=\"search\"]::-webkit-search-decoration": { appearance: "none" }
} };
};
var genAllowClearStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-clear-icon`]: {
margin: 0,
padding: 0,
lineHeight: 0,
color: token.colorTextQuaternary,
fontSize: token.fontSizeIcon,
verticalAlign: -1,
cursor: "pointer",
transition: `color ${token.motionDurationSlow}`,
border: "none",
outline: "none",
backgroundColor: "transparent",
"&:hover": { color: token.colorIcon },
"&:focus-visible": {
color: token.colorIcon,
borderRadius: token.borderRadiusSM,
...genFocusOutline(token)
},
"&:active": { color: token.colorText },
"&-hidden": { visibility: "hidden" },
"&-has-suffix": { margin: `0 ${unit$1(token.inputAffixPadding)}` }
} };
};
var genAffixStyle = (token) => {
const { componentCls, inputAffixPadding, colorTextDescription, motionDurationSlow, colorIcon, colorIconHover, iconCls } = token;
const affixCls = `${componentCls}-affix-wrapper`;
const affixClsDisabled = `${componentCls}-affix-wrapper-disabled`;
return {
[affixCls]: {
...genBasicInputStyle(token),
display: "inline-flex",
"&-focused, &:focus": { zIndex: 1 },
[`> input${componentCls}`]: { padding: 0 },
[`> input${componentCls}, > textarea${componentCls}`]: {
fontSize: "inherit",
border: "none",
borderRadius: 0,
outline: "none",
background: "transparent",
color: "inherit",
"&::-ms-reveal": { display: "none" },
"&:focus": { boxShadow: "none !important" }
},
"&::before": {
display: "inline-block",
width: 0,
visibility: "hidden",
content: "\"\\a0\""
},
[componentCls]: {
"&-prefix, &-suffix": {
display: "flex",
flex: "none",
alignItems: "center",
"> *:not(:last-child)": { marginInlineEnd: token.paddingXS }
},
"&-show-count-suffix": {
color: colorTextDescription,
direction: "ltr"
},
"&-show-count-has-suffix": { marginInlineEnd: token.paddingXXS },
"&-prefix": { marginInlineEnd: inputAffixPadding },
"&-suffix": { marginInlineStart: inputAffixPadding }
},
...genAllowClearStyle(token),
[`${iconCls}${componentCls}-password-icon`]: {
color: colorIcon,
cursor: "pointer",
transition: `all ${motionDurationSlow}`,
"&:hover": { color: colorIconHover }
}
},
[`${componentCls}-underlined`]: { borderRadius: 0 },
[affixClsDisabled]: { [`${iconCls}${componentCls}-password-icon`]: {
color: colorIcon,
cursor: "not-allowed",
"&:hover": { color: colorIcon }
} }
};
};
var genGroupStyle$1 = (token) => {
const { componentCls, borderRadiusLG, borderRadiusSM } = token;
return { [`${componentCls}-group`]: {
...resetComponent(token),
...genInputGroupStyle(token),
"&-rtl": { direction: "rtl" },
"&-wrapper": {
display: "inline-block",
width: "100%",
textAlign: "start",
verticalAlign: "top",
"&-rtl": { direction: "rtl" },
"&-lg": { [`${componentCls}-group-addon`]: {
borderRadius: borderRadiusLG,
fontSize: token.inputFontSizeLG
} },
"&-sm": { [`${componentCls}-group-addon`]: { borderRadius: borderRadiusSM } },
...genOutlinedGroupStyle(token),
...genFilledGroupStyle(token),
[`&:not(${componentCls}-compact-first-item):not(${componentCls}-compact-last-item)${componentCls}-compact-item`]: { [`${componentCls}, ${componentCls}-group-addon`]: { borderRadius: 0 } },
[`&:not(${componentCls}-compact-last-item)${componentCls}-compact-first-item`]: { [`${componentCls}, ${componentCls}-group-addon`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
} },
[`&:not(${componentCls}-compact-first-item)${componentCls}-compact-last-item`]: { [`${componentCls}, ${componentCls}-group-addon`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
} },
[`&:not(${componentCls}-compact-last-item)${componentCls}-compact-item`]: { [`${componentCls}-affix-wrapper`]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0
} },
[`&:not(${componentCls}-compact-first-item)${componentCls}-compact-item`]: { [`${componentCls}-affix-wrapper`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0
} }
}
} };
};
var genRangeStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-out-of-range`]: { [`&, & input, & textarea, ${componentCls}-show-count-suffix, ${componentCls}-data-count`]: { color: token.colorError } } };
};
var useSharedStyle = genStyleHooks(["Input", "Shared"], (token) => {
const inputToken = merge(token, initInputToken(token));
return [genInputStyle$1(inputToken), genAffixStyle(inputToken)];
}, initComponentToken$1, { resetFont: false });
var style_default$41 = genStyleHooks(["Input", "Component"], (token) => {
const inputToken = merge(token, initInputToken(token));
return [
genGroupStyle$1(inputToken),
genRangeStyle(inputToken),
genCompactItemStyle(inputToken, {
focus: true,
focusElCls: `${inputToken.componentCls}-affix-wrapper-focused`
})
];
}, initComponentToken$1, { resetFont: false });
//#endregion
//#region node_modules/antd/es/date-picker/style/util.js
/**
* Get multiple selector needed style. The calculation:
*
* ContainerPadding = BasePadding - ItemMargin
*
* Border: ╔═══════════════════════════╗ ┬
* ContainerPadding: ║ ║ │
* ╟───────────────────────────╢ ┬ │
* Item Margin: ║ ║ │ │
* ║ ┌──────────┐ ║ │ │
* Item(multipleItemHeight): ║ BasePadding │ Item │ ║ Overflow Container(ControlHeight)
* ║ └──────────┘ ║ │ │
* Item Margin: ║ ║ │ │
* ╟───────────────────────────╢ ┴ │
* ContainerPadding: ║ ║ │
* Border: ╚═══════════════════════════╝ ┴
*/
var getMultipleSelectorUnit = (token) => {
const { multipleSelectItemHeight, paddingXXS, lineWidth, INTERNAL_FIXED_ITEM_MARGIN } = token;
const basePadding = token.max(token.calc(paddingXXS).sub(lineWidth).equal(), 0);
return {
basePadding,
containerPadding: token.max(token.calc(basePadding).sub(INTERNAL_FIXED_ITEM_MARGIN).equal(), 0),
itemHeight: unit$1(multipleSelectItemHeight),
itemLineHeight: unit$1(token.calc(multipleSelectItemHeight).sub(token.calc(token.lineWidth).mul(2)).equal())
};
};
/**
* Get the `@rc-component/overflow` needed style.
* It's a share style which means not affected by `size`.
*/
var genOverflowStyle = (token) => {
const { componentCls, iconCls, borderRadiusSM, motionDurationSlow, paddingXS, multipleItemColorDisabled, multipleItemBorderColorDisabled, colorIcon, colorIconHover, INTERNAL_FIXED_ITEM_MARGIN } = token;
return {
/**
* Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
* may update to redesign with its align logic.
*/
[`${componentCls}-selection-overflow`]: {
position: "relative",
display: "flex",
flex: "auto",
flexWrap: "wrap",
maxWidth: "100%",
"&-item": {
flex: "none",
alignSelf: "center",
maxWidth: "calc(100% - 4px)",
display: "inline-flex"
},
[`${componentCls}-selection-item`]: {
display: "flex",
alignSelf: "center",
flex: "none",
boxSizing: "border-box",
maxWidth: "100%",
marginBlock: INTERNAL_FIXED_ITEM_MARGIN,
borderRadius: borderRadiusSM,
cursor: "default",
transition: [
`font-size`,
`line-height`,
`height`
].map((prop) => `${prop} ${motionDurationSlow}`).join(", "),
marginInlineEnd: token.calc(INTERNAL_FIXED_ITEM_MARGIN).mul(2).equal(),
paddingInlineStart: paddingXS,
paddingInlineEnd: token.calc(paddingXS).div(2).equal(),
[`${componentCls}-disabled&`]: {
color: multipleItemColorDisabled,
borderColor: multipleItemBorderColorDisabled,
cursor: "not-allowed"
},
"&-content": {
display: "inline-block",
marginInlineEnd: token.calc(paddingXS).div(2).equal(),
overflow: "hidden",
whiteSpace: "pre",
textOverflow: "ellipsis"
},
"&-remove": {
...resetIcon(),
display: "inline-flex",
alignItems: "center",
color: colorIcon,
fontWeight: "bold",
fontSize: 10,
lineHeight: "inherit",
cursor: "pointer",
[`> ${iconCls}`]: { verticalAlign: "-0.2em" },
"&:hover": { color: colorIconHover }
}
}
} };
};
//#endregion
//#region node_modules/antd/es/date-picker/style/multiple.js
var genSize = (token, suffix) => {
const { componentCls, controlHeight } = token;
const suffixCls = suffix ? `${componentCls}-${suffix}` : "";
const multipleSelectorUnit = getMultipleSelectorUnit(token);
return [{ [`${componentCls}-multiple${suffixCls}`]: {
paddingBlock: multipleSelectorUnit.containerPadding,
paddingInlineStart: multipleSelectorUnit.basePadding,
minHeight: controlHeight,
[`${componentCls}-selection-item`]: {
height: multipleSelectorUnit.itemHeight,
lineHeight: unit$1(multipleSelectorUnit.itemLineHeight)
}
} }];
};
var genPickerMultipleStyle = (token) => {
const { componentCls, calc, lineWidth } = token;
const smallToken = merge(token, {
fontHeight: token.fontSize,
selectHeight: token.controlHeightSM,
multipleSelectItemHeight: token.multipleItemHeightSM,
borderRadius: token.borderRadiusSM,
borderRadiusSM: token.borderRadiusXS,
controlHeight: token.controlHeightSM
});
const largeToken = merge(token, {
fontHeight: calc(token.multipleItemHeightLG).sub(calc(lineWidth).mul(2).equal()).equal(),
fontSize: token.fontSizeLG,
selectHeight: token.controlHeightLG,
multipleSelectItemHeight: token.multipleItemHeightLG,
borderRadius: token.borderRadiusLG,
borderRadiusSM: token.borderRadius,
controlHeight: token.controlHeightLG
});
return [
genSize(smallToken, "small"),
genSize(token),
genSize(largeToken, "large"),
{ [`${componentCls}${componentCls}-multiple`]: {
width: "100%",
cursor: "text",
[`${componentCls}-selector`]: {
flex: "auto",
padding: 0,
position: "relative",
"&:after": { margin: 0 },
[`${componentCls}-selection-placeholder`]: {
position: "absolute",
top: "50%",
insetInlineStart: token.inputPaddingHorizontalBase,
insetInlineEnd: 0,
transform: "translateY(-50%)",
transition: `all ${token.motionDurationSlow}`,
overflow: "hidden",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
flex: 1,
color: token.colorTextPlaceholder,
pointerEvents: "none"
}
},
...genOverflowStyle(token),
[`${componentCls}-multiple-input`]: {
width: 0,
height: 0,
border: 0,
visibility: "hidden",
position: "absolute",
zIndex: -1
}
} }
];
};
//#endregion
//#region node_modules/antd/es/date-picker/style/panel.js
var genPickerCellInnerStyle = (token) => {
const { pickerCellCls, pickerCellInnerCls, cellHeight, borderRadiusSM, motionDurationMid, cellHoverBg, lineWidth, lineType, colorPrimary, cellActiveWithRangeBg, colorTextLightSolid, colorTextDisabled, cellBgDisabled, colorFillSecondary } = token;
return {
"&::before": {
position: "absolute",
top: "50%",
insetInlineStart: 0,
insetInlineEnd: 0,
zIndex: 1,
height: cellHeight,
transform: "translateY(-50%)",
content: "\"\"",
pointerEvents: "none"
},
[pickerCellInnerCls]: {
position: "relative",
zIndex: 2,
display: "inline-block",
minWidth: cellHeight,
height: cellHeight,
lineHeight: unit$1(cellHeight),
borderRadius: borderRadiusSM,
transition: `background-color ${motionDurationMid}`
},
[`&:hover:not(${pickerCellCls}-in-view):not(${pickerCellCls}-disabled),
&:hover:not(${pickerCellCls}-selected):not(${pickerCellCls}-range-start):not(${pickerCellCls}-range-end):not(${pickerCellCls}-disabled)`]: { [pickerCellInnerCls]: { background: cellHoverBg } },
[`&-in-view${pickerCellCls}-today ${pickerCellInnerCls}`]: { "&::before": {
position: "absolute",
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
zIndex: 1,
border: `${unit$1(lineWidth)} ${lineType} ${colorPrimary}`,
borderRadius: borderRadiusSM,
content: "\"\""
} },
[`&-in-view${pickerCellCls}-in-range,
&-in-view${pickerCellCls}-range-start,
&-in-view${pickerCellCls}-range-end`]: {
position: "relative",
[`&:not(${pickerCellCls}-disabled):before`]: { background: cellActiveWithRangeBg }
},
[`&-in-view${pickerCellCls}-selected,
&-in-view${pickerCellCls}-range-start,
&-in-view${pickerCellCls}-range-end`]: {
[`&:not(${pickerCellCls}-disabled) ${pickerCellInnerCls}`]: {
color: colorTextLightSolid,
background: colorPrimary
},
[`&${pickerCellCls}-disabled ${pickerCellInnerCls}`]: { background: colorFillSecondary }
},
[`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-disabled):before`]: { insetInlineStart: "50%" },
[`&-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-disabled):before`]: { insetInlineEnd: "50%" },
[`&-in-view${pickerCellCls}-range-start:not(${pickerCellCls}-range-end) ${pickerCellInnerCls}`]: {
borderStartStartRadius: borderRadiusSM,
borderEndStartRadius: borderRadiusSM,
borderStartEndRadius: 0,
borderEndEndRadius: 0
},
[`&-in-view${pickerCellCls}-range-end:not(${pickerCellCls}-range-start) ${pickerCellInnerCls}`]: {
borderStartStartRadius: 0,
borderEndStartRadius: 0,
borderStartEndRadius: borderRadiusSM,
borderEndEndRadius: borderRadiusSM
},
"&-disabled": {
color: colorTextDisabled,
cursor: "not-allowed",
[pickerCellInnerCls]: { background: "transparent" },
"&::before": { background: cellBgDisabled }
},
[`&-disabled${pickerCellCls}-today ${pickerCellInnerCls}::before`]: { borderColor: colorTextDisabled }
};
};
var genPanelStyle$2 = (token) => {
const { componentCls, pickerCellCls, pickerCellInnerCls, pickerYearMonthCellWidth, pickerControlIconSize, cellWidth, paddingSM, paddingXS, paddingXXS, colorBgContainer, lineWidth, lineType, borderRadiusLG, colorPrimary, colorTextHeading, colorSplit, pickerControlIconBorderWidth, colorIcon, textHeight, motionDurationMid, colorIconHover, fontWeightStrong, cellHeight, pickerCellPaddingVertical, colorTextDisabled, colorText, fontSize, motionDurationSlow, withoutTimeCellHeight, pickerQuarterPanelContentHeight, borderRadiusSM, colorTextLightSolid, cellHoverBg, timeColumnHeight, timeColumnWidth, timeCellHeight, controlItemBgActive, marginXXS, pickerDatePanelPaddingHorizontal, pickerControlIconMargin } = token;
const pickerPanelWidth = token.calc(cellWidth).mul(7).add(token.calc(pickerDatePanelPaddingHorizontal).mul(2)).equal();
return { [componentCls]: {
"&-panel": {
display: "inline-flex",
flexDirection: "column",
textAlign: "center",
background: colorBgContainer,
borderRadius: borderRadiusLG,
outline: "none",
"&-focused": { borderColor: colorPrimary },
"&-rtl": {
[`${componentCls}-prev-icon,
${componentCls}-super-prev-icon`]: { transform: "rotate(45deg)" },
[`${componentCls}-next-icon,
${componentCls}-super-next-icon`]: { transform: "rotate(-135deg)" },
[`${componentCls}-time-panel`]: { [`${componentCls}-content`]: {
direction: "ltr",
"> *": { direction: "rtl" }
} }
}
},
"&-decade-panel, &-year-panel, &-quarter-panel, &-month-panel, &-week-panel, &-date-panel, &-time-panel": {
display: "flex",
flexDirection: "column",
width: pickerPanelWidth
},
"&-header": {
display: "flex",
padding: `0 ${unit$1(paddingXS)}`,
color: colorTextHeading,
borderBottom: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
"> *": { flex: "none" },
button: {
padding: 0,
color: colorIcon,
lineHeight: unit$1(textHeight),
background: "transparent",
border: 0,
cursor: "pointer",
transition: `color ${motionDurationMid}`,
fontSize: "inherit",
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
"&:empty": { display: "none" }
},
"> button": {
minWidth: "1.6em",
fontSize,
"&:hover": { color: colorIconHover },
"&:disabled": {
opacity: .25,
pointerEvents: "none"
}
},
"&-view": {
flex: "auto",
fontWeight: fontWeightStrong,
lineHeight: unit$1(textHeight),
"> button": {
color: "inherit",
fontWeight: "inherit",
verticalAlign: "top",
"&:not(:first-child)": { marginInlineStart: paddingXS },
"&:hover": { color: colorPrimary }
}
}
},
"&-prev-icon, &-next-icon, &-super-prev-icon, &-super-next-icon": {
position: "relative",
width: pickerControlIconSize,
height: pickerControlIconSize,
"&::before": {
position: "absolute",
top: 0,
insetInlineStart: 0,
width: pickerControlIconSize,
height: pickerControlIconSize,
border: `0 solid currentcolor`,
borderBlockStartWidth: pickerControlIconBorderWidth,
borderInlineStartWidth: pickerControlIconBorderWidth,
content: "\"\""
}
},
"&-super-prev-icon, &-super-next-icon": { "&::after": {
position: "absolute",
top: pickerControlIconMargin,
insetInlineStart: pickerControlIconMargin,
display: "inline-block",
width: pickerControlIconSize,
height: pickerControlIconSize,
border: "0 solid currentcolor",
borderBlockStartWidth: pickerControlIconBorderWidth,
borderInlineStartWidth: pickerControlIconBorderWidth,
content: "\"\""
} },
"&-prev-icon, &-super-prev-icon": { transform: "rotate(-45deg)" },
"&-next-icon, &-super-next-icon": { transform: "rotate(135deg)" },
"&-content": {
width: "100%",
tableLayout: "fixed",
borderCollapse: "collapse",
"th, td": {
position: "relative",
minWidth: cellHeight,
fontWeight: "normal"
},
th: {
height: token.calc(cellHeight).add(token.calc(pickerCellPaddingVertical).mul(2)).equal(),
color: colorText,
verticalAlign: "middle"
}
},
"&-cell": {
padding: `${unit$1(pickerCellPaddingVertical)} 0`,
color: colorTextDisabled,
cursor: "pointer",
"&-in-view": { color: colorText },
...genPickerCellInnerStyle(token)
},
"&-decade-panel, &-year-panel, &-quarter-panel, &-month-panel": {
[`${componentCls}-content`]: { height: token.calc(withoutTimeCellHeight).mul(4).equal() },
[pickerCellInnerCls]: { padding: `0 ${unit$1(paddingXS)}` }
},
"&-quarter-panel": { [`${componentCls}-content`]: { height: pickerQuarterPanelContentHeight } },
"&-decade-panel": {
[pickerCellInnerCls]: { padding: `0 ${unit$1(token.calc(paddingXS).div(2).equal())}` },
[`${componentCls}-cell::before`]: { display: "none" }
},
"&-year-panel, &-quarter-panel, &-month-panel": {
[`${componentCls}-body`]: { padding: `0 ${unit$1(paddingXS)}` },
[pickerCellInnerCls]: { width: pickerYearMonthCellWidth }
},
"&-date-panel": {
[`${componentCls}-body`]: { padding: `${unit$1(paddingXS)} ${unit$1(pickerDatePanelPaddingHorizontal)}` },
[`${componentCls}-content th`]: {
boxSizing: "border-box",
padding: 0
}
},
"&-week-panel-row": {
td: {
"&:before": { transition: `background-color ${motionDurationMid}` },
"&:first-child:before": {
borderStartStartRadius: borderRadiusSM,
borderEndStartRadius: borderRadiusSM
},
"&:last-child:before": {
borderStartEndRadius: borderRadiusSM,
borderEndEndRadius: borderRadiusSM
}
},
"&:hover td:before": { background: cellHoverBg },
"&-range-start td, &-range-end td, &-selected td, &-hover td": { [`&${pickerCellCls}`]: {
"&:before": { background: colorPrimary },
[`&${componentCls}-cell-week`]: { color: new FastColor(colorTextLightSolid).setA(.5).toHexString() },
[pickerCellInnerCls]: { color: colorTextLightSolid }
} },
"&-range-hover td:before": { background: controlItemBgActive }
},
"&-week-panel, &-date-panel-show-week": {
[`${componentCls}-body`]: { padding: `${unit$1(paddingXS)} ${unit$1(paddingSM)}` },
[`${componentCls}-content th`]: { width: "auto" }
},
"&-datetime-panel": {
display: "flex",
[`${componentCls}-time-panel`]: { borderInlineStart: `${unit$1(lineWidth)} ${lineType} ${colorSplit}` },
[`${componentCls}-date-panel,
${componentCls}-time-panel`]: { transition: `opacity ${motionDurationSlow}` },
"&-active": { [`${componentCls}-date-panel,
${componentCls}-time-panel`]: {
opacity: .3,
"&-active": { opacity: 1 }
} }
},
"&-time-panel": {
width: "auto",
minWidth: "auto",
[`${componentCls}-content`]: {
display: "flex",
flex: "auto",
height: timeColumnHeight
},
"&-column": {
flex: "1 0 auto",
width: timeColumnWidth,
margin: `${unit$1(paddingXXS)} 0`,
padding: 0,
overflowY: "auto",
textAlign: "start",
listStyle: "none",
transition: `background-color ${motionDurationMid}`,
overflowX: "hidden",
"&::-webkit-scrollbar": {
width: 8,
backgroundColor: "transparent"
},
"&::-webkit-scrollbar-thumb": {
backgroundColor: token.colorTextTertiary,
borderRadius: token.borderRadiusSM
},
"&": {
scrollbarWidth: "thin",
scrollbarColor: `${token.colorTextTertiary} transparent`
},
"&::after": {
display: "block",
height: `calc(100% - ${unit$1(timeCellHeight)})`,
content: "\"\""
},
"&:not(:first-child)": { borderInlineStart: `${unit$1(lineWidth)} ${lineType} ${colorSplit}` },
"&-active": { background: new FastColor(controlItemBgActive).setA(.2).toHexString() },
"> li": {
margin: 0,
padding: 0,
[`&${componentCls}-time-panel-cell`]: {
marginInline: marginXXS,
[`${componentCls}-time-panel-cell-inner`]: {
display: "block",
width: token.calc(timeColumnWidth).sub(token.calc(marginXXS).mul(2)).equal(),
height: timeCellHeight,
margin: 0,
paddingBlock: 0,
paddingInlineEnd: 0,
paddingInlineStart: token.calc(timeColumnWidth).sub(timeCellHeight).div(2).equal(),
color: colorText,
lineHeight: unit$1(timeCellHeight),
borderRadius: borderRadiusSM,
cursor: "pointer",
transition: `background-color ${motionDurationMid}`,
"&:hover": { background: cellHoverBg }
},
"&-selected": { [`${componentCls}-time-panel-cell-inner`]: { background: controlItemBgActive } },
"&-disabled": { [`${componentCls}-time-panel-cell-inner`]: {
color: colorTextDisabled,
background: "transparent",
cursor: "not-allowed"
} }
}
}
}
}
} };
};
var genPickerPanelStyle = (token) => {
const { componentCls, textHeight, lineWidth, paddingSM, antCls, colorPrimary, cellActiveWithRangeBg, colorPrimaryBorder, lineType, colorSplit } = token;
return { [`${componentCls}-dropdown`]: {
[`${componentCls}-footer`]: {
borderTop: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
"&-extra": {
padding: `0 ${unit$1(paddingSM)}`,
lineHeight: unit$1(token.calc(textHeight).sub(token.calc(lineWidth).mul(2)).equal()),
textAlign: "start",
"&:not(:last-child)": { borderBottom: `${unit$1(lineWidth)} ${lineType} ${colorSplit}` }
}
},
[`${componentCls}-panels + ${componentCls}-footer ${componentCls}-ranges`]: { justifyContent: "space-between" },
[`${componentCls}-ranges`]: {
marginBlock: 0,
paddingInline: unit$1(paddingSM),
overflow: "hidden",
textAlign: "start",
listStyle: "none",
display: "flex",
justifyContent: "center",
alignItems: "center",
"> li": {
lineHeight: unit$1(token.calc(textHeight).sub(token.calc(lineWidth).mul(2)).equal()),
display: "inline-block"
},
[`${componentCls}-now-btn-disabled`]: {
pointerEvents: "none",
color: token.colorTextDisabled
},
[`${componentCls}-preset > ${antCls}-tag-blue`]: {
color: colorPrimary,
background: cellActiveWithRangeBg,
borderColor: colorPrimaryBorder,
cursor: "pointer"
},
[`${componentCls}-ok`]: {
paddingBlock: token.calc(lineWidth).mul(2).equal(),
marginInlineStart: "auto"
}
}
} };
};
//#endregion
//#region node_modules/antd/es/date-picker/style/token.js
var initPickerPanelToken = (token) => {
const { componentCls, controlHeightLG, paddingXXS, padding } = token;
return {
pickerCellCls: `${componentCls}-cell`,
pickerCellInnerCls: `${componentCls}-cell-inner`,
pickerYearMonthCellWidth: token.calc(controlHeightLG).mul(1.5).equal(),
pickerQuarterPanelContentHeight: token.calc(controlHeightLG).mul(1.4).equal(),
pickerCellPaddingVertical: token.calc(paddingXXS).add(token.calc(paddingXXS).div(2)).equal(),
pickerCellBorderGap: 2,
pickerControlIconSize: 7,
pickerControlIconMargin: 4,
pickerControlIconBorderWidth: 1.5,
pickerDatePanelPaddingHorizontal: token.calc(padding).add(token.calc(paddingXXS).div(2)).equal()
};
};
var initPanelComponentToken = (token) => {
const { colorBgContainerDisabled, controlHeight, controlHeightSM, controlHeightLG, paddingXXS, lineWidth } = token;
const dblPaddingXXS = paddingXXS * 2;
const dblLineWidth = lineWidth * 2;
const multipleItemHeight = Math.min(controlHeight - dblPaddingXXS, controlHeight - dblLineWidth);
const multipleItemHeightSM = Math.min(controlHeightSM - dblPaddingXXS, controlHeightSM - dblLineWidth);
const multipleItemHeightLG = Math.min(controlHeightLG - dblPaddingXXS, controlHeightLG - dblLineWidth);
return {
INTERNAL_FIXED_ITEM_MARGIN: Math.floor(paddingXXS / 2),
cellHoverBg: token.controlItemBgHover,
cellActiveWithRangeBg: token.controlItemBgActive,
cellHoverWithRangeBg: new FastColor(token.colorPrimary).lighten(35).toHexString(),
cellRangeBorderColor: new FastColor(token.colorPrimary).lighten(20).toHexString(),
cellBgDisabled: colorBgContainerDisabled,
timeColumnWidth: controlHeightLG * 1.4,
timeColumnHeight: 224,
timeCellHeight: 28,
cellWidth: controlHeightSM * 1.5,
cellHeight: controlHeightSM,
textHeight: controlHeightLG,
withoutTimeCellHeight: controlHeightLG * 1.65,
multipleItemBg: token.colorFillSecondary,
multipleItemBorderColor: "transparent",
multipleItemHeight,
multipleItemHeightSM,
multipleItemHeightLG,
multipleSelectorBgDisabled: colorBgContainerDisabled,
multipleItemColorDisabled: token.colorTextDisabled,
multipleItemBorderColorDisabled: "transparent"
};
};
var prepareComponentToken$36 = (token) => ({
...initComponentToken$1(token),
...initPanelComponentToken(token),
...getArrowToken(token),
presetsWidth: 120,
presetsMaxWidth: 200,
zIndexPopup: token.zIndexPopupBase + 50
});
//#endregion
//#region node_modules/antd/es/date-picker/style/variants.js
var genVariantsStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: [{
...genOutlinedStyle(token),
...genUnderlinedStyle(token),
...genFilledStyle(token),
...genBorderlessStyle(token)
}, {
"&-outlined": { [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
background: token.multipleItemBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
} },
"&-filled": { [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
background: token.colorBgContainer,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`
} },
"&-borderless": { [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
background: token.multipleItemBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
} },
"&-underlined": { [`&${componentCls}-multiple ${componentCls}-selection-item`]: {
background: token.multipleItemBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.multipleItemBorderColor}`
} }
}] };
};
//#endregion
//#region node_modules/antd/es/date-picker/style/index.js
var genPickerPadding = (paddingBlock, paddingInline) => {
return { padding: `${unit$1(paddingBlock)} ${unit$1(paddingInline)}` };
};
var genPickerStatusStyle = (token) => {
const { componentCls, colorError, colorWarning } = token;
return { [`${componentCls}:not(${componentCls}-disabled):not([disabled])`]: {
[`&${componentCls}-status-error`]: { [`${componentCls}-active-bar`]: { background: colorError } },
[`&${componentCls}-status-warning`]: { [`${componentCls}-active-bar`]: { background: colorWarning } }
} };
};
var genPickerStyle$1 = (token) => {
const { componentCls, antCls, paddingInline, lineWidth, lineType, colorBorder, borderRadius, motionDurationMid, colorTextDisabled, colorTextPlaceholder, colorTextQuaternary, fontSizeLG, inputFontSizeLG, fontSizeSM, inputFontSizeSM, controlHeightSM, paddingInlineSM, paddingXS, marginXS, colorIcon, lineWidthBold, colorPrimary, motionDurationSlow, zIndexPopup, paddingXXS, sizePopupArrow, colorBgElevated, borderRadiusLG, boxShadowSecondary, borderRadiusSM, colorSplit, cellHoverBg, presetsWidth, presetsMaxWidth, boxShadowPopoverArrow, fontHeight, lineHeightLG } = token;
return [
{ [componentCls]: {
...resetComponent(token),
...genPickerPadding(token.paddingBlock, token.paddingInline),
position: "relative",
display: "inline-flex",
alignItems: "center",
lineHeight: 1,
borderRadius,
transition: [
`border`,
`box-shadow`,
`background-color`
].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
[`${componentCls}-prefix`]: {
flex: "0 0 auto",
marginInlineEnd: token.inputAffixPadding
},
[`${componentCls}-input`]: {
position: "relative",
display: "inline-flex",
alignItems: "center",
width: "100%",
"> input": {
position: "relative",
display: "inline-block",
width: "100%",
color: "inherit",
fontSize: token.inputFontSize ?? token.fontSize,
lineHeight: token.lineHeight,
transition: `all ${motionDurationMid}`,
...genPlaceholderStyle(colorTextPlaceholder),
flex: "auto",
minWidth: 1,
height: "auto",
padding: 0,
background: "transparent",
border: 0,
fontFamily: "inherit",
"&:focus": {
boxShadow: "none",
outline: 0
},
"&[disabled]": {
background: "transparent",
color: colorTextDisabled,
cursor: "not-allowed"
}
},
"&-placeholder": { "> input": { color: colorTextPlaceholder } }
},
"&-large": {
...genPickerPadding(token.paddingBlockLG, token.paddingInlineLG),
borderRadius: token.borderRadiusLG,
[`${componentCls}-input > input`]: {
fontSize: inputFontSizeLG ?? fontSizeLG,
lineHeight: lineHeightLG
}
},
"&-small": {
...genPickerPadding(token.paddingBlockSM, token.paddingInlineSM),
borderRadius: token.borderRadiusSM,
[`${componentCls}-input > input`]: { fontSize: inputFontSizeSM ?? fontSizeSM }
},
[`${componentCls}-suffix`]: {
display: "flex",
flex: "none",
alignSelf: "center",
marginInlineStart: token.calc(paddingXS).div(2).equal(),
color: colorTextQuaternary,
lineHeight: 1,
pointerEvents: "none",
transition: ["opacity", "color"].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
"> *": {
verticalAlign: "top",
"&:not(:last-child)": { marginInlineEnd: marginXS }
}
},
[`${componentCls}-clear`]: {
position: "absolute",
top: "50%",
insetInlineEnd: 0,
color: colorTextQuaternary,
lineHeight: 1,
transform: "translateY(-50%)",
cursor: "pointer",
opacity: 0,
transition: ["opacity", "color"].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
"> *": { verticalAlign: "top" },
"&:hover": { color: colorIcon }
},
"&:hover": {
[`${componentCls}-clear`]: { opacity: 1 },
[`${componentCls}-suffix:not(:last-child)`]: { opacity: 0 }
},
[`${componentCls}-separator`]: {
position: "relative",
display: "inline-block",
width: "1em",
height: fontSizeLG,
color: colorTextQuaternary,
fontSize: fontSizeLG,
verticalAlign: "top",
cursor: "default",
[`${componentCls}-focused &`]: { color: colorIcon },
[`${componentCls}-range-separator &`]: { [`${componentCls}-disabled &`]: { cursor: "not-allowed" } }
},
"&-range": {
position: "relative",
display: "inline-flex",
[`${componentCls}-active-bar`]: {
bottom: token.calc(lineWidth).mul(-1).equal(),
height: lineWidthBold,
background: colorPrimary,
opacity: 0,
transition: `all ${motionDurationSlow} ease-out`,
pointerEvents: "none"
},
[`&${componentCls}-focused`]: { [`${componentCls}-active-bar`]: { opacity: 1 } },
[`${componentCls}-range-separator`]: {
alignItems: "center",
padding: `0 ${unit$1(paddingXS)}`,
lineHeight: 1
}
},
"&-range, &-multiple": {
[`${componentCls}-clear`]: { insetInlineEnd: paddingInline },
[`&${componentCls}-small`]: { [`${componentCls}-clear`]: { insetInlineEnd: paddingInlineSM } }
},
"&-dropdown": {
...resetComponent(token),
...genPanelStyle$2(token),
pointerEvents: "none",
position: "absolute",
top: -9999,
left: {
_skip_check_: true,
value: -9999
},
zIndex: zIndexPopup,
[`&${componentCls}-dropdown-hidden`]: { display: "none" },
"&-rtl": { direction: "rtl" },
[`&${componentCls}-dropdown-placement-bottomLeft,
&${componentCls}-dropdown-placement-bottomRight`]: { [`${componentCls}-range-arrow`]: {
top: 0,
display: "block",
transform: "translateY(-100%)"
} },
[`&${componentCls}-dropdown-placement-topLeft,
&${componentCls}-dropdown-placement-topRight`]: { [`${componentCls}-range-arrow`]: {
bottom: 0,
display: "block",
transform: "translateY(100%) rotate(180deg)"
} },
[`&${antCls}-slide-up-appear, &${antCls}-slide-up-enter`]: { [`${componentCls}-range-arrow${componentCls}-range-arrow`]: { transition: "none" } },
[`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topLeft,
&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-topRight,
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topLeft,
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-topRight`]: { animationName: slideDownIn },
[`&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomLeft,
&${antCls}-slide-up-enter${antCls}-slide-up-enter-active${componentCls}-dropdown-placement-bottomRight,
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomLeft,
&${antCls}-slide-up-appear${antCls}-slide-up-appear-active${componentCls}-dropdown-placement-bottomRight`]: { animationName: slideUpIn },
[`&${antCls}-slide-up-leave ${componentCls}-panel-container`]: { pointerEvents: "none" },
[`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topLeft,
&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-topRight`]: { animationName: slideDownOut },
[`&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomLeft,
&${antCls}-slide-up-leave${antCls}-slide-up-leave-active${componentCls}-dropdown-placement-bottomRight`]: { animationName: slideUpOut },
[`${componentCls}-panel > ${componentCls}-time-panel`]: { paddingTop: paddingXXS },
[`${componentCls}-range-wrapper`]: {
display: "flex",
position: "relative"
},
[`${componentCls}-range-arrow`]: {
position: "absolute",
zIndex: 1,
display: "none",
paddingInline: token.calc(paddingInline).mul(1.5).equal(),
boxSizing: "content-box",
transition: `all ${motionDurationSlow} ease-out`,
...genRoundedArrow(token, colorBgElevated, boxShadowPopoverArrow),
"&:before": { insetInlineStart: token.calc(paddingInline).mul(1.5).equal() }
},
[`${componentCls}-panel-container`]: {
overflow: "hidden",
verticalAlign: "top",
background: colorBgElevated,
borderRadius: borderRadiusLG,
boxShadow: boxShadowSecondary,
transition: `margin ${motionDurationSlow}`,
display: "inline-block",
pointerEvents: "auto",
[`${componentCls}-panel-layout`]: {
display: "flex",
flexWrap: "nowrap",
alignItems: "stretch"
},
[`${componentCls}-presets`]: {
display: "flex",
flexDirection: "column",
minWidth: presetsWidth,
maxWidth: presetsMaxWidth,
ul: {
height: 0,
flex: "auto",
listStyle: "none",
overflow: "auto",
margin: 0,
padding: paddingXS,
borderInlineEnd: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
li: {
...textEllipsis,
borderRadius: borderRadiusSM,
paddingInline: paddingXS,
paddingBlock: token.calc(controlHeightSM).sub(fontHeight).div(2).equal(),
cursor: "pointer",
transition: `all ${motionDurationSlow}`,
"+ li": { marginTop: marginXS },
"&:hover": { background: cellHoverBg }
}
}
},
[`${componentCls}-panels`]: {
display: "inline-flex",
flexWrap: "nowrap",
"&:last-child": { [`${componentCls}-panel`]: { borderWidth: 0 } }
},
[`${componentCls}-panel`]: {
verticalAlign: "top",
background: "transparent",
borderRadius: 0,
borderWidth: 0,
[`${componentCls}-content, table`]: { textAlign: "center" },
"&-focused": { borderColor: colorBorder }
}
}
},
"&-dropdown-range": {
padding: `${unit$1(token.calc(sizePopupArrow).mul(2).div(3).equal())} 0`,
"&-hidden": { display: "none" }
},
"&-rtl": {
direction: "rtl",
[`${componentCls}-separator`]: { transform: "scale(-1, 1)" },
[`${componentCls}-footer`]: { "&-extra": { direction: "rtl" } }
}
} },
initSlideMotion(token, "slide-up"),
initSlideMotion(token, "slide-down"),
initMoveMotion(token, "move-up"),
initMoveMotion(token, "move-down")
];
};
var style_default$40 = genStyleHooks("DatePicker", (token) => {
const pickerToken = merge(initInputToken(token), initPickerPanelToken(token), {
inputPaddingHorizontalBase: token.calc(token.paddingSM).sub(1).equal(),
multipleSelectItemHeight: token.multipleItemHeight,
selectHeight: token.controlHeight
});
return [
genPickerPanelStyle(pickerToken),
genPickerStyle$1(pickerToken),
genVariantsStyle(pickerToken),
genPickerStatusStyle(pickerToken),
genPickerMultipleStyle(pickerToken),
genCompactItemStyle(token, { focusElCls: `${token.componentCls}-focused` })
];
}, prepareComponentToken$36);
//#endregion
//#region node_modules/antd/es/calendar/style/index.js
var genCalendarStyles = (token) => {
const { calendarCls, componentCls, fullBg, fullPanelBg, itemActiveBg } = token;
return {
[calendarCls]: {
...genPanelStyle$2(token),
...resetComponent(token),
background: fullBg,
"&-rtl": { direction: "rtl" },
[`${calendarCls}-header`]: {
display: "flex",
justifyContent: "flex-end",
padding: `${unit$1(token.paddingSM)} 0`,
[`${calendarCls}-year-select`]: { minWidth: token.yearControlWidth },
[`${calendarCls}-month-select`]: {
minWidth: token.monthControlWidth,
marginInlineStart: token.marginXS
},
[`${calendarCls}-mode-switch`]: { marginInlineStart: token.marginXS }
}
},
[`${calendarCls} ${componentCls}-panel`]: {
background: fullPanelBg,
border: 0,
borderTop: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
borderRadius: 0,
[`${componentCls}-month-panel, ${componentCls}-date-panel`]: { width: "auto" },
[`${componentCls}-body`]: { padding: `${unit$1(token.paddingXS)} 0` },
[`${componentCls}-content`]: { width: "100%" }
},
[`${calendarCls}-mini`]: {
borderRadius: token.borderRadiusLG,
[`${calendarCls}-header`]: {
paddingInlineEnd: token.paddingXS,
paddingInlineStart: token.paddingXS
},
[`${componentCls}-panel`]: { borderRadius: `0 0 ${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)}` },
[`${componentCls}-content`]: {
height: token.miniContentHeight,
th: {
height: "auto",
padding: 0,
lineHeight: unit$1(token.weekHeight)
}
},
[`${componentCls}-cell::before`]: { pointerEvents: "none" }
},
[`${calendarCls}${calendarCls}-full`]: {
[`${componentCls}-panel`]: {
display: "block",
width: "100%",
textAlign: "end",
background: fullBg,
border: 0,
[`${componentCls}-body`]: {
"th, td": { padding: 0 },
th: {
height: "auto",
paddingInlineEnd: token.paddingSM,
paddingBottom: token.paddingXXS,
lineHeight: unit$1(token.weekHeight)
}
}
},
[`${componentCls}-cell-week ${componentCls}-cell-inner`]: {
display: "block",
borderRadius: 0,
borderTop: `${unit$1(token.lineWidthBold)} ${token.lineType} ${token.colorSplit}`,
width: "100%",
height: token.calc(token.dateValueHeight).add(token.dateContentHeight).add(token.calc(token.paddingXS).div(2)).add(token.lineWidthBold).equal()
},
[`${componentCls}-cell`]: {
"&::before": { display: "none" },
"&:hover": { [`${calendarCls}-date`]: { background: token.controlItemBgHover } },
[`${calendarCls}-date-today::before`]: { display: "none" },
[`&-in-view${componentCls}-cell-selected`]: { [`${calendarCls}-date, ${calendarCls}-date-today`]: { background: itemActiveBg } },
"&-selected, &-selected:hover": { [`${calendarCls}-date, ${calendarCls}-date-today`]: { [`${calendarCls}-date-value`]: { color: token.colorPrimary } } }
},
[`${calendarCls}-date`]: {
display: "block",
width: "auto",
height: "auto",
margin: `0 ${unit$1(token.calc(token.marginXS).div(2).equal())}`,
padding: `${unit$1(token.calc(token.paddingXS).div(2).equal())} ${unit$1(token.paddingXS)} 0`,
border: 0,
borderTop: `${unit$1(token.lineWidthBold)} ${token.lineType} ${token.colorSplit}`,
borderRadius: 0,
transition: `background-color ${token.motionDurationSlow}`,
"&-value": {
lineHeight: unit$1(token.dateValueHeight),
transition: `color ${token.motionDurationSlow}`
},
"&-content": {
position: "static",
width: "auto",
height: token.dateContentHeight,
overflowY: "auto",
color: token.colorText,
lineHeight: token.lineHeight,
textAlign: "start"
},
"&-today": {
borderColor: token.colorPrimary,
[`${calendarCls}-date-value`]: { color: token.colorText }
}
}
},
[`@media only screen and (max-width: ${unit$1(token.screenXS)}) `]: { [calendarCls]: { [`${calendarCls}-header`]: {
display: "block",
[`${calendarCls}-year-select`]: { width: "50%" },
[`${calendarCls}-month-select`]: { width: `calc(50% - ${unit$1(token.paddingXS)})` },
[`${calendarCls}-mode-switch`]: {
width: "100%",
marginTop: token.marginXS,
marginInlineStart: 0,
"> label": {
width: "50%",
textAlign: "center"
}
}
} } }
};
};
var prepareComponentToken$35 = (token) => ({
fullBg: token.colorBgContainer,
fullPanelBg: token.colorBgContainer,
itemActiveBg: token.controlItemBgActive,
yearControlWidth: 80,
monthControlWidth: 70,
miniContentHeight: 256,
...initPanelComponentToken(token)
});
var style_default$39 = genStyleHooks("Calendar", (token) => {
const calendarCls = `${token.componentCls}-calendar`;
return genCalendarStyles(merge(token, initPickerPanelToken(token), {
calendarCls,
pickerCellInnerCls: `${token.componentCls}-cell-inner`,
dateValueHeight: token.controlHeightSM,
weekHeight: token.calc(token.controlHeightSM).mul(.75).equal(),
dateContentHeight: token.calc(token.calc(token.fontHeightSM).add(token.marginXS)).mul(3).add(token.calc(token.lineWidth).mul(2)).equal()
}));
}, prepareComponentToken$35);
//#endregion
//#region node_modules/antd/es/calendar/generateCalendar.js
var isSameYear = (date1, date2, config) => {
const { getYear } = config;
return date1 && date2 && getYear(date1) === getYear(date2);
};
var isSameMonth = (date1, date2, config) => {
const { getMonth } = config;
return isSameYear(date1, date2, config) && getMonth(date1) === getMonth(date2);
};
var isSameDate = (date1, date2, config) => {
const { getDate } = config;
return isSameMonth(date1, date2, config) && getDate(date1) === getDate(date2);
};
var generateCalendar = (generateConfig) => {
const Calendar = (props) => {
const { prefixCls: customizePrefixCls, className, rootClassName, style, dateFullCellRender, dateCellRender, monthFullCellRender, monthCellRender, cellRender, fullCellRender, headerRender, value, defaultValue, disabledDate, mode, validRange, fullscreen = true, showWeek, onChange, onPanelChange, onSelect, styles, classNames } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("calendar");
const mergedProps = {
...props,
mode,
fullscreen,
showWeek
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const [rootCls, headerCls, panelClassNames, rootStyle, headerStyle, panelStyles] = import_react.useMemo(() => {
const { root: nextRootClassName, header: nextHeaderClassName, ...nextPanelClassNames } = mergedClassNames;
const { root: nextRootStyle, header: nextHeaderStyle, ...nextPanelStyles } = mergedStyles;
return [
nextRootClassName,
nextHeaderClassName,
nextPanelClassNames,
nextRootStyle,
nextHeaderStyle,
nextPanelStyles
];
}, [mergedClassNames, mergedStyles]);
const prefixCls = getPrefixCls("picker", customizePrefixCls);
const calendarPrefixCls = `${prefixCls}-calendar`;
const [hashId, cssVarCls] = style_default$39(prefixCls, calendarPrefixCls);
const today = generateConfig.getNow();
{
const warning = devUseWarning("Calendar");
[
["dateFullCellRender", "fullCellRender"],
["dateCellRender", "cellRender"],
["monthFullCellRender", "fullCellRender"],
["monthCellRender", "cellRender"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const [mergedValue, setMergedValue] = useControlledState(() => defaultValue || generateConfig.getNow(), value);
const [mergedMode, setMergedMode] = useControlledState("month", mode);
const panelMode = import_react.useMemo(() => mergedMode === "year" ? "month" : "date", [mergedMode]);
const mergedDisabledDate = import_react.useCallback((date) => {
return (validRange ? generateConfig.isAfter(validRange[0], date) || generateConfig.isAfter(date, validRange[1]) : false) || !!disabledDate?.(date);
}, [disabledDate, validRange]);
const triggerPanelChange = (date, newMode) => {
onPanelChange?.(date, newMode);
};
const triggerChange = (date) => {
setMergedValue(date);
if (!isSameDate(date, mergedValue, generateConfig)) {
if (panelMode === "date" && !isSameMonth(date, mergedValue, generateConfig) || panelMode === "month" && !isSameYear(date, mergedValue, generateConfig)) triggerPanelChange(date, mergedMode);
onChange?.(date);
}
};
const triggerModeChange = (newMode) => {
setMergedMode(newMode);
triggerPanelChange(mergedValue, newMode);
};
const onInternalSelect = (date, source) => {
triggerChange(date);
onSelect?.(date, { source });
};
const dateRender = import_react.useCallback((date, info) => {
if (fullCellRender) return fullCellRender(date, info);
if (dateFullCellRender) return dateFullCellRender(date);
return /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-cell-inner`, `${calendarPrefixCls}-date`, { [`${calendarPrefixCls}-date-today`]: isSameDate(today, date, generateConfig) }) }, /* @__PURE__ */ import_react.createElement("div", { className: `${calendarPrefixCls}-date-value` }, String(generateConfig.getDate(date)).padStart(2, "0")), /* @__PURE__ */ import_react.createElement("div", { className: `${calendarPrefixCls}-date-content` }, typeof cellRender === "function" ? cellRender(date, info) : dateCellRender?.(date)));
}, [
today,
prefixCls,
calendarPrefixCls,
fullCellRender,
dateFullCellRender,
cellRender,
dateCellRender
]);
const monthRender = import_react.useCallback((date, info) => {
if (fullCellRender) return fullCellRender(date, info);
if (monthFullCellRender) return monthFullCellRender(date);
const months = info.locale.shortMonths || generateConfig.locale.getShortMonths(info.locale.locale);
return /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-cell-inner`, `${calendarPrefixCls}-date`, { [`${calendarPrefixCls}-date-today`]: isSameMonth(today, date, generateConfig) }) }, /* @__PURE__ */ import_react.createElement("div", { className: `${calendarPrefixCls}-date-value` }, months[generateConfig.getMonth(date)]), /* @__PURE__ */ import_react.createElement("div", { className: `${calendarPrefixCls}-date-content` }, typeof cellRender === "function" ? cellRender(date, info) : monthCellRender?.(date)));
}, [
today,
prefixCls,
calendarPrefixCls,
fullCellRender,
monthFullCellRender,
cellRender,
monthCellRender
]);
const [contextLocale] = useLocale$1("Calendar", en_US_default);
const locale = merge$1(contextLocale, props.locale || {});
const mergedCellRender = (current, info) => {
if (info.type === "date") return dateRender(current, info);
if (info.type === "month") return monthRender(current, {
...info,
locale: locale?.lang
});
};
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(calendarPrefixCls, {
[`${calendarPrefixCls}-full`]: fullscreen,
[`${calendarPrefixCls}-mini`]: !fullscreen,
[`${calendarPrefixCls}-rtl`]: direction === "rtl"
}, contextClassName, className, rootClassName, rootCls, hashId, cssVarCls),
style: {
...rootStyle,
...contextStyle,
...style
}
}, headerRender ? headerRender({
value: mergedValue,
type: mergedMode,
onChange: (nextDate) => {
onInternalSelect(nextDate, "customize");
},
onTypeChange: triggerModeChange
}) : /* @__PURE__ */ import_react.createElement(CalendarHeader, {
className: headerCls,
style: headerStyle,
prefixCls: calendarPrefixCls,
value: mergedValue,
generateConfig,
mode: mergedMode,
fullscreen,
locale: locale?.lang,
validRange,
onChange: onInternalSelect,
onModeChange: triggerModeChange
}), /* @__PURE__ */ import_react.createElement(RefPanelPicker, {
classNames: panelClassNames,
styles: panelStyles,
value: mergedValue,
prefixCls,
locale: locale?.lang,
generateConfig,
cellRender: mergedCellRender,
onSelect: (nextDate) => {
onInternalSelect(nextDate, panelMode);
},
mode: panelMode,
picker: panelMode,
disabledDate: mergedDisabledDate,
hideHeader: true,
showWeek
}));
};
Calendar.displayName = "Calendar";
return Calendar;
};
//#endregion
//#region node_modules/antd/es/calendar/index.js
var Calendar = generateCalendar(generateConfig);
Calendar.generateCalendar = generateCalendar;
//#endregion
//#region node_modules/@rc-component/util/es/isMobile.js
var import_is_mobile = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
module.exports = isMobile;
module.exports.isMobile = isMobile;
module.exports.default = isMobile;
var mobileRE = /(android|bb\d+|meego).+mobile|armv7l|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|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i;
var notMobileRE = /CrOS/;
var tabletRE = /android|ipad|playbook|silk/i;
function isMobile(opts) {
if (!opts) opts = {};
let ua = opts.ua;
if (!ua && typeof navigator !== "undefined") ua = navigator.userAgent;
if (ua && ua.headers && typeof ua.headers["user-agent"] === "string") ua = ua.headers["user-agent"];
if (typeof ua !== "string") return false;
let result = mobileRE.test(ua) && !notMobileRE.test(ua) || !!opts.tablet && tabletRE.test(ua);
if (!result && opts.tablet && opts.featureDetect && navigator && navigator.maxTouchPoints > 1 && ua.indexOf("Macintosh") !== -1 && ua.indexOf("Safari") !== -1) result = true;
return result;
}
})))());
var cached;
var getIsMobile = () => {
if (typeof cached === "undefined") cached = (0, import_is_mobile.default)();
return cached;
};
//#endregion
//#region node_modules/@rc-component/tabs/es/TabContext.js
var TabContext_default = /* @__PURE__ */ (0, import_react.createContext)(null);
//#endregion
//#region node_modules/@rc-component/tabs/es/hooks/useIndicator.js
var useIndicator = (options) => {
const { activeTabOffset, horizontal, rtl, indicator = {} } = options;
const { size, align = "center" } = indicator;
const [inkStyle, setInkStyle] = (0, import_react.useState)();
const inkBarRafRef = (0, import_react.useRef)();
const getLength = import_react.useCallback((origin) => {
if (typeof size === "function") return size(origin);
if (typeof size === "number") return size;
return origin;
}, [size]);
function cleanInkBarRaf() {
wrapperRaf.cancel(inkBarRafRef.current);
}
(0, import_react.useEffect)(() => {
const newInkStyle = {};
if (activeTabOffset) if (horizontal) {
newInkStyle.width = getLength(activeTabOffset.width);
const key = rtl ? "right" : "left";
if (align === "start") newInkStyle[key] = activeTabOffset[key];
if (align === "center") {
newInkStyle[key] = activeTabOffset[key] + activeTabOffset.width / 2;
newInkStyle.transform = rtl ? "translateX(50%)" : "translateX(-50%)";
}
if (align === "end") {
newInkStyle[key] = activeTabOffset[key] + activeTabOffset.width;
newInkStyle.transform = "translateX(-100%)";
}
} else {
newInkStyle.height = getLength(activeTabOffset.height);
if (align === "start") newInkStyle.top = activeTabOffset.top;
if (align === "center") {
newInkStyle.top = activeTabOffset.top + activeTabOffset.height / 2;
newInkStyle.transform = "translateY(-50%)";
}
if (align === "end") {
newInkStyle.top = activeTabOffset.top + activeTabOffset.height;
newInkStyle.transform = "translateY(-100%)";
}
}
cleanInkBarRaf();
inkBarRafRef.current = wrapperRaf(() => {
if (!(inkStyle && newInkStyle && Object.keys(newInkStyle).every((key) => {
const newValue = newInkStyle[key];
const oldValue = inkStyle[key];
return typeof newValue === "number" && typeof oldValue === "number" ? Math.round(newValue) === Math.round(oldValue) : newValue === oldValue;
}))) setInkStyle(newInkStyle);
});
return cleanInkBarRaf;
}, [
JSON.stringify(activeTabOffset),
horizontal,
rtl,
align,
getLength
]);
return { style: inkStyle };
};
//#endregion
//#region node_modules/@rc-component/tabs/es/hooks/useOffsets.js
var DEFAULT_SIZE$2 = {
width: 0,
height: 0,
left: 0,
top: 0
};
function useOffsets(tabs, tabSizes, holderScrollWidth) {
return (0, import_react.useMemo)(() => {
const map = /* @__PURE__ */ new Map();
const lastOffset = tabSizes.get(tabs[0]?.key) || DEFAULT_SIZE$2;
const rightOffset = lastOffset.left + lastOffset.width;
for (let i = 0; i < tabs.length; i += 1) {
const { key } = tabs[i];
let data = tabSizes.get(key);
if (!data) data = tabSizes.get(tabs[i - 1]?.key) || DEFAULT_SIZE$2;
const entity = map.get(key) || { ...data };
entity.right = rightOffset - entity.left - entity.width;
map.set(key, entity);
}
return map;
}, [
tabs.map((tab) => tab.key).join("_"),
tabSizes,
holderScrollWidth
]);
}
//#endregion
//#region node_modules/@rc-component/tabs/es/hooks/useSyncState.js
function useSyncState(defaultState, onChange) {
const stateRef = import_react.useRef(defaultState);
const [, forceUpdate] = import_react.useState({});
function setState(updater) {
const newValue = typeof updater === "function" ? updater(stateRef.current) : updater;
if (newValue !== stateRef.current) onChange(newValue, stateRef.current);
stateRef.current = newValue;
forceUpdate({});
}
return [stateRef.current, setState];
}
//#endregion
//#region node_modules/@rc-component/tabs/es/hooks/useTouchMove.js
var MIN_SWIPE_DISTANCE = .1;
var STOP_SWIPE_DISTANCE = .01;
var REFRESH_INTERVAL = 20;
var SPEED_OFF_MULTIPLE = .995 ** REFRESH_INTERVAL;
function useTouchMove(ref, onOffset) {
const [touchPosition, setTouchPosition] = (0, import_react.useState)();
const [lastTimestamp, setLastTimestamp] = (0, import_react.useState)(0);
const [lastTimeDiff, setLastTimeDiff] = (0, import_react.useState)(0);
const [lastOffset, setLastOffset] = (0, import_react.useState)();
const motionRef = (0, import_react.useRef)();
function onTouchStart(e) {
const { screenX, screenY } = e.touches[0];
setTouchPosition({
x: screenX,
y: screenY
});
window.clearInterval(motionRef.current);
}
function onTouchMove(e) {
if (!touchPosition) return;
const { screenX, screenY } = e.touches[0];
setTouchPosition({
x: screenX,
y: screenY
});
const offsetX = screenX - touchPosition.x;
const offsetY = screenY - touchPosition.y;
onOffset(offsetX, offsetY);
const now = Date.now();
setLastTimestamp(now);
setLastTimeDiff(now - lastTimestamp);
setLastOffset({
x: offsetX,
y: offsetY
});
}
function onTouchEnd() {
if (!touchPosition) return;
setTouchPosition(null);
setLastOffset(null);
if (lastOffset) {
const distanceX = lastOffset.x / lastTimeDiff;
const distanceY = lastOffset.y / lastTimeDiff;
if (Math.max(Math.abs(distanceX), Math.abs(distanceY)) < MIN_SWIPE_DISTANCE) return;
let currentX = distanceX;
let currentY = distanceY;
motionRef.current = window.setInterval(() => {
if (Math.abs(currentX) < STOP_SWIPE_DISTANCE && Math.abs(currentY) < STOP_SWIPE_DISTANCE) {
window.clearInterval(motionRef.current);
return;
}
currentX *= SPEED_OFF_MULTIPLE;
currentY *= SPEED_OFF_MULTIPLE;
onOffset(currentX * REFRESH_INTERVAL, currentY * REFRESH_INTERVAL);
}, REFRESH_INTERVAL);
}
}
const lastWheelDirectionRef = (0, import_react.useRef)();
function onWheel(e) {
const { deltaX, deltaY } = e;
let mixed = 0;
const absX = Math.abs(deltaX);
const absY = Math.abs(deltaY);
if (absX === absY) mixed = lastWheelDirectionRef.current === "x" ? deltaX : deltaY;
else if (absX > absY) {
mixed = deltaX;
lastWheelDirectionRef.current = "x";
} else {
mixed = deltaY;
lastWheelDirectionRef.current = "y";
}
if (onOffset(-mixed, -mixed)) e.preventDefault();
}
const touchEventsRef = (0, import_react.useRef)(null);
touchEventsRef.current = {
onTouchStart,
onTouchMove,
onTouchEnd,
onWheel
};
import_react.useEffect(() => {
function onProxyTouchStart(e) {
touchEventsRef.current.onTouchStart(e);
}
function onProxyTouchMove(e) {
touchEventsRef.current.onTouchMove(e);
}
function onProxyTouchEnd(e) {
touchEventsRef.current.onTouchEnd(e);
}
function onProxyWheel(e) {
touchEventsRef.current.onWheel(e);
}
document.addEventListener("touchmove", onProxyTouchMove, { passive: false });
document.addEventListener("touchend", onProxyTouchEnd, { passive: true });
ref.current.addEventListener("touchstart", onProxyTouchStart, { passive: true });
ref.current.addEventListener("wheel", onProxyWheel, { passive: false });
return () => {
document.removeEventListener("touchmove", onProxyTouchMove);
document.removeEventListener("touchend", onProxyTouchEnd);
};
}, []);
}
//#endregion
//#region node_modules/@rc-component/tabs/es/hooks/useUpdate.js
/**
* Help to merge callback with `useLayoutEffect`.
* One time will only trigger once.
*/
function useUpdate(callback) {
const [count, setCount] = (0, import_react.useState)(0);
const effectRef = (0, import_react.useRef)(0);
const callbackRef = (0, import_react.useRef)();
callbackRef.current = callback;
useLayoutUpdateEffect(() => {
callbackRef.current?.();
}, [count]);
return () => {
if (effectRef.current !== count) return;
effectRef.current += 1;
setCount(effectRef.current);
};
}
function useUpdateState(defaultState) {
const batchRef = (0, import_react.useRef)([]);
const [, forceUpdate] = (0, import_react.useState)({});
const state = (0, import_react.useRef)(typeof defaultState === "function" ? defaultState() : defaultState);
const flushUpdate = useUpdate(() => {
let current = state.current;
batchRef.current.forEach((callback) => {
current = callback(current);
});
batchRef.current = [];
state.current = current;
forceUpdate({});
});
function updater(callback) {
batchRef.current.push(callback);
flushUpdate();
}
return [state.current, updater];
}
//#endregion
//#region node_modules/@rc-component/tabs/es/hooks/useVisibleRange.js
var DEFAULT_SIZE$1 = {
width: 0,
height: 0,
left: 0,
top: 0,
right: 0
};
function useVisibleRange(tabOffsets, visibleTabContentValue, transform, tabContentSizeValue, addNodeSizeValue, operationNodeSizeValue, { tabs, tabPosition, rtl }) {
let charUnit;
let position;
let transformSize;
if (["top", "bottom"].includes(tabPosition)) {
charUnit = "width";
position = rtl ? "right" : "left";
transformSize = Math.abs(transform);
} else {
charUnit = "height";
position = "top";
transformSize = -transform;
}
return (0, import_react.useMemo)(() => {
if (!tabs.length) return [0, 0];
const len = tabs.length;
let endIndex = len;
for (let i = 0; i < len; i += 1) {
const offset = tabOffsets.get(tabs[i].key) || DEFAULT_SIZE$1;
if (Math.floor(offset[position] + offset[charUnit]) > Math.floor(transformSize + visibleTabContentValue)) {
endIndex = i - 1;
break;
}
}
let startIndex = 0;
for (let i = len - 1; i >= 0; i -= 1) if ((tabOffsets.get(tabs[i].key) || DEFAULT_SIZE$1)[position] < transformSize) {
startIndex = i + 1;
break;
}
return startIndex > endIndex ? [0, -1] : [startIndex, endIndex];
}, [
tabOffsets,
visibleTabContentValue,
tabContentSizeValue,
addNodeSizeValue,
operationNodeSizeValue,
transformSize,
tabPosition,
tabs.map((tab) => tab.key).join("_"),
rtl
]);
}
//#endregion
//#region node_modules/@rc-component/tabs/es/util.js
/**
* We trade Map as deps which may change with same value but different ref object.
* We should make it as hash for deps
* */
function stringify(obj) {
let tgt;
if (obj instanceof Map) {
tgt = {};
obj.forEach((v, k) => {
tgt[k] = v;
});
} else tgt = obj;
return JSON.stringify(tgt);
}
var RC_TABS_DOUBLE_QUOTE = "TABS_DQ";
function genDataNodeKey(key) {
return String(key).replace(/"/g, RC_TABS_DOUBLE_QUOTE);
}
function getRemovable(closable, closeIcon, editable, disabled) {
if (!editable || disabled || closable === false || closable === void 0 && (closeIcon === false || closeIcon === null)) return false;
return true;
}
//#endregion
//#region node_modules/@rc-component/tabs/es/TabNavList/AddButton.js
var AddButton = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, editable, locale, style } = props;
if (!editable || editable.showAdd === false) return null;
return /* @__PURE__ */ import_react.createElement("button", {
ref,
type: "button",
className: `${prefixCls}-nav-add`,
style,
"aria-label": locale?.addAriaLabel || "Add tab",
onClick: (event) => {
editable.onEdit("add", { event });
}
}, editable.addIcon || "+");
});
//#endregion
//#region node_modules/@rc-component/tabs/es/TabNavList/ExtraContent.js
var ExtraContent = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { position, prefixCls, extra } = props;
if (!extra) return null;
let content;
let assertExtra = {};
if (typeof extra === "object" && !/* @__PURE__ */ import_react.isValidElement(extra)) assertExtra = extra;
else assertExtra.right = extra;
if (position === "right") content = assertExtra.right;
if (position === "left") content = assertExtra.left;
return content ? /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-extra-content`,
ref
}, content) : null;
});
ExtraContent.displayName = "ExtraContent";
//#endregion
//#region node_modules/@rc-component/tabs/es/TabNavList/OperationNode.js
function _extends$49() {
_extends$49 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$49.apply(this, arguments);
}
var OperationNode = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, id, tabs, locale, mobile, more: moreProps = {}, style, className, editable, tabBarGutter, rtl, removeAriaLabel, onTabClick, getPopupContainer, popupClassName, popupStyle } = props;
const [open, setOpen] = (0, import_react.useState)(false);
const [selectedKey, setSelectedKey] = (0, import_react.useState)(null);
const { icon: moreIcon = "More" } = moreProps;
const popupId = `${id}-more-popup`;
const dropdownPrefix = `${prefixCls}-dropdown`;
const selectedItemId = selectedKey !== null ? `${popupId}-${selectedKey}` : null;
const dropdownAriaLabel = locale?.dropdownAriaLabel;
function onRemoveTab(event, key) {
event.preventDefault();
event.stopPropagation();
editable.onEdit("remove", {
key,
event
});
}
const menu = /* @__PURE__ */ import_react.createElement(ExportMenu, {
onClick: ({ key, domEvent }) => {
onTabClick(key, domEvent);
setOpen(false);
},
prefixCls: `${dropdownPrefix}-menu`,
id: popupId,
tabIndex: -1,
role: "listbox",
"aria-activedescendant": selectedItemId,
selectedKeys: [selectedKey],
"aria-label": dropdownAriaLabel !== void 0 ? dropdownAriaLabel : "expanded dropdown"
}, tabs.map((tab) => {
const { closable, disabled, closeIcon, key, label } = tab;
const removable = getRemovable(closable, closeIcon, editable, disabled);
return /* @__PURE__ */ import_react.createElement(MenuItem_default, {
key,
id: `${popupId}-${key}`,
role: "option",
"aria-controls": id && `${id}-panel-${key}`,
disabled
}, /* @__PURE__ */ import_react.createElement("span", null, label), removable && /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": removeAriaLabel || "remove",
tabIndex: 0,
className: `${dropdownPrefix}-menu-item-remove`,
onClick: (e) => {
e.stopPropagation();
onRemoveTab(e, key);
}
}, closeIcon || editable.removeIcon || "×"));
}));
function selectOffset(offset) {
const enabledTabs = tabs.filter((tab) => !tab.disabled);
let selectedIndex = enabledTabs.findIndex((tab) => tab.key === selectedKey) || 0;
const len = enabledTabs.length;
for (let i = 0; i < len; i += 1) {
selectedIndex = (selectedIndex + offset + len) % len;
const tab = enabledTabs[selectedIndex];
if (!tab.disabled) {
setSelectedKey(tab.key);
return;
}
}
}
function onKeyDown(e) {
const { which } = e;
if (!open) {
if ([
KeyCode.DOWN,
KeyCode.SPACE,
KeyCode.ENTER
].includes(which)) {
setOpen(true);
e.preventDefault();
}
return;
}
switch (which) {
case KeyCode.UP:
selectOffset(-1);
e.preventDefault();
break;
case KeyCode.DOWN:
selectOffset(1);
e.preventDefault();
break;
case KeyCode.ESC:
setOpen(false);
break;
case KeyCode.SPACE:
case KeyCode.ENTER:
if (selectedKey !== null) onTabClick(selectedKey, e);
break;
}
}
(0, import_react.useEffect)(() => {
const ele = document.getElementById(selectedItemId);
if (ele?.scrollIntoView) ele.scrollIntoView(false);
}, [selectedItemId, selectedKey]);
(0, import_react.useEffect)(() => {
if (!open) setSelectedKey(null);
}, [open]);
const moreStyle = { marginInlineStart: tabBarGutter };
if (!tabs.length) {
moreStyle.visibility = "hidden";
moreStyle.order = 1;
}
const overlayClassName = clsx(popupClassName, { [`${dropdownPrefix}-rtl`]: rtl });
const moreNode = mobile ? null : /* @__PURE__ */ import_react.createElement(es_default$18, _extends$49({
prefixCls: dropdownPrefix,
overlay: menu,
visible: tabs.length ? open : false,
onVisibleChange: setOpen,
overlayClassName,
overlayStyle: popupStyle,
mouseEnterDelay: .1,
mouseLeaveDelay: .1,
getPopupContainer
}, moreProps), /* @__PURE__ */ import_react.createElement("button", {
type: "button",
className: `${prefixCls}-nav-more`,
style: moreStyle,
"aria-haspopup": "listbox",
"aria-controls": popupId,
id: `${id}-more`,
"aria-expanded": open,
onKeyDown
}, moreIcon));
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-nav-operations`, className),
style,
ref
}, moreNode, /* @__PURE__ */ import_react.createElement(AddButton, {
prefixCls,
locale,
editable
}));
});
var OperationNode_default = /* @__PURE__ */ import_react.memo(OperationNode, (_, next) => next.tabMoving);
//#endregion
//#region node_modules/@rc-component/tabs/es/TabNavList/TabNode.js
var TabNode = (props) => {
const { prefixCls, id, active, focus, tab: { key, label, disabled, closeIcon, icon }, closable, renderWrapper, removeAriaLabel, editable, onClick, onFocus, onBlur, onKeyDown, onMouseDown, onMouseUp, style, className, tabCount, currentPosition } = props;
const tabPrefix = `${prefixCls}-tab`;
const removable = getRemovable(closable, closeIcon, editable, disabled);
function onInternalClick(e) {
if (disabled) return;
onClick(e);
}
function onRemoveTab(event) {
event.preventDefault();
event.stopPropagation();
editable.onEdit("remove", {
key,
event
});
}
const labelNode = import_react.useMemo(() => icon && typeof label === "string" ? /* @__PURE__ */ import_react.createElement("span", null, label) : label, [label, icon]);
const btnRef = import_react.useRef(null);
import_react.useEffect(() => {
if (focus && btnRef.current) btnRef.current.focus();
}, [focus]);
const node = /* @__PURE__ */ import_react.createElement("div", {
key,
"data-node-key": genDataNodeKey(key),
className: clsx(tabPrefix, className, {
[`${tabPrefix}-with-remove`]: removable,
[`${tabPrefix}-active`]: active,
[`${tabPrefix}-disabled`]: disabled,
[`${tabPrefix}-focus`]: focus
}),
style,
onClick: onInternalClick
}, /* @__PURE__ */ import_react.createElement("div", {
ref: btnRef,
role: "tab",
"aria-selected": active,
id: id && `${id}-tab-${key}`,
className: `${tabPrefix}-btn`,
"aria-controls": id && `${id}-panel-${key}`,
"aria-disabled": disabled,
tabIndex: disabled ? null : active ? 0 : -1,
onClick: (e) => {
e.stopPropagation();
onInternalClick(e);
},
onKeyDown,
onMouseDown,
onMouseUp,
onFocus,
onBlur
}, focus && /* @__PURE__ */ import_react.createElement("div", {
"aria-live": "polite",
style: {
width: 0,
height: 0,
position: "absolute",
overflow: "hidden",
opacity: 0
}
}, `Tab ${currentPosition} of ${tabCount}`), icon && /* @__PURE__ */ import_react.createElement("span", { className: `${tabPrefix}-icon` }, icon), label && labelNode), removable && /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": removeAriaLabel || "remove",
tabIndex: active ? 0 : -1,
className: `${tabPrefix}-remove`,
onClick: (e) => {
e.stopPropagation();
onRemoveTab(e);
}
}, closeIcon || editable.removeIcon || "×"));
return renderWrapper ? renderWrapper(node) : node;
};
//#endregion
//#region node_modules/@rc-component/tabs/es/TabNavList/index.js
function _extends$48() {
_extends$48 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$48.apply(this, arguments);
}
var getTabSize = (tab, containerRect) => {
const { offsetWidth, offsetHeight, offsetTop, offsetLeft } = tab;
const { width, height, left, top } = tab.getBoundingClientRect();
if (Math.abs(width - offsetWidth) < 1) return [
width,
height,
left - containerRect.left,
top - containerRect.top
];
return [
offsetWidth,
offsetHeight,
offsetLeft,
offsetTop
];
};
var getSize$1 = (refObj) => {
const { offsetWidth = 0, offsetHeight = 0 } = refObj.current || {};
if (refObj.current) {
const { width, height } = refObj.current.getBoundingClientRect();
if (Math.abs(width - offsetWidth) < 1) return [width, height];
}
return [offsetWidth, offsetHeight];
};
/**
* Convert `SizeInfo` to unit value. Such as [123, 456] with `top` position get `123`
*/
var getUnitValue = (size, tabPositionTopOrBottom) => {
return size[tabPositionTopOrBottom ? 0 : 1];
};
var TabNavList = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { className, style, id, animated, activeKey, rtl, extra, editable, locale, tabPosition, tabBarGutter, children, onTabClick, onTabScroll, indicator, classNames: tabsClassNames, styles } = props;
const { prefixCls, tabs } = import_react.useContext(TabContext_default);
const containerRef = (0, import_react.useRef)(null);
const extraLeftRef = (0, import_react.useRef)(null);
const extraRightRef = (0, import_react.useRef)(null);
const tabsWrapperRef = (0, import_react.useRef)(null);
const tabListRef = (0, import_react.useRef)(null);
const operationsRef = (0, import_react.useRef)(null);
const innerAddButtonRef = (0, import_react.useRef)(null);
const tabPositionTopOrBottom = tabPosition === "top" || tabPosition === "bottom";
const [transformLeft, setTransformLeft] = useSyncState(0, (next, prev) => {
if (tabPositionTopOrBottom && onTabScroll) onTabScroll({ direction: next > prev ? "left" : "right" });
});
const [transformTop, setTransformTop] = useSyncState(0, (next, prev) => {
if (!tabPositionTopOrBottom && onTabScroll) onTabScroll({ direction: next > prev ? "top" : "bottom" });
});
const [containerExcludeExtraSize, setContainerExcludeExtraSize] = (0, import_react.useState)([0, 0]);
const [tabContentSize, setTabContentSize] = (0, import_react.useState)([0, 0]);
const [addSize, setAddSize] = (0, import_react.useState)([0, 0]);
const [operationSize, setOperationSize] = (0, import_react.useState)([0, 0]);
const [tabSizes, setTabSizes] = useUpdateState(/* @__PURE__ */ new Map());
const tabOffsets = useOffsets(tabs, tabSizes, tabContentSize[0]);
const containerExcludeExtraSizeValue = getUnitValue(containerExcludeExtraSize, tabPositionTopOrBottom);
const tabContentSizeValue = getUnitValue(tabContentSize, tabPositionTopOrBottom);
const addSizeValue = getUnitValue(addSize, tabPositionTopOrBottom);
const operationSizeValue = getUnitValue(operationSize, tabPositionTopOrBottom);
const needScroll = Math.floor(containerExcludeExtraSizeValue) < Math.floor(tabContentSizeValue + addSizeValue);
const visibleTabContentValue = needScroll ? containerExcludeExtraSizeValue - operationSizeValue : containerExcludeExtraSizeValue - addSizeValue;
const operationsHiddenClassName = `${prefixCls}-nav-operations-hidden`;
let transformMin = 0;
let transformMax = 0;
if (!tabPositionTopOrBottom) {
transformMin = Math.min(0, visibleTabContentValue - tabContentSizeValue);
transformMax = 0;
} else if (rtl) {
transformMin = 0;
transformMax = Math.max(0, tabContentSizeValue - visibleTabContentValue);
} else {
transformMin = Math.min(0, visibleTabContentValue - tabContentSizeValue);
transformMax = 0;
}
function alignInRange(value) {
if (value < transformMin) return transformMin;
if (value > transformMax) return transformMax;
return value;
}
const touchMovingRef = (0, import_react.useRef)(null);
const [lockAnimation, setLockAnimation] = (0, import_react.useState)();
function doLockAnimation() {
setLockAnimation(Date.now());
}
function clearTouchMoving() {
if (touchMovingRef.current) clearTimeout(touchMovingRef.current);
}
useTouchMove(tabsWrapperRef, (offsetX, offsetY) => {
function doMove(setState, offset) {
setState((value) => {
return alignInRange(value + offset);
});
}
if (!needScroll) return false;
if (tabPositionTopOrBottom) doMove(setTransformLeft, offsetX);
else doMove(setTransformTop, offsetY);
clearTouchMoving();
doLockAnimation();
return true;
});
(0, import_react.useEffect)(() => {
clearTouchMoving();
if (lockAnimation) touchMovingRef.current = setTimeout(() => {
setLockAnimation(0);
}, 100);
return clearTouchMoving;
}, [lockAnimation]);
const [visibleStart, visibleEnd] = useVisibleRange(tabOffsets, visibleTabContentValue, tabPositionTopOrBottom ? transformLeft : transformTop, tabContentSizeValue, addSizeValue, operationSizeValue, {
...props,
tabs
});
const scrollToTab = useEvent((key = activeKey) => {
const tabOffset = tabOffsets.get(key) || {
width: 0,
height: 0,
left: 0,
right: 0,
top: 0
};
if (tabPositionTopOrBottom) {
let newTransform = transformLeft;
if (rtl) {
if (tabOffset.right < transformLeft) newTransform = tabOffset.right;
else if (tabOffset.right + tabOffset.width > transformLeft + visibleTabContentValue) newTransform = tabOffset.right + tabOffset.width - visibleTabContentValue;
} else if (tabOffset.left < -transformLeft) newTransform = -tabOffset.left;
else if (tabOffset.left + tabOffset.width > -transformLeft + visibleTabContentValue) newTransform = -(tabOffset.left + tabOffset.width - visibleTabContentValue);
setTransformTop(0);
setTransformLeft(alignInRange(newTransform));
} else {
let newTransform = transformTop;
if (tabOffset.top < -transformTop) newTransform = -tabOffset.top;
else if (tabOffset.top + tabOffset.height > -transformTop + visibleTabContentValue) newTransform = -(tabOffset.top + tabOffset.height - visibleTabContentValue);
setTransformLeft(0);
setTransformTop(alignInRange(newTransform));
}
});
const [focusKey, setFocusKey] = (0, import_react.useState)();
const [isMouse, setIsMouse] = (0, import_react.useState)(false);
const enabledTabs = tabs.filter((tab) => !tab.disabled).map((tab) => tab.key);
const onOffset = (offset) => {
const currentIndex = enabledTabs.indexOf(focusKey || activeKey);
const len = enabledTabs.length;
const newKey = enabledTabs[(currentIndex + offset + len) % len];
setFocusKey(newKey);
};
const handleRemoveTab = (removalTabKey, e) => {
const removeIndex = enabledTabs.indexOf(removalTabKey);
const removeTab = tabs.find((tab) => tab.key === removalTabKey);
if (getRemovable(removeTab?.closable, removeTab?.closeIcon, editable, removeTab?.disabled)) {
e.preventDefault();
e.stopPropagation();
editable.onEdit("remove", {
key: removalTabKey,
event: e
});
if (removeIndex === enabledTabs.length - 1) onOffset(-1);
else onOffset(1);
}
};
const handleMouseDown = (key, e) => {
setIsMouse(true);
if (e.button === 1) handleRemoveTab(key, e);
};
const handleKeyDown = (e) => {
const { code } = e;
const isRTL = rtl && tabPositionTopOrBottom;
const firstEnabledTab = enabledTabs[0];
const lastEnabledTab = enabledTabs[enabledTabs.length - 1];
switch (code) {
case "ArrowLeft":
if (tabPositionTopOrBottom) onOffset(isRTL ? 1 : -1);
break;
case "ArrowRight":
if (tabPositionTopOrBottom) onOffset(isRTL ? -1 : 1);
break;
case "ArrowUp":
e.preventDefault();
if (!tabPositionTopOrBottom) onOffset(-1);
break;
case "ArrowDown":
e.preventDefault();
if (!tabPositionTopOrBottom) onOffset(1);
break;
case "Home":
e.preventDefault();
setFocusKey(firstEnabledTab);
break;
case "End":
e.preventDefault();
setFocusKey(lastEnabledTab);
break;
case "Enter":
case "Space":
e.preventDefault();
onTabClick(focusKey ?? activeKey, e);
break;
case "Backspace":
case "Delete":
handleRemoveTab(focusKey, e);
break;
}
};
const tabNodeStyle = {};
if (tabPositionTopOrBottom) tabNodeStyle.marginInlineStart = tabBarGutter;
else tabNodeStyle.marginTop = tabBarGutter;
const tabNodes = tabs.map((tab, i) => {
const { key } = tab;
return /* @__PURE__ */ import_react.createElement(TabNode, {
id,
prefixCls,
key,
tab,
className: tabsClassNames?.item,
style: i === 0 ? styles?.item : {
...tabNodeStyle,
...styles?.item
},
closable: tab.closable,
editable,
active: key === activeKey,
focus: key === focusKey,
renderWrapper: children,
removeAriaLabel: locale?.removeAriaLabel,
tabCount: enabledTabs.length,
currentPosition: i + 1,
onClick: (e) => {
onTabClick(key, e);
},
onKeyDown: handleKeyDown,
onFocus: () => {
if (!isMouse) setFocusKey(key);
scrollToTab(key);
doLockAnimation();
if (!tabsWrapperRef.current) return;
if (!rtl) tabsWrapperRef.current.scrollLeft = 0;
tabsWrapperRef.current.scrollTop = 0;
},
onBlur: () => {
setFocusKey(void 0);
},
onMouseDown: (e) => handleMouseDown(key, e),
onMouseUp: () => {
setIsMouse(false);
}
});
});
const updateTabSizes = () => setTabSizes(() => {
const newSizes = /* @__PURE__ */ new Map();
const listRect = tabListRef.current?.getBoundingClientRect();
tabs.forEach(({ key }) => {
const btnNode = tabListRef.current?.querySelector(`[data-node-key="${genDataNodeKey(key)}"]`);
if (btnNode) {
const [width, height, left, top] = getTabSize(btnNode, listRect);
newSizes.set(key, {
width,
height,
left,
top
});
}
});
return newSizes;
});
(0, import_react.useEffect)(() => {
updateTabSizes();
}, [tabs.map((tab) => tab.key).join("_")]);
const onListHolderResize = useUpdate(() => {
const containerSize = getSize$1(containerRef);
const extraLeftSize = getSize$1(extraLeftRef);
const extraRightSize = getSize$1(extraRightRef);
setContainerExcludeExtraSize([containerSize[0] - extraLeftSize[0] - extraRightSize[0], containerSize[1] - extraLeftSize[1] - extraRightSize[1]]);
const newAddSize = getSize$1(innerAddButtonRef);
setAddSize(newAddSize);
setOperationSize(getSize$1(operationsRef));
const tabContentFullSize = getSize$1(tabListRef);
setTabContentSize([tabContentFullSize[0] - newAddSize[0], tabContentFullSize[1] - newAddSize[1]]);
updateTabSizes();
});
const startHiddenTabs = tabs.slice(0, visibleStart);
const endHiddenTabs = tabs.slice(visibleEnd + 1);
const hiddenTabs = [...startHiddenTabs, ...endHiddenTabs];
const activeTabOffset = tabOffsets.get(activeKey);
const { style: indicatorStyle } = useIndicator({
activeTabOffset,
horizontal: tabPositionTopOrBottom,
indicator,
rtl
});
(0, import_react.useEffect)(() => {
scrollToTab();
}, [
activeKey,
transformMin,
transformMax,
stringify(activeTabOffset),
stringify(tabOffsets),
tabPositionTopOrBottom
]);
(0, import_react.useEffect)(() => {
onListHolderResize();
}, [rtl]);
const hasDropdown = !!hiddenTabs.length;
const wrapPrefix = `${prefixCls}-nav-wrap`;
let pingLeft;
let pingRight;
let pingTop;
let pingBottom;
if (tabPositionTopOrBottom) if (rtl) {
pingRight = transformLeft > 0;
pingLeft = transformLeft !== transformMax;
} else {
pingLeft = transformLeft < 0;
pingRight = transformLeft !== transformMin;
}
else {
pingTop = transformTop < 0;
pingBottom = transformTop !== transformMin;
}
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: onListHolderResize }, /* @__PURE__ */ import_react.createElement("div", {
ref: useComposeRef(ref, containerRef),
role: "tablist",
"aria-orientation": tabPositionTopOrBottom ? "horizontal" : "vertical",
className: clsx(`${prefixCls}-nav`, className, tabsClassNames?.header),
style: {
...styles?.header,
...style
},
onKeyDown: () => {
doLockAnimation();
}
}, /* @__PURE__ */ import_react.createElement(ExtraContent, {
ref: extraLeftRef,
position: "left",
extra,
prefixCls
}), /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: onListHolderResize }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(wrapPrefix, {
[`${wrapPrefix}-ping-left`]: pingLeft,
[`${wrapPrefix}-ping-right`]: pingRight,
[`${wrapPrefix}-ping-top`]: pingTop,
[`${wrapPrefix}-ping-bottom`]: pingBottom
}),
ref: tabsWrapperRef
}, /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: onListHolderResize }, /* @__PURE__ */ import_react.createElement("div", {
ref: tabListRef,
className: `${prefixCls}-nav-list`,
style: {
transform: `translate(${transformLeft}px, ${transformTop}px)`,
transition: lockAnimation ? "none" : void 0
}
}, tabNodes, /* @__PURE__ */ import_react.createElement(AddButton, {
ref: innerAddButtonRef,
prefixCls,
locale,
editable,
style: {
...tabNodes.length === 0 ? void 0 : tabNodeStyle,
visibility: hasDropdown ? "hidden" : null
}
}), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-ink-bar`, tabsClassNames?.indicator, { [`${prefixCls}-ink-bar-animated`]: animated.inkBar }),
style: {
...indicatorStyle,
...styles?.indicator
}
}))))), /* @__PURE__ */ import_react.createElement(OperationNode_default, _extends$48({}, props, {
removeAriaLabel: locale?.removeAriaLabel,
ref: operationsRef,
prefixCls,
tabs: hiddenTabs,
className: !hasDropdown && operationsHiddenClassName,
popupStyle: styles?.popup,
tabMoving: !!lockAnimation
})), /* @__PURE__ */ import_react.createElement(ExtraContent, {
ref: extraRightRef,
position: "right",
extra,
prefixCls
})));
});
//#endregion
//#region node_modules/@rc-component/tabs/es/TabNavList/Wrapper.js
var TabNavListWrapper = ({ renderTabBar, ...restProps }) => {
if (renderTabBar) return renderTabBar(restProps, TabNavList);
return /* @__PURE__ */ import_react.createElement(TabNavList, restProps);
};
TabNavListWrapper.displayName = "TabNavListWrapper";
//#endregion
//#region node_modules/@rc-component/tabs/es/TabPanelList/TabPane.js
var TabPane$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, className, style, id, active, tabKey, children } = props;
const hasContent = import_react.Children.count(children) > 0;
return /* @__PURE__ */ import_react.createElement("div", {
id: id && `${id}-panel-${tabKey}`,
role: "tabpanel",
tabIndex: active && hasContent ? 0 : -1,
"aria-labelledby": id && `${id}-tab-${tabKey}`,
"aria-hidden": !active,
style,
className: clsx(prefixCls, active && `${prefixCls}-active`, className),
ref
}, children);
});
TabPane$1.displayName = "TabPane";
//#endregion
//#region node_modules/@rc-component/tabs/es/TabPanelList/index.js
function _extends$47() {
_extends$47 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$47.apply(this, arguments);
}
var TabPanelList = (props) => {
const { id, activeKey, animated, tabPosition, destroyOnHidden, contentStyle, contentClassName } = props;
const { prefixCls, tabs } = import_react.useContext(TabContext_default);
const tabPaneAnimated = animated.tabPane;
const tabPanePrefixCls = `${prefixCls}-tabpane`;
return /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-content-holder`) }, /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-content`, `${prefixCls}-content-${tabPosition}`, { [`${prefixCls}-content-animated`]: tabPaneAnimated }) }, tabs.map((item) => {
const { key, forceRender, style: paneStyle, className: paneClassName, destroyOnHidden: itemDestroyOnHidden, ...restTabProps } = item;
const active = key === activeKey;
return /* @__PURE__ */ import_react.createElement(es_default$28, _extends$47({
key,
visible: active,
forceRender,
removeOnLeave: !!(destroyOnHidden ?? itemDestroyOnHidden),
leavedClassName: `${tabPanePrefixCls}-hidden`
}, animated.tabPaneMotion), ({ style: motionStyle, className: motionClassName }, ref) => /* @__PURE__ */ import_react.createElement(TabPane$1, _extends$47({}, restTabProps, {
prefixCls: tabPanePrefixCls,
id,
tabKey: key,
animated: tabPaneAnimated,
active,
style: {
...contentStyle,
...paneStyle,
...motionStyle
},
className: clsx(contentClassName, paneClassName, motionClassName),
ref
})));
})));
};
//#endregion
//#region node_modules/@rc-component/tabs/es/hooks/useAnimateConfig.js
function useAnimateConfig$1(animated = {
inkBar: true,
tabPane: false
}) {
let mergedAnimated;
if (animated === false) mergedAnimated = {
inkBar: false,
tabPane: false
};
else if (animated === true) mergedAnimated = {
inkBar: true,
tabPane: false
};
else mergedAnimated = {
inkBar: true,
...typeof animated === "object" ? animated : {}
};
if (mergedAnimated.tabPaneMotion && mergedAnimated.tabPane === void 0) mergedAnimated.tabPane = true;
if (!mergedAnimated.tabPaneMotion && mergedAnimated.tabPane) {
warningOnce(false, "`animated.tabPane` is true but `animated.tabPaneMotion` is not provided. Motion will not work.");
mergedAnimated.tabPane = false;
}
return mergedAnimated;
}
//#endregion
//#region node_modules/@rc-component/tabs/es/Tabs.js
function _extends$46() {
_extends$46 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$46.apply(this, arguments);
}
/**
* Should added antd:
* - type
*
* Removed:
* - onNextClick
* - onPrevClick
* - keyboard
*/
var uuid = 0;
var Tabs$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { id, prefixCls = "rc-tabs", className, items, direction, activeKey, defaultActiveKey, editable, animated, tabPosition = "top", tabBarGutter, tabBarStyle, tabBarExtraContent, locale, more, destroyOnHidden, renderTabBar, onChange, onTabClick, onTabScroll, getPopupContainer, popupClassName, indicator, classNames: tabsClassNames, styles, ...restProps } = props;
const tabs = import_react.useMemo(() => (items || []).filter((item) => item && typeof item === "object" && "key" in item), [items]);
const rtl = direction === "rtl";
const mergedAnimated = useAnimateConfig$1(animated);
const [mobile, setMobile] = (0, import_react.useState)(false);
(0, import_react.useEffect)(() => {
setMobile(getIsMobile());
}, []);
const [mergedActiveKey, setMergedActiveKey] = useControlledState(defaultActiveKey ?? tabs[0]?.key, activeKey);
const [activeIndex, setActiveIndex] = (0, import_react.useState)(() => tabs.findIndex((tab) => tab.key === mergedActiveKey));
(0, import_react.useEffect)(() => {
let newActiveIndex = tabs.findIndex((tab) => tab.key === mergedActiveKey);
if (newActiveIndex === -1) {
newActiveIndex = Math.max(0, Math.min(activeIndex, tabs.length - 1));
setMergedActiveKey(tabs[newActiveIndex]?.key);
}
setActiveIndex(newActiveIndex);
}, [
tabs.map((tab) => tab.key).join("_"),
mergedActiveKey,
activeIndex
]);
const [mergedId, setMergedId] = useControlledState(null, id);
(0, import_react.useEffect)(() => {
if (!id) {
setMergedId(`rc-tabs-${uuid}`);
uuid += 1;
}
}, []);
function onInternalTabClick(key, e) {
onTabClick?.(key, e);
const isActiveChanged = key !== mergedActiveKey;
setMergedActiveKey(key);
if (isActiveChanged) onChange?.(key);
}
const sharedProps = {
id: mergedId,
activeKey: mergedActiveKey,
animated: mergedAnimated,
tabPosition,
rtl,
mobile
};
const tabNavBarProps = {
...sharedProps,
editable,
locale,
more,
tabBarGutter,
onTabClick: onInternalTabClick,
onTabScroll,
extra: tabBarExtraContent,
style: tabBarStyle,
getPopupContainer,
popupClassName: clsx(popupClassName, tabsClassNames?.popup),
indicator,
styles,
classNames: tabsClassNames
};
const memoizedValue = import_react.useMemo(() => {
return {
tabs,
prefixCls
};
}, [tabs, prefixCls]);
return /* @__PURE__ */ import_react.createElement(TabContext_default.Provider, { value: memoizedValue }, /* @__PURE__ */ import_react.createElement("div", _extends$46({
ref,
id,
className: clsx(prefixCls, `${prefixCls}-${tabPosition}`, {
[`${prefixCls}-mobile`]: mobile,
[`${prefixCls}-editable`]: editable,
[`${prefixCls}-rtl`]: rtl
}, className)
}, restProps), /* @__PURE__ */ import_react.createElement(TabNavListWrapper, _extends$46({}, tabNavBarProps, { renderTabBar })), /* @__PURE__ */ import_react.createElement(TabPanelList, _extends$46({ destroyOnHidden }, sharedProps, {
contentStyle: styles?.content,
contentClassName: tabsClassNames?.content,
animated: mergedAnimated
}))));
});
Tabs$1.displayName = "Tabs";
//#endregion
//#region node_modules/@rc-component/tabs/es/index.js
var es_default$16 = Tabs$1;
//#endregion
//#region node_modules/antd/es/tabs/hooks/useAnimateConfig.js
var motion = {
motionAppear: false,
motionEnter: true,
motionLeave: true
};
function useAnimateConfig(prefixCls, animated = {
inkBar: true,
tabPane: false
}) {
let mergedAnimated;
if (animated === false) mergedAnimated = {
inkBar: false,
tabPane: false
};
else if (animated === true) mergedAnimated = {
inkBar: true,
tabPane: true
};
else mergedAnimated = {
inkBar: true,
...isPlainObject(animated) ? animated : {}
};
if (mergedAnimated.tabPane) mergedAnimated.tabPaneMotion = {
...motion,
motionName: getTransitionName(prefixCls, "switch")
};
return mergedAnimated;
}
//#endregion
//#region node_modules/antd/es/tabs/hooks/useLegacyItems.js
function filter(items) {
return items.filter((item) => item);
}
function useLegacyItems(items, children) {
devUseWarning("Tabs").deprecated(!children, "Tabs.TabPane", "items");
if (items) return items.map((item) => ({
...item,
destroyOnHidden: item.destroyOnHidden ?? item.destroyInactiveTabPane
}));
return filter(toArray$8(children).map((node) => {
if (/* @__PURE__ */ import_react.isValidElement(node)) {
const { key, props } = node;
const { tab, ...restProps } = props || {};
return {
key: String(key),
...restProps,
label: tab
};
}
return null;
}));
}
//#endregion
//#region node_modules/antd/es/tabs/style/motion.js
var genMotionStyle$2 = (token) => {
const { componentCls, motionDurationSlow } = token;
return [{ [componentCls]: { [`${componentCls}-switch`]: {
"&-appear, &-enter": {
transition: "none",
"&-start": { opacity: 0 },
"&-active": {
opacity: 1,
transition: `opacity ${motionDurationSlow}`
}
},
"&-leave": {
position: "absolute",
transition: "none",
inset: 0,
"&-start": { opacity: 1 },
"&-active": {
opacity: 0,
transition: `opacity ${motionDurationSlow}`
}
}
} } }, [initSlideMotion(token, "slide-up"), initSlideMotion(token, "slide-down")]];
};
//#endregion
//#region node_modules/antd/es/tabs/style/index.js
var genCardStyle$1 = (token) => {
const { componentCls, tabsCardPadding, cardBg, cardGutter, colorBorderSecondary, itemSelectedColor } = token;
return { [`${componentCls}-card`]: {
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
[`${componentCls}-tab`]: {
margin: 0,
padding: tabsCardPadding,
background: cardBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`
},
[`${componentCls}-tab-active`]: {
color: itemSelectedColor,
background: token.colorBgContainer
},
[`${componentCls}-tab-focus:has(${componentCls}-tab-btn:focus-visible)`]: genFocusOutline(token, -3),
[`& ${componentCls}-tab${componentCls}-tab-focus ${componentCls}-tab-btn:focus-visible`]: { outline: "none" },
[`${componentCls}-ink-bar`]: { visibility: "hidden" }
},
[`&${componentCls}-top, &${componentCls}-bottom`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab + ${componentCls}-tab`]: { marginLeft: {
_skip_check_: true,
value: unit$1(cardGutter)
} } } },
[`&${componentCls}-top`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
[`${componentCls}-tab`]: { borderRadius: `${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)} 0 0` },
[`${componentCls}-tab-active`]: { borderBottomColor: token.colorBgContainer }
} },
[`&${componentCls}-bottom`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
[`${componentCls}-tab`]: { borderRadius: `0 0 ${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)}` },
[`${componentCls}-tab-active`]: { borderTopColor: token.colorBgContainer }
} },
[`&${componentCls}-left, &${componentCls}-right`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab + ${componentCls}-tab`]: { marginTop: unit$1(cardGutter) } } },
[`&${componentCls}-left`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
[`${componentCls}-tab`]: { borderRadius: {
_skip_check_: true,
value: `${unit$1(token.borderRadiusLG)} 0 0 ${unit$1(token.borderRadiusLG)}`
} },
[`${componentCls}-tab-active`]: { borderRightColor: {
_skip_check_: true,
value: token.colorBgContainer
} }
} },
[`&${componentCls}-right`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
[`${componentCls}-tab`]: { borderRadius: {
_skip_check_: true,
value: `0 ${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)} 0`
} },
[`${componentCls}-tab-active`]: { borderLeftColor: {
_skip_check_: true,
value: token.colorBgContainer
} }
} }
} };
};
var genDropdownStyle$1 = (token) => {
const { componentCls, itemHoverColor, dropdownEdgeChildVerticalPadding } = token;
return { [`${componentCls}-dropdown`]: {
...resetComponent(token),
position: "absolute",
top: -9999,
left: {
_skip_check_: true,
value: -9999
},
zIndex: token.zIndexPopup,
display: "block",
"&-hidden": { display: "none" },
[`${componentCls}-dropdown-menu`]: {
maxHeight: token.tabsDropdownHeight,
margin: 0,
padding: `${unit$1(dropdownEdgeChildVerticalPadding)} 0`,
overflowX: "hidden",
overflowY: "auto",
textAlign: {
_skip_check_: true,
value: "left"
},
listStyleType: "none",
backgroundColor: token.colorBgContainer,
backgroundClip: "padding-box",
borderRadius: token.borderRadiusLG,
outline: "none",
boxShadow: token.boxShadowSecondary,
"&-item": {
...textEllipsis,
display: "flex",
alignItems: "center",
minWidth: token.tabsDropdownWidth,
margin: 0,
padding: `${unit$1(token.paddingXXS)} ${unit$1(token.paddingSM)}`,
color: token.colorText,
fontWeight: "normal",
fontSize: token.fontSize,
lineHeight: token.lineHeight,
cursor: "pointer",
transition: `all ${token.motionDurationSlow}`,
"> span": {
flex: 1,
whiteSpace: "nowrap"
},
"&-remove": {
flex: "none",
marginLeft: {
_skip_check_: true,
value: token.marginSM
},
color: token.colorIcon,
fontSize: token.fontSizeSM,
background: "transparent",
border: 0,
cursor: "pointer",
"&:hover": { color: itemHoverColor }
},
"&:hover": { background: token.controlItemBgHover },
"&-disabled": { "&, &:hover": {
color: token.colorTextDisabled,
background: "transparent",
cursor: "not-allowed"
} }
}
}
} };
};
var genPositionStyle = (token) => {
const { componentCls, margin, colorBorderSecondary, horizontalMargin, verticalItemPadding, verticalItemMargin, motionDurationSlow, calc } = token;
return {
[`${componentCls}-top, ${componentCls}-bottom`]: {
flexDirection: "column",
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
margin: horizontalMargin,
"&::before": {
position: "absolute",
right: {
_skip_check_: true,
value: 0
},
left: {
_skip_check_: true,
value: 0
},
borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
content: "''"
},
[`${componentCls}-ink-bar`]: {
height: token.lineWidthBold,
"&-animated": { transition: [
"width",
"left",
"right"
].map((prop) => `${prop} ${motionDurationSlow}`).join(", ") }
},
[`${componentCls}-nav-wrap`]: {
"&::before, &::after": {
top: 0,
bottom: 0,
width: token.controlHeight
},
"&::before": {
left: {
_skip_check_: true,
value: 0
},
boxShadow: token.boxShadowTabsOverflowLeft
},
"&::after": {
right: {
_skip_check_: true,
value: 0
},
boxShadow: token.boxShadowTabsOverflowRight
},
[`&${componentCls}-nav-wrap-ping-left::before`]: { opacity: 1 },
[`&${componentCls}-nav-wrap-ping-right::after`]: { opacity: 1 }
}
}
},
[`${componentCls}-top`]: { [`> ${componentCls}-nav,
> div > ${componentCls}-nav`]: {
"&::before": { bottom: 0 },
[`${componentCls}-ink-bar`]: { bottom: 0 }
} },
[`${componentCls}-bottom`]: {
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
order: 1,
marginTop: margin,
marginBottom: 0,
"&::before": { top: 0 },
[`${componentCls}-ink-bar`]: { top: 0 }
},
[`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: { order: 0 }
},
[`${componentCls}-left, ${componentCls}-right`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
flexDirection: "column",
minWidth: calc(token.controlHeight).mul(1.25).equal(),
[`${componentCls}-tab`]: {
padding: verticalItemPadding,
textAlign: "center"
},
[`${componentCls}-tab + ${componentCls}-tab`]: { margin: verticalItemMargin },
[`${componentCls}-nav-wrap`]: {
flexDirection: "column",
"&::before, &::after": {
right: {
_skip_check_: true,
value: 0
},
left: {
_skip_check_: true,
value: 0
},
height: token.controlHeight
},
"&::before": {
top: 0,
boxShadow: token.boxShadowTabsOverflowTop
},
"&::after": {
bottom: 0,
boxShadow: token.boxShadowTabsOverflowBottom
},
[`&${componentCls}-nav-wrap-ping-top::before`]: { opacity: 1 },
[`&${componentCls}-nav-wrap-ping-bottom::after`]: { opacity: 1 }
},
[`${componentCls}-ink-bar`]: {
width: token.lineWidthBold,
"&-animated": { transition: ["height", "top"].map((prop) => `${prop} ${motionDurationSlow}`).join(", ") }
},
[`${componentCls}-nav-list, ${componentCls}-nav-operations`]: {
flex: "1 0 auto",
flexDirection: "column"
}
} },
[`${componentCls}-left`]: {
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-ink-bar`]: { right: {
_skip_check_: true,
value: 0
} } },
[`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
marginLeft: {
_skip_check_: true,
value: unit$1(calc(token.lineWidth).mul(-1).equal())
},
borderLeft: {
_skip_check_: true,
value: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
},
[`> ${componentCls}-content > ${componentCls}-tabpane`]: { paddingLeft: {
_skip_check_: true,
value: token.paddingLG
} }
}
},
[`${componentCls}-right`]: {
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
order: 1,
[`${componentCls}-ink-bar`]: { left: {
_skip_check_: true,
value: 0
} }
},
[`> ${componentCls}-content-holder, > div > ${componentCls}-content-holder`]: {
order: 0,
marginRight: {
_skip_check_: true,
value: calc(token.lineWidth).mul(-1).equal()
},
borderRight: {
_skip_check_: true,
value: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
},
[`> ${componentCls}-content > ${componentCls}-tabpane`]: { paddingRight: {
_skip_check_: true,
value: token.paddingLG
} }
}
}
};
};
var genSizeStyle$3 = (token) => {
const { componentCls, cardPaddingSM, cardPaddingLG, cardHeightSM, cardHeightLG, horizontalItemPaddingSM, horizontalItemPaddingLG } = token;
return {
[componentCls]: {
"&-small": { [`> ${componentCls}-nav`]: { [`${componentCls}-tab`]: {
padding: horizontalItemPaddingSM,
fontSize: token.titleFontSizeSM
} } },
"&-large": { [`> ${componentCls}-nav`]: { [`${componentCls}-tab`]: {
padding: horizontalItemPaddingLG,
fontSize: token.titleFontSizeLG,
lineHeight: token.lineHeightLG
} } }
},
[`${componentCls}-card`]: {
[`&${componentCls}-small`]: {
[`> ${componentCls}-nav`]: {
[`${componentCls}-tab`]: { padding: cardPaddingSM },
[`${componentCls}-nav-add`]: {
minWidth: cardHeightSM,
minHeight: cardHeightSM
}
},
[`&${componentCls}-bottom`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: `0 0 ${unit$1(token.borderRadius)} ${unit$1(token.borderRadius)}` } },
[`&${componentCls}-top`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: `${unit$1(token.borderRadius)} ${unit$1(token.borderRadius)} 0 0` } },
[`&${componentCls}-right`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: {
_skip_check_: true,
value: `0 ${unit$1(token.borderRadius)} ${unit$1(token.borderRadius)} 0`
} } },
[`&${componentCls}-left`]: { [`> ${componentCls}-nav ${componentCls}-tab`]: { borderRadius: {
_skip_check_: true,
value: `${unit$1(token.borderRadius)} 0 0 ${unit$1(token.borderRadius)}`
} } }
},
[`&${componentCls}-large`]: { [`> ${componentCls}-nav`]: {
[`${componentCls}-tab`]: { padding: cardPaddingLG },
[`${componentCls}-nav-add`]: {
minWidth: cardHeightLG,
minHeight: cardHeightLG
}
} }
}
};
};
var genTabStyle = (token) => {
const { componentCls, itemActiveColor, itemHoverColor, iconCls, tabsHorizontalItemMargin, horizontalItemPadding, itemSelectedColor, itemColor } = token;
const tabCls = `${componentCls}-tab`;
return {
[tabCls]: {
position: "relative",
WebkitTouchCallout: "none",
WebkitTapHighlightColor: "transparent",
display: "inline-flex",
alignItems: "center",
padding: horizontalItemPadding,
fontSize: token.titleFontSize,
background: "transparent",
border: 0,
outline: "none",
cursor: "pointer",
color: itemColor,
"&-btn, &-remove": { "&:focus:not(:focus-visible), &:active": { color: itemActiveColor } },
"&-btn": {
outline: "none",
transition: `all ${token.motionDurationSlow}`,
[`${tabCls}-icon:not(:last-child)`]: { marginInlineEnd: token.marginSM }
},
"&-remove": {
flex: "none",
lineHeight: 1,
marginRight: {
_skip_check_: true,
value: token.calc(token.marginXXS).mul(-1).equal()
},
marginLeft: {
_skip_check_: true,
value: token.marginXS
},
color: token.colorIcon,
fontSize: token.fontSizeSM,
background: "transparent",
border: "none",
outline: "none",
cursor: "pointer",
transition: `all ${token.motionDurationSlow}`,
"&:hover": { color: token.colorTextHeading },
...genFocusStyle(token)
},
"&:hover": { color: itemHoverColor },
[`&${tabCls}-active ${tabCls}-btn`]: { color: itemSelectedColor },
[`&${tabCls}-focus ${tabCls}-btn:focus-visible`]: genFocusOutline(token),
[`&${tabCls}-disabled`]: {
color: token.colorTextDisabled,
cursor: "not-allowed"
},
[`&${tabCls}-disabled ${tabCls}-btn, &${tabCls}-disabled ${componentCls}-remove`]: { "&:focus, &:active": { color: token.colorTextDisabled } },
[`& ${tabCls}-remove ${iconCls}`]: {
margin: 0,
verticalAlign: "middle"
},
[`${iconCls}:not(:last-child)`]: { marginRight: {
_skip_check_: true,
value: token.marginSM
} }
},
[`${tabCls} + ${tabCls}`]: { margin: {
_skip_check_: true,
value: tabsHorizontalItemMargin
} }
};
};
var genRtlStyle$2 = (token) => {
const { componentCls, tabsHorizontalItemMarginRTL, iconCls, cardGutter, calc } = token;
return {
[`${componentCls}-rtl`]: {
direction: "rtl",
[`${componentCls}-nav`]: { [`${componentCls}-tab`]: {
margin: {
_skip_check_: true,
value: tabsHorizontalItemMarginRTL
},
[`${componentCls}-tab:last-of-type`]: { marginLeft: {
_skip_check_: true,
value: 0
} },
[iconCls]: {
marginRight: {
_skip_check_: true,
value: 0
},
marginLeft: {
_skip_check_: true,
value: token.marginSM
}
},
[`${componentCls}-tab-remove`]: {
marginRight: {
_skip_check_: true,
value: token.marginXS
},
marginLeft: {
_skip_check_: true,
value: calc(token.marginXXS).mul(-1).equal()
},
[iconCls]: { margin: 0 }
}
} },
[`&${componentCls}-left`]: {
[`> ${componentCls}-nav`]: { order: 1 },
[`> ${componentCls}-content-holder`]: { order: 0 }
},
[`&${componentCls}-right`]: {
[`> ${componentCls}-nav`]: { order: 0 },
[`> ${componentCls}-content-holder`]: { order: 1 }
},
[`&${componentCls}-card${componentCls}-top, &${componentCls}-card${componentCls}-bottom`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-tab + ${componentCls}-tab`]: {
marginRight: {
_skip_check_: true,
value: cardGutter
},
marginLeft: {
_skip_check_: true,
value: 0
}
} } }
},
[`${componentCls}-dropdown-rtl`]: { direction: "rtl" },
[`${componentCls}-menu-item`]: { [`${componentCls}-dropdown-rtl`]: { textAlign: {
_skip_check_: true,
value: "right"
} } }
};
};
var genTabsStyle = (token) => {
const { componentCls, tabsCardPadding, cardHeight, cardGutter, itemHoverColor, itemActiveColor, colorBorderSecondary } = token;
return {
[componentCls]: {
...resetComponent(token),
display: "flex",
[`> ${componentCls}-nav, > div > ${componentCls}-nav`]: {
position: "relative",
display: "flex",
flex: "none",
alignItems: "center",
[`${componentCls}-nav-wrap`]: {
position: "relative",
display: "flex",
flex: "auto",
alignSelf: "stretch",
overflow: "hidden",
whiteSpace: "nowrap",
transform: "translate(0)",
"&::before, &::after": {
position: "absolute",
zIndex: 1,
opacity: 0,
transition: `opacity ${token.motionDurationSlow}`,
content: "''",
pointerEvents: "none"
}
},
[`${componentCls}-nav-list`]: {
position: "relative",
display: "flex",
transition: `opacity ${token.motionDurationSlow}`
},
[`${componentCls}-nav-operations`]: {
display: "flex",
alignSelf: "stretch"
},
[`${componentCls}-nav-operations-hidden`]: {
position: "absolute",
visibility: "hidden",
pointerEvents: "none"
},
[`${componentCls}-nav-more`]: {
position: "relative",
padding: tabsCardPadding,
background: "transparent",
border: 0,
color: token.colorText,
"&::after": {
position: "absolute",
right: {
_skip_check_: true,
value: 0
},
bottom: 0,
left: {
_skip_check_: true,
value: 0
},
height: token.calc(token.controlHeightLG).div(8).equal(),
transform: "translateY(100%)",
content: "''"
}
},
[`${componentCls}-nav-add`]: {
minWidth: cardHeight,
minHeight: cardHeight,
marginLeft: {
_skip_check_: true,
value: cardGutter
},
background: "transparent",
border: `${unit$1(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
borderRadius: `${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)} 0 0`,
outline: "none",
cursor: "pointer",
color: token.colorText,
transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut}`,
"&:hover": { color: itemHoverColor },
"&:active, &:focus:not(:focus-visible)": { color: itemActiveColor },
...genFocusStyle(token, -3)
}
},
[`${componentCls}-extra-content`]: { flex: "none" },
[`${componentCls}-ink-bar`]: {
position: "absolute",
background: token.inkBarColor,
pointerEvents: "none"
},
...genTabStyle(token),
[`${componentCls}-content`]: {
position: "relative",
width: "100%"
},
[`${componentCls}-content-holder`]: {
flex: "auto",
minWidth: 0,
minHeight: 0
},
[`${componentCls}-tabpane`]: {
...genFocusStyle(token),
"&-hidden": { display: "none" }
}
},
[`${componentCls}-centered`]: { [`> ${componentCls}-nav, > div > ${componentCls}-nav`]: { [`${componentCls}-nav-wrap`]: { [`&:not([class*='${componentCls}-nav-wrap-ping']) > ${componentCls}-nav-list`]: { margin: "auto" } } } }
};
};
var prepareComponentToken$34 = (token) => {
const { cardHeight, cardHeightSM, cardHeightLG, controlHeight, controlHeightLG } = token;
const mergedCardHeight = cardHeight || controlHeightLG;
const mergedCardHeightSM = cardHeightSM || controlHeight;
const mergedCardHeightLG = cardHeightLG || controlHeightLG + 8;
return {
zIndexPopup: token.zIndexPopupBase + 50,
cardBg: token.colorFillAlter,
cardHeight: mergedCardHeight,
cardHeightSM: mergedCardHeightSM,
cardHeightLG: mergedCardHeightLG,
cardPadding: `${(mergedCardHeight - token.fontHeight) / 2 - token.lineWidth}px ${token.padding}px`,
cardPaddingSM: `${(mergedCardHeightSM - token.fontHeight) / 2 - token.lineWidth}px ${token.paddingXS}px`,
cardPaddingLG: `${(mergedCardHeightLG - token.fontHeightLG) / 2 - token.lineWidth}px ${token.padding}px`,
titleFontSize: token.fontSize,
titleFontSizeLG: token.fontSizeLG,
titleFontSizeSM: token.fontSize,
inkBarColor: token.colorPrimary,
horizontalMargin: `0 0 ${token.margin}px 0`,
horizontalItemGutter: 32,
horizontalItemMargin: ``,
horizontalItemMarginRTL: ``,
horizontalItemPadding: `${token.paddingSM}px 0`,
horizontalItemPaddingSM: `${token.paddingXS}px 0`,
horizontalItemPaddingLG: `${token.padding}px 0`,
verticalItemPadding: `${token.paddingXS}px ${token.paddingLG}px`,
verticalItemMargin: `${token.margin}px 0 0 0`,
itemColor: token.colorText,
itemSelectedColor: token.colorPrimary,
itemHoverColor: token.colorPrimaryHover,
itemActiveColor: token.colorPrimaryActive,
cardGutter: token.marginXXS / 2
};
};
var style_default$38 = genStyleHooks("Tabs", (token) => {
const tabsToken = merge(token, {
tabsCardPadding: token.cardPadding,
dropdownEdgeChildVerticalPadding: token.paddingXXS,
tabsDropdownHeight: 200,
tabsDropdownWidth: 120,
tabsHorizontalItemMargin: `0 0 0 ${unit$1(token.horizontalItemGutter)}`,
tabsHorizontalItemMarginRTL: `0 0 0 ${unit$1(token.horizontalItemGutter)}`
});
return [
genSizeStyle$3(tabsToken),
genRtlStyle$2(tabsToken),
genPositionStyle(tabsToken),
genDropdownStyle$1(tabsToken),
genCardStyle$1(tabsToken),
genTabsStyle(tabsToken),
genMotionStyle$2(tabsToken)
];
}, prepareComponentToken$34);
//#endregion
//#region node_modules/antd/es/tabs/TabPane.js
var TabPane = () => null;
TabPane.displayName = "DeprecatedTabPane";
//#endregion
//#region node_modules/antd/es/tabs/index.js
var Tabs = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { type, className, rootClassName, size: customSize, onEdit, hideAdd, centered, addIcon, removeIcon, moreIcon, more, popupClassName, children, items, animated, style, indicatorSize, indicator, classNames, styles, destroyInactiveTabPane, destroyOnHidden, tabPlacement, tabPosition, ...restProps } = props;
const { prefixCls: customizePrefixCls } = restProps;
const { getPrefixCls, direction, getPopupContainer, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("tabs");
const { tabs } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("tabs", customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$38(prefixCls, rootCls);
const tabsRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({ nativeElement: tabsRef.current }));
let editable;
if (type === "editable-card") editable = {
onEdit: (editType, { key, event }) => {
onEdit?.(editType === "add" ? event : key, editType);
},
removeIcon: removeIcon ?? tabs?.removeIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon, null),
addIcon: (addIcon ?? tabs?.addIcon) || /* @__PURE__ */ import_react.createElement(RefIcon$14, null),
showAdd: hideAdd !== true
};
const rootPrefixCls = getPrefixCls();
{
const warning = devUseWarning("Tabs");
[["popupClassName", "classNames.popup"], ["tabPosition", "tabPlacement"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
warning(!("onPrevClick" in props) && !("onNextClick" in props), "breaking", "`onPrevClick` and `onNextClick` has been removed. Please use `onTabScroll` instead.");
warning(!(indicatorSize || tabs?.indicatorSize), "deprecated", "`indicatorSize` has been deprecated. Please use `indicator={{ size: ... }}` instead.");
warning.deprecated(!("destroyInactiveTabPane" in props || items?.some((item) => "destroyInactiveTabPane" in item)), "destroyInactiveTabPane", "destroyOnHidden");
}
const size = useSize(customSize);
const mergedItems = useLegacyItems(items, children);
const mergedAnimated = useAnimateConfig(prefixCls, animated);
const mergedIndicator = {
align: indicator?.align ?? tabs?.indicator?.align,
size: indicator?.size ?? indicatorSize ?? tabs?.indicator?.size ?? tabs?.indicatorSize
};
const mergedPlacement = import_react.useMemo(() => {
const placement = tabPlacement ?? tabPosition ?? void 0;
const isRTL = direction === "rtl";
switch (placement) {
case "start": return isRTL ? "right" : "left";
case "end": return isRTL ? "left" : "right";
default: return placement;
}
}, [
tabPlacement,
tabPosition,
direction
]);
const mergedProps = {
...props,
size,
tabPlacement: mergedPlacement,
items: mergedItems
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { popup: { _default: "root" } });
return /* @__PURE__ */ import_react.createElement(es_default$16, {
ref: tabsRef,
direction,
getPopupContainer,
...restProps,
items: mergedItems,
className: clsx({
[`${prefixCls}-large`]: size === "large",
[`${prefixCls}-small`]: size === "small",
[`${prefixCls}-card`]: ["card", "editable-card"].includes(type),
[`${prefixCls}-editable-card`]: type === "editable-card",
[`${prefixCls}-centered`]: centered
}, contextClassName, className, rootClassName, mergedClassNames.root, hashId, cssVarCls, rootCls),
classNames: {
...mergedClassNames,
popup: clsx(popupClassName, hashId, cssVarCls, rootCls, mergedClassNames.popup?.root)
},
styles: mergedStyles,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
editable,
more: {
icon: tabs?.more?.icon ?? tabs?.moreIcon ?? moreIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon$13, null),
transitionName: `${rootPrefixCls}-slide-up`,
...more
},
prefixCls,
animated: mergedAnimated,
indicator: mergedIndicator,
destroyOnHidden: destroyOnHidden ?? destroyInactiveTabPane,
tabPosition: mergedPlacement
});
});
Tabs.TabPane = TabPane;
Tabs.displayName = "Tabs";
//#endregion
//#region node_modules/antd/es/card/CardGrid.js
var CardGrid = ({ prefixCls, className, hoverable = true, ...rest }) => {
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefix = getPrefixCls("card", prefixCls);
const classString = clsx(`${prefix}-grid`, className, { [`${prefix}-grid-hoverable`]: hoverable });
return /* @__PURE__ */ import_react.createElement("div", {
...rest,
className: classString
});
};
CardGrid.displayName = "CardGrid";
//#endregion
//#region node_modules/antd/es/card/style/index.js
var genCardHeadStyle = (token) => {
const { antCls, componentCls, headerHeight, headerPadding, tabsMarginBottom } = token;
return {
display: "flex",
justifyContent: "center",
flexDirection: "column",
minHeight: headerHeight,
marginBottom: -1,
padding: `0 ${unit$1(headerPadding)}`,
color: token.colorTextHeading,
fontWeight: token.fontWeightStrong,
fontSize: token.headerFontSize,
background: token.headerBg,
borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}`,
borderRadius: `${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)} 0 0`,
...clearFix(),
"&-wrapper": {
width: "100%",
display: "flex",
alignItems: "center"
},
"&-title": {
display: "inline-block",
flex: 1,
...textEllipsis,
[`
> ${componentCls}-typography,
> ${componentCls}-typography-edit-content
`]: {
insetInlineStart: 0,
marginTop: 0,
marginBottom: 0
}
},
[`${antCls}-tabs-top`]: {
clear: "both",
marginBottom: tabsMarginBottom,
color: token.colorText,
fontWeight: "normal",
fontSize: token.fontSize,
"&-bar": { borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorderSecondary}` }
}
};
};
var genCardGridStyle = (token) => {
const { cardPaddingBase, colorBorderSecondary, cardShadow, lineWidth } = token;
return {
width: "33.33%",
padding: cardPaddingBase,
border: 0,
borderRadius: 0,
boxShadow: `
${unit$1(lineWidth)} 0 0 0 ${colorBorderSecondary},
0 ${unit$1(lineWidth)} 0 0 ${colorBorderSecondary},
${unit$1(lineWidth)} ${unit$1(lineWidth)} 0 0 ${colorBorderSecondary},
${unit$1(lineWidth)} 0 0 0 ${colorBorderSecondary} inset,
0 ${unit$1(lineWidth)} 0 0 ${colorBorderSecondary} inset;
`,
transition: `all ${token.motionDurationMid}`,
"&-hoverable:hover": {
position: "relative",
zIndex: 1,
boxShadow: cardShadow
}
};
};
var genCardActionsStyle = (token) => {
const { componentCls, iconCls, actionsLiMargin, cardActionsIconSize, colorBorderSecondary, actionsBg } = token;
return {
margin: 0,
padding: 0,
listStyle: "none",
background: actionsBg,
borderTop: `${unit$1(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
display: "flex",
borderRadius: `0 0 ${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)}`,
...clearFix(),
"& > li": {
margin: actionsLiMargin,
color: token.colorTextDescription,
textAlign: "center",
"> span": {
position: "relative",
display: "block",
minWidth: token.calc(token.cardActionsIconSize).mul(2).equal(),
fontSize: token.fontSize,
lineHeight: token.lineHeight,
cursor: "pointer",
"&:hover": {
color: token.colorPrimary,
transition: `color ${token.motionDurationMid}`
},
[`a:not(${componentCls}-btn), > ${iconCls}`]: {
display: "inline-block",
width: "100%",
color: token.colorIcon,
lineHeight: unit$1(token.fontHeight),
transition: `color ${token.motionDurationMid}`,
"&:hover": { color: token.colorPrimary }
},
[`> ${iconCls}`]: {
fontSize: cardActionsIconSize,
lineHeight: unit$1(token.calc(cardActionsIconSize).mul(token.lineHeight).equal())
}
},
"&:not(:last-child)": { borderInlineEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}` }
}
};
};
var genCardMetaStyle = (token) => ({
margin: `${unit$1(token.calc(token.marginXXS).mul(-1).equal())} 0`,
display: "flex",
...clearFix(),
"&-avatar": { paddingInlineEnd: token.padding },
"&-section": {
overflow: "hidden",
flex: 1,
"> div:not(:last-child)": { marginBottom: token.marginXS }
},
"&-title": {
color: token.colorTextHeading,
fontWeight: token.fontWeightStrong,
fontSize: token.fontSizeLG,
...textEllipsis
},
"&-description": { color: token.colorTextDescription }
});
var genCardTypeInnerStyle = (token) => {
const { componentCls, colorFillAlter, headerPadding, bodyPadding } = token;
return {
[`${componentCls}-head`]: {
padding: `0 ${unit$1(headerPadding)}`,
background: colorFillAlter,
"&-title": { fontSize: token.fontSize }
},
[`${componentCls}-body`]: { padding: `${unit$1(token.padding)} ${unit$1(bodyPadding)}` }
};
};
var genCardLoadingStyle = (token) => {
const { componentCls } = token;
return {
overflow: "hidden",
[`${componentCls}-body`]: { userSelect: "none" }
};
};
var genCardStyle = (token) => {
const { componentCls, cardShadow, cardHeadPadding, colorBorderSecondary, boxShadowTertiary, bodyPadding, extraColor, motionDurationMid } = token;
return {
[componentCls]: {
...resetComponent(token),
position: "relative",
background: token.colorBgContainer,
borderRadius: token.borderRadiusLG,
[`&:not(${componentCls}-bordered)`]: { boxShadow: boxShadowTertiary },
[`${componentCls}-head`]: genCardHeadStyle(token),
[`${componentCls}-extra`]: {
marginInlineStart: "auto",
color: extraColor,
fontWeight: "normal",
fontSize: token.fontSize
},
[`${componentCls}-body`]: {
padding: bodyPadding,
borderRadius: `0 0 ${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)}`,
"&:first-child": {
borderStartStartRadius: token.borderRadiusLG,
borderStartEndRadius: token.borderRadiusLG
},
"&:not(:last-child)": {
borderEndStartRadius: 0,
borderEndEndRadius: 0
}
},
[`${componentCls}-grid`]: genCardGridStyle(token),
[`${componentCls}-cover`]: { "> *": {
display: "block",
width: "100%",
borderRadius: `${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)} 0 0`
} },
[`${componentCls}-actions`]: genCardActionsStyle(token),
[`${componentCls}-meta`]: genCardMetaStyle(token)
},
[`${componentCls}-bordered`]: {
border: `${unit$1(token.lineWidth)} ${token.lineType} ${colorBorderSecondary}`,
[`${componentCls}-cover`]: {
marginTop: -1,
marginInlineStart: -1,
marginInlineEnd: -1
}
},
[`${componentCls}-hoverable`]: {
cursor: "pointer",
transition: [`box-shadow`, `border-color`].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
"&:hover": {
borderColor: "transparent",
boxShadow: cardShadow
}
},
[`${componentCls}-contain-grid`]: {
borderRadius: `${unit$1(token.borderRadiusLG)} ${unit$1(token.borderRadiusLG)} 0 0 `,
[`&:not(:has(> ${componentCls}-head))`]: { borderRadius: 0 },
[`${componentCls}-body`]: {
display: "flex",
flexWrap: "wrap"
},
[`&:not(${componentCls}-loading) ${componentCls}-body`]: {
marginBlockStart: token.calc(token.lineWidth).mul(-1).equal(),
marginInlineStart: token.calc(token.lineWidth).mul(-1).equal(),
padding: 0
}
},
[`${componentCls}-contain-tabs`]: { [`> div${componentCls}-head`]: {
minHeight: 0,
[`${componentCls}-head-title, ${componentCls}-extra`]: { paddingTop: cardHeadPadding }
} },
[`${componentCls}-type-inner`]: genCardTypeInnerStyle(token),
[`${componentCls}-loading`]: genCardLoadingStyle(token),
[`${componentCls}-rtl`]: { direction: "rtl" }
};
};
var genCardSizeStyle = (token) => {
const { componentCls, bodyPaddingSM, headerPaddingSM, headerHeightSM, headerFontSizeSM } = token;
return {
[`${componentCls}-small`]: {
[`> ${componentCls}-head`]: {
minHeight: headerHeightSM,
padding: `0 ${unit$1(headerPaddingSM)}`,
fontSize: headerFontSizeSM,
[`> ${componentCls}-head-wrapper`]: { [`> ${componentCls}-extra`]: { fontSize: token.fontSize } }
},
[`> ${componentCls}-body`]: { padding: bodyPaddingSM }
},
[`${componentCls}-small${componentCls}-contain-tabs`]: { [`> ${componentCls}-head`]: { [`${componentCls}-head-title, ${componentCls}-extra`]: {
paddingTop: 0,
display: "flex",
alignItems: "center"
} } }
};
};
var prepareComponentToken$33 = (token) => ({
headerBg: "transparent",
headerFontSize: token.fontSizeLG,
headerFontSizeSM: token.fontSize,
headerHeight: token.fontSizeLG * token.lineHeightLG + token.padding * 2,
headerHeightSM: token.fontSize * token.lineHeight + token.paddingXS * 2,
actionsBg: token.colorBgContainer,
actionsLiMargin: `${token.paddingSM}px 0`,
tabsMarginBottom: -token.padding - token.lineWidth,
extraColor: token.colorText,
bodyPaddingSM: 12,
headerPaddingSM: 12,
bodyPadding: token.bodyPadding ?? token.paddingLG,
headerPadding: token.headerPadding ?? token.paddingLG
});
var style_default$37 = genStyleHooks("Card", (token) => {
const cardToken = merge(token, {
cardShadow: token.boxShadowCard,
cardHeadPadding: token.padding,
cardPaddingBase: token.paddingLG,
cardActionsIconSize: token.fontSize
});
return [genCardStyle(cardToken), genCardSizeStyle(cardToken)];
}, prepareComponentToken$33);
//#endregion
//#region node_modules/antd/es/card/Card.js
var ActionNode = (props) => {
const { actionClasses, actions = [], actionStyle } = props;
return /* @__PURE__ */ import_react.createElement("ul", {
className: actionClasses,
style: actionStyle
}, actions.map((action, index) => {
const key = `action-${index}`;
return /* @__PURE__ */ import_react.createElement("li", {
style: { width: `${100 / actions.length}%` },
key
}, /* @__PURE__ */ import_react.createElement("span", null, action));
}));
};
var Card$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, rootClassName, style, extra, headStyle = {}, bodyStyle = {}, title, loading, bordered, variant: customVariant, size: customizeSize, type, cover, actions, tabList, children, activeTabKey, defaultActiveTabKey, tabBarExtraContent, hoverable, tabProps = {}, classNames, styles, ...rest } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("card");
const [variant] = useVariant("card", customVariant, bordered);
devUseWarning("Card").deprecated(customizeSize !== "default", "size=\"default\"", "size=\"medium\"");
const mergedSize = useSize(customizeSize);
const mergedProps = {
...props,
size: mergedSize,
variant
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
{
const warning = devUseWarning("Card");
[
["headStyle", "styles.header"],
["bodyStyle", "styles.body"],
["bordered", "variant"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const onTabChange = (key) => {
props.onTabChange?.(key);
};
const childNodes = import_react.useMemo(() => toArray$8(children), [children]);
const isContainGrid = import_react.useMemo(() => childNodes.some((child) => /* @__PURE__ */ import_react.isValidElement(child) && child.type === CardGrid), [childNodes]);
const prefixCls = getPrefixCls("card", customizePrefixCls);
const [hashId, cssVarCls] = style_default$37(prefixCls);
const loadingBlock = /* @__PURE__ */ import_react.createElement(skeleton_default, {
loading: true,
active: true,
paragraph: { rows: 4 },
title: false
}, children);
const hasActiveTabKey = activeTabKey !== void 0;
const extraProps = {
...tabProps,
[hasActiveTabKey ? "activeKey" : "defaultActiveKey"]: hasActiveTabKey ? activeTabKey : defaultActiveTabKey,
tabBarExtraContent
};
let head;
const tabSize = mergedSize !== "small" ? "large" : mergedSize;
const tabs = tabList ? /* @__PURE__ */ import_react.createElement(Tabs, {
size: tabSize,
...extraProps,
className: `${prefixCls}-head-tabs`,
onChange: onTabChange,
items: tabList.map(({ tab, ...item }) => ({
label: tab,
...item
}))
}) : null;
if (title || extra || tabs) {
const headClasses = clsx(`${prefixCls}-head`, mergedClassNames.header);
const titleClasses = clsx(`${prefixCls}-head-title`, mergedClassNames.title);
const extraClasses = clsx(`${prefixCls}-extra`, mergedClassNames.extra);
const mergedHeadStyle = {
...headStyle,
...mergedStyles.header
};
head = /* @__PURE__ */ import_react.createElement("div", {
className: headClasses,
style: mergedHeadStyle
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-head-wrapper` }, title && /* @__PURE__ */ import_react.createElement("div", {
className: titleClasses,
style: mergedStyles.title
}, title), extra && /* @__PURE__ */ import_react.createElement("div", {
className: extraClasses,
style: mergedStyles.extra
}, extra)), tabs);
}
const coverClasses = clsx(`${prefixCls}-cover`, mergedClassNames.cover);
const coverDom = cover ? /* @__PURE__ */ import_react.createElement("div", {
className: coverClasses,
style: mergedStyles.cover
}, cover) : null;
const bodyClasses = clsx(`${prefixCls}-body`, mergedClassNames.body);
const mergedBodyStyle = {
...bodyStyle,
...mergedStyles.body
};
const body = loading || childNodes.length ? /* @__PURE__ */ import_react.createElement("div", {
className: bodyClasses,
style: mergedBodyStyle
}, loading ? loadingBlock : children) : null;
const actionClasses = clsx(`${prefixCls}-actions`, mergedClassNames.actions);
const actionDom = actions?.length ? /* @__PURE__ */ import_react.createElement(ActionNode, {
actionClasses,
actionStyle: mergedStyles.actions,
actions
}) : null;
const divProps = omit(rest, ["onTabChange"]);
const classString = clsx(prefixCls, contextClassName, {
[`${prefixCls}-loading`]: loading,
[`${prefixCls}-bordered`]: variant !== "borderless",
[`${prefixCls}-hoverable`]: hoverable,
[`${prefixCls}-contain-grid`]: isContainGrid,
[`${prefixCls}-contain-tabs`]: tabList?.length,
[`${prefixCls}-small`]: mergedSize === "small",
[`${prefixCls}-type-${type}`]: !!type,
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, rootClassName, hashId, cssVarCls, mergedClassNames.root);
const mergedStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
return /* @__PURE__ */ import_react.createElement("div", {
ref,
...divProps,
className: classString,
style: mergedStyle
}, head, coverDom, body, actionDom);
});
Card$1.displayName = "Card";
//#endregion
//#region node_modules/antd/es/card/CardMeta.js
var CardMeta = (props) => {
const { prefixCls: customizePrefixCls, className, avatar, title, description, style, classNames: cardMetaClassNames, styles, ...restProps } = props;
const { getPrefixCls, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("cardMeta");
const metaPrefixCls = `${getPrefixCls("card", customizePrefixCls)}-meta`;
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, cardMetaClassNames], [contextStyles, styles], { props });
const rootClassNames = clsx(metaPrefixCls, className, contextClassName, mergedClassNames.root);
const rootStyles = {
...contextStyle,
...mergedStyles.root,
...style
};
const avatarClassNames = clsx(`${metaPrefixCls}-avatar`, mergedClassNames.avatar);
const titleClassNames = clsx(`${metaPrefixCls}-title`, mergedClassNames.title);
const descriptionClassNames = clsx(`${metaPrefixCls}-description`, mergedClassNames.description);
const sectionClassNames = clsx(`${metaPrefixCls}-section`, mergedClassNames.section);
const avatarDom = avatar ? /* @__PURE__ */ import_react.createElement("div", {
className: avatarClassNames,
style: mergedStyles.avatar
}, avatar) : null;
const titleDom = title ? /* @__PURE__ */ import_react.createElement("div", {
className: titleClassNames,
style: mergedStyles.title
}, title) : null;
const descriptionDom = description ? /* @__PURE__ */ import_react.createElement("div", {
className: descriptionClassNames,
style: mergedStyles.description
}, description) : null;
const MetaDetail = titleDom || descriptionDom ? /* @__PURE__ */ import_react.createElement("div", {
className: sectionClassNames,
style: mergedStyles.section
}, titleDom, descriptionDom) : null;
return /* @__PURE__ */ import_react.createElement("div", {
...restProps,
className: rootClassNames,
style: rootStyles
}, avatarDom, MetaDetail);
};
CardMeta.displayName = "CardMeta";
//#endregion
//#region node_modules/antd/es/card/index.js
var Card = Card$1;
Card.Grid = CardGrid;
Card.Meta = CardMeta;
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
var t = {};
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) continue;
t[n] = r[n];
}
return t;
}
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
function _objectWithoutProperties(e, t) {
if (null == e) return {};
var o, r, i = _objectWithoutPropertiesLoose(e, t);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
}
return i;
}
//#endregion
//#region node_modules/@ant-design/react-slick/es/initial-state.js
var initialState = {
animating: false,
autoplaying: null,
currentDirection: 0,
currentLeft: null,
currentSlide: 0,
direction: 1,
dragging: false,
edgeDragged: false,
initialized: false,
lazyLoadedList: [],
listHeight: null,
listWidth: null,
scrolling: false,
slideCount: null,
slideHeight: null,
slideWidth: null,
swipeLeft: null,
swiped: false,
swiping: false,
touchObject: {
startX: 0,
startY: 0,
curX: 0,
curY: 0
},
trackStyle: {},
trackWidth: 0,
targetSlide: 0
};
//#endregion
//#region node_modules/throttle-debounce/esm/index.js
/**
* Throttle execution of a function. Especially useful for rate limiting
* execution of handlers on events like resize and scroll.
*
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
* are most useful.
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
* as-is, to `callback` when the throttled-function is executed.
* @param {object} [options] - An object to configure options.
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
* one final time after the last throttled-function call. (After the throttled-function has not been called for
* `delay` milliseconds, the internal counter is reset).
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
* callback will never executed if both noLeading = true and noTrailing = true.
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
* false (at end), schedule `callback` to execute after `delay` ms.
*
* @returns {Function} A new, throttled, function.
*/
function throttle(delay, callback, options) {
var _ref = options || {}, _ref$noTrailing = _ref.noTrailing, noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing, _ref$noLeading = _ref.noLeading, noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading, _ref$debounceMode = _ref.debounceMode, debounceMode = _ref$debounceMode === void 0 ? void 0 : _ref$debounceMode;
var timeoutID;
var cancelled = false;
var lastExec = 0;
function clearExistingTimeout() {
if (timeoutID) clearTimeout(timeoutID);
}
function cancel(options) {
var _ref2$upcomingOnly = (options || {}).upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
clearExistingTimeout();
cancelled = !upcomingOnly;
}
function wrapper() {
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) arguments_[_key] = arguments[_key];
var self = this;
var elapsed = Date.now() - lastExec;
if (cancelled) return;
function exec() {
lastExec = Date.now();
callback.apply(self, arguments_);
}
function clear() {
timeoutID = void 0;
}
if (!noLeading && debounceMode && !timeoutID) exec();
clearExistingTimeout();
if (debounceMode === void 0 && elapsed > delay) if (noLeading) {
lastExec = Date.now();
if (!noTrailing) timeoutID = setTimeout(debounceMode ? clear : exec, delay);
} else exec();
else if (noTrailing !== true) timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === void 0 ? delay - elapsed : delay);
}
wrapper.cancel = cancel;
return wrapper;
}
/**
* Debounce execution of a function. Debouncing, unlike throttling,
* guarantees that a function is only executed a single time, either at the
* very beginning of a series of calls, or at the very end.
*
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
* to `callback` when the debounced-function is executed.
* @param {object} [options] - An object to configure options.
* @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
* after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
* (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
*
* @returns {Function} A new, debounced function.
*/
function debounce(delay, callback, options) {
var _ref$atBegin = (options || {}).atBegin;
return throttle(delay, callback, { debounceMode: (_ref$atBegin === void 0 ? false : _ref$atBegin) !== false });
}
//#endregion
//#region node_modules/@ant-design/react-slick/es/default-props.js
var defaultProps$1 = {
accessibility: true,
adaptiveHeight: false,
afterChange: null,
appendDots: function appendDots(dots) {
return /* @__PURE__ */ import_react.createElement("ul", { style: { display: "block" } }, dots);
},
arrows: true,
autoplay: false,
autoplaySpeed: 3e3,
beforeChange: null,
centerMode: false,
centerPadding: "50px",
className: "",
cssEase: "ease",
customPaging: function customPaging(i) {
return /* @__PURE__ */ import_react.createElement("button", null, i + 1);
},
dots: false,
dotsClass: "slick-dots",
draggable: true,
easing: "linear",
edgeFriction: .35,
fade: false,
focusOnSelect: false,
infinite: true,
initialSlide: 0,
lazyLoad: null,
nextArrow: null,
onEdge: null,
onInit: null,
onLazyLoadError: null,
onReInit: null,
pauseOnDotsHover: false,
pauseOnFocus: false,
pauseOnHover: true,
prevArrow: null,
responsive: null,
rows: 1,
rtl: false,
slide: "div",
slidesPerRow: 1,
slidesToScroll: 1,
slidesToShow: 1,
speed: 500,
swipe: true,
swipeEvent: null,
swipeToSlide: false,
touchMove: true,
touchThreshold: 5,
useCSS: true,
useTransform: true,
variableWidth: false,
vertical: false,
verticalSwiping: false,
waitForAnimate: true,
asNavFor: null,
unslick: false
};
//#endregion
//#region node_modules/@ant-design/react-slick/es/utils/innerSliderUtils.js
function clamp(number, lowerBound, upperBound) {
return Math.max(lowerBound, Math.min(number, upperBound));
}
var safePreventDefault = function safePreventDefault(event) {
if (![
"onTouchStart",
"onTouchMove",
"onWheel"
].includes(event._reactName)) event.preventDefault();
};
var getOnDemandLazySlides = function getOnDemandLazySlides(spec) {
var onDemandSlides = [];
var startIndex = lazyStartIndex(spec);
var endIndex = lazyEndIndex(spec);
for (var slideIndex = startIndex; slideIndex < endIndex; slideIndex++) if (spec.lazyLoadedList.indexOf(slideIndex) < 0) onDemandSlides.push(slideIndex);
return onDemandSlides;
};
var lazyStartIndex = function lazyStartIndex(spec) {
return spec.currentSlide - lazySlidesOnLeft(spec);
};
var lazyEndIndex = function lazyEndIndex(spec) {
return spec.currentSlide + lazySlidesOnRight(spec);
};
var lazySlidesOnLeft = function lazySlidesOnLeft(spec) {
return spec.centerMode ? Math.floor(spec.slidesToShow / 2) + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : 0;
};
var lazySlidesOnRight = function lazySlidesOnRight(spec) {
return spec.centerMode ? Math.floor((spec.slidesToShow - 1) / 2) + 1 + (parseInt(spec.centerPadding) > 0 ? 1 : 0) : spec.slidesToShow;
};
var getWidth = function getWidth(elem) {
return elem && elem.offsetWidth || 0;
};
var getHeight = function getHeight(elem) {
return elem && elem.offsetHeight || 0;
};
var getSwipeDirection = function getSwipeDirection(touchObject) {
var verticalSwiping = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
var xDist = touchObject.startX - touchObject.curX, yDist = touchObject.startY - touchObject.curY, swipeAngle = Math.round(Math.atan2(yDist, xDist) * 180 / Math.PI);
if (swipeAngle < 0) swipeAngle = 360 - Math.abs(swipeAngle);
if (swipeAngle <= 45 && swipeAngle >= 0 || swipeAngle <= 360 && swipeAngle >= 315) return "left";
if (swipeAngle >= 135 && swipeAngle <= 225) return "right";
if (verticalSwiping === true) if (swipeAngle >= 35 && swipeAngle <= 135) return "up";
else return "down";
return "vertical";
};
var canGoNext = function canGoNext(spec) {
var canGo = true;
if (!spec.infinite) {
if (spec.centerMode && spec.currentSlide >= spec.slideCount - 1) canGo = false;
else if (spec.slideCount <= spec.slidesToShow || spec.currentSlide >= spec.slideCount - spec.slidesToShow) canGo = false;
}
return canGo;
};
var extractObject = function extractObject(spec, keys) {
var newObject = {};
keys.forEach(function(key) {
return newObject[key] = spec[key];
});
return newObject;
};
var initializedState = function initializedState(spec) {
var slideCount = import_react.Children.count(spec.children);
var listNode = spec.listRef;
var listWidth = Math.ceil(getWidth(listNode));
var trackNode = spec.trackRef && spec.trackRef.node;
var trackWidth = Math.ceil(getWidth(trackNode));
var slideWidth;
if (!spec.vertical) {
var centerPaddingAdj = spec.centerMode && parseInt(spec.centerPadding) * 2;
if (typeof spec.centerPadding === "string" && spec.centerPadding.slice(-1) === "%") centerPaddingAdj *= listWidth / 100;
slideWidth = Math.ceil((listWidth - centerPaddingAdj) / spec.slidesToShow);
} else slideWidth = listWidth;
var slideHeight = listNode && getHeight(listNode.querySelector("[data-index=\"0\"]"));
var listHeight = slideHeight * spec.slidesToShow;
var currentSlide = spec.currentSlide === void 0 ? spec.initialSlide : spec.currentSlide;
if (spec.rtl && spec.currentSlide === void 0) currentSlide = slideCount - 1 - spec.initialSlide;
var lazyLoadedList = spec.lazyLoadedList || [];
var slidesToLoad = getOnDemandLazySlides(_objectSpread2(_objectSpread2({}, spec), {}, {
currentSlide,
lazyLoadedList
}));
lazyLoadedList = lazyLoadedList.concat(slidesToLoad);
var state = {
slideCount,
slideWidth,
listWidth,
trackWidth,
currentSlide,
slideHeight,
listHeight,
lazyLoadedList
};
if (spec.autoplaying === null && spec.autoplay) state["autoplaying"] = "playing";
return state;
};
var slideHandler = function slideHandler(spec) {
var waitForAnimate = spec.waitForAnimate, animating = spec.animating, fade = spec.fade, infinite = spec.infinite, index = spec.index, slideCount = spec.slideCount, lazyLoad = spec.lazyLoad, currentSlide = spec.currentSlide, centerMode = spec.centerMode, slidesToScroll = spec.slidesToScroll, slidesToShow = spec.slidesToShow, useCSS = spec.useCSS;
var lazyLoadedList = spec.lazyLoadedList;
if (waitForAnimate && animating) return {};
var animationSlide = index, finalSlide, animationLeft, finalLeft;
var state = {}, nextState = {};
var targetSlide = infinite ? index : clamp(index, 0, slideCount - 1);
if (fade) {
if (!infinite && (index < 0 || index >= slideCount)) return {};
if (index < 0) animationSlide = index + slideCount;
else if (index >= slideCount) animationSlide = index - slideCount;
if (lazyLoad && lazyLoadedList.indexOf(animationSlide) < 0) lazyLoadedList = lazyLoadedList.concat(animationSlide);
state = {
animating: true,
currentSlide: animationSlide,
lazyLoadedList,
targetSlide: animationSlide
};
nextState = {
animating: false,
targetSlide: animationSlide
};
} else {
finalSlide = animationSlide;
if (animationSlide < 0) {
finalSlide = animationSlide + slideCount;
if (!infinite) finalSlide = 0;
else if (slideCount % slidesToScroll !== 0) finalSlide = slideCount - slideCount % slidesToScroll;
} else if (!canGoNext(spec) && animationSlide > currentSlide) animationSlide = finalSlide = currentSlide;
else if (centerMode && animationSlide >= slideCount) {
animationSlide = infinite ? slideCount : slideCount - 1;
finalSlide = infinite ? 0 : slideCount - 1;
} else if (animationSlide >= slideCount) {
finalSlide = animationSlide - slideCount;
if (!infinite) finalSlide = slideCount - slidesToShow;
else if (slideCount % slidesToScroll !== 0) finalSlide = 0;
}
if (!infinite && animationSlide + slidesToShow >= slideCount) finalSlide = slideCount - slidesToShow;
animationLeft = getTrackLeft(_objectSpread2(_objectSpread2({}, spec), {}, { slideIndex: animationSlide }));
finalLeft = getTrackLeft(_objectSpread2(_objectSpread2({}, spec), {}, { slideIndex: finalSlide }));
if (!infinite) {
if (animationLeft === finalLeft) animationSlide = finalSlide;
animationLeft = finalLeft;
}
if (lazyLoad) lazyLoadedList = lazyLoadedList.concat(getOnDemandLazySlides(_objectSpread2(_objectSpread2({}, spec), {}, { currentSlide: animationSlide })));
if (!useCSS) state = {
currentSlide: finalSlide,
trackStyle: getTrackCSS(_objectSpread2(_objectSpread2({}, spec), {}, { left: finalLeft })),
lazyLoadedList,
targetSlide
};
else {
state = {
animating: true,
currentSlide: finalSlide,
trackStyle: getTrackAnimateCSS(_objectSpread2(_objectSpread2({}, spec), {}, { left: animationLeft })),
lazyLoadedList,
targetSlide
};
nextState = {
animating: false,
currentSlide: finalSlide,
trackStyle: getTrackCSS(_objectSpread2(_objectSpread2({}, spec), {}, { left: finalLeft })),
swipeLeft: null,
targetSlide
};
}
}
return {
state,
nextState
};
};
var changeSlide = function changeSlide(spec, options) {
var indexOffset, previousInt, slideOffset, unevenOffset, targetSlide;
var slidesToScroll = spec.slidesToScroll, slidesToShow = spec.slidesToShow, slideCount = spec.slideCount, currentSlide = spec.currentSlide, previousTargetSlide = spec.targetSlide, lazyLoad = spec.lazyLoad, infinite = spec.infinite;
unevenOffset = slideCount % slidesToScroll !== 0;
indexOffset = unevenOffset ? 0 : (slideCount - currentSlide) % slidesToScroll;
if (options.message === "previous") {
slideOffset = indexOffset === 0 ? slidesToScroll : slidesToShow - indexOffset;
targetSlide = currentSlide - slideOffset;
if (lazyLoad && !infinite) {
previousInt = currentSlide - slideOffset;
targetSlide = previousInt === -1 ? slideCount - 1 : previousInt;
}
if (!infinite) targetSlide = previousTargetSlide - slidesToScroll;
} else if (options.message === "next") {
slideOffset = indexOffset === 0 ? slidesToScroll : indexOffset;
targetSlide = currentSlide + slideOffset;
if (lazyLoad && !infinite) targetSlide = (currentSlide + slidesToScroll) % slideCount + indexOffset;
if (!infinite) targetSlide = previousTargetSlide + slidesToScroll;
} else if (options.message === "dots") targetSlide = options.index * options.slidesToScroll;
else if (options.message === "children") {
targetSlide = options.index;
if (infinite) {
var direction = siblingDirection(_objectSpread2(_objectSpread2({}, spec), {}, { targetSlide }));
if (targetSlide > options.currentSlide && direction === "left") targetSlide = targetSlide - slideCount;
else if (targetSlide < options.currentSlide && direction === "right") targetSlide = targetSlide + slideCount;
}
} else if (options.message === "index") targetSlide = Number(options.index);
return targetSlide;
};
var keyHandler = function keyHandler(e, accessibility, rtl) {
if (e.target.tagName.match("TEXTAREA|INPUT|SELECT") || !accessibility) return "";
if (e.keyCode === 37) return rtl ? "next" : "previous";
if (e.keyCode === 39) return rtl ? "previous" : "next";
return "";
};
var swipeStart = function swipeStart(e, swipe, draggable) {
e.target.tagName === "IMG" && safePreventDefault(e);
if (!swipe || !draggable && e.type.indexOf("mouse") !== -1) return "";
return {
dragging: true,
touchObject: {
startX: e.touches ? e.touches[0].pageX : e.clientX,
startY: e.touches ? e.touches[0].pageY : e.clientY,
curX: e.touches ? e.touches[0].pageX : e.clientX,
curY: e.touches ? e.touches[0].pageY : e.clientY
}
};
};
var swipeMove = function swipeMove(e, spec) {
var scrolling = spec.scrolling, animating = spec.animating, vertical = spec.vertical, swipeToSlide = spec.swipeToSlide, verticalSwiping = spec.verticalSwiping, rtl = spec.rtl, currentSlide = spec.currentSlide, edgeFriction = spec.edgeFriction, edgeDragged = spec.edgeDragged, onEdge = spec.onEdge, swiped = spec.swiped, swiping = spec.swiping, slideCount = spec.slideCount, slidesToScroll = spec.slidesToScroll, infinite = spec.infinite, touchObject = spec.touchObject, swipeEvent = spec.swipeEvent, listHeight = spec.listHeight, listWidth = spec.listWidth;
if (scrolling) return;
if (animating) return safePreventDefault(e);
if (vertical && swipeToSlide && verticalSwiping) safePreventDefault(e);
var swipeLeft, state = {};
var curLeft = getTrackLeft(spec);
touchObject.curX = e.touches ? e.touches[0].pageX : e.clientX;
touchObject.curY = e.touches ? e.touches[0].pageY : e.clientY;
touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curX - touchObject.startX, 2)));
var verticalSwipeLength = Math.round(Math.sqrt(Math.pow(touchObject.curY - touchObject.startY, 2)));
if (!verticalSwiping && !swiping && verticalSwipeLength > 10) return { scrolling: true };
if (verticalSwiping) touchObject.swipeLength = verticalSwipeLength;
var positionOffset = (!rtl ? 1 : -1) * (touchObject.curX > touchObject.startX ? 1 : -1);
if (verticalSwiping) positionOffset = touchObject.curY > touchObject.startY ? 1 : -1;
var dotCount = Math.ceil(slideCount / slidesToScroll);
var swipeDirection = getSwipeDirection(spec.touchObject, verticalSwiping);
var touchSwipeLength = touchObject.swipeLength;
if (!infinite) {
if (currentSlide === 0 && (swipeDirection === "right" || swipeDirection === "down") || currentSlide + 1 >= dotCount && (swipeDirection === "left" || swipeDirection === "up") || !canGoNext(spec) && (swipeDirection === "left" || swipeDirection === "up")) {
touchSwipeLength = touchObject.swipeLength * edgeFriction;
if (edgeDragged === false && onEdge) {
onEdge(swipeDirection);
state["edgeDragged"] = true;
}
}
}
if (!swiped && swipeEvent) {
swipeEvent(swipeDirection);
state["swiped"] = true;
}
if (!vertical) if (!rtl) swipeLeft = curLeft + touchSwipeLength * positionOffset;
else swipeLeft = curLeft - touchSwipeLength * positionOffset;
else swipeLeft = curLeft + touchSwipeLength * (listHeight / listWidth) * positionOffset;
if (verticalSwiping) swipeLeft = curLeft + touchSwipeLength * positionOffset;
state = _objectSpread2(_objectSpread2({}, state), {}, {
touchObject,
swipeLeft,
trackStyle: getTrackCSS(_objectSpread2(_objectSpread2({}, spec), {}, { left: swipeLeft }))
});
if (Math.abs(touchObject.curX - touchObject.startX) < Math.abs(touchObject.curY - touchObject.startY) * .8) return state;
if (touchObject.swipeLength > 10) {
state["swiping"] = true;
safePreventDefault(e);
}
return state;
};
var swipeEnd = function swipeEnd(e, spec) {
var dragging = spec.dragging, swipe = spec.swipe, touchObject = spec.touchObject, listWidth = spec.listWidth, touchThreshold = spec.touchThreshold, verticalSwiping = spec.verticalSwiping, listHeight = spec.listHeight, swipeToSlide = spec.swipeToSlide, scrolling = spec.scrolling, onSwipe = spec.onSwipe, targetSlide = spec.targetSlide, currentSlide = spec.currentSlide, infinite = spec.infinite;
if (!dragging) {
if (swipe) safePreventDefault(e);
return {};
}
var minSwipe = verticalSwiping ? listHeight / touchThreshold : listWidth / touchThreshold;
var swipeDirection = getSwipeDirection(touchObject, verticalSwiping);
var state = {
dragging: false,
edgeDragged: false,
scrolling: false,
swiping: false,
swiped: false,
swipeLeft: null,
touchObject: {}
};
if (scrolling) return state;
if (!touchObject.swipeLength) return state;
if (touchObject.swipeLength > minSwipe) {
safePreventDefault(e);
if (onSwipe) onSwipe(swipeDirection);
var slideCount, newSlide;
var activeSlide = infinite ? currentSlide : targetSlide;
switch (swipeDirection) {
case "left":
case "up":
newSlide = activeSlide + getSlideCount(spec);
slideCount = swipeToSlide ? checkNavigable(spec, newSlide) : newSlide;
state["currentDirection"] = 0;
break;
case "right":
case "down":
newSlide = activeSlide - getSlideCount(spec);
slideCount = swipeToSlide ? checkNavigable(spec, newSlide) : newSlide;
state["currentDirection"] = 1;
break;
default: slideCount = activeSlide;
}
state["triggerSlideHandler"] = slideCount;
} else {
var currentLeft = getTrackLeft(spec);
state["trackStyle"] = getTrackAnimateCSS(_objectSpread2(_objectSpread2({}, spec), {}, { left: currentLeft }));
}
return state;
};
var getNavigableIndexes = function getNavigableIndexes(spec) {
var max = spec.infinite ? spec.slideCount * 2 : spec.slideCount;
var breakpoint = spec.infinite ? spec.slidesToShow * -1 : 0;
var counter = spec.infinite ? spec.slidesToShow * -1 : 0;
var indexes = [];
while (breakpoint < max) {
indexes.push(breakpoint);
breakpoint = counter + spec.slidesToScroll;
counter += Math.min(spec.slidesToScroll, spec.slidesToShow);
}
return indexes;
};
var checkNavigable = function checkNavigable(spec, index) {
var navigables = getNavigableIndexes(spec);
var prevNavigable = 0;
if (index > navigables[navigables.length - 1]) index = navigables[navigables.length - 1];
else for (var n in navigables) {
if (index < navigables[n]) {
index = prevNavigable;
break;
}
prevNavigable = navigables[n];
}
return index;
};
var getSlideCount = function getSlideCount(spec) {
var centerOffset = spec.centerMode ? spec.slideWidth * Math.floor(spec.slidesToShow / 2) : 0;
if (spec.swipeToSlide) {
var swipedSlide;
var slickList = spec.listRef;
var slides = slickList.querySelectorAll && slickList.querySelectorAll(".slick-slide") || [];
Array.from(slides).every(function(slide) {
if (!spec.vertical) {
if (slide.offsetLeft - centerOffset + getWidth(slide) / 2 > spec.swipeLeft * -1) {
swipedSlide = slide;
return false;
}
} else if (slide.offsetTop + getHeight(slide) / 2 > spec.swipeLeft * -1) {
swipedSlide = slide;
return false;
}
return true;
});
if (!swipedSlide) return 0;
var currentIndex = spec.rtl === true ? spec.slideCount - spec.currentSlide : spec.currentSlide;
return Math.abs(swipedSlide.dataset.index - currentIndex) || 1;
} else return spec.slidesToScroll;
};
var checkSpecKeys = function checkSpecKeys(spec, keysArray) {
return keysArray.reduce(function(value, key) {
return value && spec.hasOwnProperty(key);
}, true) ? null : console.error("Keys Missing:", spec);
};
var getTrackCSS = function getTrackCSS(spec) {
checkSpecKeys(spec, [
"left",
"variableWidth",
"slideCount",
"slidesToShow",
"slideWidth"
]);
var trackWidth, trackHeight;
if (!spec.vertical) trackWidth = getTotalSlides(spec) * spec.slideWidth;
else trackHeight = (spec.unslick ? spec.slideCount : spec.slideCount + 2 * spec.slidesToShow) * spec.slideHeight;
var style = {
opacity: 1,
transition: "",
WebkitTransition: ""
};
if (spec.useTransform) {
var WebkitTransform = !spec.vertical ? "translate3d(" + spec.left + "px, 0px, 0px)" : "translate3d(0px, " + spec.left + "px, 0px)";
var transform = !spec.vertical ? "translate3d(" + spec.left + "px, 0px, 0px)" : "translate3d(0px, " + spec.left + "px, 0px)";
var msTransform = !spec.vertical ? "translateX(" + spec.left + "px)" : "translateY(" + spec.left + "px)";
style = _objectSpread2(_objectSpread2({}, style), {}, {
WebkitTransform,
transform,
msTransform
});
} else if (spec.vertical) style["top"] = spec.left;
else style["left"] = spec.left;
if (spec.fade) style = { opacity: 1 };
if (trackWidth) style.width = trackWidth;
if (trackHeight) style.height = trackHeight;
if (window && !window.addEventListener && window.attachEvent) if (!spec.vertical) style.marginLeft = spec.left + "px";
else style.marginTop = spec.left + "px";
return style;
};
var getTrackAnimateCSS = function getTrackAnimateCSS(spec) {
checkSpecKeys(spec, [
"left",
"variableWidth",
"slideCount",
"slidesToShow",
"slideWidth",
"speed",
"cssEase"
]);
var style = getTrackCSS(spec);
if (spec.useTransform) {
style.WebkitTransition = "-webkit-transform " + spec.speed + "ms " + spec.cssEase;
style.transition = "transform " + spec.speed + "ms " + spec.cssEase;
} else if (spec.vertical) style.transition = "top " + spec.speed + "ms " + spec.cssEase;
else style.transition = "left " + spec.speed + "ms " + spec.cssEase;
return style;
};
var getTrackLeft = function getTrackLeft(spec) {
if (spec.unslick) return 0;
checkSpecKeys(spec, [
"slideIndex",
"trackRef",
"infinite",
"centerMode",
"slideCount",
"slidesToShow",
"slidesToScroll",
"slideWidth",
"listWidth",
"variableWidth",
"slideHeight"
]);
var slideIndex = spec.slideIndex, trackRef = spec.trackRef, infinite = spec.infinite, centerMode = spec.centerMode, slideCount = spec.slideCount, slidesToShow = spec.slidesToShow, slidesToScroll = spec.slidesToScroll, slideWidth = spec.slideWidth, listWidth = spec.listWidth, variableWidth = spec.variableWidth, slideHeight = spec.slideHeight, fade = spec.fade, vertical = spec.vertical;
var slideOffset = 0;
var targetLeft;
var targetSlide;
var verticalOffset = 0;
if (fade || spec.slideCount === 1) return 0;
var slidesToOffset = 0;
if (infinite) {
slidesToOffset = -getPreClones(spec);
if (slideCount % slidesToScroll !== 0 && slideIndex + slidesToScroll > slideCount) slidesToOffset = -(slideIndex > slideCount ? slidesToShow - (slideIndex - slideCount) : slideCount % slidesToScroll);
if (centerMode) slidesToOffset += parseInt(slidesToShow / 2);
} else {
if (slideCount % slidesToScroll !== 0 && slideIndex + slidesToScroll > slideCount) slidesToOffset = slidesToShow - slideCount % slidesToScroll;
if (centerMode) slidesToOffset = parseInt(slidesToShow / 2);
}
slideOffset = slidesToOffset * slideWidth;
verticalOffset = slidesToOffset * slideHeight;
if (!vertical) targetLeft = slideIndex * slideWidth * -1 + slideOffset;
else targetLeft = slideIndex * slideHeight * -1 + verticalOffset;
if (variableWidth === true) {
var targetSlideIndex;
var trackElem = trackRef && trackRef.node;
targetSlideIndex = slideIndex + getPreClones(spec);
targetSlide = trackElem && trackElem.childNodes[targetSlideIndex];
targetLeft = targetSlide ? targetSlide.offsetLeft * -1 : 0;
if (centerMode === true) {
targetSlideIndex = infinite ? slideIndex + getPreClones(spec) : slideIndex;
targetSlide = trackElem && trackElem.children[targetSlideIndex];
targetLeft = 0;
for (var slide = 0; slide < targetSlideIndex; slide++) targetLeft -= trackElem && trackElem.children[slide] && trackElem.children[slide].offsetWidth;
targetLeft -= parseInt(spec.centerPadding);
targetLeft += targetSlide && (listWidth - targetSlide.offsetWidth) / 2;
}
}
return targetLeft;
};
var getPreClones = function getPreClones(spec) {
if (spec.unslick || !spec.infinite) return 0;
if (spec.variableWidth) return spec.slideCount;
return spec.slidesToShow + (spec.centerMode ? 1 : 0);
};
var getPostClones = function getPostClones(spec) {
if (spec.unslick || !spec.infinite) return 0;
if (spec.variableWidth) return spec.slideCount;
return spec.slidesToShow + (spec.centerMode ? 1 : 0);
};
var getTotalSlides = function getTotalSlides(spec) {
return spec.slideCount === 1 ? 1 : getPreClones(spec) + spec.slideCount + getPostClones(spec);
};
var siblingDirection = function siblingDirection(spec) {
if (spec.targetSlide > spec.currentSlide) {
if (spec.targetSlide > spec.currentSlide + slidesOnRight(spec)) return "left";
return "right";
} else {
if (spec.targetSlide < spec.currentSlide - slidesOnLeft(spec)) return "right";
return "left";
}
};
var slidesOnRight = function slidesOnRight(_ref) {
var slidesToShow = _ref.slidesToShow, centerMode = _ref.centerMode, rtl = _ref.rtl, centerPadding = _ref.centerPadding;
if (centerMode) {
var right = (slidesToShow - 1) / 2 + 1;
if (parseInt(centerPadding) > 0) right += 1;
if (rtl && slidesToShow % 2 === 0) right += 1;
return right;
}
if (rtl) return 0;
return slidesToShow - 1;
};
var slidesOnLeft = function slidesOnLeft(_ref2) {
var slidesToShow = _ref2.slidesToShow, centerMode = _ref2.centerMode, rtl = _ref2.rtl, centerPadding = _ref2.centerPadding;
if (centerMode) {
var left = (slidesToShow - 1) / 2 + 1;
if (parseInt(centerPadding) > 0) left += 1;
if (!rtl && slidesToShow % 2 === 0) left += 1;
return left;
}
if (rtl) return slidesToShow - 1;
return 0;
};
var canUseDOM = function canUseDOM() {
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
};
var validSettings = Object.keys(defaultProps$1);
function filterSettings(settings) {
return validSettings.reduce(function(acc, settingName) {
if (settings.hasOwnProperty(settingName)) acc[settingName] = settings[settingName];
return acc;
}, {});
}
//#endregion
//#region node_modules/@ant-design/react-slick/es/track.js
function _callSuper$4(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
var getSlideClasses = function getSlideClasses(spec) {
var slickActive, slickCenter, slickCloned;
var centerOffset, index;
if (spec.rtl) index = spec.slideCount - 1 - spec.index;
else index = spec.index;
slickCloned = index < 0 || index >= spec.slideCount;
if (spec.centerMode) {
centerOffset = Math.floor(spec.slidesToShow / 2);
slickCenter = (index - spec.currentSlide) % spec.slideCount === 0;
if (index > spec.currentSlide - centerOffset - 1 && index <= spec.currentSlide + centerOffset) slickActive = true;
} else slickActive = spec.currentSlide <= index && index < spec.currentSlide + spec.slidesToShow;
var focusedSlide;
if (spec.targetSlide < 0) focusedSlide = spec.targetSlide + spec.slideCount;
else if (spec.targetSlide >= spec.slideCount) focusedSlide = spec.targetSlide - spec.slideCount;
else focusedSlide = spec.targetSlide;
return {
"slick-slide": true,
"slick-active": slickActive,
"slick-center": slickCenter,
"slick-cloned": slickCloned,
"slick-current": index === focusedSlide
};
};
var getSlideStyle = function getSlideStyle(spec) {
var style = {};
if (spec.variableWidth === void 0 || spec.variableWidth === false) style.width = spec.slideWidth;
if (spec.fade) {
style.position = "relative";
if (spec.vertical && spec.slideHeight) style.top = -spec.index * parseInt(spec.slideHeight);
else style.left = -spec.index * parseInt(spec.slideWidth);
style.opacity = spec.currentSlide === spec.index ? 1 : 0;
style.zIndex = spec.currentSlide === spec.index ? 999 : 998;
if (spec.useCSS) style.transition = "opacity " + spec.speed + "ms " + spec.cssEase + ", visibility " + spec.speed + "ms " + spec.cssEase;
}
return style;
};
var getKey$1 = function getKey(child, fallbackKey) {
return child.key + "-" + fallbackKey;
};
var renderSlides = function renderSlides(spec) {
var key;
var slides = [];
var preCloneSlides = [];
var postCloneSlides = [];
var childrenCount = import_react.Children.count(spec.children);
var startIndex = lazyStartIndex(spec);
var endIndex = lazyEndIndex(spec);
import_react.Children.forEach(spec.children, function(elem, index) {
var child;
var childOnClickOptions = {
message: "children",
index,
slidesToScroll: spec.slidesToScroll,
currentSlide: spec.currentSlide
};
if (!spec.lazyLoad || spec.lazyLoad && spec.lazyLoadedList.indexOf(index) >= 0) child = elem;
else child = /* @__PURE__ */ import_react.createElement("div", null);
var childStyle = getSlideStyle(_objectSpread2(_objectSpread2({}, spec), {}, { index }));
var slideClass = child.props.className || "";
var slideClasses = getSlideClasses(_objectSpread2(_objectSpread2({}, spec), {}, { index }));
slides.push(/* @__PURE__ */ import_react.cloneElement(child, {
key: "original" + getKey$1(child, index),
"data-index": index,
className: clsx(slideClasses, slideClass),
tabIndex: "-1",
"aria-hidden": !slideClasses["slick-active"],
style: _objectSpread2(_objectSpread2({ outline: "none" }, child.props.style || {}), childStyle),
onClick: function onClick(e) {
child.props && child.props.onClick && child.props.onClick(e);
if (spec.focusOnSelect) spec.focusOnSelect(childOnClickOptions);
}
}));
if (spec.infinite && childrenCount > 1 && spec.fade === false && !spec.unslick) {
var preCloneNo = childrenCount - index;
if (preCloneNo <= getPreClones(spec)) {
key = -preCloneNo;
if (key >= startIndex) child = elem;
slideClasses = getSlideClasses(_objectSpread2(_objectSpread2({}, spec), {}, { index: key }));
preCloneSlides.push(/* @__PURE__ */ import_react.cloneElement(child, {
key: "precloned" + getKey$1(child, key),
"data-index": key,
tabIndex: "-1",
className: clsx(slideClasses, slideClass),
"aria-hidden": !slideClasses["slick-active"],
style: _objectSpread2(_objectSpread2({}, child.props.style || {}), childStyle),
onClick: function onClick(e) {
child.props && child.props.onClick && child.props.onClick(e);
if (spec.focusOnSelect) spec.focusOnSelect(childOnClickOptions);
}
}));
}
if (index < getPostClones(spec)) {
key = childrenCount + index;
if (key < endIndex) child = elem;
slideClasses = getSlideClasses(_objectSpread2(_objectSpread2({}, spec), {}, { index: key }));
postCloneSlides.push(/* @__PURE__ */ import_react.cloneElement(child, {
key: "postcloned" + getKey$1(child, key),
"data-index": key,
tabIndex: "-1",
className: clsx(slideClasses, slideClass),
"aria-hidden": !slideClasses["slick-active"],
style: _objectSpread2(_objectSpread2({}, child.props.style || {}), childStyle),
onClick: function onClick(e) {
child.props && child.props.onClick && child.props.onClick(e);
if (spec.focusOnSelect) spec.focusOnSelect(childOnClickOptions);
}
}));
}
}
});
if (spec.rtl) return preCloneSlides.concat(slides, postCloneSlides).reverse();
else return preCloneSlides.concat(slides, postCloneSlides);
};
var Track$1 = /* @__PURE__ */ function(_React$PureComponent) {
function Track() {
var _this;
_classCallCheck$1(this, Track);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
_this = _callSuper$4(this, Track, [].concat(args));
_defineProperty$28(_this, "node", null);
_defineProperty$28(_this, "handleRef", function(ref) {
_this.node = ref;
});
return _this;
}
_inherits(Track, _React$PureComponent);
return _createClass$1(Track, [{
key: "render",
value: function render() {
var slides = renderSlides(this.props);
var _this$props = this.props;
var mouseEvents = {
onMouseEnter: _this$props.onMouseEnter,
onMouseOver: _this$props.onMouseOver,
onMouseLeave: _this$props.onMouseLeave
};
return /* @__PURE__ */ import_react.createElement("div", _extends$91({
ref: this.handleRef,
className: "slick-track",
style: this.props.trackStyle
}, mouseEvents), slides);
}
}]);
}(import_react.PureComponent);
//#endregion
//#region node_modules/@ant-design/react-slick/es/dots.js
function _callSuper$3(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
var getDotCount = function getDotCount(spec) {
var dots;
if (spec.infinite) dots = Math.ceil(spec.slideCount / spec.slidesToScroll);
else dots = Math.ceil((spec.slideCount - spec.slidesToShow) / spec.slidesToScroll) + 1;
return dots;
};
var Dots = /* @__PURE__ */ function(_React$PureComponent) {
function Dots() {
_classCallCheck$1(this, Dots);
return _callSuper$3(this, Dots, arguments);
}
_inherits(Dots, _React$PureComponent);
return _createClass$1(Dots, [{
key: "clickHandler",
value: function clickHandler(options, e) {
e.preventDefault();
this.props.clickHandler(options);
}
}, {
key: "render",
value: function render() {
var _this$props = this.props, onMouseEnter = _this$props.onMouseEnter, onMouseOver = _this$props.onMouseOver, onMouseLeave = _this$props.onMouseLeave, infinite = _this$props.infinite, slidesToScroll = _this$props.slidesToScroll, slidesToShow = _this$props.slidesToShow, slideCount = _this$props.slideCount, currentSlide = _this$props.currentSlide;
var dotCount = getDotCount({
slideCount,
slidesToScroll,
slidesToShow,
infinite
});
var mouseEvents = {
onMouseEnter,
onMouseOver,
onMouseLeave
};
var dots = [];
for (var i = 0; i < dotCount; i++) {
var _rightBound = (i + 1) * slidesToScroll - 1;
var rightBound = infinite ? _rightBound : clamp(_rightBound, 0, slideCount - 1);
var _leftBound = rightBound - (slidesToScroll - 1);
var leftBound = infinite ? _leftBound : clamp(_leftBound, 0, slideCount - 1);
var className = clsx({ "slick-active": infinite ? currentSlide >= leftBound && currentSlide <= rightBound : currentSlide === leftBound });
var dotOptions = {
message: "dots",
index: i,
slidesToScroll,
currentSlide
};
var onClick = this.clickHandler.bind(this, dotOptions);
dots = dots.concat(/* @__PURE__ */ import_react.createElement("li", {
key: i,
className
}, /* @__PURE__ */ import_react.cloneElement(this.props.customPaging(i), { onClick })));
}
return /* @__PURE__ */ import_react.cloneElement(this.props.appendDots(dots), _objectSpread2({ className: this.props.dotsClass }, mouseEvents));
}
}]);
}(import_react.PureComponent);
//#endregion
//#region node_modules/@ant-design/react-slick/es/arrows.js
function _callSuper$2(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
var PrevArrow = /* @__PURE__ */ function(_React$PureComponent) {
function PrevArrow() {
_classCallCheck$1(this, PrevArrow);
return _callSuper$2(this, PrevArrow, arguments);
}
_inherits(PrevArrow, _React$PureComponent);
return _createClass$1(PrevArrow, [{
key: "clickHandler",
value: function clickHandler(options, e) {
if (e) e.preventDefault();
this.props.clickHandler(options, e);
}
}, {
key: "render",
value: function render() {
var prevClasses = {
"slick-arrow": true,
"slick-prev": true
};
var prevHandler = this.clickHandler.bind(this, { message: "previous" });
if (!this.props.infinite && (this.props.currentSlide === 0 || this.props.slideCount <= this.props.slidesToShow)) {
prevClasses["slick-disabled"] = true;
prevHandler = null;
}
var prevArrowProps = {
key: "0",
"data-role": "none",
className: clsx(prevClasses),
style: { display: "block" },
onClick: prevHandler
};
var customProps = {
currentSlide: this.props.currentSlide,
slideCount: this.props.slideCount
};
var prevArrow;
if (this.props.prevArrow) prevArrow = /* @__PURE__ */ import_react.cloneElement(this.props.prevArrow, _objectSpread2(_objectSpread2({}, prevArrowProps), customProps));
else prevArrow = /* @__PURE__ */ import_react.createElement("button", _extends$91({
key: "0",
type: "button"
}, prevArrowProps), " ", "Previous");
return prevArrow;
}
}]);
}(import_react.PureComponent);
var NextArrow = /* @__PURE__ */ function(_React$PureComponent2) {
function NextArrow() {
_classCallCheck$1(this, NextArrow);
return _callSuper$2(this, NextArrow, arguments);
}
_inherits(NextArrow, _React$PureComponent2);
return _createClass$1(NextArrow, [{
key: "clickHandler",
value: function clickHandler(options, e) {
if (e) e.preventDefault();
this.props.clickHandler(options, e);
}
}, {
key: "render",
value: function render() {
var nextClasses = {
"slick-arrow": true,
"slick-next": true
};
var nextHandler = this.clickHandler.bind(this, { message: "next" });
if (!canGoNext(this.props)) {
nextClasses["slick-disabled"] = true;
nextHandler = null;
}
var nextArrowProps = {
key: "1",
"data-role": "none",
className: clsx(nextClasses),
style: { display: "block" },
onClick: nextHandler
};
var customProps = {
currentSlide: this.props.currentSlide,
slideCount: this.props.slideCount
};
var nextArrow;
if (this.props.nextArrow) nextArrow = /* @__PURE__ */ import_react.cloneElement(this.props.nextArrow, _objectSpread2(_objectSpread2({}, nextArrowProps), customProps));
else nextArrow = /* @__PURE__ */ import_react.createElement("button", _extends$91({
key: "1",
type: "button"
}, nextArrowProps), " ", "Next");
return nextArrow;
}
}]);
}(import_react.PureComponent);
//#endregion
//#region node_modules/@ant-design/react-slick/es/inner-slider.js
var _excluded$2 = ["animating"];
function _callSuper$1(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
var InnerSlider = /* @__PURE__ */ function(_React$Component) {
function InnerSlider(props) {
var _this;
_classCallCheck$1(this, InnerSlider);
_this = _callSuper$1(this, InnerSlider, [props]);
_defineProperty$28(_this, "listRefHandler", function(ref) {
return _this.list = ref;
});
_defineProperty$28(_this, "trackRefHandler", function(ref) {
return _this.track = ref;
});
_defineProperty$28(_this, "adaptHeight", function() {
if (_this.props.adaptiveHeight && _this.list) {
var elem = _this.list.querySelector("[data-index=\"".concat(_this.state.currentSlide, "\"]"));
_this.list.style.height = getHeight(elem) + "px";
}
});
_defineProperty$28(_this, "componentDidMount", function() {
_this.props.onInit && _this.props.onInit();
if (_this.props.lazyLoad) {
var slidesToLoad = getOnDemandLazySlides(_objectSpread2(_objectSpread2({}, _this.props), _this.state));
if (slidesToLoad.length > 0) {
_this.setState(function(prevState) {
return { lazyLoadedList: prevState.lazyLoadedList.concat(slidesToLoad) };
});
if (_this.props.onLazyLoad) _this.props.onLazyLoad(slidesToLoad);
}
}
var spec = _objectSpread2({
listRef: _this.list,
trackRef: _this.track
}, _this.props);
_this.updateState(spec, true, function() {
_this.adaptHeight();
_this.props.autoplay && _this.autoPlay("playing");
});
if (_this.props.lazyLoad === "progressive") _this.lazyLoadTimer = setInterval(_this.progressiveLazyLoad, 1e3);
if (typeof ResizeObserver !== "undefined") {
_this.ro = new ResizeObserver(function() {
if (_this.state.animating) {
_this.onWindowResized(false);
_this.callbackTimers.push(setTimeout(function() {
return _this.onWindowResized();
}, _this.props.speed));
} else _this.onWindowResized();
});
_this.ro.observe(_this.list);
}
document.querySelectorAll && Array.prototype.forEach.call(document.querySelectorAll(".slick-slide"), function(slide) {
slide.onfocus = _this.props.pauseOnFocus ? _this.onSlideFocus : null;
slide.onblur = _this.props.pauseOnFocus ? _this.onSlideBlur : null;
});
if (window.addEventListener) window.addEventListener("resize", _this.onWindowResized);
else window.attachEvent("onresize", _this.onWindowResized);
});
_defineProperty$28(_this, "componentWillUnmount", function() {
var _this$ro;
if (_this.animationEndCallback) clearTimeout(_this.animationEndCallback);
if (_this.lazyLoadTimer) clearInterval(_this.lazyLoadTimer);
if (_this.callbackTimers.length) {
_this.callbackTimers.forEach(function(timer) {
return clearTimeout(timer);
});
_this.callbackTimers = [];
}
if (window.addEventListener) window.removeEventListener("resize", _this.onWindowResized);
else window.detachEvent("onresize", _this.onWindowResized);
if (_this.autoplayTimer) clearInterval(_this.autoplayTimer);
(_this$ro = _this.ro) === null || _this$ro === void 0 || _this$ro.disconnect();
});
_defineProperty$28(_this, "componentDidUpdate", function(prevProps) {
_this.checkImagesLoad();
_this.props.onReInit && _this.props.onReInit();
if (_this.props.lazyLoad) {
var slidesToLoad = getOnDemandLazySlides(_objectSpread2(_objectSpread2({}, _this.props), _this.state));
if (slidesToLoad.length > 0) {
_this.setState(function(prevState) {
return { lazyLoadedList: prevState.lazyLoadedList.concat(slidesToLoad) };
});
if (_this.props.onLazyLoad) _this.props.onLazyLoad(slidesToLoad);
}
}
_this.adaptHeight();
var spec = _objectSpread2(_objectSpread2({
listRef: _this.list,
trackRef: _this.track
}, _this.props), _this.state);
var setTrackStyle = _this.didPropsChange(prevProps);
setTrackStyle && _this.updateState(spec, setTrackStyle, function() {
if (_this.state.currentSlide >= import_react.Children.count(_this.props.children)) _this.changeSlide({
message: "index",
index: import_react.Children.count(_this.props.children) - _this.props.slidesToShow,
currentSlide: _this.state.currentSlide
});
if (prevProps.autoplay !== _this.props.autoplay || prevProps.autoplaySpeed !== _this.props.autoplaySpeed) if (!prevProps.autoplay && _this.props.autoplay) _this.autoPlay("playing");
else if (_this.props.autoplay) _this.autoPlay("update");
else _this.pause("paused");
});
});
_defineProperty$28(_this, "onWindowResized", function(setTrackStyle) {
if (_this.debouncedResize) _this.debouncedResize.cancel();
_this.debouncedResize = debounce(50, function() {
return _this.resizeWindow(setTrackStyle);
});
_this.debouncedResize();
});
_defineProperty$28(_this, "resizeWindow", function() {
var setTrackStyle = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
if (!Boolean(_this.track && _this.track.node)) return;
var spec = _objectSpread2(_objectSpread2({
listRef: _this.list,
trackRef: _this.track
}, _this.props), _this.state);
_this.updateState(spec, setTrackStyle, function() {
if (_this.props.autoplay) _this.autoPlay("update");
else _this.pause("paused");
});
_this.setState({ animating: false });
clearTimeout(_this.animationEndCallback);
delete _this.animationEndCallback;
});
_defineProperty$28(_this, "updateState", function(spec, setTrackStyle, callback) {
var updatedState = initializedState(spec);
spec = _objectSpread2(_objectSpread2(_objectSpread2({}, spec), updatedState), {}, { slideIndex: updatedState.currentSlide });
var targetLeft = getTrackLeft(spec);
spec = _objectSpread2(_objectSpread2({}, spec), {}, { left: targetLeft });
var trackStyle = getTrackCSS(spec);
if (setTrackStyle || import_react.Children.count(_this.props.children) !== import_react.Children.count(spec.children)) updatedState["trackStyle"] = trackStyle;
_this.setState(updatedState, callback);
});
_defineProperty$28(_this, "ssrInit", function() {
if (_this.props.variableWidth) {
var _trackWidth = 0, _trackLeft = 0;
var childrenWidths = [];
var preClones = getPreClones(_objectSpread2(_objectSpread2(_objectSpread2({}, _this.props), _this.state), {}, { slideCount: _this.props.children.length }));
var postClones = getPostClones(_objectSpread2(_objectSpread2(_objectSpread2({}, _this.props), _this.state), {}, { slideCount: _this.props.children.length }));
_this.props.children.forEach(function(child) {
childrenWidths.push(child.props.style.width);
_trackWidth += child.props.style.width;
});
for (var i = 0; i < preClones; i++) {
_trackLeft += childrenWidths[childrenWidths.length - 1 - i];
_trackWidth += childrenWidths[childrenWidths.length - 1 - i];
}
for (var _i = 0; _i < postClones; _i++) _trackWidth += childrenWidths[_i];
for (var _i2 = 0; _i2 < _this.state.currentSlide; _i2++) _trackLeft += childrenWidths[_i2];
var _trackStyle = {
width: _trackWidth + "px",
left: -_trackLeft + "px"
};
if (_this.props.centerMode) {
var currentWidth = "".concat(childrenWidths[_this.state.currentSlide], "px");
_trackStyle.left = "calc(".concat(_trackStyle.left, " + (100% - ").concat(currentWidth, ") / 2 ) ");
}
return { trackStyle: _trackStyle };
}
var childrenCount = import_react.Children.count(_this.props.children);
var spec = _objectSpread2(_objectSpread2(_objectSpread2({}, _this.props), _this.state), {}, { slideCount: childrenCount });
var slideCount = getPreClones(spec) + getPostClones(spec) + childrenCount;
var trackWidth = 100 / _this.props.slidesToShow * slideCount;
var slideWidth = 100 / slideCount;
var trackLeft = -slideWidth * (getPreClones(spec) + _this.state.currentSlide) * trackWidth / 100;
if (_this.props.centerMode) trackLeft += (100 - slideWidth * trackWidth / 100) / 2;
var trackStyle = {
width: trackWidth + "%",
left: trackLeft + "%"
};
return {
slideWidth: slideWidth + "%",
trackStyle
};
});
_defineProperty$28(_this, "checkImagesLoad", function() {
var images = _this.list && _this.list.querySelectorAll && _this.list.querySelectorAll(".slick-slide img") || [];
var imagesCount = images.length, loadedCount = 0;
Array.prototype.forEach.call(images, function(image) {
var handler = function handler() {
return ++loadedCount && loadedCount >= imagesCount && _this.onWindowResized();
};
if (!image.onclick) image.onclick = function() {
return image.parentNode.focus();
};
else {
var prevClickHandler = image.onclick;
image.onclick = function(e) {
prevClickHandler(e);
image.parentNode.focus();
};
}
if (!image.onload) if (_this.props.lazyLoad) image.onload = function() {
_this.adaptHeight();
_this.callbackTimers.push(setTimeout(_this.onWindowResized, _this.props.speed));
};
else {
image.onload = handler;
image.onerror = function() {
handler();
_this.props.onLazyLoadError && _this.props.onLazyLoadError();
};
}
});
});
_defineProperty$28(_this, "progressiveLazyLoad", function() {
var slidesToLoad = [];
var spec = _objectSpread2(_objectSpread2({}, _this.props), _this.state);
for (var index = _this.state.currentSlide; index < _this.state.slideCount + getPostClones(spec); index++) if (_this.state.lazyLoadedList.indexOf(index) < 0) {
slidesToLoad.push(index);
break;
}
for (var _index = _this.state.currentSlide - 1; _index >= -getPreClones(spec); _index--) if (_this.state.lazyLoadedList.indexOf(_index) < 0) {
slidesToLoad.push(_index);
break;
}
if (slidesToLoad.length > 0) {
_this.setState(function(state) {
return { lazyLoadedList: state.lazyLoadedList.concat(slidesToLoad) };
});
if (_this.props.onLazyLoad) _this.props.onLazyLoad(slidesToLoad);
} else if (_this.lazyLoadTimer) {
clearInterval(_this.lazyLoadTimer);
delete _this.lazyLoadTimer;
}
});
_defineProperty$28(_this, "slideHandler", function(index) {
var dontAnimate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
var _this$props = _this.props, asNavFor = _this$props.asNavFor, beforeChange = _this$props.beforeChange, onLazyLoad = _this$props.onLazyLoad, speed = _this$props.speed, afterChange = _this$props.afterChange;
var currentSlide = _this.state.currentSlide;
var _slideHandler = slideHandler(_objectSpread2(_objectSpread2(_objectSpread2({ index }, _this.props), _this.state), {}, {
trackRef: _this.track,
useCSS: _this.props.useCSS && !dontAnimate
})), state = _slideHandler.state, nextState = _slideHandler.nextState;
if (!state) return;
beforeChange && beforeChange(currentSlide, state.currentSlide);
var slidesToLoad = state.lazyLoadedList.filter(function(value) {
return _this.state.lazyLoadedList.indexOf(value) < 0;
});
onLazyLoad && slidesToLoad.length > 0 && onLazyLoad(slidesToLoad);
if (!_this.props.waitForAnimate && _this.animationEndCallback) {
clearTimeout(_this.animationEndCallback);
afterChange && afterChange(currentSlide);
delete _this.animationEndCallback;
}
_this.setState(state, function() {
if (asNavFor && _this.asNavForIndex !== index) {
_this.asNavForIndex = index;
asNavFor.innerSlider.slideHandler(index);
}
if (!nextState) return;
_this.animationEndCallback = setTimeout(function() {
var animating = nextState.animating, firstBatch = _objectWithoutProperties(nextState, _excluded$2);
_this.setState(firstBatch, function() {
_this.callbackTimers.push(setTimeout(function() {
return _this.setState({ animating });
}, 10));
afterChange && afterChange(state.currentSlide);
delete _this.animationEndCallback;
});
}, speed);
});
});
_defineProperty$28(_this, "changeSlide", function(options) {
var dontAnimate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
var targetSlide = changeSlide(_objectSpread2(_objectSpread2({}, _this.props), _this.state), options);
if (targetSlide !== 0 && !targetSlide) return;
if (dontAnimate === true) _this.slideHandler(targetSlide, dontAnimate);
else _this.slideHandler(targetSlide);
_this.props.autoplay && _this.autoPlay("update");
if (_this.props.focusOnSelect) {
var nodes = _this.list.querySelectorAll(".slick-current");
nodes[0] && nodes[0].focus();
}
});
_defineProperty$28(_this, "clickHandler", function(e) {
if (_this.clickable === false) {
e.stopPropagation();
e.preventDefault();
}
_this.clickable = true;
});
_defineProperty$28(_this, "keyHandler", function(e) {
var dir = keyHandler(e, _this.props.accessibility, _this.props.rtl);
dir !== "" && _this.changeSlide({ message: dir });
});
_defineProperty$28(_this, "selectHandler", function(options) {
_this.changeSlide(options);
});
_defineProperty$28(_this, "disableBodyScroll", function() {
window.ontouchmove = function preventDefault(e) {
e = e || window.event;
if (e.preventDefault) e.preventDefault();
e.returnValue = false;
};
});
_defineProperty$28(_this, "enableBodyScroll", function() {
window.ontouchmove = null;
});
_defineProperty$28(_this, "swipeStart", function(e) {
if (_this.props.verticalSwiping) _this.disableBodyScroll();
var state = swipeStart(e, _this.props.swipe, _this.props.draggable);
state !== "" && _this.setState(state);
});
_defineProperty$28(_this, "swipeMove", function(e) {
var state = swipeMove(e, _objectSpread2(_objectSpread2(_objectSpread2({}, _this.props), _this.state), {}, {
trackRef: _this.track,
listRef: _this.list,
slideIndex: _this.state.currentSlide
}));
if (!state) return;
if (state["swiping"]) _this.clickable = false;
_this.setState(state);
});
_defineProperty$28(_this, "swipeEnd", function(e) {
var state = swipeEnd(e, _objectSpread2(_objectSpread2(_objectSpread2({}, _this.props), _this.state), {}, {
trackRef: _this.track,
listRef: _this.list,
slideIndex: _this.state.currentSlide
}));
if (!state) return;
var triggerSlideHandler = state["triggerSlideHandler"];
delete state["triggerSlideHandler"];
_this.setState(state);
if (triggerSlideHandler === void 0) return;
_this.slideHandler(triggerSlideHandler);
if (_this.props.verticalSwiping) _this.enableBodyScroll();
});
_defineProperty$28(_this, "touchEnd", function(e) {
_this.swipeEnd(e);
_this.clickable = true;
});
_defineProperty$28(_this, "slickPrev", function() {
_this.callbackTimers.push(setTimeout(function() {
return _this.changeSlide({ message: "previous" });
}, 0));
});
_defineProperty$28(_this, "slickNext", function() {
_this.callbackTimers.push(setTimeout(function() {
return _this.changeSlide({ message: "next" });
}, 0));
});
_defineProperty$28(_this, "slickGoTo", function(slide) {
var dontAnimate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
slide = Number(slide);
if (isNaN(slide)) return "";
_this.callbackTimers.push(setTimeout(function() {
return _this.changeSlide({
message: "index",
index: slide,
currentSlide: _this.state.currentSlide
}, dontAnimate);
}, 0));
});
_defineProperty$28(_this, "play", function() {
var nextIndex;
if (_this.props.rtl) nextIndex = _this.state.currentSlide - _this.props.slidesToScroll;
else if (canGoNext(_objectSpread2(_objectSpread2({}, _this.props), _this.state))) nextIndex = _this.state.currentSlide + _this.props.slidesToScroll;
else return false;
_this.slideHandler(nextIndex);
});
_defineProperty$28(_this, "autoPlay", function(playType) {
if (_this.autoplayTimer) clearInterval(_this.autoplayTimer);
var autoplaying = _this.state.autoplaying;
if (playType === "update") {
if (autoplaying === "hovered" || autoplaying === "focused" || autoplaying === "paused") return;
} else if (playType === "leave") {
if (autoplaying === "paused" || autoplaying === "focused") return;
} else if (playType === "blur") {
if (autoplaying === "paused" || autoplaying === "hovered") return;
}
_this.autoplayTimer = setInterval(_this.play, _this.props.autoplaySpeed + 50);
_this.setState({ autoplaying: "playing" });
});
_defineProperty$28(_this, "pause", function(pauseType) {
if (_this.autoplayTimer) {
clearInterval(_this.autoplayTimer);
_this.autoplayTimer = null;
}
var autoplaying = _this.state.autoplaying;
if (pauseType === "paused") _this.setState({ autoplaying: "paused" });
else if (pauseType === "focused") {
if (autoplaying === "hovered" || autoplaying === "playing") _this.setState({ autoplaying: "focused" });
} else if (autoplaying === "playing") _this.setState({ autoplaying: "hovered" });
});
_defineProperty$28(_this, "onDotsOver", function() {
return _this.props.autoplay && _this.pause("hovered");
});
_defineProperty$28(_this, "onDotsLeave", function() {
return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave");
});
_defineProperty$28(_this, "onTrackOver", function() {
return _this.props.autoplay && _this.pause("hovered");
});
_defineProperty$28(_this, "onTrackLeave", function() {
return _this.props.autoplay && _this.state.autoplaying === "hovered" && _this.autoPlay("leave");
});
_defineProperty$28(_this, "onSlideFocus", function() {
return _this.props.autoplay && _this.pause("focused");
});
_defineProperty$28(_this, "onSlideBlur", function() {
return _this.props.autoplay && _this.state.autoplaying === "focused" && _this.autoPlay("blur");
});
_defineProperty$28(_this, "render", function() {
var className = clsx("slick-slider", _this.props.className, {
"slick-vertical": _this.props.vertical,
"slick-initialized": true
});
var spec = _objectSpread2(_objectSpread2({}, _this.props), _this.state);
var trackProps = extractObject(spec, [
"fade",
"cssEase",
"speed",
"infinite",
"centerMode",
"focusOnSelect",
"currentSlide",
"lazyLoad",
"lazyLoadedList",
"rtl",
"slideWidth",
"slideHeight",
"listHeight",
"vertical",
"slidesToShow",
"slidesToScroll",
"slideCount",
"trackStyle",
"variableWidth",
"unslick",
"centerPadding",
"targetSlide",
"useCSS"
]);
var pauseOnHover = _this.props.pauseOnHover;
trackProps = _objectSpread2(_objectSpread2({}, trackProps), {}, {
onMouseEnter: pauseOnHover ? _this.onTrackOver : null,
onMouseLeave: pauseOnHover ? _this.onTrackLeave : null,
onMouseOver: pauseOnHover ? _this.onTrackOver : null,
focusOnSelect: _this.props.focusOnSelect && _this.clickable ? _this.selectHandler : null
});
var dots;
if (_this.props.dots === true && _this.state.slideCount >= _this.props.slidesToShow) {
var dotProps = extractObject(spec, [
"dotsClass",
"slideCount",
"slidesToShow",
"currentSlide",
"slidesToScroll",
"clickHandler",
"children",
"customPaging",
"infinite",
"appendDots"
]);
var pauseOnDotsHover = _this.props.pauseOnDotsHover;
dotProps = _objectSpread2(_objectSpread2({}, dotProps), {}, {
clickHandler: _this.changeSlide,
onMouseEnter: pauseOnDotsHover ? _this.onDotsLeave : null,
onMouseOver: pauseOnDotsHover ? _this.onDotsOver : null,
onMouseLeave: pauseOnDotsHover ? _this.onDotsLeave : null
});
dots = /* @__PURE__ */ import_react.createElement(Dots, dotProps);
}
var prevArrow, nextArrow;
var arrowProps = extractObject(spec, [
"infinite",
"centerMode",
"currentSlide",
"slideCount",
"slidesToShow",
"prevArrow",
"nextArrow"
]);
arrowProps.clickHandler = _this.changeSlide;
if (_this.props.arrows) {
prevArrow = /* @__PURE__ */ import_react.createElement(PrevArrow, arrowProps);
nextArrow = /* @__PURE__ */ import_react.createElement(NextArrow, arrowProps);
}
var verticalHeightStyle = null;
if (_this.props.vertical) verticalHeightStyle = { height: _this.state.listHeight };
var centerPaddingStyle = null;
if (_this.props.vertical === false) {
if (_this.props.centerMode === true) centerPaddingStyle = { padding: "0px " + _this.props.centerPadding };
} else if (_this.props.centerMode === true) centerPaddingStyle = { padding: _this.props.centerPadding + " 0px" };
var listStyle = _objectSpread2(_objectSpread2({}, verticalHeightStyle), centerPaddingStyle);
var touchMove = _this.props.touchMove;
var listProps = {
className: "slick-list",
style: listStyle,
onClick: _this.clickHandler,
onMouseDown: touchMove ? _this.swipeStart : null,
onMouseMove: _this.state.dragging && touchMove ? _this.swipeMove : null,
onMouseUp: touchMove ? _this.swipeEnd : null,
onMouseLeave: _this.state.dragging && touchMove ? _this.swipeEnd : null,
onTouchStart: touchMove ? _this.swipeStart : null,
onTouchMove: _this.state.dragging && touchMove ? _this.swipeMove : null,
onTouchEnd: touchMove ? _this.touchEnd : null,
onTouchCancel: _this.state.dragging && touchMove ? _this.swipeEnd : null,
onKeyDown: _this.props.accessibility ? _this.keyHandler : null
};
var innerSliderProps = {
className,
dir: "ltr",
style: _this.props.style
};
if (_this.props.unslick) {
listProps = { className: "slick-list" };
innerSliderProps = {
className,
style: _this.props.style
};
}
return /* @__PURE__ */ import_react.createElement("div", innerSliderProps, !_this.props.unslick ? prevArrow : "", /* @__PURE__ */ import_react.createElement("div", _extends$91({ ref: _this.listRefHandler }, listProps), /* @__PURE__ */ import_react.createElement(Track$1, _extends$91({ ref: _this.trackRefHandler }, trackProps), _this.props.children)), !_this.props.unslick ? nextArrow : "", !_this.props.unslick ? dots : "");
});
_this.list = null;
_this.track = null;
_this.state = _objectSpread2(_objectSpread2({}, initialState), {}, {
currentSlide: _this.props.initialSlide,
targetSlide: _this.props.initialSlide ? _this.props.initialSlide : 0,
slideCount: import_react.Children.count(_this.props.children)
});
_this.callbackTimers = [];
_this.clickable = true;
_this.debouncedResize = null;
var ssrState = _this.ssrInit();
_this.state = _objectSpread2(_objectSpread2({}, _this.state), ssrState);
return _this;
}
_inherits(InnerSlider, _React$Component);
return _createClass$1(InnerSlider, [{
key: "didPropsChange",
value: function didPropsChange(prevProps) {
var setTrackStyle = false;
for (var _i3 = 0, _Object$keys = Object.keys(this.props); _i3 < _Object$keys.length; _i3++) {
var key = _Object$keys[_i3];
if (!prevProps.hasOwnProperty(key)) {
setTrackStyle = true;
break;
}
if (_typeof$30(prevProps[key]) === "object" || typeof prevProps[key] === "function" || isNaN(prevProps[key])) continue;
if (prevProps[key] !== this.props[key]) {
setTrackStyle = true;
break;
}
}
return setTrackStyle || import_react.Children.count(this.props.children) !== import_react.Children.count(prevProps.children);
}
}]);
}(import_react.Component);
//#endregion
//#region node_modules/string-convert/camel2hyphen.js
var require_camel2hyphen = /* @__PURE__ */ __commonJSMin(((exports, module) => {
var camel2hyphen = function(str) {
return str.replace(/[A-Z]/g, function(match) {
return "-" + match.toLowerCase();
}).toLowerCase();
};
module.exports = camel2hyphen;
}));
//#endregion
//#region node_modules/@ant-design/react-slick/es/slider.js
var import_json2mq = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
var camel2hyphen = require_camel2hyphen();
var isDimension = function(feature) {
return /[height|width]$/.test(feature);
};
var obj2mq = function(obj) {
var mq = "";
var features = Object.keys(obj);
features.forEach(function(feature, index) {
var value = obj[feature];
feature = camel2hyphen(feature);
if (isDimension(feature) && typeof value === "number") value = value + "px";
if (value === true) mq += feature;
else if (value === false) mq += "not " + feature;
else mq += "(" + feature + ": " + value + ")";
if (index < features.length - 1) mq += " and ";
});
return mq;
};
var json2mq = function(query) {
var mq = "";
if (typeof query === "string") return query;
if (query instanceof Array) {
query.forEach(function(q, index) {
mq += obj2mq(q);
if (index < query.length - 1) mq += ", ";
});
return mq;
}
return obj2mq(query);
};
module.exports = json2mq;
})))());
function _callSuper(t, o, e) {
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
}
//#endregion
//#region node_modules/@ant-design/react-slick/es/index.js
var es_default$15 = /* @__PURE__ */ function(_React$Component) {
function Slider(props) {
var _this;
_classCallCheck$1(this, Slider);
_this = _callSuper(this, Slider, [props]);
_defineProperty$28(_this, "innerSliderRefHandler", function(ref) {
return _this.innerSlider = ref;
});
_defineProperty$28(_this, "slickPrev", function() {
return _this.innerSlider.slickPrev();
});
_defineProperty$28(_this, "slickNext", function() {
return _this.innerSlider.slickNext();
});
_defineProperty$28(_this, "slickGoTo", function(slide) {
var dontAnimate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
return _this.innerSlider.slickGoTo(slide, dontAnimate);
});
_defineProperty$28(_this, "slickPause", function() {
return _this.innerSlider.pause("paused");
});
_defineProperty$28(_this, "slickPlay", function() {
return _this.innerSlider.autoPlay("play");
});
_this.state = { breakpoint: null };
_this._responsiveMediaHandlers = [];
return _this;
}
_inherits(Slider, _React$Component);
return _createClass$1(Slider, [
{
key: "media",
value: function media(query, handler) {
var mql = window.matchMedia(query);
var listener = function listener(_ref) {
if (_ref.matches) handler();
};
mql.addListener(listener);
this._responsiveMediaHandlers.push({
mql,
query,
listener
});
}
},
{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
if (this.props.responsive) {
var breakpoints = this.props.responsive.map(function(breakpt) {
return breakpt.breakpoint;
});
breakpoints.sort(function(x, y) {
return x - y;
});
breakpoints.forEach(function(breakpoint, index) {
var bQuery;
if (index === 0) bQuery = (0, import_json2mq.default)({
minWidth: 0,
maxWidth: breakpoint
});
else bQuery = (0, import_json2mq.default)({
minWidth: breakpoints[index - 1] + 1,
maxWidth: breakpoint
});
canUseDOM() && _this2.media(bQuery, function() {
_this2.setState({ breakpoint });
});
});
var query = (0, import_json2mq.default)({ minWidth: breakpoints.slice(-1)[0] });
canUseDOM() && this.media(query, function() {
_this2.setState({ breakpoint: null });
});
}
}
},
{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this._responsiveMediaHandlers.forEach(function(obj) {
obj.mql.removeListener(obj.listener);
});
}
},
{
key: "render",
value: function render() {
var _this3 = this;
var settings;
var newProps;
if (this.state.breakpoint) {
newProps = this.props.responsive.filter(function(resp) {
return resp.breakpoint === _this3.state.breakpoint;
});
settings = newProps[0].settings === "unslick" ? "unslick" : _objectSpread2(_objectSpread2(_objectSpread2({}, defaultProps$1), this.props), newProps[0].settings);
} else settings = _objectSpread2(_objectSpread2({}, defaultProps$1), this.props);
if (settings.centerMode) {
if (settings.slidesToScroll > 1 && true) console.warn("slidesToScroll should be equal to 1 in centerMode, you are using ".concat(settings.slidesToScroll));
settings.slidesToScroll = 1;
}
if (settings.fade) {
if (settings.slidesToShow > 1 && true) console.warn("slidesToShow should be equal to 1 when fade is true, you're using ".concat(settings.slidesToShow));
if (settings.slidesToScroll > 1 && true) console.warn("slidesToScroll should be equal to 1 when fade is true, you're using ".concat(settings.slidesToScroll));
settings.slidesToShow = 1;
settings.slidesToScroll = 1;
}
var children = import_react.Children.toArray(this.props.children);
children = children.filter(function(child) {
if (typeof child === "string") return !!child.trim();
return !!child;
});
if (settings.variableWidth && (settings.rows > 1 || settings.slidesPerRow > 1)) {
console.warn("variableWidth is not supported in case of rows > 1 or slidesPerRow > 1");
settings.variableWidth = false;
}
var newChildren = [];
var currentWidth = null;
for (var i = 0; i < children.length; i += settings.rows * settings.slidesPerRow) {
var newSlide = [];
for (var j = i; j < i + settings.rows * settings.slidesPerRow; j += settings.slidesPerRow) {
var row = [];
for (var k = j; k < j + settings.slidesPerRow; k += 1) {
if (settings.variableWidth && children[k].props.style) currentWidth = children[k].props.style.width;
if (k >= children.length) break;
row.push(/* @__PURE__ */ import_react.cloneElement(children[k], {
key: 100 * i + 10 * j + k,
tabIndex: -1,
style: {
width: "".concat(100 / settings.slidesPerRow, "%"),
display: "inline-block"
}
}));
}
newSlide.push(/* @__PURE__ */ import_react.createElement("div", { key: 10 * i + j }, row));
}
if (settings.variableWidth) newChildren.push(/* @__PURE__ */ import_react.createElement("div", {
key: i,
style: { width: currentWidth }
}, newSlide));
else newChildren.push(/* @__PURE__ */ import_react.createElement("div", { key: i }, newSlide));
}
if (settings === "unslick") {
var className = "regular slider " + (this.props.className || "");
return /* @__PURE__ */ import_react.createElement("div", { className }, children);
} else if (newChildren.length <= settings.slidesToShow) settings.unslick = true;
return /* @__PURE__ */ import_react.createElement(InnerSlider, _extends$91({
style: this.props.style,
ref: this.innerSliderRefHandler
}, filterSettings(settings)), newChildren);
}
}
]);
}(import_react.Component);
//#endregion
//#region node_modules/antd/es/carousel/style/index.js
var DotDuration = "--dot-duration";
var genCarouselStyle = (token) => {
const { componentCls, antCls } = token;
return { [componentCls]: {
...resetComponent(token),
".slick-slider": {
position: "relative",
display: "block",
boxSizing: "border-box",
touchAction: "pan-y",
WebkitTouchCallout: "none",
WebkitTapHighlightColor: "transparent",
".slick-track, .slick-list": {
transform: "translate3d(0, 0, 0)",
touchAction: "pan-y"
}
},
".slick-list": {
position: "relative",
display: "block",
margin: 0,
padding: 0,
overflow: "hidden",
"&:focus": { outline: "none" },
"&.dragging": { cursor: "pointer" },
".slick-slide": {
pointerEvents: "none",
[`input${antCls}-radio-input, input${antCls}-checkbox-input`]: { visibility: "hidden" },
"&.slick-active": {
pointerEvents: "auto",
[`input${antCls}-radio-input, input${antCls}-checkbox-input`]: { visibility: "visible" }
},
"> div > div": { verticalAlign: "bottom" }
}
},
".slick-track": {
position: "relative",
top: 0,
insetInlineStart: 0,
display: "block",
"&::before, &::after": {
display: "table",
content: "\"\""
},
"&::after": { clear: "both" }
},
".slick-slide": {
display: "none",
float: "left",
height: "100%",
minHeight: 1,
img: { display: "block" },
"&.dragging img": { pointerEvents: "none" }
},
".slick-initialized .slick-slide": { display: "block" },
".slick-vertical .slick-slide": {
display: "block",
height: "auto"
}
} };
};
var genArrowsStyle = (token) => {
const { componentCls, motionDurationSlow, arrowSize, arrowOffset } = token;
const arrowLength = token.calc(arrowSize).div(Math.SQRT2).equal();
return { [componentCls]: {
".slick-prev, .slick-next": {
position: "absolute",
top: "50%",
width: arrowSize,
height: arrowSize,
transform: "translateY(-50%)",
color: "#fff",
opacity: .4,
background: "transparent",
padding: 0,
lineHeight: 0,
border: 0,
outline: "none",
cursor: "pointer",
zIndex: 1,
transition: `opacity ${motionDurationSlow}`,
"&:hover, &:focus": { opacity: 1 },
"&.slick-disabled": {
pointerEvents: "none",
opacity: 0
},
"&::after": {
boxSizing: "border-box",
position: "absolute",
top: token.calc(arrowSize).sub(arrowLength).div(2).equal(),
insetInlineStart: token.calc(arrowSize).sub(arrowLength).div(2).equal(),
display: "inline-block",
width: arrowLength,
height: arrowLength,
border: `0 solid currentcolor`,
borderInlineStartWidth: 2,
borderBlockStartWidth: 2,
borderRadius: 1,
content: "\"\""
}
},
".slick-prev": {
insetInlineStart: arrowOffset,
"&::after": { transform: "rotate(-45deg)" }
},
".slick-next": {
insetInlineEnd: arrowOffset,
"&::after": { transform: "rotate(135deg)" }
}
} };
};
var genDotsStyle = (token) => {
const { componentCls, dotOffset, dotWidth, dotHeight, dotGap, colorBgContainer, motionDurationSlow } = token;
const animation = new Keyframe(`${token.prefixCls}-dot-animation`, {
from: { width: 0 },
to: { width: token.dotActiveWidth }
});
return { [componentCls]: { ".slick-dots": {
position: "absolute",
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
zIndex: 15,
display: "flex !important",
justifyContent: "center",
paddingInlineStart: 0,
margin: 0,
listStyle: "none",
"&-bottom": { bottom: dotOffset },
"&-top": {
top: dotOffset,
bottom: "auto"
},
li: {
position: "relative",
display: "inline-block",
flex: "0 1 auto",
boxSizing: "content-box",
width: dotWidth,
height: dotHeight,
marginInline: dotGap,
padding: 0,
textAlign: "center",
textIndent: -999,
verticalAlign: "top",
transition: `all ${motionDurationSlow}`,
borderRadius: dotHeight,
overflow: "hidden",
"&::after": {
display: "block",
position: "absolute",
top: 0,
insetInlineStart: 0,
width: 0,
height: dotHeight,
content: "\"\"",
background: "transparent",
borderRadius: dotHeight,
opacity: 1,
outline: "none",
cursor: "pointer",
overflow: "hidden"
},
button: {
position: "relative",
display: "block",
width: "100%",
height: dotHeight,
padding: 0,
color: "transparent",
fontSize: 0,
background: colorBgContainer,
border: 0,
borderRadius: dotHeight,
outline: "none",
cursor: "pointer",
opacity: .2,
transition: `all ${motionDurationSlow}`,
overflow: "hidden",
"&:hover": { opacity: .75 },
"&::after": {
position: "absolute",
inset: token.calc(dotGap).mul(-1).equal(),
content: "\"\""
}
},
"&.slick-active": {
width: token.dotActiveWidth,
position: "relative",
"&:hover": { opacity: 1 },
"&::after": {
background: colorBgContainer,
animationName: animation,
animationDuration: `var(${DotDuration})`,
animationTimingFunction: "ease-out",
animationFillMode: "forwards"
}
}
}
} } };
};
var genCarouselVerticalStyle = (token) => {
const { componentCls, dotOffset, arrowOffset, marginXXS } = token;
const animation = new Keyframe(`${token.prefixCls}-dot-vertical-animation`, {
from: { height: 0 },
to: { height: token.dotActiveWidth }
});
const reverseSizeOfDot = {
width: token.dotHeight,
height: token.dotWidth
};
return { [`${componentCls}-vertical`]: {
".slick-prev, .slick-next": {
insetInlineStart: "50%",
marginBlockStart: "unset",
transform: "translateX(-50%)"
},
".slick-prev": {
insetBlockStart: arrowOffset,
insetInlineStart: "50%",
"&::after": { transform: "rotate(45deg)" }
},
".slick-next": {
insetBlockStart: "auto",
insetBlockEnd: arrowOffset,
"&::after": { transform: "rotate(-135deg)" }
},
".slick-dots": {
top: "50%",
bottom: "auto",
flexDirection: "column",
width: token.dotHeight,
height: "auto",
margin: 0,
transform: "translateY(-50%)",
"&-start": {
insetInlineEnd: "auto",
insetInlineStart: dotOffset
},
"&-end": {
insetInlineEnd: dotOffset,
insetInlineStart: "auto"
},
li: {
...reverseSizeOfDot,
margin: `${unit$1(marginXXS)} 0`,
verticalAlign: "baseline",
button: reverseSizeOfDot,
"&::after": {
...reverseSizeOfDot,
height: 0
},
"&.slick-active": {
...reverseSizeOfDot,
height: token.dotActiveWidth,
button: {
...reverseSizeOfDot,
height: token.dotActiveWidth
},
"&::after": {
...reverseSizeOfDot,
animationName: animation,
animationDuration: `var(${DotDuration})`,
animationTimingFunction: "ease-out",
animationFillMode: "forwards"
}
}
}
}
} };
};
var genCarouselRtlStyle = (token) => {
const { componentCls } = token;
return [{ [`${componentCls}-rtl`]: { direction: "rtl" } }, { [`${componentCls}-vertical`]: { ".slick-dots": { [`${componentCls}-rtl&`]: { flexDirection: "column" } } } }];
};
var prepareComponentToken$32 = (token) => {
const dotActiveWidth = 24;
return {
arrowSize: 16,
arrowOffset: token.marginXS,
dotWidth: 16,
dotHeight: 3,
dotGap: token.marginXXS,
dotOffset: 12,
dotWidthActive: dotActiveWidth,
dotActiveWidth
};
};
var style_default$36 = genStyleHooks("Carousel", (token) => [
genCarouselStyle(token),
genArrowsStyle(token),
genDotsStyle(token),
genCarouselVerticalStyle(token),
genCarouselRtlStyle(token)
], prepareComponentToken$32, { deprecatedTokens: [["dotWidthActive", "dotActiveWidth"]] });
//#endregion
//#region node_modules/antd/es/carousel/index.js
var dotsClass = "slick-dots";
var ArrowButton = ({ currentSlide, slideCount, ...rest }) => /* @__PURE__ */ import_react.createElement("button", {
type: "button",
...rest
});
var Carousel = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { dots = true, arrows = false, prevArrow, nextArrow, draggable = false, waitForAnimate = false, dotPosition, dotPlacement, vertical, rootClassName, className: customClassName, style, id, autoplay = false, autoplaySpeed = 3e3, rtl, ...otherProps } = props;
const mergedDotPlacement = import_react.useMemo(() => {
const placement = dotPlacement ?? dotPosition ?? "bottom";
switch (placement) {
case "left": return "start";
case "right": return "end";
default: return placement;
}
}, [dotPosition, dotPlacement]);
const mergedVertical = vertical ?? (mergedDotPlacement === "start" || mergedDotPlacement === "end");
const { getPrefixCls, direction, className: contextClassName, style: contextStyle } = useComponentConfig("carousel");
const slickRef = import_react.useRef(null);
const goTo = (slide, dontAnimate = false) => {
slickRef.current.slickGoTo(slide, dontAnimate);
};
import_react.useImperativeHandle(ref, () => ({
goTo,
autoPlay: slickRef.current.innerSlider.autoPlay,
innerSlider: slickRef.current.innerSlider,
prev: slickRef.current.slickPrev,
next: slickRef.current.slickNext
}), [slickRef.current]);
const { children, initialSlide = 0 } = props;
const count = toArray$8(children).length;
const isRTL = (rtl ?? direction === "rtl") && !vertical;
import_react.useEffect(() => {
if (count > 0) goTo(isRTL ? count - initialSlide - 1 : initialSlide, false);
}, [
count,
initialSlide,
isRTL
]);
devUseWarning("Carousel").deprecated(!dotPosition, "dotPosition", "dotPlacement");
const newProps = {
vertical: mergedVertical,
className: clsx(customClassName, contextClassName),
style: {
...contextStyle,
...style
},
autoplay: !!autoplay,
...otherProps
};
if (newProps.effect === "fade") newProps.fade = true;
const prefixCls = getPrefixCls("carousel", newProps.prefixCls);
const enableDots = !!dots;
const dsClass = clsx(dotsClass, `${dotsClass}-${mergedDotPlacement}`, typeof dots === "boolean" ? false : dots?.className);
const [hashId, cssVarCls] = style_default$36(prefixCls);
const className = clsx(prefixCls, {
[`${prefixCls}-rtl`]: isRTL,
[`${prefixCls}-vertical`]: newProps.vertical
}, hashId, cssVarCls, rootClassName);
const dotDurationStyle = autoplay && (isPlainObject(autoplay) ? autoplay.dotDuration : false) ? { [DotDuration]: `${autoplaySpeed}ms` } : {};
return /* @__PURE__ */ import_react.createElement("div", {
className,
id,
style: dotDurationStyle
}, /* @__PURE__ */ import_react.createElement(es_default$15, {
ref: slickRef,
...newProps,
dots: enableDots,
dotsClass: dsClass,
arrows,
prevArrow: prevArrow ?? /* @__PURE__ */ import_react.createElement(ArrowButton, { "aria-label": isRTL ? "next" : "prev" }),
nextArrow: nextArrow ?? /* @__PURE__ */ import_react.createElement(ArrowButton, { "aria-label": isRTL ? "prev" : "next" }),
draggable,
verticalSwiping: mergedVertical,
autoplaySpeed,
waitForAnimate,
rtl: isRTL
}));
});
Carousel.displayName = "Carousel";
//#endregion
//#region node_modules/@rc-component/cascader/es/context.js
var CascaderContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useSearchOptions.js
var SEARCH_MARK = "__rc_cascader_search_mark__";
var defaultFilter = (search, options, { label = "" }) => options.some((opt) => String(opt[label]).toLowerCase().includes(search.toLowerCase()));
var defaultRender$1 = (inputValue, path, prefixCls, fieldNames) => path.map((opt) => opt[fieldNames.label]).join(" / ");
var useSearchOptions = (search, options, fieldNames, prefixCls, config, enableHalfPath) => {
const { filter = defaultFilter, render = defaultRender$1, limit = 50, sort } = config;
return import_react.useMemo(() => {
const filteredOptions = [];
if (!search) return [];
function dig(list, pathOptions, parentDisabled = false) {
list.forEach((option) => {
if (!sort && limit !== false && limit > 0 && filteredOptions.length >= limit) return;
const connectedPathOptions = [...pathOptions, option];
const children = option[fieldNames.children];
const mergedDisabled = parentDisabled || option.disabled;
if (!children || children.length === 0 || enableHalfPath) {
if (filter(search, connectedPathOptions, { label: fieldNames.label })) filteredOptions.push({
...option,
disabled: mergedDisabled,
[fieldNames.label]: render(search, connectedPathOptions, prefixCls, fieldNames),
[SEARCH_MARK]: connectedPathOptions,
[fieldNames.children]: void 0
});
}
if (children) dig(option[fieldNames.children], connectedPathOptions, mergedDisabled);
});
}
dig(options, []);
if (sort) filteredOptions.sort((a, b) => {
return sort(a[SEARCH_MARK], b[SEARCH_MARK], search, fieldNames);
});
return limit !== false && limit > 0 ? filteredOptions.slice(0, limit) : filteredOptions;
}, [
search,
options,
fieldNames,
prefixCls,
render,
enableHalfPath,
filter,
sort,
limit
]);
};
//#endregion
//#region node_modules/@rc-component/cascader/es/utils/commonUtil.js
var VALUE_SPLIT = "__RC_CASCADER_SPLIT__";
var SHOW_PARENT$2 = "SHOW_PARENT";
var SHOW_CHILD$2 = "SHOW_CHILD";
/**
* Will convert value to string, and join with `VALUE_SPLIT`
*/
function toPathKey(value) {
return value.join(VALUE_SPLIT);
}
/**
* Batch convert value to string, and join with `VALUE_SPLIT`
*/
function toPathKeys(value) {
return value.map(toPathKey);
}
function toPathValueStr(pathKey) {
return pathKey.split(VALUE_SPLIT);
}
function fillFieldNames$2(fieldNames) {
const { label, value, children } = fieldNames || {};
const val = value || "value";
return {
label: label || "label",
value: val,
key: val,
children: children || "children"
};
}
function isLeaf(option, fieldNames) {
return option.isLeaf ?? !option[fieldNames.children]?.length;
}
function scrollIntoParentView(element) {
const parent = element.parentElement;
if (!parent) return;
const elementToParent = element.offsetTop - parent.offsetTop;
if (elementToParent - parent.scrollTop < 0) parent.scrollTo({ top: elementToParent });
else if (elementToParent + element.offsetHeight - parent.scrollTop > parent.offsetHeight) parent.scrollTo({ top: elementToParent + element.offsetHeight - parent.offsetHeight });
}
function getFullPathKeys(options, fieldNames) {
return options.map((item) => item[SEARCH_MARK]?.map((opt) => opt[fieldNames.value]));
}
function isMultipleValue(value) {
return Array.isArray(value) && Array.isArray(value[0]);
}
function toRawValues(value) {
if (!value) return [];
if (isMultipleValue(value)) return value;
return (value.length === 0 ? [] : [value]).map((val) => Array.isArray(val) ? val : [val]);
}
//#endregion
//#region node_modules/@rc-component/cascader/es/utils/treeUtil.js
function formatStrategyValues$1(pathKeys, getKeyPathEntities, showCheckedStrategy) {
const valueSet = new Set(pathKeys);
const keyPathEntities = getKeyPathEntities();
return pathKeys.filter((key) => {
const entity = keyPathEntities[key];
const parent = entity ? entity.parent : null;
const children = entity ? entity.children : null;
if (entity && entity.node.disabled) return true;
return showCheckedStrategy === "SHOW_CHILD" ? !(children && children.some((child) => child.key && valueSet.has(child.key))) : !(parent && !parent.node.disabled && valueSet.has(parent.key));
});
}
function toPathOptions(valueCells, options, fieldNames, stringMode = false) {
let currentList = options;
const valueOptions = [];
for (let i = 0; i < valueCells.length; i += 1) {
const valueCell = valueCells[i];
const foundIndex = currentList?.findIndex((option) => {
const val = option[fieldNames.value];
return stringMode ? String(val) === String(valueCell) : val === valueCell;
});
const foundOption = foundIndex !== -1 ? currentList?.[foundIndex] : null;
valueOptions.push({
value: foundOption?.[fieldNames.value] ?? valueCell,
index: foundIndex,
option: foundOption
});
currentList = foundOption?.[fieldNames.children];
}
return valueOptions;
}
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useDisplayValues.js
var useDisplayValues_default = ((rawValues, options, fieldNames, multiple, displayRender) => {
return import_react.useMemo(() => {
const mergedDisplayRender = displayRender || ((labels) => {
const mergedLabels = multiple ? labels.slice(-1) : labels;
const SPLIT = " / ";
if (mergedLabels.every((label) => ["string", "number"].includes(typeof label))) return mergedLabels.join(SPLIT);
return mergedLabels.reduce((list, label, index) => {
const keyedLabel = /* @__PURE__ */ import_react.isValidElement(label) ? /* @__PURE__ */ import_react.cloneElement(label, { key: index }) : label;
if (index === 0) return [keyedLabel];
return [
...list,
SPLIT,
keyedLabel
];
}, []);
});
return rawValues.map((valueCells) => {
const valueOptions = toPathOptions(valueCells, options, fieldNames);
const label = mergedDisplayRender(valueOptions.map(({ option, value }) => option?.[fieldNames.label] ?? value), valueOptions.map(({ option }) => option));
const value = toPathKey(valueCells);
return {
label,
value,
key: value,
valueCells,
disabled: valueOptions[valueOptions.length - 1]?.option?.disabled
};
});
}, [
rawValues,
options,
fieldNames,
displayRender,
multiple
]);
});
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useMissingValues.js
function useMissingValues(options, fieldNames) {
return import_react.useCallback((rawValues) => {
const missingValues = [];
const existsValues = [];
rawValues.forEach((valueCell) => {
if (toPathOptions(valueCell, options, fieldNames).every((opt) => opt.option)) existsValues.push(valueCell);
else missingValues.push(valueCell);
});
return [existsValues, missingValues];
}, [options, fieldNames]);
}
//#endregion
//#region node_modules/@rc-component/tree/es/utils/keyUtil.js
function getEntity(keyEntities, key) {
return keyEntities[key];
}
//#endregion
//#region node_modules/@rc-component/tree/es/utils/treeUtil.js
function getPosition$1(level, index) {
return `${level}-${index}`;
}
function isTreeNode(node) {
return node && node.type && node.type.isTreeNode;
}
function getKey(key, pos) {
if (key !== null && key !== void 0) return key;
return pos;
}
function fillFieldNames$1(fieldNames) {
const { title, _title, key, children } = fieldNames || {};
const mergedTitle = title || "title";
return {
title: mergedTitle,
_title: _title || [mergedTitle],
key: key || "key",
children: children || "children"
};
}
/**
* Warning if TreeNode do not provides key
*/
function warningWithoutKey(treeData, fieldNames) {
const keys = /* @__PURE__ */ new Map();
function dig(list, path = "") {
(list || []).forEach((treeNode) => {
const key = treeNode[fieldNames.key];
const children = treeNode[fieldNames.children];
warningOnce(key !== null && key !== void 0, `Tree node must have a certain key: [${path}${key}]`);
const recordKey = String(key);
warningOnce(!keys.has(recordKey) || key === null || key === void 0, `Same 'key' exist in the Tree: ${recordKey}`);
keys.set(recordKey, true);
dig(children, `${path}${recordKey} > `);
});
}
dig(treeData);
}
/**
* Convert `children` of Tree into `treeData` structure.
*/
function convertTreeToData(rootNodes) {
function dig(node) {
return toArray$8(node).map((treeNode) => {
if (!isTreeNode(treeNode)) {
warningOnce(!treeNode, "Tree/TreeNode can only accept TreeNode as children.");
return null;
}
const { key } = treeNode;
const { children, ...rest } = treeNode.props;
const dataNode = {
key,
...rest
};
const parsedChildren = dig(children);
if (parsedChildren.length) dataNode.children = parsedChildren;
return dataNode;
}).filter((dataNode) => dataNode);
}
return dig(rootNodes);
}
/**
* Flat nest tree data into flatten list. This is used for virtual list render.
* @param treeNodeList Origin data node list
* @param expandedKeys
* need expanded keys, provides `true` means all expanded (used in `rc-tree-select`).
*/
function flattenTreeData(treeNodeList, expandedKeys, fieldNames) {
const { _title: fieldTitles, key: fieldKey, children: fieldChildren } = fillFieldNames$1(fieldNames);
const expandedKeySet = new Set(expandedKeys === true ? [] : expandedKeys);
const flattenList = [];
function dig(list, parent = null) {
return list.map((treeNode, index) => {
const pos = getPosition$1(parent ? parent.pos : "0", index);
const mergedKey = getKey(treeNode[fieldKey], pos);
let mergedTitle;
for (let i = 0; i < fieldTitles.length; i += 1) {
const fieldTitle = fieldTitles[i];
if (treeNode[fieldTitle] !== void 0) {
mergedTitle = treeNode[fieldTitle];
break;
}
}
const flattenNode = Object.assign(omit(treeNode, [
...fieldTitles,
fieldKey,
fieldChildren
]), {
title: mergedTitle,
key: mergedKey,
parent,
pos,
children: null,
data: treeNode,
isStart: [...parent ? parent.isStart : [], index === 0],
isEnd: [...parent ? parent.isEnd : [], index === list.length - 1]
});
flattenList.push(flattenNode);
if (expandedKeys === true || expandedKeySet.has(mergedKey)) flattenNode.children = dig(treeNode[fieldChildren] || [], flattenNode);
else flattenNode.children = [];
return flattenNode;
});
}
dig(treeNodeList);
return flattenList;
}
/**
* Traverse all the data by `treeData`.
* Please not use it out of the `rc-tree` since we may refactor this code.
*/
function traverseDataNodes(dataNodes, callback, config) {
let mergedConfig = {};
if (typeof config === "object") mergedConfig = config;
else mergedConfig = { externalGetKey: config };
mergedConfig = mergedConfig || {};
const { childrenPropName, externalGetKey, fieldNames } = mergedConfig;
const { key: fieldKey, children: fieldChildren } = fillFieldNames$1(fieldNames);
const mergeChildrenPropName = childrenPropName || fieldChildren;
let syntheticGetKey;
if (externalGetKey) {
if (typeof externalGetKey === "string") syntheticGetKey = (node) => node[externalGetKey];
else if (typeof externalGetKey === "function") syntheticGetKey = (node) => externalGetKey(node);
} else syntheticGetKey = (node, pos) => getKey(node[fieldKey], pos);
function processNode(node, index, parent, pathNodes) {
const children = node ? node[mergeChildrenPropName] : dataNodes;
const pos = node ? getPosition$1(parent.pos, index) : "0";
const connectNodes = node ? [...pathNodes, node] : [];
if (node) callback({
node,
index,
pos,
key: syntheticGetKey(node, pos),
parentPos: parent.node ? parent.pos : null,
level: parent.level + 1,
nodes: connectNodes
});
if (children) children.forEach((subNode, subIndex) => {
processNode(subNode, subIndex, {
node,
pos,
level: parent ? parent.level + 1 : -1
}, connectNodes);
});
}
processNode(null);
}
/**
* Convert `treeData` into entity records.
*/
function convertDataToEntities(dataNodes, { initWrapper, processEntity, onProcessFinished, externalGetKey, childrenPropName, fieldNames } = {}, legacyExternalGetKey) {
const mergedExternalGetKey = externalGetKey || legacyExternalGetKey;
const posEntities = {};
const keyEntities = {};
let wrapper = {
posEntities,
keyEntities
};
if (initWrapper) wrapper = initWrapper(wrapper) || wrapper;
traverseDataNodes(dataNodes, (item) => {
const { node, index, pos, key, parentPos, level, nodes } = item;
const entity = {
node,
nodes,
index,
key,
pos,
level
};
const mergedKey = getKey(key, pos);
posEntities[pos] = entity;
keyEntities[mergedKey] = entity;
entity.parent = posEntities[parentPos];
if (entity.parent) {
entity.parent.children = entity.parent.children || [];
entity.parent.children.push(entity);
}
if (processEntity) processEntity(entity, wrapper);
}, {
externalGetKey: mergedExternalGetKey,
childrenPropName,
fieldNames
});
if (onProcessFinished) onProcessFinished(wrapper);
return wrapper;
}
function isLeafNode(isLeaf, loadData, hasChildren, loaded) {
if (isLeaf === false) return false;
return isLeaf || !loadData && !hasChildren || loadData && loaded && !hasChildren;
}
/**
* Get TreeNode props with Tree props.
*/
function getTreeNodeProps(key, { expandedKeys, selectedKeys, loadedKeys, loadingKeys, checkedKeys, halfCheckedKeys, dragOverNodeKey, dropPosition, keyEntities }) {
const entity = getEntity(keyEntities, key);
return {
eventKey: key,
expanded: expandedKeys.indexOf(key) !== -1,
selected: selectedKeys.indexOf(key) !== -1,
loaded: loadedKeys.indexOf(key) !== -1,
loading: loadingKeys.indexOf(key) !== -1,
checked: checkedKeys.indexOf(key) !== -1,
halfChecked: halfCheckedKeys.indexOf(key) !== -1,
pos: String(entity ? entity.pos : ""),
dragOver: dragOverNodeKey === key && dropPosition === 0,
dragOverGapTop: dragOverNodeKey === key && dropPosition === -1,
dragOverGapBottom: dragOverNodeKey === key && dropPosition === 1
};
}
function convertNodePropsToEventData(props) {
const { data, expanded, selected, checked, loaded, loading, halfChecked, dragOver, dragOverGapTop, dragOverGapBottom, pos, active, eventKey } = props;
const eventData = {
...data,
expanded,
selected,
checked,
loaded,
loading,
halfChecked,
dragOver,
dragOverGapTop,
dragOverGapBottom,
pos,
active,
key: eventKey
};
if (!("props" in eventData)) Object.defineProperty(eventData, "props", { get() {
warningOnce(false, "Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`.");
return props;
} });
return eventData;
}
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useEntities.js
/** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
var useEntities_default = ((options, fieldNames) => {
const cacheRef = import_react.useRef({
options: [],
info: {
keyEntities: {},
pathKeyEntities: {}
}
});
return import_react.useCallback(() => {
if (cacheRef.current.options !== options) {
cacheRef.current.options = options;
cacheRef.current.info = convertDataToEntities(options, {
fieldNames,
initWrapper: (wrapper) => ({
...wrapper,
pathKeyEntities: {}
}),
processEntity: (entity, wrapper) => {
const pathKey = entity.nodes.map((node) => node[fieldNames.value]).join(VALUE_SPLIT);
wrapper.pathKeyEntities[pathKey] = entity;
entity.key = pathKey;
}
});
}
return cacheRef.current.info.pathKeyEntities;
}, [fieldNames, options]);
});
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useOptions.js
function useOptions(mergedFieldNames, options) {
const mergedOptions = import_react.useMemo(() => options || [], [options]);
const getPathKeyEntities = useEntities_default(mergedOptions, mergedFieldNames);
return [
mergedOptions,
getPathKeyEntities,
import_react.useCallback((pathKeys) => {
const keyPathEntities = getPathKeyEntities();
return pathKeys.map((pathKey) => {
const { nodes } = keyPathEntities[pathKey];
return nodes.map((node) => node[mergedFieldNames.value]);
});
}, [getPathKeyEntities, mergedFieldNames])
];
}
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useSearchConfig.js
function useSearchConfig$1(showSearch, props) {
const { autoClearSearchValue, searchValue, onSearch } = props;
return import_react.useMemo(() => {
if (!showSearch) return [false, {}];
let searchConfig = {
matchInputWidth: true,
limit: 50,
autoClearSearchValue,
searchValue,
onSearch
};
if (showSearch && typeof showSearch === "object") searchConfig = {
...searchConfig,
...showSearch
};
if (searchConfig.limit <= 0) {
searchConfig.limit = false;
warningOnce(false, "'limit' of showSearch should be positive number or false.");
}
return [true, searchConfig];
}, [
showSearch,
autoClearSearchValue,
searchValue,
onSearch
]);
}
//#endregion
//#region node_modules/@rc-component/tree/es/utils/conductUtil.js
function removeFromCheckedKeys(halfCheckedKeys, checkedKeys) {
const filteredKeys = /* @__PURE__ */ new Set();
halfCheckedKeys.forEach((key) => {
if (!checkedKeys.has(key)) filteredKeys.add(key);
});
return filteredKeys;
}
function isCheckDisabled$1(node) {
const { disabled, disableCheckbox, checkable } = node || {};
return !!(disabled || disableCheckbox) || checkable === false;
}
function fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
const checkedKeys = new Set(keys);
const halfCheckedKeys = /* @__PURE__ */ new Set();
for (let level = 0; level <= maxLevel; level += 1) (levelEntities.get(level) || /* @__PURE__ */ new Set()).forEach((entity) => {
const { key, node, children = [] } = entity;
if (checkedKeys.has(key) && !syntheticGetCheckDisabled(node)) children.filter((childEntity) => !syntheticGetCheckDisabled(childEntity.node)).forEach((childEntity) => {
checkedKeys.add(childEntity.key);
});
});
const visitedKeys = /* @__PURE__ */ new Set();
for (let level = maxLevel; level >= 0; level -= 1) (levelEntities.get(level) || /* @__PURE__ */ new Set()).forEach((entity) => {
const { parent, node } = entity;
if (syntheticGetCheckDisabled(node) || !entity.parent || visitedKeys.has(entity.parent.key)) return;
if (syntheticGetCheckDisabled(entity.parent.node)) {
visitedKeys.add(parent.key);
return;
}
let allChecked = true;
let partialChecked = false;
(parent.children || []).filter((childEntity) => !syntheticGetCheckDisabled(childEntity.node)).forEach(({ key }) => {
const checked = checkedKeys.has(key);
if (allChecked && !checked) allChecked = false;
if (!partialChecked && (checked || halfCheckedKeys.has(key))) partialChecked = true;
});
if (allChecked) checkedKeys.add(parent.key);
if (partialChecked) halfCheckedKeys.add(parent.key);
visitedKeys.add(parent.key);
});
return {
checkedKeys: Array.from(checkedKeys),
halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
};
}
function cleanConductCheck(keys, halfKeys, levelEntities, maxLevel, syntheticGetCheckDisabled) {
const checkedKeys = new Set(keys);
let halfCheckedKeys = new Set(halfKeys);
for (let level = 0; level <= maxLevel; level += 1) (levelEntities.get(level) || /* @__PURE__ */ new Set()).forEach((entity) => {
const { key, node, children = [] } = entity;
if (!checkedKeys.has(key) && !halfCheckedKeys.has(key) && !syntheticGetCheckDisabled(node)) children.filter((childEntity) => !syntheticGetCheckDisabled(childEntity.node)).forEach((childEntity) => {
checkedKeys.delete(childEntity.key);
});
});
halfCheckedKeys = /* @__PURE__ */ new Set();
const visitedKeys = /* @__PURE__ */ new Set();
for (let level = maxLevel; level >= 0; level -= 1) (levelEntities.get(level) || /* @__PURE__ */ new Set()).forEach((entity) => {
const { parent, node } = entity;
if (syntheticGetCheckDisabled(node) || !entity.parent || visitedKeys.has(entity.parent.key)) return;
if (syntheticGetCheckDisabled(entity.parent.node)) {
visitedKeys.add(parent.key);
return;
}
let allChecked = true;
let partialChecked = false;
(parent.children || []).filter((childEntity) => !syntheticGetCheckDisabled(childEntity.node)).forEach(({ key }) => {
const checked = checkedKeys.has(key);
if (allChecked && !checked) allChecked = false;
if (!partialChecked && (checked || halfCheckedKeys.has(key))) partialChecked = true;
});
if (!allChecked) checkedKeys.delete(parent.key);
if (partialChecked) halfCheckedKeys.add(parent.key);
visitedKeys.add(parent.key);
});
return {
checkedKeys: Array.from(checkedKeys),
halfCheckedKeys: Array.from(removeFromCheckedKeys(halfCheckedKeys, checkedKeys))
};
}
/**
* Conduct with keys.
* @param keyList current key list
* @param keyEntities key - dataEntity map
* @param mode `fill` to fill missing key, `clean` to remove useless key
*/
function conductCheck(keyList, checked, keyEntities, getCheckDisabled) {
const warningMissKeys = [];
let syntheticGetCheckDisabled;
if (getCheckDisabled) syntheticGetCheckDisabled = getCheckDisabled;
else syntheticGetCheckDisabled = isCheckDisabled$1;
const keys = new Set(keyList.filter((key) => {
const hasEntity = !!getEntity(keyEntities, key);
if (!hasEntity) warningMissKeys.push(key);
return hasEntity;
}));
const levelEntities = /* @__PURE__ */ new Map();
let maxLevel = 0;
Object.keys(keyEntities).forEach((key) => {
const entity = keyEntities[key];
const { level } = entity;
let levelSet = levelEntities.get(level);
if (!levelSet) {
levelSet = /* @__PURE__ */ new Set();
levelEntities.set(level, levelSet);
}
levelSet.add(entity);
maxLevel = Math.max(maxLevel, level);
});
warningOnce(!warningMissKeys.length, `Tree missing follow keys: ${warningMissKeys.slice(0, 100).map((key) => `'${key}'`).join(", ")}`);
let result;
if (checked === true) result = fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled);
else result = cleanConductCheck(keys, checked.halfCheckedKeys, levelEntities, maxLevel, syntheticGetCheckDisabled);
return result;
}
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useSelect.js
function useSelect(multiple, triggerChange, checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy) {
return (valuePath) => {
if (!multiple) triggerChange(valuePath);
else {
const pathKey = toPathKey(valuePath);
const checkedPathKeys = toPathKeys(checkedValues);
const halfCheckedPathKeys = toPathKeys(halfCheckedValues);
const existInChecked = checkedPathKeys.includes(pathKey);
const existInMissing = missingCheckedValues.some((valueCells) => toPathKey(valueCells) === pathKey);
let nextCheckedValues = checkedValues;
let nextMissingValues = missingCheckedValues;
if (existInMissing && !existInChecked) nextMissingValues = missingCheckedValues.filter((valueCells) => toPathKey(valueCells) !== pathKey);
else {
const nextRawCheckedKeys = existInChecked ? checkedPathKeys.filter((key) => key !== pathKey) : [...checkedPathKeys, pathKey];
const pathKeyEntities = getPathKeyEntities();
let checkedKeys;
if (existInChecked) ({checkedKeys} = conductCheck(nextRawCheckedKeys, {
checked: false,
halfCheckedKeys: halfCheckedPathKeys
}, pathKeyEntities));
else ({checkedKeys} = conductCheck(nextRawCheckedKeys, true, pathKeyEntities));
nextCheckedValues = getValueByKeyPath(formatStrategyValues$1(checkedKeys, getPathKeyEntities, showCheckedStrategy));
}
triggerChange([...nextMissingValues, ...nextCheckedValues]);
}
};
}
//#endregion
//#region node_modules/@rc-component/cascader/es/hooks/useValues.js
function useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues) {
return import_react.useMemo(() => {
const [existValues, missingValues] = getMissingValues(rawValues);
if (!multiple || !rawValues.length) return [
existValues,
[],
missingValues
];
const { checkedKeys, halfCheckedKeys } = conductCheck(toPathKeys(existValues), true, getPathKeyEntities());
return [
getValueByKeyPath(checkedKeys),
getValueByKeyPath(halfCheckedKeys),
missingValues
];
}, [
multiple,
rawValues,
getPathKeyEntities,
getValueByKeyPath,
getMissingValues
]);
}
//#endregion
//#region node_modules/@rc-component/cascader/es/OptionList/Checkbox.js
function Checkbox$2({ prefixCls, checked, halfChecked, disabled, onClick, disableCheckbox }) {
const { checkable } = import_react.useContext(CascaderContext);
const customCheckbox = typeof checkable !== "boolean" ? checkable : null;
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}`, {
[`${prefixCls}-checked`]: checked,
[`${prefixCls}-indeterminate`]: !checked && halfChecked,
[`${prefixCls}-disabled`]: disabled || disableCheckbox
}),
onClick
}, customCheckbox);
}
//#endregion
//#region node_modules/@rc-component/cascader/es/OptionList/Column.js
function _extends$45() {
_extends$45 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$45.apply(this, arguments);
}
var FIX_LABEL = "__cascader_fix_label__";
function Column$2({ prefixCls, multiple, options, activeValue, prevValuePath, onToggleOpen, onSelect, onActive, checkedSet, halfCheckedSet, loadingKeys, isSelectable, disabled: propsDisabled }) {
const menuPrefixCls = `${prefixCls}-menu`;
const menuItemPrefixCls = `${prefixCls}-menu-item`;
const menuRef = import_react.useRef(null);
const { fieldNames, changeOnSelect, expandTrigger, expandIcon, loadingIcon, popupMenuColumnStyle, optionRender, classNames, styles } = import_react.useContext(CascaderContext);
const hoverOpen = expandTrigger === "hover";
const isOptionDisabled = (disabled) => propsDisabled || disabled;
const optionInfoList = import_react.useMemo(() => options.map((option) => {
const { disabled, disableCheckbox } = option;
const searchOptions = option[SEARCH_MARK];
const label = option["__cascader_fix_label__"] ?? option[fieldNames.label];
const value = option[fieldNames.value];
const isMergedLeaf = isLeaf(option, fieldNames);
const fullPath = searchOptions ? searchOptions.map((opt) => opt[fieldNames.value]) : [...prevValuePath, value];
const fullPathKey = toPathKey(fullPath);
return {
disabled,
label,
value,
isLeaf: isMergedLeaf,
isLoading: loadingKeys.includes(fullPathKey),
checked: checkedSet.has(fullPathKey),
halfChecked: halfCheckedSet.has(fullPathKey),
option,
disableCheckbox,
fullPath,
fullPathKey
};
}), [
options,
checkedSet,
fieldNames,
halfCheckedSet,
loadingKeys,
prevValuePath
]);
import_react.useEffect(() => {
if (menuRef.current) {
const selector = `.${menuItemPrefixCls}-active`;
const activeElement = menuRef.current.querySelector(selector);
if (activeElement) scrollIntoParentView(activeElement);
}
}, [activeValue, menuItemPrefixCls]);
return /* @__PURE__ */ import_react.createElement("ul", {
className: clsx(menuPrefixCls, classNames?.popup?.list),
style: styles?.popup?.list,
ref: menuRef,
role: "menu"
}, optionInfoList.map(({ disabled, label, value, isLeaf: isMergedLeaf, isLoading, checked, halfChecked, option, fullPath, fullPathKey, disableCheckbox }) => {
const ariaProps = pickAttrs(option, {
aria: true,
data: true
});
const triggerOpenPath = () => {
if (isOptionDisabled(disabled)) return;
const nextValueCells = [...fullPath];
if (hoverOpen && isMergedLeaf) nextValueCells.pop();
onActive(nextValueCells);
};
const triggerSelect = () => {
if (isSelectable(option) && !isOptionDisabled(disabled)) onSelect(fullPath, isMergedLeaf);
};
let title;
if (typeof option.title === "string") title = option.title;
else if (typeof label === "string") title = label;
return /* @__PURE__ */ import_react.createElement("li", _extends$45({ key: fullPathKey }, ariaProps, {
className: clsx(menuItemPrefixCls, classNames?.popup?.listItem, {
[`${menuItemPrefixCls}-expand`]: !isMergedLeaf,
[`${menuItemPrefixCls}-active`]: activeValue === value || activeValue === fullPathKey,
[`${menuItemPrefixCls}-disabled`]: isOptionDisabled(disabled),
[`${menuItemPrefixCls}-loading`]: isLoading
}),
style: {
...popupMenuColumnStyle,
...styles?.popup?.listItem
},
role: "menuitemcheckbox",
title,
"aria-checked": checked,
"data-path-key": fullPathKey,
onClick: () => {
triggerOpenPath();
if (disableCheckbox) return;
if (!multiple || isMergedLeaf) triggerSelect();
},
onDoubleClick: () => {
if (changeOnSelect) onToggleOpen(false);
},
onMouseEnter: () => {
if (hoverOpen) triggerOpenPath();
},
onMouseDown: (e) => {
e.preventDefault();
}
}), multiple && /* @__PURE__ */ import_react.createElement(Checkbox$2, {
prefixCls: `${prefixCls}-checkbox`,
checked,
halfChecked,
disabled: isOptionDisabled(disabled) || disableCheckbox,
disableCheckbox,
onClick: (e) => {
if (disableCheckbox) return;
e.stopPropagation();
triggerSelect();
}
}), /* @__PURE__ */ import_react.createElement("div", { className: `${menuItemPrefixCls}-content` }, optionRender && value !== "__EMPTY__" ? optionRender(option) : label), !isLoading && expandIcon && !isMergedLeaf && /* @__PURE__ */ import_react.createElement("div", { className: `${menuItemPrefixCls}-expand-icon` }, expandIcon), isLoading && loadingIcon && /* @__PURE__ */ import_react.createElement("div", { className: `${menuItemPrefixCls}-loading-icon` }, loadingIcon));
}));
}
//#endregion
//#region node_modules/@rc-component/cascader/es/OptionList/useActive.js
/**
* Control the active open options path.
*/
var useActive = (multiple, open) => {
const { values } = import_react.useContext(CascaderContext);
const firstValueCells = values[0];
const [activeValueCells, setActiveValueCells] = import_react.useState([]);
import_react.useEffect(() => {
if (!multiple) setActiveValueCells(firstValueCells || []);
}, [open, firstValueCells]);
return [activeValueCells, setActiveValueCells];
};
//#endregion
//#region node_modules/@rc-component/cascader/es/OptionList/useKeyboard.js
var useKeyboard_default = ((ref, options, fieldNames, activeValueCells, setActiveValueCells, onKeyBoardSelect, contextProps) => {
const { direction, searchValue, toggleOpen, open } = contextProps;
const rtl = direction === "rtl";
const [validActiveValueCells, lastActiveIndex, lastActiveOptions, fullPathKeys] = import_react.useMemo(() => {
let activeIndex = -1;
let currentOptions = options;
const mergedActiveIndexes = [];
const mergedActiveValueCells = [];
const len = activeValueCells.length;
const pathKeys = getFullPathKeys(options, fieldNames);
for (let i = 0; i < len && currentOptions; i += 1) {
const nextActiveIndex = currentOptions.findIndex((option, index) => (pathKeys[index] ? toPathKey(pathKeys[index]) : option[fieldNames.value]) === activeValueCells[i]);
if (nextActiveIndex === -1) break;
activeIndex = nextActiveIndex;
mergedActiveIndexes.push(activeIndex);
mergedActiveValueCells.push(activeValueCells[i]);
currentOptions = currentOptions[activeIndex][fieldNames.children];
}
let activeOptions = options;
for (let i = 0; i < mergedActiveIndexes.length - 1; i += 1) activeOptions = activeOptions[mergedActiveIndexes[i]][fieldNames.children];
return [
mergedActiveValueCells,
activeIndex,
activeOptions,
pathKeys
];
}, [
activeValueCells,
fieldNames,
options
]);
const internalSetActiveValueCells = (next) => {
setActiveValueCells(next);
};
const offsetActiveOption = (offset) => {
const len = lastActiveOptions.length;
let currentIndex = lastActiveIndex;
if (currentIndex === -1 && offset < 0) currentIndex = len;
for (let i = 0; i < len; i += 1) {
currentIndex = (currentIndex + offset + len) % len;
const option = lastActiveOptions[currentIndex];
if (option && !option.disabled) {
internalSetActiveValueCells(validActiveValueCells.slice(0, -1).concat(fullPathKeys[currentIndex] ? toPathKey(fullPathKeys[currentIndex]) : option[fieldNames.value]));
return;
}
}
};
const prevColumn = () => {
if (validActiveValueCells.length > 1) internalSetActiveValueCells(validActiveValueCells.slice(0, -1));
else toggleOpen(false);
};
const nextColumn = () => {
const nextOption = (lastActiveOptions[lastActiveIndex]?.[fieldNames.children] || []).find((option) => !option.disabled);
if (nextOption) internalSetActiveValueCells([...validActiveValueCells, nextOption[fieldNames.value]]);
};
import_react.useImperativeHandle(ref, () => ({
onKeyDown: (event) => {
const { which } = event;
switch (which) {
case KeyCode.UP:
case KeyCode.DOWN: {
let offset = 0;
if (which === KeyCode.UP) offset = -1;
else if (which === KeyCode.DOWN) offset = 1;
if (offset !== 0) offsetActiveOption(offset);
break;
}
case KeyCode.LEFT:
if (searchValue) break;
if (rtl) nextColumn();
else prevColumn();
break;
case KeyCode.RIGHT:
if (searchValue) break;
if (rtl) prevColumn();
else nextColumn();
break;
case KeyCode.BACKSPACE:
if (!searchValue) prevColumn();
break;
case KeyCode.ENTER:
if (validActiveValueCells.length) {
const originOptions = lastActiveOptions[lastActiveIndex]?.["__rc_cascader_search_mark__"] || [];
if (originOptions.length) onKeyBoardSelect(originOptions.map((opt) => opt[fieldNames.value]), originOptions[originOptions.length - 1]);
else onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]);
}
break;
case KeyCode.ESC:
toggleOpen(false);
if (open) event.stopPropagation();
}
},
onKeyUp: () => {}
}));
});
//#endregion
//#region node_modules/@rc-component/cascader/es/OptionList/List.js
function _extends$44() {
_extends$44 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$44.apply(this, arguments);
}
var RawOptionList = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, multiple, searchValue, toggleOpen, notFoundContent, direction, open, disabled, lockOptions = false } = props;
const containerRef = import_react.useRef(null);
const rtl = direction === "rtl";
const { options, values, halfValues, fieldNames, changeOnSelect, onSelect, searchOptions, popupPrefixCls, loadData, expandTrigger } = import_react.useContext(CascaderContext);
const mergedPrefixCls = popupPrefixCls || prefixCls;
const [loadingKeys, setLoadingKeys] = import_react.useState([]);
const internalLoadData = (valueCells) => {
if (!loadData || searchValue) return;
const rawOptions = toPathOptions(valueCells, options, fieldNames).map(({ option }) => option);
const lastOption = rawOptions[rawOptions.length - 1];
if (lastOption && !isLeaf(lastOption, fieldNames)) {
const pathKey = toPathKey(valueCells);
setLoadingKeys((keys) => [...keys, pathKey]);
loadData(rawOptions);
}
};
import_react.useEffect(() => {
if (loadingKeys.length) loadingKeys.forEach((loadingKey) => {
const optionList = toPathOptions(toPathValueStr(loadingKey), options, fieldNames, true).map(({ option }) => option);
const lastOption = optionList[optionList.length - 1];
if (!lastOption || lastOption[fieldNames.children] || isLeaf(lastOption, fieldNames)) setLoadingKeys((keys) => keys.filter((key) => key !== loadingKey));
});
}, [
options,
loadingKeys,
fieldNames
]);
const checkedSet = import_react.useMemo(() => new Set(toPathKeys(values)), [values]);
const halfCheckedSet = import_react.useMemo(() => new Set(toPathKeys(halfValues)), [halfValues]);
const [activeValueCells, setActiveValueCells] = useActive(multiple, open);
const onPathOpen = (nextValueCells) => {
setActiveValueCells(nextValueCells);
internalLoadData(nextValueCells);
};
const isSelectable = (option) => {
if (disabled) return false;
const { disabled: optionDisabled } = option;
const isMergedLeaf = isLeaf(option, fieldNames);
return !optionDisabled && (isMergedLeaf || changeOnSelect || multiple);
};
const onPathSelect = (valuePath, leaf, fromKeyboard = false) => {
onSelect(valuePath);
if (!multiple && (leaf || changeOnSelect && (expandTrigger === "hover" || fromKeyboard))) toggleOpen(false);
};
const filteredOptions = import_react.useMemo(() => {
if (searchValue) return searchOptions;
return options;
}, [
searchValue,
searchOptions,
options
]);
const mergedOptions = useMemo$44(() => filteredOptions, [open, lockOptions], (prev, next) => !!next[0] && !next[1]);
const optionColumns = import_react.useMemo(() => {
const optionList = [{ options: mergedOptions }];
let currentList = mergedOptions;
const fullPathKeys = getFullPathKeys(currentList, fieldNames);
for (let i = 0; i < activeValueCells.length; i += 1) {
const activeValueCell = activeValueCells[i];
const subOptions = currentList.find((option, index) => (fullPathKeys[index] ? toPathKey(fullPathKeys[index]) : option[fieldNames.value]) === activeValueCell)?.[fieldNames.children];
if (!subOptions?.length) break;
currentList = subOptions;
optionList.push({ options: subOptions });
}
return optionList;
}, [
mergedOptions,
activeValueCells,
fieldNames
]);
const onKeyboardSelect = (selectValueCells, option) => {
if (isSelectable(option)) onPathSelect(selectValueCells, isLeaf(option, fieldNames), true);
};
useKeyboard_default(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect, {
direction,
searchValue,
toggleOpen,
open
});
import_react.useEffect(() => {
if (searchValue) return;
for (let i = 0; i < activeValueCells.length; i += 1) {
const cellKeyPath = toPathKey(activeValueCells.slice(0, i + 1));
const ele = containerRef.current?.querySelector(`li[data-path-key="${cellKeyPath.replace(/\\{0,2}"/g, "\\\"")}"]`);
if (ele) scrollIntoParentView(ele);
}
}, [activeValueCells, searchValue]);
const isEmpty = !optionColumns[0]?.options?.length;
const emptyList = [{
[fieldNames.value]: "__EMPTY__",
[FIX_LABEL]: notFoundContent,
disabled: true
}];
const columnProps = {
...props,
multiple: !isEmpty && multiple,
onSelect: onPathSelect,
onActive: onPathOpen,
onToggleOpen: toggleOpen,
checkedSet,
halfCheckedSet,
loadingKeys,
isSelectable
};
const columnNodes = (isEmpty ? [{ options: emptyList }] : optionColumns).map((col, index) => {
const prevValuePath = activeValueCells.slice(0, index);
const activeValue = activeValueCells[index];
return /* @__PURE__ */ import_react.createElement(Column$2, _extends$44({ key: index }, columnProps, {
prefixCls: mergedPrefixCls,
options: col.options,
prevValuePath,
activeValue
}));
});
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${mergedPrefixCls}-menus`, {
[`${mergedPrefixCls}-menu-empty`]: isEmpty,
[`${mergedPrefixCls}-rtl`]: rtl
}),
ref: containerRef
}, columnNodes);
});
RawOptionList.displayName = "RawOptionList";
//#endregion
//#region node_modules/@rc-component/cascader/es/OptionList/index.js
function _extends$43() {
_extends$43 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$43.apply(this, arguments);
}
var RefOptionList$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { lockOptions, ...baseProps } = useBaseProps();
return /* @__PURE__ */ import_react.createElement(RawOptionList, _extends$43({}, props, baseProps, {
lockOptions,
ref
}));
});
//#endregion
//#region node_modules/@rc-component/cascader/es/Panel.js
function noop$2() {}
function Panel$2(props) {
const { prefixCls = "rc-cascader", style, className, options, checkable, defaultValue, value, fieldNames, changeOnSelect, onChange, showCheckedStrategy, loadData, expandTrigger, expandIcon = ">", loadingIcon, direction, notFoundContent = "Not Found", disabled, optionRender } = props;
const multiple = !!checkable;
const [interanlRawValues, setRawValues] = useControlledState(defaultValue, value);
const rawValues = toRawValues(interanlRawValues);
const mergedFieldNames = import_react.useMemo(() => fillFieldNames$2(fieldNames), [JSON.stringify(fieldNames)]);
const [mergedOptions, getPathKeyEntities, getValueByKeyPath] = useOptions(mergedFieldNames, options);
const [checkedValues, halfCheckedValues, missingCheckedValues] = useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, useMissingValues(mergedOptions, mergedFieldNames));
const handleSelection = useSelect(multiple, useEvent((nextValues) => {
setRawValues(nextValues);
if (onChange) {
const nextRawValues = toRawValues(nextValues);
const valueOptions = nextRawValues.map((valueCells) => toPathOptions(valueCells, mergedOptions, mergedFieldNames).map((valueOpt) => valueOpt.option));
onChange(multiple ? nextRawValues : nextRawValues[0], multiple ? valueOptions : valueOptions[0]);
}
}), checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy);
const onInternalSelect = useEvent((valuePath) => {
handleSelection(valuePath);
});
const cascaderContext = import_react.useMemo(() => ({
options: mergedOptions,
fieldNames: mergedFieldNames,
values: checkedValues,
halfValues: halfCheckedValues,
changeOnSelect,
onSelect: onInternalSelect,
checkable,
searchOptions: [],
popupPrefixCls: void 0,
loadData,
expandTrigger,
expandIcon,
loadingIcon,
popupMenuColumnStyle: void 0,
optionRender
}), [
mergedOptions,
mergedFieldNames,
checkedValues,
halfCheckedValues,
changeOnSelect,
onInternalSelect,
checkable,
loadData,
expandTrigger,
expandIcon,
loadingIcon,
optionRender
]);
const panelPrefixCls = `${prefixCls}-panel`;
const isEmpty = !mergedOptions.length;
return /* @__PURE__ */ import_react.createElement(CascaderContext.Provider, { value: cascaderContext }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(panelPrefixCls, {
[`${panelPrefixCls}-rtl`]: direction === "rtl",
[`${panelPrefixCls}-empty`]: isEmpty
}, className),
style
}, isEmpty ? notFoundContent : /* @__PURE__ */ import_react.createElement(RawOptionList, {
prefixCls,
searchValue: "",
multiple,
toggleOpen: noop$2,
open: true,
direction,
disabled
})));
}
//#endregion
//#region node_modules/@rc-component/cascader/es/utils/warningPropsUtil.js
function warningNullOptions(options, fieldNames) {
if (options) {
const recursiveOptions = (optionsList) => {
for (let i = 0; i < optionsList.length; i++) {
const option = optionsList[i];
if (option[fieldNames?.value] === null) {
warningOnce(false, "`value` in Cascader options should not be `null`.");
return true;
}
if (Array.isArray(option[fieldNames?.children]) && recursiveOptions(option[fieldNames?.children])) return true;
}
};
recursiveOptions(options);
}
}
//#endregion
//#region node_modules/@rc-component/cascader/es/Cascader.js
function _extends$42() {
_extends$42 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$42.apply(this, arguments);
}
var Cascader$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { id, prefixCls = "rc-cascader", fieldNames, defaultValue, value, changeOnSelect, onChange, displayRender, checkable, showSearch, expandTrigger, options, popupPrefixCls, loadData, open, popupClassName, popupMenuColumnStyle, popupStyle: customPopupStyle, classNames, styles, placement, onPopupVisibleChange, expandIcon = ">", loadingIcon, children, popupMatchSelectWidth = false, showCheckedStrategy = SHOW_PARENT$2, optionRender, ...restProps } = props;
const mergedId = useId_default(id);
const multiple = !!checkable;
const [interanlRawValues, setRawValues] = useControlledState(defaultValue, value);
const rawValues = toRawValues(interanlRawValues);
const mergedFieldNames = import_react.useMemo(() => fillFieldNames$2(fieldNames), [JSON.stringify(fieldNames)]);
const [mergedOptions, getPathKeyEntities, getValueByKeyPath] = useOptions(mergedFieldNames, options);
const [mergedShowSearch, searchConfig] = useSearchConfig$1(showSearch, props);
const { autoClearSearchValue = true, searchValue, onSearch } = searchConfig;
const [internalSearchValue, setSearchValue] = useControlledState("", searchValue);
const mergedSearchValue = internalSearchValue || "";
const onInternalSearch = (searchText, info) => {
setSearchValue(searchText);
if (info.source !== "blur" && onSearch) onSearch(searchText);
};
const searchOptions = useSearchOptions(mergedSearchValue, mergedOptions, mergedFieldNames, popupPrefixCls || prefixCls, searchConfig, changeOnSelect || multiple);
const [checkedValues, halfCheckedValues, missingCheckedValues] = useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, useMissingValues(mergedOptions, mergedFieldNames));
const displayValues = useDisplayValues_default(import_react.useMemo(() => {
const deduplicateKeys = formatStrategyValues$1(toPathKeys(checkedValues), getPathKeyEntities, showCheckedStrategy);
return [...missingCheckedValues, ...getValueByKeyPath(deduplicateKeys)];
}, [
checkedValues,
getPathKeyEntities,
getValueByKeyPath,
missingCheckedValues,
showCheckedStrategy
]), mergedOptions, mergedFieldNames, multiple, displayRender);
const triggerChange = useEvent((nextValues) => {
setRawValues(nextValues);
if (onChange) {
const nextRawValues = toRawValues(nextValues);
const valueOptions = nextRawValues.map((valueCells) => toPathOptions(valueCells, mergedOptions, mergedFieldNames).map((valueOpt) => valueOpt.option));
onChange(multiple ? nextRawValues : nextRawValues[0], multiple ? valueOptions : valueOptions[0]);
}
});
const handleSelection = useSelect(multiple, triggerChange, checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy);
const onInternalSelect = useEvent((valuePath) => {
if (!multiple || autoClearSearchValue) setSearchValue("");
handleSelection(valuePath);
});
const onDisplayValuesChange = (_, info) => {
if (info.type === "clear") {
triggerChange([]);
return;
}
const { valueCells } = info.values[0];
onInternalSelect(valueCells);
};
const onInternalPopupVisibleChange = (nextVisible) => {
onPopupVisibleChange?.(nextVisible);
};
warningNullOptions(mergedOptions, mergedFieldNames);
const cascaderContext = import_react.useMemo(() => ({
classNames,
styles,
options: mergedOptions,
fieldNames: mergedFieldNames,
values: checkedValues,
halfValues: halfCheckedValues,
changeOnSelect,
onSelect: onInternalSelect,
checkable,
searchOptions,
popupPrefixCls,
loadData,
expandTrigger,
expandIcon,
loadingIcon,
popupMenuColumnStyle,
optionRender
}), [
classNames,
styles,
mergedOptions,
mergedFieldNames,
checkedValues,
halfCheckedValues,
changeOnSelect,
onInternalSelect,
checkable,
searchOptions,
popupPrefixCls,
loadData,
expandTrigger,
expandIcon,
loadingIcon,
popupMenuColumnStyle,
optionRender
]);
const emptyOptions = !(mergedSearchValue ? searchOptions : mergedOptions).length;
const popupStyle = mergedSearchValue && searchConfig.matchInputWidth || emptyOptions ? {} : { minWidth: "auto" };
return /* @__PURE__ */ import_react.createElement(CascaderContext.Provider, { value: cascaderContext }, /* @__PURE__ */ import_react.createElement(BaseSelect, _extends$42({}, restProps, {
ref,
id: mergedId,
prefixCls,
autoClearSearchValue,
popupMatchSelectWidth,
classNames,
styles,
popupStyle: {
...popupStyle,
...customPopupStyle
},
displayValues,
onDisplayValuesChange,
mode: multiple ? "multiple" : void 0,
searchValue: mergedSearchValue,
onSearch: onInternalSearch,
showSearch: mergedShowSearch,
OptionList: RefOptionList$1,
emptyOptions,
open,
popupClassName,
placement,
onPopupVisibleChange: onInternalPopupVisibleChange,
getRawInputElement: () => children
})));
});
Cascader$1.displayName = "Cascader";
Cascader$1.SHOW_PARENT = SHOW_PARENT$2;
Cascader$1.SHOW_CHILD = SHOW_CHILD$2;
Cascader$1.Panel = Panel$2;
//#endregion
//#region node_modules/@rc-component/cascader/es/index.js
var es_default$14 = Cascader$1;
//#endregion
//#region node_modules/antd/es/cascader/hooks/useBase.js
function useBase(customizePrefixCls, direction) {
const { getPrefixCls, direction: rootDirection, renderEmpty } = import_react.useContext(ConfigContext);
const mergedDirection = direction || rootDirection;
return [
getPrefixCls("select", customizePrefixCls),
getPrefixCls("cascader", customizePrefixCls),
mergedDirection,
renderEmpty
];
}
//#endregion
//#region node_modules/antd/es/cascader/hooks/useCheckable.js
function useCheckable(cascaderPrefixCls, multiple) {
return import_react.useMemo(() => multiple ? /* @__PURE__ */ import_react.createElement("span", { className: `${cascaderPrefixCls}-checkbox-inner` }) : false, [cascaderPrefixCls, multiple]);
}
//#endregion
//#region node_modules/antd/es/cascader/hooks/useIcons.js
var defaultLoadingIcon = /* @__PURE__ */ import_react.createElement(RefIcon$5, { spin: true });
var defaultExpandIcon = /* @__PURE__ */ import_react.createElement(RefIcon$6, null);
var defaultRtlExpandIcon = /* @__PURE__ */ import_react.createElement(RefIcon$12, null);
function useIcons$1({ contextExpandIcon, contextLoadingIcon, expandIcon, loadingIcon, isRtl }) {
return import_react.useMemo(() => ({
expandIcon: expandIcon ?? contextExpandIcon ?? (isRtl ? defaultRtlExpandIcon : defaultExpandIcon),
loadingIcon: loadingIcon ?? contextLoadingIcon ?? defaultLoadingIcon
}), [
contextExpandIcon,
contextLoadingIcon,
expandIcon,
isRtl,
loadingIcon
]);
}
//#endregion
//#region node_modules/antd/es/checkbox/style/index.js
var genCheckboxStyle = (token) => {
const { checkboxCls, checkboxSize, lineWidth } = token;
const wrapperCls = `${checkboxCls}-wrapper`;
return [
{
[`${checkboxCls}-group`]: {
...resetComponent(token),
display: "inline-flex",
flexWrap: "wrap",
columnGap: token.marginXS,
[`> ${token.antCls}-row`]: { flex: 1 }
},
[wrapperCls]: {
...resetComponent(token),
display: "inline-flex",
alignItems: "baseline",
cursor: "pointer",
"&:after": {
display: "inline-block",
width: 0,
overflow: "hidden",
content: "'\\a0'"
},
[`& + ${wrapperCls}`]: { marginInlineStart: 0 },
[`&${wrapperCls}-in-form-item`]: { "input[type=\"checkbox\"]": {
width: 14,
height: 14
} }
},
[checkboxCls]: {
...resetComponent(token),
position: "relative",
whiteSpace: "nowrap",
lineHeight: 1,
cursor: "pointer",
alignSelf: "center",
boxSizing: "border-box",
display: "block",
width: checkboxSize,
height: checkboxSize,
direction: "ltr",
backgroundColor: token.colorBgContainer,
border: `${unit$1(lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderRadius: token.borderRadiusSM,
borderCollapse: "separate",
transition: `all ${token.motionDurationSlow}`,
flex: "none",
...genNoMotionStyle(),
"&:after": {
boxSizing: "border-box",
position: "absolute",
top: `calc(${checkboxSize} / 2 - ${lineWidth})`,
insetInlineStart: `calc(${checkboxSize} / 4 - ${lineWidth})`,
display: "table",
width: token.calc(checkboxSize).div(14).mul(5).equal(),
height: token.calc(checkboxSize).div(14).mul(8).equal(),
border: `${unit$1(token.lineWidthBold)} solid ${token.colorWhite}`,
borderTop: 0,
borderInlineStart: 0,
transform: "rotate(45deg) scale(0) translate(-50%,-50%)",
opacity: 0,
content: "\"\"",
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`,
...genNoMotionStyle()
},
[`${checkboxCls}-input`]: {
position: "absolute",
inset: `calc(-1 * (${lineWidth}))`,
zIndex: 1,
cursor: "pointer",
opacity: 0,
margin: 0
},
[`&:has(${checkboxCls}-input:focus-visible)`]: genFocusOutline(token),
"& + span": {
paddingInlineStart: token.paddingXS,
paddingInlineEnd: token.paddingXS
}
}
},
{
[`
${wrapperCls}:not(${wrapperCls}-disabled),
${checkboxCls}:not(${checkboxCls}-disabled)
`]: { [`&:hover ${checkboxCls}`]: { borderColor: token.colorPrimary } },
[`${wrapperCls}:not(${wrapperCls}-disabled)`]: { [`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled)`]: {
backgroundColor: token.colorPrimaryHover,
borderColor: "transparent"
} }
},
{ [`${checkboxCls}-checked`]: {
backgroundColor: token.colorPrimary,
borderColor: token.colorPrimary,
"&:after": {
opacity: 1,
transform: "rotate(45deg) scale(1) translate(-50%,-50%)",
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`,
...genNoMotionStyle()
},
[`&:not(${checkboxCls}-disabled):hover`]: {
backgroundColor: token.colorPrimaryHover,
borderColor: "transparent"
}
} },
{ [checkboxCls]: { "&-indeterminate": {
backgroundColor: token.colorBgContainer,
borderColor: token.colorBorder,
"&:after": {
top: "50%",
insetInlineStart: "50%",
width: token.calc(token.fontSizeLG).div(2).equal(),
height: token.calc(token.fontSizeLG).div(2).equal(),
backgroundColor: token.colorPrimary,
border: 0,
transform: "translate(-50%, -50%) scale(1)",
opacity: 1,
content: "\"\""
},
"&:hover": {
backgroundColor: token.colorBgContainer,
borderColor: token.colorPrimary
}
} } },
{
[`${wrapperCls}-disabled`]: { cursor: "not-allowed" },
[`${checkboxCls}-disabled`]: {
[`&, ${checkboxCls}-input`]: {
cursor: "not-allowed",
pointerEvents: "none"
},
background: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
"&:after": { borderColor: token.colorTextDisabled },
"& + span": { color: token.colorTextDisabled },
[`&${checkboxCls}-indeterminate::after`]: { background: token.colorTextDisabled }
}
}
];
};
function getStyle(prefixCls, token) {
return genCheckboxStyle(merge(token, {
checkboxCls: `.${prefixCls}`,
checkboxSize: token.controlInteractiveSize
}));
}
var style_default$35 = genStyleHooks("Checkbox", (token, { prefixCls }) => [getStyle(prefixCls, token)]);
//#endregion
//#region node_modules/antd/es/cascader/style/columns.js
var getColumnsStyle = (token) => {
const { prefixCls, componentCls } = token;
const cascaderMenuItemCls = `${componentCls}-menu-item`;
const iconCls = `
&${cascaderMenuItemCls}-expand ${cascaderMenuItemCls}-expand-icon,
${cascaderMenuItemCls}-loading-icon
`;
return [getStyle(`${prefixCls}-checkbox`, token), { [componentCls]: {
"&-checkbox": {
top: 0,
marginInlineEnd: token.paddingXS,
pointerEvents: "unset"
},
"&-menus": {
display: "flex",
flexWrap: "nowrap",
alignItems: "flex-start",
[`&${componentCls}-menu-empty`]: { [`${componentCls}-menu`]: {
width: "100%",
height: "auto",
[cascaderMenuItemCls]: { color: token.colorTextDisabled }
} }
},
"&-menu": {
flexGrow: 1,
flexShrink: 0,
minWidth: token.controlItemWidth,
height: token.dropdownHeight,
margin: 0,
padding: token.menuPadding,
overflow: "auto",
verticalAlign: "top",
listStyle: "none",
"-ms-overflow-style": "-ms-autohiding-scrollbar",
"&:not(:last-child)": { borderInlineEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}` },
"&-item": {
display: "flex",
maxWidth: 400,
flexWrap: "nowrap",
alignItems: "center",
padding: token.optionPadding,
lineHeight: token.lineHeight,
cursor: "pointer",
transition: `all ${token.motionDurationMid}`,
borderRadius: token.borderRadiusSM,
"&:hover": { background: token.controlItemBgHover },
"&-disabled": {
color: token.colorTextDisabled,
cursor: "not-allowed",
"&:hover": { background: "transparent" },
[iconCls]: { color: token.colorTextDisabled }
},
[`&-active:not(${cascaderMenuItemCls}-disabled)`]: { "&, &:hover": {
color: token.optionSelectedColor,
fontWeight: token.optionSelectedFontWeight,
backgroundColor: token.optionSelectedBg
} },
"&-content": {
flex: "auto",
minWidth: 0,
...textEllipsis
},
[iconCls]: {
marginInlineStart: token.paddingXXS,
color: token.colorIcon,
fontSize: token.fontSizeIcon
},
"&-keyword": { color: token.colorHighlight }
}
}
} }];
};
//#endregion
//#region node_modules/antd/es/cascader/style/index.js
var genBaseStyle$10 = (token) => {
const { componentCls, antCls } = token;
return [
{ [componentCls]: { width: token.controlWidth } },
{ [`${componentCls}-dropdown`]: [{ [`&${antCls}-select-dropdown`]: { padding: 0 } }, getColumnsStyle(token)] },
{ [`${componentCls}-dropdown-rtl`]: { direction: "rtl" } },
genCompactItemStyle(token)
];
};
var prepareComponentToken$31 = (token) => {
const itemPaddingVertical = Math.round((token.controlHeight - token.fontSize * token.lineHeight) / 2);
return {
controlWidth: 184,
controlItemWidth: 111,
dropdownHeight: 180,
optionSelectedBg: token.controlItemBgActive,
optionSelectedFontWeight: token.fontWeightStrong,
optionPadding: `${itemPaddingVertical}px ${token.paddingSM}px`,
menuPadding: token.paddingXXS,
optionSelectedColor: token.colorText
};
};
var style_default$34 = genStyleHooks("Cascader", genBaseStyle$10, prepareComponentToken$31, {
resetFont: false,
unitless: { optionSelectedFontWeight: true }
});
//#endregion
//#region node_modules/antd/es/cascader/style/panel.js
var genPanelStyle$1 = (token) => {
const { componentCls } = token;
return { [`${componentCls}-panel`]: [getColumnsStyle(token), {
display: "inline-flex",
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
borderRadius: token.borderRadiusLG,
overflowX: "auto",
maxWidth: "100%",
[`${componentCls}-menus`]: { alignItems: "stretch" },
[`${componentCls}-menu`]: { height: "auto" },
"&-empty": { padding: token.paddingXXS }
}] };
};
var panel_default = genComponentStyleHook(["Cascader", "Panel"], genPanelStyle$1, prepareComponentToken$31, { resetFont: false });
//#endregion
//#region node_modules/antd/es/cascader/Panel.js
function CascaderPanel(props) {
const { prefixCls: customizePrefixCls, className, multiple, rootClassName, notFoundContent, direction, expandIcon, loadingIcon, disabled: customDisabled } = props;
const { expandIcon: contextExpandIcon, loadingIcon: contextLoadingIcon } = useComponentConfig("cascader");
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const [_, cascaderPrefixCls, mergedDirection, renderEmpty] = useBase(customizePrefixCls, direction);
const rootCls = useCSSVarCls(cascaderPrefixCls);
const [hashId, cssVarCls] = style_default$34(cascaderPrefixCls, rootCls);
panel_default(cascaderPrefixCls);
const { expandIcon: mergedExpandIcon, loadingIcon: mergedLoadingIcon } = useIcons$1({
contextExpandIcon,
contextLoadingIcon,
expandIcon,
loadingIcon,
isRtl: mergedDirection === "rtl"
});
const mergedNotFoundContent = notFoundContent || renderEmpty?.("Cascader") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "Cascader" });
const checkable = useCheckable(cascaderPrefixCls, multiple);
return /* @__PURE__ */ import_react.createElement(Panel$2, {
...props,
checkable,
prefixCls: cascaderPrefixCls,
className: clsx(className, hashId, rootClassName, cssVarCls, rootCls),
notFoundContent: mergedNotFoundContent,
direction: mergedDirection,
expandIcon: mergedExpandIcon,
loadingIcon: mergedLoadingIcon,
disabled: mergedDisabled
});
}
//#endregion
//#region node_modules/antd/es/cascader/index.js
var { SHOW_CHILD: SHOW_CHILD$1, SHOW_PARENT: SHOW_PARENT$1 } = es_default$14;
var highlightKeyword = (str, lowerKeyword, prefixCls) => {
const cells = str.toLowerCase().split(lowerKeyword).reduce((list, cur, index) => index === 0 ? [cur] : [].concat(_toConsumableArray$8(list), [lowerKeyword, cur]), []);
const fillCells = [];
let start = 0;
cells.forEach((cell, index) => {
const end = start + cell.length;
let originWorld = str.slice(start, end);
start = end;
if (index % 2 === 1) originWorld = /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-menu-item-keyword`,
key: `separator-${index}`
}, originWorld);
fillCells.push(originWorld);
});
return fillCells;
};
var defaultSearchRender = (inputValue, path, prefixCls, fieldNames) => {
const optionList = [];
const lower = inputValue.toLowerCase();
path.forEach((node, index) => {
if (index !== 0) optionList.push(" / ");
let label = node[fieldNames.label];
const type = typeof label;
if (type === "string" || type === "number") label = highlightKeyword(String(label), lower, prefixCls);
optionList.push(label);
});
return optionList;
};
var Cascader = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, size: customizeSize, disabled: customDisabled, className, rootClassName, multiple, bordered = true, transitionName, choiceTransitionName = "", popupClassName, expandIcon, placement, showSearch, allowClear = true, notFoundContent, direction, getPopupContainer, status: customStatus, showArrow, builtinPlacements, style, variant: customVariant, dropdownClassName, dropdownRender, onDropdownVisibleChange, onPopupVisibleChange, dropdownMenuColumnStyle, popupRender, dropdownStyle, popupMenuColumnStyle, onOpenChange, styles, classNames, loadingIcon, ...rest } = props;
const restProps = omit(rest, ["suffixIcon"]);
const { getPrefixCls, getPopupContainer: getContextPopupContainer, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, expandIcon: contextExpandIcon, loadingIcon: contextLoadingIcon } = useComponentConfig("cascader");
const { popupOverflow } = import_react.useContext(ConfigContext);
const { status: contextStatus, hasFeedback, isFormItemInput, feedbackIcon } = import_react.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
{
const warning = devUseWarning("Cascader");
Object.entries({
dropdownClassName: "classNames.popup.root",
dropdownStyle: "styles.popup.root",
dropdownRender: "popupRender",
dropdownMenuColumnStyle: "styles.popup.listItem",
popupMenuColumnStyle: "styles.popup.listItem",
onDropdownVisibleChange: "onOpenChange",
onPopupVisibleChange: "onOpenChange",
bordered: "variant"
}).forEach(([oldProp, newProp]) => {
warning.deprecated(!(oldProp in props), oldProp, newProp);
});
warning(!("showArrow" in props), "deprecated", "`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.");
}
const [prefixCls, cascaderPrefixCls, mergedDirection, renderEmpty] = useBase(customizePrefixCls, direction);
const isRtl = mergedDirection === "rtl";
const rootPrefixCls = getPrefixCls();
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$52(prefixCls, rootCls);
const cascaderRootCls = useCSSVarCls(cascaderPrefixCls);
style_default$34(cascaderPrefixCls, cascaderRootCls);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const [variant, enableVariantCls] = useVariant("cascader", customVariant, bordered);
const mergedNotFoundContent = notFoundContent || renderEmpty?.("Cascader") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "Cascader" });
const mergedPopupRender = usePopupRender(popupRender || dropdownRender);
const mergedPopupMenuColumnStyle = popupMenuColumnStyle || dropdownMenuColumnStyle;
const mergedOnOpenChange = onOpenChange || onPopupVisibleChange || onDropdownVisibleChange;
const mergedShowSearch = import_react.useMemo(() => {
if (!showSearch) return showSearch;
let searchConfig = { render: defaultSearchRender };
if (isPlainObject(showSearch)) searchConfig = {
...searchConfig,
...showSearch
};
return searchConfig;
}, [showSearch]);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const { expandIcon: mergedExpandIcon, loadingIcon: mergedLoadingIcon } = useIcons$1({
contextExpandIcon,
contextLoadingIcon,
expandIcon,
loadingIcon,
isRtl
});
const checkable = useCheckable(cascaderPrefixCls, multiple);
const showSuffixIcon = useShowArrow(props.suffixIcon, showArrow);
const { suffixIcon, removeIcon, clearIcon } = useIcons$2({
...props,
loadingIcon: mergedLoadingIcon,
hasFeedback,
feedbackIcon,
showSuffixIcon,
multiple,
prefixCls,
componentName: "Cascader"
});
const memoPlacement = import_react.useMemo(() => {
if (placement !== void 0) return placement;
return isRtl ? "bottomRight" : "bottomLeft";
}, [placement, isRtl]);
const mergedAllowClear = allowClear === true ? { clearIcon } : allowClear;
const mergedProps = {
...props,
variant,
size: mergedSize,
status: mergedStatus,
disabled: mergedDisabled
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { popup: { _default: "root" } });
const mergedPopupStyle = {
...mergedStyles.popup?.root,
...dropdownStyle
};
const [zIndex] = useZIndex("SelectLike", mergedPopupStyle?.zIndex);
const mergedPopupClassName = clsx(popupClassName || dropdownClassName, `${cascaderPrefixCls}-dropdown`, { [`${cascaderPrefixCls}-dropdown-rtl`]: mergedDirection === "rtl" }, rootClassName, rootCls, mergedClassNames.popup?.root, cascaderRootCls, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement(es_default$14, {
prefixCls,
className: clsx(!customizePrefixCls && cascaderPrefixCls, {
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-rtl`]: isRtl,
[`${prefixCls}-${variant}`]: enableVariantCls,
[`${prefixCls}-in-form-item`]: isFormItemInput
}, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, contextClassName, className, rootClassName, mergedClassNames.root, rootCls, cascaderRootCls, hashId, cssVarCls),
disabled: mergedDisabled,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
classNames: mergedClassNames,
styles: mergedStyles,
...restProps,
builtinPlacements: mergedBuiltinPlacements(builtinPlacements, popupOverflow),
direction: mergedDirection,
placement: memoPlacement,
notFoundContent: mergedNotFoundContent,
allowClear: mergedAllowClear,
showSearch: mergedShowSearch,
expandIcon: mergedExpandIcon,
suffixIcon,
removeIcon,
loadingIcon: mergedLoadingIcon,
checkable,
popupClassName: mergedPopupClassName,
popupPrefixCls: customizePrefixCls || cascaderPrefixCls,
popupStyle: {
...mergedPopupStyle,
zIndex
},
popupRender: mergedPopupRender,
popupMenuColumnStyle: mergedPopupMenuColumnStyle,
onPopupVisibleChange: mergedOnOpenChange,
choiceTransitionName: getTransitionName(rootPrefixCls, "", choiceTransitionName),
transitionName: getTransitionName(rootPrefixCls, "slide-up", transitionName),
getPopupContainer: getPopupContainer || getContextPopupContainer,
ref
});
});
Cascader.displayName = "Cascader";
/* istanbul ignore next */
var PurePanel$7 = genPurePanel(Cascader, "popupAlign", (props) => omit(props, ["visible"]));
Cascader.SHOW_PARENT = SHOW_PARENT$1;
Cascader.SHOW_CHILD = SHOW_CHILD$1;
Cascader.Panel = CascaderPanel;
Cascader._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$7;
//#endregion
//#region node_modules/antd/es/checkbox/GroupContext.js
var GroupContext$1 = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/antd/es/checkbox/Checkbox.js
var InternalCheckbox = (props, ref) => {
const { prefixCls: customizePrefixCls, children, indeterminate = false, onMouseEnter, onMouseLeave, skipGroup = false, disabled, rootClassName, className, style, classNames, styles, name, value, checked, defaultChecked, onChange, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("checkbox");
const checkboxGroup = import_react.useContext(GroupContext$1);
const { isFormItemInput } = import_react.useContext(FormItemInputContext);
const contextDisabled = import_react.useContext(DisabledContext);
const mergedDisabled = (checkboxGroup?.disabled || disabled) ?? contextDisabled;
devUseWarning("Checkbox")("checked" in props || !!checkboxGroup || !("value" in props), "usage", "`value` is not a valid prop, do you mean `checked`?");
const [innerChecked, setInnerChecked] = useControlledState(defaultChecked, checked);
let mergedChecked = innerChecked;
const onInternalChange = useEvent((event) => {
setInnerChecked(event.target.checked);
onChange?.(event);
if (!skipGroup && checkboxGroup?.toggleOption) checkboxGroup.toggleOption({
label: children,
value
});
});
if (checkboxGroup && !skipGroup) mergedChecked = checkboxGroup.value.includes(value);
const checkboxRef = import_react.useRef(null);
const mergedRef = useComposeRef(ref, checkboxRef);
import_react.useEffect(() => {
if (skipGroup || !checkboxGroup) return;
checkboxGroup.registerValue(value);
return () => {
checkboxGroup.cancelValue(value);
};
}, [value, skipGroup]);
import_react.useEffect(() => {
if (checkboxRef.current?.input) checkboxRef.current.input.indeterminate = indeterminate;
}, [indeterminate]);
const prefixCls = getPrefixCls("checkbox", customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$35(prefixCls, rootCls);
const checkboxProps = { ...restProps };
const mergedProps = {
...props,
indeterminate,
disabled: mergedDisabled,
checked: mergedChecked
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const classString = clsx(`${prefixCls}-wrapper`, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-wrapper-checked`]: mergedChecked,
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
}, contextClassName, className, mergedClassNames.root, rootClassName, cssVarCls, rootCls, hashId);
const checkboxClass = clsx(mergedClassNames.icon, { [`${prefixCls}-indeterminate`]: indeterminate }, TARGET_CLS, hashId);
const [onLabelClick, onInputClick] = useBubbleLock(checkboxProps.onClick);
return /* @__PURE__ */ import_react.createElement(Wave, {
component: "Checkbox",
disabled: mergedDisabled
}, /* @__PURE__ */ import_react.createElement("label", {
className: classString,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
onMouseEnter,
onMouseLeave,
onClick: onLabelClick
}, /* @__PURE__ */ import_react.createElement(Checkbox$3, {
...checkboxProps,
name: !skipGroup && checkboxGroup ? checkboxGroup.name : name,
checked: mergedChecked,
onClick: onInputClick,
onChange: onInternalChange,
prefixCls,
className: checkboxClass,
style: mergedStyles.icon,
disabled: mergedDisabled,
ref: mergedRef,
value
}), isNonNullable(children) && /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-label`, mergedClassNames.label),
style: mergedStyles.label
}, children)));
};
var Checkbox$1 = /* @__PURE__ */ import_react.forwardRef(InternalCheckbox);
Checkbox$1.displayName = "Checkbox";
//#endregion
//#region node_modules/antd/es/checkbox/Group.js
var CheckboxGroup = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { defaultValue, children, options = [], prefixCls: customizePrefixCls, className, rootClassName, style, onChange, role = "group", ...restProps } = props;
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const [value, setValue] = import_react.useState(restProps.value || defaultValue || []);
const [registeredValues, setRegisteredValues] = import_react.useState([]);
import_react.useEffect(() => {
if ("value" in restProps) setValue(restProps.value || []);
}, [restProps.value]);
const memoizedOptions = import_react.useMemo(() => options.map((option) => {
if (typeof option === "string" || isNumber(option)) return {
label: option,
value: option
};
return option;
}), [options]);
const cancelValue = (val) => {
setRegisteredValues((prevValues) => prevValues.filter((v) => v !== val));
};
const registerValue = (val) => {
setRegisteredValues((prevValues) => [].concat(_toConsumableArray$8(prevValues), [val]));
};
const toggleOption = (option) => {
const optionIndex = value.indexOf(option.value);
const newValue = _toConsumableArray$8(value);
if (optionIndex === -1) newValue.push(option.value);
else newValue.splice(optionIndex, 1);
if (!("value" in restProps)) setValue(newValue);
onChange?.(newValue.filter((val) => registeredValues.includes(val)).sort((a, b) => {
return memoizedOptions.findIndex((opt) => opt.value === a) - memoizedOptions.findIndex((opt) => opt.value === b);
}));
};
const prefixCls = getPrefixCls("checkbox", customizePrefixCls);
const groupPrefixCls = `${prefixCls}-group`;
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$35(prefixCls, rootCls);
const domProps = omit(restProps, ["value", "disabled"]);
const childrenNode = options.length ? memoizedOptions.map((option) => /* @__PURE__ */ import_react.createElement(Checkbox$1, {
prefixCls,
key: option.value.toString(),
disabled: "disabled" in option ? option.disabled : restProps.disabled,
value: option.value,
checked: value.includes(option.value),
onChange: option.onChange,
className: clsx(`${groupPrefixCls}-item`, option.className),
style: option.style,
title: option.title,
id: option.id,
required: option.required
}, option.label)) : children;
const memoizedContext = import_react.useMemo(() => ({
toggleOption,
value,
disabled: restProps.disabled,
name: restProps.name,
registerValue,
cancelValue
}), [
toggleOption,
value,
restProps.disabled,
restProps.name,
registerValue,
cancelValue
]);
const classString = clsx(groupPrefixCls, { [`${groupPrefixCls}-rtl`]: direction === "rtl" }, className, rootClassName, cssVarCls, rootCls, hashId);
return /* @__PURE__ */ import_react.createElement("div", {
className: classString,
style,
role,
...domProps,
ref
}, /* @__PURE__ */ import_react.createElement(GroupContext$1.Provider, { value: memoizedContext }, childrenNode));
});
//#endregion
//#region node_modules/antd/es/checkbox/index.js
var Checkbox = Checkbox$1;
Checkbox.Group = CheckboxGroup;
Checkbox.__ANT_CHECKBOX = true;
Checkbox.displayName = "Checkbox";
//#endregion
//#region node_modules/antd/es/grid/RowContext.js
var RowContext = /* @__PURE__ */ (0, import_react.createContext)({});
//#endregion
//#region node_modules/antd/es/grid/col.js
function parseFlex(flex) {
if (flex === "auto") return "1 1 auto";
if (isNumber(flex)) return `${flex} ${flex} auto`;
if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) return `0 0 ${flex}`;
return flex;
}
var Col = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const { gutter, wrap } = import_react.useContext(RowContext);
const { prefixCls: customizePrefixCls, span, order, offset, push, pull, className, children, flex, style, ...others } = props;
const prefixCls = getPrefixCls("col", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const [hashId, cssVarCls] = useColStyle(prefixCls);
const [varName] = genCssVar(rootPrefixCls, "col");
const sizeStyle = {};
let sizeClassObj = {};
responsiveArrayReversed.forEach((size) => {
let sizeProps = {};
const propSize = props[size];
if (isNumber(propSize)) sizeProps.span = propSize;
else if (isPlainObject(propSize)) sizeProps = propSize || {};
delete others[size];
sizeClassObj = {
...sizeClassObj,
[`${prefixCls}-${size}-${sizeProps.span}`]: isNonNullable(sizeProps.span),
[`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,
[`${prefixCls}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0,
[`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,
[`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
[`${prefixCls}-rtl`]: direction === "rtl"
};
if (sizeProps.flex) {
sizeClassObj[`${prefixCls}-${size}-flex`] = true;
sizeStyle[varName(`${size}-flex`)] = parseFlex(sizeProps.flex);
}
});
const classes = clsx(prefixCls, {
[`${prefixCls}-${span}`]: span !== void 0,
[`${prefixCls}-order-${order}`]: order,
[`${prefixCls}-offset-${offset}`]: offset,
[`${prefixCls}-push-${push}`]: push,
[`${prefixCls}-pull-${pull}`]: pull
}, className, sizeClassObj, hashId, cssVarCls);
const mergedStyle = {};
if (gutter?.[0]) mergedStyle.paddingInline = isNumber(gutter[0]) ? `${gutter[0] / 2}px` : `calc(${gutter[0]} / 2)`;
if (flex) {
mergedStyle.flex = parseFlex(flex);
if (wrap === false && !mergedStyle.minWidth) mergedStyle.minWidth = 0;
}
return /* @__PURE__ */ import_react.createElement("div", {
...others,
style: {
...mergedStyle,
...style,
...sizeStyle
},
className: classes,
ref
}, children);
});
Col.displayName = "Col";
//#endregion
//#region node_modules/antd/es/grid/hooks/useGutter.js
function useGutter(gutter, screens) {
const results = [void 0, void 0];
const normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, void 0];
const mergedScreens = screens || {
xs: true,
sm: true,
md: true,
lg: true,
xl: true,
xxl: true,
xxxl: true
};
normalizedGutter.forEach((g, index) => {
if (isPlainObject(g)) for (let i = 0; i < responsiveArray.length; i++) {
const breakpoint = responsiveArray[i];
if (mergedScreens[breakpoint] && g[breakpoint] !== void 0) {
results[index] = g[breakpoint];
break;
}
}
else results[index] = g;
});
return results;
}
//#endregion
//#region node_modules/antd/es/grid/row.js
var useMergedPropByScreen = (oriProp, screen) => {
const [prop, setProp] = import_react.useState(() => isString(oriProp) ? oriProp : "");
const calcMergedAlignOrJustify = () => {
if (isString(oriProp)) setProp(oriProp);
if (!isPlainObject(oriProp)) return;
for (let i = 0; i < responsiveArray.length; i++) {
const breakpoint = responsiveArray[i];
if (!screen || !screen[breakpoint]) continue;
const curVal = oriProp[breakpoint];
if (curVal !== void 0) {
setProp(curVal);
return;
}
}
};
import_react.useEffect(() => {
calcMergedAlignOrJustify();
}, [JSON.stringify(oriProp), screen]);
return prop;
};
var Row$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, justify, align, className, style, children, gutter = 0, wrap, ...others } = props;
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const screens = useBreakpoint$1(true, null);
const mergedAlign = useMergedPropByScreen(align, screens);
const mergedJustify = useMergedPropByScreen(justify, screens);
const prefixCls = getPrefixCls("row", customizePrefixCls);
const [hashId, cssVarCls] = useRowStyle(prefixCls);
const gutters = useGutter(gutter, screens);
const classes = clsx(prefixCls, {
[`${prefixCls}-no-wrap`]: wrap === false,
[`${prefixCls}-${mergedJustify}`]: mergedJustify,
[`${prefixCls}-${mergedAlign}`]: mergedAlign,
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, hashId, cssVarCls);
const rowStyle = {};
if (gutters?.[0]) rowStyle.marginInline = isNumber(gutters[0]) ? `${gutters[0] / -2}px` : `calc(${gutters[0]} / -2)`;
const [gutterH, gutterV] = gutters;
rowStyle.rowGap = gutterV;
const rowContext = import_react.useMemo(() => ({
gutter: [gutterH, gutterV],
wrap
}), [
gutterH,
gutterV,
wrap
]);
return /* @__PURE__ */ import_react.createElement(RowContext.Provider, { value: rowContext }, /* @__PURE__ */ import_react.createElement("div", {
...others,
className: classes,
style: {
...rowStyle,
...style
},
ref
}, children));
});
Row$1.displayName = "Row";
//#endregion
//#region node_modules/antd/es/grid/index.js
function useBreakpoint() {
return useBreakpoint$1();
}
var grid_default = { useBreakpoint };
//#endregion
//#region node_modules/antd/es/col/index.js
var col_default = Col;
//#endregion
//#region node_modules/antd/es/divider/style/index.js
var genSizeDividerStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: { "&-horizontal": { [`&${componentCls}`]: {
"&-sm": { marginBlock: token.marginXS },
"&-md": { marginBlock: token.margin }
} } } };
};
var genSharedDividerStyle = (token) => {
const { componentCls, sizePaddingEdgeHorizontal, colorSplit, lineWidth, textPaddingInline, orientationMargin, verticalMarginInline } = token;
const railCls = `${componentCls}-rail`;
return { [componentCls]: {
...resetComponent(token),
borderBlockStart: `${unit$1(lineWidth)} solid ${colorSplit}`,
[railCls]: { borderBlockStart: `${unit$1(lineWidth)} solid ${colorSplit}` },
"&-vertical": {
position: "relative",
top: "-0.06em",
display: "inline-block",
height: "0.9em",
marginInline: verticalMarginInline,
marginBlock: 0,
verticalAlign: "middle",
borderTop: 0,
borderInlineStart: `${unit$1(lineWidth)} solid ${colorSplit}`
},
"&-horizontal": {
display: "flex",
clear: "both",
width: "100%",
minWidth: "100%",
margin: `${unit$1(token.marginLG)} 0`
},
[`&-horizontal${componentCls}-with-text`]: {
display: "flex",
alignItems: "center",
margin: `${unit$1(token.dividerHorizontalWithTextGutterMargin)} 0`,
color: token.colorTextHeading,
fontWeight: 500,
fontSize: token.fontSizeLG,
whiteSpace: "nowrap",
textAlign: "center",
borderBlockStart: `0 ${colorSplit}`,
[`${railCls}-start, ${railCls}-end`]: {
width: "50%",
borderBlockStartColor: "inherit",
borderBlockEnd: 0,
content: "''"
}
},
[`&-horizontal${componentCls}-with-text-start`]: {
[`${railCls}-start`]: { width: `calc(${orientationMargin} * 100%)` },
[`${railCls}-end`]: { width: `calc(100% - ${orientationMargin} * 100%)` }
},
[`&-horizontal${componentCls}-with-text-end`]: {
[`${railCls}-start`]: { width: `calc(100% - ${orientationMargin} * 100%)` },
[`${railCls}-end`]: { width: `calc(${orientationMargin} * 100%)` }
},
[`${componentCls}-inner-text`]: {
display: "inline-block",
paddingBlock: 0,
paddingInline: textPaddingInline
},
"&-dashed": {
background: "none",
borderColor: colorSplit,
borderStyle: "dashed",
borderWidth: `${unit$1(lineWidth)} 0 0`,
[railCls]: { borderBlockStart: `${unit$1(lineWidth)} dashed ${colorSplit}` }
},
[`&-horizontal${componentCls}-with-text${componentCls}-dashed`]: { [`${railCls}-start, ${railCls}-end`]: { borderStyle: "dashed none none" } },
[`&-vertical${componentCls}-dashed`]: {
borderInlineStartWidth: lineWidth,
borderInlineEnd: 0,
borderBlockStart: 0,
borderBlockEnd: 0
},
"&-dotted": {
background: "none",
borderColor: colorSplit,
borderStyle: "dotted",
borderWidth: `${unit$1(lineWidth)} 0 0`,
[railCls]: { borderBlockStart: `${unit$1(lineWidth)} dotted ${colorSplit}` }
},
[`&-horizontal${componentCls}-with-text${componentCls}-dotted`]: { "&::before, &::after": { borderStyle: "dotted none none" } },
[`&-vertical${componentCls}-dotted`]: {
borderInlineStartWidth: lineWidth,
borderInlineEnd: 0,
borderBlockStart: 0,
borderBlockEnd: 0
},
[`&-plain${componentCls}-with-text`]: {
color: token.colorText,
fontWeight: "normal",
fontSize: token.fontSize
},
[`&-horizontal${componentCls}-with-text-start${componentCls}-no-default-orientation-margin-start`]: {
[`${railCls}-start`]: { width: 0 },
[`${railCls}-end`]: { width: "100%" },
[`${componentCls}-inner-text`]: { paddingInlineStart: sizePaddingEdgeHorizontal }
},
[`&-horizontal${componentCls}-with-text-end${componentCls}-no-default-orientation-margin-end`]: {
[`${railCls}-start`]: { width: "100%" },
[`${railCls}-end`]: { width: 0 },
[`${componentCls}-inner-text`]: { paddingInlineEnd: sizePaddingEdgeHorizontal }
}
} };
};
var prepareComponentToken$30 = (token) => ({
textPaddingInline: "1em",
orientationMargin: .05,
verticalMarginInline: token.marginXS
});
var style_default$33 = genStyleHooks("Divider", (token) => {
const dividerToken = merge(token, {
dividerHorizontalWithTextGutterMargin: token.margin,
sizePaddingEdgeHorizontal: 0
});
return [genSharedDividerStyle(dividerToken), genSizeDividerStyle(dividerToken)];
}, prepareComponentToken$30, { unitless: { orientationMargin: true } });
//#endregion
//#region node_modules/antd/es/divider/index.js
var titlePlacementList = [
"left",
"right",
"center",
"start",
"end"
];
var Divider = (props) => {
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("divider");
const { prefixCls: customizePrefixCls, type, orientation, vertical, titlePlacement, orientationMargin, className, rootClassName, children, dashed, variant = "solid", plain, style, size: customSize, classNames, styles, ...restProps } = props;
const prefixCls = getPrefixCls("divider", customizePrefixCls);
const railCls = `${prefixCls}-rail`;
const [hashId, cssVarCls] = style_default$33(prefixCls);
const sizeFullName = useSize(customSize);
const hasChildren = !!children;
const validTitlePlacement = titlePlacementList.includes(orientation || "");
const mergedTitlePlacement = import_react.useMemo(() => {
const placement = titlePlacement ?? (validTitlePlacement ? orientation : "center");
if (placement === "left") return direction === "rtl" ? "end" : "start";
if (placement === "right") return direction === "rtl" ? "start" : "end";
return placement;
}, [
direction,
orientation,
titlePlacement,
validTitlePlacement
]);
const hasMarginStart = mergedTitlePlacement === "start" && orientationMargin != null;
const hasMarginEnd = mergedTitlePlacement === "end" && orientationMargin != null;
const [mergedOrientation, mergedVertical] = useOrientation(orientation, vertical, type);
const mergedProps = {
...props,
orientation: mergedOrientation,
titlePlacement: mergedTitlePlacement,
size: sizeFullName
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const classString = clsx(prefixCls, contextClassName, hashId, cssVarCls, `${prefixCls}-${mergedOrientation}`, {
[`${prefixCls}-with-text`]: hasChildren,
[`${prefixCls}-with-text-${mergedTitlePlacement}`]: hasChildren,
[`${prefixCls}-dashed`]: !!dashed,
[`${prefixCls}-${variant}`]: variant !== "solid",
[`${prefixCls}-plain`]: !!plain,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-no-default-orientation-margin-start`]: hasMarginStart,
[`${prefixCls}-no-default-orientation-margin-end`]: hasMarginEnd,
[`${prefixCls}-md`]: sizeFullName === "medium" || sizeFullName === "middle",
[`${prefixCls}-sm`]: sizeFullName === "small",
[railCls]: !children,
[mergedClassNames.rail]: mergedClassNames.rail && !children
}, className, rootClassName, mergedClassNames.root);
const memoizedPlacementMargin = import_react.useMemo(() => {
if (isNumber(orientationMargin)) return orientationMargin;
if (/^\d+$/.test(orientationMargin)) return Number(orientationMargin);
return orientationMargin;
}, [orientationMargin]);
const innerStyle = {
marginInlineStart: hasMarginStart ? memoizedPlacementMargin : void 0,
marginInlineEnd: hasMarginEnd ? memoizedPlacementMargin : void 0
};
{
const warning = devUseWarning("Divider");
warning(!children || !mergedVertical, "usage", "`children` not working in `vertical` mode.");
warning(!validTitlePlacement, "usage", "`orientation` is used for direction, please use `titlePlacement` replace this");
[["type", "orientation"], ["orientationMargin", "styles.content.margin"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
return /* @__PURE__ */ import_react.createElement("div", {
className: classString,
style: {
...contextStyle,
...mergedStyles.root,
...children ? {} : mergedStyles.rail,
...style
},
...restProps,
role: "separator"
}, children && !mergedVertical && /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(railCls, `${railCls}-start`, mergedClassNames.rail),
style: mergedStyles.rail
}), /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-inner-text`, mergedClassNames.content),
style: {
...innerStyle,
...mergedStyles.content
}
}, children), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(railCls, `${railCls}-end`, mergedClassNames.rail),
style: mergedStyles.rail
})));
};
Divider.displayName = "Divider";
//#endregion
//#region node_modules/@rc-component/segmented/es/MotionThumb.js
var calcThumbStyle = (targetElement, vertical) => {
if (!targetElement) return null;
const style = {
left: targetElement.offsetLeft,
right: targetElement.parentElement.clientWidth - targetElement.clientWidth - targetElement.offsetLeft,
width: targetElement.clientWidth,
top: targetElement.offsetTop,
bottom: targetElement.parentElement.clientHeight - targetElement.clientHeight - targetElement.offsetTop,
height: targetElement.clientHeight
};
if (vertical) return {
left: 0,
right: 0,
width: 0,
top: style.top,
bottom: style.bottom,
height: style.height
};
return {
left: style.left,
right: style.right,
width: style.width,
top: 0,
bottom: 0,
height: 0
};
};
var toPX = (value) => value !== void 0 ? `${value}px` : void 0;
function MotionThumb(props) {
const { prefixCls, containerRef, value, getValueIndex, motionName, onMotionStart, onMotionEnd, direction, vertical = false } = props;
const thumbRef = import_react.useRef(null);
const [prevValue, setPrevValue] = import_react.useState(value);
const findValueElement = (val) => {
const index = getValueIndex(val);
const ele = containerRef.current?.querySelectorAll(`.${prefixCls}-item`)[index];
return ele?.offsetParent && ele;
};
const [prevStyle, setPrevStyle] = import_react.useState(null);
const [nextStyle, setNextStyle] = import_react.useState(null);
useLayoutEffect$1(() => {
if (prevValue !== value) {
const prev = findValueElement(prevValue);
const next = findValueElement(value);
const calcPrevStyle = calcThumbStyle(prev, vertical);
const calcNextStyle = calcThumbStyle(next, vertical);
setPrevValue(value);
setPrevStyle(calcPrevStyle);
setNextStyle(calcNextStyle);
if (prev && next) onMotionStart();
else onMotionEnd();
}
}, [value]);
const thumbStart = import_react.useMemo(() => {
if (vertical) return toPX(prevStyle?.top ?? 0);
if (direction === "rtl") return toPX(-prevStyle?.right);
return toPX(prevStyle?.left);
}, [
vertical,
direction,
prevStyle
]);
const thumbActive = import_react.useMemo(() => {
if (vertical) return toPX(nextStyle?.top ?? 0);
if (direction === "rtl") return toPX(-nextStyle?.right);
return toPX(nextStyle?.left);
}, [
vertical,
direction,
nextStyle
]);
const onAppearStart = () => {
if (vertical) return {
transform: "translateY(var(--thumb-start-top))",
height: "var(--thumb-start-height)"
};
return {
transform: "translateX(var(--thumb-start-left))",
width: "var(--thumb-start-width)"
};
};
const onAppearActive = () => {
if (vertical) return {
transform: "translateY(var(--thumb-active-top))",
height: "var(--thumb-active-height)"
};
return {
transform: "translateX(var(--thumb-active-left))",
width: "var(--thumb-active-width)"
};
};
const onVisibleChanged = () => {
setPrevStyle(null);
setNextStyle(null);
onMotionEnd();
};
if (!prevStyle || !nextStyle) return null;
return /* @__PURE__ */ import_react.createElement(es_default$28, {
visible: true,
motionName,
motionAppear: true,
onAppearStart,
onAppearActive,
onVisibleChanged
}, ({ className: motionClassName, style: motionStyle }, ref) => {
const mergedStyle = {
...motionStyle,
"--thumb-start-left": thumbStart,
"--thumb-start-width": toPX(prevStyle?.width),
"--thumb-active-left": thumbActive,
"--thumb-active-width": toPX(nextStyle?.width),
"--thumb-start-top": thumbStart,
"--thumb-start-height": toPX(prevStyle?.height),
"--thumb-active-top": thumbActive,
"--thumb-active-height": toPX(nextStyle?.height)
};
const motionProps = {
ref: composeRef(thumbRef, ref),
style: mergedStyle,
className: clsx(`${prefixCls}-thumb`, motionClassName)
};
return /* @__PURE__ */ import_react.createElement("div", motionProps);
});
}
//#endregion
//#region node_modules/@rc-component/segmented/es/index.js
function getValidTitle(option) {
if (typeof option.title !== "undefined") return option.title;
if (typeof option.label !== "object") return option.label?.toString();
}
function normalizeOptions(options) {
return options.map((option) => {
if (typeof option === "object" && option !== null) {
const validTitle = getValidTitle(option);
return {
...option,
title: validTitle
};
}
return {
label: option?.toString(),
title: option?.toString(),
value: option
};
});
}
var InternalSegmentedOption = ({ prefixCls, className, style, styles, classNames: segmentedClassNames, data, disabled, checked, label, title, value, name, onChange, onFocus, onBlur, onKeyDown, onKeyUp, onMouseDown, itemRender = (node) => node }) => {
const handleChange = (event) => {
if (disabled) return;
onChange(event, value);
};
return itemRender(/* @__PURE__ */ import_react.createElement("label", {
className: clsx(className, { [`${prefixCls}-item-disabled`]: disabled }),
style,
onMouseDown
}, /* @__PURE__ */ import_react.createElement("input", {
name,
className: `${prefixCls}-item-input`,
type: "radio",
disabled,
checked,
onChange: handleChange,
onFocus,
onBlur,
onKeyDown,
onKeyUp
}), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-item-label`, segmentedClassNames?.label),
title,
style: styles?.label
}, label)), { item: data });
};
var Segmented$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls = "rc-segmented", direction, vertical, options = [], disabled, defaultValue, value, name, onChange, className = "", style, styles, classNames: segmentedClassNames, motionName = "thumb-motion", itemRender, ...restProps } = props;
const containerRef = import_react.useRef(null);
const mergedRef = import_react.useMemo(() => composeRef(containerRef, ref), [containerRef, ref]);
const segmentedOptions = import_react.useMemo(() => {
return normalizeOptions(options);
}, [options]);
const [rawValue, setRawValue] = useControlledState(defaultValue ?? segmentedOptions[0]?.value, value);
const [thumbShow, setThumbShow] = import_react.useState(false);
const handleChange = (event, val) => {
setRawValue(val);
onChange?.(val);
};
const divProps = omit(restProps, ["children"]);
const [isKeyboard, setIsKeyboard] = import_react.useState(false);
const [isFocused, setIsFocused] = import_react.useState(false);
const handleFocus = () => {
setIsFocused(true);
};
const handleBlur = () => {
setIsFocused(false);
};
const handleMouseDown = () => {
setIsKeyboard(false);
};
const handleKeyUp = (event) => {
if (event.key === "Tab") setIsKeyboard(true);
};
const onOffset = (offset) => {
const currentIndex = segmentedOptions.findIndex((option) => option.value === rawValue);
const total = segmentedOptions.length;
const nextOption = segmentedOptions[(currentIndex + offset + total) % total];
if (nextOption) {
setRawValue(nextOption.value);
onChange?.(nextOption.value);
}
};
const handleKeyDown = (event) => {
switch (event.key) {
case "ArrowLeft":
case "ArrowUp":
onOffset(-1);
break;
case "ArrowRight":
case "ArrowDown":
onOffset(1);
break;
}
};
const renderOption = (segmentedOption) => {
const { value: optionValue, disabled: optionDisabled } = segmentedOption;
return /* @__PURE__ */ import_react.createElement(InternalSegmentedOption, _extends$91({}, segmentedOption, {
name,
data: segmentedOption,
itemRender,
key: optionValue,
prefixCls,
className: clsx(segmentedOption.className, `${prefixCls}-item`, segmentedClassNames?.item, {
[`${prefixCls}-item-selected`]: optionValue === rawValue && !thumbShow,
[`${prefixCls}-item-focused`]: isFocused && isKeyboard && optionValue === rawValue
}),
style: styles?.item,
classNames: segmentedClassNames,
styles,
checked: optionValue === rawValue,
onChange: handleChange,
onFocus: handleFocus,
onBlur: handleBlur,
onKeyDown: handleKeyDown,
onKeyUp: handleKeyUp,
onMouseDown: handleMouseDown,
disabled: !!disabled || !!optionDisabled
}));
};
return /* @__PURE__ */ import_react.createElement("div", _extends$91({
role: "radiogroup",
"aria-label": "segmented control",
tabIndex: disabled ? void 0 : 0,
"aria-orientation": vertical ? "vertical" : "horizontal",
style
}, divProps, {
className: clsx(prefixCls, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-vertical`]: vertical
}, className),
ref: mergedRef
}), /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-group` }, /* @__PURE__ */ import_react.createElement(MotionThumb, {
vertical,
prefixCls,
value: rawValue,
containerRef,
motionName: `${prefixCls}-${motionName}`,
direction,
getValueIndex: (val) => segmentedOptions.findIndex((n) => n.value === val),
onMotionStart: () => {
setThumbShow(true);
},
onMotionEnd: () => {
setThumbShow(false);
}
}), segmentedOptions.map(renderOption)));
});
Segmented$1.displayName = "Segmented";
var TypedSegmented = Segmented$1;
//#endregion
//#region node_modules/antd/es/segmented/style/index.js
function getItemDisabledStyle(cls, token) {
return { [`${cls}, ${cls}:hover, ${cls}:focus`]: {
color: token.colorTextDisabled,
cursor: "not-allowed"
} };
}
var getItemSelectedStyle = (token) => {
return {
background: token.itemSelectedBg,
boxShadow: token.boxShadowTertiary
};
};
var segmentedTextEllipsisCss = {
overflow: "hidden",
...textEllipsis
};
var genSegmentedStyle = (token) => {
const { componentCls, motionDurationSlow, motionEaseInOut, motionDurationMid } = token;
const labelHeight = token.calc(token.controlHeight).sub(token.calc(token.trackPadding).mul(2)).equal();
const labelHeightLG = token.calc(token.controlHeightLG).sub(token.calc(token.trackPadding).mul(2)).equal();
const labelHeightSM = token.calc(token.controlHeightSM).sub(token.calc(token.trackPadding).mul(2)).equal();
return { [componentCls]: {
...resetComponent(token),
display: "inline-block",
padding: token.trackPadding,
color: token.itemColor,
background: token.trackBg,
borderRadius: token.borderRadius,
transition: `all ${motionDurationMid}`,
...genFocusStyle(token),
[`${componentCls}-group`]: {
position: "relative",
display: "flex",
alignItems: "stretch",
justifyItems: "flex-start",
flexDirection: "row",
width: "100%"
},
[`&${componentCls}-rtl`]: { direction: "rtl" },
[`&${componentCls}-vertical`]: {
[`${componentCls}-group`]: { flexDirection: "column" },
[`${componentCls}-thumb`]: {
width: "100%",
height: 0,
padding: `0 ${unit$1(token.paddingXXS)}`
}
},
[`&${componentCls}-block`]: { display: "flex" },
[`&${componentCls}-block ${componentCls}-item`]: {
flex: 1,
minWidth: 0
},
[`${componentCls}-item`]: {
position: "relative",
textAlign: "center",
cursor: "pointer",
transition: `color ${motionDurationMid}`,
borderRadius: token.borderRadiusSM,
transform: "translateZ(0)",
"&-selected": {
...getItemSelectedStyle(token),
color: token.itemSelectedColor
},
"&-focused": genFocusOutline(token),
"&::after": {
content: "\"\"",
position: "absolute",
zIndex: -1,
width: "100%",
height: "100%",
top: 0,
insetInlineStart: 0,
borderRadius: "inherit",
opacity: 0,
pointerEvents: "none",
transition: ["opacity", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", ")
},
[`&:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)`]: {
"&:hover, &:active": { color: token.itemHoverColor },
"&:hover::after": {
opacity: 1,
backgroundColor: token.itemHoverBg
},
"&:active::after": {
opacity: 1,
backgroundColor: token.itemActiveBg
}
},
"&-label": {
minHeight: labelHeight,
lineHeight: unit$1(labelHeight),
padding: `0 ${unit$1(token.segmentedPaddingHorizontal)}`,
...segmentedTextEllipsisCss
},
"&-icon + *": { marginInlineStart: token.calc(token.marginSM).div(2).equal() },
"&-input": {
position: "absolute",
insetBlockStart: 0,
insetInlineStart: 0,
width: 0,
height: 0,
opacity: 0,
pointerEvents: "none"
}
},
[`${componentCls}-thumb`]: {
...getItemSelectedStyle(token),
position: "absolute",
insetBlockStart: 0,
insetInlineStart: 0,
width: 0,
height: "100%",
padding: `${unit$1(token.paddingXXS)} 0`,
borderRadius: token.borderRadiusSM,
[`& ~ ${componentCls}-item:not(${componentCls}-item-selected):not(${componentCls}-item-disabled)::after`]: { backgroundColor: "transparent" }
},
[`&${componentCls}-lg`]: {
borderRadius: token.borderRadiusLG,
[`${componentCls}-item-label`]: {
minHeight: labelHeightLG,
lineHeight: unit$1(labelHeightLG),
padding: `0 ${unit$1(token.segmentedPaddingHorizontal)}`,
fontSize: token.fontSizeLG
},
[`${componentCls}-item, ${componentCls}-thumb`]: { borderRadius: token.borderRadius }
},
[`&${componentCls}-sm`]: {
borderRadius: token.borderRadiusSM,
[`${componentCls}-item-label`]: {
minHeight: labelHeightSM,
lineHeight: unit$1(labelHeightSM),
padding: `0 ${unit$1(token.segmentedPaddingHorizontalSM)}`
},
[`${componentCls}-item, ${componentCls}-thumb`]: { borderRadius: token.borderRadiusXS }
},
...getItemDisabledStyle(`&-disabled ${componentCls}-item`, token),
...getItemDisabledStyle(`${componentCls}-item-disabled`, token),
[`${componentCls}-thumb-motion-appear-active`]: {
willChange: "transform, width",
transition: [`transform`, `width`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(", ")
},
[`&${componentCls}-shape-round`]: {
borderRadius: 9999,
[`${componentCls}-item, ${componentCls}-thumb`]: { borderRadius: 9999 }
}
} };
};
var prepareComponentToken$29 = (token) => {
const { colorTextLabel, colorText, colorFillSecondary, colorBgElevated, colorFill, lineWidthBold, colorBgLayout } = token;
return {
trackPadding: lineWidthBold,
trackBg: colorBgLayout,
itemColor: colorTextLabel,
itemHoverColor: colorText,
itemHoverBg: colorFillSecondary,
itemSelectedBg: colorBgElevated,
itemActiveBg: colorFill,
itemSelectedColor: colorText
};
};
var style_default$32 = genStyleHooks("Segmented", (token) => {
const { lineWidth, calc } = token;
return genSegmentedStyle(merge(token, {
segmentedPaddingHorizontal: calc(token.controlPaddingHorizontal).sub(lineWidth).equal(),
segmentedPaddingHorizontalSM: calc(token.controlPaddingHorizontalSM).sub(lineWidth).equal()
}));
}, prepareComponentToken$29);
//#endregion
//#region node_modules/antd/es/segmented/index.js
function isSegmentedLabeledOptionWithIcon(option) {
return isPlainObject(option) && !!option?.icon;
}
var Segmented = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const defaultName = useId_default();
const { prefixCls: customizePrefixCls, className, rootClassName, block, options = [], size: customSize, style, vertical, orientation, shape = "default", name = defaultName, styles, classNames, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("segmented");
const mergedProps = {
...props,
options,
size: customSize,
shape
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const prefixCls = getPrefixCls("segmented", customizePrefixCls);
const [hashId, cssVarCls] = style_default$32(prefixCls);
const mergedSize = useSize(customSize);
const extendedOptions = import_react.useMemo(() => options.map((option) => {
if (isSegmentedLabeledOptionWithIcon(option)) {
const { icon, label, ...restOption } = option;
return {
...restOption,
label: /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-item-icon`, mergedClassNames.icon),
style: mergedStyles.icon
}, icon), label && /* @__PURE__ */ import_react.createElement("span", null, label))
};
}
return option;
}), [
options,
prefixCls,
mergedClassNames.icon,
mergedStyles.icon
]);
const [, mergedVertical] = useOrientation(orientation, vertical);
const cls = clsx(className, rootClassName, contextClassName, mergedClassNames.root, {
[`${prefixCls}-block`]: block,
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-vertical`]: mergedVertical,
[`${prefixCls}-shape-${shape}`]: shape === "round"
}, hashId, cssVarCls);
const mergedStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
const itemRender = (node, { item }) => {
if (!item.tooltip) return node;
const tooltipProps = isPlainObject(item.tooltip) ? item.tooltip : { title: item.tooltip };
return /* @__PURE__ */ import_react.createElement(Tooltip, { ...tooltipProps }, node);
};
return /* @__PURE__ */ import_react.createElement(TypedSegmented, {
...restProps,
name,
className: cls,
style: mergedStyle,
classNames: mergedClassNames,
styles: mergedStyles,
itemRender,
options: extendedOptions,
ref,
prefixCls,
direction,
vertical: mergedVertical
});
});
Segmented.displayName = "Segmented";
//#endregion
//#region node_modules/antd/es/color-picker/context.js
var PanelPickerContext = /* @__PURE__ */ import_react.createContext({});
var PanelPresetsContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorClear.js
var ColorClear = ({ prefixCls, value, onChange, className, style }) => {
const onClick = () => {
if (onChange && value && !value.cleared) {
const hsba = value.toHsb();
hsba.a = 0;
const genColor = generateColor(hsba);
genColor.cleared = true;
onChange(genColor);
}
};
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-clear`, className),
style,
onClick
});
};
//#endregion
//#region node_modules/@rc-component/mini-decimal/es/supportUtil.js
function supportBigInt() {
return typeof BigInt === "function";
}
//#endregion
//#region node_modules/@rc-component/mini-decimal/es/numberUtil.js
function isEmpty(value) {
return !value && value !== 0 && !Number.isNaN(value) || !String(value).trim();
}
/**
* Format string number to readable number
*/
function trimNumber(numStr) {
var str = numStr.trim();
var negative = str.startsWith("-");
if (negative) str = str.slice(1);
str = str.replace(/(\.\d*[^0])0*$/, "$1").replace(/\.0*$/, "").replace(/^0+/, "");
if (str.startsWith(".")) str = "0".concat(str);
var trimStr = str || "0";
var splitNumber = trimStr.split(".");
var integerStr = splitNumber[0] || "0";
var decimalStr = splitNumber[1] || "0";
if (integerStr === "0" && decimalStr === "0") negative = false;
var negativeStr = negative ? "-" : "";
return {
negative,
negativeStr,
trimStr,
integerStr,
decimalStr,
fullStr: "".concat(negativeStr).concat(trimStr)
};
}
function isE(number) {
var str = String(number);
return !Number.isNaN(Number(str)) && str.includes("e");
}
/**
* Parse a scientific-notation string into reusable parts.
*
* The idea is to split the value into mantissa and exponent first, then
* normalize the mantissa into sign, integer/decimal segments, and a compact
* digit sequence so later logic can move the decimal point without re-parsing.
*/
function parseScientificNotation(numStr) {
var _numStr$toLowerCase$s2 = _slicedToArray$31(numStr.toLowerCase().split("e"), 2), mantissa = _numStr$toLowerCase$s2[0], _numStr$toLowerCase$s3 = _numStr$toLowerCase$s2[1], exponent = _numStr$toLowerCase$s3 === void 0 ? "0" : _numStr$toLowerCase$s3;
var negative = mantissa.startsWith("-");
var _unsignedMantissa$spl2 = _slicedToArray$31((negative ? mantissa.slice(1) : mantissa).split("."), 2), _unsignedMantissa$spl3 = _unsignedMantissa$spl2[0], integer = _unsignedMantissa$spl3 === void 0 ? "0" : _unsignedMantissa$spl3, _unsignedMantissa$spl4 = _unsignedMantissa$spl2[1], decimal = _unsignedMantissa$spl4 === void 0 ? "" : _unsignedMantissa$spl4;
return {
decimal,
digits: "".concat(integer).concat(decimal).replace(/^0+/, "") || "0",
exponent: Number(exponent),
integer,
negative
};
}
/**
* Expand parsed scientific notation into a plain decimal string.
*
* The core idea is to calculate where the decimal point lands after applying
* the exponent, then rebuild the string by either padding zeros or inserting
* the decimal point inside the normalized digit sequence.
*/
function expandScientificNotation(parsed) {
var decimal = parsed.decimal, digits = parsed.digits, exponent = parsed.exponent, integer = parsed.integer, negative = parsed.negative;
if (digits === "0") return "0";
var integerDigits = integer.replace(/^0+/, "").length;
var leadingDecimalZeros = (decimal.match(/^0*/) || [""])[0].length;
var decimalIndex = (integerDigits || -leadingDecimalZeros) + exponent;
var expanded = "";
if (decimalIndex <= 0) expanded = "0.".concat("0".repeat(-decimalIndex)).concat(digits);
else if (decimalIndex >= digits.length) expanded = "".concat(digits).concat("0".repeat(decimalIndex - digits.length));
else expanded = "".concat(digits.slice(0, decimalIndex), ".").concat(digits.slice(decimalIndex));
return "".concat(negative ? "-" : "").concat(expanded);
}
function getScientificPrecision(parsed) {
if (parsed.exponent >= 0) return Math.max(0, parsed.decimal.length - parsed.exponent);
return Math.abs(parsed.exponent) + parsed.decimal.length;
}
/**
* [Legacy] Convert 1e-9 to 0.000000001.
* This may lose some precision if user really want 1e-9.
*/
function getNumberPrecision(number) {
var numStr = String(number);
if (isE(number)) return getScientificPrecision(parseScientificNotation(numStr));
return numStr.includes(".") && validateNumber(numStr) ? numStr.length - numStr.indexOf(".") - 1 : 0;
}
/**
* Convert number (includes scientific notation) to -xxx.yyy format
*/
function num2str(number) {
var numStr = String(number);
if (isE(number)) {
if (number > Number.MAX_SAFE_INTEGER) return String(supportBigInt() ? BigInt(number).toString() : Number.MAX_SAFE_INTEGER);
if (number < Number.MIN_SAFE_INTEGER) return String(supportBigInt() ? BigInt(number).toString() : Number.MIN_SAFE_INTEGER);
var parsed = parseScientificNotation(numStr);
var precision = getScientificPrecision(parsed);
numStr = precision > 100 ? expandScientificNotation(parsed) : number.toFixed(precision);
}
return trimNumber(numStr).fullStr;
}
function validateNumber(num) {
if (typeof num === "number") return !Number.isNaN(num);
if (!num) return false;
return /^\s*-?\d+(\.\d+)?\s*$/.test(num) || /^\s*-?\d+\.\s*$/.test(num) || /^\s*-?\.\d+\s*$/.test(num);
}
//#endregion
//#region node_modules/@rc-component/mini-decimal/es/BigIntDecimal.js
var BigIntDecimal = /* @__PURE__ */ function() {
function BigIntDecimal(value) {
_classCallCheck$1(this, BigIntDecimal);
_defineProperty$28(this, "origin", "");
_defineProperty$28(this, "negative", void 0);
_defineProperty$28(this, "integer", void 0);
_defineProperty$28(this, "decimal", void 0);
/** BigInt will convert `0009` to `9`. We need record the len of decimal */
_defineProperty$28(this, "decimalLen", void 0);
_defineProperty$28(this, "empty", void 0);
_defineProperty$28(this, "nan", void 0);
if (isEmpty(value)) {
this.empty = true;
return;
}
this.origin = String(value);
if (value === "-" || Number.isNaN(value)) {
this.nan = true;
return;
}
var mergedValue = value;
if (isE(mergedValue)) mergedValue = Number(mergedValue);
mergedValue = typeof mergedValue === "string" ? mergedValue : num2str(mergedValue);
if (validateNumber(mergedValue)) {
var trimRet = trimNumber(mergedValue);
this.negative = trimRet.negative;
var numbers = trimRet.trimStr.split(".");
this.integer = BigInt(numbers[0]);
var decimalStr = numbers[1] || "0";
this.decimal = BigInt(decimalStr);
this.decimalLen = decimalStr.length;
} else this.nan = true;
}
_createClass$1(BigIntDecimal, [
{
key: "getMark",
value: function getMark() {
return this.negative ? "-" : "";
}
},
{
key: "getIntegerStr",
value: function getIntegerStr() {
return this.integer.toString();
}
},
{
key: "getDecimalStr",
value: function getDecimalStr() {
return this.decimal.toString().padStart(this.decimalLen, "0");
}
},
{
key: "alignDecimal",
value: function alignDecimal(decimalLength) {
var str = "".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(decimalLength, "0"));
return BigInt(str);
}
},
{
key: "negate",
value: function negate() {
var clone = new BigIntDecimal(this.toString());
clone.negative = !clone.negative;
return clone;
}
},
{
key: "cal",
value: function cal(offset, calculator, calDecimalLen) {
var maxDecimalLength = Math.max(this.getDecimalStr().length, offset.getDecimalStr().length);
var valueStr = calculator(this.alignDecimal(maxDecimalLength), offset.alignDecimal(maxDecimalLength)).toString();
var nextDecimalLength = calDecimalLen(maxDecimalLength);
var _trimNumber = trimNumber(valueStr), negativeStr = _trimNumber.negativeStr, trimStr = _trimNumber.trimStr;
var hydrateValueStr = "".concat(negativeStr).concat(trimStr.padStart(nextDecimalLength + 1, "0"));
return new BigIntDecimal("".concat(hydrateValueStr.slice(0, -nextDecimalLength), ".").concat(hydrateValueStr.slice(-nextDecimalLength)));
}
},
{
key: "add",
value: function add(value) {
if (this.isInvalidate()) return new BigIntDecimal(value);
var offset = new BigIntDecimal(value);
if (offset.isInvalidate()) return this;
return this.cal(offset, function(num1, num2) {
return num1 + num2;
}, function(len) {
return len;
});
}
},
{
key: "multi",
value: function multi(value) {
var target = new BigIntDecimal(value);
if (this.isInvalidate() || target.isInvalidate()) return new BigIntDecimal(NaN);
return this.cal(target, function(num1, num2) {
return num1 * num2;
}, function(len) {
return len * 2;
});
}
},
{
key: "isEmpty",
value: function isEmpty() {
return this.empty;
}
},
{
key: "isNaN",
value: function isNaN() {
return this.nan;
}
},
{
key: "isInvalidate",
value: function isInvalidate() {
return this.isEmpty() || this.isNaN();
}
},
{
key: "equals",
value: function equals(target) {
return this.toString() === (target === null || target === void 0 ? void 0 : target.toString());
}
},
{
key: "lessEquals",
value: function lessEquals(target) {
return this.add(target.negate().toString()).toNumber() <= 0;
}
},
{
key: "toNumber",
value: function toNumber() {
if (this.isNaN()) return NaN;
return Number(this.toString());
}
},
{
key: "toString",
value: function toString() {
if (!(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true)) return this.origin;
if (this.isInvalidate()) return "";
return trimNumber("".concat(this.getMark()).concat(this.getIntegerStr(), ".").concat(this.getDecimalStr())).fullStr;
}
}
]);
return BigIntDecimal;
}();
//#endregion
//#region node_modules/@rc-component/mini-decimal/es/NumberDecimal.js
/**
* We can remove this when IE not support anymore
*/
var NumberDecimal = /* @__PURE__ */ function() {
function NumberDecimal(value) {
_classCallCheck$1(this, NumberDecimal);
_defineProperty$28(this, "origin", "");
_defineProperty$28(this, "number", void 0);
_defineProperty$28(this, "empty", void 0);
if (isEmpty(value)) {
this.empty = true;
return;
}
this.origin = String(value);
this.number = Number(value);
}
_createClass$1(NumberDecimal, [
{
key: "negate",
value: function negate() {
return new NumberDecimal(-this.toNumber());
}
},
{
key: "add",
value: function add(value) {
if (this.isInvalidate()) return new NumberDecimal(value);
var target = Number(value);
if (Number.isNaN(target)) return this;
var number = this.number + target;
if (number > Number.MAX_SAFE_INTEGER) return new NumberDecimal(Number.MAX_SAFE_INTEGER);
if (number < Number.MIN_SAFE_INTEGER) return new NumberDecimal(Number.MIN_SAFE_INTEGER);
var maxPrecision = Math.max(getNumberPrecision(this.number), getNumberPrecision(target));
return new NumberDecimal(number.toFixed(maxPrecision));
}
},
{
key: "multi",
value: function multi(value) {
var target = Number(value);
if (this.isInvalidate() || Number.isNaN(target)) return new NumberDecimal(NaN);
var number = this.number * target;
if (number > Number.MAX_SAFE_INTEGER) return new NumberDecimal(Number.MAX_SAFE_INTEGER);
if (number < Number.MIN_SAFE_INTEGER) return new NumberDecimal(Number.MIN_SAFE_INTEGER);
var maxPrecision = Math.max(getNumberPrecision(this.number), getNumberPrecision(target));
return new NumberDecimal(number.toFixed(maxPrecision));
}
},
{
key: "isEmpty",
value: function isEmpty() {
return this.empty;
}
},
{
key: "isNaN",
value: function isNaN() {
return Number.isNaN(this.number);
}
},
{
key: "isInvalidate",
value: function isInvalidate() {
return this.isEmpty() || this.isNaN();
}
},
{
key: "equals",
value: function equals(target) {
return this.toNumber() === (target === null || target === void 0 ? void 0 : target.toNumber());
}
},
{
key: "lessEquals",
value: function lessEquals(target) {
return this.add(target.negate().toString()).toNumber() <= 0;
}
},
{
key: "toNumber",
value: function toNumber() {
return this.number;
}
},
{
key: "toString",
value: function toString() {
if (!(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true)) return this.origin;
if (this.isInvalidate()) return "";
if (isE(this.number) && getNumberPrecision(this.number) > 100) return String(this.number);
return num2str(this.number);
}
}
]);
return NumberDecimal;
}();
//#endregion
//#region node_modules/@rc-component/mini-decimal/es/MiniDecimal.js
function getMiniDecimal(value) {
if (supportBigInt()) return new BigIntDecimal(value);
return new NumberDecimal(value);
}
/**
* Align the logic of toFixed to around like 1.5 => 2.
* If set `cutOnly`, will just remove the over decimal part.
*/
function toFixed(numStr, separatorStr, precision) {
var cutOnly = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
if (numStr === "") return "";
var _trimNumber = trimNumber(numStr), negativeStr = _trimNumber.negativeStr, integerStr = _trimNumber.integerStr, decimalStr = _trimNumber.decimalStr;
var precisionDecimalStr = "".concat(separatorStr).concat(decimalStr);
var numberWithoutDecimal = "".concat(negativeStr).concat(integerStr);
if (precision >= 0) {
var advancedNum = Number(decimalStr[precision]);
if (advancedNum >= 5 && !cutOnly) return toFixed(getMiniDecimal(numStr).add("".concat(negativeStr, "0.").concat("0".repeat(precision)).concat(10 - advancedNum)).toString(), separatorStr, precision, cutOnly);
if (precision === 0) return numberWithoutDecimal;
return "".concat(numberWithoutDecimal).concat(separatorStr).concat(decimalStr.padEnd(precision, "0").slice(0, precision));
}
if (precisionDecimalStr === ".0") return numberWithoutDecimal;
return "".concat(numberWithoutDecimal).concat(precisionDecimalStr);
}
//#endregion
//#region node_modules/@rc-component/mini-decimal/es/index.js
var es_default$13 = getMiniDecimal;
//#endregion
//#region node_modules/@rc-component/util/es/proxyObject.js
/**
* Proxy object if environment supported
*/
function proxyObject(obj, extendProps) {
if (typeof Proxy !== "undefined" && obj) return new Proxy(obj, { get(target, prop) {
if (extendProps[prop]) return extendProps[prop];
const originProp = target[prop];
return typeof originProp === "function" ? originProp.bind(target) : originProp;
} });
return obj;
}
//#endregion
//#region node_modules/@rc-component/input-number/es/hooks/useCursor.js
/**
* Keep input cursor in the correct position if possible.
* Is this necessary since we have `formatter` which may mass the content?
*/
function useCursor(input, focused) {
const selectionRef = (0, import_react.useRef)(null);
function recordCursor() {
try {
const { selectionStart: start, selectionEnd: end, value } = input;
selectionRef.current = {
start,
end,
value,
beforeTxt: value.substring(0, start),
afterTxt: value.substring(end)
};
} catch (e) {}
}
/**
* Restore logic:
* 1. back string same
* 2. start string same
*/
function restoreCursor() {
if (input && selectionRef.current && focused) try {
const { value } = input;
const { beforeTxt, afterTxt, start } = selectionRef.current;
let startPos = value.length;
if (value.startsWith(beforeTxt)) startPos = beforeTxt.length;
else if (value.endsWith(afterTxt)) startPos = value.length - selectionRef.current.afterTxt.length;
else {
const beforeLastChar = beforeTxt[start - 1];
const newIndex = value.indexOf(beforeLastChar, start - 1);
if (newIndex !== -1) startPos = newIndex + 1;
}
input.setSelectionRange(startPos, startPos);
} catch (e) {
warningOnce(false, `Something warning of cursor restore. Please fire issue about this: ${e.message}`);
}
}
return [recordCursor, restoreCursor];
}
//#endregion
//#region node_modules/@rc-component/input-number/es/StepHandler.js
/**
* When click and hold on a button - the speed of auto changing the value.
*/
var STEP_INTERVAL = 200;
/**
* When click and hold on a button - the delay before auto changing the value.
*/
var STEP_DELAY = 600;
function StepHandler({ prefixCls, action, children, disabled, className, style, onStep }) {
const isUpAction = action === "up";
const stepTimeoutRef = import_react.useRef();
const frameIds = import_react.useRef([]);
const onStopStep = () => {
clearTimeout(stepTimeoutRef.current);
};
const onStepMouseDown = (e) => {
e.preventDefault();
onStopStep();
onStep(isUpAction, "handler");
function loopStep() {
onStep(isUpAction, "handler");
stepTimeoutRef.current = setTimeout(loopStep, STEP_INTERVAL);
}
stepTimeoutRef.current = setTimeout(loopStep, STEP_DELAY);
};
import_react.useEffect(() => () => {
onStopStep();
frameIds.current.forEach((id) => {
wrapperRaf.cancel(id);
});
}, []);
const actionClassName = `${prefixCls}-action`;
const mergedClassName = clsx(actionClassName, `${actionClassName}-${action}`, { [`${actionClassName}-${action}-disabled`]: disabled }, className);
const safeOnStopStep = () => frameIds.current.push(wrapperRaf(onStopStep));
return /* @__PURE__ */ import_react.createElement("span", {
unselectable: "on",
role: "button",
onMouseUp: safeOnStopStep,
onMouseLeave: safeOnStopStep,
onMouseDown: (e) => {
onStepMouseDown(e);
},
"aria-label": isUpAction ? "Increase Value" : "Decrease Value",
"aria-disabled": disabled,
className: mergedClassName,
style
}, children || /* @__PURE__ */ import_react.createElement("span", {
unselectable: "on",
className: `${prefixCls}-action-${action}-inner`
}));
}
//#endregion
//#region node_modules/@rc-component/input-number/es/utils/numberUtil.js
function getDecupleSteps(step) {
const stepStr = typeof step === "number" ? num2str(step) : trimNumber(step).fullStr;
if (!stepStr.includes(".")) return step + "0";
return trimNumber(stepStr.replace(/(\d)\.(\d)/g, "$1$2.")).fullStr;
}
//#endregion
//#region node_modules/@rc-component/input-number/es/hooks/useFrame.js
/**
* Always trigger latest once when call multiple time
*/
var useFrame_default = (() => {
const idRef = (0, import_react.useRef)(0);
const cleanUp = () => {
wrapperRaf.cancel(idRef.current);
};
(0, import_react.useEffect)(() => cleanUp, []);
return (callback) => {
cleanUp();
idRef.current = wrapperRaf(() => {
callback();
});
};
});
//#endregion
//#region node_modules/@rc-component/input-number/es/InputNumber.js
function _extends$41() {
_extends$41 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$41.apply(this, arguments);
}
/**
* We support `stringMode` which need handle correct type when user call in onChange
* format max or min value
* 1. if isInvalid return null
* 2. if precision is undefined, return decimal
* 3. format with precision
* I. if max > 0, round down with precision. Example: max= 3.5, precision=0 afterFormat: 3
* II. if max < 0, round up with precision. Example: max= -3.5, precision=0 afterFormat: -4
* III. if min > 0, round up with precision. Example: min= 3.5, precision=0 afterFormat: 4
* IV. if min < 0, round down with precision. Example: max= -3.5, precision=0 afterFormat: -3
*/
var getDecimalValue = (stringMode, decimalValue) => {
if (stringMode || decimalValue.isEmpty()) return decimalValue.toString();
return decimalValue.toNumber();
};
var getDecimalIfValidate = (value) => {
const decimal = es_default$13(value);
return decimal.isInvalidate() ? null : decimal;
};
var InputNumber$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { mode = "input", prefixCls = "rc-input-number", className, style, classNames, styles, min, max, step = 1, defaultValue, value, disabled, readOnly, upHandler, downHandler, keyboard, changeOnWheel = false, controls = true, prefix, suffix, stringMode, parser, formatter, precision, decimalSeparator, onChange, onInput, onPressEnter, onStep, onMouseDown, onClick, onMouseUp, onMouseLeave, onMouseMove, onMouseEnter, onMouseOut, changeOnBlur = true, ...restProps } = props;
const [focus, setFocus] = import_react.useState(false);
const userTypingRef = import_react.useRef(false);
const compositionRef = import_react.useRef(false);
const shiftKeyRef = import_react.useRef(false);
const rootRef = import_react.useRef(null);
const inputRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => proxyObject(inputRef.current, {
focus: (option) => {
triggerFocus(inputRef.current, option);
},
blur: () => {
inputRef.current?.blur();
},
nativeElement: rootRef.current
}));
const [decimalValue, setDecimalValue] = import_react.useState(() => es_default$13(value ?? defaultValue));
function setUncontrolledDecimalValue(newDecimal) {
if (value === void 0) setDecimalValue(newDecimal);
}
/**
* `precision` is used for formatter & onChange.
* It will auto generate by `value` & `step`.
* But it will not block user typing.
*
* Note: Auto generate `precision` is used for legacy logic.
* We should remove this since we already support high precision with BigInt.
*
* @param number Provide which number should calculate precision
* @param userTyping Change by user typing
*/
const getPrecision = import_react.useCallback((numStr, userTyping) => {
if (userTyping) return;
if (precision >= 0) return precision;
return Math.max(getNumberPrecision(numStr), getNumberPrecision(step));
}, [precision, step]);
const mergedParser = import_react.useCallback((num) => {
const numStr = String(num);
if (parser) return parser(numStr);
let parsedStr = numStr;
if (decimalSeparator) parsedStr = parsedStr.replace(decimalSeparator, ".");
return parsedStr.replace(/[^\w.-]+/g, "");
}, [parser, decimalSeparator]);
const inputValueRef = import_react.useRef("");
const mergedFormatter = import_react.useCallback((number, userTyping) => {
if (formatter) return formatter(number, {
userTyping,
input: String(inputValueRef.current)
});
let str = typeof number === "number" ? num2str(number) : number;
if (!userTyping) {
const mergedPrecision = getPrecision(str, userTyping);
if (validateNumber(str) && (decimalSeparator || mergedPrecision >= 0)) str = toFixed(str, decimalSeparator || ".", mergedPrecision);
}
return str;
}, [
formatter,
getPrecision,
decimalSeparator
]);
/**
* Input text value control
*
* User can not update input content directly. It updates with follow rules by priority:
* 1. controlled `value` changed
* * [SPECIAL] Typing like `1.` should not immediately convert to `1`
* 2. User typing with format (not precision)
* 3. Blur or Enter trigger revalidate
*/
const [inputValue, setInternalInputValue] = import_react.useState(() => {
const initValue = defaultValue ?? value;
if (decimalValue.isInvalidate() && ["string", "number"].includes(typeof initValue)) return Number.isNaN(initValue) ? "" : initValue;
return mergedFormatter(decimalValue.toString(), false);
});
inputValueRef.current = inputValue;
function setInputValue(newValue, userTyping) {
setInternalInputValue(mergedFormatter(newValue.isInvalidate() ? newValue.toString(false) : newValue.toString(!userTyping), userTyping));
}
const maxDecimal = import_react.useMemo(() => getDecimalIfValidate(max), [max, precision]);
const minDecimal = import_react.useMemo(() => getDecimalIfValidate(min), [min, precision]);
const upDisabled = import_react.useMemo(() => {
if (!maxDecimal || !decimalValue || decimalValue.isInvalidate()) return false;
return maxDecimal.lessEquals(decimalValue);
}, [maxDecimal, decimalValue]);
const downDisabled = import_react.useMemo(() => {
if (!minDecimal || !decimalValue || decimalValue.isInvalidate()) return false;
return decimalValue.lessEquals(minDecimal);
}, [minDecimal, decimalValue]);
const [recordCursor, restoreCursor] = useCursor(inputRef.current, focus);
/**
* Find target value closet within range.
* e.g. [11, 28]:
* 3 => 11
* 23 => 23
* 99 => 28
*/
const getRangeValue = (target) => {
if (maxDecimal && !target.lessEquals(maxDecimal)) return maxDecimal;
if (minDecimal && !minDecimal.lessEquals(target)) return minDecimal;
return null;
};
/**
* Check value is in [min, max] range
*/
const isInRange = (target) => !getRangeValue(target);
/**
* Trigger `onChange` if value validated and not equals of origin.
* Return the value that re-align in range.
*/
const triggerValueUpdate = (newValue, userTyping) => {
let updateValue = newValue;
let isRangeValidate = isInRange(updateValue) || updateValue.isEmpty();
if (!updateValue.isEmpty() && !userTyping) {
updateValue = getRangeValue(updateValue) || updateValue;
isRangeValidate = true;
}
if (!readOnly && !disabled && isRangeValidate) {
const numStr = updateValue.toString();
const mergedPrecision = getPrecision(numStr, userTyping);
if (mergedPrecision >= 0) {
updateValue = es_default$13(toFixed(numStr, ".", mergedPrecision));
if (!isInRange(updateValue)) updateValue = es_default$13(toFixed(numStr, ".", mergedPrecision, true));
}
if (!updateValue.equals(decimalValue)) {
setUncontrolledDecimalValue(updateValue);
onChange?.(updateValue.isEmpty() ? null : getDecimalValue(stringMode, updateValue));
if (value === void 0) setInputValue(updateValue, userTyping);
}
return updateValue;
}
return decimalValue;
};
const onNextPromise = useFrame_default();
const collectInputValue = (inputStr) => {
recordCursor();
inputValueRef.current = inputStr;
setInternalInputValue(inputStr);
if (!compositionRef.current) {
const finalDecimal = es_default$13(mergedParser(inputStr));
if (!finalDecimal.isNaN()) triggerValueUpdate(finalDecimal, true);
}
onInput?.(inputStr);
onNextPromise(() => {
let nextInputStr = inputStr;
if (!parser) nextInputStr = inputStr.replace(/。/g, ".");
if (nextInputStr !== inputStr) collectInputValue(nextInputStr);
});
};
const onCompositionStart = () => {
compositionRef.current = true;
};
const onCompositionEnd = () => {
compositionRef.current = false;
collectInputValue(inputRef.current.value);
};
const onInternalInput = (e) => {
collectInputValue(e.target.value);
};
const onInternalStep = useEvent((up, emitter) => {
if (up && upDisabled || !up && downDisabled) return;
userTypingRef.current = false;
let stepDecimal = es_default$13(shiftKeyRef.current ? getDecupleSteps(step) : step);
if (!up) stepDecimal = stepDecimal.negate();
const updatedValue = triggerValueUpdate((decimalValue || es_default$13(0)).add(stepDecimal.toString()), false);
onStep?.(getDecimalValue(stringMode, updatedValue), {
offset: shiftKeyRef.current ? getDecupleSteps(step) : step,
type: up ? "up" : "down",
emitter
});
inputRef.current?.focus();
});
/**
* Flush current input content to trigger value change & re-formatter input if needed.
* This will always flush input value for update.
* If it's invalidate, will fallback to last validate value.
*/
const flushInputValue = (userTyping) => {
const parsedValue = es_default$13(mergedParser(inputValue));
let formatValue;
if (!parsedValue.isNaN()) formatValue = triggerValueUpdate(parsedValue, userTyping);
else formatValue = triggerValueUpdate(decimalValue, userTyping);
if (value !== void 0) setInputValue(decimalValue, false);
else if (!formatValue.isNaN()) setInputValue(formatValue, false);
};
const onBeforeInput = () => {
userTypingRef.current = true;
};
const onKeyDown = (event) => {
const { key, shiftKey } = event;
userTypingRef.current = true;
shiftKeyRef.current = shiftKey;
if (key === "Enter") {
if (!compositionRef.current) userTypingRef.current = false;
flushInputValue(false);
onPressEnter?.(event);
}
if (keyboard === false) return;
if (!compositionRef.current && [
"Up",
"ArrowUp",
"Down",
"ArrowDown"
].includes(key)) {
onInternalStep(key === "Up" || key === "ArrowUp", "keyboard");
event.preventDefault();
}
};
const onKeyUp = () => {
userTypingRef.current = false;
shiftKeyRef.current = false;
};
import_react.useEffect(() => {
if (changeOnWheel && focus) {
const onWheel = (event) => {
onInternalStep(event.deltaY < 0, "wheel");
event.preventDefault();
};
const input = inputRef.current;
if (input) {
input.addEventListener("wheel", onWheel, { passive: false });
return () => input.removeEventListener("wheel", onWheel);
}
}
});
const onBlur = () => {
if (changeOnBlur) flushInputValue(false);
setFocus(false);
userTypingRef.current = false;
};
const onInternalMouseDown = (event) => {
if (inputRef.current && event.target !== inputRef.current) {
inputRef.current.focus();
event.preventDefault();
}
onMouseDown?.(event);
};
useLayoutUpdateEffect(() => {
if (!decimalValue.isInvalidate()) setInputValue(decimalValue, false);
}, [precision, formatter]);
useLayoutUpdateEffect(() => {
const newValue = es_default$13(value);
setDecimalValue(newValue);
const currentParsedValue = es_default$13(mergedParser(inputValue));
if (!newValue.equals(currentParsedValue) || !userTypingRef.current || formatter) setInputValue(newValue, userTypingRef.current);
}, [value]);
useLayoutUpdateEffect(() => {
if (formatter) restoreCursor();
}, [inputValue]);
const sharedHandlerProps = {
prefixCls,
onStep: onInternalStep,
className: classNames?.action,
style: styles?.action
};
const upNode = /* @__PURE__ */ import_react.createElement(StepHandler, _extends$41({}, sharedHandlerProps, {
action: "up",
disabled: upDisabled
}), upHandler);
const downNode = /* @__PURE__ */ import_react.createElement(StepHandler, _extends$41({}, sharedHandlerProps, {
action: "down",
disabled: downDisabled
}), downHandler);
return /* @__PURE__ */ import_react.createElement("div", {
ref: rootRef,
className: clsx(prefixCls, `${prefixCls}-mode-${mode}`, className, classNames?.root, {
[`${prefixCls}-focused`]: focus,
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-readonly`]: readOnly,
[`${prefixCls}-not-a-number`]: decimalValue.isNaN(),
[`${prefixCls}-out-of-range`]: !decimalValue.isInvalidate() && !isInRange(decimalValue)
}),
style: {
...styles?.root,
...style
},
onMouseDown: onInternalMouseDown,
onMouseUp,
onMouseLeave,
onMouseMove,
onMouseEnter,
onMouseOut,
onClick,
onFocus: () => {
setFocus(true);
},
onBlur,
onKeyDown,
onKeyUp,
onCompositionStart,
onCompositionEnd,
onBeforeInput
}, mode === "spinner" && controls && downNode, prefix !== void 0 && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-prefix`, classNames?.prefix),
style: styles?.prefix
}, prefix), /* @__PURE__ */ import_react.createElement("input", _extends$41({
autoComplete: "off",
role: "spinbutton",
"aria-valuemin": min,
"aria-valuemax": max,
"aria-valuenow": decimalValue.isInvalidate() ? null : decimalValue.toString(),
step,
ref: inputRef,
className: clsx(`${prefixCls}-input`, classNames?.input),
style: styles?.input,
value: inputValue,
onChange: onInternalInput,
disabled,
readOnly
}, restProps)), suffix !== void 0 && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-suffix`, classNames?.suffix),
style: styles?.suffix
}, suffix), mode === "spinner" && controls && upNode, mode === "input" && controls && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-actions`, classNames?.actions),
style: styles?.actions
}, upNode, downNode));
});
InputNumber$1.displayName = "InputNumber";
//#endregion
//#region node_modules/@rc-component/input-number/es/index.js
var es_default$12 = InputNumber$1;
//#endregion
//#region node_modules/antd/es/space/style/addon.js
var genSpaceAddonStyle = (token) => {
const { componentCls, borderRadius, paddingSM, colorBorder, paddingXS, fontSizeLG, fontSizeSM, borderRadiusLG, borderRadiusSM, colorBgContainerDisabled, lineWidth, antCls } = token;
const [varName, varRef] = genCssVar(antCls, "space");
return { [componentCls]: [
{
display: "inline-flex",
alignItems: "center",
gap: 0,
whiteSpace: "nowrap",
paddingInline: paddingSM,
margin: 0,
borderWidth: lineWidth,
borderStyle: "solid",
borderRadius,
"&:hover": { zIndex: 0 },
[`&${componentCls}-disabled`]: { color: token.colorTextDisabled },
"&-large": {
fontSize: fontSizeLG,
borderRadius: borderRadiusLG
},
"&-small": {
paddingInline: paddingXS,
borderRadius: borderRadiusSM,
fontSize: fontSizeSM
},
"&-compact-last-item": {
borderEndStartRadius: 0,
borderStartStartRadius: 0
},
"&-compact-first-item": {
borderEndEndRadius: 0,
borderStartEndRadius: 0
},
"&-compact-item:not(:first-child):not(:last-child)": { borderRadius: 0 },
"&-compact-item:not(:last-child)": { borderInlineEndWidth: 0 },
"&-compact-item:not(:first-child)": { borderInlineStartWidth: 0 }
},
{
[varName("addon-border-color")]: colorBorder,
[varName("addon-background")]: colorBgContainerDisabled,
[varName("addon-border-color-outlined")]: colorBorder,
[varName("addon-background-filled")]: colorBgContainerDisabled,
borderColor: varRef("addon-border-color"),
background: varRef("addon-background"),
"&-variant-outlined": { [varName("addon-border-color")]: varRef("addon-border-color-outlined") },
"&-variant-filled": {
[varName("addon-border-color")]: "transparent",
[varName("addon-background")]: varRef("addon-background-filled"),
[`&${componentCls}-disabled`]: {
[varName("addon-border-color")]: colorBorder,
[varName("addon-background")]: colorBgContainerDisabled
}
},
"&-variant-borderless": {
border: "none",
background: "transparent"
},
"&-variant-underlined": {
border: "none",
background: "transparent"
}
},
{
"&-status-error": {
[varName("addon-border-color-outlined")]: token.colorError,
[varName("addon-background-filled")]: token.colorErrorBg,
color: token.colorError
},
"&-status-warning": {
[varName("addon-border-color-outlined")]: token.colorWarning,
[varName("addon-background-filled")]: token.colorWarningBg,
color: token.colorWarning
}
}
] };
};
var addon_default = genStyleHooks(["Space", "Addon"], (token) => [genSpaceAddonStyle(token), genCompactItemStyle(token, { focus: false })]);
//#endregion
//#region node_modules/antd/es/space/Addon.js
var SpaceAddon = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { className, children, style, prefixCls: customizePrefixCls, variant = "outlined", disabled, status, ...restProps } = props;
const { getPrefixCls, direction: directionConfig } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("space-addon", customizePrefixCls);
const [hashId, cssVarCls] = addon_default(prefixCls);
const { compactItemClassnames, compactSize } = useCompactItemContext(prefixCls, directionConfig);
const statusCls = getStatusClassNames(prefixCls, status);
const classes = clsx(prefixCls, hashId, compactItemClassnames, cssVarCls, `${prefixCls}-variant-${variant}`, statusCls, {
[`${prefixCls}-${compactSize}`]: compactSize,
[`${prefixCls}-disabled`]: disabled
}, className);
return /* @__PURE__ */ import_react.createElement("div", {
ref,
className: classes,
style,
...restProps
}, children);
});
//#endregion
//#region node_modules/antd/es/input-number/style/token.js
var prepareComponentToken$28 = (token) => {
const handleVisible = token.handleVisible ?? "auto";
const handleWidth = token.controlHeightSM - token.lineWidth * 2;
return {
...initComponentToken$1(token),
controlWidth: 90,
handleWidth,
handleFontSize: token.fontSize / 2,
handleVisible,
handleActiveBg: token.colorFillAlter,
handleBg: token.colorBgContainer,
filledHandleBg: new FastColor(token.colorFillSecondary).onBackground(token.colorBgContainer).toHexString(),
handleHoverColor: token.colorPrimary,
handleBorderColor: token.colorBorder,
handleOpacity: handleVisible === true ? 1 : 0,
handleVisibleWidth: handleVisible === true ? handleWidth : 0
};
};
//#endregion
//#region node_modules/antd/es/input-number/style/index.js
var genInputNumberStyles = (token) => {
const { componentCls, lineWidth, lineType, borderRadius, inputFontSizeSM, inputFontSizeLG, colorError, paddingInlineSM, paddingBlockSM, paddingBlockLG, paddingInlineLG, colorIcon, colorTextDisabled, motionDurationMid, handleHoverColor, handleOpacity, paddingInline, paddingBlock, handleBg, handleActiveBg, inputAffixPadding, borderRadiusSM, controlWidth, handleBorderColor, filledHandleBg, lineHeightLG, antCls } = token;
const borderStyle = `${unit$1(lineWidth)} ${lineType} ${handleBorderColor}`;
const [varName, varRef] = genCssVar(antCls, "input-number");
return [
{ [componentCls]: {
...resetComponent(token),
...genBasicInputStyle(token),
[varName("input-padding-block")]: unit$1(paddingBlock),
[varName("input-padding-inline")]: unit$1(paddingInline),
display: "inline-flex",
width: controlWidth,
margin: 0,
paddingBlock: 0,
borderRadius,
...genOutlinedStyle(token, { [`${componentCls}-actions`]: {
background: handleBg,
[`${componentCls}-action-down`]: { borderBlockStart: borderStyle }
} }),
...genFilledStyle(token, {
[`${componentCls}-actions`]: {
background: filledHandleBg,
[`${componentCls}-action-down`]: { borderBlockStart: borderStyle }
},
"&:focus-within": { [`${componentCls}-actions`]: { background: handleBg } }
}),
...genUnderlinedStyle(token, { [`${componentCls}-actions`]: {
background: handleBg,
[`${componentCls}-action-down`]: { borderBlockStart: borderStyle }
} }),
...genBorderlessStyle(token),
[`&${componentCls}-borderless`]: {
paddingBlock: 0,
[varName("input-padding-block")]: unit$1(token.calc(paddingBlock).add(lineWidth).equal())
},
[`&${componentCls}-borderless${componentCls}-sm`]: {
paddingBlock: 0,
[varName("input-padding-block")]: unit$1(token.calc(paddingBlockSM).add(lineWidth).equal())
},
[`&${componentCls}-borderless${componentCls}-lg`]: {
paddingBlock: 0,
[varName("input-padding-block")]: unit$1(token.calc(paddingBlockLG).add(lineWidth).equal())
},
"&-rtl": {
direction: "rtl",
[`${componentCls}-input`]: { direction: "rtl" }
},
[`&${componentCls}-out-of-range`]: { [`${componentCls}-input`]: { color: colorError } },
[`${componentCls}-input`]: {
...resetComponent(token),
width: "100%",
paddingBlock: varRef("input-padding-block"),
textAlign: "start",
backgroundColor: "transparent",
border: 0,
borderRadius: 0,
outline: 0,
transition: `all ${motionDurationMid} linear`,
appearance: "textfield",
fontSize: "inherit",
lineHeight: "inherit",
...genPlaceholderStyle(token.colorTextPlaceholder),
"&[type=\"number\"]::-webkit-inner-spin-button, &[type=\"number\"]::-webkit-outer-spin-button": {
margin: 0,
appearance: "none"
}
},
[`&:hover ${componentCls}-handler-wrap, &-focused ${componentCls}-handler-wrap`]: {
width: token.handleWidth,
opacity: 1
},
[`&-disabled ${componentCls}-input`]: {
cursor: "not-allowed",
color: token.colorTextDisabled
}
} },
{ [componentCls]: {
[`${componentCls}-action`]: {
...resetIcon(),
userSelect: "none",
overflow: "hidden",
fontWeight: "bold",
lineHeight: 0,
textAlign: "center",
cursor: "pointer",
transition: `all ${motionDurationMid} linear`,
[`&:active:not(${componentCls}-action-up-disabled):not(${componentCls}-action-down-disabled)`]: { background: handleActiveBg },
[`&:hover:not(${componentCls}-action-up-disabled):not(${componentCls}-action-down-disabled)`]: { color: handleHoverColor },
[`&${componentCls}-action-up-disabled, &${componentCls}-action-down-disabled`]: {
cursor: "not-allowed",
color: colorTextDisabled
}
},
"&-mode-input": {
overflow: "hidden",
[`${componentCls}-actions`]: {
position: "absolute",
insetBlockStart: 0,
insetInlineEnd: 0,
width: token.handleVisibleWidth,
opacity: handleOpacity,
height: "100%",
borderRadius: 0,
display: "flex",
flexDirection: "column",
alignItems: "stretch",
transition: `all ${motionDurationMid}`,
overflow: "hidden",
[`${componentCls}-action`]: {
display: "flex",
alignItems: "center",
justifyContent: "center",
flex: "auto",
height: "40%",
marginInlineEnd: 0,
fontSize: token.handleFontSize
}
},
[`&:hover ${componentCls}-actions, &-focused ${componentCls}-actions`]: {
width: token.handleWidth,
opacity: 1
},
[`${componentCls}-action`]: {
color: colorIcon,
height: "50%",
borderInlineStart: borderStyle,
[`&:hover:not(${componentCls}-action-up-disabled):not(${componentCls}-action-down-disabled)`]: { height: `60%` }
},
[`&${componentCls}-disabled, &${componentCls}-readonly`]: { [`${componentCls}-actions`]: { display: "none" } }
},
[`&${componentCls}-mode-spinner`]: {
padding: 0,
width: "auto",
[`${componentCls}-action`]: {
flex: "none",
paddingInline: varRef("input-padding-inline"),
"&-up": { borderInlineStart: borderStyle },
"&-down": { borderInlineEnd: borderStyle }
},
[`${componentCls}-input`]: {
textAlign: "center",
paddingInline: varRef("input-padding-inline")
}
}
} },
{ [componentCls]: {
"&-lg": {
[varName("input-padding-block")]: unit$1(paddingBlockLG),
[varName("input-padding-inline")]: unit$1(paddingInlineLG),
paddingBlock: 0,
fontSize: inputFontSizeLG,
lineHeight: lineHeightLG
},
"&-sm": {
[varName("input-padding-block")]: unit$1(paddingBlockSM),
[varName("input-padding-inline")]: unit$1(paddingInlineSM),
paddingBlock: 0,
fontSize: inputFontSizeSM,
borderRadius: borderRadiusSM
}
} },
{ [componentCls]: {
[`${componentCls}-prefix, ${componentCls}-suffix`]: {
display: "flex",
flex: "none",
alignItems: "center",
alignSelf: "center",
pointerEvents: "none"
},
[`${componentCls}-prefix`]: { marginInlineEnd: inputAffixPadding },
[`${componentCls}-suffix`]: {
height: "100%",
marginInlineStart: inputAffixPadding,
transition: `margin ${motionDurationMid}`
},
[`&:hover:not(${componentCls}-without-controls)`]: { [`${componentCls}-suffix`]: { marginInlineEnd: token.handleWidth } }
} }
];
};
var genCompatibleStyles = (token) => {
const { componentCls, antCls } = token;
return { [`${componentCls}-addon`]: { [`&:has(${antCls}-select)`]: {
border: 0,
padding: 0
} } };
};
var style_default$31 = genStyleHooks("InputNumber", (token) => {
const inputNumberToken = merge(token, initInputToken(token));
return [
genInputNumberStyles(inputNumberToken),
genCompatibleStyles(inputNumberToken),
genCompactItemStyle(inputNumberToken)
];
}, prepareComponentToken$28, {
unitless: { handleOpacity: true },
resetFont: false
});
//#endregion
//#region node_modules/antd/es/input-number/index.js
var InternalInputNumber = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const inputRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => inputRef.current);
const { rootClassName, size: customizeSize, disabled: customDisabled, prefixCls, addonBefore: _addonBefore, addonAfter: _addonAfter, prefix, suffix, bordered, readOnly, status, controls = true, variant: customVariant, className, style, classNames, styles, mode, ...others } = props;
const { direction, className: contextClassName, style: contextStyle, styles: contextStyles, classNames: contextClassNames } = useComponentConfig("inputNumber");
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const mergedControls = import_react.useMemo(() => {
if (!controls || mergedDisabled || readOnly) return false;
return controls;
}, [
controls,
mergedDisabled,
readOnly
]);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
let upIcon = mode === "spinner" ? /* @__PURE__ */ import_react.createElement(RefIcon$14, null) : /* @__PURE__ */ import_react.createElement(RefIcon$15, null);
let downIcon = mode === "spinner" ? /* @__PURE__ */ import_react.createElement(RefIcon$16, null) : /* @__PURE__ */ import_react.createElement(RefIcon$8, null);
const controlsTemp = typeof mergedControls === "boolean" ? mergedControls : void 0;
if (isPlainObject(mergedControls)) {
upIcon = mergedControls.upIcon || upIcon;
downIcon = mergedControls.downIcon || downIcon;
}
const { hasFeedback, isFormItemInput, feedbackIcon } = import_react.useContext(FormItemInputContext);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const [variant, enableVariantCls] = useVariant("inputNumber", customVariant, bordered);
const suffixNode = hasFeedback && /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, feedbackIcon);
const mergedProps = {
...props,
size: mergedSize,
disabled: mergedDisabled,
controls: mergedControls
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
return /* @__PURE__ */ import_react.createElement(es_default$12, {
ref: inputRef,
mode,
disabled: mergedDisabled,
className: clsx(className, rootClassName, mergedClassNames.root, contextClassName, compactItemClassnames, getStatusClassNames(prefixCls, status, hasFeedback), {
[`${prefixCls}-${variant}`]: enableVariantCls,
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-in-form-item`]: isFormItemInput,
[`${prefixCls}-without-controls`]: !mergedControls
}),
style: {
...mergedStyles.root,
...contextStyle,
...style
},
upHandler: upIcon,
downHandler: downIcon,
prefixCls,
readOnly,
controls: controlsTemp,
prefix,
suffix: suffixNode || suffix,
classNames: mergedClassNames,
styles: mergedStyles,
...others
});
});
var InputNumber = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { addonBefore, addonAfter, prefixCls: customizePrefixCls, className, status: customStatus, rootClassName, ...rest } = props;
const { getPrefixCls } = useComponentConfig("inputNumber");
const prefixCls = getPrefixCls("input-number", customizePrefixCls);
const { status: contextStatus } = import_react.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$31(prefixCls, rootCls);
const hasLegacyAddon = addonBefore || addonAfter;
{
const typeWarning = devUseWarning("InputNumber");
[
["bordered", "variant"],
["addonAfter", "Space.Compact"],
["addonBefore", "Space.Compact"]
].forEach(([prop, newProp]) => {
typeWarning.deprecated(!(prop in props), prop, newProp);
});
typeWarning(!(props.type === "number" && props.changeOnWheel), "usage", "When `type=number` is used together with `changeOnWheel`, changeOnWheel may not work properly. Please delete `type=number` if it is not necessary.");
}
const inputNumberNode = /* @__PURE__ */ import_react.createElement(InternalInputNumber, {
ref,
...rest,
prefixCls,
status: mergedStatus,
className: clsx(cssVarCls, rootCls, hashId, className),
rootClassName: !hasLegacyAddon ? rootClassName : void 0
});
if (hasLegacyAddon) {
const renderAddon = (node) => {
if (!node) return null;
return /* @__PURE__ */ import_react.createElement(SpaceAddon, {
className: clsx(`${prefixCls}-addon`, cssVarCls, hashId),
variant: props.variant,
disabled: props.disabled,
status: mergedStatus
}, /* @__PURE__ */ import_react.createElement(ContextIsolator, { form: true }, node));
};
const addonBeforeNode = renderAddon(addonBefore);
const addonAfterNode = renderAddon(addonAfter);
return /* @__PURE__ */ import_react.createElement(Compact, { rootClassName }, addonBeforeNode, inputNumberNode, addonAfterNode);
}
return inputNumberNode;
});
var TypedInputNumber = InputNumber;
/** @private Internal Component. Do not use in your production. */
var PureInputNumber = (props) => /* @__PURE__ */ import_react.createElement(ConfigProvider, { theme: { components: { InputNumber: { handleVisible: true } } } }, /* @__PURE__ */ import_react.createElement(InputNumber, { ...props }));
InternalInputNumber.displayName = "InternalInputNumber";
TypedInputNumber.displayName = "InputNumber";
TypedInputNumber._InternalPanelDoNotUseOrYouWillBeFired = PureInputNumber;
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorSteppers.js
var ColorSteppers = ({ prefixCls, min = 0, max = 100, value, onChange, className, formatter }) => {
const colorSteppersPrefixCls = `${prefixCls}-steppers`;
const [internalValue, setInternalValue] = (0, import_react.useState)(0);
const stepValue = !Number.isNaN(value) ? value : internalValue;
return /* @__PURE__ */ import_react.createElement(TypedInputNumber, {
className: clsx(colorSteppersPrefixCls, className),
min,
max,
value: stepValue,
formatter,
size: "small",
onChange: (step) => {
setInternalValue(step || 0);
onChange?.(step);
}
});
};
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorAlphaInput.js
var ColorAlphaInput = ({ prefixCls, value, onChange }) => {
const colorAlphaInputPrefixCls = `${prefixCls}-alpha-input`;
const [internalValue, setInternalValue] = (0, import_react.useState)(() => generateColor(value || "#000"));
const alphaValue = value || internalValue;
const handleAlphaChange = (step) => {
const hsba = alphaValue.toHsb();
hsba.a = (step || 0) / 100;
const genColor = generateColor(hsba);
setInternalValue(genColor);
onChange?.(genColor);
};
return /* @__PURE__ */ import_react.createElement(ColorSteppers, {
value: getColorAlpha(alphaValue),
prefixCls,
formatter: (step) => `${step}%`,
className: colorAlphaInputPrefixCls,
onChange: handleAlphaChange
});
};
//#endregion
//#region node_modules/@rc-component/input/es/utils/commonUtils.js
function hasAddon(props) {
return !!(props.addonBefore || props.addonAfter);
}
function hasPrefixSuffix$1(props) {
return !!(props.prefix || props.suffix || props.allowClear);
}
function cloneEvent(event, target, value) {
const currentTarget = target.cloneNode(true);
const newEvent = Object.create(event, {
target: { value: currentTarget },
currentTarget: { value: currentTarget }
});
currentTarget.value = value;
if (typeof target.selectionStart === "number" && typeof target.selectionEnd === "number") {
currentTarget.selectionStart = target.selectionStart;
currentTarget.selectionEnd = target.selectionEnd;
}
currentTarget.setSelectionRange = (...args) => {
target.setSelectionRange(...args);
};
return newEvent;
}
function resolveOnChange(target, e, onChange, targetValue) {
if (!onChange) return;
let event = e;
if (e.type === "click") {
event = cloneEvent(e, target, "");
onChange(event);
return;
}
if (target.type !== "file" && targetValue !== void 0) {
event = cloneEvent(e, target, targetValue);
onChange(event);
return;
}
onChange(event);
}
//#endregion
//#region node_modules/@rc-component/input/es/BaseInput.js
function _extends$40() {
_extends$40 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$40.apply(this, arguments);
}
var BaseInput = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { inputElement: inputEl, children, prefixCls, prefix, suffix, addonBefore, addonAfter, className, style, disabled, readOnly, focused, triggerFocus, allowClear, value, handleReset, hidden, classes, classNames, dataAttrs, styles, components, onClear } = props;
const inputElement = children ?? inputEl;
const AffixWrapperComponent = components?.affixWrapper || "span";
const GroupWrapperComponent = components?.groupWrapper || "span";
const WrapperComponent = components?.wrapper || "span";
const GroupAddonComponent = components?.groupAddon || "span";
const containerRef = (0, import_react.useRef)(null);
const onInputClick = (e) => {
if (containerRef.current?.contains(e.target)) triggerFocus?.();
};
const hasAffix = hasPrefixSuffix$1(props);
let element = /* @__PURE__ */ (0, import_react.cloneElement)(inputElement, {
value,
className: clsx(inputElement.props?.className, !hasAffix && classNames?.variant) || null
});
const groupRef = (0, import_react.useRef)(null);
import_react.useImperativeHandle(ref, () => ({ nativeElement: groupRef.current || containerRef.current }));
if (hasAffix) {
let clearIcon = null;
if (allowClear) {
const needClear = !disabled && !readOnly && value;
const clearIconCls = `${prefixCls}-clear-icon`;
const iconNode = typeof allowClear === "object" && allowClear?.clearIcon ? allowClear.clearIcon : "✖";
clearIcon = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
tabIndex: -1,
onClick: (event) => {
handleReset?.(event);
onClear?.();
},
onMouseDown: (e) => e.preventDefault(),
className: clsx(clearIconCls, {
[`${clearIconCls}-hidden`]: !needClear,
[`${clearIconCls}-has-suffix`]: !!suffix
})
}, iconNode);
}
const affixWrapperPrefixCls = `${prefixCls}-affix-wrapper`;
const affixWrapperCls = clsx(affixWrapperPrefixCls, {
[`${prefixCls}-disabled`]: disabled,
[`${affixWrapperPrefixCls}-disabled`]: disabled,
[`${affixWrapperPrefixCls}-focused`]: focused,
[`${affixWrapperPrefixCls}-readonly`]: readOnly,
[`${affixWrapperPrefixCls}-input-with-clear-btn`]: suffix && allowClear && value
}, classes?.affixWrapper, classNames?.affixWrapper, classNames?.variant);
const suffixNode = (suffix || allowClear) && /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-suffix`, classNames?.suffix),
style: styles?.suffix
}, clearIcon, suffix);
element = /* @__PURE__ */ import_react.createElement(AffixWrapperComponent, _extends$40({
className: affixWrapperCls,
style: styles?.affixWrapper,
onClick: onInputClick
}, dataAttrs?.affixWrapper, { ref: containerRef }), prefix && /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-prefix`, classNames?.prefix),
style: styles?.prefix
}, prefix), element, suffixNode);
}
if (hasAddon(props)) {
const wrapperCls = `${prefixCls}-group`;
const addonCls = `${wrapperCls}-addon`;
const groupWrapperCls = `${wrapperCls}-wrapper`;
const mergedWrapperClassName = clsx(`${prefixCls}-wrapper`, wrapperCls, classes?.wrapper, classNames?.wrapper);
const mergedGroupClassName = clsx(groupWrapperCls, { [`${groupWrapperCls}-disabled`]: disabled }, classes?.group, classNames?.groupWrapper);
element = /* @__PURE__ */ import_react.createElement(GroupWrapperComponent, {
className: mergedGroupClassName,
ref: groupRef
}, /* @__PURE__ */ import_react.createElement(WrapperComponent, { className: mergedWrapperClassName }, addonBefore && /* @__PURE__ */ import_react.createElement(GroupAddonComponent, { className: addonCls }, addonBefore), element, addonAfter && /* @__PURE__ */ import_react.createElement(GroupAddonComponent, { className: addonCls }, addonAfter)));
}
return /* @__PURE__ */ import_react.cloneElement(element, {
className: clsx(element.props?.className, className) || null,
style: {
...element.props?.style,
...style
},
hidden
});
});
//#endregion
//#region node_modules/@rc-component/input/es/hooks/useCount.js
function useCount(count, showCount) {
return import_react.useMemo(() => {
let mergedConfig = {};
if (showCount) mergedConfig.show = typeof showCount === "object" && showCount.formatter ? showCount.formatter : !!showCount;
mergedConfig = {
...mergedConfig,
...count
};
const { show, ...rest } = mergedConfig;
return {
...rest,
show: !!show,
showFormatter: typeof show === "function" ? show : void 0,
strategy: rest.strategy || ((value) => value.length)
};
}, [count, showCount]);
}
//#endregion
//#region node_modules/@rc-component/input/es/Input.js
function _extends$39() {
_extends$39 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$39.apply(this, arguments);
}
//#endregion
//#region node_modules/@rc-component/input/es/index.js
var es_default$11 = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { autoComplete, onChange, onFocus, onBlur, onPressEnter, onKeyDown, onKeyUp, prefixCls = "rc-input", disabled, htmlSize, className, maxLength, suffix, showCount, count, type = "text", classes, classNames, styles, onCompositionStart, onCompositionEnd, ...rest } = props;
const [focused, setFocused] = (0, import_react.useState)(false);
const compositionRef = (0, import_react.useRef)(false);
const keyLockRef = (0, import_react.useRef)(false);
const inputRef = (0, import_react.useRef)(null);
const holderRef = (0, import_react.useRef)(null);
const focus = (option) => {
if (inputRef.current) triggerFocus(inputRef.current, option);
};
const [value, setValue] = useControlledState(props.defaultValue, props.value);
const formatValue = value === void 0 || value === null ? "" : String(value);
const [selection, setSelection] = (0, import_react.useState)(null);
const countConfig = useCount(count, showCount);
const mergedMax = countConfig.max || maxLength;
const valueLength = countConfig.strategy(formatValue);
const isOutOfRange = !!mergedMax && valueLength > mergedMax;
(0, import_react.useImperativeHandle)(ref, () => ({
focus,
blur: () => {
inputRef.current?.blur();
},
setSelectionRange: (start, end, direction) => {
inputRef.current?.setSelectionRange(start, end, direction);
},
select: () => {
inputRef.current?.select();
},
input: inputRef.current,
nativeElement: holderRef.current?.nativeElement || inputRef.current
}));
(0, import_react.useEffect)(() => {
if (keyLockRef.current) keyLockRef.current = false;
setFocused((prev) => prev && disabled ? false : prev);
}, [disabled]);
const triggerChange = (e, currentValue, info) => {
let cutValue = currentValue;
if (!compositionRef.current && countConfig.exceedFormatter && countConfig.max && countConfig.strategy(currentValue) > countConfig.max) {
cutValue = countConfig.exceedFormatter(currentValue, { max: countConfig.max });
if (currentValue !== cutValue) setSelection([inputRef.current?.selectionStart || 0, inputRef.current?.selectionEnd || 0]);
} else if (info.source === "compositionEnd") return;
setValue(cutValue);
if (inputRef.current) resolveOnChange(inputRef.current, e, onChange, cutValue);
};
(0, import_react.useEffect)(() => {
if (selection) inputRef.current?.setSelectionRange(...selection);
}, [selection]);
const onInternalChange = (e) => {
triggerChange(e, e.target.value, { source: "change" });
};
const onInternalCompositionEnd = (e) => {
compositionRef.current = false;
triggerChange(e, e.currentTarget.value, { source: "compositionEnd" });
onCompositionEnd?.(e);
};
const handleKeyDown = (e) => {
if (onPressEnter && e.key === "Enter" && !keyLockRef.current && !e.nativeEvent.isComposing) {
keyLockRef.current = true;
onPressEnter(e);
}
onKeyDown?.(e);
};
const handleKeyUp = (e) => {
if (e.key === "Enter") keyLockRef.current = false;
onKeyUp?.(e);
};
const handleFocus = (e) => {
setFocused(true);
onFocus?.(e);
};
const handleBlur = (e) => {
if (keyLockRef.current) keyLockRef.current = false;
setFocused(false);
onBlur?.(e);
};
const handleReset = (e) => {
setValue("");
focus();
if (inputRef.current) resolveOnChange(inputRef.current, e, onChange);
};
const outOfRangeCls = isOutOfRange && `${prefixCls}-out-of-range`;
const getInputElement = () => {
const otherProps = omit(props, [
"prefixCls",
"onPressEnter",
"addonBefore",
"addonAfter",
"prefix",
"suffix",
"allowClear",
"defaultValue",
"showCount",
"count",
"classes",
"htmlSize",
"styles",
"classNames",
"onClear"
]);
return /* @__PURE__ */ import_react.createElement("input", _extends$39({ autoComplete }, otherProps, {
onChange: onInternalChange,
onFocus: handleFocus,
onBlur: handleBlur,
onKeyDown: handleKeyDown,
onKeyUp: handleKeyUp,
className: clsx(prefixCls, { [`${prefixCls}-disabled`]: disabled }, classNames?.input),
style: styles?.input,
ref: inputRef,
size: htmlSize,
type,
onCompositionStart: (e) => {
compositionRef.current = true;
onCompositionStart?.(e);
},
onCompositionEnd: onInternalCompositionEnd
}));
};
const getSuffix = () => {
const hasMaxLength = Number(mergedMax) > 0;
if (suffix || countConfig.show) {
const dataCount = countConfig.showFormatter ? countConfig.showFormatter({
value: formatValue,
count: valueLength,
maxLength: mergedMax
}) : `${valueLength}${hasMaxLength ? ` / ${mergedMax}` : ""}`;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, countConfig.show && /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-show-count-suffix`, { [`${prefixCls}-show-count-has-suffix`]: !!suffix }, classNames?.count),
style: { ...styles?.count }
}, dataCount), suffix);
}
return null;
};
return /* @__PURE__ */ import_react.createElement(BaseInput, _extends$39({}, rest, {
prefixCls,
className: clsx(className, outOfRangeCls),
handleReset,
value: formatValue,
focused,
triggerFocus: focus,
suffix: getSuffix(),
disabled,
classes,
classNames,
styles,
ref: holderRef
}), getInputElement());
});
//#endregion
//#region node_modules/antd/es/_util/getAllowClear.js
var getAllowClear = (allowClear) => {
let mergedAllowClear;
if (isPlainObject(allowClear) && allowClear?.clearIcon) mergedAllowClear = allowClear;
else if (allowClear) mergedAllowClear = { clearIcon: /* @__PURE__ */ import_react.createElement(RefIcon$3, null) };
return mergedAllowClear;
};
//#endregion
//#region node_modules/antd/es/input/hooks/useRemovePasswordTimeout.js
function useRemovePasswordTimeout(inputRef, triggerOnMount) {
const removePasswordTimeoutRef = (0, import_react.useRef)([]);
const removePasswordTimeout = () => {
removePasswordTimeoutRef.current.push(setTimeout(() => {
if (inputRef.current?.input && inputRef.current?.input.getAttribute("type") === "password" && inputRef.current?.input.hasAttribute("value")) inputRef.current?.input.removeAttribute("value");
}));
};
(0, import_react.useEffect)(() => {
if (triggerOnMount) removePasswordTimeout();
return () => removePasswordTimeoutRef.current.forEach((timer) => {
if (timer) clearTimeout(timer);
});
}, []);
return removePasswordTimeout;
}
//#endregion
//#region node_modules/antd/es/input/utils.js
function hasPrefixSuffix(props) {
return !!(props.prefix || props.suffix || props.allowClear || props.showCount);
}
//#endregion
//#region node_modules/antd/es/input/Input.js
var Input$1 = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls: customizePrefixCls, bordered = true, status: customStatus, size: customSize, disabled: customDisabled, onBlur, onFocus, suffix, allowClear, addonAfter, addonBefore, className, style, styles, rootClassName, onChange, classNames, variant: customVariant, ...rest } = props;
{
const { deprecated } = devUseWarning("Input");
[
["bordered", "variant"],
["addonAfter", "Space.Compact"],
["addonBefore", "Space.Compact"]
].forEach(([prop, newProp]) => {
deprecated(!(prop in props), prop, newProp);
});
}
const { getPrefixCls, direction, allowClear: contextAllowClear, autoComplete: contextAutoComplete, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("input");
const prefixCls = getPrefixCls("input", customizePrefixCls);
const inputRef = (0, import_react.useRef)(null);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = useSharedStyle(prefixCls, rootClassName);
style_default$41(prefixCls, rootCls);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const mergedSize = useSize((ctx) => customSize ?? compactSize ?? ctx);
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const mergedProps = {
...props,
size: mergedSize,
disabled: mergedDisabled
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const { status: contextStatus, hasFeedback, feedbackIcon } = (0, import_react.useContext)(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
const inputHasPrefixSuffix = hasPrefixSuffix(props) || !!hasFeedback;
const prevHasPrefixSuffixRef = (0, import_react.useRef)(inputHasPrefixSuffix);
{
const warning = devUseWarning("Input");
(0, import_react.useEffect)(() => {
if (inputHasPrefixSuffix && !prevHasPrefixSuffixRef.current) warning(document.activeElement === inputRef.current?.input, "usage", `When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ`);
prevHasPrefixSuffixRef.current = inputHasPrefixSuffix;
}, [inputHasPrefixSuffix]);
}
const removePasswordTimeout = useRemovePasswordTimeout(inputRef, true);
const handleBlur = (e) => {
removePasswordTimeout();
onBlur?.(e);
};
const handleFocus = (e) => {
removePasswordTimeout();
onFocus?.(e);
};
const handleChange = (e) => {
removePasswordTimeout();
onChange?.(e);
};
const suffixNode = (hasFeedback || suffix) && /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, suffix, hasFeedback && feedbackIcon);
const mergedAllowClear = getAllowClear(allowClear ?? contextAllowClear);
const [variant, enableVariantCls] = useVariant("input", customVariant, bordered);
return /* @__PURE__ */ import_react.createElement(es_default$11, {
ref: composeRef(ref, inputRef),
prefixCls,
autoComplete: contextAutoComplete,
...rest,
disabled: mergedDisabled,
onBlur: handleBlur,
onFocus: handleFocus,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
styles: mergedStyles,
suffix: suffixNode,
allowClear: mergedAllowClear,
className: clsx(className, rootClassName, cssVarCls, rootCls, compactItemClassnames, contextClassName, mergedClassNames.root),
onChange: handleChange,
addonBefore: addonBefore && /* @__PURE__ */ import_react.createElement(ContextIsolator, {
form: true,
space: true
}, addonBefore),
addonAfter: addonAfter && /* @__PURE__ */ import_react.createElement(ContextIsolator, {
form: true,
space: true
}, addonAfter),
classNames: {
...mergedClassNames,
input: clsx({
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-rtl`]: direction === "rtl"
}, mergedClassNames.input, hashId),
variant: clsx({ [`${prefixCls}-${variant}`]: enableVariantCls }, getStatusClassNames(prefixCls, mergedStatus)),
affixWrapper: clsx({
[`${prefixCls}-affix-wrapper-sm`]: mergedSize === "small",
[`${prefixCls}-affix-wrapper-lg`]: mergedSize === "large",
[`${prefixCls}-affix-wrapper-rtl`]: direction === "rtl"
}, hashId),
wrapper: clsx({ [`${prefixCls}-group-rtl`]: direction === "rtl" }, hashId),
groupWrapper: clsx({
[`${prefixCls}-group-wrapper-sm`]: mergedSize === "small",
[`${prefixCls}-group-wrapper-lg`]: mergedSize === "large",
[`${prefixCls}-group-wrapper-rtl`]: direction === "rtl",
[`${prefixCls}-group-wrapper-${variant}`]: enableVariantCls
}, getStatusClassNames(`${prefixCls}-group-wrapper`, mergedStatus, hasFeedback), hashId)
}
});
});
Input$1.displayName = "Input";
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorHexInput.js
var hexReg = /(^#[\da-f]{6}$)|(^#[\da-f]{8}$)/i;
var isHexString = (hex) => hexReg.test(`#${hex}`);
var ColorHexInput = ({ prefixCls, value, onChange }) => {
const colorHexInputPrefixCls = `${prefixCls}-hex-input`;
const [hexValue, setHexValue] = (0, import_react.useState)(() => value ? toHexFormat(value.toHexString()) : void 0);
(0, import_react.useEffect)(() => {
if (value) setHexValue(toHexFormat(value.toHexString()));
}, [value]);
const handleHexChange = (e) => {
const originValue = e.target.value;
setHexValue(toHexFormat(originValue));
if (isHexString(toHexFormat(originValue, true))) onChange?.(generateColor(originValue));
};
return /* @__PURE__ */ import_react.createElement(Input$1, {
className: colorHexInputPrefixCls,
value: hexValue,
prefix: "#",
onChange: handleHexChange,
size: "small"
});
};
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorHsbInput.js
var ColorHsbInput = ({ prefixCls, value, onChange }) => {
const colorHsbInputPrefixCls = `${prefixCls}-hsb-input`;
const [internalValue, setInternalValue] = (0, import_react.useState)(() => generateColor(value || "#000"));
const hsbValue = value || internalValue;
const handleHsbChange = (step, type) => {
const hsb = hsbValue.toHsb();
hsb[type] = type === "h" ? step : (step || 0) / 100;
const genColor = generateColor(hsb);
setInternalValue(genColor);
onChange?.(genColor);
};
return /* @__PURE__ */ import_react.createElement("div", { className: colorHsbInputPrefixCls }, /* @__PURE__ */ import_react.createElement(ColorSteppers, {
max: 360,
min: 0,
value: Number(hsbValue.toHsb().h),
prefixCls,
className: colorHsbInputPrefixCls,
formatter: (step) => getRoundNumber(step || 0).toString(),
onChange: (step) => handleHsbChange(Number(step), "h")
}), /* @__PURE__ */ import_react.createElement(ColorSteppers, {
max: 100,
min: 0,
value: Number(hsbValue.toHsb().s) * 100,
prefixCls,
className: colorHsbInputPrefixCls,
formatter: (step) => `${getRoundNumber(step || 0)}%`,
onChange: (step) => handleHsbChange(Number(step), "s")
}), /* @__PURE__ */ import_react.createElement(ColorSteppers, {
max: 100,
min: 0,
value: Number(hsbValue.toHsb().b) * 100,
prefixCls,
className: colorHsbInputPrefixCls,
formatter: (step) => `${getRoundNumber(step || 0)}%`,
onChange: (step) => handleHsbChange(Number(step), "b")
}));
};
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorRgbInput.js
var ColorRgbInput = ({ prefixCls, value, onChange }) => {
const colorRgbInputPrefixCls = `${prefixCls}-rgb-input`;
const [internalValue, setInternalValue] = (0, import_react.useState)(() => generateColor(value || "#000"));
const rgbValue = value || internalValue;
const handleRgbChange = (step, type) => {
const rgb = rgbValue.toRgb();
rgb[type] = step || 0;
const genColor = generateColor(rgb);
setInternalValue(genColor);
onChange?.(genColor);
};
return /* @__PURE__ */ import_react.createElement("div", { className: colorRgbInputPrefixCls }, /* @__PURE__ */ import_react.createElement(ColorSteppers, {
max: 255,
min: 0,
value: Number(rgbValue.toRgb().r),
prefixCls,
className: colorRgbInputPrefixCls,
onChange: (step) => handleRgbChange(Number(step), "r")
}), /* @__PURE__ */ import_react.createElement(ColorSteppers, {
max: 255,
min: 0,
value: Number(rgbValue.toRgb().g),
prefixCls,
className: colorRgbInputPrefixCls,
onChange: (step) => handleRgbChange(Number(step), "g")
}), /* @__PURE__ */ import_react.createElement(ColorSteppers, {
max: 255,
min: 0,
value: Number(rgbValue.toRgb().b),
prefixCls,
className: colorRgbInputPrefixCls,
onChange: (step) => handleRgbChange(Number(step), "b")
}));
};
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorInput.js
var selectOptions = [
"hex",
"hsb",
"rgb"
].map((format) => ({
value: format,
label: format.toUpperCase()
}));
var ColorInput = (props) => {
const { prefixCls, format, value, disabledAlpha, onFormatChange, onChange, disabledFormat } = props;
const [colorFormat, setColorFormat] = useControlledState("hex", format);
const colorInputPrefixCls = `${prefixCls}-input`;
const triggerFormatChange = (newFormat) => {
setColorFormat(newFormat);
onFormatChange?.(newFormat);
};
const steppersNode = (0, import_react.useMemo)(() => {
const inputProps = {
value,
prefixCls,
onChange
};
switch (colorFormat) {
case "hsb": return /* @__PURE__ */ import_react.createElement(ColorHsbInput, { ...inputProps });
case "rgb": return /* @__PURE__ */ import_react.createElement(ColorRgbInput, { ...inputProps });
default: return /* @__PURE__ */ import_react.createElement(ColorHexInput, { ...inputProps });
}
}, [
colorFormat,
prefixCls,
value,
onChange
]);
return /* @__PURE__ */ import_react.createElement("div", { className: `${colorInputPrefixCls}-container` }, !disabledFormat && /* @__PURE__ */ import_react.createElement(Select, {
value: colorFormat,
variant: "borderless",
getPopupContainer: (current) => current,
popupMatchSelectWidth: 68,
placement: "bottomRight",
onChange: triggerFormatChange,
className: `${prefixCls}-format-select`,
size: "small",
options: selectOptions
}), /* @__PURE__ */ import_react.createElement("div", { className: colorInputPrefixCls }, steppersNode), !disabledAlpha && /* @__PURE__ */ import_react.createElement(ColorAlphaInput, {
prefixCls,
value,
onChange
}));
};
//#endregion
//#region node_modules/@rc-component/slider/es/util.js
function getOffset$1(value, min, max) {
return (value - min) / (max - min);
}
function getDirectionStyle(direction, value, min, max) {
const offset = getOffset$1(value, min, max);
const positionStyle = {};
switch (direction) {
case "rtl":
positionStyle.right = `${offset * 100}%`;
positionStyle.transform = "translateX(50%)";
break;
case "btt":
positionStyle.bottom = `${offset * 100}%`;
positionStyle.transform = "translateY(50%)";
break;
case "ttb":
positionStyle.top = `${offset * 100}%`;
positionStyle.transform = "translateY(-50%)";
break;
default:
positionStyle.left = `${offset * 100}%`;
positionStyle.transform = "translateX(-50%)";
break;
}
return positionStyle;
}
/** Return index value if is list or return value directly */
function getIndex(value, index) {
return Array.isArray(value) ? value[index] : value;
}
//#endregion
//#region node_modules/@rc-component/slider/es/context.js
var SliderContext = /* @__PURE__ */ import_react.createContext({
min: 0,
max: 0,
direction: "ltr",
step: 1,
includedStart: 0,
includedEnd: 0,
tabIndex: 0,
keyboard: true,
styles: {},
classNames: {}
});
/** @private NOT PROMISE AVAILABLE. DO NOT USE IN PRODUCTION. */
var UnstableContext$3 = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/slider/es/Handles/Handle.js
function _extends$38() {
_extends$38 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$38.apply(this, arguments);
}
var Handle = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, value, valueIndex, onStartMove, onDelete, style, render, dragging, draggingDelete, onOffsetChange, onChangeComplete, onFocus, onMouseEnter, ...restProps } = props;
const { min, max, direction, disabled, keyboard, range, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaRequired, ariaValueTextFormatterForHandle, styles, classNames } = import_react.useContext(SliderContext);
const handlePrefixCls = `${prefixCls}-handle`;
const onInternalStartMove = (e) => {
if (!disabled) onStartMove(e, valueIndex);
};
const onInternalFocus = (e) => {
onFocus?.(e, valueIndex);
};
const onInternalMouseEnter = (e) => {
onMouseEnter(e, valueIndex);
};
const onKeyDown = (e) => {
if (!disabled && keyboard) {
let offset = null;
switch (e.which || e.keyCode) {
case KeyCode.LEFT:
offset = direction === "ltr" || direction === "btt" ? -1 : 1;
break;
case KeyCode.RIGHT:
offset = direction === "ltr" || direction === "btt" ? 1 : -1;
break;
case KeyCode.UP:
offset = direction !== "ttb" ? 1 : -1;
break;
case KeyCode.DOWN:
offset = direction !== "ttb" ? -1 : 1;
break;
case KeyCode.HOME:
offset = "min";
break;
case KeyCode.END:
offset = "max";
break;
case KeyCode.PAGE_UP:
offset = 2;
break;
case KeyCode.PAGE_DOWN:
offset = -2;
break;
case KeyCode.BACKSPACE:
case KeyCode.DELETE:
onDelete?.(valueIndex);
break;
}
if (offset !== null) {
e.preventDefault();
onOffsetChange(offset, valueIndex);
}
}
};
const handleKeyUp = (e) => {
switch (e.which || e.keyCode) {
case KeyCode.LEFT:
case KeyCode.RIGHT:
case KeyCode.UP:
case KeyCode.DOWN:
case KeyCode.HOME:
case KeyCode.END:
case KeyCode.PAGE_UP:
case KeyCode.PAGE_DOWN:
onChangeComplete?.();
break;
}
};
const positionStyle = getDirectionStyle(direction, value, min, max);
let divProps = {};
if (valueIndex !== null) divProps = {
tabIndex: disabled ? null : getIndex(tabIndex, valueIndex),
role: "slider",
"aria-valuemin": min,
"aria-valuemax": max,
"aria-valuenow": value,
"aria-disabled": disabled,
"aria-label": getIndex(ariaLabelForHandle, valueIndex),
"aria-labelledby": getIndex(ariaLabelledByForHandle, valueIndex),
"aria-required": getIndex(ariaRequired, valueIndex),
"aria-valuetext": getIndex(ariaValueTextFormatterForHandle, valueIndex)?.(value),
"aria-orientation": direction === "ltr" || direction === "rtl" ? "horizontal" : "vertical",
onMouseDown: onInternalStartMove,
onTouchStart: onInternalStartMove,
onFocus: onInternalFocus,
onMouseEnter: onInternalMouseEnter,
onKeyDown,
onKeyUp: handleKeyUp
};
let handleNode = /* @__PURE__ */ import_react.createElement("div", _extends$38({
ref,
className: clsx(handlePrefixCls, {
[`${handlePrefixCls}-${valueIndex + 1}`]: valueIndex !== null && range,
[`${handlePrefixCls}-dragging`]: dragging,
[`${handlePrefixCls}-dragging-delete`]: draggingDelete
}, classNames.handle),
style: {
...positionStyle,
...style,
...styles.handle
}
}, divProps, restProps));
if (render) handleNode = render(handleNode, {
index: valueIndex,
prefixCls,
value,
dragging,
draggingDelete
});
return handleNode;
});
Handle.displayName = "Handle";
//#endregion
//#region node_modules/@rc-component/slider/es/Handles/index.js
function _extends$37() {
_extends$37 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$37.apply(this, arguments);
}
var Handles = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, style, onStartMove, onOffsetChange, values, handleRender, activeHandleRender, draggingIndex, draggingDelete, onFocus, ...restProps } = props;
const handlesRef = import_react.useRef({});
const [activeVisible, setActiveVisible] = import_react.useState(false);
const [activeIndex, setActiveIndex] = import_react.useState(-1);
const onActive = (index) => {
setActiveIndex(index);
setActiveVisible(true);
};
const onHandleFocus = (e, index) => {
onActive(index);
onFocus?.(e);
};
const onHandleMouseEnter = (e, index) => {
onActive(index);
};
import_react.useImperativeHandle(ref, () => ({
focus: (index) => {
handlesRef.current[index]?.focus();
},
hideHelp: () => {
(0, import_react_dom.flushSync)(() => {
setActiveVisible(false);
});
}
}));
const handleProps = {
prefixCls,
onStartMove,
onOffsetChange,
render: handleRender,
onFocus: onHandleFocus,
onMouseEnter: onHandleMouseEnter,
...restProps
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, values.map((value, index) => {
const dragging = draggingIndex === index;
return /* @__PURE__ */ import_react.createElement(Handle, _extends$37({
ref: (node) => {
if (!node) delete handlesRef.current[index];
else handlesRef.current[index] = node;
},
dragging,
draggingDelete: dragging && draggingDelete,
style: getIndex(style, index),
key: index,
value,
valueIndex: index
}, handleProps));
}), activeHandleRender && activeVisible && /* @__PURE__ */ import_react.createElement(Handle, _extends$37({ key: "a11y" }, handleProps, {
value: values[activeIndex],
valueIndex: null,
dragging: draggingIndex !== -1,
draggingDelete,
render: activeHandleRender,
style: { pointerEvents: "none" },
tabIndex: null,
"aria-hidden": true
})));
});
Handles.displayName = "Handles";
//#endregion
//#region node_modules/@rc-component/slider/es/Marks/Mark.js
var Mark = (props) => {
const { prefixCls, style, children, value, onClick } = props;
const { min, max, direction, includedStart, includedEnd, included } = import_react.useContext(SliderContext);
const textCls = `${prefixCls}-text`;
const positionStyle = getDirectionStyle(direction, value, min, max);
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(textCls, { [`${textCls}-active`]: included && includedStart <= value && value <= includedEnd }),
style: {
...positionStyle,
...style
},
onMouseDown: (e) => {
e.stopPropagation();
},
onClick: () => {
onClick(value);
}
}, children);
};
//#endregion
//#region node_modules/@rc-component/slider/es/Marks/index.js
var Marks = (props) => {
const { prefixCls, marks, onClick } = props;
const markPrefixCls = `${prefixCls}-mark`;
if (!marks.length) return null;
return /* @__PURE__ */ import_react.createElement("div", { className: markPrefixCls }, marks.map(({ value, style, label }) => /* @__PURE__ */ import_react.createElement(Mark, {
key: value,
prefixCls: markPrefixCls,
style,
value,
onClick
}, label)));
};
//#endregion
//#region node_modules/@rc-component/slider/es/Steps/Dot.js
var Dot = (props) => {
const { prefixCls, value, style, activeStyle } = props;
const { min, max, direction, included, includedStart, includedEnd } = import_react.useContext(SliderContext);
const dotClassName = `${prefixCls}-dot`;
const active = included && includedStart <= value && value <= includedEnd;
let mergedStyle = {
...getDirectionStyle(direction, value, min, max),
...typeof style === "function" ? style(value) : style
};
if (active) mergedStyle = {
...mergedStyle,
...typeof activeStyle === "function" ? activeStyle(value) : activeStyle
};
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(dotClassName, { [`${dotClassName}-active`]: active }),
style: mergedStyle
});
};
//#endregion
//#region node_modules/@rc-component/slider/es/Steps/index.js
var Steps$3 = (props) => {
const { prefixCls, marks, dots, style, activeStyle } = props;
const { min, max, step } = import_react.useContext(SliderContext);
const stepDots = import_react.useMemo(() => {
const dotSet = /* @__PURE__ */ new Set();
marks.forEach((mark) => {
dotSet.add(mark.value);
});
if (dots && step !== null) {
let current = min;
while (current <= max) {
dotSet.add(current);
current += step;
}
}
return Array.from(dotSet);
}, [
min,
max,
step,
dots,
marks
]);
return /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-step` }, stepDots.map((dotValue) => /* @__PURE__ */ import_react.createElement(Dot, {
prefixCls,
key: dotValue,
value: dotValue,
style,
activeStyle
})));
};
//#endregion
//#region node_modules/@rc-component/slider/es/Tracks/Track.js
var Track = (props) => {
const { prefixCls, style, start, end, index, onStartMove, replaceCls } = props;
const { direction, min, max, disabled, range, classNames } = import_react.useContext(SliderContext);
const trackPrefixCls = `${prefixCls}-track`;
const offsetStart = getOffset$1(start, min, max);
const offsetEnd = getOffset$1(end, min, max);
const onInternalStartMove = (e) => {
if (!disabled && onStartMove) onStartMove(e, -1);
};
const positionStyle = {};
switch (direction) {
case "rtl":
positionStyle.right = `${offsetStart * 100}%`;
positionStyle.width = `${offsetEnd * 100 - offsetStart * 100}%`;
break;
case "btt":
positionStyle.bottom = `${offsetStart * 100}%`;
positionStyle.height = `${offsetEnd * 100 - offsetStart * 100}%`;
break;
case "ttb":
positionStyle.top = `${offsetStart * 100}%`;
positionStyle.height = `${offsetEnd * 100 - offsetStart * 100}%`;
break;
default:
positionStyle.left = `${offsetStart * 100}%`;
positionStyle.width = `${offsetEnd * 100 - offsetStart * 100}%`;
}
const className = replaceCls || clsx(trackPrefixCls, {
[`${trackPrefixCls}-${index + 1}`]: index !== null && range,
[`${prefixCls}-track-draggable`]: onStartMove
}, classNames.track);
return /* @__PURE__ */ import_react.createElement("div", {
className,
style: {
...positionStyle,
...style
},
onMouseDown: onInternalStartMove,
onTouchStart: onInternalStartMove
});
};
//#endregion
//#region node_modules/@rc-component/slider/es/Tracks/index.js
var Tracks = (props) => {
const { prefixCls, style, values, startPoint, onStartMove } = props;
const { included, range, min, styles, classNames } = import_react.useContext(SliderContext);
const trackList = import_react.useMemo(() => {
if (!range) {
if (values.length === 0) return [];
const startValue = startPoint ?? min;
const endValue = values[0];
return [{
start: Math.min(startValue, endValue),
end: Math.max(startValue, endValue)
}];
}
const list = [];
for (let i = 0; i < values.length - 1; i += 1) list.push({
start: values[i],
end: values[i + 1]
});
return list;
}, [
values,
range,
startPoint,
min
]);
if (!included) return null;
const tracksNode = trackList?.length && (classNames.tracks || styles.tracks) ? /* @__PURE__ */ import_react.createElement(Track, {
index: null,
prefixCls,
start: trackList[0].start,
end: trackList[trackList.length - 1].end,
replaceCls: clsx(classNames.tracks, `${prefixCls}-tracks`),
style: styles.tracks
}) : null;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, tracksNode, trackList.map(({ start, end }, index) => /* @__PURE__ */ import_react.createElement(Track, {
index,
prefixCls,
style: {
...getIndex(style, index),
...styles.track
},
start,
end,
key: index,
onStartMove
})));
};
//#endregion
//#region node_modules/@rc-component/slider/es/hooks/useDrag.js
/** Drag to delete offset. It's a user experience number for dragging out */
var REMOVE_DIST = 130;
function getPosition(e) {
const obj = "targetTouches" in e ? e.targetTouches[0] : e;
return {
pageX: obj.pageX,
pageY: obj.pageY
};
}
function useDrag$1(containerRef, direction, rawValues, min, max, formatValue, triggerChange, finishChange, offsetValues, editable, minCount) {
const [draggingValue, setDraggingValue] = import_react.useState(null);
const [draggingIndex, setDraggingIndex] = import_react.useState(-1);
const [draggingDelete, setDraggingDelete] = import_react.useState(false);
const [cacheValues, setCacheValues] = import_react.useState(rawValues);
const [originValues, setOriginValues] = import_react.useState(rawValues);
const mouseMoveEventRef = import_react.useRef(null);
const mouseUpEventRef = import_react.useRef(null);
const touchEventTargetRef = import_react.useRef(null);
const { onDragStart, onDragChange } = import_react.useContext(UnstableContext$3);
useLayoutEffect$1(() => {
if (draggingIndex === -1) setCacheValues(rawValues);
}, [rawValues, draggingIndex]);
import_react.useEffect(() => () => {
document.removeEventListener("mousemove", mouseMoveEventRef.current);
document.removeEventListener("mouseup", mouseUpEventRef.current);
if (touchEventTargetRef.current) {
touchEventTargetRef.current.removeEventListener("touchmove", mouseMoveEventRef.current);
touchEventTargetRef.current.removeEventListener("touchend", mouseUpEventRef.current);
}
}, []);
const flushValues = (nextValues, nextValue, deleteMark) => {
if (nextValue !== void 0) setDraggingValue(nextValue);
setCacheValues(nextValues);
let changeValues = nextValues;
if (deleteMark) changeValues = nextValues.filter((_, i) => i !== draggingIndex);
triggerChange(changeValues);
if (onDragChange) onDragChange({
rawValues: nextValues,
deleteIndex: deleteMark ? draggingIndex : -1,
draggingIndex,
draggingValue: nextValue
});
};
const updateCacheValue = useEvent((valueIndex, offsetPercent, deleteMark) => {
if (valueIndex === -1) {
const startValue = originValues[0];
const endValue = originValues[originValues.length - 1];
const maxStartOffset = min - startValue;
const maxEndOffset = max - endValue;
let offset = offsetPercent * (max - min);
offset = Math.max(offset, maxStartOffset);
offset = Math.min(offset, maxEndOffset);
offset = formatValue(startValue + offset) - startValue;
flushValues(originValues.map((val) => val + offset));
} else {
const offsetDist = (max - min) * offsetPercent;
const cloneValues = [...cacheValues];
cloneValues[valueIndex] = originValues[valueIndex];
const next = offsetValues(cloneValues, offsetDist, valueIndex, "dist");
flushValues(next.values, next.value, deleteMark);
}
});
const onStartMove = (e, valueIndex, startValues) => {
e.stopPropagation();
const initialValues = startValues || rawValues;
const originValue = initialValues[valueIndex];
setDraggingIndex(valueIndex);
setDraggingValue(originValue);
setOriginValues(initialValues);
setCacheValues(initialValues);
setDraggingDelete(false);
const { pageX: startX, pageY: startY } = getPosition(e);
let deleteMark = false;
if (onDragStart) onDragStart({
rawValues: initialValues,
draggingIndex: valueIndex,
draggingValue: originValue
});
const onMouseMove = (event) => {
event.preventDefault();
const { pageX: moveX, pageY: moveY } = getPosition(event);
const offsetX = moveX - startX;
const offsetY = moveY - startY;
const { width, height } = containerRef.current.getBoundingClientRect();
let offSetPercent;
let removeDist;
switch (direction) {
case "btt":
offSetPercent = -offsetY / height;
removeDist = offsetX;
break;
case "ttb":
offSetPercent = offsetY / height;
removeDist = offsetX;
break;
case "rtl":
offSetPercent = -offsetX / width;
removeDist = offsetY;
break;
default:
offSetPercent = offsetX / width;
removeDist = offsetY;
}
deleteMark = editable ? Math.abs(removeDist) > REMOVE_DIST && minCount < cacheValues.length : false;
setDraggingDelete(deleteMark);
updateCacheValue(valueIndex, offSetPercent, deleteMark);
};
const onMouseUp = (event) => {
event.preventDefault();
document.removeEventListener("mouseup", onMouseUp);
document.removeEventListener("mousemove", onMouseMove);
if (touchEventTargetRef.current) {
touchEventTargetRef.current.removeEventListener("touchmove", mouseMoveEventRef.current);
touchEventTargetRef.current.removeEventListener("touchend", mouseUpEventRef.current);
}
mouseMoveEventRef.current = null;
mouseUpEventRef.current = null;
touchEventTargetRef.current = null;
finishChange(deleteMark);
setDraggingIndex(-1);
setDraggingDelete(false);
};
document.addEventListener("mouseup", onMouseUp);
document.addEventListener("mousemove", onMouseMove);
e.currentTarget.addEventListener("touchend", onMouseUp);
e.currentTarget.addEventListener("touchmove", onMouseMove);
mouseMoveEventRef.current = onMouseMove;
mouseUpEventRef.current = onMouseUp;
touchEventTargetRef.current = e.currentTarget;
};
return [
draggingIndex,
draggingValue,
draggingDelete,
import_react.useMemo(() => {
const sourceValues = [...rawValues].sort((a, b) => a - b);
const targetValues = [...cacheValues].sort((a, b) => a - b);
const counts = {};
targetValues.forEach((val) => {
counts[val] = (counts[val] || 0) + 1;
});
sourceValues.forEach((val) => {
counts[val] = (counts[val] || 0) - 1;
});
const maxDiffCount = editable ? 1 : 0;
return Object.values(counts).reduce((prev, next) => prev + Math.abs(next), 0) <= maxDiffCount ? cacheValues : rawValues;
}, [
rawValues,
cacheValues,
editable
]),
onStartMove
];
}
//#endregion
//#region node_modules/@rc-component/slider/es/hooks/useOffset.js
/** Format the value in the range of [min, max] */
/** Format value align with step */
/** Format value align with step & marks */
function useOffset(min, max, step, markList, allowCross, pushable) {
const formatRangeValue = import_react.useCallback((val) => Math.max(min, Math.min(max, val)), [min, max]);
const formatStepValue = import_react.useCallback((val) => {
if (step !== null) {
const stepValue = min + Math.round((formatRangeValue(val) - min) / step) * step;
const getDecimal = (num) => (String(num).split(".")[1] || "").length;
const maxDecimal = Math.max(getDecimal(step), getDecimal(max), getDecimal(min));
const fixedValue = Number(stepValue.toFixed(maxDecimal));
return min <= fixedValue && fixedValue <= max ? fixedValue : null;
}
return null;
}, [
step,
min,
max,
formatRangeValue
]);
const formatValue = import_react.useCallback((val) => {
const formatNextValue = formatRangeValue(val);
const alignValues = markList.map((mark) => mark.value);
if (step !== null) alignValues.push(formatStepValue(val));
alignValues.push(min, max);
let closeValue = alignValues[0];
let closeDist = max - min;
alignValues.forEach((alignValue) => {
const dist = Math.abs(formatNextValue - alignValue);
if (dist <= closeDist) {
closeValue = alignValue;
closeDist = dist;
}
});
return closeValue;
}, [
min,
max,
markList,
step,
formatRangeValue,
formatStepValue
]);
const offsetValue = (values, offset, valueIndex, mode = "unit") => {
if (typeof offset === "number") {
let nextValue;
const originValue = values[valueIndex];
const targetDistValue = originValue + offset;
let potentialValues = [];
markList.forEach((mark) => {
potentialValues.push(mark.value);
});
potentialValues.push(min, max);
potentialValues.push(formatStepValue(originValue));
const sign = offset > 0 ? 1 : -1;
if (mode === "unit") potentialValues.push(formatStepValue(originValue + sign * step));
else potentialValues.push(formatStepValue(targetDistValue));
potentialValues = potentialValues.filter((val) => val !== null).filter((val) => offset < 0 ? val <= originValue : val >= originValue);
if (mode === "unit") potentialValues = potentialValues.filter((val) => val !== originValue);
const compareValue = mode === "unit" ? originValue : targetDistValue;
nextValue = potentialValues[0];
let valueDist = Math.abs(nextValue - compareValue);
potentialValues.forEach((potentialValue) => {
const dist = Math.abs(potentialValue - compareValue);
if (dist < valueDist) {
nextValue = potentialValue;
valueDist = dist;
}
});
if (nextValue === void 0) return offset < 0 ? min : max;
if (mode === "dist") return nextValue;
if (Math.abs(offset) > 1) {
const cloneValues = [...values];
cloneValues[valueIndex] = nextValue;
return offsetValue(cloneValues, offset - sign, valueIndex, mode);
}
return nextValue;
} else if (offset === "min") return min;
else if (offset === "max") return max;
};
/** Same as `offsetValue` but return `changed` mark to tell value changed */
const offsetChangedValue = (values, offset, valueIndex, mode = "unit") => {
const originValue = values[valueIndex];
const nextValue = offsetValue(values, offset, valueIndex, mode);
return {
value: nextValue,
changed: nextValue !== originValue
};
};
const needPush = (dist) => {
return pushable === null && dist === 0 || typeof pushable === "number" && dist < pushable;
};
const offsetValues = (values, offset, valueIndex, mode = "unit") => {
const nextValues = values.map(formatValue);
const originValue = nextValues[valueIndex];
nextValues[valueIndex] = offsetValue(nextValues, offset, valueIndex, mode);
if (allowCross === false) {
const pushNum = pushable || 0;
if (valueIndex > 0 && nextValues[valueIndex - 1] !== originValue) nextValues[valueIndex] = Math.max(nextValues[valueIndex], nextValues[valueIndex - 1] + pushNum);
if (valueIndex < nextValues.length - 1 && nextValues[valueIndex + 1] !== originValue) nextValues[valueIndex] = Math.min(nextValues[valueIndex], nextValues[valueIndex + 1] - pushNum);
} else if (typeof pushable === "number" || pushable === null) {
for (let i = valueIndex + 1; i < nextValues.length; i += 1) {
let changed = true;
while (needPush(nextValues[i] - nextValues[i - 1]) && changed) ({value: nextValues[i], changed} = offsetChangedValue(nextValues, 1, i));
}
for (let i = valueIndex; i > 0; i -= 1) {
let changed = true;
while (needPush(nextValues[i] - nextValues[i - 1]) && changed) ({value: nextValues[i - 1], changed} = offsetChangedValue(nextValues, -1, i - 1));
}
for (let i = nextValues.length - 1; i > 0; i -= 1) {
let changed = true;
while (needPush(nextValues[i] - nextValues[i - 1]) && changed) ({value: nextValues[i - 1], changed} = offsetChangedValue(nextValues, -1, i - 1));
}
for (let i = 0; i < nextValues.length - 1; i += 1) {
let changed = true;
while (needPush(nextValues[i + 1] - nextValues[i]) && changed) ({value: nextValues[i + 1], changed} = offsetChangedValue(nextValues, 1, i + 1));
}
}
return {
value: nextValues[valueIndex],
values: nextValues
};
};
return [formatValue, offsetValues];
}
//#endregion
//#region node_modules/@rc-component/slider/es/hooks/useRange.js
function useRange(range) {
return (0, import_react.useMemo)(() => {
if (range === true || !range) return [
!!range,
false,
false,
0
];
const { editable, draggableTrack, minCount, maxCount } = range;
warning$2(!editable || !draggableTrack, "`editable` can not work with `draggableTrack`.");
return [
true,
editable,
!editable && draggableTrack,
minCount || 0,
maxCount
];
}, [range]);
}
//#endregion
//#region node_modules/@rc-component/slider/es/Slider.js
/**
* New:
* - click mark to update range value
* - handleRender
* - Fix handle with count not correct
* - Fix pushable not work in some case
* - No more FindDOMNode
* - Move all position related style into inline style
* - Key: up is plus, down is minus
* - fix Key with step = null not align with marks
* - Change range should not trigger onChange
* - keyboard support pushable
*/
var Slider$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls = "rc-slider", className, style, classNames, styles, id, disabled = false, keyboard = true, autoFocus, onFocus, onBlur, min = 0, max = 100, step = 1, value, defaultValue, range, count, onChange, onBeforeChange, onAfterChange, onChangeComplete, allowCross = true, pushable = false, reverse, vertical, included = true, startPoint, trackStyle, handleStyle, railStyle, dotStyle, activeDotStyle, marks, dots, handleRender, activeHandleRender, track, tabIndex = 0, ariaLabelForHandle, ariaLabelledByForHandle, ariaRequired, ariaValueTextFormatterForHandle } = props;
const handlesRef = import_react.useRef(null);
const containerRef = import_react.useRef(null);
const direction = import_react.useMemo(() => {
if (vertical) return reverse ? "ttb" : "btt";
return reverse ? "rtl" : "ltr";
}, [reverse, vertical]);
const [rangeEnabled, rangeEditable, rangeDraggableTrack, minCount, maxCount] = useRange(range);
const mergedMin = import_react.useMemo(() => isFinite(min) ? min : 0, [min]);
const mergedMax = import_react.useMemo(() => isFinite(max) ? max : 100, [max]);
const mergedStep = import_react.useMemo(() => step !== null && step <= 0 ? 1 : step, [step]);
const mergedPush = import_react.useMemo(() => {
if (typeof pushable === "boolean") return pushable ? mergedStep : false;
return pushable >= 0 ? pushable : false;
}, [pushable, mergedStep]);
const markList = import_react.useMemo(() => {
return Object.keys(marks || {}).map((key) => {
const mark = marks[key];
const markObj = { value: Number(key) };
if (mark && typeof mark === "object" && !/* @__PURE__ */ import_react.isValidElement(mark) && ("label" in mark || "style" in mark)) {
markObj.style = mark.style;
markObj.label = mark.label;
} else markObj.label = mark;
return markObj;
}).filter(({ label }) => label || typeof label === "number").sort((a, b) => a.value - b.value);
}, [marks]);
const [formatValue, offsetValues] = useOffset(mergedMin, mergedMax, mergedStep, markList, allowCross, mergedPush);
const [mergedValue, setValue] = useControlledState(defaultValue, value);
const rawValues = import_react.useMemo(() => {
const valueList = mergedValue === null || mergedValue === void 0 ? [] : Array.isArray(mergedValue) ? mergedValue : [mergedValue];
const [val0 = mergedMin] = valueList;
let returnValues = mergedValue === null ? [] : [val0];
if (rangeEnabled) {
returnValues = [...valueList];
if (count || mergedValue === void 0) {
const pointCount = count >= 0 ? count + 1 : 2;
returnValues = returnValues.slice(0, pointCount);
while (returnValues.length < pointCount) returnValues.push(returnValues[returnValues.length - 1] ?? mergedMin);
}
returnValues.sort((a, b) => a - b);
}
returnValues.forEach((val, index) => {
returnValues[index] = formatValue(val);
});
return returnValues;
}, [
mergedValue,
rangeEnabled,
mergedMin,
count,
formatValue
]);
const getTriggerValue = (triggerValues) => rangeEnabled ? triggerValues : triggerValues[0];
const triggerChange = useEvent((nextValues) => {
const cloneNextValues = [...nextValues].sort((a, b) => a - b);
if (onChange && !isEqual(cloneNextValues, rawValues, true)) onChange(getTriggerValue(cloneNextValues));
setValue(cloneNextValues);
});
const finishChange = useEvent((draggingDelete) => {
if (draggingDelete) handlesRef.current.hideHelp();
const finishValue = getTriggerValue(rawValues);
onAfterChange?.(finishValue);
warningOnce(!onAfterChange, "[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.");
onChangeComplete?.(finishValue);
});
const onDelete = (index) => {
if (disabled || !rangeEditable || rawValues.length <= minCount) return;
const cloneNextValues = [...rawValues];
cloneNextValues.splice(index, 1);
onBeforeChange?.(getTriggerValue(cloneNextValues));
triggerChange(cloneNextValues);
const nextFocusIndex = Math.max(0, index - 1);
handlesRef.current.hideHelp();
handlesRef.current.focus(nextFocusIndex);
};
const [draggingIndex, draggingValue, draggingDelete, cacheValues, onStartDrag] = useDrag$1(containerRef, direction, rawValues, mergedMin, mergedMax, formatValue, triggerChange, finishChange, offsetValues, rangeEditable, minCount);
/**
* When `rangeEditable` will insert a new value in the values array.
* Else it will replace the value in the values array.
*/
const changeToCloseValue = (newValue, e) => {
if (!disabled) {
const cloneNextValues = [...rawValues];
let valueIndex = 0;
let valueBeforeIndex = 0;
let valueDist = mergedMax - mergedMin;
rawValues.forEach((val, index) => {
const dist = Math.abs(newValue - val);
if (dist <= valueDist) {
valueDist = dist;
valueIndex = index;
}
if (val < newValue) valueBeforeIndex = index;
});
let focusIndex = valueIndex;
if (rangeEditable && valueDist !== 0 && (!maxCount || rawValues.length < maxCount)) {
cloneNextValues.splice(valueBeforeIndex + 1, 0, newValue);
focusIndex = valueBeforeIndex + 1;
} else cloneNextValues[valueIndex] = newValue;
if (rangeEnabled && !rawValues.length && count === void 0) cloneNextValues.push(newValue);
const nextValue = getTriggerValue(cloneNextValues);
onBeforeChange?.(nextValue);
triggerChange(cloneNextValues);
if (e) {
document.activeElement?.blur?.();
handlesRef.current.focus(focusIndex);
onStartDrag(e, focusIndex, cloneNextValues);
} else {
onAfterChange?.(nextValue);
warningOnce(!onAfterChange, "[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.");
onChangeComplete?.(nextValue);
}
}
};
const onSliderMouseDown = (e) => {
e.preventDefault();
const { width, height, left, top, bottom, right } = containerRef.current.getBoundingClientRect();
const { clientX, clientY } = e;
let percent;
switch (direction) {
case "btt":
percent = (bottom - clientY) / height;
break;
case "ttb":
percent = (clientY - top) / height;
break;
case "rtl":
percent = (right - clientX) / width;
break;
default: percent = (clientX - left) / width;
}
changeToCloseValue(formatValue(mergedMin + percent * (mergedMax - mergedMin)), e);
};
const [keyboardValue, setKeyboardValue] = import_react.useState(null);
const onHandleOffsetChange = (offset, valueIndex) => {
if (!disabled) {
const next = offsetValues(rawValues, offset, valueIndex);
onBeforeChange?.(getTriggerValue(rawValues));
triggerChange(next.values);
setKeyboardValue(next.value);
}
};
import_react.useEffect(() => {
if (keyboardValue !== null) {
const valueIndex = rawValues.indexOf(keyboardValue);
if (valueIndex >= 0) handlesRef.current.focus(valueIndex);
}
setKeyboardValue(null);
}, [keyboardValue]);
const mergedDraggableTrack = import_react.useMemo(() => {
if (rangeDraggableTrack && mergedStep === null) {
warningOnce(false, "`draggableTrack` is not supported when `step` is `null`.");
return false;
}
return rangeDraggableTrack;
}, [rangeDraggableTrack, mergedStep]);
const onStartMove = useEvent((e, valueIndex) => {
onStartDrag(e, valueIndex);
onBeforeChange?.(getTriggerValue(rawValues));
});
const dragging = draggingIndex !== -1;
import_react.useEffect(() => {
if (!dragging) {
const valueIndex = rawValues.lastIndexOf(draggingValue);
handlesRef.current.focus(valueIndex);
}
}, [dragging]);
const sortedCacheValues = import_react.useMemo(() => [...cacheValues].sort((a, b) => a - b), [cacheValues]);
const [includedStart, includedEnd] = import_react.useMemo(() => {
if (!rangeEnabled) return [mergedMin, sortedCacheValues[0]];
return [sortedCacheValues[0], sortedCacheValues[sortedCacheValues.length - 1]];
}, [
sortedCacheValues,
rangeEnabled,
mergedMin
]);
import_react.useImperativeHandle(ref, () => ({
focus: () => {
handlesRef.current.focus(0);
},
blur: () => {
const { activeElement } = document;
if (containerRef.current?.contains(activeElement)) activeElement?.blur();
}
}));
import_react.useEffect(() => {
if (autoFocus) handlesRef.current.focus(0);
}, []);
const context = import_react.useMemo(() => ({
min: mergedMin,
max: mergedMax,
direction,
disabled,
keyboard,
step: mergedStep,
included,
includedStart,
includedEnd,
range: rangeEnabled,
tabIndex,
ariaLabelForHandle,
ariaLabelledByForHandle,
ariaRequired,
ariaValueTextFormatterForHandle,
styles: styles || {},
classNames: classNames || {}
}), [
mergedMin,
mergedMax,
direction,
disabled,
keyboard,
mergedStep,
included,
includedStart,
includedEnd,
rangeEnabled,
tabIndex,
ariaLabelForHandle,
ariaLabelledByForHandle,
ariaRequired,
ariaValueTextFormatterForHandle,
styles,
classNames
]);
return /* @__PURE__ */ import_react.createElement(SliderContext.Provider, { value: context }, /* @__PURE__ */ import_react.createElement("div", {
ref: containerRef,
className: clsx(prefixCls, className, {
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-vertical`]: vertical,
[`${prefixCls}-horizontal`]: !vertical,
[`${prefixCls}-with-marks`]: markList.length
}),
style,
onMouseDown: onSliderMouseDown,
id
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-rail`, classNames?.rail),
style: {
...railStyle,
...styles?.rail
}
}), track !== false && /* @__PURE__ */ import_react.createElement(Tracks, {
prefixCls,
style: trackStyle,
values: rawValues,
startPoint,
onStartMove: mergedDraggableTrack ? onStartMove : void 0
}), /* @__PURE__ */ import_react.createElement(Steps$3, {
prefixCls,
marks: markList,
dots,
style: dotStyle,
activeStyle: activeDotStyle
}), /* @__PURE__ */ import_react.createElement(Handles, {
ref: handlesRef,
prefixCls,
style: handleStyle,
values: cacheValues,
draggingIndex,
draggingDelete,
onStartMove,
onOffsetChange: onHandleOffsetChange,
onFocus,
onBlur,
handleRender,
activeHandleRender,
onChangeComplete: finishChange,
onDelete: rangeEditable ? onDelete : void 0
}), /* @__PURE__ */ import_react.createElement(Marks, {
prefixCls,
marks: markList,
onClick: changeToCloseValue
})));
});
Slider$1.displayName = "Slider";
//#endregion
//#region node_modules/@rc-component/slider/es/index.js
var es_default$10 = Slider$1;
//#endregion
//#region node_modules/antd/es/slider/Context.js
/** @private Internal context. Do not use in your production. */
var SliderInternalContext = /* @__PURE__ */ (0, import_react.createContext)({});
//#endregion
//#region node_modules/antd/es/slider/SliderTooltip.js
var SliderTooltip = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { open, draggingDelete, value } = props;
const innerRef = (0, import_react.useRef)(null);
const mergedOpen = open && !draggingDelete;
const rafRef = (0, import_react.useRef)(null);
function cancelKeepAlign() {
wrapperRaf.cancel(rafRef.current);
rafRef.current = null;
}
function keepAlign() {
rafRef.current = wrapperRaf(() => {
innerRef.current?.forceAlign();
rafRef.current = null;
});
}
import_react.useEffect(() => {
if (mergedOpen) keepAlign();
else cancelKeepAlign();
return cancelKeepAlign;
}, [
mergedOpen,
props.title,
value
]);
return /* @__PURE__ */ import_react.createElement(Tooltip, {
ref: composeRef(innerRef, ref),
...props,
open: mergedOpen
});
});
SliderTooltip.displayName = "SliderTooltip";
//#endregion
//#region node_modules/antd/es/slider/style/index.js
var genBaseStyle$9 = (token) => {
const { componentCls, antCls, controlSize, dotSize, marginFull, marginPart, colorFillContentHover, handleColorDisabled, calc, handleSize, handleSizeHover, handleActiveColor, handleActiveOutlineColor, handleLineWidth, handleLineWidthHover, motionDurationMid } = token;
return { [componentCls]: {
...resetComponent(token),
position: "relative",
height: controlSize,
margin: `${unit$1(marginPart)} ${unit$1(marginFull)}`,
padding: 0,
cursor: "pointer",
touchAction: "none",
"&-vertical": { margin: `${unit$1(marginFull)} ${unit$1(marginPart)}` },
[`${componentCls}-rail`]: {
position: "absolute",
backgroundColor: token.railBg,
borderRadius: token.borderRadiusXS,
transition: `background-color ${motionDurationMid}`
},
[`${componentCls}-track,${componentCls}-tracks`]: {
position: "absolute",
transition: `background-color ${motionDurationMid}`
},
[`${componentCls}-track`]: {
backgroundColor: token.trackBg,
borderRadius: token.borderRadiusXS
},
[`${componentCls}-track-draggable`]: {
boxSizing: "content-box",
backgroundClip: "content-box",
border: "solid rgba(0,0,0,0)"
},
"&:hover": {
[`${componentCls}-rail`]: { backgroundColor: token.railHoverBg },
[`${componentCls}-track`]: { backgroundColor: token.trackHoverBg },
[`${componentCls}-dot`]: { borderColor: colorFillContentHover },
[`${componentCls}-handle::after`]: { boxShadow: `0 0 0 ${unit$1(handleLineWidth)} ${token.colorPrimaryBorderHover}` },
[`${componentCls}-dot-active`]: { borderColor: token.dotActiveBorderColor }
},
[`${componentCls}-handle`]: {
position: "absolute",
width: handleSize,
height: handleSize,
outline: "none",
userSelect: "none",
"&-dragging-delete": { opacity: 0 },
"&::before": {
content: "\"\"",
position: "absolute",
insetInlineStart: calc(handleLineWidth).mul(-1).equal(),
insetBlockStart: calc(handleLineWidth).mul(-1).equal(),
width: calc(handleSize).add(calc(handleLineWidth).mul(2)).equal(),
height: calc(handleSize).add(calc(handleLineWidth).mul(2)).equal(),
backgroundColor: "transparent"
},
"&::after": {
content: "\"\"",
position: "absolute",
insetBlockStart: 0,
insetInlineStart: 0,
width: handleSize,
height: handleSize,
backgroundColor: token.colorBgElevated,
boxShadow: `0 0 0 ${unit$1(handleLineWidth)} ${token.handleColor}`,
outline: `0px solid transparent`,
borderRadius: "50%",
cursor: "pointer",
transition: [
"inset-inline-start",
"inset-block-start",
"width",
"height",
"box-shadow",
"outline"
].map((prop) => `${prop} ${motionDurationMid}`).join(", ")
},
"&:hover, &:active, &:focus": {
"&::before": {
insetInlineStart: calc(handleSizeHover).sub(handleSize).div(2).add(handleLineWidthHover).mul(-1).equal(),
insetBlockStart: calc(handleSizeHover).sub(handleSize).div(2).add(handleLineWidthHover).mul(-1).equal(),
width: calc(handleSizeHover).add(calc(handleLineWidthHover).mul(2)).equal(),
height: calc(handleSizeHover).add(calc(handleLineWidthHover).mul(2)).equal()
},
"&::after": {
boxShadow: `0 0 0 ${unit$1(handleLineWidthHover)} ${handleActiveColor}`,
outline: `6px solid ${handleActiveOutlineColor}`,
width: handleSizeHover,
height: handleSizeHover,
insetInlineStart: token.calc(handleSize).sub(handleSizeHover).div(2).equal(),
insetBlockStart: token.calc(handleSize).sub(handleSizeHover).div(2).equal()
}
}
},
[`&-lock ${componentCls}-handle`]: { "&::before, &::after": { transition: "none" } },
[`${componentCls}-mark`]: {
position: "absolute",
fontSize: token.fontSize
},
[`${componentCls}-mark-text`]: {
position: "absolute",
display: "inline-block",
color: token.colorTextDescription,
textAlign: "center",
wordBreak: "keep-all",
cursor: "pointer",
userSelect: "none",
"&-active": { color: token.colorText }
},
[`${componentCls}-step`]: {
position: "absolute",
background: "transparent",
pointerEvents: "none"
},
[`${componentCls}-dot`]: {
position: "absolute",
width: dotSize,
height: dotSize,
backgroundColor: token.colorBgElevated,
border: `${unit$1(handleLineWidth)} solid ${token.dotBorderColor}`,
borderRadius: "50%",
cursor: "pointer",
transition: `border-color ${token.motionDurationSlow}`,
pointerEvents: "auto",
"&-active": { borderColor: token.dotActiveBorderColor }
},
[`&${componentCls}-disabled`]: {
cursor: "not-allowed",
[`${componentCls}-rail`]: { backgroundColor: `${token.railBg} !important` },
[`${componentCls}-track`]: { backgroundColor: `${token.trackBgDisabled} !important` },
[`
${componentCls}-dot
`]: {
backgroundColor: token.colorBgElevated,
borderColor: token.trackBgDisabled,
boxShadow: "none",
cursor: "not-allowed"
},
[`${componentCls}-handle::after`]: {
backgroundColor: token.colorBgElevated,
cursor: "not-allowed",
width: handleSize,
height: handleSize,
boxShadow: `0 0 0 ${unit$1(handleLineWidth)} ${handleColorDisabled}`,
insetInlineStart: 0,
insetBlockStart: 0
},
[`
${componentCls}-mark-text,
${componentCls}-dot
`]: { cursor: `not-allowed !important` }
},
[`&-tooltip ${antCls}-tooltip-container`]: { minWidth: "unset" }
} };
};
var genDirectionStyle = (token, horizontal) => {
const { componentCls, railSize, handleSize, dotSize, marginFull, calc } = token;
const railPadding = horizontal ? "paddingBlock" : "paddingInline";
const full = horizontal ? "width" : "height";
const part = horizontal ? "height" : "width";
const handlePos = horizontal ? "insetBlockStart" : "insetInlineStart";
const markInset = horizontal ? "top" : "insetInlineStart";
const handlePosSize = calc(railSize).mul(3).sub(handleSize).div(2).equal();
const draggableBorderSize = calc(handleSize).sub(railSize).div(2).equal();
const draggableBorder = horizontal ? {
borderWidth: `${unit$1(draggableBorderSize)} 0`,
transform: `translateY(${unit$1(calc(draggableBorderSize).mul(-1).equal())})`
} : {
borderWidth: `0 ${unit$1(draggableBorderSize)}`,
transform: `translateX(${unit$1(token.calc(draggableBorderSize).mul(-1).equal())})`
};
return {
[railPadding]: railSize,
[part]: calc(railSize).mul(3).equal(),
[`${componentCls}-rail`]: {
[full]: "100%",
[part]: railSize
},
[`${componentCls}-track,${componentCls}-tracks`]: { [part]: railSize },
[`${componentCls}-track-draggable`]: { ...draggableBorder },
[`${componentCls}-handle`]: { [handlePos]: handlePosSize },
[`${componentCls}-mark`]: {
insetInlineStart: 0,
top: 0,
[markInset]: calc(railSize).mul(3).add(horizontal ? 0 : marginFull).equal(),
[full]: "100%"
},
[`${componentCls}-step`]: {
insetInlineStart: 0,
top: 0,
[markInset]: railSize,
[full]: "100%",
[part]: railSize
},
[`${componentCls}-dot`]: {
position: "absolute",
[handlePos]: calc(railSize).sub(dotSize).div(2).equal()
}
};
};
var genHorizontalStyle$3 = (token) => {
const { componentCls, marginPartWithMark } = token;
return { [`${componentCls}-horizontal`]: {
...genDirectionStyle(token, true),
[`&${componentCls}-with-marks`]: { marginBottom: marginPartWithMark }
} };
};
var genVerticalStyle$3 = (token) => {
const { componentCls } = token;
return { [`${componentCls}-vertical`]: {
...genDirectionStyle(token, false),
height: "100%"
} };
};
var prepareComponentToken$27 = (token) => {
const increaseHandleWidth = 1;
const controlSize = token.controlHeightLG / 4;
const controlSizeHover = token.controlHeightSM / 2;
const handleLineWidth = token.lineWidth + increaseHandleWidth;
const handleLineWidthHover = token.lineWidth + increaseHandleWidth * 1.5;
const handleActiveColor = token.colorPrimary;
const handleActiveOutlineColor = new FastColor(handleActiveColor).setA(.2).toRgbString();
return {
controlSize,
railSize: 4,
handleSize: controlSize,
handleSizeHover: controlSizeHover,
dotSize: 8,
handleLineWidth,
handleLineWidthHover,
railBg: token.colorFillTertiary,
railHoverBg: token.colorFillSecondary,
trackBg: token.colorPrimaryBorder,
trackHoverBg: token.colorPrimaryBorderHover,
handleColor: token.colorPrimaryBorder,
handleActiveColor,
handleActiveOutlineColor,
handleColorDisabled: new FastColor(token.colorTextDisabled).onBackground(token.colorBgContainer).toHexString(),
dotBorderColor: token.colorBorderSecondary,
dotActiveBorderColor: token.colorPrimaryBorder,
trackBgDisabled: token.colorBgContainerDisabled
};
};
var style_default$30 = genStyleHooks("Slider", (token) => {
const sliderToken = merge(token, {
marginPart: token.calc(token.controlHeight).sub(token.controlSize).div(2).equal(),
marginFull: token.calc(token.controlSize).div(2).equal(),
marginPartWithMark: token.calc(token.controlHeightLG).sub(token.controlSize).equal()
});
return [
genBaseStyle$9(sliderToken),
genHorizontalStyle$3(sliderToken),
genVerticalStyle$3(sliderToken)
];
}, prepareComponentToken$27);
//#endregion
//#region node_modules/antd/es/slider/useRafLock.js
function useRafLock() {
const [state, setState] = import_react.useState(false);
const rafRef = import_react.useRef(null);
const cleanup = () => {
wrapperRaf.cancel(rafRef.current);
};
const setDelayState = (nextState) => {
cleanup();
if (nextState) setState(nextState);
else rafRef.current = wrapperRaf(() => {
setState(nextState);
});
};
import_react.useEffect(() => cleanup, []);
return [state, setDelayState];
}
//#endregion
//#region node_modules/antd/es/slider/index.js
function getTipFormatter(tipFormatter) {
if (tipFormatter || tipFormatter === null) return tipFormatter;
return (val) => isNumber(val) ? val.toString() : "";
}
var Slider = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, range, className, rootClassName, style, disabled, tooltip = {}, onChangeComplete, classNames, styles, vertical, orientation, ...restProps } = props;
const [, mergedVertical] = useOrientation(orientation, vertical);
const { getPrefixCls, direction: contextDirection, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, getPopupContainer } = useComponentConfig("slider");
const contextDisabled = import_react.useContext(DisabledContext);
const mergedDisabled = disabled ?? contextDisabled;
const mergedProps = {
...props,
disabled: mergedDisabled,
vertical: mergedVertical
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const { handleRender: contextHandleRender, direction: internalContextDirection } = import_react.useContext(SliderInternalContext);
const isRTL = (internalContextDirection || contextDirection) === "rtl";
const [hoverOpen, setHoverOpen] = useRafLock();
const [focusOpen, setFocusOpen] = useRafLock();
const tooltipProps = { ...tooltip };
const { open: tooltipOpen, placement: tooltipPlacement, getPopupContainer: getTooltipPopupContainer, prefixCls: customizeTooltipPrefixCls, formatter: tipFormatter } = tooltipProps;
const lockOpen = tooltipOpen;
const activeOpen = (hoverOpen || focusOpen) && lockOpen !== false;
const mergedTipFormatter = getTipFormatter(tipFormatter);
const [dragging, setDragging] = useRafLock();
const onInternalChangeComplete = (nextValues) => {
onChangeComplete?.(nextValues);
setDragging(false);
};
const getTooltipPlacement = (placement, vert) => {
if (placement) return placement;
if (!vert) return "top";
return isRTL ? "left" : "right";
};
const prefixCls = getPrefixCls("slider", customizePrefixCls);
const [hashId, cssVarCls] = style_default$30(prefixCls);
const rootClassNames = clsx(className, contextClassName, mergedClassNames.root, rootClassName, {
[`${prefixCls}-rtl`]: isRTL,
[`${prefixCls}-lock`]: dragging
}, hashId, cssVarCls);
if (isRTL && !mergedVertical) restProps.reverse = !restProps.reverse;
{
const warning = devUseWarning("Slider");
[
["tooltipPrefixCls", "prefixCls"],
["getTooltipPopupContainer", "getPopupContainer"],
["tipFormatter", "formatter"],
["tooltipPlacement", "placement"],
["tooltipVisible", "open"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, `tooltip.${newName}`);
});
}
import_react.useEffect(() => {
const onMouseUp = () => {
wrapperRaf(() => {
setFocusOpen(false);
}, 1);
};
document.addEventListener("mouseup", onMouseUp);
return () => {
document.removeEventListener("mouseup", onMouseUp);
};
}, []);
const useActiveTooltipHandle = range && !lockOpen;
const handleRender = contextHandleRender || ((node, info) => {
const { index } = info;
const nodeProps = node.props;
function proxyEvent(eventName, event, triggerRestPropsEvent) {
if (triggerRestPropsEvent) restProps[eventName]?.(event);
nodeProps[eventName]?.(event);
}
const passedProps = {
...nodeProps,
onMouseEnter: (e) => {
setHoverOpen(true);
proxyEvent("onMouseEnter", e);
},
onMouseLeave: (e) => {
setHoverOpen(false);
proxyEvent("onMouseLeave", e);
},
onMouseDown: (e) => {
setFocusOpen(true);
setDragging(true);
proxyEvent("onMouseDown", e);
},
onFocus: (e) => {
setFocusOpen(true);
restProps.onFocus?.(e);
proxyEvent("onFocus", e, true);
},
onBlur: (e) => {
setFocusOpen(false);
restProps.onBlur?.(e);
proxyEvent("onBlur", e, true);
}
};
const cloneNode = /* @__PURE__ */ import_react.cloneElement(node, passedProps);
const open = (!!lockOpen || activeOpen) && mergedTipFormatter !== null;
if (!useActiveTooltipHandle) return /* @__PURE__ */ import_react.createElement(SliderTooltip, {
...tooltipProps,
prefixCls: getPrefixCls("tooltip", customizeTooltipPrefixCls),
title: mergedTipFormatter ? mergedTipFormatter(info.value) : "",
value: info.value,
open,
placement: getTooltipPlacement(tooltipPlacement, mergedVertical),
key: index,
classNames: { root: `${prefixCls}-tooltip` },
getPopupContainer: getTooltipPopupContainer || getPopupContainer
}, cloneNode);
return cloneNode;
});
const activeHandleRender = useActiveTooltipHandle ? (handle, info) => {
const cloneNode = /* @__PURE__ */ import_react.cloneElement(handle, { style: {
...handle.props.style,
visibility: "hidden"
} });
return /* @__PURE__ */ import_react.createElement(SliderTooltip, {
...tooltipProps,
prefixCls: getPrefixCls("tooltip", customizeTooltipPrefixCls),
title: mergedTipFormatter ? mergedTipFormatter(info.value) : "",
open: mergedTipFormatter !== null && activeOpen,
placement: getTooltipPlacement(tooltipPlacement, mergedVertical),
key: "tooltip",
classNames: { root: `${prefixCls}-tooltip` },
getPopupContainer: getTooltipPopupContainer || getPopupContainer,
draggingDelete: info.draggingDelete
}, cloneNode);
} : void 0;
const rootStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
return /* @__PURE__ */ import_react.createElement(es_default$10, {
...restProps,
classNames: mergedClassNames,
styles: mergedStyles,
step: restProps.step,
range,
className: rootClassNames,
style: rootStyle,
disabled: mergedDisabled,
vertical: mergedVertical,
ref,
prefixCls,
handleRender,
activeHandleRender,
onChangeComplete: onInternalChangeComplete
});
});
Slider.displayName = "Slider";
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorSlider.js
var GradientColorSlider = (props) => {
const { prefixCls, colors, type, color, range = false, className, activeIndex, onActive, onDragStart, onDragChange, onKeyDelete, ...restProps } = props;
const sliderProps = {
...restProps,
track: false
};
const linearCss = import_react.useMemo(() => {
return `linear-gradient(90deg, ${colors.map((c) => `${c.color} ${c.percent}%`).join(", ")})`;
}, [colors]);
const pointColor = import_react.useMemo(() => {
if (!color || !type) return null;
if (type === "alpha") return color.toRgbString();
return `hsl(${color.toHsb().h}, 100%, 50%)`;
}, [color, type]);
const onInternalDragStart = useEvent(onDragStart);
const onInternalDragChange = useEvent(onDragChange);
const unstableContext = import_react.useMemo(() => ({
onDragStart: onInternalDragStart,
onDragChange: onInternalDragChange
}), []);
const handleRender = useEvent((ori, info) => {
const { onFocus, style, className: handleCls, onKeyDown } = ori.props;
const mergedStyle = { ...style };
if (type === "gradient") mergedStyle.background = getGradientPercentColor(colors, info.value);
return /* @__PURE__ */ import_react.cloneElement(ori, {
onFocus: (e) => {
onActive?.(info.index);
onFocus?.(e);
},
style: mergedStyle,
className: clsx(handleCls, { [`${prefixCls}-slider-handle-active`]: activeIndex === info.index }),
onKeyDown: (e) => {
if ((e.key === "Delete" || e.key === "Backspace") && onKeyDelete) onKeyDelete(info.index);
onKeyDown?.(e);
}
});
});
const sliderContext = import_react.useMemo(() => ({
direction: "ltr",
handleRender
}), []);
return /* @__PURE__ */ import_react.createElement(SliderInternalContext.Provider, { value: sliderContext }, /* @__PURE__ */ import_react.createElement(UnstableContext$3.Provider, { value: unstableContext }, /* @__PURE__ */ import_react.createElement(Slider, {
...sliderProps,
className: clsx(className, `${prefixCls}-slider`),
tooltip: { open: false },
range: {
editable: range,
minCount: 2
},
styles: {
rail: { background: linearCss },
handle: pointColor ? { background: pointColor } : {}
},
classNames: {
rail: `${prefixCls}-slider-rail`,
handle: `${prefixCls}-slider-handle`
}
})));
};
var SingleColorSlider = (props) => {
const { value, onChange, onChangeComplete } = props;
const singleOnChange = (v) => onChange(v[0]);
const singleOnChangeComplete = (v) => onChangeComplete(v[0]);
return /* @__PURE__ */ import_react.createElement(GradientColorSlider, {
...props,
value: [value],
onChange: singleOnChange,
onChangeComplete: singleOnChangeComplete
});
};
//#endregion
//#region node_modules/antd/es/color-picker/components/PanelPicker/GradientColorBar.js
function sortColors(colors) {
return _toConsumableArray$8(colors).sort((a, b) => a.percent - b.percent);
}
/**
* GradientColorBar will auto show when the mode is `gradient`.
*/
var GradientColorBar = (props) => {
const { prefixCls, mode, onChange, onChangeComplete, onActive, activeIndex, onGradientDragging, colors } = props;
const isGradient = mode === "gradient";
const colorList = import_react.useMemo(() => colors.map((info) => ({
percent: info.percent,
color: info.color.toRgbString()
})), [colors]);
const values = import_react.useMemo(() => colorList.map((info) => info.percent), [colorList]);
const colorsRef = import_react.useRef(colorList);
const onDragStart = ({ rawValues, draggingIndex, draggingValue }) => {
if (rawValues.length > colorList.length) {
const newPointColor = getGradientPercentColor(colorList, draggingValue);
const nextColors = _toConsumableArray$8(colorList);
nextColors.splice(draggingIndex, 0, {
percent: draggingValue,
color: newPointColor
});
colorsRef.current = nextColors;
} else colorsRef.current = colorList;
onGradientDragging(true);
onChange(new AggregationColor(sortColors(colorsRef.current)), true);
};
const onDragChange = ({ deleteIndex, draggingIndex, draggingValue }) => {
let nextColors = _toConsumableArray$8(colorsRef.current);
if (deleteIndex !== -1) nextColors.splice(deleteIndex, 1);
else {
nextColors[draggingIndex] = {
...nextColors[draggingIndex],
percent: draggingValue
};
nextColors = sortColors(nextColors);
}
onChange(new AggregationColor(nextColors), true);
};
const onKeyDelete = (index) => {
const nextColors = _toConsumableArray$8(colorList);
nextColors.splice(index, 1);
const nextColor = new AggregationColor(nextColors);
onChange(nextColor);
onChangeComplete(nextColor);
};
const onInternalChangeComplete = (nextValues) => {
onChangeComplete(new AggregationColor(colorList));
if (activeIndex >= nextValues.length) onActive(nextValues.length - 1);
onGradientDragging(false);
};
if (!isGradient) return null;
return /* @__PURE__ */ import_react.createElement(GradientColorSlider, {
min: 0,
max: 100,
prefixCls,
className: `${prefixCls}-gradient-slider`,
colors: colorList,
color: null,
value: values,
range: true,
onChangeComplete: onInternalChangeComplete,
disabled: false,
type: "gradient",
activeIndex,
onActive,
onDragStart,
onDragChange,
onKeyDelete
});
};
var GradientColorBar_default = /* @__PURE__ */ import_react.memo(GradientColorBar);
//#endregion
//#region node_modules/antd/es/color-picker/components/PanelPicker/index.js
var components = { slider: SingleColorSlider };
var PanelPicker = () => {
const panelPickerContext = (0, import_react.useContext)(PanelPickerContext);
const { mode, onModeChange, modeOptions, prefixCls, allowClear, value, disabledAlpha, onChange, onClear, onChangeComplete, activeIndex, gradientDragging, ...injectProps } = panelPickerContext;
const colors = import_react.useMemo(() => {
if (!value.cleared) return value.getColors();
return [{
percent: 0,
color: new AggregationColor("")
}, {
percent: 100,
color: new AggregationColor("")
}];
}, [value]);
const isSingle = !value.isGradient();
const [lockedColor, setLockedColor] = import_react.useState(value);
useLayoutEffect$1(() => {
if (!isSingle) setLockedColor(colors[activeIndex]?.color);
}, [
isSingle,
colors,
gradientDragging,
activeIndex
]);
const activeColor = import_react.useMemo(() => {
if (isSingle) return value;
if (gradientDragging) return lockedColor;
return colors[activeIndex]?.color;
}, [
colors,
value,
activeIndex,
isSingle,
lockedColor,
gradientDragging
]);
const [pickerColor, setPickerColor] = import_react.useState(activeColor);
const [forceSync, setForceSync] = useForceUpdate();
const mergedPickerColor = pickerColor?.equals(activeColor) ? activeColor : pickerColor;
useLayoutEffect$1(() => {
setPickerColor(activeColor);
}, [forceSync, activeColor?.toHexString()]);
const fillColor = (nextColor, info) => {
let submitColor = generateColor(nextColor);
if (value.cleared) {
const rgb = submitColor.toRgb();
if (!rgb.r && !rgb.g && !rgb.b && info) {
const { type: infoType, value: infoValue = 0 } = info;
submitColor = new AggregationColor({
h: infoType === "hue" ? infoValue : 0,
s: 1,
b: 1,
a: infoType === "alpha" ? infoValue / 100 : 1
});
} else submitColor = genAlphaColor(submitColor);
}
if (mode === "single") return submitColor;
const nextColors = _toConsumableArray$8(colors);
nextColors[activeIndex] = {
...nextColors[activeIndex],
color: submitColor
};
return new AggregationColor(nextColors);
};
const onPickerChange = (colorValue, fromPicker, info) => {
const nextColor = fillColor(colorValue, info);
setPickerColor(nextColor.isGradient() ? nextColor.getColors()[activeIndex].color : nextColor);
onChange(nextColor, fromPicker);
};
const onInternalChangeComplete = (nextColor, info) => {
onChangeComplete(fillColor(nextColor, info));
setForceSync();
};
const onInputChange = (colorValue) => {
onChange(fillColor(colorValue));
};
let operationNode = null;
const showMode = modeOptions.length > 1;
if (allowClear || showMode) operationNode = /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-operation` }, showMode && /* @__PURE__ */ import_react.createElement(Segmented, {
size: "small",
options: modeOptions,
value: mode,
onChange: onModeChange
}), /* @__PURE__ */ import_react.createElement(ColorClear, {
prefixCls,
value,
onChange: (clearColor) => {
onChange(clearColor);
onClear?.();
},
...injectProps
}));
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, operationNode, /* @__PURE__ */ import_react.createElement(GradientColorBar_default, {
...panelPickerContext,
colors
}), /* @__PURE__ */ import_react.createElement(es_default$25, {
prefixCls,
value: mergedPickerColor?.toHsb(),
disabledAlpha,
onChange: (colorValue, info) => {
onPickerChange(colorValue, true, info);
},
onChangeComplete: (colorValue, info) => {
onInternalChangeComplete(colorValue, info);
},
components
}), /* @__PURE__ */ import_react.createElement(ColorInput, {
value: activeColor,
onChange: onInputChange,
prefixCls,
disabledAlpha,
...injectProps
}));
};
//#endregion
//#region node_modules/antd/es/color-picker/components/PanelPresets.js
var PanelPresets = () => {
const { prefixCls, value, presets, onChange } = (0, import_react.useContext)(PanelPresetsContext);
return Array.isArray(presets) ? /* @__PURE__ */ import_react.createElement(ColorPresets, {
value,
presets,
prefixCls,
onChange
}) : null;
};
//#endregion
//#region node_modules/antd/es/color-picker/ColorPickerPanel.js
var ColorPickerPanel = (props) => {
const { prefixCls, presets, panelRender, value, onChange, onClear, allowClear, disabledAlpha, mode, onModeChange, modeOptions, onChangeComplete, activeIndex, onActive, format, onFormatChange, gradientDragging, onGradientDragging, disabledFormat } = props;
const colorPickerPanelPrefixCls = `${prefixCls}-inner`;
const panelContext = import_react.useMemo(() => ({
prefixCls,
value,
onChange,
onClear,
allowClear,
disabledAlpha,
mode,
onModeChange,
modeOptions,
onChangeComplete,
activeIndex,
onActive,
format,
onFormatChange,
gradientDragging,
onGradientDragging,
disabledFormat
}), [
prefixCls,
value,
onChange,
onClear,
allowClear,
disabledAlpha,
mode,
onModeChange,
modeOptions,
onChangeComplete,
activeIndex,
onActive,
format,
onFormatChange,
gradientDragging,
onGradientDragging,
disabledFormat
]);
const presetContext = import_react.useMemo(() => ({
prefixCls,
value,
presets,
onChange
}), [
prefixCls,
value,
presets,
onChange
]);
const innerPanel = /* @__PURE__ */ import_react.createElement("div", { className: `${colorPickerPanelPrefixCls}-content` }, /* @__PURE__ */ import_react.createElement(PanelPicker, null), Array.isArray(presets) && /* @__PURE__ */ import_react.createElement(Divider, null), /* @__PURE__ */ import_react.createElement(PanelPresets, null));
return /* @__PURE__ */ import_react.createElement(PanelPickerContext.Provider, { value: panelContext }, /* @__PURE__ */ import_react.createElement(PanelPresetsContext.Provider, { value: presetContext }, /* @__PURE__ */ import_react.createElement("div", { className: colorPickerPanelPrefixCls }, typeof panelRender === "function" ? panelRender(innerPanel, { components: {
Picker: PanelPicker,
Presets: PanelPresets
} }) : innerPanel)));
};
ColorPickerPanel.displayName = "ColorPickerPanel";
//#endregion
//#region node_modules/antd/es/color-picker/components/ColorTrigger.js
var ColorTrigger = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { color, prefixCls, open, disabled, format, className, style, classNames, styles, showText, activeIndex, ...rest } = props;
const colorTriggerPrefixCls = `${prefixCls}-trigger`;
const colorTextPrefixCls = `${colorTriggerPrefixCls}-text`;
const colorTextCellPrefixCls = `${colorTextPrefixCls}-cell`;
const [locale] = useLocale$1("ColorPicker");
const desc = import_react.useMemo(() => {
if (!showText) return "";
if (typeof showText === "function") return showText(color);
if (color.cleared) return locale.transparent;
if (color.isGradient()) return color.getColors().map((c, index) => {
const inactive = activeIndex !== -1 && activeIndex !== index;
return /* @__PURE__ */ import_react.createElement("span", {
key: index,
className: clsx(colorTextCellPrefixCls, inactive && `${colorTextCellPrefixCls}-inactive`)
}, c.color.toRgbString(), " ", c.percent, "%");
});
const hexString = color.toHexString().toUpperCase();
const alpha = getColorAlpha(color);
switch (format) {
case "rgb": return color.toRgbString();
case "hsb": return color.toHsbString();
default: return alpha < 100 ? `${hexString.slice(0, 7)},${alpha}%` : hexString;
}
}, [
color,
format,
showText,
activeIndex,
locale.transparent,
colorTextCellPrefixCls
]);
const containerNode = (0, import_react.useMemo)(() => color.cleared ? /* @__PURE__ */ import_react.createElement(ColorClear, {
prefixCls,
className: classNames.body,
style: styles.body
}) : /* @__PURE__ */ import_react.createElement(ColorBlock, {
prefixCls,
color: color.toCssString(),
className: classNames.body,
innerClassName: classNames.content,
style: styles.body,
innerStyle: styles.content
}), [
color,
prefixCls,
classNames.body,
classNames.content,
styles.body,
styles.content
]);
return /* @__PURE__ */ import_react.createElement("div", {
ref,
className: clsx(colorTriggerPrefixCls, className, classNames.root, {
[`${colorTriggerPrefixCls}-active`]: open,
[`${colorTriggerPrefixCls}-disabled`]: disabled
}),
style: {
...styles.root,
...style
},
...pickAttrs(rest)
}, containerNode, showText && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(colorTextPrefixCls, classNames.description),
style: styles.description
}, desc));
});
//#endregion
//#region node_modules/antd/es/color-picker/hooks/useModeColor.js
/**
* Combine the `color` and `mode` to make sure sync of state.
*/
function useModeColor(defaultValue, value, mode) {
const [locale] = useLocale$1("ColorPicker");
const [mergedColor, setMergedColor] = useControlledState(defaultValue, value);
const [modeState, setModeState] = import_react.useState("single");
const [modeOptionList, modeSet] = import_react.useMemo(() => {
const list = (Array.isArray(mode) ? mode : [mode]).filter((m) => m);
if (!list.length) list.push("single");
const modes = new Set(list);
const optionList = [];
const pushOption = (modeType, localeTxt) => {
if (modes.has(modeType)) optionList.push({
label: localeTxt,
value: modeType
});
};
pushOption("single", locale.singleColor);
pushOption("gradient", locale.gradientColor);
return [optionList, modes];
}, [
mode,
locale.singleColor,
locale.gradientColor
]);
const [cacheColor, setCacheColor] = import_react.useState(null);
const setColor = useEvent((nextColor) => {
setCacheColor(nextColor);
setMergedColor(nextColor);
});
const postColor = import_react.useMemo(() => {
const colorObj = generateColor(mergedColor || "");
return colorObj.equals(cacheColor) ? cacheColor : colorObj;
}, [mergedColor, cacheColor]);
const postMode = import_react.useMemo(() => {
if (modeSet.has(modeState)) return modeState;
return modeOptionList[0]?.value;
}, [
modeSet,
modeState,
modeOptionList
]);
import_react.useEffect(() => {
setModeState(postColor.isGradient() ? "gradient" : "single");
}, [postColor]);
return [
postColor,
setColor,
postMode,
setModeState,
modeOptionList
];
}
//#endregion
//#region node_modules/antd/es/color-picker/style/color-block.js
/**
* @private Internal usage only
* see: https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/conic-gradient#checkerboard
*/
var getTransBg = (size, colorFill) => ({
backgroundImage: `conic-gradient(${colorFill} 25%, transparent 25% 50%, ${colorFill} 50% 75%, transparent 75% 100%)`,
backgroundSize: `${size} ${size}`
});
var genColorBlockStyle = (token, size) => {
const { componentCls, borderRadiusSM, colorPickerInsetShadow, lineWidth, colorFillSecondary } = token;
return { [`${componentCls}-color-block`]: {
position: "relative",
borderRadius: borderRadiusSM,
width: size,
height: size,
boxShadow: colorPickerInsetShadow,
flex: "none",
...getTransBg("50%", token.colorFillSecondary),
[`${componentCls}-color-block-inner`]: {
width: "100%",
height: "100%",
boxShadow: `inset 0 0 0 ${unit$1(lineWidth)} ${colorFillSecondary}`,
borderRadius: "inherit"
}
} };
};
//#endregion
//#region node_modules/antd/es/color-picker/style/input.js
var genInputStyle = (token) => {
const { componentCls, antCls, fontSizeSM, lineHeightSM, colorPickerAlphaInputWidth, marginXXS, paddingXXS, controlHeightSM, marginXS, fontSizeIcon, paddingXS, colorTextPlaceholder, colorPickerInputNumberHandleWidth, lineWidth } = token;
return { [`${componentCls}-input-container`]: {
display: "flex",
[`${componentCls}-steppers${antCls}-input-number`]: {
fontSize: fontSizeSM,
lineHeight: lineHeightSM,
padding: 0,
[`${antCls}-input-number-input`]: {
paddingInlineStart: paddingXXS,
paddingInlineEnd: 0
},
[`${antCls}-input-number-handler-wrap`]: { width: colorPickerInputNumberHandleWidth }
},
[`${componentCls}-steppers${componentCls}-alpha-input`]: {
flex: `0 0 ${unit$1(colorPickerAlphaInputWidth)}`,
marginInlineStart: marginXXS
},
[`${componentCls}-format-select${antCls}-select`]: {
marginInlineEnd: marginXS,
width: "auto",
"&-single": {
[`${antCls}-select-selector`]: {
padding: 0,
border: 0
},
[`${antCls}-select-arrow`]: { insetInlineEnd: 0 },
[`${antCls}-select-selection-item`]: {
paddingInlineEnd: token.calc(fontSizeIcon).add(marginXXS).equal(),
fontSize: fontSizeSM,
lineHeight: unit$1(controlHeightSM)
},
[`${antCls}-select-item-option-content`]: {
fontSize: fontSizeSM,
lineHeight: lineHeightSM
},
[`${antCls}-select-dropdown`]: { [`${antCls}-select-item`]: { minHeight: "auto" } }
}
},
[`${componentCls}-input`]: {
gap: marginXXS,
alignItems: "center",
flex: 1,
width: 0,
[`${componentCls}-hsb-input,${componentCls}-rgb-input`]: {
height: controlHeightSM,
display: "flex",
gap: marginXXS,
alignItems: "center"
},
[`${componentCls}-steppers`]: { flex: 1 },
[`${componentCls}-hex-input${antCls}-input-affix-wrapper`]: {
flex: 1,
padding: `0 ${unit$1(paddingXS)}`,
[`${antCls}-input`]: {
fontSize: fontSizeSM,
textTransform: "uppercase",
lineHeight: unit$1(token.calc(controlHeightSM).sub(token.calc(lineWidth).mul(2)).equal())
},
[`${antCls}-input-prefix`]: { color: colorTextPlaceholder }
}
}
} };
};
//#endregion
//#region node_modules/antd/es/color-picker/style/picker.js
var genPickerStyle = (token) => {
const { componentCls, controlHeightLG, borderRadiusSM, colorPickerInsetShadow, marginSM, colorBgElevated, colorFillSecondary, lineWidthBold, colorPickerHandlerSize } = token;
return {
userSelect: "none",
[`${componentCls}-select`]: {
[`${componentCls}-palette`]: {
minHeight: token.calc(controlHeightLG).mul(4).equal(),
overflow: "hidden",
borderRadius: borderRadiusSM
},
[`${componentCls}-saturation`]: {
position: "absolute",
borderRadius: "inherit",
boxShadow: colorPickerInsetShadow,
inset: 0
},
marginBottom: marginSM
},
[`${componentCls}-handler`]: {
width: colorPickerHandlerSize,
height: colorPickerHandlerSize,
border: `${unit$1(lineWidthBold)} solid ${colorBgElevated}`,
position: "relative",
borderRadius: "50%",
cursor: "pointer",
boxShadow: `${colorPickerInsetShadow}, 0 0 0 1px ${colorFillSecondary}`
}
};
};
//#endregion
//#region node_modules/antd/es/color-picker/style/presets.js
var genPresetsStyle = (token) => {
const { componentCls, antCls, colorTextQuaternary, paddingXXS, colorPickerPresetColorSize, fontSizeSM, colorText, lineHeightSM, lineWidth, borderRadius, colorFill, colorWhite, marginXXS, paddingXS, fontHeightSM } = token;
return { [`${componentCls}-presets`]: {
[`${antCls}-collapse-item > ${antCls}-collapse-header`]: {
padding: 0,
[`${antCls}-collapse-expand-icon`]: {
height: fontHeightSM,
color: colorTextQuaternary,
paddingInlineEnd: paddingXXS
}
},
[`${antCls}-collapse`]: {
display: "flex",
flexDirection: "column",
gap: marginXXS
},
[`${antCls}-collapse-item > ${antCls}-collapse-panel > ${antCls}-collapse-body`]: { padding: `${unit$1(paddingXS)} 0` },
"&-label": {
fontSize: fontSizeSM,
color: colorText,
lineHeight: lineHeightSM
},
"&-items": {
display: "flex",
flexWrap: "wrap",
gap: token.calc(marginXXS).mul(1.5).equal(),
[`${componentCls}-presets-color`]: {
position: "relative",
cursor: "pointer",
width: colorPickerPresetColorSize,
height: colorPickerPresetColorSize,
"&::before": {
content: "\"\"",
pointerEvents: "none",
width: token.calc(colorPickerPresetColorSize).add(token.calc(lineWidth).mul(4)).equal(),
height: token.calc(colorPickerPresetColorSize).add(token.calc(lineWidth).mul(4)).equal(),
position: "absolute",
top: token.calc(lineWidth).mul(-2).equal(),
insetInlineStart: token.calc(lineWidth).mul(-2).equal(),
borderRadius,
border: `${unit$1(lineWidth)} solid transparent`,
transition: `border-color ${token.motionDurationMid} ${token.motionEaseInBack}`
},
"&:hover::before": { borderColor: colorFill },
"&::after": {
boxSizing: "border-box",
position: "absolute",
top: "50%",
insetInlineStart: "21.5%",
display: "table",
width: token.calc(colorPickerPresetColorSize).div(13).mul(5).equal(),
height: token.calc(colorPickerPresetColorSize).div(13).mul(8).equal(),
border: `${unit$1(token.lineWidthBold)} solid ${token.colorWhite}`,
borderTop: 0,
borderInlineStart: 0,
transform: "rotate(45deg) scale(0) translate(-50%,-50%)",
opacity: 0,
content: "\"\"",
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
},
[`&${componentCls}-presets-color-checked`]: {
"&::after": {
opacity: 1,
borderColor: colorWhite,
transform: "rotate(45deg) scale(1) translate(-50%,-50%)",
transition: `transform ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
},
[`&${componentCls}-presets-color-bright`]: { "&::after": { borderColor: "rgba(0, 0, 0, 0.45)" } }
}
}
},
"&-empty": {
fontSize: fontSizeSM,
color: colorTextQuaternary
}
} };
};
//#endregion
//#region node_modules/antd/es/color-picker/style/slider.js
var genSliderStyle = (token) => {
const { componentCls, colorPickerInsetShadow, colorBgElevated, colorFillSecondary, lineWidthBold, colorPickerHandlerSizeSM, colorPickerSliderHeight, marginSM, marginXS } = token;
const handleInnerSize = token.calc(colorPickerHandlerSizeSM).sub(token.calc(lineWidthBold).mul(2).equal()).equal();
const handleHoverSize = token.calc(colorPickerHandlerSizeSM).add(token.calc(lineWidthBold).mul(2).equal()).equal();
const activeHandleStyle = { "&:after": {
transform: "scale(1)",
boxShadow: `${colorPickerInsetShadow}, 0 0 0 1px ${token.colorPrimaryActive}`
} };
return {
[`${componentCls}-slider`]: [getTransBg(unit$1(colorPickerSliderHeight), token.colorFillSecondary), {
margin: 0,
padding: 0,
height: colorPickerSliderHeight,
borderRadius: token.calc(colorPickerSliderHeight).div(2).equal(),
"&-rail": {
height: colorPickerSliderHeight,
borderRadius: token.calc(colorPickerSliderHeight).div(2).equal(),
boxShadow: colorPickerInsetShadow
},
[`& ${componentCls}-slider-handle`]: {
width: handleInnerSize,
height: handleInnerSize,
top: 0,
borderRadius: "100%",
"&:before": {
display: "block",
position: "absolute",
background: "transparent",
left: {
_skip_check_: true,
value: "50%"
},
top: "50%",
transform: "translate(-50%, -50%)",
width: handleHoverSize,
height: handleHoverSize,
borderRadius: "100%"
},
"&:after": {
width: colorPickerHandlerSizeSM,
height: colorPickerHandlerSizeSM,
border: `${unit$1(lineWidthBold)} solid ${colorBgElevated}`,
boxShadow: `${colorPickerInsetShadow}, 0 0 0 1px ${colorFillSecondary}`,
outline: "none",
insetInlineStart: token.calc(lineWidthBold).mul(-1).equal(),
top: token.calc(lineWidthBold).mul(-1).equal(),
background: "transparent",
transition: "none"
},
"&:focus": activeHandleStyle
}
}],
[`${componentCls}-slider-container`]: {
display: "flex",
gap: marginSM,
marginBottom: marginSM,
[`${componentCls}-slider-group`]: {
flex: 1,
flexDirection: "column",
justifyContent: "space-between",
display: "flex",
"&-disabled-alpha": { justifyContent: "center" }
}
},
[`${componentCls}-gradient-slider`]: {
marginBottom: marginXS,
[`& ${componentCls}-slider-handle`]: {
"&:after": { transform: "scale(0.8)" },
"&-active, &:focus": activeHandleStyle
}
}
};
};
//#endregion
//#region node_modules/antd/es/color-picker/style/index.js
var genActiveStyle = (token, borderColor, outlineColor) => ({
borderInlineEndWidth: token.lineWidth,
borderColor,
boxShadow: `0 0 0 ${unit$1(token.controlOutlineWidth)} ${outlineColor}`,
outline: 0
});
var genRtlStyle$1 = (token) => {
const { componentCls } = token;
return { "&-rtl": {
[`${componentCls}-presets-color`]: { "&::after": { direction: "ltr" } },
[`${componentCls}-clear`]: { "&::after": { direction: "ltr" } }
} };
};
var genClearStyle = (token, size, extraStyle) => {
const { componentCls, borderRadiusSM, lineWidth, colorSplit, colorBorder, red6 } = token;
return { [`${componentCls}-clear`]: {
width: size,
height: size,
borderRadius: borderRadiusSM,
border: `${unit$1(lineWidth)} solid ${colorSplit}`,
position: "relative",
overflow: "hidden",
cursor: "inherit",
transition: `all ${token.motionDurationFast}`,
...extraStyle,
"&::after": {
content: "\"\"",
position: "absolute",
insetInlineEnd: token.calc(lineWidth).mul(-1).equal(),
top: token.calc(lineWidth).mul(-1).equal(),
display: "block",
width: 40,
height: 2,
transformOrigin: `calc(100% - 1px) 1px`,
transform: "rotate(-45deg)",
backgroundColor: red6
},
"&:hover": { borderColor: colorBorder }
} };
};
var genStatusStyle$1 = (token) => {
const { componentCls, colorError, colorWarning, colorErrorHover, colorWarningHover, colorErrorOutline, colorWarningOutline } = token;
return {
[`&${componentCls}-status-error`]: {
borderColor: colorError,
"&:hover": { borderColor: colorErrorHover },
[`&${componentCls}-trigger-active`]: { ...genActiveStyle(token, colorError, colorErrorOutline) }
},
[`&${componentCls}-status-warning`]: {
borderColor: colorWarning,
"&:hover": { borderColor: colorWarningHover },
[`&${componentCls}-trigger-active`]: { ...genActiveStyle(token, colorWarning, colorWarningOutline) }
}
};
};
var genSizeStyle$2 = (token) => {
const { componentCls, controlHeightLG, controlHeightSM, controlHeight, controlHeightXS, borderRadius, borderRadiusSM, borderRadiusXS, borderRadiusLG, fontSizeLG } = token;
return {
[`&${componentCls}-lg`]: {
minWidth: controlHeightLG,
minHeight: controlHeightLG,
borderRadius: borderRadiusLG,
[`${componentCls}-color-block, ${componentCls}-clear`]: {
width: controlHeight,
height: controlHeight,
borderRadius
},
[`${componentCls}-trigger-text`]: { fontSize: fontSizeLG }
},
[`&${componentCls}-sm`]: {
minWidth: controlHeightSM,
minHeight: controlHeightSM,
borderRadius: borderRadiusSM,
[`${componentCls}-color-block, ${componentCls}-clear`]: {
width: controlHeightXS,
height: controlHeightXS,
borderRadius: borderRadiusXS
},
[`${componentCls}-trigger-text`]: { lineHeight: unit$1(controlHeightXS) }
}
};
};
var genColorPickerStyle = (token) => {
const { antCls, componentCls, colorPickerWidth, colorPrimary, motionDurationMid, colorBgElevated, colorTextDisabled, colorText, colorBgContainerDisabled, borderRadius, marginXS, marginSM, controlHeight, controlHeightSM, colorBgTextActive, colorPickerPresetColorSize, colorPickerPreviewSize, lineWidth, colorBorder, paddingXXS, fontSize, colorPrimaryHover, controlOutline } = token;
return [{ [componentCls]: {
[`${componentCls}-inner`]: {
"&-content": {
display: "flex",
flexDirection: "column",
width: colorPickerWidth,
[`& > ${antCls}-divider`]: { margin: `${unit$1(marginSM)} 0 ${unit$1(marginXS)}` }
},
[`${componentCls}-panel`]: { ...genPickerStyle(token) },
...genSliderStyle(token),
...genColorBlockStyle(token, colorPickerPreviewSize),
...genInputStyle(token),
...genPresetsStyle(token),
...genClearStyle(token, colorPickerPresetColorSize, { marginInlineStart: "auto" }),
[`${componentCls}-operation`]: {
display: "flex",
justifyContent: "space-between",
marginBottom: marginXS
}
},
"&-trigger": {
minWidth: controlHeight,
minHeight: controlHeight,
borderRadius,
border: `${unit$1(lineWidth)} solid ${colorBorder}`,
cursor: "pointer",
display: "inline-flex",
alignItems: "flex-start",
justifyContent: "center",
transition: `all ${motionDurationMid}`,
background: colorBgElevated,
padding: token.calc(paddingXXS).sub(lineWidth).equal(),
[`${componentCls}-trigger-text`]: {
marginInlineStart: marginXS,
marginInlineEnd: token.calc(marginXS).sub(token.calc(paddingXXS).sub(lineWidth)).equal(),
fontSize,
color: colorText,
alignSelf: "center",
"&-cell": {
"&:not(:last-child):after": { content: "\", \"" },
"&-inactive": { color: colorTextDisabled }
}
},
"&:hover": { borderColor: colorPrimaryHover },
[`&${componentCls}-trigger-active`]: { ...genActiveStyle(token, colorPrimary, controlOutline) },
"&-disabled": {
color: colorTextDisabled,
background: colorBgContainerDisabled,
cursor: "not-allowed",
"&:hover": { borderColor: colorBgTextActive },
[`${componentCls}-trigger-text`]: { color: colorTextDisabled }
},
...genClearStyle(token, controlHeightSM),
...genColorBlockStyle(token, controlHeightSM),
...genStatusStyle$1(token),
...genSizeStyle$2(token)
},
...genRtlStyle$1(token)
} }, genCompactItemStyle(token, { focusElCls: `${componentCls}-trigger-active` })];
};
var style_default$29 = genStyleHooks("ColorPicker", (token) => {
const { colorTextQuaternary, marginSM } = token;
const colorPickerSliderHeight = 8;
return genColorPickerStyle(merge(token, {
colorPickerWidth: 234,
colorPickerHandlerSize: 16,
colorPickerHandlerSizeSM: 12,
colorPickerAlphaInputWidth: 44,
colorPickerInputNumberHandleWidth: 16,
colorPickerPresetColorSize: 24,
colorPickerInsetShadow: `inset 0 0 1px 0 ${colorTextQuaternary}`,
colorPickerSliderHeight,
colorPickerPreviewSize: token.calc(colorPickerSliderHeight).mul(2).add(marginSM).equal()
}));
});
//#endregion
//#region node_modules/antd/es/color-picker/ColorPicker.js
var ColorPicker = (props) => {
const { mode, value, defaultValue, format, defaultFormat, allowClear = false, presets, children, trigger = "click", open, disabled, placement = "bottomLeft", arrow, panelRender, showText, style, className, size: customizeSize, rootClassName, prefixCls: customizePrefixCls, styles, classNames, disabledAlpha = false, onFormatChange, onChange, onClear, onOpenChange, onChangeComplete, getPopupContainer, autoAdjustOverflow = true, destroyTooltipOnHide, destroyOnHidden, disabledFormat, ...rest } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, arrow: contextArrow } = useComponentConfig("colorPicker");
const contextDisabled = (0, import_react.useContext)(DisabledContext);
const mergedDisabled = disabled ?? contextDisabled;
const prefixCls = getPrefixCls("color-picker", customizePrefixCls);
const mergedArrow = useMergedArrow(arrow, contextArrow);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const mergedProps = {
...props,
trigger,
allowClear,
autoAdjustOverflow,
disabledAlpha,
arrow: mergedArrow,
placement,
disabled: mergedDisabled,
size: mergedSize
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { popup: { _default: "root" } });
const [internalPopupOpen, setPopupOpen] = useControlledState(false, open);
const popupOpen = !mergedDisabled && internalPopupOpen;
const [formatValue, setFormatValue] = useControlledState(defaultFormat, format);
const triggerFormatChange = (newFormat) => {
setFormatValue(newFormat);
if (formatValue !== newFormat) onFormatChange?.(newFormat);
};
const triggerOpenChange = (visible) => {
if (!visible || !mergedDisabled) {
setPopupOpen(visible);
onOpenChange?.(visible);
}
};
const [mergedColor, setColor, modeState, setModeState, modeOptions] = useModeColor(defaultValue, value, mode);
const isAlphaColor = (0, import_react.useMemo)(() => getColorAlpha(mergedColor) < 100, [mergedColor]);
const [cachedGradientColor, setCachedGradientColor] = import_react.useState(null);
const onInternalChangeComplete = (color) => {
if (onChangeComplete) {
let changeColor = generateColor(color);
if (disabledAlpha && isAlphaColor) changeColor = genAlphaColor(color);
onChangeComplete(changeColor);
}
};
const onInternalChange = (data, changeFromPickerDrag) => {
let color = generateColor(data);
if (disabledAlpha && isAlphaColor) color = genAlphaColor(color);
setColor(color);
setCachedGradientColor(null);
if (onChange) onChange(color, color.toCssString());
if (!changeFromPickerDrag) onInternalChangeComplete(color);
};
const [activeIndex, setActiveIndex] = import_react.useState(0);
const [gradientDragging, setGradientDragging] = import_react.useState(false);
const onInternalModeChange = (newMode) => {
setModeState(newMode);
if (newMode === "single" && mergedColor.isGradient()) {
setActiveIndex(0);
onInternalChange(new AggregationColor(mergedColor.getColors()[0].color));
setCachedGradientColor(mergedColor);
} else if (newMode === "gradient" && !mergedColor.isGradient()) {
const baseColor = isAlphaColor ? genAlphaColor(mergedColor) : mergedColor;
onInternalChange(new AggregationColor(cachedGradientColor || [{
percent: 0,
color: baseColor
}, {
percent: 100,
color: baseColor
}]));
}
};
const { status: contextStatus } = import_react.useContext(FormItemInputContext);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$29(prefixCls, rootCls);
const mergedRootCls = clsx(rootClassName, cssVarCls, rootCls, { [`${prefixCls}-rtl`]: direction });
const mergedCls = clsx(getStatusClassNames(prefixCls, contextStatus), {
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-lg`]: mergedSize === "large"
}, compactItemClassnames, contextClassName, mergedRootCls, className, hashId);
const mergedPopupCls = clsx(prefixCls, mergedRootCls, mergedClassNames.popup?.root);
devUseWarning("ColorPicker")(!(disabledAlpha && isAlphaColor), "usage", "`disabledAlpha` will make the alpha to be 100% when use alpha color.");
const popoverProps = {
open: popupOpen,
trigger,
placement,
arrow: mergedArrow,
rootClassName,
getPopupContainer,
autoAdjustOverflow,
destroyOnHidden: destroyOnHidden ?? !!destroyTooltipOnHide
};
const mergedStyle = {
...contextStyle,
...style
};
return /* @__PURE__ */ import_react.createElement(Popover, {
classNames: { root: mergedPopupCls },
styles: {
root: mergedStyles.popup?.root,
container: styles?.popupOverlayInner
},
onOpenChange: triggerOpenChange,
content: /* @__PURE__ */ import_react.createElement(ContextIsolator, { form: true }, /* @__PURE__ */ import_react.createElement(ColorPickerPanel, {
mode: modeState,
onModeChange: onInternalModeChange,
modeOptions,
prefixCls,
value: mergedColor,
allowClear,
disabled: mergedDisabled,
disabledAlpha,
presets,
panelRender,
format: formatValue,
onFormatChange: triggerFormatChange,
onChange: onInternalChange,
onChangeComplete: onInternalChangeComplete,
onClear,
activeIndex,
onActive: setActiveIndex,
gradientDragging,
onGradientDragging: setGradientDragging,
disabledFormat
})),
...popoverProps
}, children || /* @__PURE__ */ import_react.createElement(ColorTrigger, {
activeIndex: popupOpen ? activeIndex : -1,
open: popupOpen,
className: mergedCls,
style: mergedStyle,
classNames: mergedClassNames,
styles: mergedStyles,
prefixCls,
disabled: mergedDisabled,
showText,
format: formatValue,
...rest,
color: mergedColor
}));
};
ColorPicker.displayName = "ColorPicker";
ColorPicker._InternalPanelDoNotUseOrYouWillBeFired = genPurePanel(ColorPicker, void 0, (props) => ({
...props,
placement: "bottom",
autoAdjustOverflow: false
}), "color-picker", (prefixCls) => prefixCls);
//#endregion
//#region node_modules/antd/es/color-picker/index.js
var color_picker_default = ColorPicker;
//#endregion
//#region node_modules/antd/es/date-picker/hooks/useMergedPickerSemantic.js
var useMergedPickerSemantic = (pickerType, classNames, styles, popupClassName, popupStyle, mergedProps) => {
const { classNames: contextClassNames, styles: contextStyles } = useComponentConfig(pickerType);
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { popup: { _default: "root" } });
return import_react.useMemo(() => {
return [{
...mergedClassNames,
popup: {
...mergedClassNames.popup,
root: clsx(mergedClassNames.popup?.root, popupClassName)
}
}, {
...mergedStyles,
popup: {
...mergedStyles.popup,
root: {
...mergedStyles.popup?.root,
...popupStyle
}
}
}];
}, [
mergedClassNames,
mergedStyles,
popupClassName,
popupStyle
]);
};
//#endregion
//#region node_modules/antd/es/date-picker/util.js
function getPlaceholder(locale, picker, customizePlaceholder) {
if (customizePlaceholder !== void 0) return customizePlaceholder;
if (picker === "year" && locale.lang.yearPlaceholder) return locale.lang.yearPlaceholder;
if (picker === "quarter" && locale.lang.quarterPlaceholder) return locale.lang.quarterPlaceholder;
if (picker === "month" && locale.lang.monthPlaceholder) return locale.lang.monthPlaceholder;
if (picker === "week" && locale.lang.weekPlaceholder) return locale.lang.weekPlaceholder;
if (picker === "time" && locale.timePickerLocale.placeholder) return locale.timePickerLocale.placeholder;
return locale.lang.placeholder;
}
function getRangePlaceholder(locale, picker, customizePlaceholder) {
if (customizePlaceholder !== void 0) return customizePlaceholder;
if (picker === "year" && locale.lang.yearPlaceholder) return locale.lang.rangeYearPlaceholder;
if (picker === "quarter" && locale.lang.quarterPlaceholder) return locale.lang.rangeQuarterPlaceholder;
if (picker === "month" && locale.lang.monthPlaceholder) return locale.lang.rangeMonthPlaceholder;
if (picker === "week" && locale.lang.weekPlaceholder) return locale.lang.rangeWeekPlaceholder;
if (picker === "time" && locale.timePickerLocale.placeholder) return locale.timePickerLocale.rangePlaceholder;
return locale.lang.rangePlaceholder;
}
function useIcons(props, prefixCls) {
const { allowClear = true } = props;
const { clearIcon, removeIcon } = useIcons$2({
...props,
prefixCls,
componentName: "DatePicker"
});
return [import_react.useMemo(() => {
if (allowClear === false) return false;
return {
clearIcon,
...allowClear === true ? {} : allowClear
};
}, [allowClear, clearIcon]), removeIcon];
}
//#endregion
//#region node_modules/antd/es/date-picker/generatePicker/constant.js
var [WEEK, WEEKPICKER] = ["week", "WeekPicker"];
var [MONTH, MONTHPICKER] = ["month", "MonthPicker"];
var [YEAR, YEARPICKER] = ["year", "YearPicker"];
var [QUARTER, QUARTERPICKER] = ["quarter", "QuarterPicker"];
var [TIME, TIMEPICKER] = ["time", "TimePicker"];
//#endregion
//#region node_modules/antd/es/date-picker/generatePicker/useSuffixIcon.js
var useSuffixIcon = ({ picker, hasFeedback, feedbackIcon, suffixIcon }) => {
if (suffixIcon === null || suffixIcon === false) return null;
if (suffixIcon === true || suffixIcon === void 0) return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, picker === TIME ? /* @__PURE__ */ import_react.createElement(RefIcon$17, null) : /* @__PURE__ */ import_react.createElement(RefIcon$18, null), hasFeedback && feedbackIcon);
return suffixIcon;
};
//#endregion
//#region node_modules/antd/es/date-picker/PickerButton.js
var PickerButton = (props) => /* @__PURE__ */ import_react.createElement(Button, {
size: "small",
type: "primary",
...props
});
//#endregion
//#region node_modules/antd/es/date-picker/generatePicker/useComponents.js
function useComponents(components) {
return (0, import_react.useMemo)(() => ({
button: PickerButton,
...components
}), [components]);
}
//#endregion
//#region node_modules/antd/es/date-picker/generatePicker/generateRangePicker.js
var generateRangePicker = (generateConfig) => {
const RangePicker = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls: customizePrefixCls, getPopupContainer: customGetPopupContainer, components, className, style, classNames, styles, placement, size: customizeSize, disabled: customDisabled, bordered = true, placeholder, status: customStatus, variant: customVariant, picker, dropdownClassName, popupClassName, popupStyle, rootClassName, suffixIcon, separator, ...restProps } = props;
const pickerType = picker === TIME ? "timePicker" : "datePicker";
{
const warning = devUseWarning("DatePicker.RangePicker");
Object.entries({
dropdownClassName: "classNames.popup.root",
popupClassName: "classNames.popup.root",
popupStyle: "styles.popup.root",
bordered: "variant",
onSelect: "onCalendarChange"
}).forEach(([oldProp, newProp]) => {
warning.deprecated(!(oldProp in props), oldProp, newProp);
});
}
const [mergedClassNames, mergedStyles] = useMergedPickerSemantic(pickerType, classNames, styles, popupClassName || dropdownClassName, popupStyle);
const innerRef = import_react.useRef(null);
const { getPrefixCls, direction, getPopupContainer, rangePicker } = (0, import_react.useContext)(ConfigContext);
const prefixCls = getPrefixCls("picker", customizePrefixCls);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const rootPrefixCls = getPrefixCls();
const mergedSeparator = separator ?? rangePicker?.separator;
const [variant, enableVariantCls] = useVariant("rangePicker", customVariant, bordered);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$40(prefixCls, rootCls);
const mergedRootClassName = clsx(hashId, cssVarCls, rootCls, rootClassName);
const [mergedAllowClear] = useIcons(props, prefixCls);
const mergedComponents = useComponents(components);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const { hasFeedback, status: contextStatus, feedbackIcon } = (0, import_react.useContext)(FormItemInputContext);
const mergedSuffixIcon = useSuffixIcon({
picker,
hasFeedback,
feedbackIcon,
suffixIcon
});
(0, import_react.useImperativeHandle)(ref, () => innerRef.current);
const [contextLocale] = useLocale$1("Calendar", locale$1);
const locale = merge$1(contextLocale, props.locale || {});
const [zIndex] = useZIndex("DatePicker", mergedStyles?.popup?.root?.zIndex);
return /* @__PURE__ */ import_react.createElement(ContextIsolator, { space: true }, /* @__PURE__ */ import_react.createElement(RefRangePicker, {
separator: /* @__PURE__ */ import_react.createElement("span", {
"aria-label": "to",
className: `${prefixCls}-separator`
}, mergedSeparator ?? /* @__PURE__ */ import_react.createElement(RefIcon$19, null)),
disabled: mergedDisabled,
ref: innerRef,
placement,
placeholder: getRangePlaceholder(locale, picker, placeholder),
suffixIcon: mergedSuffixIcon,
prevIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-prev-icon` }),
nextIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-next-icon` }),
superPrevIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-super-prev-icon` }),
superNextIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-super-next-icon` }),
transitionName: `${rootPrefixCls}-slide-up`,
picker,
...restProps,
locale: locale.lang,
getPopupContainer: customGetPopupContainer || getPopupContainer,
generateConfig,
components: mergedComponents,
direction,
prefixCls,
rootClassName: mergedRootClassName,
className: clsx({
[`${prefixCls}-large`]: mergedSize === "large",
[`${prefixCls}-small`]: mergedSize === "small",
[`${prefixCls}-${variant}`]: enableVariantCls
}, getStatusClassNames(prefixCls, getMergedStatus(contextStatus, customStatus), hasFeedback), compactItemClassnames, className, rangePicker?.className),
style: {
...rangePicker?.style,
...style
},
classNames: mergedClassNames,
styles: {
...mergedStyles,
popup: {
...mergedStyles.popup,
root: {
...mergedStyles.popup.root,
zIndex
}
}
},
allowClear: mergedAllowClear
}));
});
RangePicker.displayName = "RangePicker";
return RangePicker;
};
//#endregion
//#region node_modules/antd/es/date-picker/generatePicker/generateSinglePicker.js
var generatePicker$1 = (generateConfig) => {
const getPicker = (picker, displayName) => {
const pickerType = displayName === TIMEPICKER ? "timePicker" : "datePicker";
const Picker = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls: customizePrefixCls, getPopupContainer: customizeGetPopupContainer, components, style, className, size: customizeSize, bordered, placement, placeholder, disabled: customDisabled, status: customStatus, variant: customVariant, onCalendarChange, classNames, styles, dropdownClassName, popupClassName, popupStyle, rootClassName, suffixIcon, ...restProps } = props;
const { suffixIcon: contextSuffixIcon } = useComponentConfig(displayName === TIMEPICKER ? "timePicker" : "datePicker");
{
const warning = devUseWarning(displayName || "DatePicker");
warning(picker !== "quarter", "deprecated", `DatePicker.${displayName} is legacy usage. Please use DatePicker[picker='${picker}'] directly.`);
Object.entries({
dropdownClassName: "classNames.popup.root",
popupClassName: "classNames.popup.root",
popupStyle: "styles.popup.root",
bordered: "variant",
onSelect: "onCalendarChange"
}).forEach(([oldProp, newProp]) => {
warning.deprecated(!(oldProp in props), oldProp, newProp);
});
}
const { getPrefixCls, direction, getPopupContainer, [pickerType]: contextPickerConfig } = (0, import_react.useContext)(ConfigContext);
const prefixCls = getPrefixCls("picker", customizePrefixCls);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const mergedProps = {
...props,
size: mergedSize,
disabled: mergedDisabled,
status: customStatus,
variant: customVariant
};
const [mergedClassNames, mergedStyles] = useMergedPickerSemantic(pickerType, classNames, styles, popupClassName || dropdownClassName, popupStyle, mergedProps);
const innerRef = import_react.useRef(null);
const [variant, enableVariantCls] = useVariant("datePicker", customVariant, bordered);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$40(prefixCls, rootCls);
const mergedRootClassName = clsx(hashId, cssVarCls, rootCls, rootClassName);
(0, import_react.useImperativeHandle)(ref, () => innerRef.current);
const additionalProps = { showToday: true };
const mergedPicker = picker || props.picker;
const rootPrefixCls = getPrefixCls();
const { onSelect, multiple } = restProps;
const hasLegacyOnSelect = onSelect && picker === "time" && !multiple;
const onInternalCalendarChange = (date, dateStr, info) => {
onCalendarChange?.(date, dateStr, info);
if (hasLegacyOnSelect) onSelect(date);
};
const [mergedAllowClear, removeIcon] = useIcons(props, prefixCls);
const mergedComponents = useComponents(components);
const { hasFeedback, status: contextStatus, feedbackIcon } = (0, import_react.useContext)(FormItemInputContext);
const mergedSuffixIcon = useSuffixIcon({
picker: mergedPicker,
hasFeedback,
feedbackIcon,
suffixIcon: suffixIcon === void 0 ? contextSuffixIcon : suffixIcon
});
const [contextLocale] = useLocale$1("DatePicker", locale$1);
const locale = merge$1(contextLocale, props.locale || {});
const [zIndex] = useZIndex("DatePicker", mergedStyles?.popup?.root?.zIndex);
return /* @__PURE__ */ import_react.createElement(ContextIsolator, { space: true }, /* @__PURE__ */ import_react.createElement(es_default$17, {
ref: innerRef,
placeholder: getPlaceholder(locale, mergedPicker, placeholder),
suffixIcon: mergedSuffixIcon,
placement,
prevIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-prev-icon` }),
nextIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-next-icon` }),
superPrevIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-super-prev-icon` }),
superNextIcon: /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-super-next-icon` }),
transitionName: `${rootPrefixCls}-slide-up`,
picker,
onCalendarChange: onInternalCalendarChange,
...additionalProps,
...restProps,
locale: locale.lang,
getPopupContainer: customizeGetPopupContainer || getPopupContainer,
generateConfig,
components: mergedComponents,
direction,
disabled: mergedDisabled,
prefixCls,
rootClassName: mergedRootClassName,
className: clsx({
[`${prefixCls}-large`]: mergedSize === "large",
[`${prefixCls}-small`]: mergedSize === "small",
[`${prefixCls}-${variant}`]: enableVariantCls
}, getStatusClassNames(prefixCls, getMergedStatus(contextStatus, customStatus), hasFeedback), compactItemClassnames, contextPickerConfig?.className, className),
style: {
...contextPickerConfig?.style,
...style
},
classNames: mergedClassNames,
styles: {
...mergedStyles,
popup: {
...mergedStyles.popup,
root: {
...mergedStyles.popup.root,
zIndex
}
}
},
allowClear: mergedAllowClear,
removeIcon
}));
});
if (displayName) Picker.displayName = displayName;
return Picker;
};
const DatePicker = getPicker();
const WeekPicker = getPicker(WEEK, WEEKPICKER);
const MonthPicker = getPicker(MONTH, MONTHPICKER);
const YearPicker = getPicker(YEAR, YEARPICKER);
const QuarterPicker = getPicker(QUARTER, QUARTERPICKER);
return {
DatePicker,
WeekPicker,
MonthPicker,
YearPicker,
TimePicker: getPicker(TIME, TIMEPICKER),
QuarterPicker
};
};
//#endregion
//#region node_modules/antd/es/date-picker/generatePicker/index.js
var generatePicker = (generateConfig) => {
const { DatePicker, WeekPicker, MonthPicker, YearPicker, TimePicker, QuarterPicker } = generatePicker$1(generateConfig);
const RangePicker = generateRangePicker(generateConfig);
const MergedDatePicker = DatePicker;
MergedDatePicker.WeekPicker = WeekPicker;
MergedDatePicker.MonthPicker = MonthPicker;
MergedDatePicker.YearPicker = YearPicker;
MergedDatePicker.RangePicker = RangePicker;
MergedDatePicker.TimePicker = TimePicker;
MergedDatePicker.QuarterPicker = QuarterPicker;
MergedDatePicker.displayName = "DatePicker";
return MergedDatePicker;
};
//#endregion
//#region node_modules/antd/es/date-picker/index.js
var DatePicker = generatePicker(generateConfig);
DatePicker._InternalPanelDoNotUseOrYouWillBeFired = genPurePanel(DatePicker, "popupAlign", void 0, "picker");
DatePicker._InternalRangePanelDoNotUseOrYouWillBeFired = genPurePanel(DatePicker.RangePicker, "popupAlign", void 0, "picker");
DatePicker.generatePicker = generatePicker;
//#endregion
//#region node_modules/antd/es/descriptions/constant.js
var DEFAULT_COLUMN_MAP = {
xxxl: 4,
xxl: 3,
xl: 3,
lg: 3,
md: 3,
sm: 2,
xs: 1
};
//#endregion
//#region node_modules/antd/es/descriptions/DescriptionsContext.js
var DescriptionsContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/antd/es/descriptions/hooks/useItems.js
var transChildren2Items = (childNodes) => toArray$8(childNodes).map((node) => ({
...node?.props,
key: node.key
}));
function useItems$2(screens, items, children) {
const mergedItems = import_react.useMemo(() => items || transChildren2Items(children), [items, children]);
return import_react.useMemo(() => mergedItems.map(({ span, ...restItem }) => {
if (span === "filled") return {
...restItem,
filled: true
};
return {
...restItem,
span: isNumber(span) ? span : matchScreen(screens, span)
};
}), [mergedItems, screens]);
}
//#endregion
//#region node_modules/antd/es/descriptions/hooks/useRow.js
function getCalcRows(rowItems, mergedColumn) {
let rows = [];
let tmpRow = [];
let exceed = false;
let count = 0;
rowItems.filter((n) => n).forEach((rowItem) => {
const { filled, ...restItem } = rowItem;
if (filled) {
tmpRow.push(restItem);
rows.push(tmpRow);
tmpRow = [];
count = 0;
return;
}
const restSpan = mergedColumn - count;
count += rowItem.span || 1;
if (count >= mergedColumn) {
if (count > mergedColumn) {
exceed = true;
tmpRow.push({
...restItem,
span: restSpan
});
} else tmpRow.push(restItem);
rows.push(tmpRow);
tmpRow = [];
count = 0;
} else tmpRow.push(restItem);
});
if (tmpRow.length > 0) rows.push(tmpRow);
rows = rows.map((rows) => {
const count = rows.reduce((acc, item) => acc + (item.span || 1), 0);
if (count < mergedColumn) {
const last = rows[rows.length - 1];
last.span = mergedColumn - (count - (last.span || 1));
return rows;
}
return rows;
});
return [rows, exceed];
}
var useRow = (mergedColumn, items) => {
const [rows, exceed] = (0, import_react.useMemo)(() => getCalcRows(items, mergedColumn), [items, mergedColumn]);
devUseWarning("Descriptions")(!exceed, "usage", "Sum of column `span` in a line not match `column` of Descriptions.");
return rows;
};
//#endregion
//#region node_modules/antd/es/descriptions/Item.js
/* istanbul ignore next */
var DescriptionsItem = (props) => {
return props.children;
};
//#endregion
//#region node_modules/antd/es/descriptions/Cell.js
var Cell$1 = (props) => {
const { itemPrefixCls, component, span, className, style, labelStyle, contentStyle, bordered, label, content, colon, type, styles, classNames } = props;
const Component = component;
const { classNames: contextClassNames, styles: contextStyles } = import_react.useContext(DescriptionsContext);
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props });
const mergedLabelStyle = {
...labelStyle,
...mergedStyles.label
};
const mergedContentStyle = {
...contentStyle,
...mergedStyles.content
};
if (bordered) return /* @__PURE__ */ import_react.createElement(Component, {
colSpan: span,
style,
className: clsx(className, {
[`${itemPrefixCls}-item-${type}`]: type === "label" || type === "content",
[mergedClassNames.label]: mergedClassNames.label && type === "label",
[mergedClassNames.content]: mergedClassNames.content && type === "content"
})
}, isNonNullable(label) && /* @__PURE__ */ import_react.createElement("span", { style: mergedLabelStyle }, label), isNonNullable(content) && /* @__PURE__ */ import_react.createElement("span", { style: mergedContentStyle }, content));
return /* @__PURE__ */ import_react.createElement(Component, {
className: clsx(`${itemPrefixCls}-item`, className),
style,
colSpan: span
}, /* @__PURE__ */ import_react.createElement("div", { className: `${itemPrefixCls}-item-container` }, isNonNullable(label) && /* @__PURE__ */ import_react.createElement("span", {
style: mergedLabelStyle,
className: clsx(`${itemPrefixCls}-item-label`, mergedClassNames.label, { [`${itemPrefixCls}-item-no-colon`]: !colon })
}, label), isNonNullable(content) && /* @__PURE__ */ import_react.createElement("span", {
style: mergedContentStyle,
className: clsx(`${itemPrefixCls}-item-content`, mergedClassNames.content)
}, content)));
};
//#endregion
//#region node_modules/antd/es/descriptions/Row.js
function renderCells(items, { colon, prefixCls, bordered }, { component, type, showLabel, showContent, labelStyle: rootLabelStyle, contentStyle: rootContentStyle, styles: rootStyles }) {
return items.map(({ label, children, prefixCls: itemPrefixCls = prefixCls, className, style, labelStyle, contentStyle, span = 1, key, styles, classNames }, index) => {
if (typeof component === "string") return /* @__PURE__ */ import_react.createElement(Cell$1, {
key: `${type}-${key || index}`,
className,
style,
classNames,
styles: {
label: {
...rootLabelStyle,
...rootStyles?.label,
...labelStyle,
...styles?.label
},
content: {
...rootContentStyle,
...rootStyles?.content,
...contentStyle,
...styles?.content
}
},
span,
colon,
component,
itemPrefixCls,
bordered,
label: showLabel ? label : null,
content: showContent ? children : null,
type
});
return [/* @__PURE__ */ import_react.createElement(Cell$1, {
key: `label-${key || index}`,
className,
style: {
...rootLabelStyle,
...rootStyles?.label,
...style,
...labelStyle,
...styles?.label
},
span: 1,
colon,
component: component[0],
itemPrefixCls,
bordered,
label,
type: "label"
}), /* @__PURE__ */ import_react.createElement(Cell$1, {
key: `content-${key || index}`,
className,
style: {
...rootContentStyle,
...rootStyles?.content,
...style,
...contentStyle,
...styles?.content
},
span: span * 2 - 1,
component: component[1],
itemPrefixCls,
bordered,
content: children,
type: "content"
})];
});
}
var Row = (props) => {
const descContext = import_react.useContext(DescriptionsContext);
const { prefixCls, vertical, row, index, bordered } = props;
if (vertical) return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("tr", {
key: `label-${index}`,
className: `${prefixCls}-row`
}, renderCells(row, props, {
component: "th",
type: "label",
showLabel: true,
...descContext
})), /* @__PURE__ */ import_react.createElement("tr", {
key: `content-${index}`,
className: `${prefixCls}-row`
}, renderCells(row, props, {
component: "td",
type: "content",
showContent: true,
...descContext
})));
return /* @__PURE__ */ import_react.createElement("tr", {
key: index,
className: `${prefixCls}-row`
}, renderCells(row, props, {
component: bordered ? ["th", "td"] : "td",
type: "item",
showLabel: true,
showContent: true,
...descContext
}));
};
//#endregion
//#region node_modules/antd/es/descriptions/style/index.js
var genBorderedStyle$3 = (token) => {
const { componentCls, labelBg } = token;
return { [`&${componentCls}-bordered`]: {
[`> ${componentCls}-view`]: {
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
"> table": { tableLayout: "auto" },
[`${componentCls}-row`]: {
borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
"&:first-child": { "> th:first-child, > td:first-child": { borderStartStartRadius: token.borderRadiusLG } },
"&:last-child": {
borderBottom: "none",
"> th:first-child, > td:first-child": { borderEndStartRadius: token.borderRadiusLG }
},
[`> ${componentCls}-item-label, > ${componentCls}-item-content`]: {
padding: `${unit$1(token.padding)} ${unit$1(token.paddingLG)}`,
borderInlineEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
"&:last-child": { borderInlineEnd: "none" }
},
[`> ${componentCls}-item-label`]: {
color: token.colorTextSecondary,
backgroundColor: labelBg,
"&::after": { display: "none" }
}
}
},
[`&${componentCls}-medium`]: { [`${componentCls}-row`]: { [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: { padding: `${unit$1(token.paddingSM)} ${unit$1(token.paddingLG)}` } } },
[`&${componentCls}-small`]: { [`${componentCls}-row`]: { [`> ${componentCls}-item-label, > ${componentCls}-item-content`]: { padding: `${unit$1(token.paddingXS)} ${unit$1(token.padding)}` } } }
} };
};
var genDescriptionStyles = (token) => {
const { componentCls, extraColor, itemPaddingBottom, itemPaddingEnd, colonMarginRight, colonMarginLeft, titleMarginBottom } = token;
return { [componentCls]: {
...resetComponent(token),
...genBorderedStyle$3(token),
"&-rtl": { direction: "rtl" },
[`${componentCls}-header`]: {
display: "flex",
alignItems: "center",
marginBottom: titleMarginBottom
},
[`${componentCls}-title`]: {
...textEllipsis,
flex: "auto",
color: token.titleColor,
fontWeight: token.fontWeightStrong,
fontSize: token.fontSizeLG,
lineHeight: token.lineHeightLG
},
[`${componentCls}-extra`]: {
marginInlineStart: "auto",
color: extraColor,
fontSize: token.fontSize
},
[`${componentCls}-view`]: {
width: "100%",
borderRadius: token.borderRadiusLG,
table: {
width: "100%",
tableLayout: "fixed",
borderCollapse: "collapse"
}
},
[`${componentCls}-row`]: {
"> th, > td": {
paddingBottom: itemPaddingBottom,
paddingInlineEnd: itemPaddingEnd
},
"> th:last-child, > td:last-child": { paddingInlineEnd: 0 },
"&:last-child": {
borderBottom: "none",
"> th, > td": { paddingBottom: 0 }
}
},
[`${componentCls}-item-label`]: {
color: token.labelColor,
fontWeight: "normal",
fontSize: token.fontSize,
lineHeight: token.lineHeight,
textAlign: "start",
"&::after": {
content: "\":\"",
position: "relative",
top: -.5,
marginInline: `${unit$1(colonMarginLeft)} ${unit$1(colonMarginRight)}`
},
[`&${componentCls}-item-no-colon::after`]: { content: "\"\"" }
},
[`${componentCls}-item-no-label`]: { "&::after": {
margin: 0,
content: "\"\""
} },
[`${componentCls}-item-content`]: {
display: "table-cell",
flex: 1,
color: token.contentColor,
fontSize: token.fontSize,
lineHeight: token.lineHeight,
wordBreak: "break-word",
overflowWrap: "break-word"
},
[`${componentCls}-item`]: {
paddingBottom: 0,
verticalAlign: "top",
"&-container": {
display: "flex",
[`${componentCls}-item-label`]: {
display: "inline-flex",
alignItems: "baseline"
},
[`${componentCls}-item-content`]: {
display: "inline-flex",
alignItems: "baseline",
minWidth: "1em"
}
}
},
"&-medium": { [`${componentCls}-row`]: { "> th, > td": { paddingBottom: token.paddingSM } } },
"&-small": { [`${componentCls}-row`]: { "> th, > td": { paddingBottom: token.paddingXS } } }
} };
};
var prepareComponentToken$26 = (token) => ({
labelBg: token.colorFillAlter,
labelColor: token.colorTextTertiary,
titleColor: token.colorText,
titleMarginBottom: token.fontSizeSM * token.lineHeightSM,
itemPaddingBottom: token.padding,
itemPaddingEnd: token.padding,
colonMarginRight: token.marginXS,
colonMarginLeft: token.marginXXS / 2,
contentColor: token.colorText,
extraColor: token.colorText
});
var style_default$28 = genStyleHooks("Descriptions", (token) => {
return genDescriptionStyles(merge(token, {}));
}, prepareComponentToken$26);
//#endregion
//#region node_modules/antd/es/descriptions/index.js
var Descriptions = (props) => {
const { prefixCls: customizePrefixCls, title, extra, column, colon = true, bordered, layout, children, className, rootClassName, style, size: customizeSize, labelStyle, contentStyle, styles, items, classNames, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("descriptions");
const prefixCls = getPrefixCls("descriptions", customizePrefixCls);
const screens = useBreakpoint$1();
{
const warning = devUseWarning("Descriptions");
warning.deprecated(customizeSize !== "default", "size=\"default\"", "size=\"large\"");
[["labelStyle", "styles.label"], ["contentStyle", "styles.content"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const mergedColumn = import_react.useMemo(() => {
if (isNumber(column)) return column;
return matchScreen(screens, {
...DEFAULT_COLUMN_MAP,
...column
}) ?? 3;
}, [screens, column]);
const mergedItems = useItems$2(screens, items, children);
const mergedSize = useSize(customizeSize);
const rows = useRow(mergedColumn, mergedItems);
const [hashId, cssVarCls] = style_default$28(prefixCls);
const mergedProps = {
...props,
column: mergedColumn,
items: mergedItems,
size: mergedSize
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const memoizedValue = import_react.useMemo(() => ({
labelStyle,
contentStyle,
styles: {
label: mergedStyles.label,
content: mergedStyles.content
},
classNames: {
label: mergedClassNames.label,
content: mergedClassNames.content
}
}), [
labelStyle,
contentStyle,
mergedStyles.label,
mergedStyles.content,
mergedClassNames.label,
mergedClassNames.content
]);
return /* @__PURE__ */ import_react.createElement(DescriptionsContext.Provider, { value: memoizedValue }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(prefixCls, contextClassName, mergedClassNames.root, {
[`${prefixCls}-medium`]: mergedSize === "medium" || mergedSize === "middle",
[`${prefixCls}-small`]: mergedSize === "small",
[`${prefixCls}-bordered`]: !!bordered,
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, rootClassName, hashId, cssVarCls),
style: {
...contextStyle,
...mergedStyles.root,
...style
},
...restProps
}, (title || extra) && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-header`, mergedClassNames.header),
style: mergedStyles.header
}, title && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, mergedClassNames.title),
style: mergedStyles.title
}, title), extra && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-extra`, mergedClassNames.extra),
style: mergedStyles.extra
}, extra)), /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-view` }, /* @__PURE__ */ import_react.createElement("table", null, /* @__PURE__ */ import_react.createElement("tbody", null, rows.map((row, index) => /* @__PURE__ */ import_react.createElement(Row, {
key: index,
index,
colon,
prefixCls,
vertical: layout === "vertical",
bordered,
row
})))))));
};
Descriptions.displayName = "Descriptions";
Descriptions.Item = DescriptionsItem;
//#endregion
//#region node_modules/@rc-component/drawer/es/context.js
var DrawerContext = /* @__PURE__ */ import_react.createContext(null);
var RefContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/drawer/es/DrawerPanel.js
function _extends$36() {
_extends$36 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$36.apply(this, arguments);
}
var DrawerPanel$1 = (props) => {
const { prefixCls, className, containerRef, ...restProps } = props;
const { panel: panelRef } = import_react.useContext(RefContext);
const mergedRef = useComposeRef(panelRef, containerRef);
return /* @__PURE__ */ import_react.createElement("div", _extends$36({
className: clsx(`${prefixCls}-section`, className),
role: "dialog",
ref: mergedRef
}, pickAttrs(props, { aria: true }), { "aria-modal": "true" }, restProps));
};
DrawerPanel$1.displayName = "DrawerPanel";
//#endregion
//#region node_modules/@rc-component/drawer/es/hooks/useDrag.js
function useDrag(options) {
const { prefixCls, direction, className, style, maxSize, containerRef, currentSize, onResize, onResizeEnd, onResizeStart } = options;
const [isDragging, setIsDragging] = import_react.useState(false);
const [startPos, setStartPos] = import_react.useState(0);
const [startSize, setStartSize] = import_react.useState(0);
const isHorizontal = direction === "left" || direction === "right";
const handleMouseDown = useEvent((e) => {
e.preventDefault();
e.stopPropagation();
setIsDragging(true);
if (isHorizontal) setStartPos(e.clientX);
else setStartPos(e.clientY);
let startSize;
if (typeof currentSize === "number") startSize = currentSize;
else if (containerRef?.current) {
const rect = containerRef.current.getBoundingClientRect();
startSize = isHorizontal ? rect.width : rect.height;
}
setStartSize(startSize);
onResizeStart?.(startSize);
});
const handleMouseMove = useEvent((e) => {
if (!isDragging) return;
let delta = (isHorizontal ? e.clientX : e.clientY) - startPos;
if (direction === "right" || direction === "bottom") delta = -delta;
let newSize = startSize + delta;
if (newSize < 0) newSize = 0;
if (maxSize && newSize > maxSize) newSize = maxSize;
onResize?.(newSize);
});
const handleMouseUp = import_react.useCallback(() => {
if (isDragging) {
setIsDragging(false);
if (containerRef?.current) {
const rect = containerRef.current.getBoundingClientRect();
const finalSize = isHorizontal ? rect.width : rect.height;
onResizeEnd?.(finalSize);
}
}
}, [
isDragging,
containerRef,
onResizeEnd,
isHorizontal
]);
import_react.useEffect(() => {
if (isDragging) {
document.addEventListener("mousemove", handleMouseMove);
document.addEventListener("mouseup", handleMouseUp);
return () => {
document.removeEventListener("mousemove", handleMouseMove);
document.removeEventListener("mouseup", handleMouseUp);
};
}
}, [
isDragging,
handleMouseMove,
handleMouseUp
]);
return {
dragElementProps: {
className: clsx(`${prefixCls}-dragger`, `${prefixCls}-dragger-${direction}`, {
[`${prefixCls}-dragger-dragging`]: isDragging,
[`${prefixCls}-dragger-horizontal`]: isHorizontal,
[`${prefixCls}-dragger-vertical`]: !isHorizontal
}, className),
style,
onMouseDown: handleMouseDown
},
isDragging
};
}
//#endregion
//#region node_modules/@rc-component/drawer/es/util.js
function parseWidthHeight(value) {
if (typeof value === "string") {
const num = Number(value.replace(/px$/i, ""));
if (parseFloat(value) === num) warningOnce(false, "Invalid value type of `width` or `height` which should be number type instead.");
if (!Number.isNaN(num)) return num;
}
return value;
}
function warnCheck(props) {
warningOnce(!("wrapperClassName" in props), `'wrapperClassName' is removed. Please use 'rootClassName' instead.`);
warningOnce(canUseDom() || !props.open, `Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.`);
}
//#endregion
//#region node_modules/@rc-component/drawer/es/hooks/useFocusable.js
function useFocusable(getContainer, open, autoFocus, focusTrap, mask) {
const [ignoreElement] = useLockFocus(open && (focusTrap ?? mask !== false), getContainer);
import_react.useEffect(() => {
if (open && autoFocus === true) getContainer()?.focus({ preventScroll: true });
}, [open]);
return ignoreElement;
}
//#endregion
//#region node_modules/@rc-component/drawer/es/DrawerPopup.js
function _extends$35() {
_extends$35 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$35.apply(this, arguments);
}
var DrawerPopup = (props, ref) => {
const { prefixCls, open, placement, inline, push, forceRender, autoFocus, focusTrap, classNames: drawerClassNames, rootClassName, rootStyle, zIndex, className, id, style, motion, width, height, size, maxSize, children, mask, maskClosable, maskMotion, maskClassName, maskStyle, afterOpenChange, onClose, onMouseEnter, onMouseOver, onMouseLeave, onClick, onKeyDown, onKeyUp, styles, drawerRender, resizable, defaultSize } = props;
const panelRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => panelRef.current);
const ignoreElement = useFocusable(() => panelRef.current, open, autoFocus, focusTrap, mask);
const [pushed, setPushed] = import_react.useState(false);
const parentContext = import_react.useContext(DrawerContext);
let pushConfig;
if (typeof push === "boolean") pushConfig = push ? {} : { distance: 0 };
else pushConfig = push || {};
const pushDistance = pushConfig?.distance ?? parentContext?.pushDistance ?? 180;
const mergedContext = import_react.useMemo(() => ({
pushDistance,
push: () => {
setPushed(true);
},
pull: () => {
setPushed(false);
}
}), [pushDistance]);
import_react.useEffect(() => {
if (open) parentContext?.push?.();
else parentContext?.pull?.();
}, [open]);
import_react.useEffect(() => () => {
parentContext?.pull?.();
}, []);
const maskNode = /* @__PURE__ */ import_react.createElement(es_default$28, _extends$35({ key: "mask" }, maskMotion, { visible: mask && open }), ({ className: motionMaskClassName, style: motionMaskStyle }, maskRef) => /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-mask`, motionMaskClassName, drawerClassNames?.mask, maskClassName),
style: {
...motionMaskStyle,
...maskStyle,
...styles?.mask
},
onClick: maskClosable && open ? onClose : void 0,
ref: maskRef
}));
const motionProps = typeof motion === "function" ? motion(placement) : motion;
const [currentSize, setCurrentSize] = import_react.useState();
const isHorizontal = placement === "left" || placement === "right";
const mergedSize = import_react.useMemo(() => {
return parseWidthHeight(size ?? (isHorizontal ? width : height) ?? currentSize ?? defaultSize ?? (isHorizontal ? 378 : void 0));
}, [
size,
width,
height,
defaultSize,
isHorizontal,
currentSize
]);
const wrapperStyle = import_react.useMemo(() => {
const nextWrapperStyle = {};
if (pushed && pushDistance) switch (placement) {
case "top":
nextWrapperStyle.transform = `translateY(${pushDistance}px)`;
break;
case "bottom":
nextWrapperStyle.transform = `translateY(${-pushDistance}px)`;
break;
case "left":
nextWrapperStyle.transform = `translateX(${pushDistance}px)`;
break;
default:
nextWrapperStyle.transform = `translateX(${-pushDistance}px)`;
break;
}
if (isHorizontal) nextWrapperStyle.width = parseWidthHeight(mergedSize);
else nextWrapperStyle.height = parseWidthHeight(mergedSize);
return nextWrapperStyle;
}, [
pushed,
pushDistance,
placement,
isHorizontal,
mergedSize
]);
const wrapperRef = import_react.useRef(null);
const isResizable = !!resizable;
const resizeConfig = typeof resizable === "object" && resizable || {};
const onInternalResize = useEvent((size) => {
setCurrentSize(size);
resizeConfig.onResize?.(size);
});
const { dragElementProps, isDragging } = useDrag({
prefixCls: `${prefixCls}-resizable`,
direction: placement,
className: drawerClassNames?.dragger,
style: styles?.dragger,
maxSize,
containerRef: wrapperRef,
currentSize: mergedSize,
onResize: onInternalResize,
onResizeStart: resizeConfig.onResizeStart,
onResizeEnd: resizeConfig.onResizeEnd
});
const eventHandlers = {
onMouseEnter,
onMouseOver,
onMouseLeave,
onClick,
onKeyDown,
onKeyUp,
onFocus: (e) => {
ignoreElement(e.target);
}
};
const panelNode = /* @__PURE__ */ import_react.createElement(es_default$28, _extends$35({ key: "panel" }, motionProps, {
visible: open,
forceRender,
onVisibleChanged: afterOpenChange,
removeOnLeave: false,
leavedClassName: `${prefixCls}-content-wrapper-hidden`
}), ({ className: motionClassName, style: motionStyle }, motionRef) => {
const content = /* @__PURE__ */ import_react.createElement(DrawerPanel$1, _extends$35({
id,
containerRef: motionRef,
prefixCls,
className: clsx(className, drawerClassNames?.section),
style: {
...style,
...styles?.section
}
}, pickAttrs(props, { aria: true }), eventHandlers), children);
return /* @__PURE__ */ import_react.createElement("div", _extends$35({
ref: wrapperRef,
className: clsx(`${prefixCls}-content-wrapper`, isDragging && `${prefixCls}-content-wrapper-dragging`, drawerClassNames?.wrapper, !isDragging && motionClassName),
style: {
...motionStyle,
...wrapperStyle,
...styles?.wrapper
}
}, pickAttrs(props, { data: true })), isResizable && /* @__PURE__ */ import_react.createElement("div", dragElementProps), drawerRender ? drawerRender(content) : content);
});
const containerStyle = { ...rootStyle };
if (zIndex) containerStyle.zIndex = zIndex;
return /* @__PURE__ */ import_react.createElement(DrawerContext.Provider, { value: mergedContext }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(prefixCls, `${prefixCls}-${placement}`, rootClassName, {
[`${prefixCls}-open`]: open,
[`${prefixCls}-inline`]: inline
}),
style: containerStyle,
tabIndex: -1,
ref: panelRef
}, maskNode, panelNode));
};
var RefDrawerPopup = /* @__PURE__ */ import_react.forwardRef(DrawerPopup);
RefDrawerPopup.displayName = "DrawerPopup";
//#endregion
//#region node_modules/@rc-component/drawer/es/Drawer.js
var Drawer$1 = (props) => {
const { open = false, prefixCls = "rc-drawer", placement = "right", autoFocus = true, keyboard = true, width, height, size, maxSize, mask = true, maskClosable = true, getContainer, forceRender, afterOpenChange, destroyOnHidden, onMouseEnter, onMouseOver, onMouseLeave, onClick, onKeyDown, onKeyUp, onClose, resizable, defaultSize, focusTriggerAfterClose, panelRef } = props;
const [animatedVisible, setAnimatedVisible] = import_react.useState(false);
warnCheck(props);
const [mounted, setMounted] = import_react.useState(false);
useLayoutEffect$1(() => {
setMounted(true);
}, []);
const mergedOpen = mounted ? open : false;
const popupRef = import_react.useRef(null);
const lastActiveRef = import_react.useRef(null);
useLayoutEffect$1(() => {
if (mergedOpen) lastActiveRef.current = document.activeElement;
}, [mergedOpen]);
const internalAfterOpenChange = (nextVisible) => {
setAnimatedVisible(nextVisible);
afterOpenChange?.(nextVisible);
if (!nextVisible && focusTriggerAfterClose !== false && lastActiveRef.current && !popupRef.current?.contains(lastActiveRef.current)) lastActiveRef.current?.focus({ preventScroll: true });
};
const refContext = import_react.useMemo(() => ({ panel: panelRef }), [panelRef]);
if (!forceRender && !animatedVisible && !mergedOpen && destroyOnHidden) return null;
const eventHandlers = {
onMouseEnter,
onMouseOver,
onMouseLeave,
onClick,
onKeyDown,
onKeyUp
};
const drawerPopupProps = {
...props,
open: mergedOpen,
prefixCls,
placement,
autoFocus,
keyboard,
width,
height,
size,
maxSize,
defaultSize,
mask,
maskClosable,
inline: getContainer === false,
afterOpenChange: internalAfterOpenChange,
ref: popupRef,
resizable,
...eventHandlers
};
const onEsc = ({ top, event }) => {
if (top && keyboard) {
event.stopPropagation();
onClose?.(event);
}
};
return /* @__PURE__ */ import_react.createElement(RefContext.Provider, { value: refContext }, /* @__PURE__ */ import_react.createElement(es_default$27, {
open: mergedOpen || forceRender || animatedVisible,
autoDestroy: false,
getContainer,
autoLock: mask && (mergedOpen || animatedVisible),
onEsc
}, /* @__PURE__ */ import_react.createElement(RefDrawerPopup, drawerPopupProps)));
};
Drawer$1.displayName = "Drawer";
//#endregion
//#region node_modules/@rc-component/drawer/es/index.js
var es_default$9 = Drawer$1;
//#endregion
//#region node_modules/antd/es/drawer/DrawerPanel.js
var DrawerPanel = (props) => {
const { prefixCls, ariaId, title, footer, extra, closable, loading, onClose, headerStyle, bodyStyle, footerStyle, children, classNames: drawerClassNames, styles: drawerStyles } = props;
const drawerContext = useComponentConfig("drawer");
const { classNames: contextClassNames, styles: contextStyles, closable: contextClosable } = drawerContext;
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, drawerClassNames], [contextStyles, drawerStyles], { props: {
...props,
closable: closable ?? contextClosable
} });
const closablePlacement = import_react.useMemo(() => {
const merged = closable ?? contextClosable;
if (merged === false) return;
if (isPlainObject(merged) && merged?.placement === "end") return "end";
return "start";
}, [closable, contextClosable]);
const customCloseIconRender = import_react.useCallback((icon) => /* @__PURE__ */ import_react.createElement("button", {
type: "button",
onClick: onClose,
className: clsx(`${prefixCls}-close`, { [`${prefixCls}-close-${closablePlacement}`]: closablePlacement === "end" }, mergedClassNames.close),
style: mergedStyles.close
}, icon), [
onClose,
prefixCls,
closablePlacement,
mergedClassNames.close,
mergedStyles.close
]);
const [mergedClosable, mergedCloseIcon] = useClosable$1(pickClosable(props), pickClosable(drawerContext), {
closable: true,
closeIconRender: customCloseIconRender
});
const renderHeader = () => {
if (!title && !mergedClosable) return null;
return /* @__PURE__ */ import_react.createElement("div", {
style: {
...mergedStyles.header,
...headerStyle
},
className: clsx(`${prefixCls}-header`, mergedClassNames.header, { [`${prefixCls}-header-close-only`]: mergedClosable && !title && !extra })
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-header-title` }, closablePlacement === "start" && mergedCloseIcon, title && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, mergedClassNames.title),
style: mergedStyles.title,
id: ariaId
}, title)), extra && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-extra`, mergedClassNames.extra),
style: mergedStyles.extra
}, extra), closablePlacement === "end" && mergedCloseIcon);
};
const renderFooter = () => {
if (!footer) return null;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-footer`, mergedClassNames.footer),
style: {
...mergedStyles.footer,
...footerStyle
}
}, footer);
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, renderHeader(), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-body`, mergedClassNames.body),
style: {
...mergedStyles.body,
...bodyStyle
}
}, loading ? /* @__PURE__ */ import_react.createElement(skeleton_default, {
active: true,
title: false,
paragraph: { rows: 5 },
className: `${prefixCls}-body-skeleton`
}) : children), renderFooter());
};
//#endregion
//#region node_modules/antd/es/drawer/style/motion.js
var getMoveTranslate = (direction) => {
const value = "100%";
return {
left: `translateX(-${value})`,
right: `translateX(${value})`,
top: `translateY(-${value})`,
bottom: `translateY(${value})`
}[direction];
};
var getEnterLeaveStyle = (startStyle, endStyle) => ({
"&-enter, &-appear": {
...startStyle,
"&-active": endStyle
},
"&-leave": {
...endStyle,
"&-active": startStyle
}
});
var getFadeStyle = (from, duration) => ({
"&-enter, &-appear, &-leave": {
"&-start": { transition: "none" },
"&-active": { transition: `all ${duration}` }
},
...getEnterLeaveStyle({ opacity: from }, { opacity: 1 })
});
var getPanelMotionStyles = (direction, duration) => [getFadeStyle(.7, duration), getEnterLeaveStyle({ transform: getMoveTranslate(direction) }, { transform: "none" })];
var genMotionStyle$1 = (token) => {
const { componentCls, motionDurationSlow } = token;
return { [componentCls]: {
[`${componentCls}-mask-motion`]: getFadeStyle(0, motionDurationSlow),
[`${componentCls}-panel-motion`]: [
"left",
"right",
"top",
"bottom"
].reduce((obj, direction) => {
return {
...obj,
[`&-${direction}`]: getPanelMotionStyles(direction, motionDurationSlow)
};
}, {})
} };
};
//#endregion
//#region node_modules/antd/es/drawer/style/index.js
var genDrawerStyle = (token) => {
const { borderRadiusSM, componentCls, zIndexPopup, colorBgMask, colorBgElevated, motionDurationSlow, motionDurationMid, paddingXS, padding, paddingLG, fontSizeLG, lineHeightLG, lineWidth, lineType, colorSplit, marginXS, colorIcon, colorIconHover, colorBgTextHover, colorBgTextActive, colorText, fontWeightStrong, footerPaddingBlock, footerPaddingInline, draggerSize, calc } = token;
const wrapperCls = `${componentCls}-content-wrapper`;
const draggerCls = `${componentCls}-resizable-dragger`;
return { [componentCls]: {
position: "fixed",
inset: 0,
zIndex: zIndexPopup,
pointerEvents: "none",
color: colorText,
"&-pure": {
position: "relative",
background: colorBgElevated,
display: "flex",
flexDirection: "column",
pointerEvents: "auto",
[`&${componentCls}-left`]: { boxShadow: token.boxShadowDrawerLeft },
[`&${componentCls}-right`]: { boxShadow: token.boxShadowDrawerRight },
[`&${componentCls}-top`]: { boxShadow: token.boxShadowDrawerUp },
[`&${componentCls}-bottom`]: { boxShadow: token.boxShadowDrawerDown }
},
"&-inline": { position: "absolute" },
[`${componentCls}-mask`]: {
position: "absolute",
inset: 0,
zIndex: zIndexPopup,
background: colorBgMask,
pointerEvents: "auto",
[`&${componentCls}-mask-blur`]: { backdropFilter: "blur(4px)" }
},
[wrapperCls]: {
position: "absolute",
zIndex: zIndexPopup,
maxWidth: "100vw",
transition: `all ${motionDurationSlow}`,
"&-hidden": { display: "none" }
},
[`&-left > ${wrapperCls}`]: {
top: 0,
bottom: 0,
left: {
_skip_check_: true,
value: 0
},
boxShadow: token.boxShadowDrawerLeft
},
[`&-right > ${wrapperCls}`]: {
top: 0,
right: {
_skip_check_: true,
value: 0
},
bottom: 0,
boxShadow: token.boxShadowDrawerRight
},
[`&-top > ${wrapperCls}`]: {
top: 0,
insetInline: 0,
boxShadow: token.boxShadowDrawerUp
},
[`&-bottom > ${wrapperCls}`]: {
bottom: 0,
insetInline: 0,
boxShadow: token.boxShadowDrawerDown
},
[`${componentCls}-section`]: {
display: "flex",
flexDirection: "column",
width: "100%",
height: "100%",
overflow: "auto",
background: colorBgElevated,
pointerEvents: "auto"
},
[`${componentCls}-header`]: {
display: "flex",
flex: 0,
alignItems: "center",
padding: `${unit$1(padding)} ${unit$1(paddingLG)}`,
fontSize: fontSizeLG,
lineHeight: lineHeightLG,
borderBottom: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
"&-title": {
display: "flex",
flex: 1,
alignItems: "center",
minWidth: 0,
minHeight: 0
}
},
[`${componentCls}-extra`]: { flex: "none" },
[`${componentCls}-close`]: {
display: "inline-flex",
width: calc(fontSizeLG).add(paddingXS).equal(),
height: calc(fontSizeLG).add(paddingXS).equal(),
borderRadius: borderRadiusSM,
justifyContent: "center",
alignItems: "center",
color: colorIcon,
fontWeight: fontWeightStrong,
fontSize: fontSizeLG,
fontStyle: "normal",
lineHeight: 1,
textAlign: "center",
textTransform: "none",
textDecoration: "none",
background: "transparent",
border: 0,
cursor: "pointer",
transition: `all ${motionDurationMid}`,
textRendering: "auto",
[`&${componentCls}-close-end`]: { marginInlineStart: marginXS },
[`&:not(${componentCls}-close-end)`]: { marginInlineEnd: marginXS },
"&:hover": {
color: colorIconHover,
backgroundColor: colorBgTextHover,
textDecoration: "none"
},
"&:active": { backgroundColor: colorBgTextActive },
...genFocusStyle(token)
},
[`${componentCls}-title`]: {
flex: 1,
margin: 0,
fontWeight: token.fontWeightStrong,
fontSize: fontSizeLG,
lineHeight: lineHeightLG
},
[`${componentCls}-body`]: {
flex: 1,
minWidth: 0,
minHeight: 0,
padding: paddingLG,
overflow: "auto",
[`${componentCls}-body-skeleton`]: {
width: "100%",
height: "100%",
display: "flex",
justifyContent: "center"
}
},
[`${componentCls}-footer`]: {
flexShrink: 0,
padding: `${unit$1(footerPaddingBlock)} ${unit$1(footerPaddingInline)}`,
borderTop: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`
},
[draggerCls]: {
position: "absolute",
zIndex: 1,
backgroundColor: "transparent",
userSelect: "none",
pointerEvents: "auto",
"&:hover": {
backgroundColor: token.colorPrimary,
opacity: .2
},
"&-dragging": {
backgroundColor: token.colorPrimary,
opacity: .3
}
},
[`${draggerCls}-left`]: {
top: 0,
bottom: 0,
right: {
_skip_check_: true,
value: 0
},
width: draggerSize,
cursor: "col-resize"
},
[`${draggerCls}-right`]: {
top: 0,
bottom: 0,
left: {
_skip_check_: true,
value: 0
},
width: draggerSize,
cursor: "col-resize"
},
[`${draggerCls}-top`]: {
insetInline: 0,
bottom: 0,
height: draggerSize,
cursor: "row-resize"
},
[`${draggerCls}-bottom`]: {
insetInline: 0,
top: 0,
height: draggerSize,
cursor: "row-resize"
},
[`${wrapperCls}-dragging`]: {
userSelect: "none",
transition: "none",
willChange: "width, height",
[`${componentCls}-content`]: { pointerEvents: "none" },
[`${componentCls}-section`]: { pointerEvents: "none" }
},
"&-rtl": { direction: "rtl" }
} };
};
var prepareComponentToken$25 = (token) => ({
zIndexPopup: token.zIndexPopupBase,
footerPaddingBlock: token.paddingXS,
footerPaddingInline: token.padding,
draggerSize: 4
});
var style_default$27 = genStyleHooks("Drawer", (token) => {
const drawerToken = merge(token, {});
return [genDrawerStyle(drawerToken), genMotionStyle$1(drawerToken)];
}, prepareComponentToken$25);
//#endregion
//#region node_modules/antd/es/drawer/Drawer.js
var DEFAULT_PUSH_STATE = { distance: 180 };
var DEFAULT_SIZE = 378;
var MOTION_CONFIG = {
motionAppear: true,
motionEnter: true,
motionLeave: true,
motionDeadline: 500
};
var Drawer = (props) => {
const { rootClassName, size, defaultSize = DEFAULT_SIZE, height, width, mask: drawerMask, push = DEFAULT_PUSH_STATE, open, afterOpenChange, onClose, prefixCls: customizePrefixCls, getContainer: customizeGetContainer, panelRef = null, style, className, resizable, "aria-labelledby": ariaLabelledby, focusable, maskClosable, maskStyle, drawerStyle, contentWrapperStyle, destroyOnClose, destroyOnHidden, ...rest } = props;
const { placement } = rest;
const id = useId_default();
const ariaId = rest.title ? id : void 0;
const { getPopupContainer, getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, mask: contextMask } = useComponentConfig("drawer");
const prefixCls = getPrefixCls("drawer", customizePrefixCls);
const [hashId, cssVarCls] = style_default$27(prefixCls);
const getContainer = customizeGetContainer === void 0 && getPopupContainer ? () => getPopupContainer(document.body) : customizeGetContainer;
const drawerSize = import_react.useMemo(() => {
if (isNumber(size)) return size;
if (size === "large") return 736;
if (size === "default") return DEFAULT_SIZE;
if (typeof size === "string") {
if (/^\d+(\.\d+)?$/.test(size)) return Number(size);
return size;
}
if (!placement || placement === "left" || placement === "right") return width;
return height;
}, [
size,
placement,
width,
height
]);
const maskMotion = {
motionName: getTransitionName(prefixCls, "mask-motion"),
...MOTION_CONFIG
};
const panelMotion = (motionPlacement) => ({
motionName: getTransitionName(prefixCls, `panel-motion-${motionPlacement}`),
...MOTION_CONFIG
});
const mergedPanelRef = composeRef(panelRef, usePanelRef());
const [zIndex, contextZIndex] = useZIndex("Drawer", rest.zIndex);
const [mergedMask, maskBlurClassName, mergedMaskClosable] = useMergedMask(drawerMask, contextMask, prefixCls, maskClosable);
const mergedFocusable = useFocusable$1(focusable, getContainer !== false && mergedMask);
const { classNames, styles, rootStyle } = rest;
const mergedProps = {
...props,
zIndex,
panelRef,
mask: mergedMask,
maskClosable: mergedMaskClosable,
defaultSize,
push,
focusable: mergedFocusable
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const drawerClassName = clsx({
"no-mask": !mergedMask,
[`${prefixCls}-rtl`]: direction === "rtl"
}, rootClassName, hashId, cssVarCls, mergedClassNames.root);
{
const warning = devUseWarning("Drawer");
[
["headerStyle", "styles.header"],
["bodyStyle", "styles.body"],
["footerStyle", "styles.footer"],
["contentWrapperStyle", "styles.wrapper"],
["maskStyle", "styles.mask"],
["drawerStyle", "styles.section"],
["destroyInactivePanel", "destroyOnHidden"],
["width", "size"],
["height", "size"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
if (getContainer !== void 0 && props.style?.position === "absolute") warning(false, "breaking", "`style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.");
warning.deprecated(!(mergedClassNames?.content || mergedStyles?.content), "classNames.content and styles.content", "classNames.section and styles.section");
}
return /* @__PURE__ */ import_react.createElement(ContextIsolator, {
form: true,
space: true
}, /* @__PURE__ */ import_react.createElement(ZIndexContext.Provider, { value: contextZIndex }, /* @__PURE__ */ import_react.createElement(es_default$9, {
prefixCls,
onClose,
maskMotion,
motion: panelMotion,
...rest,
classNames: {
mask: clsx(mergedClassNames.mask, maskBlurClassName.mask),
section: mergedClassNames.section,
wrapper: mergedClassNames.wrapper,
dragger: mergedClassNames.dragger
},
styles: {
mask: {
...mergedStyles.mask,
...maskStyle
},
section: {
...mergedStyles.section,
...drawerStyle
},
wrapper: {
...mergedStyles.wrapper,
...contentWrapperStyle
},
dragger: mergedStyles.dragger
},
open,
mask: mergedMask,
maskClosable: mergedMaskClosable,
push,
size: drawerSize,
defaultSize,
style: {
...contextStyle,
...style
},
rootStyle: {
...rootStyle,
...mergedStyles.root
},
className: clsx(contextClassName, className),
rootClassName: drawerClassName,
getContainer,
afterOpenChange,
panelRef: mergedPanelRef,
zIndex,
...resizable ? { resizable } : {},
"aria-labelledby": ariaLabelledby ?? ariaId,
destroyOnHidden: destroyOnHidden ?? destroyOnClose,
focusTriggerAfterClose: mergedFocusable.focusTriggerAfterClose,
focusTrap: mergedFocusable.trap
}, /* @__PURE__ */ import_react.createElement(DrawerPanel, {
prefixCls,
size,
...rest,
ariaId,
onClose
}))));
};
/** @private Internal Component. Do not use in your production. */
var PurePanel$6 = (props) => {
const { prefixCls: customizePrefixCls, style, className, placement = "right", ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("drawer", customizePrefixCls);
const [hashId, cssVarCls] = style_default$27(prefixCls);
const cls = clsx(prefixCls, `${prefixCls}-pure`, `${prefixCls}-${placement}`, hashId, cssVarCls, className);
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style
}, /* @__PURE__ */ import_react.createElement(DrawerPanel, {
prefixCls,
...restProps
}));
};
Drawer._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$6;
Drawer.displayName = "Drawer";
//#endregion
//#region node_modules/antd/es/drawer/index.js
var drawer_default = Drawer;
//#endregion
//#region node_modules/antd/es/_util/gapSize.js
function isPresetSize(size) {
return [
"small",
"middle",
"medium",
"large"
].includes(size);
}
function isValidGapNumber(size) {
if (!size) return false;
return isNumber(size);
}
//#endregion
//#region node_modules/antd/es/space/context.js
var SpaceContext = /* @__PURE__ */ import_react.createContext({ latestIndex: 0 });
var SpaceContextProvider = SpaceContext.Provider;
//#endregion
//#region node_modules/antd/es/space/Item.js
var Item$1 = (props) => {
const { className, prefix, index, children, separator, style, classNames, styles } = props;
const { latestIndex } = import_react.useContext(SpaceContext);
if (!isNonNullable(children)) return null;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("div", {
className,
style
}, children), index < latestIndex && separator && /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefix}-item-separator`, classNames?.separator),
style: styles?.separator
}, separator));
};
//#endregion
//#region node_modules/antd/es/space/style/index.js
var genSpaceStyle = (token) => {
const { componentCls, antCls } = token;
return { [componentCls]: {
display: "inline-flex",
"&-rtl": { direction: "rtl" },
"&-vertical": { flexDirection: "column" },
"&-align": {
flexDirection: "column",
"&-center": { alignItems: "center" },
"&-start": { alignItems: "flex-start" },
"&-end": { alignItems: "flex-end" },
"&-baseline": { alignItems: "baseline" }
},
[`${componentCls}-item:empty`]: { display: "none" },
[`${componentCls}-item > ${antCls}-badge-not-a-wrapper:only-child`]: { display: "block" }
} };
};
var genSpaceGapStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
"&-gap-row-small": { rowGap: token.spaceGapSmallSize },
"&-gap-row-medium, &-gap-row-middle": { rowGap: token.spaceGapMiddleSize },
"&-gap-row-large": { rowGap: token.spaceGapLargeSize },
"&-gap-col-small": { columnGap: token.spaceGapSmallSize },
"&-gap-col-medium, &-gap-col-middle": { columnGap: token.spaceGapMiddleSize },
"&-gap-col-large": { columnGap: token.spaceGapLargeSize }
} };
};
var style_default$26 = genStyleHooks("Space", (token) => {
const spaceToken = merge(token, {
spaceGapSmallSize: token.paddingXS,
spaceGapMiddleSize: token.padding,
spaceGapLargeSize: token.paddingLG
});
return [genSpaceStyle(spaceToken), genSpaceGapStyle(spaceToken)];
}, () => ({}), { resetStyle: false });
//#endregion
//#region node_modules/antd/es/space/index.js
var Space = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { getPrefixCls, direction: directionConfig, size: contextSize, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("space");
const { size = contextSize ?? "small", align, className, rootClassName, children, direction, orientation, prefixCls: customizePrefixCls, split, separator, style, vertical, wrap = false, classNames, styles, ...restProps } = props;
const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
const isPresetVerticalSize = isPresetSize(verticalSize);
const isPresetHorizontalSize = isPresetSize(horizontalSize);
const isValidVerticalSize = isValidGapNumber(verticalSize);
const isValidHorizontalSize = isValidGapNumber(horizontalSize);
const childNodes = toArray$8(children, { keepEmpty: true });
const [mergedOrientation, mergedVertical] = useOrientation(orientation, vertical, direction);
const mergedAlign = align === void 0 && !mergedVertical ? "center" : align;
const mergedSeparator = separator ?? split;
const prefixCls = getPrefixCls("space", customizePrefixCls);
const [hashId, cssVarCls] = style_default$26(prefixCls);
const mergedProps = {
...props,
size,
orientation: mergedOrientation,
align: mergedAlign
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const rootClassNames = clsx(prefixCls, contextClassName, hashId, `${prefixCls}-${mergedOrientation}`, {
[`${prefixCls}-rtl`]: directionConfig === "rtl",
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
[`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
[`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
}, className, rootClassName, cssVarCls, mergedClassNames.root);
const itemClassName = clsx(`${prefixCls}-item`, mergedClassNames.item);
const renderedItems = childNodes.map((child, i) => {
const key = child?.key || `${itemClassName}-${i}`;
return /* @__PURE__ */ import_react.createElement(Item$1, {
prefix: prefixCls,
classNames: mergedClassNames,
styles: mergedStyles,
className: itemClassName,
key,
index: i,
separator: mergedSeparator,
style: mergedStyles.item
}, child);
});
{
const warning = devUseWarning("Space");
[["direction", "orientation"], ["split", "separator"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const memoizedSpaceContext = import_react.useMemo(() => {
return { latestIndex: childNodes.reduce((latest, child, i) => isNonNullable(child) ? i : latest, 0) };
}, [childNodes]);
if (childNodes.length === 0) return null;
const gapStyle = {};
if (wrap) gapStyle.flexWrap = "wrap";
if (!isPresetHorizontalSize && isValidHorizontalSize) gapStyle.columnGap = horizontalSize;
if (!isPresetVerticalSize && isValidVerticalSize) gapStyle.rowGap = verticalSize;
return /* @__PURE__ */ import_react.createElement("div", {
ref,
className: rootClassNames,
style: {
...gapStyle,
...mergedStyles.root,
...contextStyle,
...style
},
...restProps
}, /* @__PURE__ */ import_react.createElement(SpaceContextProvider, { value: memoizedSpaceContext }, renderedItems));
});
Space.Compact = Compact;
Space.Addon = SpaceAddon;
Space.displayName = "Space";
//#endregion
//#region node_modules/antd/es/dropdown/dropdown-button.js
/** @deprecated Please use Space.Compact + Dropdown + Button instead */
var DropdownButton = (props) => {
const { getPopupContainer: getContextPopupContainer, getPrefixCls, direction } = import_react.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, type = "default", danger, disabled, loading, onClick, htmlType, children, className, menu, arrow, autoFocus, trigger, align, open, onOpenChange, placement, getPopupContainer, href, icon = /* @__PURE__ */ import_react.createElement(RefIcon$13, null), title, buttonsRender = (buttons) => buttons, mouseEnterDelay, mouseLeaveDelay, overlayClassName, overlayStyle, destroyOnHidden, destroyPopupOnHide, dropdownRender, popupRender, ...restProps } = props;
const prefixCls = getPrefixCls("dropdown", customizePrefixCls);
const buttonPrefixCls = `${prefixCls}-button`;
const dropdownProps = {
menu,
arrow,
autoFocus,
align,
disabled,
trigger: disabled ? [] : trigger,
onOpenChange,
getPopupContainer: getPopupContainer || getContextPopupContainer,
mouseEnterDelay,
mouseLeaveDelay,
classNames: { root: overlayClassName },
styles: { root: overlayStyle },
destroyOnHidden,
popupRender: popupRender || dropdownRender
};
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const classes = clsx(buttonPrefixCls, compactItemClassnames, className);
if ("destroyPopupOnHide" in props) dropdownProps.destroyPopupOnHide = destroyPopupOnHide;
if ("open" in props) dropdownProps.open = open;
if ("placement" in props) dropdownProps.placement = placement;
else dropdownProps.placement = direction === "rtl" ? "bottomLeft" : "bottomRight";
devUseWarning("Dropdown.Button").deprecated(false, "Dropdown.Button", "Space.Compact + Dropdown + Button");
const [leftButtonToRender, rightButtonToRender] = buttonsRender([/* @__PURE__ */ import_react.createElement(button_default, {
type,
danger,
disabled,
loading,
onClick,
htmlType,
href,
title
}, children), /* @__PURE__ */ import_react.createElement(button_default, {
type,
danger,
icon
})]);
return /* @__PURE__ */ import_react.createElement(Space.Compact, {
className: classes,
size: compactSize,
block: true,
...restProps
}, leftButtonToRender, /* @__PURE__ */ import_react.createElement(Dropdown$1, { ...dropdownProps }, rightButtonToRender));
};
DropdownButton.__ANT_BUTTON = true;
//#endregion
//#region node_modules/antd/es/dropdown/index.js
var Dropdown = Dropdown$1;
/** @deprecated Please use Space.Compact + Dropdown + Button instead */
Dropdown.Button = DropdownButton;
//#endregion
//#region node_modules/antd/es/flex/utils.js
var flexWrapValues = [
"wrap",
"nowrap",
"wrap-reverse"
];
var justifyContentValues = [
"flex-start",
"flex-end",
"start",
"end",
"center",
"space-between",
"space-around",
"space-evenly",
"stretch",
"normal",
"left",
"right"
];
var alignItemsValues = [
"center",
"start",
"end",
"flex-start",
"flex-end",
"self-start",
"self-end",
"baseline",
"normal",
"stretch"
];
var genClsWrap = (prefixCls, props) => {
const wrap = props.wrap === true ? "wrap" : props.wrap;
return { [`${prefixCls}-wrap-${wrap}`]: wrap && flexWrapValues.includes(wrap) };
};
var genClsAlign = (prefixCls, props) => {
const alignCls = {};
alignItemsValues.forEach((cssKey) => {
alignCls[`${prefixCls}-align-${cssKey}`] = props.align === cssKey;
});
alignCls[`${prefixCls}-align-stretch`] = !props.align && !!props.vertical;
return alignCls;
};
var genClsJustify = (prefixCls, props) => {
const justifyCls = {};
justifyContentValues.forEach((cssKey) => {
justifyCls[`${prefixCls}-justify-${cssKey}`] = props.justify === cssKey;
});
return justifyCls;
};
var createFlexClassNames = (prefixCls, props) => {
return clsx({
...genClsWrap(prefixCls, props),
...genClsAlign(prefixCls, props),
...genClsJustify(prefixCls, props)
});
};
//#endregion
//#region node_modules/antd/es/flex/style/index.js
var genFlexStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
display: "flex",
margin: 0,
padding: 0,
"&-vertical": { flexDirection: "column" },
"&-rtl": { direction: "rtl" },
"&:empty": { display: "none" }
} };
};
var genFlexGapStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
"&-gap-small": { gap: token.flexGapSM },
"&-gap-medium, &-gap-middle": { gap: token.flexGap },
"&-gap-large": { gap: token.flexGapLG }
} };
};
var genFlexWrapStyle = (token) => {
const { componentCls } = token;
const wrapStyle = {};
flexWrapValues.forEach((value) => {
wrapStyle[`${componentCls}-wrap-${value}`] = { flexWrap: value };
});
return wrapStyle;
};
var genAlignItemsStyle = (token) => {
const { componentCls } = token;
const alignStyle = {};
alignItemsValues.forEach((value) => {
alignStyle[`${componentCls}-align-${value}`] = { alignItems: value };
});
return alignStyle;
};
var genJustifyContentStyle = (token) => {
const { componentCls } = token;
const justifyStyle = {};
justifyContentValues.forEach((value) => {
justifyStyle[`${componentCls}-justify-${value}`] = { justifyContent: value };
});
return justifyStyle;
};
var prepareComponentToken$24 = () => ({});
var style_default$25 = genStyleHooks("Flex", (token) => {
const { paddingXS, padding, paddingLG } = token;
const flexToken = merge(token, {
flexGapSM: paddingXS,
flexGap: padding,
flexGapLG: paddingLG
});
return [
genFlexStyle(flexToken),
genFlexGapStyle(flexToken),
genFlexWrapStyle(flexToken),
genAlignItemsStyle(flexToken),
genJustifyContentStyle(flexToken)
];
}, prepareComponentToken$24, { resetStyle: false });
//#endregion
//#region node_modules/antd/es/flex/index.js
var Flex = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, rootClassName, className, style, flex, gap, vertical, orientation, component: Component = "div", children, ...othersProps } = props;
const { flex: ctxFlex, direction: ctxDirection, getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("flex", customizePrefixCls);
const [hashId, cssVarCls] = style_default$25(prefixCls);
const [, mergedVertical] = useOrientation(orientation, vertical ?? ctxFlex?.vertical);
const mergedCls = clsx(className, rootClassName, ctxFlex?.className, prefixCls, hashId, cssVarCls, createFlexClassNames(prefixCls, {
...props,
vertical: mergedVertical
}), {
[`${prefixCls}-rtl`]: ctxDirection === "rtl",
[`${prefixCls}-gap-${gap}`]: isPresetSize(gap),
[`${prefixCls}-vertical`]: mergedVertical
});
const mergedStyle = {
...ctxFlex?.style,
...style
};
if (isNonNullable(flex)) mergedStyle.flex = flex;
if (isNonNullable(gap) && !isPresetSize(gap)) mergedStyle.gap = gap;
return /* @__PURE__ */ import_react.createElement(Component, {
ref,
className: mergedCls,
style: mergedStyle,
...omit(othersProps, [
"justify",
"wrap",
"align"
])
}, children);
});
Flex.displayName = "Flex";
//#endregion
//#region node_modules/antd/es/float-button/context.js
var GroupContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/antd/es/_util/convertToTooltipProps.js
var convertToTooltipProps = (tooltip, context) => {
if (!isNonNullable(tooltip)) return null;
if (isPlainObject(tooltip) && !/* @__PURE__ */ (0, import_react.isValidElement)(tooltip)) return {
...context,
...tooltip
};
return {
...context,
title: tooltip
};
};
//#endregion
//#region node_modules/antd/es/float-button/style/button.js
var genFloatButtonStyle = (token) => {
const { componentCls, floatButtonSize, iconCls, antCls, floatButtonIconSize } = token;
const [varName, varRef] = genCssVar(antCls, "float-btn");
const badgeCls = `${componentCls}-badge`;
const R = Math.SQRT2;
const offsetR = (R - 1) / R;
const offsetSquare = token.calc(token.borderRadius).mul(offsetR).equal();
const offsetCircle = token.calc(token.controlHeight).div(2).mul(offsetR).equal();
return { [componentCls]: [{ [varName("size")]: unit$1(floatButtonSize) }, {
flexDirection: "column",
margin: 0,
padding: `${unit$1(token.paddingXXS)} 0`,
width: varRef("size"),
minHeight: varRef("size"),
height: "auto",
wordBreak: "break-word",
whiteSpace: "normal",
gap: token.calc(token.paddingXXS).div(2).equal(),
"&-rtl": { direction: "rtl" },
[`&${componentCls}-individual`]: {
position: "fixed",
zIndex: token.zIndexPopupBase,
insetInlineEnd: token.floatButtonInsetInlineEnd,
bottom: token.floatButtonInsetBlockEnd,
boxShadow: token.boxShadowSecondary
},
[`&${componentCls}-pure`]: {
position: "relative",
inset: "auto"
},
"&:empty": { display: "none" },
[`${componentCls}-icon`]: { lineHeight: 1 },
[`&${componentCls}-icon-only`]: { [iconCls]: { fontSize: floatButtonIconSize } },
[`${componentCls}-content`]: { fontSize: token.fontSizeSM },
[badgeCls]: {
position: "absolute",
top: 0,
insetInlineEnd: 0,
[`&:not(${badgeCls}-dot)`]: { transform: "translate(50%, -50%)" }
},
[`&-rtl ${badgeCls}:not(${badgeCls}-dot)`]: { transform: "translate(-50%, -50%)" },
"&-square": { [`${badgeCls}-dot`]: {
marginTop: offsetSquare,
marginInlineEnd: offsetSquare
} },
"&-circle": { [badgeCls]: {
marginTop: offsetCircle,
marginInlineEnd: offsetCircle
} }
}] };
};
//#endregion
//#region node_modules/antd/es/float-button/style/group.js
var genGroupStyle = (token) => {
const { componentCls, antCls, floatButtonSize, padding } = token;
const groupCls = `${componentCls}-group`;
const listCls = `${groupCls}-list`;
const [varName, varRef] = genCssVar(antCls, "float-btn");
return { [groupCls]: [
{
[varName("list-transform-start")]: `translate(0,${unit$1(floatButtonSize)})`,
[varName("list-trigger-offset")]: `calc(${unit$1(floatButtonSize)} + ${unit$1(padding)})`
},
{
...resetComponent(token),
position: "fixed",
zIndex: token.zIndexPopupBase,
insetInlineEnd: token.floatButtonInsetInlineEnd,
bottom: token.floatButtonInsetBlockEnd,
gap: padding,
"&-rtl": { direction: "rtl" },
[`&${componentCls}-pure`]: {
position: "relative",
inset: "auto"
},
[componentCls]: {
position: "relative",
inset: "auto"
}
},
{
[`&:not(${groupCls}-individual) ${listCls}`]: { boxShadow: token.boxShadowSecondary },
[`&${groupCls}-individual ${listCls}`]: { gap: padding },
[`&-menu-mode ${listCls}`]: { position: "absolute" },
[listCls]: {
borderRadius: token.borderRadiusLG,
"&-motion": {
transition: `all ${token.motionDurationSlow}`,
"&-enter, &-appear": {
opacity: 0,
transform: varRef("list-transform-start"),
"&-active": {
opacity: 1,
transform: `translate(0, 0)`
}
},
"&-leave": { "&-active": {
opacity: 0,
transform: varRef("list-transform-start")
} }
}
},
"&-top": { [listCls]: { bottom: varRef("list-trigger-offset") } },
"&-bottom": { [listCls]: {
[varName("list-transform-start")]: `translate(0, calc(${unit$1(floatButtonSize)} * -1))`,
top: varRef("list-trigger-offset")
} },
"&-left": { [listCls]: {
[varName("list-transform-start")]: `translate(${unit$1(floatButtonSize)}, 0)`,
right: varRef("list-trigger-offset")
} },
"&-right": { [listCls]: {
[varName("list-transform-start")]: `translate(calc(${unit$1(floatButtonSize)} * -1), 0)`,
left: varRef("list-trigger-offset")
} }
}
] };
};
//#endregion
//#region node_modules/antd/es/float-button/style/index.js
var prepareComponentToken$23 = () => ({});
var style_default$24 = genStyleHooks("FloatButton", (token) => {
const { controlHeightLG, marginXXL, marginLG, fontSizeIcon, calc } = token;
const floatButtonToken = merge(token, {
floatButtonIconSize: calc(fontSizeIcon).mul(1.5).equal(),
floatButtonSize: controlHeightLG,
floatButtonInsetBlockEnd: marginXXL,
floatButtonInsetInlineEnd: marginLG
});
return [
genFloatButtonStyle(floatButtonToken),
genGroupStyle(floatButtonToken),
initFadeMotion(token)
];
}, prepareComponentToken$23, { order: -998 });
//#endregion
//#region node_modules/antd/es/float-button/FloatButton.js
var floatButtonPrefixCls = "float-btn";
var FloatButton = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, rootClassName, style, type = "default", shape = "circle", icon, description, content, tooltip, badge = {}, classNames, styles, ...restProps } = props;
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const groupContext = import_react.useContext(GroupContext);
const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const { shape: contextShape, individual: contextIndividual, classNames: contextClassNames, styles: contextStyles } = groupContext || {};
const mergedShape = contextShape || shape;
const mergedIndividual = contextIndividual ?? true;
const mergedContent = content ?? description;
const mergedProps = {
...props,
type,
shape: mergedShape
};
const [hashId, cssVarCls] = style_default$24(prefixCls, rootCls);
const [mergedClassNames, mergedStyles] = useMergeSemantic([
import_react.useMemo(() => ({
icon: `${prefixCls}-icon`,
content: `${prefixCls}-content`
}), [prefixCls]),
contextClassNames,
classNames
], [contextStyles, styles], { props: mergedProps });
const mergedIcon = !mergedContent && !icon ? /* @__PURE__ */ import_react.createElement(RefIcon$20, null) : icon;
const [zIndex] = useZIndex("FloatButton", style?.zIndex);
const mergedStyle = {
...style,
zIndex
};
const badgeProps = omit(badge, [
"title",
"children",
"status",
"text"
]);
const badgeNode = "badge" in props && /* @__PURE__ */ import_react.createElement(Badge, {
...badgeProps,
className: clsx(badgeProps.className, `${prefixCls}-badge`, { [`${prefixCls}-badge-dot`]: badgeProps.dot })
});
const tooltipProps = convertToTooltipProps(tooltip);
{
const warning = devUseWarning("FloatButton");
warning(!(mergedShape === "circle" && mergedContent), "usage", "supported only when `shape` is `square`. Due to narrow space for text, short sentence is recommended.");
warning.deprecated(!description, "description", "content");
}
let node = /* @__PURE__ */ import_react.createElement(Button, {
...restProps,
ref,
className: clsx(hashId, cssVarCls, rootCls, prefixCls, className, rootClassName, `${prefixCls}-${type}`, `${prefixCls}-${mergedShape}`, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-individual`]: mergedIndividual,
[`${prefixCls}-icon-only`]: !mergedContent
}),
classNames: mergedClassNames,
styles: mergedStyles,
style: mergedStyle,
shape: mergedShape,
type,
size: "large",
icon: mergedIcon,
_skipSemantic: true
}, mergedContent, badgeNode);
if (tooltipProps) node = /* @__PURE__ */ import_react.createElement(Tooltip, { ...tooltipProps }, node);
return node;
});
FloatButton.displayName = "FloatButton";
//#endregion
//#region node_modules/antd/es/float-button/BackTop.js
var defaultIcon = /* @__PURE__ */ import_react.createElement(RefIcon$10, null);
var BackTop$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { backTopIcon: contextIcon } = useComponentConfig("floatButton");
const { prefixCls: customizePrefixCls, className, type = "default", shape = "circle", visibilityHeight = 400, icon, target, onClick, duration = 450, ...restProps } = props;
const mergedIcon = icon ?? contextIcon ?? defaultIcon;
const [visible, setVisible] = (0, import_react.useState)(visibilityHeight === 0);
const internalRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({ nativeElement: internalRef.current }));
const getDefaultTarget = () => internalRef.current?.ownerDocument || window;
const handleScroll = throttleByAnimationFrame((e) => {
setVisible(getScroll$2(e.target) >= visibilityHeight);
});
(0, import_react.useEffect)(() => {
const container = (target || getDefaultTarget)();
handleScroll({ target: container });
container?.addEventListener("scroll", handleScroll);
return () => {
handleScroll.cancel();
container?.removeEventListener("scroll", handleScroll);
};
}, [target]);
const scrollToTop = (e) => {
scrollTo(0, {
getContainer: target || getDefaultTarget,
duration
});
onClick?.(e);
};
const { getPrefixCls } = (0, import_react.useContext)(ConfigContext);
const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const contentProps = {
prefixCls,
icon: mergedIcon,
type,
shape: (0, import_react.useContext)(GroupContext)?.shape || shape,
...restProps
};
return /* @__PURE__ */ import_react.createElement(es_default$28, {
visible,
motionName: `${rootPrefixCls}-fade`
}, ({ className: motionClassName }, setRef) => /* @__PURE__ */ import_react.createElement(FloatButton, {
ref: composeRef(internalRef, setRef),
...contentProps,
onClick: scrollToTop,
className: clsx(className, motionClassName)
}));
});
BackTop$1.displayName = "FloatButton.BackTop";
//#endregion
//#region node_modules/antd/es/float-button/FloatButtonGroup.js
var FloatButtonGroup = (props) => {
const { prefixCls: customizePrefixCls, className, style, classNames, styles, rootClassName, shape = "circle", type = "default", placement, icon = /* @__PURE__ */ import_react.createElement(RefIcon$20, null), closeIcon, trigger, children, onOpenChange, open: customOpen, onClick: onTriggerButtonClick, ...floatButtonProps } = props;
const { direction, getPrefixCls, closeIcon: contextCloseIcon, classNames: contextClassNames, styles: contextStyles, className: contextClassName, style: contextStyle } = useComponentConfig("floatButtonGroup");
const mergedCloseIcon = closeIcon ?? contextCloseIcon ?? /* @__PURE__ */ import_react.createElement(RefIcon, null);
const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$24(prefixCls, rootCls);
const groupPrefixCls = `${prefixCls}-group`;
const isMenuMode = trigger && ["click", "hover"].includes(trigger);
const [zIndex] = useZIndex("FloatButton", style?.zIndex);
const floatButtonGroupRef = import_react.useRef(null);
const mergedPlacement = [
"top",
"left",
"right",
"bottom"
].includes(placement) ? placement : "top";
const [open, setOpen] = useControlledState(false, customOpen);
const hoverTrigger = trigger === "hover";
const clickTrigger = trigger === "click";
const triggerOpen = useEvent((nextOpen) => {
if (open !== nextOpen) {
setOpen(nextOpen);
onOpenChange?.(nextOpen);
}
});
const onMouseEnter = () => {
if (hoverTrigger) triggerOpen(true);
};
const onMouseLeave = () => {
if (hoverTrigger) triggerOpen(false);
};
const onInternalTriggerButtonClick = (e) => {
if (clickTrigger) triggerOpen(!open);
onTriggerButtonClick?.(e);
};
import_react.useEffect(() => {
if (clickTrigger) {
const onDocClick = (e) => {
if (floatButtonGroupRef.current?.contains(e.target)) return;
triggerOpen(false);
};
document.addEventListener("click", onDocClick, { capture: true });
return () => document.removeEventListener("click", onDocClick, { capture: true });
}
}, [clickTrigger]);
devUseWarning("FloatButton.Group")(!("open" in props) || !!trigger, "usage", "`open` need to be used together with `trigger`");
const individual = shape === "circle";
const mergedProps = {
...props,
shape,
type,
placement: mergedPlacement
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const listContext = import_react.useMemo(() => ({
shape,
individual,
classNames: {
root: mergedClassNames.item,
icon: mergedClassNames.itemIcon,
content: mergedClassNames.itemContent
},
styles: {
root: mergedStyles.item,
icon: mergedStyles.itemIcon,
content: mergedStyles.itemContent
}
}), [
shape,
individual,
mergedClassNames,
mergedStyles
]);
const triggerContext = import_react.useMemo(() => ({
...listContext,
individual: true,
classNames: {
root: mergedClassNames.trigger,
icon: mergedClassNames.triggerIcon,
content: mergedClassNames.triggerContent
},
styles: {
root: mergedStyles.trigger,
icon: mergedStyles.triggerIcon,
content: mergedStyles.triggerContent
}
}), [
listContext,
mergedClassNames,
mergedStyles
]);
let listNode;
const listCls = `${groupPrefixCls}-list`;
const renderList = (motionClassName) => {
const vertical = mergedPlacement === "top" || mergedPlacement === "bottom";
const sharedProps = {
className: clsx(listCls, mergedClassNames.list, motionClassName),
style: mergedStyles.list
};
if (individual) listNode = /* @__PURE__ */ import_react.createElement(Flex, {
vertical,
...sharedProps
}, children);
else listNode = /* @__PURE__ */ import_react.createElement(Space.Compact, {
vertical,
...sharedProps
}, children);
return listNode;
};
return /* @__PURE__ */ import_react.createElement(GroupContext.Provider, { value: listContext }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(groupPrefixCls, hashId, cssVarCls, rootCls, contextClassName, mergedClassNames.root, className, rootClassName, {
[`${groupPrefixCls}-rtl`]: direction === "rtl",
[`${groupPrefixCls}-individual`]: individual,
[`${groupPrefixCls}-${mergedPlacement}`]: isMenuMode,
[`${groupPrefixCls}-menu-mode`]: isMenuMode
}),
style: {
...contextStyle,
zIndex,
...mergedStyles.root,
...style
},
ref: floatButtonGroupRef,
onMouseEnter,
onMouseLeave
}, isMenuMode ? /* @__PURE__ */ import_react.createElement(es_default$28, {
visible: open,
motionName: `${listCls}-motion`
}, ({ className: motionClassName }) => renderList(motionClassName)) : renderList(), isMenuMode && /* @__PURE__ */ import_react.createElement(GroupContext.Provider, { value: triggerContext }, /* @__PURE__ */ import_react.createElement(FloatButton, {
type,
icon: open ? mergedCloseIcon : icon,
"aria-label": props["aria-label"],
className: `${groupPrefixCls}-trigger`,
onClick: onInternalTriggerButtonClick,
...floatButtonProps
}))));
};
//#endregion
//#region node_modules/antd/es/float-button/PurePanel.js
var PureFloatButton = ({ backTop, ...props }) => backTop ? /* @__PURE__ */ import_react.createElement(BackTop$1, {
...props,
visibilityHeight: 0
}) : /* @__PURE__ */ import_react.createElement(FloatButton, { ...props });
/** @private Internal Component. Do not use in your production. */
var PurePanel$5 = ({ className, items, classNames: cls, styles, prefixCls: customizePrefixCls, ...restProps }) => {
const { getPrefixCls } = import_react.useContext(ConfigContext);
const pureCls = `${getPrefixCls(floatButtonPrefixCls, customizePrefixCls)}-pure`;
if (items) return /* @__PURE__ */ import_react.createElement(FloatButtonGroup, {
className: clsx(className, pureCls),
classNames: cls,
styles,
...restProps
}, items.map((item, index) => /* @__PURE__ */ import_react.createElement(PureFloatButton, {
key: index,
...item
})));
return /* @__PURE__ */ import_react.createElement(PureFloatButton, {
className: clsx(className, pureCls),
classNames: cls,
styles,
...restProps
});
};
//#endregion
//#region node_modules/antd/es/float-button/index.js
FloatButton.BackTop = BackTop$1;
FloatButton.Group = FloatButtonGroup;
FloatButton._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$5;
var float_button_default = FloatButton;
//#endregion
//#region node_modules/antd/es/form/hooks/useDebounce.js
function useDebounce(value) {
const [cacheValue, setCacheValue] = import_react.useState(value);
import_react.useEffect(() => {
const timeout = setTimeout(() => {
setCacheValue(value);
}, value.length ? 0 : 10);
return () => {
clearTimeout(timeout);
};
}, [value]);
return cacheValue;
}
//#endregion
//#region node_modules/antd/es/form/style/explain.js
var genFormValidateMotionStyle = (token) => {
const { componentCls, motionDurationFast, motionEaseInOut } = token;
const helpCls = `${componentCls}-show-help`;
const helpItemCls = `${componentCls}-show-help-item`;
return { [helpCls]: {
transition: `opacity ${motionDurationFast} ${motionEaseInOut}`,
"&-appear, &-enter": {
opacity: 0,
"&-active": { opacity: 1 }
},
"&-leave": {
opacity: 1,
"&-active": { opacity: 0 }
},
[helpItemCls]: {
overflow: "hidden",
transition: `${[
"height",
"opacity",
"transform"
].map((prop) => `${prop} ${motionDurationFast} ${motionEaseInOut}`).join(", ")} !important`,
[`&${helpItemCls}-appear, &${helpItemCls}-enter`]: {
transform: `translateY(-5px)`,
opacity: 0,
"&-active": {
transform: "translateY(0)",
opacity: 1
}
},
[`&${helpItemCls}-leave-active`]: { transform: `translateY(-5px)` }
}
} };
};
//#endregion
//#region node_modules/antd/es/form/style/index.js
var resetForm = (token) => ({
legend: {
display: "block",
width: "100%",
marginBottom: token.marginLG,
padding: 0,
color: token.colorTextDescription,
fontSize: token.fontSizeLG,
lineHeight: "inherit",
border: 0,
borderBottom: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`
},
"input[type=\"search\"]": { boxSizing: "border-box" },
"input[type=\"radio\"], input[type=\"checkbox\"]": { lineHeight: "normal" },
"input[type=\"file\"]": { display: "block" },
"input[type=\"range\"]": {
display: "block",
width: "100%"
},
"select[multiple], select[size]": { height: "auto" },
"input[type='file']:focus, input[type='radio']:focus, input[type='checkbox']:focus": {
outline: 0,
boxShadow: `0 0 0 ${unit$1(token.controlOutlineWidth)} ${token.controlOutline}`
},
output: {
display: "block",
paddingTop: 15,
color: token.colorText,
fontSize: token.fontSize,
lineHeight: token.lineHeight
}
});
var genFormSize = (token, height) => {
const { formItemCls } = token;
return { [formItemCls]: {
[`${formItemCls}-label > label`]: { height },
[`${formItemCls}-control-input`]: { minHeight: height }
} };
};
var genFormStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
...resetComponent(token),
...resetForm(token),
[`${componentCls}-text`]: {
display: "inline-block",
paddingInlineEnd: token.paddingSM
},
"&-small": { ...genFormSize(token, token.controlHeightSM) },
"&-large": { ...genFormSize(token, token.controlHeightLG) }
} };
};
var genFormItemStyle = (token) => {
const { formItemCls, iconCls, rootPrefixCls, antCls, labelRequiredMarkColor, labelColor, labelFontSize, labelHeight, labelColonMarginInlineStart, labelColonMarginInlineEnd, itemMarginBottom } = token;
const [varName] = genCssVar(antCls, "grid");
return { [formItemCls]: {
...resetComponent(token),
marginBottom: itemMarginBottom,
verticalAlign: "top",
"&-with-help": { transition: "none" },
[`&-hidden,
&-hidden${antCls}-row`]: { display: "none" },
"&-has-warning": { [`${formItemCls}-split`]: { color: token.colorError } },
"&-has-error": { [`${formItemCls}-split`]: { color: token.colorWarning } },
[`${formItemCls}-label`]: {
flexGrow: 0,
overflow: "hidden",
whiteSpace: "nowrap",
textAlign: "end",
verticalAlign: "middle",
"&-left": { textAlign: "start" },
"&-wrap": {
overflow: "unset",
lineHeight: token.lineHeight,
whiteSpace: "unset",
"> label": {
verticalAlign: "middle",
textWrap: "balance"
}
},
"> label": {
position: "relative",
display: "inline-flex",
alignItems: "center",
maxWidth: "100%",
height: labelHeight,
color: labelColor,
fontSize: labelFontSize,
[`> ${iconCls}`]: {
fontSize: token.fontSize,
verticalAlign: "top"
},
[`&${formItemCls}-required`]: {
"&::before": {
display: "inline-block",
marginInlineEnd: token.marginXXS,
color: labelRequiredMarkColor,
fontSize: token.fontSize,
fontFamily: "sans-serif",
lineHeight: 1,
content: "\"*\""
},
[`&${formItemCls}-required-mark-hidden, &${formItemCls}-required-mark-optional`]: { "&::before": { display: "none" } }
},
[`${formItemCls}-optional`]: {
display: "inline-block",
marginInlineStart: token.marginXXS,
color: token.colorTextDescription,
[`&${formItemCls}-required-mark-hidden`]: { display: "none" }
},
[`${formItemCls}-tooltip`]: {
color: token.colorTextDescription,
cursor: "help",
writingMode: "horizontal-tb",
marginInlineStart: token.marginXXS
},
"&::after": {
content: "\":\"",
position: "relative",
marginBlock: 0,
marginInlineStart: labelColonMarginInlineStart,
marginInlineEnd: labelColonMarginInlineEnd
},
[`&${formItemCls}-no-colon::after`]: { content: "\"\\a0\"" }
}
},
[`${formItemCls}-control`]: {
[varName("display")]: "flex",
flexDirection: "column",
flexGrow: 1,
[`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: { width: "100%" },
"&-input": {
position: "relative",
display: "flex",
alignItems: "center",
minHeight: token.controlHeight,
"&-content": {
flex: "auto",
maxWidth: "100%",
[`&:has(> ${antCls}-switch:only-child, > ${antCls}-rate:only-child)`]: {
display: "flex",
alignItems: "center"
}
}
}
},
[formItemCls]: {
"&-additional": {
display: "flex",
flexDirection: "column"
},
"&-explain, &-extra": {
clear: "both",
color: token.colorTextDescription,
fontSize: token.fontSize,
lineHeight: token.lineHeight
},
"&-explain-connected": { width: "100%" },
"&-extra": {
minHeight: token.controlHeightSM,
transition: `color ${token.motionDurationMid} ${token.motionEaseOut}`
},
"&-explain": {
"&-error": { color: token.colorError },
"&-warning": { color: token.colorWarning }
}
},
[`&-with-help ${formItemCls}-explain`]: {
height: "auto",
opacity: 1
},
[`${formItemCls}-feedback-icon`]: {
fontSize: token.fontSize,
textAlign: "center",
visibility: "visible",
animationName: zoomIn,
animationDuration: token.motionDurationMid,
animationTimingFunction: token.motionEaseOutBack,
pointerEvents: "none",
"&-success": { color: token.colorSuccess },
"&-error": { color: token.colorError },
"&-warning": { color: token.colorWarning },
"&-validating": { color: token.colorPrimary }
}
} };
};
var makeVerticalLayoutLabel = (token) => ({
padding: token.verticalLabelPadding,
margin: token.verticalLabelMargin,
whiteSpace: "initial",
textAlign: "start",
"> label": {
margin: 0,
"&::after": { visibility: "hidden" }
}
});
var genHorizontalStyle$2 = (token) => {
const { antCls, formItemCls } = token;
return { [`${formItemCls}-horizontal`]: {
[`${formItemCls}-label`]: { flexGrow: 0 },
[`${formItemCls}-control`]: {
flex: "1 1 0",
minWidth: 0
},
[`${formItemCls}-label[class$='-24'], ${formItemCls}-label[class*='-24 ']`]: { [`& + ${formItemCls}-control`]: { minWidth: "unset" } },
[`${antCls}-col-24${formItemCls}-label,
${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
} };
};
var genInlineStyle$1 = (token) => {
const { componentCls, formItemCls, inlineItemMarginBottom } = token;
return { [`${componentCls}-inline`]: {
display: "flex",
flexWrap: "wrap",
[`${formItemCls}-inline`]: {
flex: "none",
marginInlineEnd: token.margin,
marginBottom: inlineItemMarginBottom,
"&-row": { flexWrap: "nowrap" },
[`> ${formItemCls}-label,
> ${formItemCls}-control`]: {
display: "inline-block",
verticalAlign: "top"
},
[`> ${formItemCls}-label`]: { flex: "none" },
[`${componentCls}-text`]: { display: "inline-block" },
[`${formItemCls}-has-feedback`]: { display: "inline-block" }
}
} };
};
var makeVerticalLayout = (token) => {
const { componentCls, formItemCls, rootPrefixCls } = token;
return {
[`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token),
[`${componentCls}:not(${componentCls}-inline)`]: { [formItemCls]: {
flexWrap: "wrap",
[`${formItemCls}-label, ${formItemCls}-control`]: { [`&:not([class*=" ${rootPrefixCls}-col-xs"])`]: {
flex: "0 0 100%",
maxWidth: "100%"
} }
} }
};
};
var genVerticalStyle$2 = (token) => {
const { componentCls, formItemCls, antCls } = token;
return {
[`${formItemCls}-vertical`]: {
[`${formItemCls}-row`]: { flexDirection: "column" },
[`${formItemCls}-label > label`]: { height: "auto" },
[`${formItemCls}-control`]: { width: "100%" },
[`${formItemCls}-label,
${antCls}-col-24${formItemCls}-label,
${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token)
},
[`@media (max-width: ${unit$1(token.screenXSMax)})`]: [makeVerticalLayout(token), { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } }],
[`@media (max-width: ${unit$1(token.screenSMMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } },
[`@media (max-width: ${unit$1(token.screenMDMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } },
[`@media (max-width: ${unit$1(token.screenLGMax)})`]: { [componentCls]: { [`${formItemCls}:not(${formItemCls}-horizontal)`]: { [`${antCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token) } } }
};
};
var prepareComponentToken$22 = (token) => ({
labelRequiredMarkColor: token.colorError,
labelColor: token.colorTextHeading,
labelFontSize: token.fontSize,
labelHeight: token.controlHeight,
labelColonMarginInlineStart: token.marginXXS / 2,
labelColonMarginInlineEnd: token.marginXS,
itemMarginBottom: token.marginLG,
verticalLabelPadding: `0 0 ${token.paddingXS}px`,
verticalLabelMargin: 0,
inlineItemMarginBottom: 0
});
var prepareToken$2 = (token, rootPrefixCls) => {
return merge(token, {
formItemCls: `${token.componentCls}-item`,
rootPrefixCls
});
};
var style_default$23 = genStyleHooks("Form", (token, { rootPrefixCls }) => {
const formToken = prepareToken$2(token, rootPrefixCls);
return [
genFormStyle(formToken),
genFormItemStyle(formToken),
genFormValidateMotionStyle(formToken),
genHorizontalStyle$2(formToken),
genInlineStyle$1(formToken),
genVerticalStyle$2(formToken),
genCollapseMotion(formToken),
zoomIn
];
}, prepareComponentToken$22, { order: -1e3 });
//#endregion
//#region node_modules/antd/es/form/ErrorList.js
var EMPTY_LIST$2 = [];
function toErrorEntity(error, prefix, errorStatus, index = 0) {
return {
key: typeof error === "string" ? error : `${prefix}-${index}`,
error,
errorStatus
};
}
var ErrorList = ({ help, helpStatus, errors = EMPTY_LIST$2, warnings = EMPTY_LIST$2, className: rootClassName, fieldId, onVisibleChanged }) => {
const { prefixCls } = import_react.useContext(FormItemPrefixContext);
const baseClassName = `${prefixCls}-item-explain`;
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$23(prefixCls, rootCls);
const collapseMotion = import_react.useMemo(() => initCollapseMotion(prefixCls), [prefixCls]);
const debounceErrors = useDebounce(errors);
const debounceWarnings = useDebounce(warnings);
const fullKeyList = import_react.useMemo(() => {
if (isNonNullable(help)) return [toErrorEntity(help, "help", helpStatus)];
return [].concat(_toConsumableArray$8(debounceErrors.map((error, index) => toErrorEntity(error, "error", "error", index))), _toConsumableArray$8(debounceWarnings.map((warning, index) => toErrorEntity(warning, "warning", "warning", index))));
}, [
help,
helpStatus,
debounceErrors,
debounceWarnings
]);
const filledKeyFullKeyList = import_react.useMemo(() => {
const keysCount = {};
fullKeyList.forEach(({ key }) => {
keysCount[key] = (keysCount[key] || 0) + 1;
});
return fullKeyList.map((entity, index) => ({
...entity,
key: keysCount[entity.key] > 1 ? `${entity.key}-fallback-${index}` : entity.key
}));
}, [fullKeyList]);
const helpProps = {};
if (fieldId) helpProps.id = `${fieldId}_help`;
return /* @__PURE__ */ import_react.createElement(es_default$28, {
motionDeadline: collapseMotion.motionDeadline,
motionName: `${prefixCls}-show-help`,
visible: !!filledKeyFullKeyList.length,
onVisibleChanged
}, (holderProps) => {
const { className: holderClassName, style: holderStyle } = holderProps;
return /* @__PURE__ */ import_react.createElement("div", {
...helpProps,
className: clsx(baseClassName, holderClassName, cssVarCls, rootCls, rootClassName, hashId),
style: holderStyle
}, /* @__PURE__ */ import_react.createElement(CSSMotionList_default, {
keys: filledKeyFullKeyList,
...initCollapseMotion(prefixCls),
motionName: `${prefixCls}-show-help-item`,
component: false
}, (itemProps) => {
const { key, error, errorStatus, className: itemClassName, style: itemStyle } = itemProps;
return /* @__PURE__ */ import_react.createElement("div", {
key,
className: clsx(itemClassName, { [`${baseClassName}-${errorStatus}`]: errorStatus }),
style: itemStyle
}, error);
}));
});
};
//#endregion
//#region node_modules/antd/es/form/hooks/useFormWarning.js
var names = {};
function useFormWarning({ name }) {
const warning = devUseWarning("Form");
import_react.useEffect(() => {
if (name) {
names[name] = (names[name] || 0) + 1;
warning(names[name] <= 1, "usage", "There exist multiple Form with same `name`.");
return () => {
names[name] -= 1;
};
}
}, [name]);
}
//#endregion
//#region node_modules/antd/es/form/Form.js
var InternalForm = (props, ref) => {
const contextDisabled = import_react.useContext(DisabledContext);
const { getPrefixCls, direction, requiredMark: contextRequiredMark, colon: contextColon, scrollToFirstError: contextScrollToFirstError, className: contextClassName, style: contextStyle, styles: contextStyles, classNames: contextClassNames, tooltip: contextTooltip } = useComponentConfig("form");
const { prefixCls: customizePrefixCls, className, rootClassName, size, disabled = contextDisabled, form, colon, labelAlign, labelWrap, labelCol, wrapperCol, layout = "horizontal", scrollToFirstError, requiredMark, onFinishFailed, name, style, feedbackIcons, variant, classNames, styles, tooltip, ...restFormProps } = props;
const mergedSize = useSize(size);
const contextValidateMessages = import_react.useContext(validateMessagesContext_default);
useFormWarning(props);
const mergedRequiredMark = import_react.useMemo(() => {
if (requiredMark !== void 0) return requiredMark;
if (contextRequiredMark !== void 0) return contextRequiredMark;
return true;
}, [requiredMark, contextRequiredMark]);
const mergedColon = colon ?? contextColon;
const mergedTooltip = {
...contextTooltip,
...tooltip
};
const prefixCls = getPrefixCls("form", customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$23(prefixCls, rootCls);
const mergedProps = {
...props,
size: mergedSize,
disabled,
layout,
colon: mergedColon,
requiredMark: mergedRequiredMark
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const formClassName = clsx(prefixCls, `${prefixCls}-${layout}`, {
[`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-large`]: mergedSize === "large",
[`${prefixCls}-small`]: mergedSize === "small"
}, cssVarCls, rootCls, hashId, contextClassName, className, rootClassName, mergedClassNames.root);
const [wrapForm] = useForm(form);
const { __INTERNAL__ } = wrapForm;
__INTERNAL__.name = name;
const formContextValue = import_react.useMemo(() => ({
name,
labelAlign,
labelCol,
labelWrap,
wrapperCol,
layout,
colon: mergedColon,
requiredMark: mergedRequiredMark,
itemRef: __INTERNAL__.itemRef,
form: wrapForm,
feedbackIcons,
tooltip: mergedTooltip,
classNames: mergedClassNames,
styles: mergedStyles
}), [
name,
labelAlign,
labelCol,
wrapperCol,
layout,
mergedColon,
mergedRequiredMark,
wrapForm,
feedbackIcons,
mergedClassNames,
mergedStyles,
mergedTooltip
]);
const nativeElementRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({
...wrapForm,
nativeElement: nativeElementRef.current?.nativeElement
}));
const scrollToField = (options, fieldName) => {
if (options) {
let defaultScrollToFirstError = { block: "nearest" };
if (isPlainObject(options)) defaultScrollToFirstError = {
...defaultScrollToFirstError,
...options
};
wrapForm.scrollToField(fieldName, defaultScrollToFirstError);
}
};
const onInternalFinishFailed = (errorInfo) => {
onFinishFailed?.(errorInfo);
if (errorInfo.errorFields.length) {
const fieldName = errorInfo.errorFields[0].name;
if (scrollToFirstError !== void 0) {
scrollToField(scrollToFirstError, fieldName);
return;
}
if (contextScrollToFirstError !== void 0) scrollToField(contextScrollToFirstError, fieldName);
}
};
return /* @__PURE__ */ import_react.createElement(VariantContext.Provider, { value: variant }, /* @__PURE__ */ import_react.createElement(DisabledContextProvider, { disabled }, /* @__PURE__ */ import_react.createElement(SizeContext.Provider, { value: mergedSize }, /* @__PURE__ */ import_react.createElement(FormProvider, { validateMessages: contextValidateMessages }, /* @__PURE__ */ import_react.createElement(FormContext.Provider, { value: formContextValue }, /* @__PURE__ */ import_react.createElement(NoFormStyle, { status: true }, /* @__PURE__ */ import_react.createElement(RefForm, {
id: name,
...restFormProps,
name,
onFinishFailed: onInternalFinishFailed,
form: wrapForm,
ref: nativeElementRef,
style: {
...mergedStyles?.root,
...contextStyle,
...style
},
className: formClassName
})))))));
};
var Form$1 = /* @__PURE__ */ import_react.forwardRef(InternalForm);
Form$1.displayName = "Form";
//#endregion
//#region node_modules/antd/es/form/hooks/useChildren.js
function useChildren(children) {
if (typeof children === "function") return children;
const childList = toArray$8(children);
return childList.length <= 1 ? childList[0] : childList;
}
//#endregion
//#region node_modules/antd/es/form/hooks/useFormItemStatus.js
var useFormItemStatus = () => {
const { status, errors = [], warnings = [] } = import_react.useContext(FormItemInputContext);
devUseWarning("Form.Item")(status !== void 0, "usage", "Form.Item.useStatus should be used under Form.Item component. For more information: https://u.ant.design/form-item-usestatus");
return {
status,
errors,
warnings
};
};
useFormItemStatus.Context = FormItemInputContext;
//#endregion
//#region node_modules/antd/es/form/hooks/useFrameState.js
function useFrameState(defaultValue) {
const [value, setValue] = import_react.useState(defaultValue);
const frameRef = import_react.useRef(null);
const batchRef = import_react.useRef([]);
const destroyRef = import_react.useRef(false);
import_react.useEffect(() => {
destroyRef.current = false;
return () => {
destroyRef.current = true;
wrapperRaf.cancel(frameRef.current);
frameRef.current = null;
};
}, []);
function setFrameValue(updater) {
if (destroyRef.current) return;
if (frameRef.current === null) {
batchRef.current = [];
frameRef.current = wrapperRaf(() => {
frameRef.current = null;
setValue((prevValue) => {
let current = prevValue;
batchRef.current.forEach((func) => {
current = func(current);
});
return current;
});
});
}
batchRef.current.push(updater);
}
return [value, setFrameValue];
}
//#endregion
//#region node_modules/antd/es/form/hooks/useItemRef.js
var useItemRef = () => {
const { itemRef } = import_react.useContext(FormContext);
const cacheRef = import_react.useRef({});
function getRef(name, children) {
const childrenRef = children && typeof children === "object" && getNodeRef(children);
const nameStr = name.join("_");
if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {
cacheRef.current.name = nameStr;
cacheRef.current.originRef = childrenRef;
cacheRef.current.ref = composeRef(itemRef(name), childrenRef);
}
return cacheRef.current.ref;
}
return getRef;
};
//#endregion
//#region node_modules/antd/es/form/style/fallbackCmp.js
/**
* Fallback of IE.
* Safe to remove.
*/
var genFallbackStyle = (token) => {
const { formItemCls } = token;
return { "@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)": { [`${formItemCls}-control`]: { display: "flex" } } };
};
var fallbackCmp_default = genSubStyleComponent(["Form", "item-item"], (token, { rootPrefixCls }) => {
return genFallbackStyle(prepareToken$2(token, rootPrefixCls));
});
//#endregion
//#region node_modules/antd/es/form/FormItemInput.js
var GRID_MAX = 24;
var FormItemInput = (props) => {
const { prefixCls, status, labelCol, wrapperCol, children, errors, warnings, _internalItemRender: formItemRender, extra, help, fieldId, marginBottom, onErrorVisibleChanged, label } = props;
const baseClassName = `${prefixCls}-item`;
const formContext = import_react.useContext(FormContext);
const { classNames: contextClassNames, styles: contextStyles } = formContext;
const mergedWrapperCol = import_react.useMemo(() => {
let mergedWrapper = { ...wrapperCol || formContext.wrapperCol || {} };
if (label === null && !labelCol && !wrapperCol && formContext.labelCol) [void 0].concat(_toConsumableArray$8(responsiveArrayReversed)).forEach((size) => {
const _size = size ? [size] : [];
const formLabel = get(formContext.labelCol, _size);
const formLabelObj = isPlainObject(formLabel) ? formLabel : {};
const wrapper = get(mergedWrapper, _size);
const wrapperObj = isPlainObject(wrapper) ? wrapper : {};
if ("span" in formLabelObj && !("offset" in wrapperObj) && formLabelObj.span < GRID_MAX) mergedWrapper = set(mergedWrapper, [].concat(_size, ["offset"]), formLabelObj.span);
});
return mergedWrapper;
}, [
wrapperCol,
formContext.wrapperCol,
formContext.labelCol,
label,
labelCol
]);
const className = clsx(`${baseClassName}-control`, mergedWrapperCol.className);
const subFormContext = import_react.useMemo(() => {
const { labelCol: _labelCol, wrapperCol: _wrapperCol, ...rest } = formContext;
return rest;
}, [formContext]);
const extraRef = import_react.useRef(null);
const [extraHeight, setExtraHeight] = import_react.useState(0);
useLayoutEffect$1(() => {
if (extra && extraRef.current) setExtraHeight(extraRef.current.clientHeight);
else setExtraHeight(0);
}, [extra]);
const inputDom = /* @__PURE__ */ import_react.createElement("div", { className: `${baseClassName}-control-input` }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${baseClassName}-control-input-content`, contextClassNames?.content),
style: contextStyles?.content
}, children));
const formItemContext = import_react.useMemo(() => ({
prefixCls,
status
}), [prefixCls, status]);
const errorListDom = marginBottom !== null || errors.length || warnings.length ? /* @__PURE__ */ import_react.createElement(FormItemPrefixContext.Provider, { value: formItemContext }, /* @__PURE__ */ import_react.createElement(ErrorList, {
fieldId,
errors,
warnings,
help,
helpStatus: status,
className: `${baseClassName}-explain-connected`,
onVisibleChanged: onErrorVisibleChanged
})) : null;
const extraProps = {};
if (fieldId) extraProps.id = `${fieldId}_extra`;
const extraDom = extra ? /* @__PURE__ */ import_react.createElement("div", {
...extraProps,
className: `${baseClassName}-extra`,
ref: extraRef
}, extra) : null;
const additionalDom = errorListDom || extraDom ? /* @__PURE__ */ import_react.createElement("div", {
className: `${baseClassName}-additional`,
style: marginBottom ? { minHeight: marginBottom + extraHeight } : {}
}, errorListDom, extraDom) : null;
const dom = formItemRender && formItemRender.mark === "pro_table_render" && formItemRender.render ? formItemRender.render(props, {
input: inputDom,
errorList: errorListDom,
extra: extraDom
}) : /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, inputDom, additionalDom);
return /* @__PURE__ */ import_react.createElement(FormContext.Provider, { value: subFormContext }, /* @__PURE__ */ import_react.createElement(Col, {
...mergedWrapperCol,
className
}, dom), /* @__PURE__ */ import_react.createElement(fallbackCmp_default, { prefixCls }));
};
//#endregion
//#region node_modules/antd/es/form/FormItemLabel.js
var FormItemLabel = ({ prefixCls, label, htmlFor, labelCol, labelAlign, colon, required, requiredMark, tooltip, vertical }) => {
const [formLocale] = useLocale$1("Form");
const { labelAlign: contextLabelAlign, labelCol: contextLabelCol, labelWrap, colon: contextColon, classNames: contextClassNames, styles: contextStyles, tooltip: contextTooltip } = import_react.useContext(FormContext);
if (!label) return null;
const mergedLabelCol = labelCol || contextLabelCol || {};
const mergedLabelAlign = labelAlign || contextLabelAlign;
const labelClsBasic = `${prefixCls}-item-label`;
const labelColClassName = clsx(labelClsBasic, mergedLabelAlign === "left" && `${labelClsBasic}-left`, mergedLabelCol.className, { [`${labelClsBasic}-wrap`]: !!labelWrap });
let labelChildren = label;
const computedColon = colon === true || contextColon !== false && colon !== false;
if (computedColon && !vertical && typeof label === "string" && label.trim()) labelChildren = label.replace(/[:|:]\s*$/, "");
const tooltipProps = convertToTooltipProps(tooltip, contextTooltip);
if (tooltipProps) {
const tooltipNode = /* @__PURE__ */ import_react.createElement(Tooltip, { ...tooltipProps }, /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-item-tooltip`,
onClick: (e) => {
e.preventDefault();
},
tabIndex: -1
}, tooltipProps.icon || tooltipProps.children || /* @__PURE__ */ import_react.createElement(RefIcon$21, null)));
labelChildren = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, labelChildren, tooltipNode);
}
const isOptionalMark = requiredMark === "optional";
const isRenderMark = typeof requiredMark === "function";
const hideRequiredMark = requiredMark === false;
if (isRenderMark) labelChildren = requiredMark(labelChildren, { required: !!required });
else if (isOptionalMark && !required) labelChildren = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, labelChildren, /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-item-optional`,
title: ""
}, formLocale?.optional || localeValues.Form?.optional));
let markType;
if (hideRequiredMark) markType = "hidden";
else if (isOptionalMark || isRenderMark) markType = "optional";
const labelClassName = clsx(contextClassNames?.label, {
[`${prefixCls}-item-required`]: required,
[`${prefixCls}-item-required-mark-${markType}`]: markType,
[`${prefixCls}-item-no-colon`]: !computedColon
});
return /* @__PURE__ */ import_react.createElement(Col, {
...mergedLabelCol,
className: labelColClassName
}, /* @__PURE__ */ import_react.createElement("label", {
htmlFor,
className: labelClassName,
style: contextStyles?.label,
title: typeof label === "string" ? label : ""
}, labelChildren));
};
//#endregion
//#region node_modules/antd/es/form/FormItem/StatusProvider.js
var iconMap = {
success: RefIcon$1,
warning: RefIcon$4,
error: RefIcon$3,
validating: RefIcon$5
};
function StatusProvider({ children, errors, warnings, hasFeedback, validateStatus, prefixCls, meta, noStyle, name }) {
const itemPrefixCls = `${prefixCls}-item`;
const { feedbackIcons } = import_react.useContext(FormContext);
const mergedValidateStatus = getStatus(errors, warnings, meta, null, !!hasFeedback, validateStatus);
const { isFormItemInput: parentIsFormItemInput, status: parentStatus, hasFeedback: parentHasFeedback, feedbackIcon: parentFeedbackIcon, name: parentName } = import_react.useContext(FormItemInputContext);
const formItemStatusContext = import_react.useMemo(() => {
let feedbackIcon;
if (hasFeedback) {
const customIcons = hasFeedback !== true && hasFeedback.icons || feedbackIcons;
const customIconNode = mergedValidateStatus && customIcons?.({
status: mergedValidateStatus,
errors,
warnings
})?.[mergedValidateStatus];
const IconNode = mergedValidateStatus ? iconMap[mergedValidateStatus] : null;
feedbackIcon = customIconNode !== false && IconNode ? /* @__PURE__ */ import_react.createElement("span", { className: clsx(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`) }, customIconNode || /* @__PURE__ */ import_react.createElement(IconNode, null)) : null;
}
const context = {
status: mergedValidateStatus || "",
errors,
warnings,
hasFeedback: !!hasFeedback,
feedbackIcon,
isFormItemInput: true,
name
};
if (noStyle) {
context.status = (mergedValidateStatus ?? parentStatus) || "";
context.isFormItemInput = parentIsFormItemInput;
context.hasFeedback = !!(hasFeedback ?? parentHasFeedback);
context.feedbackIcon = hasFeedback !== void 0 ? context.feedbackIcon : parentFeedbackIcon;
context.name = name ?? parentName;
}
return context;
}, [
mergedValidateStatus,
hasFeedback,
noStyle,
parentIsFormItemInput,
parentStatus
]);
return /* @__PURE__ */ import_react.createElement(FormItemInputContext.Provider, { value: formItemStatusContext }, children);
}
//#endregion
//#region node_modules/antd/es/form/FormItem/ItemHolder.js
function ItemHolder(props) {
const { prefixCls, className, rootClassName, style, help, errors, warnings, validateStatus, meta, hasFeedback, hidden, children, fieldId, required, isRequired, onSubItemMetaChange, layout: propsLayout, name, ...restProps } = props;
const itemPrefixCls = `${prefixCls}-item`;
const { requiredMark, layout: formLayout } = import_react.useContext(FormContext);
const layout = propsLayout || formLayout;
const vertical = layout === "vertical";
const itemRef = import_react.useRef(null);
const debounceErrors = useDebounce(errors);
const debounceWarnings = useDebounce(warnings);
const hasHelp = isNonNullable(help);
const hasError = !!(hasHelp || errors.length || warnings.length);
const isOnScreen = !!itemRef.current && isVisible_default(itemRef.current);
const [marginBottom, setMarginBottom] = import_react.useState(null);
useLayoutEffect$1(() => {
if (hasError && itemRef.current) {
const itemStyle = getComputedStyle(itemRef.current);
setMarginBottom(Number.parseInt(itemStyle.marginBottom, 10));
}
}, [hasError, isOnScreen]);
const onErrorVisibleChanged = (nextVisible) => {
if (!nextVisible) setMarginBottom(null);
};
const getValidateState = (isDebounce = false) => {
return getStatus(isDebounce ? debounceErrors : meta.errors, isDebounce ? debounceWarnings : meta.warnings, meta, "", !!hasFeedback, validateStatus);
};
const mergedValidateStatus = getValidateState();
const itemClassName = clsx(itemPrefixCls, className, rootClassName, {
[`${itemPrefixCls}-with-help`]: hasHelp || debounceErrors.length || debounceWarnings.length,
[`${itemPrefixCls}-has-feedback`]: mergedValidateStatus && hasFeedback,
[`${itemPrefixCls}-has-success`]: mergedValidateStatus === "success",
[`${itemPrefixCls}-has-warning`]: mergedValidateStatus === "warning",
[`${itemPrefixCls}-has-error`]: mergedValidateStatus === "error",
[`${itemPrefixCls}-is-validating`]: mergedValidateStatus === "validating",
[`${itemPrefixCls}-hidden`]: hidden,
[`${itemPrefixCls}-${layout}`]: layout
});
return /* @__PURE__ */ import_react.createElement("div", {
className: itemClassName,
style,
ref: itemRef
}, /* @__PURE__ */ import_react.createElement(Row$1, {
className: `${itemPrefixCls}-row`,
...omit(restProps, [
"_internalItemRender",
"colon",
"dependencies",
"extra",
"fieldKey",
"getValueFromEvent",
"getValueProps",
"htmlFor",
"id",
"initialValue",
"isListField",
"label",
"labelAlign",
"labelCol",
"labelWrap",
"messageVariables",
"name",
"normalize",
"noStyle",
"preserve",
"requiredMark",
"rules",
"shouldUpdate",
"trigger",
"tooltip",
"validateFirst",
"validateTrigger",
"valuePropName",
"wrapperCol",
"validateDebounce"
])
}, /* @__PURE__ */ import_react.createElement(FormItemLabel, {
htmlFor: fieldId,
...props,
requiredMark,
required: required ?? isRequired,
prefixCls,
vertical
}), /* @__PURE__ */ import_react.createElement(FormItemInput, {
...props,
...meta,
errors: debounceErrors,
warnings: debounceWarnings,
prefixCls,
status: mergedValidateStatus,
help,
marginBottom,
onErrorVisibleChanged
}, /* @__PURE__ */ import_react.createElement(NoStyleItemContext.Provider, { value: onSubItemMetaChange }, /* @__PURE__ */ import_react.createElement(StatusProvider, {
prefixCls,
meta,
errors: meta.errors,
warnings: meta.warnings,
hasFeedback,
validateStatus: mergedValidateStatus,
name
}, children)))), !!marginBottom && /* @__PURE__ */ import_react.createElement("div", {
className: `${itemPrefixCls}-margin-offset`,
style: { marginBottom: -marginBottom }
}));
}
//#endregion
//#region node_modules/antd/es/form/FormItem/index.js
var NAME_SPLIT = "__SPLIT__";
function isSimilarControl(a, b) {
const keysA = Object.keys(a);
const keysB = Object.keys(b);
return keysA.length === keysB.length && keysA.every((key) => {
const propValueA = a[key];
const propValueB = b[key];
return propValueA === propValueB || typeof propValueA === "function" || typeof propValueB === "function";
});
}
var MemoInput = /* @__PURE__ */ import_react.memo((props) => props.children, (prev, next) => isSimilarControl(prev.control, next.control) && prev.update === next.update && prev.childProps.length === next.childProps.length && prev.childProps.every((value, index) => value === next.childProps[index]));
function genEmptyMeta() {
return {
errors: [],
warnings: [],
touched: false,
validating: false,
name: [],
validated: false
};
}
function InternalFormItem(props) {
const { name, noStyle, className, dependencies, prefixCls: customizePrefixCls, shouldUpdate, rules, children, required, label, messageVariables, trigger = "onChange", validateTrigger, hidden, help, layout } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const { name: formName } = import_react.useContext(FormContext);
const mergedChildren = useChildren(children);
const isRenderProps = typeof mergedChildren === "function";
const notifyParentMetaChange = import_react.useContext(NoStyleItemContext);
const { validateTrigger: contextValidateTrigger } = import_react.useContext(Context);
const mergedValidateTrigger = isNonNullable(validateTrigger) ? validateTrigger : contextValidateTrigger;
const hasName = isNonNullable(name);
const prefixCls = getPrefixCls("form", customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$23(prefixCls, rootCls);
const warning = devUseWarning("Form.Item");
warning(name !== null, "usage", "`null` is passed as `name` property");
const listContext = import_react.useContext(ListContext$1);
const fieldKeyPathRef = import_react.useRef(null);
const [subFieldErrors, setSubFieldErrors] = useFrameState({});
const [meta, setMeta] = useSafeState(() => genEmptyMeta());
const onMetaChange = (nextMeta) => {
const keyInfo = listContext?.getKey(nextMeta.name);
setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);
if (noStyle && help !== false && notifyParentMetaChange) {
let namePath = nextMeta.name;
if (!nextMeta.destroy) {
if (keyInfo !== void 0) {
const [fieldKey, restPath] = keyInfo;
namePath = [fieldKey].concat(_toConsumableArray$8(restPath));
fieldKeyPathRef.current = namePath;
}
} else namePath = fieldKeyPathRef.current || namePath;
notifyParentMetaChange(nextMeta, namePath);
}
};
const onSubItemMetaChange = (subMeta, uniqueKeys) => {
setSubFieldErrors((prevSubFieldErrors) => {
const clone = { ...prevSubFieldErrors };
const mergedNameKey = [].concat(_toConsumableArray$8(subMeta.name.slice(0, -1)), _toConsumableArray$8(uniqueKeys)).join(NAME_SPLIT);
if (subMeta.destroy) delete clone[mergedNameKey];
else clone[mergedNameKey] = subMeta;
return clone;
});
};
const [mergedErrors, mergedWarnings] = import_react.useMemo(() => {
const errorList = _toConsumableArray$8(meta.errors);
const warningList = _toConsumableArray$8(meta.warnings);
Object.values(subFieldErrors).forEach((subFieldError) => {
errorList.push.apply(errorList, _toConsumableArray$8(subFieldError.errors || []));
warningList.push.apply(warningList, _toConsumableArray$8(subFieldError.warnings || []));
});
return [errorList, warningList];
}, [
subFieldErrors,
meta.errors,
meta.warnings
]);
const getItemRef = useItemRef();
function renderLayout(baseChildren, fieldId, isRequired) {
if (noStyle && !hidden) return /* @__PURE__ */ import_react.createElement(StatusProvider, {
prefixCls,
hasFeedback: props.hasFeedback,
validateStatus: props.validateStatus,
meta,
errors: mergedErrors,
warnings: mergedWarnings,
noStyle: true,
name
}, baseChildren);
return /* @__PURE__ */ import_react.createElement(ItemHolder, {
key: "row",
...props,
className: clsx(className, cssVarCls, rootCls, hashId),
prefixCls,
fieldId,
isRequired,
errors: mergedErrors,
warnings: mergedWarnings,
meta,
onSubItemMetaChange,
layout,
name
}, baseChildren);
}
if (!hasName && !isRenderProps && !dependencies) return renderLayout(mergedChildren);
let variables = {};
if (typeof label === "string") variables.label = label;
else if (name) variables.label = String(name);
if (messageVariables) variables = {
...variables,
...messageVariables
};
return /* @__PURE__ */ import_react.createElement(WrapperField, {
...props,
messageVariables: variables,
trigger,
validateTrigger: mergedValidateTrigger,
onMetaChange
}, (control, renderMeta, context) => {
const mergedName = toArray$3(name).length && renderMeta ? renderMeta.name : [];
const fieldId = getFieldId(mergedName, formName);
const isRequired = required !== void 0 ? required : rules?.some((rule) => {
if (isPlainObject(rule) && rule.required && !rule.warningOnly) return true;
if (typeof rule === "function") {
const ruleEntity = rule(context);
return ruleEntity?.required && !ruleEntity?.warningOnly;
}
return false;
});
const mergedControl = { ...control };
let childNode = null;
warning(!(shouldUpdate && dependencies), "usage", "`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps.");
if (Array.isArray(mergedChildren) && hasName) {
warning(false, "usage", "A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item.");
childNode = mergedChildren;
} else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) {
warning(!!(shouldUpdate || dependencies), "usage", "A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`.");
warning(!hasName, "usage", "A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.");
} else if (dependencies && !isRenderProps && !hasName) warning(false, "usage", "Must set `name` or use a render function when `dependencies` is set.");
else if (/* @__PURE__ */ import_react.isValidElement(mergedChildren)) {
warning(mergedChildren.props.defaultValue === void 0, "usage", "`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.");
const childProps = {
...mergedChildren.props,
...mergedControl
};
if (!childProps.id) childProps.id = fieldId;
if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {
const describedbyArr = [];
if (help || mergedErrors.length > 0) describedbyArr.push(`${fieldId}_help`);
if (props.extra) describedbyArr.push(`${fieldId}_extra`);
childProps["aria-describedby"] = describedbyArr.join(" ");
}
if (mergedErrors.length > 0) childProps["aria-invalid"] = "true";
if (isRequired) childProps["aria-required"] = "true";
if (supportRef(mergedChildren)) childProps.ref = getItemRef(mergedName, mergedChildren);
new Set([].concat(_toConsumableArray$8(toArray$3(trigger)), _toConsumableArray$8(toArray$3(mergedValidateTrigger)))).forEach((eventName) => {
childProps[eventName] = (...args) => {
mergedControl[eventName]?.(...args);
mergedChildren.props[eventName]?.(...args);
};
});
const watchingChildProps = [
childProps["aria-required"],
childProps["aria-invalid"],
childProps["aria-describedby"]
];
childNode = /* @__PURE__ */ import_react.createElement(MemoInput, {
control: mergedControl,
update: mergedChildren,
childProps: watchingChildProps
}, cloneElement$1(mergedChildren, childProps));
} else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) childNode = mergedChildren(context);
else {
warning(!mergedName.length || !!noStyle, "usage", "`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.");
childNode = mergedChildren;
}
return renderLayout(childNode, fieldId, isRequired);
});
}
var FormItem = InternalFormItem;
FormItem.useStatus = useFormItemStatus;
//#endregion
//#region node_modules/antd/es/form/FormList.js
var FormList = ({ prefixCls: customizePrefixCls, children, ...props }) => {
devUseWarning("Form.List")(isNumber(props.name) || (Array.isArray(props.name) ? !!props.name.length : !!props.name), "usage", "Miss `name` prop.");
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("form", customizePrefixCls);
const contextValue = import_react.useMemo(() => ({
prefixCls,
status: "error"
}), [prefixCls]);
return /* @__PURE__ */ import_react.createElement(List$2, { ...props }, (fields, operation, meta) => /* @__PURE__ */ import_react.createElement(FormItemPrefixContext.Provider, { value: contextValue }, children(fields.map((field) => ({
...field,
fieldKey: field.key
})), operation, {
errors: meta.errors,
warnings: meta.warnings
})));
};
//#endregion
//#region node_modules/antd/es/form/hooks/useFormInstance.js
function useFormInstance() {
const { form } = import_react.useContext(FormContext);
return form;
}
//#endregion
//#region node_modules/antd/es/form/index.js
var Form = Form$1;
Form.Item = FormItem;
Form.List = FormList;
Form.ErrorList = ErrorList;
Form.useForm = useForm;
Form.useFormInstance = useFormInstance;
Form.useWatch = useWatch;
Form.Provider = FormProvider;
//#endregion
//#region node_modules/@rc-component/image/es/context.js
var PreviewGroupContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/image/es/util.js
function isImageValid(src) {
return new Promise((resolve) => {
if (!src) {
resolve(false);
return;
}
const img = document.createElement("img");
img.onerror = () => resolve(false);
img.onload = () => resolve(true);
img.src = src;
});
}
function getClientSize() {
return {
width: document.documentElement.clientWidth,
height: window.innerHeight || document.documentElement.clientHeight
};
}
//#endregion
//#region node_modules/@rc-component/image/es/hooks/useImageTransform.js
var initialTransform = {
x: 0,
y: 0,
rotate: 0,
scale: 1,
flipX: false,
flipY: false
};
function useImageTransform(imgRef, minScale, maxScale, onTransform) {
const frame = (0, import_react.useRef)(null);
const queue = (0, import_react.useRef)([]);
const [transform, setTransform] = (0, import_react.useState)(initialTransform);
const resetTransform = (action) => {
setTransform(initialTransform);
if (!isEqual(initialTransform, transform)) onTransform?.({
transform: initialTransform,
action
});
};
/** Direct update transform */
const updateTransform = (newTransform, action) => {
if (frame.current === null) {
queue.current = [];
frame.current = wrapperRaf(() => {
setTransform((preState) => {
let memoState = preState;
queue.current.forEach((queueState) => {
memoState = {
...memoState,
...queueState
};
});
frame.current = null;
onTransform?.({
transform: memoState,
action
});
return memoState;
});
});
}
queue.current.push({
...transform,
...newTransform
});
};
/** Scale according to the position of centerX and centerY */
const dispatchZoomChange = (ratio, action, centerX, centerY, isTouch) => {
const { width, height, offsetWidth, offsetHeight, offsetLeft, offsetTop } = imgRef.current;
let newRatio = ratio;
let newScale = transform.scale * ratio;
if (newScale > maxScale) {
newScale = maxScale;
newRatio = maxScale / transform.scale;
} else if (newScale < minScale) {
newScale = isTouch ? newScale : minScale;
newRatio = newScale / transform.scale;
}
/** Default center point scaling */
const mergedCenterX = centerX ?? innerWidth / 2;
const mergedCenterY = centerY ?? innerHeight / 2;
const diffRatio = newRatio - 1;
/** Deviation calculated from image size */
const diffImgX = diffRatio * width * .5;
const diffImgY = diffRatio * height * .5;
/** The difference between the click position and the edge of the document */
const diffOffsetLeft = diffRatio * (mergedCenterX - transform.x - offsetLeft);
const diffOffsetTop = diffRatio * (mergedCenterY - transform.y - offsetTop);
/** Final positioning */
let newX = transform.x - (diffOffsetLeft - diffImgX);
let newY = transform.y - (diffOffsetTop - diffImgY);
/**
* When zooming the image
* When the image size is smaller than the width and height of the window, the position is initialized
*/
if (ratio < 1 && newScale === 1) {
const mergedWidth = offsetWidth * newScale;
const mergedHeight = offsetHeight * newScale;
const { width: clientWidth, height: clientHeight } = getClientSize();
if (mergedWidth <= clientWidth && mergedHeight <= clientHeight) {
newX = 0;
newY = 0;
}
}
updateTransform({
x: newX,
y: newY,
scale: newScale
}, action);
};
return {
transform,
resetTransform,
updateTransform,
dispatchZoomChange
};
}
//#endregion
//#region node_modules/@rc-component/image/es/getFixScaleEleTransPosition.js
function fixPoint(key, start, width, clientWidth) {
const startAddWidth = start + width;
const offsetStart = (width - clientWidth) / 2;
if (width > clientWidth) {
if (start > 0) return { [key]: offsetStart };
if (start < 0 && startAddWidth < clientWidth) return { [key]: -offsetStart };
} else if (start < 0 || startAddWidth > clientWidth) return { [key]: start < 0 ? offsetStart : -offsetStart };
return {};
}
/**
* Fix positon x,y point when
*
* Ele width && height < client
* - Back origin
*
* - Ele width | height > clientWidth | clientHeight
* - left | top > 0 -> Back 0
* - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight
*
* Regardless of other
*/
function getFixScaleEleTransPosition(width, height, left, top) {
const { width: clientWidth, height: clientHeight } = getClientSize();
let fixPos = null;
if (width <= clientWidth && height <= clientHeight) fixPos = {
x: 0,
y: 0
};
else if (width > clientWidth || height > clientHeight) fixPos = {
...fixPoint("x", left, width, clientWidth),
...fixPoint("y", top, height, clientHeight)
};
return fixPos;
}
//#endregion
//#region node_modules/@rc-component/image/es/hooks/useMouseEvent.js
function useMouseEvent(imgRef, movable, open, scaleStep, transform, updateTransform, dispatchZoomChange) {
const { rotate, scale, x, y } = transform;
const [isMoving, setMoving] = (0, import_react.useState)(false);
const startPositionInfo = (0, import_react.useRef)({
diffX: 0,
diffY: 0,
transformX: 0,
transformY: 0
});
const onMouseDown = (event) => {
if (!movable || event.button !== 0) return;
event.preventDefault();
event.stopPropagation();
startPositionInfo.current = {
diffX: event.pageX - x,
diffY: event.pageY - y,
transformX: x,
transformY: y
};
setMoving(true);
};
const onMouseMove = (event) => {
if (open && isMoving) updateTransform({
x: event.pageX - startPositionInfo.current.diffX,
y: event.pageY - startPositionInfo.current.diffY
}, "move");
};
const onMouseUp = () => {
if (open && isMoving) {
setMoving(false);
/** No need to restore the position when the picture is not moved, So as not to interfere with the click */
const { transformX, transformY } = startPositionInfo.current;
if (!(x !== transformX && y !== transformY)) return;
const width = imgRef.current.offsetWidth * scale;
const height = imgRef.current.offsetHeight * scale;
const { left, top } = imgRef.current.getBoundingClientRect();
const isRotate = rotate % 180 !== 0;
const fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);
if (fixState) updateTransform({ ...fixState }, "dragRebound");
}
};
const onWheel = (event) => {
if (!open || event.deltaY == 0) return;
const scaleRatio = Math.abs(event.deltaY / 100);
let ratio = 1 + Math.min(scaleRatio, 1) * scaleStep;
if (event.deltaY > 0) ratio = 1 / ratio;
dispatchZoomChange(ratio, "wheel", event.clientX, event.clientY);
};
(0, import_react.useEffect)(() => {
if (movable) {
window.addEventListener("mouseup", onMouseUp, false);
window.addEventListener("mousemove", onMouseMove, false);
try {
/* istanbul ignore next */
if (window.top !== window.self) {
window.top.addEventListener("mouseup", onMouseUp, false);
window.top.addEventListener("mousemove", onMouseMove, false);
}
} catch (error) {
/* istanbul ignore next */
warning$2(false, `[rc-image] ${error}`);
}
}
return () => {
window.removeEventListener("mouseup", onMouseUp);
window.removeEventListener("mousemove", onMouseMove);
/* istanbul ignore next */
try {
window.top?.removeEventListener("mouseup", onMouseUp);
window.top?.removeEventListener("mousemove", onMouseMove);
} catch (error) {}
};
}, [
open,
isMoving,
x,
y,
rotate,
movable
]);
return {
isMoving,
onMouseDown,
onMouseMove,
onMouseUp,
onWheel
};
}
//#endregion
//#region node_modules/@rc-component/image/es/hooks/useStatus.js
function useStatus({ src, isCustomPlaceholder, fallback }) {
const [status, setStatus] = (0, import_react.useState)(isCustomPlaceholder ? "loading" : "normal");
const isLoaded = (0, import_react.useRef)(false);
const isError = status === "error";
(0, import_react.useEffect)(() => {
let isCurrentSrc = true;
isImageValid(src).then((isValid) => {
if (!isValid && isCurrentSrc) setStatus("error");
});
return () => {
isCurrentSrc = false;
};
}, [src]);
(0, import_react.useEffect)(() => {
if (isCustomPlaceholder && !isLoaded.current) setStatus("loading");
else if (isError) setStatus("normal");
}, [src]);
const onLoad = () => {
setStatus("normal");
};
const getImgRef = (img) => {
isLoaded.current = false;
if (status === "loading" && img?.complete && (img.naturalWidth || img.naturalHeight)) {
isLoaded.current = true;
onLoad();
}
};
return [
getImgRef,
isError && fallback ? { src: fallback } : {
onLoad,
src
},
status
];
}
//#endregion
//#region node_modules/@rc-component/image/es/hooks/useTouchEvent.js
function getDistance(a, b) {
const x = a.x - b.x;
const y = a.y - b.y;
return Math.hypot(x, y);
}
function getCenter(oldPoint1, oldPoint2, newPoint1, newPoint2) {
const distance1 = getDistance(oldPoint1, newPoint1);
const distance2 = getDistance(oldPoint2, newPoint2);
if (distance1 === 0 && distance2 === 0) return [oldPoint1.x, oldPoint1.y];
const ratio = distance1 / (distance1 + distance2);
return [oldPoint1.x + ratio * (oldPoint2.x - oldPoint1.x), oldPoint1.y + ratio * (oldPoint2.y - oldPoint1.y)];
}
function useTouchEvent(imgRef, movable, open, minScale, transform, updateTransform, dispatchZoomChange) {
const { rotate, scale, x, y } = transform;
const [isTouching, setIsTouching] = (0, import_react.useState)(false);
const touchPointInfo = (0, import_react.useRef)({
point1: {
x: 0,
y: 0
},
point2: {
x: 0,
y: 0
},
eventType: "none"
});
const updateTouchPointInfo = (values) => {
touchPointInfo.current = {
...touchPointInfo.current,
...values
};
};
const onTouchStart = (event) => {
if (!movable) return;
event.stopPropagation();
setIsTouching(true);
const { touches = [] } = event;
if (touches.length > 1) updateTouchPointInfo({
point1: {
x: touches[0].clientX,
y: touches[0].clientY
},
point2: {
x: touches[1].clientX,
y: touches[1].clientY
},
eventType: "touchZoom"
});
else updateTouchPointInfo({
point1: {
x: touches[0].clientX - x,
y: touches[0].clientY - y
},
eventType: "move"
});
};
const onTouchMove = (event) => {
const { touches = [] } = event;
const { point1, point2, eventType } = touchPointInfo.current;
if (touches.length > 1 && eventType === "touchZoom") {
const newPoint1 = {
x: touches[0].clientX,
y: touches[0].clientY
};
const newPoint2 = {
x: touches[1].clientX,
y: touches[1].clientY
};
const [centerX, centerY] = getCenter(point1, point2, newPoint1, newPoint2);
dispatchZoomChange(getDistance(newPoint1, newPoint2) / getDistance(point1, point2), "touchZoom", centerX, centerY, true);
updateTouchPointInfo({
point1: newPoint1,
point2: newPoint2,
eventType: "touchZoom"
});
} else if (eventType === "move") {
updateTransform({
x: touches[0].clientX - point1.x,
y: touches[0].clientY - point1.y
}, "move");
updateTouchPointInfo({ eventType: "move" });
}
};
const onTouchEnd = () => {
if (!open) return;
if (isTouching) setIsTouching(false);
updateTouchPointInfo({ eventType: "none" });
if (minScale > scale)
/** When the scaling ratio is less than the minimum scaling ratio, reset the scaling ratio */
return updateTransform({
x: 0,
y: 0,
scale: minScale
}, "touchZoom");
const width = imgRef.current.offsetWidth * scale;
const height = imgRef.current.offsetHeight * scale;
const { left, top } = imgRef.current.getBoundingClientRect();
const isRotate = rotate % 180 !== 0;
const fixState = getFixScaleEleTransPosition(isRotate ? height : width, isRotate ? width : height, left, top);
if (fixState) updateTransform({ ...fixState }, "dragRebound");
};
(0, import_react.useEffect)(() => {
const preventDefault = (e) => {
e.preventDefault();
};
if (open && movable) window.addEventListener("touchmove", preventDefault, { passive: false });
return () => {
window.removeEventListener("touchmove", preventDefault);
};
}, [open, movable]);
return {
isTouching,
onTouchStart,
onTouchMove,
onTouchEnd
};
}
//#endregion
//#region node_modules/@rc-component/image/es/Preview/CloseBtn.js
function CloseBtn(props) {
const { prefixCls, icon, onClick, className, style } = props;
return /* @__PURE__ */ import_react.createElement("button", {
className: clsx(`${prefixCls}-close`, className),
style,
onClick
}, icon);
}
//#endregion
//#region node_modules/@rc-component/image/es/Preview/Footer.js
function Footer$2(props) {
const { prefixCls, showProgress, current, count, showSwitch, classNames, styles, icons, image, transform, countRender, actionsRender, scale, minScale, maxScale, onActive, onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn, onClose, onReset } = props;
const { left, right, prev, next, flipY, flipX, rotateLeft, rotateRight, zoomOut, zoomIn } = icons;
const progressNode = showProgress && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-progress` }, countRender ? countRender(current + 1, count) : /* @__PURE__ */ import_react.createElement("bdi", null, `${current + 1} / ${count}`));
const actionCls = `${prefixCls}-actions-action`;
const renderOperation = ({ type, disabled, onClick, icon }) => {
return /* @__PURE__ */ import_react.createElement("button", {
type: "button",
key: type,
className: clsx(actionCls, `${actionCls}-${type}`, { [`${actionCls}-disabled`]: !!disabled }),
onClick,
disabled: !!disabled,
"aria-label": type
}, icon);
};
const switchPrevNode = showSwitch ? renderOperation({
icon: prev ?? left,
onClick: () => onActive(-1),
type: "prev",
disabled: current === 0
}) : void 0;
const switchNextNode = showSwitch ? renderOperation({
icon: next ?? right,
onClick: () => onActive(1),
type: "next",
disabled: current === count - 1
}) : void 0;
const flipYNode = renderOperation({
icon: flipY,
onClick: onFlipY,
type: "flipY"
});
const flipXNode = renderOperation({
icon: flipX,
onClick: onFlipX,
type: "flipX"
});
const rotateLeftNode = renderOperation({
icon: rotateLeft,
onClick: onRotateLeft,
type: "rotateLeft"
});
const rotateRightNode = renderOperation({
icon: rotateRight,
onClick: onRotateRight,
type: "rotateRight"
});
const zoomOutNode = renderOperation({
icon: zoomOut,
onClick: onZoomOut,
type: "zoomOut",
disabled: scale <= minScale
});
const zoomInNode = renderOperation({
icon: zoomIn,
onClick: onZoomIn,
type: "zoomIn",
disabled: scale === maxScale
});
const actionsNode = /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-actions`, classNames.actions),
style: styles.actions
}, flipYNode, flipXNode, rotateLeftNode, rotateRightNode, zoomOutNode, zoomInNode);
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-footer`, classNames.footer),
style: styles.footer
}, progressNode, actionsRender ? actionsRender(actionsNode, {
icons: {
prevIcon: switchPrevNode,
nextIcon: switchNextNode,
flipYIcon: flipYNode,
flipXIcon: flipXNode,
rotateLeftIcon: rotateLeftNode,
rotateRightIcon: rotateRightNode,
zoomOutIcon: zoomOutNode,
zoomInIcon: zoomInNode
},
actions: {
onActive,
onFlipY,
onFlipX,
onRotateLeft,
onRotateRight,
onZoomOut,
onZoomIn,
onReset,
onClose
},
transform,
current,
total: count,
image
}) : actionsNode);
}
//#endregion
//#region node_modules/@rc-component/image/es/Preview/PrevNext.js
function PrevNext(props) {
const { prefixCls, onActive, current, count, icons: { left, right, prev, next } } = props;
const switchCls = `${prefixCls}-switch`;
const prevDisabled = current === 0;
const nextDisabled = current === count - 1;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("button", {
className: clsx(switchCls, `${switchCls}-prev`, { [`${switchCls}-disabled`]: prevDisabled }),
onClick: () => onActive(-1),
disabled: prevDisabled
}, prev ?? left), /* @__PURE__ */ import_react.createElement("button", {
type: "button",
className: clsx(switchCls, `${switchCls}-next`, { [`${switchCls}-disabled`]: nextDisabled }),
onClick: () => onActive(1),
disabled: nextDisabled
}, next ?? right));
}
//#endregion
//#region node_modules/@rc-component/image/es/Preview/index.js
function _extends$34() {
_extends$34 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$34.apply(this, arguments);
}
var PreviewImage = ({ fallback, src, imgRef, ...props }) => {
const [getImgRef, srcAndOnload] = useStatus({
src,
fallback
});
return /* @__PURE__ */ import_react.createElement("img", _extends$34({ ref: (ref) => {
imgRef.current = ref;
getImgRef(ref);
} }, props, srcAndOnload));
};
var Preview = (props) => {
const { prefixCls, rootClassName, src, alt, imageInfo, fallback, movable = true, onClose, open, afterOpenChange, maskClosable = true, icons = {}, closeIcon, getContainer, current = 0, count = 1, countRender, scaleStep = .5, minScale = 1, maxScale = 50, motionName = "fade", imageRender, imgCommonProps, actionsRender, onTransform, onChange, classNames = {}, styles = {}, mousePosition, zIndex, focusTrap = true } = props;
const imgRef = (0, import_react.useRef)();
const wrapperRef = (0, import_react.useRef)(null);
const triggerRef = (0, import_react.useRef)(null);
const groupContext = (0, import_react.useContext)(PreviewGroupContext);
const showLeftOrRightSwitches = groupContext && count > 1;
const showOperationsProgress = groupContext && count >= 1;
const [enableTransition, setEnableTransition] = (0, import_react.useState)(true);
const { transform, resetTransform, updateTransform, dispatchZoomChange } = useImageTransform(imgRef, minScale, maxScale, onTransform);
const { isMoving, onMouseDown, onWheel } = useMouseEvent(imgRef, movable, open, scaleStep, transform, updateTransform, dispatchZoomChange);
const { isTouching, onTouchStart, onTouchMove, onTouchEnd } = useTouchEvent(imgRef, movable, open, minScale, transform, updateTransform, dispatchZoomChange);
const { rotate, scale } = transform;
(0, import_react.useEffect)(() => {
if (!enableTransition) setEnableTransition(true);
}, [enableTransition]);
(0, import_react.useEffect)(() => {
if (!open) resetTransform("close");
}, [open]);
const onDoubleClick = (event) => {
if (open) if (scale !== 1) updateTransform({
x: 0,
y: 0,
scale: 1
}, "doubleClick");
else dispatchZoomChange(1 + scaleStep, "doubleClick", event.clientX, event.clientY);
};
const imgNode = /* @__PURE__ */ import_react.createElement(PreviewImage, _extends$34({}, imgCommonProps, {
width: props.width,
height: props.height,
imgRef,
className: `${prefixCls}-img`,
alt,
style: {
transform: `translate3d(${transform.x}px, ${transform.y}px, 0) scale3d(${transform.flipX ? "-" : ""}${scale}, ${transform.flipY ? "-" : ""}${scale}, 1) rotate(${rotate}deg)`,
transitionDuration: (!enableTransition || isTouching) && "0s"
},
fallback,
src,
onWheel,
onMouseDown,
onDoubleClick,
onTouchStart,
onTouchMove,
onTouchEnd,
onTouchCancel: onTouchEnd
}));
const image = {
url: src,
alt,
...imageInfo
};
const onZoomIn = () => {
dispatchZoomChange(1 + scaleStep, "zoomIn");
};
const onZoomOut = () => {
dispatchZoomChange(1 / (1 + scaleStep), "zoomOut");
};
const onRotateRight = () => {
updateTransform({ rotate: rotate + 90 }, "rotateRight");
};
const onRotateLeft = () => {
updateTransform({ rotate: rotate - 90 }, "rotateLeft");
};
const onFlipX = () => {
updateTransform({ flipX: !transform.flipX }, "flipX");
};
const onFlipY = () => {
updateTransform({ flipY: !transform.flipY }, "flipY");
};
const onReset = () => {
resetTransform("reset");
};
const onActive = (offset) => {
const nextCurrent = current + offset;
if (nextCurrent >= 0 && nextCurrent <= count - 1) {
setEnableTransition(false);
resetTransform(offset < 0 ? "prev" : "next");
onChange?.(nextCurrent, current);
}
};
const onKeyDown = useEvent((event) => {
if (open) {
const { keyCode } = event;
if (showLeftOrRightSwitches) {
if (keyCode === KeyCode.LEFT) onActive(-1);
else if (keyCode === KeyCode.RIGHT) onActive(1);
}
}
});
(0, import_react.useEffect)(() => {
if (open) {
window.addEventListener("keydown", onKeyDown);
return () => {
window.removeEventListener("keydown", onKeyDown);
};
}
}, [open]);
const [lockScroll, setLockScroll] = (0, import_react.useState)(false);
import_react.useEffect(() => {
if (open) setLockScroll(true);
}, [open]);
const onVisibleChanged = (nextVisible) => {
if (!nextVisible) {
setLockScroll(false);
triggerRef.current?.focus?.();
triggerRef.current = null;
}
afterOpenChange?.(nextVisible);
};
const [portalRender, setPortalRender] = (0, import_react.useState)(false);
useLayoutEffect$1(() => {
if (open) setPortalRender(true);
}, [open]);
const onEsc = ({ top }) => {
if (top) onClose?.();
};
useLayoutEffect$1(() => {
if (open) triggerRef.current = document.activeElement;
}, [open]);
useLockFocus(focusTrap && open && portalRender, () => wrapperRef.current);
const bodyStyle = { ...styles.body };
if (mousePosition) bodyStyle.transformOrigin = `${mousePosition.x}px ${mousePosition.y}px`;
return /* @__PURE__ */ import_react.createElement(es_default$27, {
open: portalRender && open,
autoDestroy: false,
getContainer,
autoLock: lockScroll,
onEsc
}, /* @__PURE__ */ import_react.createElement(es_default$28, {
motionName,
visible: portalRender && open,
motionAppear: true,
motionEnter: true,
motionLeave: true,
onVisibleChanged
}, ({ className: motionClassName, style: motionStyle }) => {
const mergedStyle = {
...styles.root,
...motionStyle
};
if (zIndex) mergedStyle.zIndex = zIndex;
return /* @__PURE__ */ import_react.createElement("div", {
ref: wrapperRef,
className: clsx(prefixCls, rootClassName, classNames.root, motionClassName, {
[`${prefixCls}-movable`]: movable,
[`${prefixCls}-moving`]: isMoving
}),
style: mergedStyle,
role: "dialog",
"aria-modal": "true",
"aria-label": alt,
tabIndex: -1
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-mask`, classNames.mask),
style: styles.mask,
onClick: maskClosable ? onClose : void 0
}), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-body`, classNames.body),
style: bodyStyle
}, imageRender ? imageRender(imgNode, {
transform,
image,
...groupContext ? { current } : {}
}) : imgNode), closeIcon !== false && closeIcon !== null && /* @__PURE__ */ import_react.createElement(CloseBtn, {
prefixCls,
icon: closeIcon === true ? icons.close : closeIcon || icons.close,
onClick: onClose,
className: classNames.close,
style: styles.close
}), showLeftOrRightSwitches && /* @__PURE__ */ import_react.createElement(PrevNext, {
prefixCls,
current,
count,
icons,
onActive
}), /* @__PURE__ */ import_react.createElement(Footer$2, {
prefixCls,
showProgress: showOperationsProgress,
current,
count,
showSwitch: showLeftOrRightSwitches,
classNames,
styles,
image,
transform,
icons,
countRender,
actionsRender,
scale,
minScale,
maxScale,
onActive,
onFlipY,
onFlipX,
onRotateLeft,
onRotateRight,
onZoomOut,
onZoomIn,
onClose,
onReset
}));
}));
};
//#endregion
//#region node_modules/@rc-component/image/es/common.js
var COMMON_PROPS = [
"crossOrigin",
"decoding",
"draggable",
"loading",
"referrerPolicy",
"sizes",
"srcSet",
"useMap",
"alt",
"fetchPriority"
];
//#endregion
//#region node_modules/@rc-component/image/es/hooks/usePreviewItems.js
/**
* Merge props provided `items` or context collected images
*/
function usePreviewItems(items) {
const [images, setImages] = import_react.useState({});
const registerImage = import_react.useCallback((id, data) => {
setImages((imgs) => ({
...imgs,
[id]: data
}));
return () => {
setImages((imgs) => {
const cloneImgs = { ...imgs };
delete cloneImgs[id];
return cloneImgs;
});
};
}, []);
return [
import_react.useMemo(() => {
if (items) return items.map((item) => {
if (typeof item === "string") return { data: { src: item } };
const data = {};
Object.keys(item).forEach((key) => {
if (["src", ...COMMON_PROPS].includes(key)) data[key] = item[key];
});
return { data };
});
return Object.keys(images).reduce((total, id) => {
const { canPreview, data } = images[id];
if (canPreview) total.push({
data,
id
});
return total;
}, []);
}, [items, images]),
registerImage,
!!items
];
}
//#endregion
//#region node_modules/@rc-component/image/es/PreviewGroup.js
function _extends$33() {
_extends$33 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$33.apply(this, arguments);
}
var Group$1 = ({ previewPrefixCls = "rc-image-preview", classNames, styles, children, icons = {}, items, preview, fallback }) => {
const { open: previewOpen, onOpenChange, current: currentIndex, onChange, ...restProps } = preview && typeof preview === "object" ? preview : {};
const [mergedItems, register, fromItems] = usePreviewItems(items);
const [current, setCurrent] = useControlledState(0, currentIndex);
const [keepOpenIndex, setKeepOpenIndex] = (0, import_react.useState)(false);
const { src, ...imgCommonProps } = mergedItems[current]?.data || {};
const [isShowPreview, setShowPreview] = useControlledState(!!previewOpen, previewOpen);
const triggerShowPreview = useEvent((next) => {
setShowPreview(next);
if (next !== isShowPreview) onOpenChange?.(next, { current });
});
const [mousePosition, setMousePosition] = (0, import_react.useState)(null);
const onPreviewFromImage = import_react.useCallback((id, imageSrc, mouseX, mouseY) => {
const index = fromItems ? mergedItems.findIndex((item) => item.data.src === imageSrc) : mergedItems.findIndex((item) => item.id === id);
setCurrent(index < 0 ? 0 : index);
triggerShowPreview(true);
setMousePosition({
x: mouseX,
y: mouseY
});
setKeepOpenIndex(true);
}, [mergedItems, fromItems]);
import_react.useEffect(() => {
if (isShowPreview) {
if (!keepOpenIndex) setCurrent(0);
} else setKeepOpenIndex(false);
}, [isShowPreview]);
const onInternalChange = (next, prev) => {
setCurrent(next);
onChange?.(next, prev);
};
const onPreviewClose = () => {
triggerShowPreview(false);
setMousePosition(null);
};
const previewGroupContext = import_react.useMemo(() => ({
register,
onPreview: onPreviewFromImage
}), [register, onPreviewFromImage]);
return /* @__PURE__ */ import_react.createElement(PreviewGroupContext.Provider, { value: previewGroupContext }, children, /* @__PURE__ */ import_react.createElement(Preview, _extends$33({
"aria-hidden": !isShowPreview,
open: isShowPreview,
prefixCls: previewPrefixCls,
onClose: onPreviewClose,
mousePosition,
imgCommonProps,
src,
fallback,
icons,
current,
count: mergedItems.length,
onChange: onInternalChange
}, restProps, {
classNames: classNames?.popup,
styles: styles?.popup
})));
};
//#endregion
//#region node_modules/@rc-component/image/es/hooks/useRegisterImage.js
var uid$1 = 0;
function useRegisterImage(canPreview, data) {
const [id] = import_react.useState(() => {
uid$1 += 1;
return String(uid$1);
});
const groupContext = import_react.useContext(PreviewGroupContext);
const registerData = {
data,
canPreview
};
import_react.useEffect(() => {
if (groupContext) return groupContext.register(id, registerData);
}, []);
import_react.useEffect(() => {
if (groupContext) groupContext.register(id, registerData);
}, [canPreview, data]);
return id;
}
//#endregion
//#region node_modules/@rc-component/image/es/Image.js
function _extends$32() {
_extends$32 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$32.apply(this, arguments);
}
var ImageInternal = (props) => {
const { prefixCls = "rc-image", previewPrefixCls = `${prefixCls}-preview`, rootClassName, className, style, classNames = {}, styles = {}, width, height, src: imgSrc, alt, placeholder, fallback, preview = true, onClick, onError, onKeyDown, ...otherProps } = props;
const groupContext = (0, import_react.useContext)(PreviewGroupContext);
const canPreview = !!preview;
const { src: previewSrc, open: previewOpen, onOpenChange: onPreviewOpenChange, cover, rootClassName: previewRootClassName, ...restProps } = preview && typeof preview === "object" ? preview : {};
const coverPlacement = typeof cover === "object" && cover.placement ? cover.placement || "center" : "center";
const coverNode = typeof cover === "object" && cover.coverNode ? cover.coverNode : cover;
const [isShowPreview, setShowPreview] = useControlledState(!!previewOpen, previewOpen);
const [mousePosition, setMousePosition] = (0, import_react.useState)(null);
const triggerPreviewOpen = (nextOpen) => {
setShowPreview(nextOpen);
onPreviewOpenChange?.(nextOpen);
};
const onPreviewClose = () => {
triggerPreviewOpen(false);
};
const isCustomPlaceholder = placeholder && placeholder !== true;
const src = previewSrc ?? imgSrc;
const [getImgRef, srcAndOnload, status] = useStatus({
src: imgSrc,
isCustomPlaceholder,
fallback
});
const imgCommonProps = (0, import_react.useMemo)(() => {
const obj = {};
COMMON_PROPS.forEach((prop) => {
if (props[prop] !== void 0) obj[prop] = props[prop];
});
return obj;
}, COMMON_PROPS.map((prop) => props[prop]));
const imageId = useRegisterImage(canPreview, (0, import_react.useMemo)(() => ({
...imgCommonProps,
src
}), [src, imgCommonProps]));
const onPreview = (e) => {
const rect = e.target.getBoundingClientRect();
const left = rect.x + rect.width / 2;
const top = rect.y + rect.height / 2;
if (groupContext) groupContext.onPreview(imageId, src, left, top);
else {
setMousePosition({
x: left,
y: top
});
triggerPreviewOpen(true);
}
onClick?.(e);
};
const onPreviewKeyDown = (event) => {
onKeyDown?.(event);
if (!canPreview) return;
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
const rect = event.target.getBoundingClientRect();
const left = rect.x + rect.width / 2;
const top = rect.y + rect.height / 2;
if (groupContext) groupContext.onPreview(imageId, src, left, top);
else {
setMousePosition({
x: left,
y: top
});
triggerPreviewOpen(true);
}
}
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("div", _extends$32({}, otherProps, {
className: clsx(prefixCls, rootClassName, classNames.root, { [`${prefixCls}-error`]: status === "error" }),
onClick: canPreview ? onPreview : onClick,
role: canPreview ? "button" : otherProps.role,
tabIndex: canPreview && otherProps.tabIndex == null ? 0 : otherProps.tabIndex,
"aria-label": canPreview ? otherProps["aria-label"] ?? alt : otherProps["aria-label"],
onKeyDown: onPreviewKeyDown,
style: {
width,
height,
...styles.root
}
}), /* @__PURE__ */ import_react.createElement("img", _extends$32({}, imgCommonProps, {
className: clsx(`${prefixCls}-img`, { [`${prefixCls}-img-placeholder`]: placeholder === true }, classNames.image, className),
style: {
height,
...styles.image,
...style
},
ref: getImgRef
}, srcAndOnload, {
width,
height,
onError
})), status === "loading" && /* @__PURE__ */ import_react.createElement("div", {
"aria-hidden": "true",
className: `${prefixCls}-placeholder`
}, placeholder), cover !== false && canPreview && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-cover`, classNames.cover, `${prefixCls}-cover-${coverPlacement}`),
style: {
display: style?.display === "none" ? "none" : void 0,
...styles.cover
}
}, coverNode)), !groupContext && canPreview && /* @__PURE__ */ import_react.createElement(Preview, _extends$32({
"aria-hidden": !isShowPreview,
open: isShowPreview,
prefixCls: previewPrefixCls,
onClose: onPreviewClose,
mousePosition,
src,
alt,
imageInfo: {
width,
height
},
fallback,
imgCommonProps
}, restProps, {
classNames: classNames?.popup,
styles: styles?.popup,
rootClassName: clsx(previewRootClassName, rootClassName)
})));
};
ImageInternal.PreviewGroup = Group$1;
ImageInternal.displayName = "Image";
//#endregion
//#region node_modules/@rc-component/image/es/index.js
var es_default$8 = ImageInternal;
//#endregion
//#region node_modules/antd/es/image/hooks/useMergedPreviewConfig.js
var useMergedPreviewConfig = (previewConfig, contextPreviewConfig, prefixCls, mergedRootClassName, getContextPopupContainer, icons, defaultCover) => {
const [zIndex] = useZIndex("ImagePreview", previewConfig?.zIndex);
const [mergedPreviewMask, blurClassName] = useMergedMask(previewConfig?.mask, contextPreviewConfig?.mask, `${prefixCls}-preview`);
return import_react.useMemo(() => {
if (!previewConfig) return previewConfig;
const { cover, getContainer, closeIcon, rootClassName: previewRootClassName } = previewConfig;
const { closeIcon: contextCloseIcon } = contextPreviewConfig ?? {};
return {
motionName: getTransitionName(`${prefixCls}-preview`, "fade"),
...previewConfig,
...defaultCover ? { cover: cover ?? defaultCover } : {},
icons,
getContainer: getContainer ?? getContextPopupContainer,
zIndex,
closeIcon: closeIcon ?? contextCloseIcon,
rootClassName: clsx(mergedRootClassName, previewRootClassName),
mask: mergedPreviewMask,
blurClassName: blurClassName.mask
};
}, [
previewConfig,
contextPreviewConfig,
prefixCls,
mergedRootClassName,
getContextPopupContainer,
defaultCover,
icons,
zIndex,
mergedPreviewMask,
blurClassName
]);
};
//#endregion
//#region node_modules/antd/es/image/hooks/usePreviewConfig.js
function normalizeMask(mask) {
if (/* @__PURE__ */ (0, import_react.isValidElement)(mask)) return [mask, void 0];
if (typeof mask === "boolean" || isPlainObject(mask)) return [void 0, mask];
return [void 0, void 0];
}
function usePreviewConfig(preview) {
const rawPreviewConfig = (0, import_react.useMemo)(() => {
if (typeof preview === "boolean") return preview ? {} : null;
return isPlainObject(preview) ? preview : {};
}, [preview]);
const splittedPreviewConfig = (0, import_react.useMemo)(() => {
if (!rawPreviewConfig) return [
rawPreviewConfig,
"",
""
];
const { open, onOpenChange, cover, actionsRender, visible, onVisibleChange, rootClassName, maskClassName, mask, forceRender: _forceRender, destroyOnClose: _destroyOnClose, toolbarRender, ...restPreviewConfig } = rawPreviewConfig;
let onInternalOpenChange;
if (onOpenChange) onInternalOpenChange = onOpenChange;
else if (onVisibleChange) onInternalOpenChange = (nextOpen, info) => {
const { current } = info || {};
if (current !== void 0) onVisibleChange(nextOpen, !nextOpen, current);
else onVisibleChange(nextOpen, !nextOpen);
};
const [coverElement, maskConfig] = normalizeMask(mask);
return [
{
...restPreviewConfig,
open: open ?? visible,
onOpenChange: onInternalOpenChange,
cover: cover ?? coverElement,
mask: maskConfig,
actionsRender: actionsRender ?? toolbarRender
},
rootClassName,
maskClassName
];
}, [rawPreviewConfig]);
{
const warning = devUseWarning("Image");
if (rawPreviewConfig) {
[
["visible", "open"],
["onVisibleChange", "onOpenChange"],
["maskClassName", "classNames.cover"],
["rootClassName", "classNames.root"],
["toolbarRender", "actionsRender"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in rawPreviewConfig), deprecatedName, newName);
});
warning(!/* @__PURE__ */ (0, import_react.isValidElement)(rawPreviewConfig.mask), "deprecated", "`mask` used as ReactNode is deprecated. Please use `cover` instead.");
warning(!("forceRender" in rawPreviewConfig), "breaking", "`forceRender` is no longer supported.");
warning(!("destroyOnClose" in rawPreviewConfig), "breaking", "`destroyOnClose` is no longer supported.");
}
}
return splittedPreviewConfig;
}
//#endregion
//#region node_modules/antd/es/image/style/index.js
var genBoxStyle = (position) => ({
position: position || "absolute",
inset: 0
});
var genImageCoverStyle = (token) => {
const { componentCls, motionDurationSlow, colorTextLightSolid } = token;
return { [componentCls]: {
[`${componentCls}-cover`]: {
position: "absolute",
inset: 0,
display: "flex",
alignItems: "center",
justifyContent: "center",
color: colorTextLightSolid,
background: new FastColor("#000").setA(.3).toRgbString(),
cursor: "pointer",
opacity: 0,
transition: `opacity ${motionDurationSlow}`
},
"&:hover, &:focus-visible": { [`${componentCls}-cover`]: { opacity: 1 } },
[`${componentCls}-cover-top`]: {
inset: "0 0 auto 0",
justifyContent: "center"
},
[`${componentCls}-cover-bottom`]: {
inset: "auto 0 0 0",
justifyContent: "center"
}
} };
};
var genImagePreviewStyle = (token) => {
const { motionEaseOut, previewCls, motionDurationSlow, componentCls, colorBgMask, marginXL, marginSM, margin, colorTextLightSolid, paddingSM, paddingLG, previewOperationHoverColor, previewOperationColorDisabled, previewOperationSize, zIndexPopup } = token;
const operationBg = new FastColor(colorBgMask).setA(.1);
const operationBgHover = operationBg.clone().setA(.2);
const singleBtn = {
position: "absolute",
color: colorTextLightSolid,
backgroundColor: operationBg.toRgbString(),
borderRadius: "50%",
padding: paddingSM,
outline: 0,
border: 0,
cursor: "pointer",
transition: `all ${motionDurationSlow}`,
display: "flex",
fontSize: previewOperationSize,
"&:hover": { backgroundColor: operationBgHover.toRgbString() },
"&:active": { backgroundColor: operationBg.toRgbString() },
"&:focus-visible": genFocusOutline(token)
};
return { [`${componentCls}-preview`]: {
textAlign: "center",
inset: 0,
position: "fixed",
userSelect: "none",
zIndex: zIndexPopup,
[`${previewCls}-mask`]: {
inset: 0,
position: "absolute",
background: colorBgMask,
backdropFilter: "blur(0px)",
transition: `backdrop-filter ${motionDurationSlow}`,
[`&${componentCls}-preview-mask-blur`]: { backdropFilter: "blur(4px)" },
[`&${componentCls}-preview-mask-hidden`]: { display: "none" }
},
[`${previewCls}-body`]: {
...genBoxStyle(),
"pointer-events": "none",
display: "flex",
alignItems: "center",
justifyContent: "center",
"> *": { pointerEvents: "auto" }
},
[`${previewCls}-img`]: {
maxWidth: "100%",
maxHeight: "70%",
verticalAlign: "middle",
transform: "scale3d(1, 1, 1)",
transition: `transform ${motionDurationSlow} ${motionEaseOut} 0s`
},
[`&-movable ${previewCls}-img`]: { cursor: "grab" },
[`&-moving ${previewCls}-img`]: { cursor: "grabbing" },
[`${previewCls}-close`]: {
...singleBtn,
top: marginSM,
insetInlineEnd: marginSM
},
[`${previewCls}-switch`]: {
...singleBtn,
top: "50%",
transform: `translateY(-50%)`,
"&-disabled": { "&, &:hover, &:active": {
color: previewOperationColorDisabled,
background: "transparent",
cursor: "not-allowed"
} },
"&-prev": { insetInlineStart: marginSM },
"&-next": { insetInlineEnd: marginSM }
},
[`${previewCls}-footer`]: {
position: "absolute",
bottom: marginXL,
left: {
_skip_check_: true,
value: "50%"
},
display: "flex",
flexDirection: "column",
alignItems: "center",
color: token.previewOperationColor,
transform: "translateX(-50%)",
gap: margin
},
[`${previewCls}-actions`]: {
display: "flex",
gap: paddingSM,
padding: `0 ${unit$1(paddingLG)}`,
backgroundColor: operationBg.toRgbString(),
borderRadius: 100,
fontSize: previewOperationSize,
"&-action": {
color: "inherit",
background: "transparent",
border: 0,
font: "inherit",
padding: paddingSM,
cursor: "pointer",
transition: `all ${motionDurationSlow}`,
display: "flex",
[`&:not(${previewCls}-actions-action-disabled):hover`]: { color: previewOperationHoverColor },
"&:focus-visible": genFocusOutline(token),
"&-disabled": {
color: previewOperationColorDisabled,
cursor: "not-allowed"
}
}
}
} };
};
var genImageStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
position: "relative",
display: "inline-block",
...genFocusStyle(token),
[`${componentCls}-img`]: {
width: "100%",
height: "auto",
verticalAlign: "middle"
},
[`${componentCls}-img-placeholder`]: {
backgroundColor: token.colorBgContainerDisabled,
backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
backgroundRepeat: "no-repeat",
backgroundPosition: "center center",
backgroundSize: "30%"
},
[`${componentCls}-placeholder`]: { ...genBoxStyle() }
} };
};
var genPreviewMotion = (token) => {
const { previewCls, motionDurationSlow } = token;
return { [previewCls]: { "&-fade": {
transition: `opacity ${motionDurationSlow}`,
"&-enter, &-appear": {
opacity: 0,
[`${previewCls}-body`]: { transform: "scale(0)" },
"&-active": {
opacity: 1,
[`${previewCls}-body`]: {
transform: "scale(1)",
transition: `transform ${motionDurationSlow}`
}
}
},
"&-leave": {
opacity: 1,
"&-active": {
opacity: 0,
[`${previewCls}-body`]: {
transform: "scale(0)",
transition: `transform ${motionDurationSlow}`
}
}
}
} } };
};
var prepareComponentToken$21 = (token) => ({
zIndexPopup: token.zIndexPopupBase + 80,
previewOperationColor: new FastColor(token.colorTextLightSolid).setA(.65).toRgbString(),
previewOperationHoverColor: new FastColor(token.colorTextLightSolid).setA(.85).toRgbString(),
previewOperationColorDisabled: new FastColor(token.colorTextLightSolid).setA(.25).toRgbString(),
previewOperationSize: token.fontSizeIcon * 1.5
});
var style_default$22 = genStyleHooks("Image", (token) => {
const imageToken = merge(token, {
previewCls: `${token.componentCls}-preview`,
imagePreviewSwitchSize: token.controlHeightLG
});
return [
genImageStyle(imageToken),
genImageCoverStyle(imageToken),
genImagePreviewStyle(imageToken),
genPreviewMotion(imageToken)
];
}, prepareComponentToken$21);
//#endregion
//#region node_modules/antd/es/image/PreviewGroup.js
var icons = {
rotateLeft: /* @__PURE__ */ import_react.createElement(RefIcon$22, null),
rotateRight: /* @__PURE__ */ import_react.createElement(RefIcon$23, null),
zoomIn: /* @__PURE__ */ import_react.createElement(RefIcon$24, null),
zoomOut: /* @__PURE__ */ import_react.createElement(RefIcon$25, null),
close: /* @__PURE__ */ import_react.createElement(RefIcon, null),
left: /* @__PURE__ */ import_react.createElement(RefIcon$12, null),
right: /* @__PURE__ */ import_react.createElement(RefIcon$6, null),
flipX: /* @__PURE__ */ import_react.createElement(RefIcon$26, null),
flipY: /* @__PURE__ */ import_react.createElement(RefIcon$26, { rotate: 90 })
};
var InternalPreviewGroup = ({ previewPrefixCls: customizePrefixCls, preview, classNames, styles, ...otherProps }) => {
const { getPrefixCls, getPopupContainer: getContextPopupContainer, direction, preview: contextPreview, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("image");
const prefixCls = getPrefixCls("image", customizePrefixCls);
const previewPrefixCls = `${prefixCls}-preview`;
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$22(prefixCls, rootCls);
const mergedRootClassName = clsx(hashId, cssVarCls, rootCls);
const [previewConfig, previewRootClassName, previewMaskClassName] = usePreviewConfig(preview);
const [contextPreviewConfig, contextPreviewRootClassName, contextPreviewMaskClassName] = usePreviewConfig(contextPreview);
const memoizedIcons = import_react.useMemo(() => ({
...icons,
left: direction === "rtl" ? /* @__PURE__ */ import_react.createElement(RefIcon$6, null) : /* @__PURE__ */ import_react.createElement(RefIcon$12, null),
right: direction === "rtl" ? /* @__PURE__ */ import_react.createElement(RefIcon$12, null) : /* @__PURE__ */ import_react.createElement(RefIcon$6, null)
}), [direction]);
const mergedPreview = useMergedPreviewConfig(previewConfig, contextPreviewConfig, prefixCls, mergedRootClassName, getContextPopupContainer, icons);
const { mask: mergedMask, blurClassName } = mergedPreview ?? {};
const mergedProps = {
...otherProps,
classNames,
styles
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([
contextClassNames,
classNames,
{
cover: clsx(contextPreviewMaskClassName, previewMaskClassName),
popup: {
root: clsx(contextPreviewRootClassName, previewRootClassName),
mask: clsx({ [`${prefixCls}-preview-mask-hidden`]: !mergedMask }, blurClassName)
}
}
], [contextStyles, styles], { props: mergedProps }, { popup: { _default: "root" } });
return /* @__PURE__ */ import_react.createElement(es_default$8.PreviewGroup, {
preview: mergedPreview,
previewPrefixCls,
icons: memoizedIcons,
...otherProps,
classNames: mergedClassNames,
styles: mergedStyles
});
};
//#endregion
//#region node_modules/antd/es/image/index.js
var Image$1 = (props) => {
const { prefixCls: customizePrefixCls, preview, className, rootClassName, style, styles, classNames, wrapperStyle, fallback, ...otherProps } = props;
const { getPrefixCls, getPopupContainer: getContextPopupContainer, className: contextClassName, style: contextStyle, preview: contextPreview, styles: contextStyles, classNames: contextClassNames, fallback: contextFallback } = useComponentConfig("image");
const prefixCls = getPrefixCls("image", customizePrefixCls);
devUseWarning("Image").deprecated(!wrapperStyle, "wrapperStyle", "styles.root");
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$22(prefixCls, rootCls);
const mergedRootClassName = clsx(rootClassName, hashId, cssVarCls, rootCls);
const mergedClassName = clsx(className, hashId, contextClassName);
const [previewConfig, previewRootClassName, previewMaskClassName] = usePreviewConfig(preview);
const [contextPreviewConfig, contextPreviewRootClassName, contextPreviewMaskClassName] = usePreviewConfig(contextPreview);
const mergedPreviewConfig = useMergedPreviewConfig(previewConfig, contextPreviewConfig, prefixCls, mergedRootClassName, getContextPopupContainer, icons, true);
const mergedProps = {
...props,
preview: mergedPreviewConfig
};
const mergedLegacyClassNames = import_react.useMemo(() => ({
cover: clsx(contextPreviewMaskClassName, previewMaskClassName),
popup: { root: clsx(contextPreviewRootClassName, previewRootClassName) }
}), [
previewRootClassName,
previewMaskClassName,
contextPreviewRootClassName,
contextPreviewMaskClassName
]);
const { mask: mergedMask, blurClassName } = mergedPreviewConfig ?? {};
const mergedPopupClassNames = import_react.useMemo(() => ({ mask: clsx({ [`${prefixCls}-preview-mask-hidden`]: !mergedMask }, blurClassName) }), [
mergedMask,
prefixCls,
blurClassName
]);
const [mergedClassNames, mergedStyles] = useMergeSemantic(import_react.useMemo(() => [
contextClassNames,
classNames,
mergedLegacyClassNames,
{ popup: mergedPopupClassNames }
], [
contextClassNames,
classNames,
mergedLegacyClassNames,
mergedPopupClassNames
]), [
contextStyles,
{ root: wrapperStyle },
styles
], { props: mergedProps }, { popup: { _default: "root" } });
const mergedStyle = {
...contextStyle,
...style
};
const mergedFallback = fallback ?? contextFallback;
return /* @__PURE__ */ import_react.createElement(es_default$8, {
prefixCls,
preview: mergedPreviewConfig || false,
rootClassName: mergedRootClassName,
className: mergedClassName,
style: mergedStyle,
fallback: mergedFallback,
...otherProps,
classNames: mergedClassNames,
styles: mergedStyles
});
};
Image$1.PreviewGroup = InternalPreviewGroup;
Image$1.displayName = "Image";
//#endregion
//#region node_modules/antd/es/input/Group.js
/** @deprecated Please use `Space.Compact` */
var Group = (props) => {
const { getPrefixCls, direction } = (0, import_react.useContext)(ConfigContext);
const { prefixCls: customizePrefixCls, className } = props;
const prefixCls = getPrefixCls("input-group", customizePrefixCls);
const [hashId, cssVarCls] = style_default$41(getPrefixCls("input"));
const cls = clsx(prefixCls, cssVarCls, {
[`${prefixCls}-lg`]: props.size === "large",
[`${prefixCls}-sm`]: props.size === "small",
[`${prefixCls}-compact`]: props.compact,
[`${prefixCls}-rtl`]: direction === "rtl"
}, hashId, className);
const formItemContext = (0, import_react.useContext)(FormItemInputContext);
const groupFormItemContext = (0, import_react.useMemo)(() => ({
...formItemContext,
isFormItemInput: false
}), [formItemContext]);
devUseWarning("Input.Group").deprecated(false, "Input.Group", "Space.Compact");
return /* @__PURE__ */ import_react.createElement(FormItemInputContext.Provider, { value: groupFormItemContext }, /* @__PURE__ */ import_react.createElement(Space.Compact, {
className: cls,
style: props.style,
onMouseEnter: props.onMouseEnter,
onMouseLeave: props.onMouseLeave,
onFocus: props.onFocus,
onBlur: props.onBlur
}, props.children));
};
//#endregion
//#region node_modules/antd/es/input/style/otp.js
var genOTPStyle = (token) => {
const { componentCls, paddingXS } = token;
return { [componentCls]: {
display: "inline-flex",
alignItems: "center",
flexWrap: "nowrap",
columnGap: paddingXS,
[`${componentCls}-input-wrapper`]: {
position: "relative",
[`${componentCls}-mask-icon`]: {
position: "absolute",
zIndex: "1",
top: "50%",
right: "50%",
transform: "translate(50%, -50%)",
pointerEvents: "none"
},
[`${componentCls}-mask-input`]: {
color: "transparent",
caretColor: token.colorText,
"&::selection": { color: "transparent" }
},
[`${componentCls}-mask-input[type=number]::-webkit-inner-spin-button`]: {
"-webkit-appearance": "none",
margin: 0
},
[`${componentCls}-mask-input[type=number]`]: { "-moz-appearance": "textfield" }
},
"&-rtl": { direction: "rtl" },
[`${componentCls}-input`]: {
textAlign: "center",
paddingInline: token.paddingXXS
},
[`&${componentCls}-sm ${componentCls}-input`]: { paddingInline: token.calc(token.paddingXXS).div(2).equal() },
[`&${componentCls}-lg ${componentCls}-input`]: { paddingInline: token.paddingXS }
} };
};
var otp_default = genStyleHooks(["Input", "OTP"], (token) => {
return genOTPStyle(merge(token, initInputToken(token)));
}, initComponentToken$1);
//#endregion
//#region node_modules/antd/es/input/OTP/OTPInput.js
var OTPInput = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { className, value, onChange, onActiveChange, index, mask, onFocus, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("otp");
const maskValue = typeof mask === "string" ? mask : value;
const inputRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => inputRef.current);
const onInternalChange = (e) => {
onChange(index, e.target.value);
};
const syncSelection = () => {
wrapperRaf(() => {
const inputEle = inputRef.current?.input;
if (document.activeElement === inputEle && inputEle) inputEle.select();
});
};
const onInternalFocus = (e) => {
onFocus?.(e);
syncSelection();
};
const onInternalKeyDown = (event) => {
const { key, ctrlKey, metaKey } = event;
if (key === "ArrowLeft") onActiveChange(index - 1);
else if (key === "ArrowRight") onActiveChange(index + 1);
else if (key === "z" && (ctrlKey || metaKey)) event.preventDefault();
else if (key === "Backspace" && !value) onActiveChange(index - 1);
syncSelection();
};
return /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-input-wrapper`,
role: "presentation"
}, mask && value !== "" && value !== void 0 && /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-mask-icon`,
"aria-hidden": "true"
}, maskValue), /* @__PURE__ */ import_react.createElement(Input$1, {
"aria-label": `OTP Input ${index + 1}`,
type: mask === true ? "password" : "text",
...restProps,
ref: inputRef,
value,
onInput: onInternalChange,
onFocus: onInternalFocus,
onKeyDown: onInternalKeyDown,
onMouseDown: syncSelection,
onMouseUp: syncSelection,
className: clsx(className, { [`${prefixCls}-mask-input`]: mask })
}));
});
//#endregion
//#region node_modules/antd/es/input/OTP/index.js
function strToArr(str) {
return (str || "").split("");
}
var Separator = (props) => {
const { index, prefixCls, separator, className: semanticClassName, style: semanticStyle } = props;
const separatorNode = typeof separator === "function" ? separator(index) : separator;
if (!separatorNode) return null;
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-separator`, semanticClassName),
style: semanticStyle
}, separatorNode);
};
var OTP = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, length = 6, size: customSize, defaultValue, value, onChange, formatter, separator, variant, disabled, status: customStatus, autoFocus, mask, type, autoComplete, onInput, onFocus, inputMode, classNames, styles, className, style, ...restProps } = props;
devUseWarning("Input.OTP")(!(typeof mask === "string" && mask.length > 1), "usage", "`mask` prop should be a single character.");
const { classNames: contextClassNames, styles: contextStyles, getPrefixCls, direction, style: contextStyle, className: contextClassName } = useComponentConfig("otp");
const prefixCls = getPrefixCls("otp", customizePrefixCls);
const mergedProps = {
...props,
length
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const domAttrs = pickAttrs(restProps, {
aria: true,
data: true,
attr: true
});
const [hashId, cssVarCls] = otp_default(prefixCls);
const mergedSize = useSize((ctx) => customSize ?? ctx);
const formContext = import_react.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(formContext.status, customStatus);
const proxyFormContext = import_react.useMemo(() => ({
...formContext,
status: mergedStatus,
hasFeedback: false,
feedbackIcon: null
}), [formContext, mergedStatus]);
const containerRef = import_react.useRef(null);
const inputsRef = import_react.useRef({});
import_react.useImperativeHandle(ref, () => ({
focus: () => {
inputsRef.current[0]?.focus();
},
blur: () => {
for (let i = 0; i < length; i += 1) inputsRef.current[i]?.blur();
},
nativeElement: containerRef.current
}));
const internalFormatter = (txt) => formatter ? formatter(txt) : txt;
const [valueCells, setValueCells] = import_react.useState(() => strToArr(internalFormatter(defaultValue || "")));
import_react.useEffect(() => {
if (value !== void 0) setValueCells(strToArr(value));
}, [value]);
const triggerValueCellsChange = useEvent((nextValueCells) => {
setValueCells(nextValueCells);
if (onInput) onInput(nextValueCells);
if (onChange && nextValueCells.length === length && nextValueCells.every((c) => c) && nextValueCells.some((c, index) => valueCells[index] !== c)) onChange(nextValueCells.join(""));
});
const patchValue = useEvent((index, txt) => {
let nextCells = _toConsumableArray$8(valueCells);
for (let i = 0; i < index; i += 1) if (!nextCells[i]) nextCells[i] = "";
if (txt.length <= 1) nextCells[index] = txt;
else nextCells = nextCells.slice(0, index).concat(strToArr(txt));
nextCells = nextCells.slice(0, length);
for (let i = nextCells.length - 1; i >= 0; i -= 1) {
if (nextCells[i]) break;
nextCells.pop();
}
nextCells = strToArr(internalFormatter(nextCells.map((c) => c || " ").join(""))).map((c, i) => {
if (c === " " && !nextCells[i]) return nextCells[i];
return c;
});
return nextCells;
});
const onInputChange = (index, txt) => {
const nextCells = patchValue(index, txt);
const nextIndex = Math.min(index + txt.length, length - 1);
if (nextIndex !== index && nextCells[index] !== void 0) inputsRef.current[nextIndex]?.focus();
triggerValueCellsChange(nextCells);
};
const onInputActiveChange = (nextIndex) => {
inputsRef.current[nextIndex]?.focus();
};
const onInputFocus = (event, index) => {
for (let i = 0; i < index; i += 1) if (!inputsRef.current[i]?.input?.value) {
inputsRef.current[i]?.focus();
break;
}
onFocus?.(event);
};
const inputSharedProps = {
variant,
disabled,
status: mergedStatus,
mask,
type,
inputMode,
autoComplete
};
return /* @__PURE__ */ import_react.createElement("div", {
...domAttrs,
ref: containerRef,
className: clsx(className, prefixCls, {
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-rtl`]: direction === "rtl"
}, cssVarCls, hashId, contextClassName, mergedClassNames.root),
style: {
...mergedStyles.root,
...contextStyle,
...style
},
role: "group"
}, /* @__PURE__ */ import_react.createElement(FormItemInputContext.Provider, { value: proxyFormContext }, Array.from({ length }).map((_, index) => {
const key = `otp-${index}`;
const singleValue = valueCells[index] || "";
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, { key }, /* @__PURE__ */ import_react.createElement(OTPInput, {
ref: (inputEle) => {
inputsRef.current[index] = inputEle;
},
index,
size: mergedSize,
htmlSize: 1,
className: clsx(mergedClassNames.input, `${prefixCls}-input`),
style: mergedStyles.input,
onChange: onInputChange,
value: singleValue,
onActiveChange: onInputActiveChange,
autoFocus: index === 0 && autoFocus,
onFocus: (event) => onInputFocus(event, index),
...inputSharedProps
}), index < length - 1 && /* @__PURE__ */ import_react.createElement(Separator, {
separator,
index,
prefixCls,
className: clsx(mergedClassNames.separator),
style: mergedStyles.separator
}));
})));
});
//#endregion
//#region node_modules/antd/es/input/Password.js
var defaultIconRender = (visible) => visible ? /* @__PURE__ */ import_react.createElement(RefIcon$27, null) : /* @__PURE__ */ import_react.createElement(RefIcon$28, null);
var actionMap = {
click: "onClick",
hover: "onMouseOver"
};
var Password = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { disabled: customDisabled, action = "click", visibilityToggle = true, iconRender = defaultIconRender, suffix } = props;
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const visibilityControlled = isPlainObject(visibilityToggle) && visibilityToggle.visible !== void 0;
const [visible, setVisible] = (0, import_react.useState)(() => visibilityControlled ? visibilityToggle.visible : false);
const inputRef = (0, import_react.useRef)(null);
import_react.useEffect(() => {
if (visibilityControlled) setVisible(visibilityToggle.visible);
}, [visibilityControlled, visibilityToggle]);
const removePasswordTimeout = useRemovePasswordTimeout(inputRef);
const onVisibleChange = () => {
if (mergedDisabled) return;
if (visible) removePasswordTimeout();
const nextVisible = !visible;
setVisible(nextVisible);
if (isPlainObject(visibilityToggle)) visibilityToggle.onVisibleChange?.(nextVisible);
};
const getIcon = (prefixCls) => {
const iconTrigger = actionMap[action] || "";
const icon = iconRender(visible);
const iconProps = {
[iconTrigger]: onVisibleChange,
className: `${prefixCls}-icon`,
key: "passwordIcon",
onMouseDown: (e) => {
e.preventDefault();
},
onMouseUp: (e) => {
e.preventDefault();
}
};
return /* @__PURE__ */ import_react.cloneElement(/* @__PURE__ */ import_react.isValidElement(icon) ? icon : /* @__PURE__ */ import_react.createElement("span", null, icon), iconProps);
};
const { className, prefixCls: customizePrefixCls, inputPrefixCls: customizeInputPrefixCls, size, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const inputPrefixCls = getPrefixCls("input", customizeInputPrefixCls);
const prefixCls = getPrefixCls("input-password", customizePrefixCls);
const suffixIcon = visibilityToggle && getIcon(prefixCls);
const inputClassName = clsx(prefixCls, className, { [`${prefixCls}-${size}`]: !!size });
const omittedProps = {
...omit(restProps, [
"suffix",
"iconRender",
"visibilityToggle"
]),
type: visible ? "text" : "password",
className: inputClassName,
prefixCls: inputPrefixCls,
suffix: /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, suffixIcon, suffix)
};
if (size) omittedProps.size = size;
return /* @__PURE__ */ import_react.createElement(Input$1, {
ref: composeRef(ref, inputRef),
...omittedProps
});
});
Password.displayName = "Input.Password";
//#endregion
//#region node_modules/antd/es/input/style/search.js
var genSearchStyle = (token) => {
const { componentCls } = token;
const btnCls = `${componentCls}-btn`;
return { [componentCls]: {
width: "100%",
[btnCls]: { "&-filled": {
background: token.colorFillTertiary,
"&:not(:disabled)": {
"&:hover": { background: token.colorFillSecondary },
"&:active": { background: token.colorFill }
}
} }
} };
};
var search_default = genStyleHooks(["Input", "Search"], genSearchStyle);
//#endregion
//#region node_modules/antd/es/input/Search.js
var Search$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, inputPrefixCls: customizeInputPrefixCls, className, size: customizeSize, style, enterButton = false, addonAfter, loading, disabled, onSearch: customOnSearch, onChange: customOnChange, onCompositionStart, onCompositionEnd, variant, onPressEnter: customOnPressEnter, classNames, styles, hidden, ...restProps } = props;
const { direction, getPrefixCls, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("inputSearch");
const mergedProps = {
...props,
enterButton
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { button: { _default: "root" } });
const composedRef = import_react.useRef(false);
const prefixCls = getPrefixCls("input-search", customizePrefixCls);
const inputPrefixCls = getPrefixCls("input", customizeInputPrefixCls);
const [hashId, cssVarCls] = search_default(prefixCls);
const { compactSize } = useCompactItemContext(prefixCls, direction);
const size = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const inputRef = import_react.useRef(null);
const onChange = (e) => {
if (e?.target && e.type === "click" && customOnSearch) customOnSearch(e.target.value, e, { source: "clear" });
customOnChange?.(e);
};
const onMouseDown = (e) => {
if (document.activeElement === inputRef.current?.input) e.preventDefault();
};
const onSearch = (e) => {
if (customOnSearch) customOnSearch(inputRef.current?.input?.value, e, { source: "input" });
};
const onPressEnter = (e) => {
if (composedRef.current || loading) return;
customOnPressEnter?.(e);
onSearch(e);
};
const searchIcon = typeof enterButton === "boolean" ? /* @__PURE__ */ import_react.createElement(RefIcon$7, null) : null;
const btnPrefixCls = `${prefixCls}-btn`;
const btnClassName = clsx(btnPrefixCls, { [`${btnPrefixCls}-${variant}`]: variant });
let button;
const enterButtonAsElement = enterButton || {};
const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
if (isAntdButton || enterButtonAsElement.type === "button") button = cloneElement$1(enterButtonAsElement, {
onMouseDown,
onClick: (e) => {
enterButtonAsElement?.props?.onClick?.(e);
onSearch(e);
},
key: "enterButton",
...isAntdButton ? {
className: btnClassName,
size
} : {}
});
else button = /* @__PURE__ */ import_react.createElement(Button, {
classNames: mergedClassNames.button,
styles: mergedStyles.button,
className: btnClassName,
color: enterButton ? "primary" : "default",
size,
disabled,
key: "enterButton",
onMouseDown,
onClick: onSearch,
loading,
icon: searchIcon,
variant: variant === "borderless" || variant === "filled" || variant === "underlined" ? "text" : enterButton ? "solid" : void 0
}, enterButton);
if (addonAfter) button = [button, cloneElement$1(addonAfter, { key: "addonAfter" })];
const mergedClassName = clsx(prefixCls, cssVarCls, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-${size}`]: !!size,
[`${prefixCls}-with-button`]: !!enterButton
}, className, hashId, mergedClassNames.root);
const handleOnCompositionStart = (e) => {
composedRef.current = true;
onCompositionStart?.(e);
};
const handleOnCompositionEnd = (e) => {
composedRef.current = false;
onCompositionEnd?.(e);
};
const rootProps = pickAttrs(restProps, { data: true });
const inputProps = omit({
...restProps,
classNames: omit(mergedClassNames, ["button", "root"]),
styles: omit(mergedStyles, ["button", "root"]),
prefixCls: inputPrefixCls,
type: "search",
size,
variant,
onPressEnter,
onCompositionStart: handleOnCompositionStart,
onCompositionEnd: handleOnCompositionEnd,
onChange,
disabled
}, Object.keys(rootProps));
return /* @__PURE__ */ import_react.createElement(Compact, {
className: mergedClassName,
style: {
...style,
...mergedStyles.root
},
...rootProps,
hidden
}, /* @__PURE__ */ import_react.createElement(Input$1, {
ref: composeRef(inputRef, ref),
...inputProps
}), button);
});
Search$1.displayName = "Search";
//#endregion
//#region node_modules/@rc-component/textarea/es/calculateNodeHeight.js
/**
* calculateNodeHeight(uiTextNode, useCache = false)
*/
var HIDDEN_TEXTAREA_STYLE = `
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`;
var SIZING_STYLE = [
"letter-spacing",
"line-height",
"padding-top",
"padding-bottom",
"font-family",
"font-weight",
"font-size",
"font-variant",
"text-rendering",
"text-transform",
"width",
"text-indent",
"padding-left",
"padding-right",
"border-width",
"box-sizing",
"word-break",
"white-space"
];
var computedStyleCache = {};
var hiddenTextarea;
function calculateNodeStyling(node, useCache = false) {
const nodeRef = node.getAttribute("id") || node.getAttribute("data-reactid") || node.getAttribute("name");
if (useCache && computedStyleCache[nodeRef]) return computedStyleCache[nodeRef];
const style = window.getComputedStyle(node);
const boxSizing = style.getPropertyValue("box-sizing") || style.getPropertyValue("-moz-box-sizing") || style.getPropertyValue("-webkit-box-sizing");
const paddingSize = parseFloat(style.getPropertyValue("padding-bottom")) + parseFloat(style.getPropertyValue("padding-top"));
const borderSize = parseFloat(style.getPropertyValue("border-bottom-width")) + parseFloat(style.getPropertyValue("border-top-width"));
const nodeInfo = {
sizingStyle: SIZING_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(";"),
paddingSize,
borderSize,
boxSizing
};
if (useCache && nodeRef) computedStyleCache[nodeRef] = nodeInfo;
return nodeInfo;
}
function calculateAutoSizeStyle(uiTextNode, useCache = false, minRows = null, maxRows = null) {
if (!hiddenTextarea) {
hiddenTextarea = document.createElement("textarea");
hiddenTextarea.setAttribute("tab-index", "-1");
hiddenTextarea.setAttribute("aria-hidden", "true");
hiddenTextarea.setAttribute("name", "hiddenTextarea");
document.body.appendChild(hiddenTextarea);
}
if (uiTextNode.getAttribute("wrap")) hiddenTextarea.setAttribute("wrap", uiTextNode.getAttribute("wrap"));
else hiddenTextarea.removeAttribute("wrap");
const { paddingSize, borderSize, boxSizing, sizingStyle } = calculateNodeStyling(uiTextNode, useCache);
hiddenTextarea.setAttribute("style", `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`);
hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || "";
let minHeight = void 0;
let maxHeight = void 0;
let overflowY;
let height = hiddenTextarea.scrollHeight;
if (boxSizing === "border-box") height += borderSize;
else if (boxSizing === "content-box") height -= paddingSize;
if (minRows !== null || maxRows !== null) {
hiddenTextarea.value = " ";
const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
if (minRows !== null) {
minHeight = singleRowHeight * minRows;
if (boxSizing === "border-box") minHeight = minHeight + paddingSize + borderSize;
height = Math.max(minHeight, height);
}
if (maxRows !== null) {
maxHeight = singleRowHeight * maxRows;
if (boxSizing === "border-box") maxHeight = maxHeight + paddingSize + borderSize;
overflowY = height > maxHeight ? "" : "hidden";
height = Math.min(maxHeight, height);
}
}
const style = {
height,
overflowY,
resize: "none"
};
if (minHeight) style.minHeight = minHeight;
if (maxHeight) style.maxHeight = maxHeight;
return style;
}
//#endregion
//#region node_modules/@rc-component/textarea/es/ResizableTextArea.js
function _extends$31() {
_extends$31 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$31.apply(this, arguments);
}
var RESIZE_START = 0;
var RESIZE_MEASURING = 1;
var RESIZE_STABLE = 2;
var ResizableTextArea = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, defaultValue, value, autoSize, onResize, className, style, disabled, onChange, onInternalAutoSize, ...restProps } = props;
const [internalValue, setMergedValue] = useControlledState(defaultValue, value);
const mergedValue = internalValue ?? "";
const onInternalChange = (event) => {
setMergedValue(event.target.value);
onChange?.(event);
};
const textareaRef = import_react.useRef();
import_react.useImperativeHandle(ref, () => ({ textArea: textareaRef.current }));
const [minRows, maxRows] = import_react.useMemo(() => {
if (autoSize && typeof autoSize === "object") return [autoSize.minRows, autoSize.maxRows];
return [];
}, [autoSize]);
const needAutoSize = !!autoSize;
const [resizeState, setResizeState] = import_react.useState(RESIZE_STABLE);
const [autoSizeStyle, setAutoSizeStyle] = import_react.useState();
const startResize = () => {
setResizeState(RESIZE_START);
};
useLayoutEffect$1(() => {
if (needAutoSize) startResize();
}, [
value,
minRows,
maxRows,
needAutoSize
]);
useLayoutEffect$1(() => {
if (resizeState === RESIZE_START) setResizeState(RESIZE_MEASURING);
else if (resizeState === RESIZE_MEASURING) {
const textareaStyles = calculateAutoSizeStyle(textareaRef.current, false, minRows, maxRows);
setResizeState(RESIZE_STABLE);
setAutoSizeStyle(textareaStyles);
}
}, [resizeState]);
const resizeRafRef = import_react.useRef();
const cleanRaf = () => {
wrapperRaf.cancel(resizeRafRef.current);
};
const onInternalResize = (size) => {
if (resizeState === RESIZE_STABLE) {
onResize?.(size);
if (autoSize) {
cleanRaf();
resizeRafRef.current = wrapperRaf(() => {
startResize();
});
}
}
};
import_react.useEffect(() => cleanRaf, []);
const mergedAutoSizeStyle = needAutoSize ? autoSizeStyle : null;
const mergedStyle = {
...style,
...mergedAutoSizeStyle
};
if (resizeState === RESIZE_START || resizeState === RESIZE_MEASURING) {
mergedStyle.overflowY = "hidden";
mergedStyle.overflowX = "hidden";
}
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, {
onResize: onInternalResize,
disabled: !(autoSize || onResize)
}, /* @__PURE__ */ import_react.createElement("textarea", _extends$31({}, restProps, {
ref: textareaRef,
style: mergedStyle,
className: clsx(prefixCls, className, { [`${prefixCls}-disabled`]: disabled }),
disabled,
value: mergedValue,
onChange: onInternalChange
})));
});
//#endregion
//#region node_modules/@rc-component/textarea/es/TextArea.js
function _extends$30() {
_extends$30 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$30.apply(this, arguments);
}
//#endregion
//#region node_modules/@rc-component/textarea/es/index.js
var es_default$7 = /* @__PURE__ */ import_react.forwardRef(({ defaultValue, value: customValue, onFocus, onBlur, onChange, allowClear, maxLength, onCompositionStart, onCompositionEnd, suffix, prefixCls = "rc-textarea", showCount, count, className, style, disabled, hidden, classNames, styles, onResize, onClear, onPressEnter, readOnly, autoSize, onKeyDown, ...rest }, ref) => {
const [value, setValue] = useControlledState(defaultValue, customValue);
const formatValue = value === void 0 || value === null ? "" : String(value);
const [focused, setFocused] = import_react.useState(false);
const compositionRef = import_react.useRef(false);
const [textareaResized, setTextareaResized] = import_react.useState(null);
const holderRef = (0, import_react.useRef)(null);
const resizableTextAreaRef = (0, import_react.useRef)(null);
const getTextArea = () => resizableTextAreaRef.current?.textArea;
const focus = () => {
getTextArea().focus();
};
(0, import_react.useImperativeHandle)(ref, () => ({
resizableTextArea: resizableTextAreaRef.current,
focus,
blur: () => {
getTextArea().blur();
},
nativeElement: holderRef.current?.nativeElement || getTextArea()
}));
(0, import_react.useEffect)(() => {
setFocused((prev) => !disabled && prev);
}, [disabled]);
const [selection, setSelection] = import_react.useState(null);
import_react.useEffect(() => {
if (selection) getTextArea().setSelectionRange(...selection);
}, [selection]);
const countConfig = useCount(count, showCount);
const mergedMax = countConfig.max ?? maxLength;
const hasMaxLength = Number(mergedMax) > 0;
const valueLength = countConfig.strategy(formatValue);
const isOutOfRange = !!mergedMax && valueLength > mergedMax;
const triggerChange = (e, currentValue) => {
let cutValue = currentValue;
if (!compositionRef.current && countConfig.exceedFormatter && countConfig.max && countConfig.strategy(currentValue) > countConfig.max) {
cutValue = countConfig.exceedFormatter(currentValue, { max: countConfig.max });
if (currentValue !== cutValue) setSelection([getTextArea().selectionStart || 0, getTextArea().selectionEnd || 0]);
}
setValue(cutValue);
resolveOnChange(e.currentTarget, e, onChange, cutValue);
};
const onInternalCompositionStart = (e) => {
compositionRef.current = true;
onCompositionStart?.(e);
};
const onInternalCompositionEnd = (e) => {
compositionRef.current = false;
triggerChange(e, e.currentTarget.value);
onCompositionEnd?.(e);
};
const onInternalChange = (e) => {
triggerChange(e, e.target.value);
};
const handleKeyDown = (e) => {
if (e.key === "Enter" && onPressEnter && !e.nativeEvent.isComposing) onPressEnter(e);
onKeyDown?.(e);
};
const handleFocus = (e) => {
setFocused(true);
onFocus?.(e);
};
const handleBlur = (e) => {
setFocused(false);
onBlur?.(e);
};
const handleReset = (e) => {
setValue("");
focus();
resolveOnChange(getTextArea(), e, onChange);
};
let suffixNode = suffix;
let dataCount;
if (countConfig.show) {
if (countConfig.showFormatter) dataCount = countConfig.showFormatter({
value: formatValue,
count: valueLength,
maxLength: mergedMax
});
else dataCount = `${valueLength}${hasMaxLength ? ` / ${mergedMax}` : ""}`;
suffixNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, suffixNode, /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-data-count`, classNames?.count),
style: styles?.count
}, dataCount));
}
const handleResize = (size) => {
onResize?.(size);
if (getTextArea()?.style.height) setTextareaResized(true);
};
const isPureTextArea = !autoSize && !showCount && !allowClear;
return /* @__PURE__ */ import_react.createElement(BaseInput, {
ref: holderRef,
value: formatValue,
allowClear,
handleReset,
suffix: suffixNode,
prefixCls,
classNames: {
...classNames,
affixWrapper: clsx(classNames?.affixWrapper, {
[`${prefixCls}-show-count`]: showCount,
[`${prefixCls}-textarea-allow-clear`]: allowClear
})
},
disabled,
focused,
className: clsx(className, isOutOfRange && `${prefixCls}-out-of-range`),
style: {
...style,
...textareaResized && !isPureTextArea ? { height: "auto" } : {}
},
dataAttrs: { affixWrapper: { "data-count": typeof dataCount === "string" ? dataCount : void 0 } },
hidden,
readOnly,
onClear
}, /* @__PURE__ */ import_react.createElement(ResizableTextArea, _extends$30({}, rest, {
autoSize,
maxLength,
onKeyDown: handleKeyDown,
onChange: onInternalChange,
onFocus: handleFocus,
onBlur: handleBlur,
onCompositionStart: onInternalCompositionStart,
onCompositionEnd: onInternalCompositionEnd,
className: clsx(classNames?.textarea),
style: {
resize: style?.resize,
...styles?.textarea
},
disabled,
prefixCls,
onResize: handleResize,
ref: resizableTextAreaRef,
readOnly
})));
});
//#endregion
//#region node_modules/antd/es/input/style/textarea.js
var genTextAreaStyle = (token) => {
const { componentCls, paddingLG } = token;
const textareaPrefixCls = `${componentCls}-textarea`;
return {
[`textarea${componentCls}`]: {
maxWidth: "100%",
height: "auto",
minHeight: token.controlHeight,
lineHeight: token.lineHeight,
verticalAlign: "bottom",
transition: `all ${token.motionDurationSlow}`,
resize: "vertical",
[`&${componentCls}-mouse-active`]: { transition: `all ${token.motionDurationSlow}, height 0s, width 0s` }
},
[`${componentCls}-textarea-affix-wrapper-resize-dirty`]: { width: "auto" },
[textareaPrefixCls]: {
position: "relative",
"&-show-count": { [`${componentCls}-data-count`]: {
position: "absolute",
bottom: token.calc(token.fontSize).mul(token.lineHeight).mul(-1).equal(),
insetInlineEnd: 0,
color: token.colorTextDescription,
whiteSpace: "nowrap",
pointerEvents: "none"
} },
[`
&-allow-clear > ${componentCls},
&-affix-wrapper${textareaPrefixCls}-has-feedback ${componentCls}
`]: { paddingInlineEnd: paddingLG },
[`&-affix-wrapper${componentCls}-affix-wrapper`]: {
padding: 0,
[`> textarea${componentCls}`]: {
fontSize: "inherit",
border: "none",
outline: "none",
background: "transparent",
minHeight: token.calc(token.controlHeight).sub(token.calc(token.lineWidth).mul(2)).equal(),
"&:focus": { boxShadow: "none !important" }
},
[`${componentCls}-suffix`]: {
margin: 0,
"> *:not(:last-child)": { marginInline: 0 },
[`${componentCls}-clear-icon`]: {
position: "absolute",
insetInlineEnd: token.paddingInline,
insetBlockStart: token.paddingXS
},
[`${textareaPrefixCls}-suffix`]: {
position: "absolute",
top: 0,
insetInlineEnd: token.paddingInline,
bottom: 0,
zIndex: 1,
display: "inline-flex",
alignItems: "center",
margin: "auto",
pointerEvents: "none"
}
}
},
[`&-affix-wrapper${componentCls}-affix-wrapper-rtl`]: { [`${componentCls}-suffix`]: { [`${componentCls}-data-count`]: {
direction: "ltr",
insetInlineStart: 0
} } },
[`&-affix-wrapper${componentCls}-affix-wrapper-sm`]: { [`${componentCls}-suffix`]: { [`${componentCls}-clear-icon`]: { insetInlineEnd: token.paddingInlineSM } } }
}
};
};
var textarea_default = genStyleHooks(["Input", "TextArea"], (token) => {
return genTextAreaStyle(merge(token, initInputToken(token)));
}, initComponentToken$1, { resetFont: false });
//#endregion
//#region node_modules/antd/es/input/TextArea.js
var TextArea = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls: customizePrefixCls, bordered = true, size: customizeSize, disabled: customDisabled, status: customStatus, allowClear, classNames, rootClassName, className, style, styles, variant: customVariant, showCount, onMouseDown, onResize, ...rest } = props;
{
const { deprecated } = devUseWarning("TextArea");
deprecated(!("bordered" in props), "bordered", "variant");
}
const { getPrefixCls, direction, allowClear: contextAllowClear, autoComplete: contextAutoComplete, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("textArea");
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const { status: contextStatus, hasFeedback, feedbackIcon } = import_react.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props });
const innerRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({
resizableTextArea: innerRef.current?.resizableTextArea,
focus: (option) => {
triggerFocus(innerRef.current?.resizableTextArea?.textArea, option);
},
blur: () => innerRef.current?.blur(),
nativeElement: innerRef.current?.nativeElement || null
}));
const prefixCls = getPrefixCls("input", customizePrefixCls);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = useSharedStyle(prefixCls, rootClassName);
textarea_default(prefixCls, rootCls);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const [variant, enableVariantCls] = useVariant("textArea", customVariant, bordered);
const mergedAllowClear = getAllowClear(allowClear ?? contextAllowClear);
const [isMouseDown, setIsMouseDown] = import_react.useState(false);
const [resizeDirty, setResizeDirty] = import_react.useState(false);
const onInternalMouseDown = (e) => {
setIsMouseDown(true);
onMouseDown?.(e);
const onMouseUp = () => {
setIsMouseDown(false);
document.removeEventListener("mouseup", onMouseUp);
};
document.addEventListener("mouseup", onMouseUp);
};
const onInternalResize = (size) => {
onResize?.(size);
if (isMouseDown && typeof getComputedStyle === "function") {
const ele = innerRef.current?.nativeElement?.querySelector("textarea");
if (ele && getComputedStyle(ele).resize === "both") setResizeDirty(true);
}
};
return /* @__PURE__ */ import_react.createElement(es_default$7, {
autoComplete: contextAutoComplete,
...rest,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
styles: mergedStyles,
disabled: mergedDisabled,
allowClear: mergedAllowClear,
className: clsx(cssVarCls, rootCls, className, rootClassName, compactItemClassnames, contextClassName, mergedClassNames.root, { [`${prefixCls}-textarea-affix-wrapper-resize-dirty`]: resizeDirty }),
classNames: {
...mergedClassNames,
textarea: clsx({
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-lg`]: mergedSize === "large"
}, hashId, mergedClassNames.textarea, isMouseDown && `${prefixCls}-mouse-active`),
variant: clsx({ [`${prefixCls}-${variant}`]: enableVariantCls }, getStatusClassNames(prefixCls, mergedStatus)),
affixWrapper: clsx(`${prefixCls}-textarea-affix-wrapper`, {
[`${prefixCls}-affix-wrapper-rtl`]: direction === "rtl",
[`${prefixCls}-affix-wrapper-sm`]: mergedSize === "small",
[`${prefixCls}-affix-wrapper-lg`]: mergedSize === "large",
[`${prefixCls}-textarea-show-count`]: showCount || props.count?.show
}, hashId)
},
prefixCls,
suffix: hasFeedback && /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-textarea-suffix` }, feedbackIcon),
showCount,
ref: innerRef,
onResize: onInternalResize,
onMouseDown: onInternalMouseDown
});
});
//#endregion
//#region node_modules/antd/es/input/index.js
var Input = Input$1;
Input.Group = Group;
Input.Search = Search$1;
Input.TextArea = TextArea;
Input.Password = Password;
Input.OTP = OTP;
//#endregion
//#region node_modules/antd/es/layout/hooks/useHasSider.js
function useHasSider(siders, children, hasSider) {
if (typeof hasSider === "boolean") return hasSider;
if (siders.length) return true;
return toArray$8(children).some((node) => node.type === Sider);
}
//#endregion
//#region node_modules/antd/es/layout/layout.js
var generator = ({ suffixCls, tagName, displayName }) => {
return (Component) => {
const Adapter = /* @__PURE__ */ import_react.forwardRef((props, ref) => /* @__PURE__ */ import_react.createElement(Component, {
ref,
suffixCls,
tagName,
...props
}));
Adapter.displayName = displayName;
return Adapter;
};
};
var Basic = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, suffixCls, className, tagName: TagName, ...others } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("layout", customizePrefixCls);
const [hashId] = style_default$46(prefixCls);
const prefixWithSuffixCls = suffixCls ? `${prefixCls}-${suffixCls}` : prefixCls;
return /* @__PURE__ */ import_react.createElement(TagName, {
className: clsx(customizePrefixCls || prefixWithSuffixCls, className, hashId),
ref,
...others
});
});
var BasicLayout = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { direction } = import_react.useContext(ConfigContext);
const [siders, setSiders] = import_react.useState([]);
const { prefixCls: customizePrefixCls, className, rootClassName, children, hasSider, tagName: Tag, style, ...others } = props;
const passedProps = omit(others, ["suffixCls"]);
const { getPrefixCls, className: contextClassName, style: contextStyle } = useComponentConfig("layout");
const prefixCls = getPrefixCls("layout", customizePrefixCls);
const mergedHasSider = useHasSider(siders, children, hasSider);
const [hashId, cssVarCls] = style_default$46(prefixCls);
const classString = clsx(prefixCls, {
[`${prefixCls}-has-sider`]: mergedHasSider,
[`${prefixCls}-rtl`]: direction === "rtl"
}, contextClassName, className, rootClassName, hashId, cssVarCls);
const contextValue = import_react.useMemo(() => ({ siderHook: {
addSider: (id) => {
setSiders((prev) => [].concat(_toConsumableArray$8(prev), [id]));
},
removeSider: (id) => {
setSiders((prev) => prev.filter((currentId) => currentId !== id));
}
} }), []);
return /* @__PURE__ */ import_react.createElement(LayoutContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.createElement(Tag, {
ref,
className: classString,
style: {
...contextStyle,
...style
},
...passedProps
}, children));
});
var Layout$1 = generator({
tagName: "div",
displayName: "Layout"
})(BasicLayout);
var Header$1 = generator({
suffixCls: "header",
tagName: "header",
displayName: "Header"
})(Basic);
var Footer$1 = generator({
suffixCls: "footer",
tagName: "footer",
displayName: "Footer"
})(Basic);
var Content = generator({
suffixCls: "content",
tagName: "main",
displayName: "Content"
})(Basic);
//#endregion
//#region node_modules/antd/es/layout/index.js
var Layout = Layout$1;
Layout.Header = Header$1;
Layout.Footer = Footer$1;
Layout.Content = Content;
Layout.Sider = Sider;
Layout._InternalSiderContext = SiderContext;
//#endregion
//#region node_modules/@rc-component/pagination/es/locale/zh_CN.js
var locale = {
items_per_page: "条/页",
jump_to: "跳至",
jump_to_confirm: "确定",
page: "页",
prev_page: "上一页",
next_page: "下一页",
prev_5: "向前 5 页",
next_5: "向后 5 页",
prev_3: "向前 3 页",
next_3: "向后 3 页",
page_size: "页码"
};
//#endregion
//#region node_modules/@rc-component/pagination/es/Options.js
var defaultPageSizeOptions = [
10,
20,
50,
100
];
var Options = (props) => {
const { pageSizeOptions = defaultPageSizeOptions, locale, changeSize, pageSize, goButton, quickGo, rootPrefixCls, disabled, buildOptionText, showSizeChanger, sizeChangerRender } = props;
const [goInputText, setGoInputText] = import_react.useState("");
const getValidValue = import_react.useMemo(() => {
return !goInputText || Number.isNaN(goInputText) ? void 0 : Number(goInputText);
}, [goInputText]);
const mergeBuildOptionText = typeof buildOptionText === "function" ? buildOptionText : (value) => `${value} ${locale.items_per_page}`;
const handleChange = (e) => {
const value = e.target.value;
if (/^\d*$/.test(value)) setGoInputText(value);
};
const handleBlur = (e) => {
if (goButton || goInputText === "") return;
setGoInputText("");
if (e.relatedTarget && (e.relatedTarget.className.includes(`${rootPrefixCls}-item-link`) || e.relatedTarget.className.includes(`${rootPrefixCls}-item`))) return;
quickGo?.(getValidValue);
};
const go = (e) => {
if (goInputText === "") return;
if (e.keyCode === KeyCode.ENTER || e.type === "click") {
setGoInputText("");
quickGo?.(getValidValue);
}
};
const getPageSizeOptions = () => {
if (pageSizeOptions.some((option) => option.toString() === pageSize.toString())) return pageSizeOptions;
return pageSizeOptions.concat([pageSize]).sort((a, b) => {
return (Number.isNaN(Number(a)) ? 0 : Number(a)) - (Number.isNaN(Number(b)) ? 0 : Number(b));
});
};
const prefixCls = `${rootPrefixCls}-options`;
if (!showSizeChanger && !quickGo) return null;
let changeSelect = null;
let goInput = null;
let gotoButton = null;
if (showSizeChanger && sizeChangerRender) changeSelect = sizeChangerRender({
disabled,
size: pageSize,
onSizeChange: (nextValue) => {
changeSize?.(Number(nextValue));
},
"aria-label": locale.page_size,
className: `${prefixCls}-size-changer`,
options: getPageSizeOptions().map((opt) => ({
label: mergeBuildOptionText(opt),
value: opt
}))
});
if (quickGo) {
if (goButton) gotoButton = typeof goButton === "boolean" ? /* @__PURE__ */ import_react.createElement("button", {
type: "button",
onClick: go,
onKeyUp: go,
disabled,
className: `${prefixCls}-quick-jumper-button`
}, locale.jump_to_confirm) : /* @__PURE__ */ import_react.createElement("span", {
onClick: go,
onKeyUp: go
}, goButton);
goInput = /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-quick-jumper` }, locale.jump_to, /* @__PURE__ */ import_react.createElement("input", {
disabled,
type: "text",
value: goInputText,
onChange: handleChange,
onKeyUp: go,
onBlur: handleBlur,
"aria-label": locale.page
}), locale.page, gotoButton);
}
return /* @__PURE__ */ import_react.createElement("li", { className: prefixCls }, changeSelect, goInput);
};
Options.displayName = "Options";
//#endregion
//#region node_modules/@rc-component/pagination/es/Pager.js
var Pager = (props) => {
const { rootPrefixCls, page, active, className, style, showTitle, onClick, onKeyPress, itemRender } = props;
const prefixCls = `${rootPrefixCls}-item`;
const cls = clsx(prefixCls, `${prefixCls}-${page}`, {
[`${prefixCls}-active`]: active,
[`${prefixCls}-disabled`]: !page
}, className);
const handleClick = () => {
onClick(page);
};
const handleKeyPress = (e) => {
onKeyPress(e, onClick, page);
};
const pager = itemRender(page, "page", /* @__PURE__ */ import_react.createElement("a", { rel: "nofollow" }, page));
return pager ? /* @__PURE__ */ import_react.createElement("li", {
title: showTitle ? String(page) : null,
className: cls,
style,
onClick: handleClick,
onKeyDown: handleKeyPress,
tabIndex: 0
}, pager) : null;
};
Pager.displayName = "Pager";
//#endregion
//#region node_modules/@rc-component/pagination/es/Pagination.js
function _extends$29() {
_extends$29 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$29.apply(this, arguments);
}
var defaultItemRender = (_, __, element) => element;
function noop$1() {}
function isInteger(v) {
const value = Number(v);
return typeof value === "number" && !Number.isNaN(value) && isFinite(value) && Math.floor(value) === value;
}
function calculatePage(p, pageSize, total) {
const _pageSize = typeof p === "undefined" ? pageSize : p;
return Math.floor((total - 1) / _pageSize) + 1;
}
var Pagination$1 = (props) => {
const { prefixCls = "rc-pagination", selectPrefixCls = "rc-select", className, classNames: paginationClassNames, styles, current: currentProp, defaultCurrent = 1, total = 0, pageSize: pageSizeProp, defaultPageSize = 10, onChange = noop$1, hideOnSinglePage, align, showPrevNextJumpers = true, showQuickJumper, showLessItems, showTitle = true, onShowSizeChange = noop$1, locale: locale$5 = locale, style, totalBoundaryShowSizeChanger = 50, disabled, simple, showTotal, showSizeChanger = total > totalBoundaryShowSizeChanger, sizeChangerRender, pageSizeOptions, itemRender = defaultItemRender, jumpPrevIcon, jumpNextIcon, prevIcon, nextIcon } = props;
const paginationRef = import_react.useRef(null);
const [pageSize, setPageSize] = useControlledState(defaultPageSize, pageSizeProp);
const [internalCurrent, setCurrent] = useControlledState(defaultCurrent, currentProp);
const current = Math.max(1, Math.min(internalCurrent, calculatePage(void 0, pageSize, total)));
const [internalInputVal, setInternalInputVal] = import_react.useState(current);
(0, import_react.useEffect)(() => {
setInternalInputVal(current);
}, [current]);
const hasOnChange = onChange !== noop$1;
warningOnce("current" in props ? hasOnChange : true, "You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");
const jumpPrevPage = Math.max(1, current - (showLessItems ? 3 : 5));
const jumpNextPage = Math.min(calculatePage(void 0, pageSize, total), current + (showLessItems ? 3 : 5));
function getItemIcon(icon, label) {
let iconNode = icon || /* @__PURE__ */ import_react.createElement("button", {
type: "button",
"aria-label": label,
className: `${prefixCls}-item-link`
});
if (typeof icon === "function") iconNode = /* @__PURE__ */ import_react.createElement(icon, props);
return iconNode;
}
function getValidValue(e) {
const inputValue = e.target.value;
const allPages = calculatePage(void 0, pageSize, total);
let value;
if (inputValue === "") value = inputValue;
else if (Number.isNaN(Number(inputValue))) value = internalInputVal;
else if (inputValue >= allPages) value = allPages;
else value = Number(inputValue);
return value;
}
function isValid(page) {
return isInteger(page) && page !== current && isInteger(total) && total > 0;
}
const shouldDisplayQuickJumper = total > pageSize ? showQuickJumper : false;
/**
* prevent "up arrow" key reseting cursor position within textbox
* @see https://stackoverflow.com/a/1081114
*/
function handleKeyDown(event) {
if (event.keyCode === KeyCode.UP || event.keyCode === KeyCode.DOWN) event.preventDefault();
}
function handleKeyUp(event) {
const value = getValidValue(event);
if (value !== internalInputVal) setInternalInputVal(value);
switch (event.keyCode) {
case KeyCode.ENTER:
handleChange(value);
break;
case KeyCode.UP:
handleChange(value - 1);
break;
case KeyCode.DOWN:
handleChange(value + 1);
break;
default: break;
}
}
function handleBlur(event) {
handleChange(getValidValue(event));
}
function changePageSize(size) {
const newCurrent = calculatePage(size, pageSize, total);
const nextCurrent = current > newCurrent && newCurrent !== 0 ? newCurrent : current;
setPageSize(size);
setInternalInputVal(nextCurrent);
onShowSizeChange?.(current, size);
setCurrent(nextCurrent);
onChange?.(nextCurrent, size);
}
function handleChange(page) {
if (isValid(page) && !disabled) {
const currentPage = calculatePage(void 0, pageSize, total);
let newPage = page;
if (page > currentPage) newPage = currentPage;
else if (page < 1) newPage = 1;
if (newPage !== internalInputVal) setInternalInputVal(newPage);
setCurrent(newPage);
onChange?.(newPage, pageSize);
return newPage;
}
return current;
}
const hasPrev = current > 1;
const hasNext = current < calculatePage(void 0, pageSize, total);
function prevHandle() {
if (hasPrev) handleChange(current - 1);
}
function nextHandle() {
if (hasNext) handleChange(current + 1);
}
function jumpPrevHandle() {
handleChange(jumpPrevPage);
}
function jumpNextHandle() {
handleChange(jumpNextPage);
}
function runIfEnter(event, callback, ...restParams) {
if (event.key === "Enter" || event.charCode === KeyCode.ENTER || event.keyCode === KeyCode.ENTER) callback(...restParams);
}
function runIfEnterPrev(event) {
runIfEnter(event, prevHandle);
}
function runIfEnterNext(event) {
runIfEnter(event, nextHandle);
}
function runIfEnterJumpPrev(event) {
runIfEnter(event, jumpPrevHandle);
}
function runIfEnterJumpNext(event) {
runIfEnter(event, jumpNextHandle);
}
function renderPrev(prevPage) {
const prevButton = itemRender(prevPage, "prev", getItemIcon(prevIcon, "prev page"));
return /* @__PURE__ */ import_react.isValidElement(prevButton) ? /* @__PURE__ */ import_react.cloneElement(prevButton, { disabled: !hasPrev }) : prevButton;
}
function renderNext(nextPage) {
const nextButton = itemRender(nextPage, "next", getItemIcon(nextIcon, "next page"));
return /* @__PURE__ */ import_react.isValidElement(nextButton) ? /* @__PURE__ */ import_react.cloneElement(nextButton, { disabled: !hasNext }) : nextButton;
}
function handleGoTO(event) {
if (event.type === "click" || event.keyCode === KeyCode.ENTER) handleChange(internalInputVal);
}
let jumpPrev = null;
const dataOrAriaAttributeProps = pickAttrs(props, {
aria: true,
data: true
});
const totalText = showTotal && /* @__PURE__ */ import_react.createElement("li", { className: `${prefixCls}-total-text` }, showTotal(total, [total === 0 ? 0 : (current - 1) * pageSize + 1, current * pageSize > total ? total : current * pageSize]));
let jumpNext = null;
const allPages = calculatePage(void 0, pageSize, total);
if (hideOnSinglePage && total <= pageSize) return null;
const pagerList = [];
const pagerProps = {
rootPrefixCls: prefixCls,
onClick: handleChange,
onKeyPress: runIfEnter,
showTitle,
itemRender,
page: -1,
className: paginationClassNames?.item,
style: styles?.item
};
const prevPage = current - 1 > 0 ? current - 1 : 0;
const nextPage = current + 1 < allPages ? current + 1 : allPages;
const goButton = showQuickJumper && showQuickJumper.goButton;
const isReadOnly = typeof simple === "object" ? simple.readOnly : !simple;
let gotoButton = goButton;
let simplePager = null;
if (simple) {
if (goButton) {
if (typeof goButton === "boolean") gotoButton = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
onClick: handleGoTO,
onKeyUp: handleGoTO
}, locale$5.jump_to_confirm);
else gotoButton = /* @__PURE__ */ import_react.createElement("span", {
onClick: handleGoTO,
onKeyUp: handleGoTO
}, goButton);
gotoButton = /* @__PURE__ */ import_react.createElement("li", {
title: showTitle ? `${locale$5.jump_to}${current}/${allPages}` : null,
className: `${prefixCls}-simple-pager`
}, gotoButton);
}
simplePager = /* @__PURE__ */ import_react.createElement("li", {
title: showTitle ? `${current}/${allPages}` : null,
className: clsx(`${prefixCls}-simple-pager`, paginationClassNames?.item),
style: styles?.item
}, isReadOnly ? internalInputVal : /* @__PURE__ */ import_react.createElement("input", {
type: "text",
"aria-label": locale$5.jump_to,
value: internalInputVal,
disabled,
onKeyDown: handleKeyDown,
onKeyUp: handleKeyUp,
onChange: handleKeyUp,
onBlur: handleBlur,
size: 3
}), /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-slash` }, "/"), allPages);
}
const pageBufferSize = showLessItems ? 1 : 2;
if (allPages <= 3 + pageBufferSize * 2) {
if (!allPages) pagerList.push(/* @__PURE__ */ import_react.createElement(Pager, _extends$29({}, pagerProps, {
key: "noPager",
page: 1,
className: `${prefixCls}-item-disabled`
})));
for (let i = 1; i <= allPages; i += 1) pagerList.push(/* @__PURE__ */ import_react.createElement(Pager, _extends$29({}, pagerProps, {
key: i,
page: i,
active: current === i
})));
} else {
const prevItemTitle = showLessItems ? locale$5.prev_3 : locale$5.prev_5;
const nextItemTitle = showLessItems ? locale$5.next_3 : locale$5.next_5;
const jumpPrevContent = itemRender(jumpPrevPage, "jump-prev", getItemIcon(jumpPrevIcon, "prev page"));
const jumpNextContent = itemRender(jumpNextPage, "jump-next", getItemIcon(jumpNextIcon, "next page"));
if (showPrevNextJumpers) {
jumpPrev = jumpPrevContent ? /* @__PURE__ */ import_react.createElement("li", {
title: showTitle ? prevItemTitle : null,
key: "prev",
onClick: jumpPrevHandle,
tabIndex: 0,
onKeyDown: runIfEnterJumpPrev,
className: clsx(`${prefixCls}-jump-prev`, { [`${prefixCls}-jump-prev-custom-icon`]: !!jumpPrevIcon })
}, jumpPrevContent) : null;
jumpNext = jumpNextContent ? /* @__PURE__ */ import_react.createElement("li", {
title: showTitle ? nextItemTitle : null,
key: "next",
onClick: jumpNextHandle,
tabIndex: 0,
onKeyDown: runIfEnterJumpNext,
className: clsx(`${prefixCls}-jump-next`, { [`${prefixCls}-jump-next-custom-icon`]: !!jumpNextIcon })
}, jumpNextContent) : null;
}
let left = Math.max(1, current - pageBufferSize);
let right = Math.min(current + pageBufferSize, allPages);
if (current - 1 <= pageBufferSize) right = 1 + pageBufferSize * 2;
if (allPages - current <= pageBufferSize) left = allPages - pageBufferSize * 2;
for (let i = left; i <= right; i += 1) pagerList.push(/* @__PURE__ */ import_react.createElement(Pager, _extends$29({}, pagerProps, {
key: i,
page: i,
active: current === i
})));
if (current - 1 >= pageBufferSize * 2 && current !== 3) {
pagerList[0] = /* @__PURE__ */ import_react.cloneElement(pagerList[0], { className: clsx(`${prefixCls}-item-after-jump-prev`, pagerList[0].props.className) });
pagerList.unshift(jumpPrev);
}
if (allPages - current >= pageBufferSize * 2 && current !== allPages - 2) {
const lastOne = pagerList[pagerList.length - 1];
pagerList[pagerList.length - 1] = /* @__PURE__ */ import_react.cloneElement(lastOne, { className: clsx(`${prefixCls}-item-before-jump-next`, lastOne.props.className) });
pagerList.push(jumpNext);
}
if (left !== 1) pagerList.unshift(/* @__PURE__ */ import_react.createElement(Pager, _extends$29({}, pagerProps, {
key: 1,
page: 1
})));
if (right !== allPages) pagerList.push(/* @__PURE__ */ import_react.createElement(Pager, _extends$29({}, pagerProps, {
key: allPages,
page: allPages
})));
}
let prev = renderPrev(prevPage);
if (prev) {
const prevDisabled = !hasPrev || !allPages;
prev = /* @__PURE__ */ import_react.createElement("li", {
title: showTitle ? locale$5.prev_page : null,
onClick: prevHandle,
tabIndex: prevDisabled ? null : 0,
onKeyDown: runIfEnterPrev,
className: clsx(`${prefixCls}-prev`, paginationClassNames?.item, { [`${prefixCls}-disabled`]: prevDisabled }),
style: styles?.item,
"aria-disabled": prevDisabled
}, prev);
}
let next = renderNext(nextPage);
if (next) {
let nextDisabled, nextTabIndex;
if (simple) {
nextDisabled = !hasNext;
nextTabIndex = hasPrev ? 0 : null;
} else {
nextDisabled = !hasNext || !allPages;
nextTabIndex = nextDisabled ? null : 0;
}
next = /* @__PURE__ */ import_react.createElement("li", {
title: showTitle ? locale$5.next_page : null,
onClick: nextHandle,
tabIndex: nextTabIndex,
onKeyDown: runIfEnterNext,
className: clsx(`${prefixCls}-next`, paginationClassNames?.item, { [`${prefixCls}-disabled`]: nextDisabled }),
style: styles?.item,
"aria-disabled": nextDisabled
}, next);
}
const cls = clsx(prefixCls, className, {
[`${prefixCls}-start`]: align === "start",
[`${prefixCls}-center`]: align === "center",
[`${prefixCls}-end`]: align === "end",
[`${prefixCls}-simple`]: simple,
[`${prefixCls}-disabled`]: disabled
});
return /* @__PURE__ */ import_react.createElement("ul", _extends$29({
className: cls,
style,
ref: paginationRef
}, dataOrAriaAttributeProps), totalText, prev, simple ? simplePager : pagerList, next, /* @__PURE__ */ import_react.createElement(Options, {
locale: locale$5,
rootPrefixCls: prefixCls,
disabled,
selectPrefixCls,
changeSize: changePageSize,
pageSize,
pageSizeOptions,
quickGo: shouldDisplayQuickJumper ? handleChange : null,
goButton: gotoButton,
showSizeChanger,
sizeChangerRender
}));
};
Pagination$1.displayName = "Pagination";
//#endregion
//#region node_modules/antd/es/pagination/style/index.js
var genPaginationDisabledStyle = (token) => {
const { componentCls } = token;
return {
[`${componentCls}-disabled`]: {
"&, &:hover": {
cursor: "not-allowed",
[`${componentCls}-item-link`]: {
color: token.colorTextDisabled,
cursor: "not-allowed"
}
},
"&:focus-visible": {
cursor: "not-allowed",
[`${componentCls}-item-link`]: {
color: token.colorTextDisabled,
cursor: "not-allowed"
}
}
},
[`&${componentCls}-disabled`]: {
cursor: "not-allowed",
[`${componentCls}-item`]: {
cursor: "not-allowed",
backgroundColor: "transparent",
"&:hover, &:active": { backgroundColor: "transparent" },
a: {
color: token.colorTextDisabled,
backgroundColor: "transparent",
border: "none",
cursor: "not-allowed"
},
"&-active": {
borderColor: token.colorBorder,
backgroundColor: token.itemActiveBgDisabled,
"&:hover, &:active": { backgroundColor: token.itemActiveBgDisabled },
a: { color: token.itemActiveColorDisabled }
}
},
[`${componentCls}-item-link`]: {
color: token.colorTextDisabled,
cursor: "not-allowed",
"&:hover, &:active": { backgroundColor: "transparent" },
[`${componentCls}-simple&`]: {
backgroundColor: "transparent",
"&:hover, &:active": { backgroundColor: "transparent" }
}
},
[`${componentCls}-simple-pager`]: { color: token.colorTextDisabled },
[`${componentCls}-jump-prev, ${componentCls}-jump-next`]: {
[`${componentCls}-item-link-icon`]: { opacity: 0 },
[`${componentCls}-item-ellipsis`]: { opacity: 1 }
}
}
};
};
var genPaginationSmallStyle = (token) => {
const { componentCls } = token;
return { [`&${componentCls}-small ${componentCls}-options`]: {
marginInlineStart: token.paginationMiniOptionsMarginInlineStart,
"&-quick-jumper": { input: {
...genInputSmallStyle(token),
width: token.paginationMiniQuickJumperInputWidth
} }
} };
};
var genPaginationLargeStyle = (token) => {
const { componentCls } = token;
return { [`&${componentCls}-large ${componentCls}-options`]: { "&-quick-jumper": { input: { ...genInputLargeStyle(token) } } } };
};
var genPaginationSimpleStyle = (token) => {
const { componentCls, antCls } = token;
const [, varRef] = genCssVar(antCls, "pagination");
return { [`&${componentCls}-simple`]: {
[`${componentCls}-prev, ${componentCls}-next`]: {
height: varRef(`item-size-actual`),
lineHeight: varRef(`item-size-actual`),
verticalAlign: "top",
[`${componentCls}-item-link`]: {
height: varRef(`item-size-actual`),
backgroundColor: "transparent",
border: 0,
"&:hover": { backgroundColor: token.colorBgTextHover },
"&:active": { backgroundColor: token.colorBgTextActive },
"&::after": {
height: varRef(`item-size-actual`),
lineHeight: varRef(`item-size-actual`)
}
}
},
[`${componentCls}-simple-pager`]: {
display: "inline-flex",
alignItems: "center",
height: varRef(`item-size-actual`),
marginInlineEnd: varRef(`item-spacing-actual`),
input: {
boxSizing: "border-box",
height: "100%",
width: token.quickJumperInputWidth,
padding: `0 ${unit$1(token.paginationItemPaddingInline)}`,
textAlign: "center",
backgroundColor: token.itemInputBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderRadius: token.borderRadius,
outline: "none",
transition: `border-color ${token.motionDurationMid}`,
color: "inherit",
"&:hover": { borderColor: token.colorPrimary },
"&:focus": {
borderColor: token.colorPrimaryHover,
boxShadow: `${unit$1(token.inputOutlineOffset)} 0 ${unit$1(token.controlOutlineWidth)} ${token.controlOutline}`
},
"&[disabled]": {
color: token.colorTextDisabled,
backgroundColor: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
cursor: "not-allowed"
}
}
},
[`&${componentCls}-disabled`]: { [`${componentCls}-prev, ${componentCls}-next`]: { [`${componentCls}-item-link`]: { "&:hover, &:active": { backgroundColor: "transparent" } } } },
[`&${componentCls}-small`]: { [`${componentCls}-simple-pager`]: { input: { width: token.paginationMiniQuickJumperInputWidth } } }
} };
};
var genPaginationJumpStyle = (token) => {
const { componentCls, antCls } = token;
const [, varRef] = genCssVar(antCls, "pagination");
return {
[`${componentCls}-jump-prev, ${componentCls}-jump-next`]: {
outline: 0,
[`${componentCls}-item-container`]: {
position: "relative",
[`${componentCls}-item-link-icon`]: {
color: token.colorPrimary,
fontSize: token.fontSizeSM,
opacity: 0,
transition: `all ${token.motionDurationMid}`,
"&-svg": {
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
margin: "auto"
}
},
[`${componentCls}-item-ellipsis`]: {
position: "absolute",
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
display: "block",
margin: "auto",
color: token.colorTextDisabled,
letterSpacing: token.paginationEllipsisLetterSpacing,
textAlign: "center",
textIndent: token.paginationEllipsisTextIndent,
opacity: 1,
transition: `all ${token.motionDurationMid}`
}
},
"&:hover": {
[`${componentCls}-item-link-icon`]: { opacity: 1 },
[`${componentCls}-item-ellipsis`]: { opacity: 0 }
}
},
[`
${componentCls}-prev,
${componentCls}-jump-prev,
${componentCls}-jump-next
`]: { marginInlineEnd: varRef(`item-spacing-actual`) },
[`
${componentCls}-prev,
${componentCls}-next,
${componentCls}-jump-prev,
${componentCls}-jump-next
`]: {
display: "inline-block",
minWidth: varRef(`item-size-actual`),
height: varRef(`item-size-actual`),
color: token.colorText,
fontFamily: token.fontFamily,
lineHeight: varRef(`item-size-actual`),
textAlign: "center",
verticalAlign: "middle",
listStyle: "none",
borderRadius: token.borderRadius,
cursor: "pointer",
transition: `all ${token.motionDurationMid}`
},
[`${componentCls}-prev, ${componentCls}-next`]: {
outline: 0,
button: {
color: token.colorText,
cursor: "pointer",
userSelect: "none"
},
[`${componentCls}-item-link`]: {
display: "block",
width: "100%",
height: "100%",
padding: 0,
fontSize: token.fontSizeSM,
textAlign: "center",
backgroundColor: "transparent",
border: `${unit$1(token.lineWidth)} ${token.lineType} transparent`,
borderRadius: token.borderRadius,
outline: "none",
transition: `all ${token.motionDurationMid}`
},
[`&:hover ${componentCls}-item-link`]: { backgroundColor: token.colorBgTextHover },
[`&:active ${componentCls}-item-link`]: { backgroundColor: token.colorBgTextActive },
[`&${componentCls}-disabled:hover`]: { [`${componentCls}-item-link`]: { backgroundColor: "transparent" } }
},
[`${componentCls}-slash`]: {
marginInlineEnd: token.paginationSlashMarginInlineEnd,
marginInlineStart: token.paginationSlashMarginInlineStart
},
[`${componentCls}-options`]: {
display: "inline-block",
marginInlineStart: token.margin,
verticalAlign: "middle",
"&-size-changer": { width: "auto" },
"&-quick-jumper": {
display: "inline-block",
height: varRef(`item-size-actual`),
marginInlineStart: token.marginXS,
lineHeight: varRef(`item-size-actual`),
verticalAlign: "baseline",
input: {
...genBasicInputStyle(token),
...genBaseOutlinedStyle(token, {
borderColor: token.colorBorder,
hoverBorderColor: token.colorPrimaryHover,
activeBorderColor: token.colorPrimary,
activeShadow: token.activeShadow
}),
"&[disabled]": { ...genDisabledStyle(token) },
width: token.quickJumperInputWidth,
height: varRef(`item-size-actual`),
boxSizing: "border-box",
margin: 0,
marginInlineStart: varRef(`item-spacing-actual`),
marginInlineEnd: varRef(`item-spacing-actual`)
}
}
}
};
};
var genPaginationItemStyle = (token) => {
const { componentCls, antCls } = token;
const [, varRef] = genCssVar(antCls, "pagination");
return { [`${componentCls}-item`]: {
display: "inline-block",
minWidth: varRef(`item-size-actual`),
height: varRef(`item-size-actual`),
marginInlineEnd: varRef(`item-spacing-actual`),
fontFamily: token.fontFamily,
lineHeight: unit$1(token.calc(varRef("item-size-actual")).sub(2).equal()),
textAlign: "center",
verticalAlign: "middle",
listStyle: "none",
backgroundColor: token.itemBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} transparent`,
borderRadius: token.borderRadius,
outline: 0,
cursor: "pointer",
userSelect: "none",
a: {
display: "block",
padding: `0 ${unit$1(token.paginationItemPaddingInline)}`,
color: token.colorText,
"&:hover": { textDecoration: "none" }
},
[`&:not(${componentCls}-item-active)`]: {
"&:hover": {
transition: `all ${token.motionDurationMid}`,
backgroundColor: token.colorBgTextHover
},
"&:active": { backgroundColor: token.colorBgTextActive }
},
"&-active": {
fontWeight: token.fontWeightStrong,
backgroundColor: token.itemActiveBg,
borderColor: token.colorPrimary,
a: { color: token.itemActiveColor },
"&:hover": { borderColor: token.colorPrimaryHover },
"&:hover a": { color: token.itemActiveColorHover }
}
} };
};
var genPaginationStyle$1 = (token) => {
const { componentCls, antCls } = token;
const [varName, varRef] = genCssVar(antCls, "pagination");
return {
[componentCls]: {
[varName(`item-size-actual`)]: unit$1(token.itemSize),
[varName(`item-spacing-actual`)]: unit$1(token.marginXS),
"&-small": {
[varName(`item-size-actual`)]: unit$1(token.itemSizeSM),
[varName(`item-spacing-actual`)]: unit$1(token.marginXXS)
},
"&-large": {
[varName(`item-size-actual`)]: unit$1(token.itemSizeLG),
[varName(`item-spacing-actual`)]: unit$1(token.marginSM)
},
...resetComponent(token),
display: "flex",
alignItems: "center",
"&-start": { justifyContent: "start" },
"&-center": { justifyContent: "center" },
"&-end": { justifyContent: "end" },
"ul, ol": {
margin: 0,
padding: 0,
listStyle: "none"
},
"&::after": {
display: "block",
clear: "both",
height: 0,
overflow: "hidden",
visibility: "hidden",
content: "\"\""
},
[`${componentCls}-total-text`]: {
display: "inline-block",
height: varRef(`item-size-actual`),
marginInlineEnd: varRef(`item-spacing-actual`),
lineHeight: unit$1(token.calc(varRef(`item-size-actual`)).sub(2).equal()),
verticalAlign: "middle"
},
...genPaginationItemStyle(token),
...genPaginationJumpStyle(token),
...genPaginationSimpleStyle(token),
...genPaginationSmallStyle(token),
...genPaginationLargeStyle(token),
...genPaginationDisabledStyle(token),
[`@media only screen and (max-width: ${token.screenLG}px)`]: { [`${componentCls}-item`]: { "&-after-jump-prev, &-before-jump-next": { display: "none" } } },
[`@media only screen and (max-width: ${token.screenSM}px)`]: { [`${componentCls}-options`]: { display: "none" } }
},
[`&${token.componentCls}-rtl`]: { direction: "rtl" }
};
};
var genPaginationFocusStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}:not(${componentCls}-disabled)`]: {
[`${componentCls}-item`]: { ...genFocusStyle(token) },
[`${componentCls}-jump-prev, ${componentCls}-jump-next`]: { "&:focus-visible": {
[`${componentCls}-item-link-icon`]: { opacity: 1 },
[`${componentCls}-item-ellipsis`]: { opacity: 0 },
...genFocusOutline(token)
} },
[`${componentCls}-prev, ${componentCls}-next`]: { [`&:focus-visible ${componentCls}-item-link`]: genFocusOutline(token) }
} };
};
var prepareComponentToken$20 = (token) => ({
itemBg: token.colorBgContainer,
itemSize: token.controlHeight,
itemSizeSM: token.controlHeightSM,
itemSizeLG: token.controlHeightLG,
itemActiveBg: token.colorBgContainer,
itemActiveColor: token.colorPrimary,
itemActiveColorHover: token.colorPrimaryHover,
itemLinkBg: token.colorBgContainer,
itemActiveColorDisabled: token.colorTextDisabled,
itemActiveBgDisabled: token.controlItemBgActiveDisabled,
itemInputBg: token.colorBgContainer,
miniOptionsSizeChangerTop: 0,
...initComponentToken$1(token)
});
var prepareToken$1 = (token) => merge(token, {
inputOutlineOffset: 0,
quickJumperInputWidth: token.calc(token.controlHeightLG).mul(1.25).equal(),
paginationMiniOptionsMarginInlineStart: token.calc(token.marginXXS).div(2).equal(),
paginationMiniQuickJumperInputWidth: token.calc(token.controlHeightLG).mul(1.1).equal(),
paginationItemPaddingInline: token.calc(token.marginXXS).mul(1.5).equal(),
paginationEllipsisLetterSpacing: token.calc(token.marginXXS).div(2).equal(),
paginationSlashMarginInlineStart: token.marginSM,
paginationSlashMarginInlineEnd: token.marginSM,
paginationEllipsisTextIndent: "0.13em"
}, initInputToken(token));
var style_default$21 = genStyleHooks("Pagination", (token) => {
const paginationToken = prepareToken$1(token);
return [genPaginationStyle$1(paginationToken), genPaginationFocusStyle(paginationToken)];
}, prepareComponentToken$20);
//#endregion
//#region node_modules/antd/es/pagination/style/bordered.js
var genBorderedStyle$2 = (token) => {
const { componentCls } = token;
return {
[`${componentCls}${componentCls}-bordered${componentCls}-disabled`]: {
"&, &:hover": { [`${componentCls}-item-link`]: { borderColor: token.colorBorder } },
"&:focus-visible": { [`${componentCls}-item-link`]: { borderColor: token.colorBorder } },
[`${componentCls}-item, ${componentCls}-item-link`]: {
backgroundColor: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
[`&:hover:not(${componentCls}-item-active)`]: {
backgroundColor: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
a: { color: token.colorTextDisabled }
},
[`&${componentCls}-item-active`]: { backgroundColor: token.itemActiveBgDisabled }
},
[`${componentCls}-prev, ${componentCls}-next`]: {
"&:hover button": {
backgroundColor: token.colorBgContainerDisabled,
borderColor: token.colorBorder,
color: token.colorTextDisabled
},
[`${componentCls}-item-link`]: {
backgroundColor: token.colorBgContainerDisabled,
borderColor: token.colorBorder
}
}
},
[`${componentCls}${componentCls}-bordered`]: {
[`${componentCls}-prev, ${componentCls}-next`]: {
"&:hover button": {
borderColor: token.colorPrimaryHover,
backgroundColor: token.itemBg
},
[`${componentCls}-item-link`]: {
backgroundColor: token.itemLinkBg,
borderColor: token.colorBorder
},
[`&:hover ${componentCls}-item-link`]: {
borderColor: token.colorPrimary,
backgroundColor: token.itemBg,
color: token.colorPrimary
},
[`&${componentCls}-disabled`]: { [`${componentCls}-item-link`]: {
borderColor: token.colorBorder,
color: token.colorTextDisabled
} }
},
[`${componentCls}-item`]: {
backgroundColor: token.itemBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
[`&:hover:not(${componentCls}-item-active)`]: {
borderColor: token.colorPrimary,
backgroundColor: token.itemBg,
a: { color: token.colorPrimary }
},
"&-active": { borderColor: token.colorPrimary }
}
}
};
};
var bordered_default = genSubStyleComponent(["Pagination", "bordered"], (token) => {
return genBorderedStyle$2(prepareToken$1(token));
}, prepareComponentToken$20);
//#endregion
//#region node_modules/antd/es/pagination/useShowSizeChanger.js
function useShowSizeChanger(showSizeChanger) {
return (0, import_react.useMemo)(() => {
if (typeof showSizeChanger === "boolean") return [showSizeChanger, {}];
if (isPlainObject(showSizeChanger)) return [true, showSizeChanger];
return [void 0, void 0];
}, [showSizeChanger]);
}
//#endregion
//#region node_modules/antd/es/pagination/Pagination.js
var Pagination = (props) => {
const { align, prefixCls: customizePrefixCls, selectPrefixCls: customizeSelectPrefixCls, className, rootClassName, style, size: customizeSize, locale: customLocale, responsive, showSizeChanger, selectComponentClass, pageSizeOptions, styles, classNames, ...restProps } = props;
const { xs } = useBreakpoint$1(responsive);
const [, token] = useToken$1();
const { getPrefixCls, direction, showSizeChanger: contextShowSizeChangerConfig, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, totalBoundaryShowSizeChanger: contextTotalBoundaryShowSizeChanger } = useComponentConfig("pagination");
const prefixCls = getPrefixCls("pagination", customizePrefixCls);
const [hashId, cssVarCls] = style_default$21(prefixCls);
const mergedSize = useSize(customizeSize);
const isSmall = mergedSize === "small" || !!(xs && !mergedSize && responsive);
const mergedProps = {
...props,
size: mergedSize
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const [contextLocale] = useLocale$1("Pagination", locale$4);
const locale = {
...contextLocale,
...customLocale
};
const [propShowSizeChanger, propSizeChangerSelectProps] = useShowSizeChanger(showSizeChanger);
const [contextShowSizeChanger, contextSizeChangerSelectProps] = useShowSizeChanger(contextShowSizeChangerConfig);
const mergedShowSizeChanger = propShowSizeChanger ?? contextShowSizeChanger;
const mergedShowSizeChangerSelectProps = propSizeChangerSelectProps ?? contextSizeChangerSelectProps;
const SizeChanger = selectComponentClass || Select;
const mergedPageSizeOptions = import_react.useMemo(() => {
return pageSizeOptions ? pageSizeOptions.map(Number) : void 0;
}, [pageSizeOptions]);
const sizeChangerRender = (info) => {
const { disabled, size: pageSize, onSizeChange, "aria-label": ariaLabel, className: sizeChangerClassName, options } = info;
const { className: propSizeChangerClassName, onChange: propSizeChangerOnChange } = mergedShowSizeChangerSelectProps || {};
const selectedValue = options.find((option) => String(option.value) === String(pageSize))?.value;
return /* @__PURE__ */ import_react.createElement(SizeChanger, {
disabled,
showSearch: true,
popupMatchSelectWidth: false,
getPopupContainer: (triggerNode) => triggerNode.parentNode,
"aria-label": ariaLabel,
options,
...mergedShowSizeChangerSelectProps,
value: selectedValue,
onChange: (nextSize, option) => {
onSizeChange?.(nextSize);
propSizeChangerOnChange?.(nextSize, option);
},
size: mergedSize,
className: clsx(sizeChangerClassName, propSizeChangerClassName)
});
};
devUseWarning("Pagination")(!selectComponentClass, "usage", "`selectComponentClass` is not official api which will be removed.");
const iconsProps = import_react.useMemo(() => {
const ellipsis = /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-item-ellipsis` }, "•••");
return {
prevIcon: /* @__PURE__ */ import_react.createElement("button", {
className: `${prefixCls}-item-link`,
type: "button",
tabIndex: -1
}, direction === "rtl" ? /* @__PURE__ */ import_react.createElement(RefIcon$6, null) : /* @__PURE__ */ import_react.createElement(RefIcon$12, null)),
nextIcon: /* @__PURE__ */ import_react.createElement("button", {
className: `${prefixCls}-item-link`,
type: "button",
tabIndex: -1
}, direction === "rtl" ? /* @__PURE__ */ import_react.createElement(RefIcon$12, null) : /* @__PURE__ */ import_react.createElement(RefIcon$6, null)),
jumpPrevIcon: /* @__PURE__ */ import_react.createElement("a", { className: `${prefixCls}-item-link` }, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-item-container` }, direction === "rtl" ? /* @__PURE__ */ import_react.createElement(RefIcon$29, { className: `${prefixCls}-item-link-icon` }) : /* @__PURE__ */ import_react.createElement(RefIcon$30, { className: `${prefixCls}-item-link-icon` }), ellipsis)),
jumpNextIcon: /* @__PURE__ */ import_react.createElement("a", { className: `${prefixCls}-item-link` }, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-item-container` }, direction === "rtl" ? /* @__PURE__ */ import_react.createElement(RefIcon$30, { className: `${prefixCls}-item-link-icon` }) : /* @__PURE__ */ import_react.createElement(RefIcon$29, { className: `${prefixCls}-item-link-icon` }), ellipsis))
};
}, [direction, prefixCls]);
const selectPrefixCls = getPrefixCls("select", customizeSelectPrefixCls);
const extendedClassName = clsx({
[`${prefixCls}-${align}`]: !!align,
[`${prefixCls}-${mergedSize}`]: mergedSize,
/** @deprecated Should be removed in v7 */
[`${prefixCls}-mini`]: isSmall,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-bordered`]: token.wireframe
}, contextClassName, className, rootClassName, mergedClassNames.root, hashId, cssVarCls);
const mergedStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, token.wireframe && /* @__PURE__ */ import_react.createElement(bordered_default, { prefixCls }), /* @__PURE__ */ import_react.createElement(Pagination$1, {
...iconsProps,
...restProps,
styles: mergedStyles,
classNames: mergedClassNames,
style: mergedStyle,
prefixCls,
selectPrefixCls,
className: extendedClassName,
locale,
pageSizeOptions: mergedPageSizeOptions,
showSizeChanger: mergedShowSizeChanger,
totalBoundaryShowSizeChanger: restProps.totalBoundaryShowSizeChanger ?? contextTotalBoundaryShowSizeChanger,
sizeChangerRender
}));
};
Pagination.displayName = "Pagination";
//#endregion
//#region node_modules/antd/es/pagination/index.js
var pagination_default = Pagination;
//#endregion
//#region node_modules/antd/es/spin/Indicator/Progress.js
var viewSize = 100;
var borderWidth = viewSize / 5;
var radius = viewSize / 2 - borderWidth / 2;
var circumference = radius * 2 * Math.PI;
var position = 50;
var CustomCircle = (props) => {
const { dotClassName, style, hasCircleCls } = props;
return /* @__PURE__ */ import_react.createElement("circle", {
className: clsx(`${dotClassName}-circle`, { [`${dotClassName}-circle-bg`]: hasCircleCls }),
r: radius,
cx: position,
cy: position,
strokeWidth: borderWidth,
style
});
};
var Progress$1 = ({ percent, prefixCls }) => {
const dotClassName = `${prefixCls}-dot`;
const holderClassName = `${dotClassName}-holder`;
const hideClassName = `${holderClassName}-hidden`;
const [render, setRender] = import_react.useState(false);
useLayoutEffect$1(() => {
if (percent !== 0) setRender(true);
}, [percent !== 0]);
const safePtg = Math.max(Math.min(percent, 100), 0);
if (!render) return null;
const circleStyle = {
strokeDashoffset: `${circumference / 4}`,
strokeDasharray: `${circumference * safePtg / 100} ${circumference * (100 - safePtg) / 100}`
};
return /* @__PURE__ */ import_react.createElement("span", { className: clsx(holderClassName, `${dotClassName}-progress`, { [hideClassName]: safePtg <= 0 }) }, /* @__PURE__ */ import_react.createElement("svg", {
viewBox: `0 0 ${viewSize} ${viewSize}`,
role: "progressbar",
"aria-valuemin": 0,
"aria-valuemax": 100,
"aria-valuenow": safePtg
}, /* @__PURE__ */ import_react.createElement(CustomCircle, {
dotClassName,
hasCircleCls: true
}), /* @__PURE__ */ import_react.createElement(CustomCircle, {
dotClassName,
style: circleStyle
})));
};
//#endregion
//#region node_modules/antd/es/spin/Indicator/Looper.js
function Looper(props) {
const { prefixCls, percent = 0, className, style } = props;
const dotClassName = `${prefixCls}-dot`;
const holderClassName = `${dotClassName}-holder`;
const hideClassName = `${holderClassName}-hidden`;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("span", {
className: clsx(holderClassName, className, percent > 0 && hideClassName),
style
}, /* @__PURE__ */ import_react.createElement("span", { className: clsx(dotClassName, `${prefixCls}-dot-spin`) }, [
1,
2,
3,
4
].map((i) => /* @__PURE__ */ import_react.createElement("i", {
className: `${prefixCls}-dot-item`,
key: i
})))), /* @__PURE__ */ import_react.createElement(Progress$1, {
prefixCls,
percent
}));
}
//#endregion
//#region node_modules/antd/es/spin/Indicator/index.js
function Indicator(props) {
const { prefixCls, indicator, percent, className, style } = props;
const dotClassName = `${prefixCls}-dot`;
if (indicator && /* @__PURE__ */ import_react.isValidElement(indicator)) return cloneElement$1(indicator, (currentProps) => ({
className: clsx(currentProps.className, dotClassName, className),
style: {
...currentProps.style,
...style
},
percent
}));
return /* @__PURE__ */ import_react.createElement(Looper, {
prefixCls,
percent,
className,
style
});
}
//#endregion
//#region node_modules/antd/es/spin/style/index.js
var antSpinMove = new Keyframe("antSpinMove", { to: { opacity: 1 } });
var antRotate = new Keyframe("antRotate", { to: { transform: "rotate(405deg)" } });
var genSpinStyle = (token) => {
const { componentCls } = token;
const sectionCls = `${componentCls}-section`;
return { [componentCls]: {
...resetComponent(token),
position: "relative",
"&-rtl": { direction: "rtl" },
[`&${sectionCls}, ${sectionCls}`]: {
display: "flex",
alignItems: "center",
flexDirection: "column",
gap: token.paddingSM,
color: token.colorPrimary
},
[`&${sectionCls}`]: { display: "inline-flex" },
[sectionCls]: {
position: "absolute",
top: "50%",
left: {
_skip_check_: true,
value: "50%"
},
transform: "translate(-50%, -50%)",
zIndex: 1
},
[`${componentCls}-description`]: {
fontSize: token.fontSize,
lineHeight: 1
},
[`${componentCls}-container`]: {
position: "relative",
transition: `opacity ${token.motionDurationSlow}`,
"&::after": {
position: "absolute",
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
zIndex: 10,
width: "100%",
height: "100%",
background: token.colorBgContainer,
opacity: 0,
transition: `all ${token.motionDurationSlow}`,
content: "\"\"",
pointerEvents: "none"
}
},
"&-spinning": {
[`${componentCls}-description`]: { textShadow: `0 0px 5px ${token.colorBgContainer}` },
[`${componentCls}-container`]: {
clear: "both",
opacity: .5,
userSelect: "none",
pointerEvents: "none",
"&::after": {
opacity: .4,
pointerEvents: "auto"
}
}
},
"&-fullscreen": {
position: "fixed",
inset: 0,
backgroundColor: token.colorBgMask,
zIndex: token.zIndexPopupBase,
opacity: 0,
pointerEvents: "none",
transition: `all ${token.motionDurationMid}`,
[`&${componentCls}-spinning`]: {
opacity: 1,
pointerEvents: "auto"
},
[sectionCls]: {
color: token.colorWhite,
[`${componentCls}-description`]: { color: token.colorTextLightSolid }
}
}
} };
};
var genIndicatorStyle = (token) => {
const { componentCls, antCls, motionDurationSlow } = token;
const [varName, varRef] = genCssVar(antCls, "spin");
return { [componentCls]: {
[varName("dot-holder-size")]: token.dotSize,
[varName("dot-item-size")]: `calc((${varRef("dot-holder-size")} - ${token.marginXXS} / 2) / 2)`,
[`${componentCls}-dot`]: {
"&-holder": {
width: "1em",
height: "1em",
fontSize: varRef("dot-holder-size"),
display: "inline-block",
transition: ["transform", "opacity"].map((prop) => `${prop} ${motionDurationSlow} ease`).join(", "),
transformOrigin: "50% 50%",
lineHeight: 1,
"&-hidden": {
transform: "scale(0.3)",
opacity: 0
}
},
position: "relative",
display: "inline-block",
fontSize: varRef("dot-holder-size"),
width: "1em",
height: "1em",
"&-spin": {
transform: "rotate(45deg)",
animationName: antRotate,
animationDuration: "1.2s",
animationIterationCount: "infinite",
animationTimingFunction: "linear"
},
"&-item": {
position: "absolute",
display: "block",
width: varRef("dot-item-size"),
height: varRef("dot-item-size"),
background: "currentColor",
borderRadius: "100%",
transform: "scale(0.75)",
transformOrigin: "50% 50%",
opacity: .3,
animationName: antSpinMove,
animationDuration: "1s",
animationIterationCount: "infinite",
animationTimingFunction: "linear",
animationDirection: "alternate",
"&:nth-child(1)": {
top: 0,
insetInlineStart: 0,
animationDelay: "0s"
},
"&:nth-child(2)": {
top: 0,
insetInlineEnd: 0,
animationDelay: "0.4s"
},
"&:nth-child(3)": {
insetInlineEnd: 0,
bottom: 0,
animationDelay: "0.8s"
},
"&:nth-child(4)": {
bottom: 0,
insetInlineStart: 0,
animationDelay: "1.2s"
}
},
"&-progress": {
position: "absolute",
left: "50%",
top: 0,
transform: "translateX(-50%)"
},
"&-circle": {
strokeLinecap: "round",
transition: [
"stroke-dashoffset",
"stroke-dasharray",
"stroke",
"stroke-width",
"opacity"
].map((item) => `${item} ${motionDurationSlow} ease`).join(","),
fillOpacity: 0,
stroke: "currentcolor"
},
"&-circle-bg": { stroke: token.colorFillSecondary }
}
} };
};
var genSizeStyle$1 = (token) => {
const { componentCls } = token;
const [varName] = genCssVar(token.antCls, "spin");
return { [componentCls]: {
"&-sm": { [varName("dot-holder-size")]: token.dotSizeSM },
"&-lg": { [varName("dot-holder-size")]: token.dotSizeLG }
} };
};
var prepareComponentToken$19 = (token) => {
const { controlHeightLG, controlHeight } = token;
return {
contentHeight: 400,
dotSize: controlHeightLG / 2,
dotSizeSM: controlHeightLG * .35,
dotSizeLG: controlHeight
};
};
var style_default$20 = genStyleHooks("Spin", (token) => {
const spinToken = merge(token, { spinDotDefault: token.colorTextDescription });
return [
genSpinStyle(spinToken),
genIndicatorStyle(spinToken),
genSizeStyle$1(spinToken)
];
}, prepareComponentToken$19);
//#endregion
//#region node_modules/antd/es/spin/usePercent.js
var AUTO_INTERVAL = 200;
var STEP_BUCKETS = [
[30, .05],
[70, .03],
[96, .01]
];
function usePercent(spinning, percent) {
const [mockPercent, setMockPercent] = import_react.useState(0);
const mockIntervalRef = import_react.useRef(null);
const isAuto = percent === "auto";
import_react.useEffect(() => {
if (isAuto && spinning) {
setMockPercent(0);
mockIntervalRef.current = setInterval(() => {
setMockPercent((prev) => {
const restPTG = 100 - prev;
for (let i = 0; i < STEP_BUCKETS.length; i += 1) {
const [limit, stepPtg] = STEP_BUCKETS[i];
if (prev <= limit) return prev + restPTG * stepPtg;
}
return prev;
});
}, AUTO_INTERVAL);
}
return () => {
if (mockIntervalRef.current) {
clearInterval(mockIntervalRef.current);
mockIntervalRef.current = null;
}
};
}, [isAuto, spinning]);
return isAuto ? mockPercent : percent;
}
//#endregion
//#region node_modules/antd/es/spin/index.js
var defaultIndicator;
function shouldDelay(spinning, delay) {
return !!spinning && !!delay && !Number.isNaN(Number(delay));
}
var Spin = (props) => {
const { prefixCls: customizePrefixCls, spinning: customSpinning = true, delay = 0, className, rootClassName, size, tip, description, wrapperClassName, style, children, fullscreen = false, indicator, percent, classNames, styles, ...restProps } = props;
const { getPrefixCls, direction, indicator: contextIndicator, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("spin");
const prefixCls = getPrefixCls("spin", customizePrefixCls);
const [hashId, cssVarCls] = style_default$20(prefixCls);
const [spinning, setSpinning] = import_react.useState(() => customSpinning && !shouldDelay(customSpinning, delay));
const mergedPercent = usePercent(spinning, percent);
import_react.useEffect(() => {
if (customSpinning) {
const showSpinning = debounce(delay, () => {
setSpinning(true);
});
showSpinning();
return () => {
showSpinning?.cancel?.();
};
}
setSpinning(false);
}, [delay, customSpinning]);
const mergedSize = useSize((ctx) => size ?? ctx);
devUseWarning("Spin").deprecated(size !== "default", "size=\"default\"", "size=\"medium\"");
const mergedDescription = description ?? tip;
const mergedProps = {
...props,
size: mergedSize,
spinning,
tip: mergedDescription,
description: mergedDescription,
fullscreen,
children,
percent: mergedPercent
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
{
const warning = devUseWarning("Spin");
warning.deprecated(!tip, "tip", "description");
warning.deprecated(!wrapperClassName, "wrapperClassName", "classNames.root");
warning.deprecated(!(mergedClassNames?.tip || mergedStyles?.tip), "classNames.tip and styles.tip", "classNames.description and styles.description");
warning.deprecated(!(mergedClassNames?.mask || mergedStyles?.mask), "classNames.mask and styles.mask", "classNames.root and styles.root");
}
const mergedIndicator = indicator ?? contextIndicator ?? defaultIndicator;
const hasChildren = typeof children !== "undefined";
const isNested = hasChildren || fullscreen;
const indicatorNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(Indicator, {
className: clsx(mergedClassNames.indicator),
style: mergedStyles.indicator,
prefixCls,
indicator: mergedIndicator,
percent: mergedPercent
}), mergedDescription && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-description`, mergedClassNames.tip, mergedClassNames.description),
style: {
...mergedStyles.tip,
...mergedStyles.description
}
}, mergedDescription));
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(prefixCls, {
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-spinning`]: spinning,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-fullscreen`]: fullscreen
}, rootClassName, mergedClassNames.root, fullscreen && mergedClassNames.mask, isNested ? wrapperClassName : [`${prefixCls}-section`, mergedClassNames.section], contextClassName, className, hashId, cssVarCls),
style: {
...mergedStyles.root,
...!isNested ? mergedStyles.section : {},
...fullscreen ? mergedStyles.mask : {},
...contextStyle,
...style
},
"aria-live": "polite",
"aria-busy": spinning,
...restProps
}, spinning && (isNested ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-section`, mergedClassNames.section),
style: mergedStyles.section
}, indicatorNode) : indicatorNode), hasChildren && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-container`, mergedClassNames.container),
style: mergedStyles.container
}, children));
};
Spin.setDefaultIndicator = (indicator) => {
defaultIndicator = indicator;
};
Spin.displayName = "Spin";
//#endregion
//#region node_modules/antd/es/list/context.js
var ListContext = /* @__PURE__ */ import_react.createContext({});
ListContext.Consumer;
//#endregion
//#region node_modules/antd/es/list/Item.js
var Meta = ({ prefixCls: customizePrefixCls, className, avatar, title, description, ...others }) => {
const { getPrefixCls } = (0, import_react.useContext)(ConfigContext);
const prefixCls = getPrefixCls("list", customizePrefixCls);
const classString = clsx(`${prefixCls}-item-meta`, className);
const content = /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-item-meta-content` }, title && /* @__PURE__ */ import_react.createElement("h4", { className: `${prefixCls}-item-meta-title` }, title), description && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-item-meta-description` }, description));
return /* @__PURE__ */ import_react.createElement("div", {
...others,
className: classString
}, avatar && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-item-meta-avatar` }, avatar), (title || description) && content);
};
var Item = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, children, actions, extra, styles, className, classNames: customizeClassNames, colStyle, ...others } = props;
const { grid, itemLayout } = (0, import_react.useContext)(ListContext);
const { getPrefixCls, list } = (0, import_react.useContext)(ConfigContext);
const moduleClass = (moduleName) => clsx(list?.item?.classNames?.[moduleName], customizeClassNames?.[moduleName]);
const moduleStyle = (moduleName) => ({
...list?.item?.styles?.[moduleName],
...styles?.[moduleName]
});
const isItemContainsTextNodeAndNotSingular = () => {
const childNodes = toArray$8(children);
return childNodes.some((node) => typeof node === "string") && childNodes.length > 1;
};
const isFlexMode = () => {
if (itemLayout === "vertical") return !!extra;
return !isItemContainsTextNodeAndNotSingular();
};
const prefixCls = getPrefixCls("list", customizePrefixCls);
const actionsContent = actions && actions.length > 0 && /* @__PURE__ */ import_react.createElement("ul", {
className: clsx(`${prefixCls}-item-action`, moduleClass("actions")),
key: "actions",
style: moduleStyle("actions")
}, actions.map((action, i) => /* @__PURE__ */ import_react.createElement("li", { key: `${prefixCls}-item-action-${i}` }, action, i !== actions.length - 1 && /* @__PURE__ */ import_react.createElement("em", { className: `${prefixCls}-item-action-split` }))));
const Element = grid ? "div" : "li";
const itemChildren = /* @__PURE__ */ import_react.createElement(Element, {
...others,
...!grid ? { ref } : {},
className: clsx(`${prefixCls}-item`, { [`${prefixCls}-item-no-flex`]: !isFlexMode() }, className)
}, itemLayout === "vertical" && extra ? [/* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-item-main`,
key: "content"
}, children, actionsContent), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-item-extra`, moduleClass("extra")),
key: "extra",
style: moduleStyle("extra")
}, extra)] : [
children,
actionsContent,
cloneElement$1(extra, { key: "extra" })
]);
return grid ? /* @__PURE__ */ import_react.createElement(Col, {
ref,
flex: 1,
style: colStyle
}, itemChildren) : itemChildren;
});
Item.Meta = Meta;
//#endregion
//#region node_modules/antd/es/list/style/index.js
var genBorderedStyle$1 = (token) => {
const { listBorderedCls, componentCls, paddingLG, margin, itemPaddingSM, itemPaddingLG, marginLG, borderRadiusLG } = token;
const innerCornerBorderRadius = unit$1(token.calc(borderRadiusLG).sub(token.lineWidth).equal());
return {
[listBorderedCls]: {
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderRadius: borderRadiusLG,
[`${componentCls}-header`]: { borderRadius: `${innerCornerBorderRadius} ${innerCornerBorderRadius} 0 0` },
[`${componentCls}-footer`]: { borderRadius: `0 0 ${innerCornerBorderRadius} ${innerCornerBorderRadius}` },
[`${componentCls}-header,${componentCls}-footer,${componentCls}-item`]: { paddingInline: paddingLG },
[`${componentCls}-pagination`]: { margin: `${unit$1(margin)} ${unit$1(marginLG)}` }
},
[`${listBorderedCls}${componentCls}-sm`]: { [`${componentCls}-item,${componentCls}-header,${componentCls}-footer`]: { padding: itemPaddingSM } },
[`${listBorderedCls}${componentCls}-lg`]: { [`${componentCls}-item,${componentCls}-header,${componentCls}-footer`]: { padding: itemPaddingLG } }
};
};
var genResponsiveStyle = (token) => {
const { componentCls, screenSM, screenMD, marginLG, marginSM, margin } = token;
return {
[`@media screen and (max-width:${screenMD}px)`]: {
[componentCls]: { [`${componentCls}-item`]: { [`${componentCls}-item-action`]: { marginInlineStart: marginLG } } },
[`${componentCls}-vertical`]: { [`${componentCls}-item`]: { [`${componentCls}-item-extra`]: { marginInlineStart: marginLG } } }
},
[`@media screen and (max-width: ${screenSM}px)`]: {
[componentCls]: { [`${componentCls}-item`]: {
flexWrap: "wrap",
[`${componentCls}-action`]: { marginInlineStart: marginSM }
} },
[`${componentCls}-vertical`]: { [`${componentCls}-item`]: {
flexWrap: "wrap-reverse",
[`${componentCls}-item-main`]: { minWidth: token.contentWidth },
[`${componentCls}-item-extra`]: { margin: `auto auto ${unit$1(margin)}` }
} }
}
};
};
var genBaseStyle$8 = (token) => {
const { componentCls, antCls, controlHeight, minHeight, paddingSM, marginLG, padding, itemPadding, colorPrimary, itemPaddingSM, itemPaddingLG, paddingXS, margin, colorText, colorTextDescription, motionDurationSlow, lineWidth, headerBg, footerBg, emptyTextPadding, metaMarginBottom, avatarMarginRight, titleMarginBottom, descriptionFontSize } = token;
return {
[componentCls]: {
...resetComponent(token),
position: "relative",
["--rc-virtual-list-scrollbar-bg"]: token.colorSplit,
"*": { outline: "none" },
[`${componentCls}-header`]: { background: headerBg },
[`${componentCls}-footer`]: { background: footerBg },
[`${componentCls}-header, ${componentCls}-footer`]: { paddingBlock: paddingSM },
[`${componentCls}-pagination`]: {
marginBlockStart: marginLG,
[`${antCls}-pagination-options`]: { textAlign: "start" }
},
[`${componentCls}-spin`]: {
minHeight,
textAlign: "center"
},
[`${componentCls}-items`]: {
margin: 0,
padding: 0,
listStyle: "none"
},
[`${componentCls}-item`]: {
display: "flex",
alignItems: "center",
justifyContent: "space-between",
padding: itemPadding,
color: colorText,
[`${componentCls}-item-meta`]: {
display: "flex",
flex: 1,
alignItems: "flex-start",
maxWidth: "100%",
[`${componentCls}-item-meta-avatar`]: { marginInlineEnd: avatarMarginRight },
[`${componentCls}-item-meta-content`]: {
flex: "1 0",
width: 0,
color: colorText
},
[`${componentCls}-item-meta-title`]: {
margin: `0 0 ${unit$1(token.marginXXS)} 0`,
color: colorText,
fontSize: token.fontSize,
lineHeight: token.lineHeight,
"> a": {
color: colorText,
transition: `all ${motionDurationSlow}`,
"&:hover": { color: colorPrimary }
}
},
[`${componentCls}-item-meta-description`]: {
color: colorTextDescription,
fontSize: descriptionFontSize,
lineHeight: token.lineHeight
}
},
[`${componentCls}-item-action`]: {
flex: "0 0 auto",
marginInlineStart: token.marginXXL,
padding: 0,
fontSize: 0,
listStyle: "none",
"& > li": {
position: "relative",
display: "inline-block",
padding: `0 ${unit$1(paddingXS)}`,
color: colorTextDescription,
fontSize: token.fontSize,
lineHeight: token.lineHeight,
textAlign: "center",
"&:first-child": { paddingInlineStart: 0 }
},
[`${componentCls}-item-action-split`]: {
position: "absolute",
insetBlockStart: "50%",
insetInlineEnd: 0,
width: lineWidth,
height: token.calc(token.fontHeight).sub(token.calc(token.marginXXS).mul(2)).equal(),
transform: "translateY(-50%)",
backgroundColor: token.colorSplit
}
}
},
[`${componentCls}-empty`]: {
padding: `${unit$1(padding)} 0`,
color: colorTextDescription,
fontSize: token.fontSizeSM,
textAlign: "center"
},
[`${componentCls}-empty-text`]: {
padding: emptyTextPadding,
color: token.colorTextDisabled,
fontSize: token.fontSize,
textAlign: "center"
},
[`${componentCls}-item-no-flex`]: { display: "block" }
},
[`${componentCls}-grid ${antCls}-col > ${componentCls}-item`]: {
display: "block",
maxWidth: "100%",
marginBlockEnd: margin,
paddingBlock: 0,
borderBlockEnd: "none"
},
[`${componentCls}-vertical ${componentCls}-item`]: {
alignItems: "initial",
[`${componentCls}-item-main`]: {
display: "block",
flex: 1
},
[`${componentCls}-item-extra`]: { marginInlineStart: marginLG },
[`${componentCls}-item-meta`]: {
marginBlockEnd: metaMarginBottom,
[`${componentCls}-item-meta-title`]: {
marginBlockStart: 0,
marginBlockEnd: titleMarginBottom,
color: colorText,
fontSize: token.fontSizeLG,
lineHeight: token.lineHeightLG
}
},
[`${componentCls}-item-action`]: {
marginBlockStart: padding,
marginInlineStart: "auto",
"> li": {
padding: `0 ${unit$1(padding)}`,
"&:first-child": { paddingInlineStart: 0 }
}
}
},
[`${componentCls}-split ${componentCls}-item`]: {
borderBlockEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
"&:last-child": { borderBlockEnd: "none" }
},
[`${componentCls}-split ${componentCls}-header`]: { borderBlockEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}` },
[`${componentCls}-split${componentCls}-empty ${componentCls}-footer`]: { borderTop: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}` },
[`${componentCls}-loading ${componentCls}-spin-nested-loading`]: { minHeight: controlHeight },
[`${componentCls}-split${componentCls}-something-after-last-item ${antCls}-spin-container > ${componentCls}-items > ${componentCls}-item:last-child`]: { borderBlockEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorSplit}` },
[`${componentCls}-lg ${componentCls}-item`]: { padding: itemPaddingLG },
[`${componentCls}-sm ${componentCls}-item`]: { padding: itemPaddingSM },
[`${componentCls}:not(${componentCls}-vertical)`]: { [`${componentCls}-item-no-flex`]: { [`${componentCls}-item-action`]: { float: "right" } } }
};
};
var prepareComponentToken$18 = (token) => ({
contentWidth: 220,
itemPadding: `${unit$1(token.paddingContentVertical)} 0`,
itemPaddingSM: `${unit$1(token.paddingContentVerticalSM)} ${unit$1(token.paddingContentHorizontal)}`,
itemPaddingLG: `${unit$1(token.paddingContentVerticalLG)} ${unit$1(token.paddingContentHorizontalLG)}`,
headerBg: "transparent",
footerBg: "transparent",
emptyTextPadding: token.padding,
metaMarginBottom: token.padding,
avatarMarginRight: token.padding,
titleMarginBottom: token.paddingSM,
descriptionFontSize: token.fontSize
});
var style_default$19 = genStyleHooks("List", (token) => {
const listToken = merge(token, {
listBorderedCls: `${token.componentCls}-bordered`,
minHeight: token.controlHeightLG
});
return [
genBaseStyle$8(listToken),
genBorderedStyle$1(listToken),
genResponsiveStyle(listToken)
];
}, prepareComponentToken$18, { extraCssVarPrefixCls: ({ prefixCls }) => [`${prefixCls}-container`] });
//#endregion
//#region node_modules/antd/es/list/index.js
var InternalList = (props, ref) => {
const { pagination = false, prefixCls: customizePrefixCls, bordered = false, split = true, className, rootClassName, style, children, itemLayout, loadMore, grid, dataSource = [], size: customizeSize, header, footer, loading = false, rowKey, renderItem, locale, ...rest } = props;
const paginationObj = isPlainObject(pagination) ? pagination : {};
const [paginationCurrent, setPaginationCurrent] = import_react.useState(paginationObj.defaultCurrent || 1);
const [paginationSize, setPaginationSize] = import_react.useState(paginationObj.defaultPageSize || 10);
const { getPrefixCls, direction, className: contextClassName, style: contextStyle } = useComponentConfig("list");
const { renderEmpty } = import_react.useContext(ConfigContext);
const defaultPaginationProps = {
current: 1,
total: 0,
position: "bottom"
};
const triggerPaginationEvent = (eventName) => (page, pageSize) => {
setPaginationCurrent(page);
setPaginationSize(pageSize);
if (pagination) pagination?.[eventName]?.(page, pageSize);
};
const onPaginationChange = triggerPaginationEvent("onChange");
const onPaginationShowSizeChange = triggerPaginationEvent("onShowSizeChange");
const renderInternalItem = (item, index) => {
if (!renderItem) return null;
let key;
if (typeof rowKey === "function") key = rowKey(item);
else if (rowKey) key = item[rowKey];
else key = item.key;
if (!key) key = `list-item-${index}`;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, { key }, renderItem(item, index));
};
const isSomethingAfterLastItem = !!(loadMore || pagination || footer);
const prefixCls = getPrefixCls("list", customizePrefixCls);
const [hashId, cssVarCls] = style_default$19(prefixCls);
let loadingProp = loading;
if (typeof loadingProp === "boolean") loadingProp = { spinning: loadingProp };
const isLoading = !!loadingProp?.spinning;
const mergedSize = useSize(customizeSize);
let sizeCls = "";
switch (mergedSize) {
case "large":
sizeCls = "lg";
break;
case "small":
sizeCls = "sm";
break;
default: break;
}
const classString = clsx(prefixCls, {
[`${prefixCls}-vertical`]: itemLayout === "vertical",
[`${prefixCls}-${sizeCls}`]: sizeCls,
[`${prefixCls}-split`]: split,
[`${prefixCls}-bordered`]: bordered,
[`${prefixCls}-loading`]: isLoading,
[`${prefixCls}-grid`]: !!grid,
[`${prefixCls}-something-after-last-item`]: isSomethingAfterLastItem,
[`${prefixCls}-rtl`]: direction === "rtl"
}, contextClassName, className, rootClassName, hashId, cssVarCls);
const containerCls = `${prefixCls}-container`;
const paginationProps = mergeProps$1(defaultPaginationProps, {
total: dataSource.length,
current: paginationCurrent,
pageSize: paginationSize
}, pagination || {});
const largestPage = Math.ceil(paginationProps.total / paginationProps.pageSize);
paginationProps.current = Math.min(paginationProps.current, largestPage);
const paginationContent = pagination && /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-pagination`) }, /* @__PURE__ */ import_react.createElement(pagination_default, {
align: "end",
...paginationProps,
onChange: onPaginationChange,
onShowSizeChange: onPaginationShowSizeChange
}));
let splitDataSource = _toConsumableArray$8(dataSource);
if (pagination) {
if (dataSource.length > (paginationProps.current - 1) * paginationProps.pageSize) splitDataSource = _toConsumableArray$8(dataSource).splice((paginationProps.current - 1) * paginationProps.pageSize, paginationProps.pageSize);
}
const screens = useBreakpoint$1(Object.keys(grid || {}).some((key) => responsiveArray.includes(key)));
const currentBreakpoint = import_react.useMemo(() => {
for (let i = 0; i < responsiveArray.length; i += 1) {
const breakpoint = responsiveArray[i];
if (screens[breakpoint]) return breakpoint;
}
}, [screens]);
const colStyle = import_react.useMemo(() => {
if (!grid) return;
const columnCount = currentBreakpoint && grid[currentBreakpoint] ? grid[currentBreakpoint] : grid.column;
if (columnCount) return {
width: `${100 / columnCount}%`,
maxWidth: `${100 / columnCount}%`
};
}, [JSON.stringify(grid), currentBreakpoint]);
let childrenContent = isLoading && /* @__PURE__ */ import_react.createElement("div", { style: { minHeight: 53 } });
if (splitDataSource.length > 0) {
const items = splitDataSource.map(renderInternalItem);
childrenContent = grid ? /* @__PURE__ */ import_react.createElement(Row$1, {
className: clsx(containerCls, cssVarCls),
gutter: grid.gutter
}, import_react.Children.map(items, (child) => /* @__PURE__ */ import_react.createElement("div", {
key: child?.key,
style: colStyle
}, child))) : /* @__PURE__ */ import_react.createElement("ul", { className: clsx(`${prefixCls}-items`, containerCls, cssVarCls) }, items);
} else if (!children && !isLoading) childrenContent = /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-empty-text` }, locale?.emptyText || renderEmpty?.("List") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "List" }));
const paginationPosition = paginationProps.position;
const contextValue = import_react.useMemo(() => ({
grid,
itemLayout
}), [JSON.stringify(grid), itemLayout]);
devUseWarning("List")(false, "deprecated", "The `List` component is deprecated. And will be removed in next major version.");
return /* @__PURE__ */ import_react.createElement(ListContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.createElement("div", {
ref,
style: {
...contextStyle,
...style
},
className: classString,
...rest
}, (paginationPosition === "top" || paginationPosition === "both") && paginationContent, header && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-header` }, header), /* @__PURE__ */ import_react.createElement(Spin, { ...loadingProp }, childrenContent, children), footer && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-footer` }, footer), loadMore || (paginationPosition === "bottom" || paginationPosition === "both") && paginationContent));
};
var ListWithForwardRef = /* @__PURE__ */ import_react.forwardRef(InternalList);
ListWithForwardRef.displayName = "Deprecated.List";
var List = ListWithForwardRef;
List.Item = Item;
//#endregion
//#region node_modules/antd/es/masonry/hooks/useDelay.js
function useDelay(callback) {
const idRef = import_react.useRef(0);
const clearRaf = () => {
wrapperRaf.cancel(idRef.current);
};
import_react.useEffect(() => clearRaf, []);
return useEvent(() => {
clearRaf();
idRef.current = wrapperRaf(callback);
});
}
//#endregion
//#region node_modules/antd/es/masonry/hooks/usePositions.js
/**
* Auto arrange the items in the masonry layout.
* Always get stable positions by order
* instead of dynamic adjust for next item height.
*/
function usePositions(itemHeights, columnCount, verticalGutter) {
const [orderItemPositions, orderTotalHeight] = import_react.useMemo(() => {
const columnHeights = new Array(columnCount).fill(0);
const itemPositions = /* @__PURE__ */ new Map();
for (let i = 0; i < itemHeights.length; i += 1) {
const [itemKey, itemHeight, itemColumn] = itemHeights[i];
let targetColumnIndex = itemColumn ?? columnHeights.indexOf(Math.min.apply(Math, _toConsumableArray$8(columnHeights)));
targetColumnIndex = Math.min(targetColumnIndex, columnCount - 1);
const top = columnHeights[targetColumnIndex];
itemPositions.set(itemKey, {
column: targetColumnIndex,
top
});
columnHeights[targetColumnIndex] += itemHeight + verticalGutter;
}
return [itemPositions, Math.max(0, Math.max.apply(Math, _toConsumableArray$8(columnHeights)) - verticalGutter)];
}, [
columnCount,
itemHeights,
verticalGutter
]);
return [orderItemPositions, orderTotalHeight];
}
//#endregion
//#region node_modules/antd/es/masonry/hooks/useRefs.js
function useRefs$1() {
const ref = import_react.useRef(null);
if (ref.current === null) ref.current = /* @__PURE__ */ new Map();
const setRef = (key, element) => {
ref.current.set(key, element);
};
const getRef = (key) => ref.current.get(key);
return [setRef, getRef];
}
//#endregion
//#region node_modules/antd/es/masonry/MasonryItem.js
var MasonryItem = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { item, style, prefixCls, itemRender, className, index, column, onResize } = props;
const itemPrefix = `${prefixCls}-item`;
const renderNode = (0, import_react.useMemo)(() => {
return item.children ?? itemRender?.({
...item,
index,
column
});
}, [
item,
itemRender,
column,
index
]);
let returnNode = /* @__PURE__ */ import_react.createElement("div", {
ref,
style,
className: clsx(itemPrefix, className)
}, renderNode);
if (onResize) returnNode = /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize }, returnNode);
return returnNode;
});
MasonryItem.displayName = "MasonryItem";
//#endregion
//#region node_modules/antd/es/masonry/style/index.js
var genMasonryStyle = (token) => {
const { componentCls } = token;
const itemCls = `${componentCls}-item`;
return { [componentCls]: {
position: "relative",
boxSizing: "border-box",
display: "flex",
flexDirection: "column",
flexWrap: "wrap",
"&-rtl": { direction: "rtl" },
[`& > ${itemCls}`]: {
boxSizing: "border-box",
"&-fade": {
"&-appear": {
transition: `opacity ${token.motionDurationSlow} ${token.motionEaseOut}`,
opacity: 0,
"&-active": { opacity: 1 }
},
"&-leave": {
transition: `opacity ${token.motionDurationFast} ${token.motionEaseOut}`,
opacity: 1,
"&-active": { opacity: 0 }
}
},
[`&:not(${itemCls}-fade)`]: { transition: [
"left",
"right",
"top"
].map((prop) => `${prop} ${token.motionDurationSlow} ${token.motionEaseOut}`).join(",") }
}
} };
};
var style_default$18 = genStyleHooks("Masonry", genMasonryStyle);
//#endregion
//#region node_modules/antd/es/masonry/Masonry.js
var Masonry = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { rootClassName, className, style, classNames, styles, columns, prefixCls: customizePrefixCls, gutter = 0, items, itemRender, onLayoutChange, fresh } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("masonry");
const prefixCls = getPrefixCls("masonry", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const [hashId, cssVarCls] = style_default$18(prefixCls, useCSSVarCls(prefixCls));
const [varName, varRef] = genCssVar(rootPrefixCls, "masonry");
const containerRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({ nativeElement: containerRef.current }));
const [setItemRef, getItemRef] = useRefs$1();
const [mergedItems, setMergedItems] = import_react.useState([]);
import_react.useEffect(() => {
setMergedItems(items || []);
}, [items]);
const screens = useBreakpoint$1();
const [horizontalGutter = 0, verticalGutter = horizontalGutter] = useGutter(gutter, screens);
const columnCount = import_react.useMemo(() => {
if (!columns) return 3;
if (isNumber(columns)) return columns;
const matchingBreakpoint = responsiveArray.find((breakpoint) => screens[breakpoint] && columns[breakpoint] !== void 0);
if (matchingBreakpoint) return columns[matchingBreakpoint];
return columns.xs ?? 1;
}, [columns, screens]);
const mergedProps = {
...props,
columns: columnCount
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const [itemHeights, setItemHeights] = import_react.useState([]);
const collectItemSize = useDelay(() => {
const nextItemsHeight = mergedItems.map((item, index) => {
const itemKey = item.key ?? index;
const rect = getItemRef(itemKey)?.getBoundingClientRect();
return [
itemKey,
rect ? rect.height : 0,
item.column
];
});
setItemHeights((prevItemsHeight) => isEqual(prevItemsHeight, nextItemsHeight) ? prevItemsHeight : nextItemsHeight);
});
const [itemPositions, totalHeight] = usePositions(itemHeights, columnCount, verticalGutter);
const itemWithPositions = import_react.useMemo(() => mergedItems.map((item, index) => {
const key = item.key ?? index;
return {
item,
itemIndex: index,
itemKey: key,
key,
position: itemPositions.get(key)
};
}), [mergedItems, itemPositions]);
import_react.useEffect(() => {
collectItemSize();
}, [mergedItems, columnCount]);
const [itemColumns, setItemColumns] = import_react.useState([]);
useLayoutEffect$1(() => {
if (onLayoutChange && itemWithPositions.every(({ position }) => position)) setItemColumns((prevItemColumns) => {
const nextItemColumns = itemWithPositions.map(({ item, position }) => [item, position.column]);
return isEqual(prevItemColumns, nextItemColumns) ? prevItemColumns : nextItemColumns;
});
}, [itemWithPositions]);
useLayoutEffect$1(() => {
if (onLayoutChange && items && items.length === itemColumns.length) onLayoutChange(itemColumns.map(([item, column]) => ({
...item,
column
})));
}, [itemColumns]);
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: collectItemSize }, /* @__PURE__ */ import_react.createElement("div", {
ref: containerRef,
className: clsx(prefixCls, contextClassName, mergedClassNames.root, rootClassName, className, hashId, cssVarCls, { [`${prefixCls}-rtl`]: direction === "rtl" }),
style: {
height: totalHeight,
...mergedStyles.root,
...contextStyle,
...style
},
onLoad: collectItemSize,
onError: collectItemSize
}, /* @__PURE__ */ import_react.createElement(CSSMotionList_default, {
keys: itemWithPositions,
component: false,
motionAppear: true,
motionLeave: true,
motionName: `${prefixCls}-item-fade`
}, (motionInfo, motionRef) => {
const { item, itemKey, position = {}, itemIndex, key, className: motionClassName, style: motionStyle } = motionInfo;
const { column: columnIndex = 0 } = position;
const itemStyle = {
[varName("item-width")]: `calc((100% + ${horizontalGutter}px) / ${columnCount})`,
insetInlineStart: `calc(${varRef("item-width")} * ${columnIndex})`,
width: `calc(${varRef("item-width")} - ${horizontalGutter}px)`,
top: position.top,
position: "absolute"
};
return /* @__PURE__ */ import_react.createElement(MasonryItem, {
prefixCls,
key,
item,
style: {
...motionStyle,
...mergedStyles.item,
...itemStyle
},
className: clsx(mergedClassNames.item, motionClassName),
ref: composeRef(motionRef, (ele) => setItemRef(itemKey, ele)),
index: itemIndex,
itemRender,
column: columnIndex,
onResize: fresh ? collectItemSize : null
});
})));
});
Masonry.displayName = "Masonry";
//#endregion
//#region node_modules/antd/es/masonry/index.js
var masonry_default = Masonry;
//#endregion
//#region node_modules/@rc-component/mentions/es/hooks/useEffectState.js
/**
* Trigger a callback on state change
*/
function useEffectState() {
const [effectId, setEffectId] = (0, import_react.useState)({
id: 0,
callback: null
});
const update = (0, import_react.useCallback)((callback) => {
setEffectId(({ id }) => ({
id: id + 1,
callback
}));
}, []);
(0, import_react.useEffect)(() => {
effectId.callback?.();
}, [effectId]);
return update;
}
//#endregion
//#region node_modules/@rc-component/mentions/es/MentionsContext.js
var MentionsContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/mentions/es/DropdownMenu.js
/**
* We only use Menu to display the candidate.
* The focus is controlled by textarea to make accessibility easy.
*/
function DropdownMenu(props) {
const { notFoundContent, activeIndex, setActiveIndex, selectOption, onFocus, onBlur, onScroll } = import_react.useContext(MentionsContext);
const { prefixCls, options, opened } = props;
const activeOption = options[activeIndex] || {};
const menuRef = (0, import_react.useRef)(null);
(0, import_react.useEffect)(() => {
if (activeIndex === -1 || !menuRef.current || !opened) return;
const activeItem = menuRef.current?.findItem?.({ key: activeOption.key });
if (activeItem) activeItem.scrollIntoView({
block: "nearest",
inline: "nearest"
});
}, [
activeIndex,
activeOption.key,
opened
]);
return /* @__PURE__ */ import_react.createElement(ExportMenu, {
ref: menuRef,
prefixCls: `${prefixCls}-menu`,
activeKey: activeOption.key,
onSelect: ({ key }) => {
selectOption(options.find(({ key: optionKey }) => optionKey === key));
},
onFocus,
onBlur,
onScroll
}, options.map((option, index) => {
const { key, disabled, className, style, label } = option;
return /* @__PURE__ */ import_react.createElement(MenuItem_default, {
key,
disabled,
className,
style,
onMouseEnter: () => {
setActiveIndex(index);
}
}, label);
}), !options.length && /* @__PURE__ */ import_react.createElement(MenuItem_default, { disabled: true }, notFoundContent));
}
//#endregion
//#region node_modules/@rc-component/mentions/es/KeywordTrigger.js
var BUILT_IN_PLACEMENTS = {
bottomRight: {
points: ["tl", "br"],
offset: [0, 4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
bottomLeft: {
points: ["tr", "bl"],
offset: [0, 4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
topRight: {
points: ["bl", "tr"],
offset: [0, -4],
overflow: {
adjustX: 1,
adjustY: 1
}
},
topLeft: {
points: ["br", "tl"],
offset: [0, -4],
overflow: {
adjustX: 1,
adjustY: 1
}
}
};
var KeywordTrigger = (props) => {
const { prefixCls, options, children, visible, transitionName, getPopupContainer, popupClassName, popupStyle, direction, placement } = props;
const dropdownPrefix = `${prefixCls}-dropdown`;
const [opened, setOpened] = import_react.useState(false);
const dropdownElement = /* @__PURE__ */ import_react.createElement(DropdownMenu, {
prefixCls: dropdownPrefix,
options,
opened
});
const dropdownPlacement = (0, import_react.useMemo)(() => {
let popupPlacement;
if (direction === "rtl") popupPlacement = placement === "top" ? "topLeft" : "bottomLeft";
else popupPlacement = placement === "top" ? "topRight" : "bottomRight";
return popupPlacement;
}, [direction, placement]);
return /* @__PURE__ */ import_react.createElement(es_default$26, {
prefixCls: dropdownPrefix,
popupVisible: visible,
popup: dropdownElement,
popupPlacement: dropdownPlacement,
popupMotion: { motionName: transitionName },
builtinPlacements: BUILT_IN_PLACEMENTS,
getPopupContainer,
popupClassName,
popupStyle,
afterOpenChange: setOpened
}, children);
};
//#endregion
//#region node_modules/@rc-component/mentions/es/Option.js
var Option$1 = () => null;
//#endregion
//#region node_modules/@rc-component/mentions/es/util.js
/**
* Cut input selection into 2 part and return text before selection start
*/
function getBeforeSelectionText(input) {
const { selectionStart } = input;
return input.value.slice(0, selectionStart);
}
/**
* Find the last match prefix index
*/
function getLastMeasureIndex(text, prefix) {
return prefix.reduce((lastMatch, prefixStr) => {
const lastIndex = text.lastIndexOf(prefixStr);
if (lastIndex > lastMatch.location) return {
location: lastIndex,
prefix: prefixStr
};
return lastMatch;
}, {
location: -1,
prefix: ""
});
}
function lower(char) {
return (char || "").toLowerCase();
}
function reduceText(text, targetText, split) {
const firstChar = text[0];
if (!firstChar || firstChar === split) return text;
let restText = text;
const targetTextLen = targetText.length;
for (let i = 0; i < targetTextLen; i += 1) if (lower(restText[i]) !== lower(targetText[i])) {
restText = restText.slice(i);
break;
} else if (i === targetTextLen - 1) restText = restText.slice(targetTextLen);
return restText;
}
/**
* Paint targetText into current text:
* text: little@litest
* targetText: light
* => little @light test
*/
function replaceWithMeasure(text, measureConfig) {
const { measureLocation, prefix, targetText, selectionStart, split } = measureConfig;
let beforeMeasureText = text.slice(0, measureLocation);
if (beforeMeasureText[beforeMeasureText.length - split.length] === split) beforeMeasureText = beforeMeasureText.slice(0, beforeMeasureText.length - split.length);
if (beforeMeasureText) beforeMeasureText = `${beforeMeasureText}${split}`;
let restText = reduceText(text.slice(selectionStart), targetText.slice(selectionStart - measureLocation - prefix.length), split);
if (restText.slice(0, split.length) === split) restText = restText.slice(split.length);
const connectedStartText = `${beforeMeasureText}${prefix}${targetText}${split}`;
return {
text: `${connectedStartText}${restText}`,
selectionLocation: connectedStartText.length
};
}
function setInputSelection(input, location) {
input.setSelectionRange(location, location);
/**
* Reset caret into view.
* Since this function always called by user control, it's safe to focus element.
*/
input.blur();
input.focus();
}
function validateSearch(text, split) {
return !split || text.indexOf(split) === -1;
}
function filterOption(input, { value = "" }) {
const lowerCase = input.toLowerCase();
return value.toLowerCase().indexOf(lowerCase) !== -1;
}
//#endregion
//#region node_modules/@rc-component/mentions/es/context.js
var UnstableContext$2 = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/mentions/es/Mentions.js
function _extends$28() {
_extends$28 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$28.apply(this, arguments);
}
var InternalMentions = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls, className, style, classNames: mentionClassNames, styles, prefix = "@", split = " ", notFoundContent = "Not Found", value, defaultValue, children, options, allowClear, hasWrapper, silent, validateSearch: validateSearch$1 = validateSearch, filterOption: filterOption$1 = filterOption, onChange, onKeyDown, onKeyUp, onPressEnter, onSearch, onSelect, onFocus, onBlur, transitionName, placement, direction, getPopupContainer, popupClassName, rows = 1, visible, onPopupScroll, ...restProps } = props;
const mergedPrefix = (0, import_react.useMemo)(() => Array.isArray(prefix) ? prefix : [prefix], [prefix]);
const containerRef = (0, import_react.useRef)(null);
const textareaRef = (0, import_react.useRef)(null);
const measureRef = (0, import_react.useRef)(null);
const getTextArea = () => textareaRef.current?.resizableTextArea?.textArea;
import_react.useImperativeHandle(ref, () => ({
focus: () => textareaRef.current?.focus(),
blur: () => textareaRef.current?.blur(),
textarea: textareaRef.current?.resizableTextArea?.textArea,
nativeElement: containerRef.current
}));
const [measuring, setMeasuring] = (0, import_react.useState)(false);
const [measureText, setMeasureText] = (0, import_react.useState)("");
const [measurePrefix, setMeasurePrefix] = (0, import_react.useState)("");
const [measureLocation, setMeasureLocation] = (0, import_react.useState)(0);
const [activeIndex, setActiveIndex] = (0, import_react.useState)(0);
const [isFocus, setIsFocus] = (0, import_react.useState)(false);
const uniqueKey = useId_default(props.id);
const [mergedValue, setMergedValue] = useControlledState(defaultValue || "", value);
const { open } = (0, import_react.useContext)(UnstableContext$2);
(0, import_react.useEffect)(() => {
if (measuring && measureRef.current) measureRef.current.scrollTop = getTextArea().scrollTop;
}, [measuring]);
const [mergedMeasuring, mergedMeasureText, mergedMeasurePrefix, mergedMeasureLocation] = import_react.useMemo(() => {
if (open) for (let i = 0; i < mergedPrefix.length; i += 1) {
const curPrefix = mergedPrefix[i];
const index = mergedValue.lastIndexOf(curPrefix);
if (index >= 0) return [
true,
"",
curPrefix,
index
];
}
return [
measuring,
measureText,
measurePrefix,
measureLocation
];
}, [
open,
measuring,
mergedPrefix,
mergedValue,
measureText,
measurePrefix,
measureLocation
]);
const getOptions = import_react.useCallback((targetMeasureText) => {
let list;
if (options && options.length > 0) list = options.map((item) => ({
...item,
key: `${item?.key ?? item.value}-${uniqueKey}`
}));
else list = toArray$8(children).map(({ props: optionProps, key }) => ({
...optionProps,
label: optionProps.children,
key: `${key || optionProps.value}-${uniqueKey}`
}));
return list.filter((option) => {
/** Return all result if `filterOption` is false. */
if (filterOption$1 === false) return true;
return filterOption$1(targetMeasureText, option);
});
}, [
options,
uniqueKey,
children,
filterOption$1
]);
const mergedOptions = import_react.useMemo(() => getOptions(mergedMeasureText), [getOptions, mergedMeasureText]);
const onSelectionEffect = useEffectState();
const startMeasure = (nextMeasureText, nextMeasurePrefix, nextMeasureLocation) => {
setMeasuring(true);
setMeasureText(nextMeasureText);
setMeasurePrefix(nextMeasurePrefix);
setMeasureLocation(nextMeasureLocation);
setActiveIndex(0);
};
const stopMeasure = (callback) => {
setMeasuring(false);
setMeasureLocation(0);
setMeasureText("");
onSelectionEffect(callback);
};
const triggerChange = (nextValue) => {
setMergedValue(nextValue);
onChange?.(nextValue);
};
const onInternalChange = ({ target: { value: nextValue } }) => {
triggerChange(nextValue);
};
const selectOption = (option) => {
const { value: mentionValue = "" } = option;
const { text, selectionLocation } = replaceWithMeasure(mergedValue, {
measureLocation: mergedMeasureLocation,
targetText: mentionValue,
prefix: mergedMeasurePrefix,
selectionStart: getTextArea()?.selectionStart,
split
});
triggerChange(text);
stopMeasure(() => {
setInputSelection(getTextArea(), selectionLocation);
});
onSelect?.(option, mergedMeasurePrefix);
};
const onInternalKeyDown = (event) => {
const { which } = event;
onKeyDown?.(event);
if (!mergedMeasuring) return;
if (which === KeyCode.UP || which === KeyCode.DOWN) {
const optionLen = mergedOptions.length;
setActiveIndex((activeIndex + (which === KeyCode.UP ? -1 : 1) + optionLen) % optionLen);
event.preventDefault();
} else if (which === KeyCode.ESC) stopMeasure();
else if (which === KeyCode.ENTER) {
event.preventDefault();
if (silent) return;
if (!mergedOptions.length) {
stopMeasure();
return;
}
const option = mergedOptions[activeIndex];
selectOption(option);
}
};
/**
* When to start measure:
* 1. When user press `prefix`
* 2. When measureText !== prevMeasureText
* - If measure hit
* - If measuring
*
* When to stop measure:
* 1. Selection is out of range
* 2. Contains `space`
* 3. ESC or select one
*/
const onInternalKeyUp = (event) => {
const { key, which } = event;
const target = event.target;
const selectionStartText = getBeforeSelectionText(target);
const { location: measureIndex, prefix: nextMeasurePrefix } = getLastMeasureIndex(selectionStartText, mergedPrefix);
onKeyUp?.(event);
if ([
KeyCode.ESC,
KeyCode.UP,
KeyCode.DOWN,
KeyCode.ENTER
].indexOf(which) !== -1) return;
if (measureIndex !== -1) {
const nextMeasureText = selectionStartText.slice(measureIndex + nextMeasurePrefix.length);
const validateMeasure = validateSearch$1(nextMeasureText, split);
const matchOption = !!getOptions(nextMeasureText).length;
if (validateMeasure) {
if (key === nextMeasurePrefix || key === "Shift" || which === KeyCode.ALT || key === "AltGraph" || mergedMeasuring || nextMeasureText !== mergedMeasureText && matchOption) startMeasure(nextMeasureText, nextMeasurePrefix, measureIndex);
} else if (mergedMeasuring) stopMeasure();
/**
* We will trigger `onSearch` to developer since they may use for async update.
* If met `space` means user finished searching.
*/
if (onSearch && validateMeasure) onSearch(nextMeasureText, nextMeasurePrefix);
} else if (mergedMeasuring) stopMeasure();
};
const onInternalPressEnter = (event) => {
if (!mergedMeasuring && onPressEnter) onPressEnter(event);
};
const focusRef = (0, import_react.useRef)();
const onInternalFocus = (event) => {
window.clearTimeout(focusRef.current);
if (!isFocus && event && onFocus) onFocus(event);
setIsFocus(true);
};
const onInternalBlur = (event) => {
focusRef.current = window.setTimeout(() => {
setIsFocus(false);
stopMeasure();
onBlur?.(event);
}, 0);
};
const onDropdownFocus = () => {
onInternalFocus();
};
const onDropdownBlur = () => {
onInternalBlur();
};
const onInternalPopupScroll = (event) => {
onPopupScroll?.(event);
};
const mergedStyles = import_react.useMemo(() => {
const resizeStyle = styles?.textarea?.resize ?? style?.resize;
const mergedTextareaStyle = { ...styles?.textarea };
if (resizeStyle !== void 0) mergedTextareaStyle.resize = resizeStyle;
return {
...styles,
textarea: mergedTextareaStyle
};
}, [style, styles]);
const mentionNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(es_default$7, _extends$28({
classNames: { textarea: mentionClassNames?.textarea },
styles: mergedStyles,
ref: textareaRef,
value: mergedValue
}, restProps, {
rows,
onChange: onInternalChange,
onKeyDown: onInternalKeyDown,
onKeyUp: onInternalKeyUp,
onPressEnter: onInternalPressEnter,
onFocus: onInternalFocus,
onBlur: onInternalBlur
})), mergedMeasuring && /* @__PURE__ */ import_react.createElement("div", {
ref: measureRef,
className: `${prefixCls}-measure`
}, mergedValue.slice(0, mergedMeasureLocation), /* @__PURE__ */ import_react.createElement(MentionsContext.Provider, { value: {
notFoundContent,
activeIndex,
setActiveIndex,
selectOption,
onFocus: onDropdownFocus,
onBlur: onDropdownBlur,
onScroll: onInternalPopupScroll
} }, /* @__PURE__ */ import_react.createElement(KeywordTrigger, {
prefixCls,
transitionName,
placement,
direction,
options: mergedOptions,
visible: true,
getPopupContainer,
popupClassName: clsx(popupClassName, mentionClassNames?.popup),
popupStyle: styles?.popup
}, /* @__PURE__ */ import_react.createElement("span", null, mergedMeasurePrefix))), mergedValue.slice(mergedMeasureLocation + mergedMeasurePrefix.length)));
if (!hasWrapper) return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(prefixCls, className),
style,
ref: containerRef
}, mentionNode);
return mentionNode;
});
var Mentions$1 = /* @__PURE__ */ (0, import_react.forwardRef)(({ suffix, prefixCls = "rc-mentions", defaultValue, value: customValue, id, allowClear, onChange, classNames: mentionsClassNames, styles, className, disabled, onClear, ...rest }, ref) => {
const hasSuffix = !!(suffix || allowClear);
const holderRef = (0, import_react.useRef)(null);
const mentionRef = (0, import_react.useRef)(null);
(0, import_react.useImperativeHandle)(ref, () => ({
...mentionRef.current,
nativeElement: holderRef.current?.nativeElement || mentionRef.current?.nativeElement
}));
const [mergedValue, setMergedValue] = useControlledState(defaultValue || "", customValue);
const triggerChange = (currentValue) => {
setMergedValue(currentValue);
onChange?.(currentValue);
};
const handleReset = () => {
triggerChange("");
};
return /* @__PURE__ */ import_react.createElement(BaseInput, {
suffix,
prefixCls,
value: mergedValue,
allowClear,
handleReset,
className: clsx(prefixCls, className, { [`${prefixCls}-has-suffix`]: hasSuffix }),
classNames: mentionsClassNames,
disabled,
ref: holderRef,
onClear
}, /* @__PURE__ */ import_react.createElement(InternalMentions, _extends$28({
className: mentionsClassNames?.mentions,
styles,
classNames: mentionsClassNames,
prefixCls,
id,
ref: mentionRef,
onChange: triggerChange,
disabled,
hasWrapper: hasSuffix
}, rest)));
});
Mentions$1.Option = Option$1;
//#endregion
//#region node_modules/@rc-component/mentions/es/index.js
var es_default$6 = Mentions$1;
//#endregion
//#region node_modules/antd/es/_util/toList.js
var toList = (val, config = {}) => {
if (!isNonNullable(val) && config?.skipEmpty) return [];
return Array.isArray(val) ? val : [val];
};
//#endregion
//#region node_modules/antd/es/mentions/style/index.js
var genDropdownStyle = (token) => {
const { componentCls, fontSize, paddingXXS, colorBgElevated, borderRadiusLG, boxShadowSecondary, itemPaddingVertical, controlPaddingHorizontal, colorText, borderRadius, lineHeight, colorTextDisabled, controlItemBgHover, motionDurationSlow } = token;
return { [componentCls]: { "&-dropdown": {
...resetComponent(token),
position: "absolute",
top: -9999,
insetInlineStart: -9999,
zIndex: token.zIndexPopup,
boxSizing: "border-box",
fontSize,
fontVariant: "initial",
padding: paddingXXS,
backgroundColor: colorBgElevated,
borderRadius: borderRadiusLG,
outline: "none",
boxShadow: boxShadowSecondary,
"&-hidden": { display: "none" },
[`${componentCls}-dropdown-menu`]: {
maxHeight: token.dropdownHeight,
margin: 0,
paddingInlineStart: 0,
overflow: "auto",
listStyle: "none",
outline: "none",
"&-item": {
...textEllipsis,
position: "relative",
display: "block",
minWidth: token.controlItemWidth,
padding: `${unit$1(itemPaddingVertical)} ${unit$1(controlPaddingHorizontal)}`,
color: colorText,
borderRadius,
fontWeight: "normal",
lineHeight,
cursor: "pointer",
transition: `background-color ${motionDurationSlow} ease`,
"&:hover": { backgroundColor: controlItemBgHover },
"&-disabled": {
color: colorTextDisabled,
cursor: "not-allowed",
"&:hover": {
color: colorTextDisabled,
backgroundColor: controlItemBgHover,
cursor: "not-allowed"
}
},
"&-selected": {
color: colorText,
fontWeight: token.fontWeightStrong,
backgroundColor: controlItemBgHover
},
"&-active": { backgroundColor: controlItemBgHover }
}
}
} } };
};
var genMentionsStyle = (token) => {
const { componentCls, colorText, antCls, colorTextDisabled, calc } = token;
const [varName, varRef] = genCssVar(antCls, "cmp-mentions");
return { [componentCls]: [
resetComponent(token),
genBasicInputStyle(token, {
largeStyle: { padding: 0 },
smallStyle: { padding: 0 }
}),
genOutlinedStyle(token),
genFilledStyle(token),
genBorderlessStyle(token),
genUnderlinedStyle(token),
{
[varName("padding-inline")]: token.paddingInline,
[varName("padding-block")]: token.paddingBlock,
[varName("control-height")]: token.controlHeight,
display: "flex",
padding: 0,
whiteSpace: "pre-wrap",
"> textarea": [
resetComponent(token),
genPlaceholderStyle(token.colorTextPlaceholder),
{
background: "transparent",
border: "none",
borderRadius: "inherit",
outline: "none",
flex: "auto",
minWidth: 0,
resize: "none",
"&:disabled": { color: colorTextDisabled }
}
],
[`> textarea, ${componentCls}-measure`]: {
color: colorText,
boxSizing: "border-box",
margin: 0,
minHeight: calc(varRef("control-height")).sub(calc(token.lineWidth).mul(2).equal()).equal(),
paddingInline: varRef("padding-inline"),
paddingBlock: varRef("padding-block"),
overflow: "inherit",
overflowX: "hidden",
overflowY: "auto",
fontWeight: "inherit",
fontSize: "inherit",
fontFamily: "inherit",
fontStyle: "inherit",
fontVariant: "inherit",
fontSizeAdjust: "inherit",
fontStretch: "inherit",
lineHeight: "inherit",
direction: "inherit",
letterSpacing: "inherit",
whiteSpace: "inherit",
textAlign: "inherit",
verticalAlign: "top",
wordWrap: "break-word",
wordBreak: "inherit",
tabSize: "inherit"
},
[`${componentCls}-measure`]: {
position: "absolute",
inset: 0,
zIndex: -1,
color: "transparent",
pointerEvents: "none",
"> span": {
display: "inline-block",
minHeight: "1em"
}
},
[`${componentCls}-suffix`]: {
display: "inline-flex",
alignItems: "center",
flex: "none",
color: token.colorTextQuaternary,
fontSize: token.fontSizeIcon,
lineHeight: 1,
position: "absolute",
top: "50%",
transform: "translateY(-50%)",
insetInlineEnd: varRef("padding-inline"),
columnGap: token.marginXS,
[`${componentCls}-clear-icon`]: {
cursor: "pointer",
border: 0,
background: "transparent",
"&:hover": { color: token.colorIcon },
"&:active": { color: token.colorText },
"&-hidden": { visibility: "hidden" }
},
[`${antCls}-form-item-feedback-icon`]: {
display: "inline-flex",
alignItems: "center",
justifyContent: "center"
}
}
},
{ "&-has-suffix": { "> textarea": { paddingInlineEnd: calc(token.paddingXXS).mul(1.5).add(token.fontSizeIcon).add(varRef("padding-inline")).equal() } } },
{ "&-disabled": { "> textarea": { ...genDisabledStyle(token) } } },
{
"&-lg": {
[varName("padding-inline")]: token.paddingInlineLG,
[varName("padding-block")]: token.paddingBlockLG,
[varName("control-height")]: token.controlHeightLG
},
"&-sm": {
[varName("padding-inline")]: token.paddingInlineSM,
[varName("padding-block")]: token.paddingBlockSM,
[varName("control-height")]: token.controlHeightSM
}
}
] };
};
var prepareComponentToken$17 = (token) => ({
...initComponentToken$1(token),
dropdownHeight: 250,
controlItemWidth: 100,
zIndexPopup: token.zIndexPopupBase + 50,
itemPaddingVertical: (token.controlHeight - token.fontHeight) / 2
});
var style_default$17 = genStyleHooks("Mentions", (token) => {
const mentionsToken = merge(token, initInputToken(token));
return [genMentionsStyle(mentionsToken), genDropdownStyle(mentionsToken)];
}, prepareComponentToken$17);
//#endregion
//#region node_modules/antd/es/mentions/index.js
var { Option } = es_default$6;
function loadingFilterOption() {
return true;
}
var Mentions = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, rootClassName, disabled: customDisabled, loading, filterOption, children, notFoundContent, options, status: customStatus, allowClear = false, popupClassName, style, variant: customVariant, classNames, styles, size: customSize, ...restProps } = props;
const [focused, setFocused] = import_react.useState(false);
const mergedRef = composeRef(ref, import_react.useRef(null));
const mergedSize = useSize((ctx) => customSize ?? ctx);
devUseWarning("Mentions").deprecated(!children, "Mentions.Option", "options");
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("mentions");
const { renderEmpty } = import_react.useContext(ConfigContext);
const { status: contextStatus, hasFeedback, feedbackIcon } = import_react.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
const contextDisabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? contextDisabled;
const prefixCls = getPrefixCls("mentions", customizePrefixCls);
const mergedProps = {
...props,
disabled: mergedDisabled,
status: mergedStatus,
variant: customVariant
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const onFocus = (...args) => {
if (restProps.onFocus) restProps.onFocus.apply(restProps, args);
setFocused(true);
};
const onBlur = (...args) => {
if (restProps.onBlur) restProps.onBlur.apply(restProps, args);
setFocused(false);
};
const notFoundContentEle = import_react.useMemo(() => {
if (notFoundContent !== void 0) return notFoundContent;
return renderEmpty?.("Select") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "Select" });
}, [notFoundContent, renderEmpty]);
const mentionOptions = import_react.useMemo(() => {
if (loading) return /* @__PURE__ */ import_react.createElement(Option, {
value: "ANTD_SEARCHING",
disabled: true
}, /* @__PURE__ */ import_react.createElement(Spin, { size: "small" }));
return children;
}, [loading, children]);
const mergedOptions = loading ? [{
value: "ANTD_SEARCHING",
disabled: true,
label: /* @__PURE__ */ import_react.createElement(Spin, { size: "small" })
}] : options;
const mentionsfilterOption = loading ? loadingFilterOption : filterOption;
const mergedAllowClear = getAllowClear(allowClear);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$17(prefixCls, rootCls);
const [variant, enableVariantCls] = useVariant("mentions", customVariant);
const suffixNode = hasFeedback && /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, feedbackIcon);
const mergedClassName = clsx(contextClassName, className, rootClassName, cssVarCls, rootCls, mergedClassNames.root, {
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-lg`]: mergedSize === "large"
});
return /* @__PURE__ */ import_react.createElement(es_default$6, {
silent: loading,
prefixCls,
notFoundContent: notFoundContentEle,
className: mergedClassName,
disabled: mergedDisabled,
allowClear: mergedAllowClear,
direction,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
...restProps,
filterOption: mentionsfilterOption,
onFocus,
onBlur,
ref: mergedRef,
options: mergedOptions,
suffix: suffixNode,
styles: {
textarea: mergedStyles.textarea,
popup: mergedStyles.popup,
suffix: mergedStyles.suffix
},
classNames: {
textarea: clsx(mergedClassNames.textarea),
popup: clsx(mergedClassNames.popup, popupClassName, rootClassName, hashId, cssVarCls, rootCls),
suffix: mergedClassNames.suffix,
mentions: clsx({
[`${prefixCls}-disabled`]: mergedDisabled,
[`${prefixCls}-focused`]: focused,
[`${prefixCls}-rtl`]: direction === "rtl"
}, hashId),
variant: clsx({ [`${prefixCls}-${variant}`]: enableVariantCls }, getStatusClassNames(prefixCls, mergedStatus)),
affixWrapper: hashId
}
}, mentionOptions);
});
Mentions.displayName = "Mentions";
Mentions.Option = Option;
Mentions._InternalPanelDoNotUseOrYouWillBeFired = genPurePanel(Mentions, void 0, void 0, "mentions");
Mentions.getMentions = (value = "", config = {}) => {
const { prefix = "@", split = " " } = config;
const prefixList = toList(prefix);
return value.split(split).map((str = "") => {
let hitPrefix = null;
prefixList.some((prefixStr) => {
if (str.slice(0, prefixStr.length) === prefixStr) {
hitPrefix = prefixStr;
return true;
}
return false;
});
if (hitPrefix !== null) return {
prefix: hitPrefix,
value: str.slice(hitPrefix.length)
};
return null;
}).filter((entity) => !!entity && !!entity.value);
};
//#endregion
//#region node_modules/antd/es/message/index.js
var message = null;
var act$1 = (callback) => callback();
var taskQueue$1 = [];
var defaultGlobalConfig$1 = {};
function getGlobalContext$1() {
const { getContainer, duration, rtl, maxCount, top } = defaultGlobalConfig$1;
const mergedContainer = getContainer?.() || document.body;
return {
getContainer: () => mergedContainer,
duration,
rtl,
maxCount,
top
};
}
var GlobalHolder$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { messageConfig, sync } = props;
const { getPrefixCls } = (0, import_react.useContext)(ConfigContext);
const prefixCls = defaultGlobalConfig$1.prefixCls || getPrefixCls("message");
const appConfig = (0, import_react.useContext)(AppConfigContext);
const [api, holder] = useInternalMessage({
...messageConfig,
prefixCls,
...appConfig.message
});
import_react.useImperativeHandle(ref, () => {
const instance = { ...api };
Object.keys(instance).forEach((method) => {
instance[method] = (...args) => {
sync();
return api[method].apply(api, args);
};
});
return {
instance,
sync
};
});
return holder;
});
var GlobalHolderWrapper$1 = /* @__PURE__ */ import_react.forwardRef((_, ref) => {
const [messageConfig, setMessageConfig] = import_react.useState(getGlobalContext$1);
const sync = () => {
setMessageConfig(getGlobalContext$1);
};
import_react.useEffect(sync, []);
const global = globalConfig();
const rootPrefixCls = global.getRootPrefixCls();
const rootIconPrefixCls = global.getIconPrefixCls();
const theme = global.getTheme();
const dom = /* @__PURE__ */ import_react.createElement(GlobalHolder$1, {
ref,
sync,
messageConfig
});
return /* @__PURE__ */ import_react.createElement(ConfigProvider, {
prefixCls: rootPrefixCls,
iconPrefixCls: rootIconPrefixCls,
theme
}, global.holderRender ? global.holderRender(dom) : dom);
});
var flushMessageQueue = () => {
if (!message) {
const holderFragment = document.createDocumentFragment();
const newMessage = { fragment: holderFragment };
message = newMessage;
act$1(() => {
render(/* @__PURE__ */ import_react.createElement(GlobalHolderWrapper$1, { ref: (node) => {
const { instance, sync } = node || {};
Promise.resolve().then(() => {
if (!newMessage.instance && instance) {
newMessage.instance = instance;
newMessage.sync = sync;
flushMessageQueue();
}
});
} }), holderFragment);
});
return;
}
if (!message.instance) return;
taskQueue$1.forEach((task) => {
const { type, skipped } = task;
if (!skipped) switch (type) {
case "open":
act$1(() => {
const closeFn = message.instance.open({
...defaultGlobalConfig$1,
...task.config
});
closeFn?.then(task.resolve);
task.setCloseFn(closeFn);
});
break;
case "destroy":
act$1(() => {
message?.instance.destroy(task.key);
});
break;
default: act$1(() => {
var _message$instance;
const closeFn = (_message$instance = message.instance)[type].apply(_message$instance, _toConsumableArray$8(task.args));
closeFn?.then(task.resolve);
task.setCloseFn(closeFn);
});
}
});
taskQueue$1 = [];
};
function setMessageGlobalConfig(config) {
defaultGlobalConfig$1 = {
...defaultGlobalConfig$1,
...config
};
act$1(() => {
message?.sync?.();
});
}
function open$1(config) {
const result = wrapPromiseFn((resolve) => {
let closeFn;
const task = {
type: "open",
config,
resolve,
setCloseFn: (fn) => {
closeFn = fn;
}
};
taskQueue$1.push(task);
return () => {
if (closeFn) act$1(() => {
closeFn();
});
else task.skipped = true;
};
});
flushMessageQueue();
return result;
}
function typeOpen(type, args) {
if (!globalConfig().holderRender) warnContext("message");
const result = wrapPromiseFn((resolve) => {
let closeFn;
const task = {
type,
args,
resolve,
setCloseFn: (fn) => {
closeFn = fn;
}
};
taskQueue$1.push(task);
return () => {
if (closeFn) act$1(() => {
closeFn();
});
else task.skipped = true;
};
});
flushMessageQueue();
return result;
}
var destroy$1 = (key) => {
taskQueue$1.push({
type: "destroy",
key
});
flushMessageQueue();
};
var methods$1 = [
"success",
"info",
"warning",
"error",
"loading"
];
var staticMethods = {
open: open$1,
destroy: destroy$1,
config: setMessageGlobalConfig,
useMessage,
_InternalPanelDoNotUseOrYouWillBeFired: PurePanel$14
};
methods$1.forEach((type) => {
staticMethods[type] = (...args) => typeOpen(type, args);
});
//#endregion
//#region node_modules/antd/es/modal/PurePanel.js
var PurePanel$4 = (props) => {
const { prefixCls: customizePrefixCls, className, closeIcon, closable, type, title, children, footer, classNames, styles, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const { className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("modal");
const rootPrefixCls = getPrefixCls();
const prefixCls = customizePrefixCls || getPrefixCls("modal");
const rootCls = useCSSVarCls(rootPrefixCls);
const [hashId, cssVarCls] = style_default$56(prefixCls, rootCls);
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props });
const confirmPrefixCls = `${prefixCls}-confirm`;
let additionalProps = {};
if (type) additionalProps = {
closable: closable ?? false,
title: "",
footer: "",
children: /* @__PURE__ */ import_react.createElement(ConfirmContent, {
...props,
prefixCls,
confirmPrefixCls,
rootPrefixCls,
content: children
})
};
else additionalProps = {
closable: closable ?? true,
title,
footer: footer !== null && /* @__PURE__ */ import_react.createElement(Footer$4, { ...props }),
children
};
return /* @__PURE__ */ import_react.createElement(Panel$3, {
prefixCls,
className: clsx(hashId, `${prefixCls}-pure-panel`, type && confirmPrefixCls, type && `${confirmPrefixCls}-${type}`, className, contextClassName, cssVarCls, rootCls, mergedClassNames.root),
style: {
...contextStyle,
...mergedStyles.root
},
...restProps,
closeIcon: renderCloseIcon(prefixCls, closeIcon),
closable,
classNames: mergedClassNames,
styles: mergedStyles,
...additionalProps
});
};
var PurePanel_default$1 = withPureRenderTheme(PurePanel$4);
//#endregion
//#region node_modules/antd/es/modal/index.js
function modalWarn(props) {
return confirm(withWarn(props));
}
var Modal = Modal$1;
Modal.useModal = useModal;
Modal.info = function infoFn(props) {
return confirm(withInfo(props));
};
Modal.success = function successFn(props) {
return confirm(withSuccess(props));
};
Modal.error = function errorFn(props) {
return confirm(withError(props));
};
Modal.warning = modalWarn;
Modal.warn = modalWarn;
Modal.confirm = function confirmFn(props) {
return confirm(withConfirm(props));
};
Modal.destroyAll = function destroyAllFn() {
while (destroyFns.length) {
const close = destroyFns.pop();
if (close) close();
}
};
Modal.config = modalGlobalConfig;
Modal._InternalPanelDoNotUseOrYouWillBeFired = PurePanel_default$1;
Modal.displayName = "Modal";
//#endregion
//#region node_modules/antd/es/notification/index.js
var notification = null;
var act = (callback) => callback();
var taskQueue = [];
var defaultGlobalConfig = {};
function getGlobalContext() {
const { getContainer, rtl, maxCount, top, bottom, showProgress, pauseOnHover } = defaultGlobalConfig;
const mergedContainer = getContainer?.() || document.body;
return {
getContainer: () => mergedContainer,
rtl,
maxCount,
top,
bottom,
showProgress,
pauseOnHover
};
}
var GlobalHolder = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { notificationConfig, sync } = props;
const { getPrefixCls } = (0, import_react.useContext)(ConfigContext);
const prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls("notification");
const appConfig = (0, import_react.useContext)(AppConfigContext);
const [api, holder] = useInternalNotification({
...notificationConfig,
prefixCls,
...appConfig.notification
});
import_react.useEffect(sync, []);
import_react.useImperativeHandle(ref, () => {
const instance = { ...api };
Object.keys(instance).forEach((method) => {
instance[method] = (...args) => {
sync();
return api[method].apply(api, args);
};
});
return {
instance,
sync
};
});
return holder;
});
var GlobalHolderWrapper = /* @__PURE__ */ import_react.forwardRef((_, ref) => {
const [notificationConfig, setNotificationConfig] = import_react.useState(getGlobalContext);
const sync = () => {
setNotificationConfig(getGlobalContext);
};
import_react.useEffect(sync, []);
const global = globalConfig();
const rootPrefixCls = global.getRootPrefixCls();
const rootIconPrefixCls = global.getIconPrefixCls();
const theme = global.getTheme();
const dom = /* @__PURE__ */ import_react.createElement(GlobalHolder, {
ref,
sync,
notificationConfig
});
return /* @__PURE__ */ import_react.createElement(ConfigProvider, {
prefixCls: rootPrefixCls,
iconPrefixCls: rootIconPrefixCls,
theme
}, global.holderRender ? global.holderRender(dom) : dom);
});
var flushNotificationQueue = () => {
if (!notification) {
const holderFragment = document.createDocumentFragment();
const newNotification = { fragment: holderFragment };
notification = newNotification;
act(() => {
render(/* @__PURE__ */ import_react.createElement(GlobalHolderWrapper, { ref: (node) => {
const { instance, sync } = node || {};
Promise.resolve().then(() => {
if (!newNotification.instance && instance) {
newNotification.instance = instance;
newNotification.sync = sync;
flushNotificationQueue();
}
});
} }), holderFragment);
});
return;
}
if (!notification.instance) return;
taskQueue.forEach((task) => {
switch (task.type) {
case "open":
act(() => {
notification.instance.open({
...defaultGlobalConfig,
...task.config
});
});
break;
case "destroy":
act(() => {
notification?.instance?.destroy(task.key);
});
break;
}
});
taskQueue = [];
};
function setNotificationGlobalConfig(config) {
defaultGlobalConfig = {
...defaultGlobalConfig,
...config
};
act(() => {
notification?.sync?.();
});
}
function open(config) {
if (!globalConfig().holderRender) warnContext("notification");
taskQueue.push({
type: "open",
config
});
flushNotificationQueue();
}
var destroy = (key) => {
taskQueue.push({
type: "destroy",
key
});
flushNotificationQueue();
};
var methods = [
"success",
"info",
"warning",
"error"
];
var staticMethods$1 = {
open,
destroy,
config: setNotificationGlobalConfig,
useNotification,
_InternalPanelDoNotUseOrYouWillBeFired: PurePanel$13
};
methods.forEach((type) => {
staticMethods$1[type] = (config) => open({
...config,
type
});
});
//#endregion
//#region node_modules/antd/es/popconfirm/style/index.js
var genBaseStyle$7 = (token) => {
const { componentCls, iconCls, antCls, zIndexPopup, colorText, colorWarning, marginXXS, marginXS, fontSize, fontWeightStrong, colorTextHeading } = token;
return { [componentCls]: {
zIndex: zIndexPopup,
[`&${antCls}-popover`]: { fontSize },
[`${componentCls}-message`]: {
marginBottom: marginXS,
display: "flex",
flexWrap: "nowrap",
alignItems: "start",
[`> ${componentCls}-message-icon ${iconCls}`]: {
color: colorWarning,
fontSize,
lineHeight: 1,
marginInlineEnd: marginXS
},
[`${componentCls}-title`]: {
fontWeight: fontWeightStrong,
color: colorTextHeading,
"&:only-child": { fontWeight: "normal" }
},
[`${componentCls}-description`]: {
marginTop: marginXXS,
color: colorText
}
},
[`${componentCls}-buttons`]: {
textAlign: "end",
whiteSpace: "nowrap",
button: { marginInlineStart: marginXS }
}
} };
};
var prepareComponentToken$16 = (token) => {
const { zIndexPopupBase } = token;
return { zIndexPopup: zIndexPopupBase + 60 };
};
var style_default$16 = genStyleHooks("Popconfirm", genBaseStyle$7, prepareComponentToken$16, { resetStyle: false });
//#endregion
//#region node_modules/antd/es/popconfirm/PurePanel.js
var Overlay = (props) => {
const { prefixCls, okButtonProps, cancelButtonProps, title, description, cancelText, okText, okType = "primary", icon = /* @__PURE__ */ import_react.createElement(RefIcon$4, null), showCancel = true, close, onConfirm, onCancel, onPopupClick, classNames, styles } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const [contextLocale] = useLocale$1("Popconfirm", localeValues.Popconfirm);
const titleNode = getRenderPropValue(title);
const descriptionNode = getRenderPropValue(description);
return /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-inner-content`,
onClick: onPopupClick
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-message` }, icon && /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-message-icon` }, icon), /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-message-text` }, titleNode && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, classNames?.title),
style: styles?.title
}, titleNode), descriptionNode && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-description`, classNames?.content),
style: styles?.content
}, descriptionNode))), /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-buttons` }, showCancel && /* @__PURE__ */ import_react.createElement(Button, {
onClick: onCancel,
size: "small",
...cancelButtonProps
}, cancelText || contextLocale?.cancelText), /* @__PURE__ */ import_react.createElement(ActionButton, {
buttonProps: {
size: "small",
...convertLegacyProps(okType),
...okButtonProps
},
actionFn: onConfirm,
close,
prefixCls: getPrefixCls("btn"),
quitOnNullishReturnValue: true,
emitEvent: true
}, okText || contextLocale?.okText)));
};
var PurePanel$3 = (props) => {
const { prefixCls: customizePrefixCls, placement, className, style, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("popconfirm", customizePrefixCls);
style_default$16(prefixCls);
return /* @__PURE__ */ import_react.createElement(PurePanel$9, {
placement,
className: clsx(prefixCls, className),
style,
content: /* @__PURE__ */ import_react.createElement(Overlay, {
prefixCls,
...restProps
})
});
};
//#endregion
//#region node_modules/antd/es/popconfirm/index.js
var Popconfirm = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, placement = "top", trigger, okType = "primary", icon = /* @__PURE__ */ import_react.createElement(RefIcon$4, null), children, overlayClassName, onOpenChange, overlayStyle, styles, arrow: popconfirmArrow, classNames, ...restProps } = props;
const { getPrefixCls, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, arrow: contextArrow, trigger: contextTrigger } = useComponentConfig("popconfirm");
const [open, setOpen] = useControlledState(props.defaultOpen ?? false, props.open);
const mergedArrow = useMergedArrow(popconfirmArrow, contextArrow);
const mergedTrigger = trigger || contextTrigger || "click";
devUseWarning("Popconfirm")(!onOpenChange || onOpenChange.length <= 1, "usage", "The second `onOpenChange` parameter is internal and unsupported. Please lock to a previous version if needed.");
const settingOpen = (value) => {
setOpen(value);
onOpenChange?.(value);
};
const close = () => {
settingOpen(false);
};
const onConfirm = (e) => props.onConfirm?.call(void 0, e);
const onCancel = (e) => {
settingOpen(false);
props.onCancel?.call(void 0, e);
};
const onInternalOpenChange = (value) => {
const { disabled = false } = props;
if (disabled) return;
settingOpen(value);
};
const prefixCls = getPrefixCls("popconfirm", customizePrefixCls);
const mergedProps = {
...props,
placement,
trigger: mergedTrigger,
okType,
overlayStyle,
styles,
classNames
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const rootClassNames = clsx(prefixCls, contextClassName, overlayClassName, mergedClassNames.root);
style_default$16(prefixCls);
return /* @__PURE__ */ import_react.createElement(Popover, {
arrow: mergedArrow,
...omit(restProps, ["title"]),
trigger: mergedTrigger,
placement,
onOpenChange: onInternalOpenChange,
open,
ref,
classNames: {
root: rootClassNames,
container: mergedClassNames.container,
arrow: mergedClassNames.arrow
},
styles: {
root: {
...contextStyle,
...mergedStyles.root,
...overlayStyle
},
container: mergedStyles.container,
arrow: mergedStyles.arrow
},
content: /* @__PURE__ */ import_react.createElement(Overlay, {
okType,
icon,
...props,
prefixCls,
close,
onConfirm,
onCancel,
classNames: mergedClassNames,
styles: mergedStyles
}),
"data-popover-inject": true
}, children);
});
/* istanbul ignore next */
Popconfirm._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$3;
Popconfirm.displayName = "Popconfirm";
//#endregion
//#region node_modules/@rc-component/progress/es/common.js
var defaultProps = {
percent: 0,
prefixCls: "rc-progress",
strokeColor: "#2db7f5",
strokeLinecap: "round",
strokeWidth: 1,
railColor: "#D9D9D9",
railWidth: 1,
gapPosition: "bottom",
loading: false
};
var useTransitionDuration = () => {
const pathsRef = (0, import_react.useRef)([]);
const prevTimeStamp = (0, import_react.useRef)(null);
(0, import_react.useEffect)(() => {
const now = Date.now();
let updated = false;
pathsRef.current.forEach((path) => {
if (!path) return;
updated = true;
const pathStyle = path.style;
pathStyle.transitionDuration = ".3s, .3s, .3s, .06s";
if (prevTimeStamp.current && now - prevTimeStamp.current < 100) pathStyle.transitionDuration = "0s, 0s";
});
if (updated) prevTimeStamp.current = Date.now();
});
return pathsRef.current;
};
//#endregion
//#region node_modules/@rc-component/progress/es/utils/getIndeterminateLine.js
var getIndeterminateLine_default = ((options) => {
const { id, percent, strokeLinecap, strokeWidth, loading } = options;
if (!loading) return {
indeterminateStyleProps: {},
indeterminateStyleAnimation: null
};
const animationName = `${id}-indeterminate-animate`;
const strokeDashOffset = 100 - (percent + (strokeLinecap === "round" ? strokeWidth : 0));
return {
indeterminateStyleProps: {
strokeDasharray: `${percent} 100`,
animation: `${animationName} .6s linear alternate infinite`,
strokeDashoffset: 0
},
indeterminateStyleAnimation: /* @__PURE__ */ import_react.createElement("style", null, `@keyframes ${animationName} {
0% { stroke-dashoffset: 0; }
100% { stroke-dashoffset: -${strokeDashOffset};
}`)
};
});
//#endregion
//#region node_modules/@rc-component/progress/es/Line.js
function _extends$27() {
_extends$27 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$27.apply(this, arguments);
}
var Line$1 = (props) => {
const { id, className, percent, prefixCls, strokeColor, strokeLinecap, strokeWidth, style, railColor, railWidth, transition, loading, ...restProps } = {
...defaultProps,
...props
};
const mergedId = useId_default(id);
delete restProps.gapPosition;
const percentList = Array.isArray(percent) ? percent : [percent];
const strokeColorList = Array.isArray(strokeColor) ? strokeColor : [strokeColor];
const paths = useTransitionDuration();
const center = strokeWidth / 2;
const right = 100 - strokeWidth / 2;
const pathString = `M ${strokeLinecap === "round" ? center : 0},${center}
L ${strokeLinecap === "round" ? right : 100},${center}`;
const viewBoxString = `0 0 100 ${strokeWidth}`;
let stackPtg = 0;
const { indeterminateStyleProps, indeterminateStyleAnimation } = getIndeterminateLine_default({
id: mergedId,
loading,
percent: percentList[0],
strokeLinecap,
strokeWidth
});
return /* @__PURE__ */ import_react.createElement("svg", _extends$27({
className: clsx(`${prefixCls}-line`, className),
viewBox: viewBoxString,
preserveAspectRatio: "none",
style
}, restProps), /* @__PURE__ */ import_react.createElement("path", {
className: `${prefixCls}-line-rail`,
d: pathString,
strokeLinecap,
stroke: railColor,
strokeWidth: railWidth || strokeWidth,
fillOpacity: "0"
}), percentList.map((ptg, index) => {
let dashPercent = 1;
switch (strokeLinecap) {
case "round":
dashPercent = 1 - strokeWidth / 100;
break;
case "square":
dashPercent = 1 - strokeWidth / 2 / 100;
break;
default:
dashPercent = 1;
break;
}
const pathStyle = {
strokeDasharray: `${ptg * dashPercent}px, 100px`,
strokeDashoffset: `-${stackPtg}px`,
transition: transition || "stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear",
...indeterminateStyleProps
};
const color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
stackPtg += ptg;
return /* @__PURE__ */ import_react.createElement("path", {
key: index,
className: `${prefixCls}-line-path`,
d: pathString,
strokeLinecap,
stroke: color,
strokeWidth,
fillOpacity: "0",
ref: (elem) => {
paths[index] = elem;
},
style: pathStyle
});
}), indeterminateStyleAnimation);
};
Line$1.displayName = "Line";
//#endregion
//#region node_modules/@rc-component/progress/es/Circle/PtgCircle.js
var Block = ({ bg, children }) => /* @__PURE__ */ import_react.createElement("div", { style: {
width: "100%",
height: "100%",
background: bg
} }, children);
function getPtgColors(color, scale) {
return Object.keys(color).map((key) => {
const ptgKey = `${Math.floor(parseFloat(key) * scale)}%`;
return `${color[key]} ${ptgKey}`;
});
}
var PtgCircle = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, color, gradientId, radius, className, style: circleStyleForStack, ptg, strokeLinecap, strokeWidth, size, gapDegree } = props;
const isGradient = color && typeof color === "object";
const stroke = isGradient ? `#FFF` : void 0;
const halfSize = size / 2;
const circleNode = /* @__PURE__ */ import_react.createElement("circle", {
className: clsx(`${prefixCls}-circle-path`, className),
r: radius,
cx: halfSize,
cy: halfSize,
stroke,
strokeLinecap,
strokeWidth,
opacity: ptg === 0 ? 0 : 1,
style: circleStyleForStack,
ref
});
if (!isGradient) return circleNode;
const maskId = `${gradientId}-conic`;
const fromDeg = gapDegree ? `${180 + gapDegree / 2}deg` : "0deg";
const conicColors = getPtgColors(color, (360 - gapDegree) / 360);
const linearColors = getPtgColors(color, 1);
const conicColorBg = `conic-gradient(from ${fromDeg}, ${conicColors.join(", ")})`;
const linearColorBg = `linear-gradient(to ${gapDegree ? "bottom" : "top"}, ${linearColors.join(", ")})`;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("mask", { id: maskId }, circleNode), /* @__PURE__ */ import_react.createElement("foreignObject", {
x: 0,
y: 0,
width: size,
height: size,
mask: `url(#${maskId})`
}, /* @__PURE__ */ import_react.createElement(Block, { bg: linearColorBg }, /* @__PURE__ */ import_react.createElement(Block, { bg: conicColorBg }))));
});
PtgCircle.displayName = "PtgCircle";
var getCircleStyle = (perimeter, perimeterWithoutGap, offset, percent, rotateDeg, gapDegree, gapPosition, strokeColor, strokeLinecap, strokeWidth, stepSpace = 0) => {
const offsetDeg = offset / 100 * 360 * ((360 - gapDegree) / 360);
const positionDeg = gapDegree === 0 ? 0 : {
bottom: 0,
top: 180,
left: 90,
right: -90
}[gapPosition];
let strokeDashoffset = (100 - percent) / 100 * perimeterWithoutGap;
if (strokeLinecap === "round" && percent !== 100) {
strokeDashoffset += strokeWidth / 2;
if (strokeDashoffset >= perimeterWithoutGap) strokeDashoffset = perimeterWithoutGap - .01;
}
const halfSize = 100 / 2;
return {
stroke: typeof strokeColor === "string" ? strokeColor : void 0,
strokeDasharray: `${perimeterWithoutGap}px ${perimeter}`,
strokeDashoffset: strokeDashoffset + stepSpace,
transform: `rotate(${rotateDeg + offsetDeg + positionDeg}deg)`,
transformOrigin: `${halfSize}px ${halfSize}px`,
transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",
fillOpacity: 0
};
};
//#endregion
//#region node_modules/@rc-component/progress/es/utils/getIndeterminateCircle.js
var getIndeterminateCircle_default = (({ id, loading }) => {
if (!loading) return {
indeterminateStyleProps: {},
indeterminateStyleAnimation: null
};
const animationName = `${id}-indeterminate-animate`;
return {
indeterminateStyleProps: {
transform: "rotate(0deg)",
animation: `${animationName} 1s linear infinite`
},
indeterminateStyleAnimation: /* @__PURE__ */ import_react.createElement("style", null, `@keyframes ${animationName} {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}`)
};
});
//#endregion
//#region node_modules/@rc-component/progress/es/Circle/index.js
function _extends$26() {
_extends$26 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$26.apply(this, arguments);
}
function toArray$2(value) {
const mergedValue = value ?? [];
return Array.isArray(mergedValue) ? mergedValue : [mergedValue];
}
var Circle$1 = (props) => {
const { id, prefixCls, classNames = {}, styles = {}, steps, strokeWidth, railWidth, gapDegree = 0, gapPosition, railColor, strokeLinecap, style, className, strokeColor, percent, loading, ...restProps } = {
...defaultProps,
...props
};
const halfSize = 100 / 2;
const mergedId = useId_default(id);
const gradientId = `${mergedId}-gradient`;
const radius = halfSize - strokeWidth / 2;
const perimeter = Math.PI * 2 * radius;
const rotateDeg = gapDegree > 0 ? 90 + gapDegree / 2 : -90;
const perimeterWithoutGap = perimeter * ((360 - gapDegree) / 360);
const { count: stepCount, gap: stepGap } = typeof steps === "object" ? steps : {
count: steps,
gap: 2
};
const percentList = toArray$2(percent);
const strokeColorList = toArray$2(strokeColor);
const gradient = strokeColorList.find((color) => color && typeof color === "object");
const mergedStrokeLinecap = gradient && typeof gradient === "object" ? "butt" : strokeLinecap;
const { indeterminateStyleProps, indeterminateStyleAnimation } = getIndeterminateCircle_default({
id: mergedId,
loading
});
const circleStyle = getCircleStyle(perimeter, perimeterWithoutGap, 0, 100, rotateDeg, gapDegree, gapPosition, railColor, mergedStrokeLinecap, strokeWidth);
const paths = useTransitionDuration();
const getStokeList = () => {
let stackPtg = 0;
return percentList.map((ptg, index) => {
const color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
const circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, ptg, rotateDeg, gapDegree, gapPosition, color, mergedStrokeLinecap, strokeWidth);
stackPtg += ptg;
return /* @__PURE__ */ import_react.createElement(PtgCircle, {
key: index,
color,
ptg,
radius,
prefixCls,
gradientId,
className: classNames.track,
style: {
...circleStyleForStack,
...indeterminateStyleProps,
...styles.track
},
strokeLinecap: mergedStrokeLinecap,
strokeWidth,
gapDegree,
ref: (elem) => {
paths[index] = elem;
},
size: 100
});
}).reverse();
};
const getStepStokeList = () => {
const current = Math.round(stepCount * (percentList[0] / 100));
const stepPtg = 100 / stepCount;
let stackPtg = 0;
return new Array(stepCount).fill(null).map((_, index) => {
const color = index <= current - 1 ? strokeColorList[0] : railColor;
const stroke = color && typeof color === "object" ? `url(#${gradientId})` : void 0;
const circleStyleForStack = getCircleStyle(perimeter, perimeterWithoutGap, stackPtg, stepPtg, rotateDeg, gapDegree, gapPosition, color, "butt", strokeWidth, stepGap);
stackPtg += (perimeterWithoutGap - circleStyleForStack.strokeDashoffset + stepGap) * 100 / perimeterWithoutGap;
return /* @__PURE__ */ import_react.createElement("circle", {
key: index,
className: clsx(`${prefixCls}-circle-path`, classNames.track),
r: radius,
cx: halfSize,
cy: halfSize,
stroke,
strokeWidth,
opacity: 1,
style: {
...circleStyleForStack,
...styles.track
},
ref: (elem) => {
paths[index] = elem;
}
});
});
};
return /* @__PURE__ */ import_react.createElement("svg", _extends$26({
className: clsx(`${prefixCls}-circle`, classNames.root, className),
viewBox: `0 0 100 100`,
style: {
...styles.root,
...style
},
id,
role: "presentation"
}, restProps), !stepCount && /* @__PURE__ */ import_react.createElement("circle", {
className: clsx(`${prefixCls}-circle-rail`, classNames.rail),
r: radius,
cx: halfSize,
cy: halfSize,
stroke: railColor,
strokeLinecap: mergedStrokeLinecap,
strokeWidth: railWidth || strokeWidth,
style: {
...circleStyle,
...styles.rail
}
}), stepCount ? getStepStokeList() : getStokeList(), indeterminateStyleAnimation);
};
Circle$1.displayName = "Circle";
//#endregion
//#region node_modules/antd/es/progress/utils.js
function validProgress(progress) {
if (!progress || progress < 0) return 0;
if (progress > 100) return 100;
return progress;
}
function getSuccessPercent({ success }) {
let percent;
if (success && "percent" in success) percent = success.percent;
return percent;
}
var getPercentage = ({ percent, success }) => {
const realSuccessPercent = validProgress(getSuccessPercent({ success }));
return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];
};
var getStrokeColor = ({ success = {}, strokeColor }) => {
const { strokeColor: successColor } = success;
return [successColor || presetPrimaryColors.green, strokeColor || null];
};
var getSize = (size, type, extra) => {
let width = -1;
let height = -1;
if (type === "step") {
const steps = extra.steps;
const strokeWidth = extra.strokeWidth;
if (typeof size === "string" || typeof size === "undefined") {
width = size === "small" ? 2 : 14;
height = strokeWidth ?? 8;
} else if (isNumber(size)) [width, height] = [size, size];
else [width = 14, height = 8] = Array.isArray(size) ? size : [size.width, size.height];
width *= steps;
} else if (type === "line") {
const strokeWidth = extra?.strokeWidth;
if (typeof size === "string" || typeof size === "undefined") height = strokeWidth || (size === "small" ? 6 : 8);
else if (isNumber(size)) [width, height] = [size, size];
else [width = -1, height = 8] = Array.isArray(size) ? size : [size.width, size.height];
} else if (type === "circle" || type === "dashboard") {
if (typeof size === "string" || typeof size === "undefined") [width, height] = size === "small" ? [60, 60] : [120, 120];
else if (isNumber(size)) [width, height] = [size, size];
else if (Array.isArray(size)) {
width = size[0] ?? size[1] ?? 120;
height = size[0] ?? size[1] ?? 120;
}
}
return [width, height];
};
//#endregion
//#region node_modules/antd/es/progress/Circle.js
var CIRCLE_MIN_STROKE_WIDTH = 3;
var getMinPercent = (width) => CIRCLE_MIN_STROKE_WIDTH / width * 100;
var OMIT_SEMANTIC_NAMES = [
"root",
"body",
"indicator"
];
var Circle = (props) => {
const { prefixCls, classNames, styles, railColor, trailColor, strokeLinecap = "round", gapPosition, gapPlacement, gapDegree, width: originWidth = 120, type, children, success, size = originWidth, steps } = props;
const { direction } = useComponentConfig("progress");
const mergedRailColor = railColor ?? trailColor;
const [width, height] = getSize(size, "circle");
let { strokeWidth } = props;
if (strokeWidth === void 0) strokeWidth = Math.max(getMinPercent(width), 6);
const circleStyle = {
width,
height,
fontSize: width * .15 + 6
};
const realGapDegree = import_react.useMemo(() => {
if (gapDegree || gapDegree === 0) return gapDegree;
if (type === "dashboard") return 75;
}, [gapDegree, type]);
const percentArray = getPercentage(props);
const gapPos = import_react.useMemo(() => {
const mergedPlacement = (gapPlacement ?? gapPosition) || type === "dashboard" && "bottom" || void 0;
const isRTL = direction === "rtl";
switch (mergedPlacement) {
case "start": return isRTL ? "right" : "left";
case "end": return isRTL ? "left" : "right";
default: return mergedPlacement;
}
}, [
direction,
gapPlacement,
gapPosition,
type
]);
const isGradient = Object.prototype.toString.call(props.strokeColor) === "[object Object]";
const strokeColor = getStrokeColor({
success,
strokeColor: props.strokeColor
});
const wrapperClassName = clsx(`${prefixCls}-body`, { [`${prefixCls}-circle-gradient`]: isGradient }, classNames.body);
const circleContent = /* @__PURE__ */ import_react.createElement(Circle$1, {
steps,
percent: steps ? percentArray[1] : percentArray,
strokeWidth,
railWidth: strokeWidth,
strokeColor: steps ? strokeColor[1] : strokeColor,
strokeLinecap,
railColor: mergedRailColor,
prefixCls,
gapDegree: realGapDegree,
gapPosition: gapPos,
classNames: omit(classNames, OMIT_SEMANTIC_NAMES),
styles: omit(styles, OMIT_SEMANTIC_NAMES)
});
const smallCircle = width <= 20;
const node = /* @__PURE__ */ import_react.createElement("div", {
className: wrapperClassName,
style: {
...circleStyle,
...styles.body
}
}, circleContent, !smallCircle && children);
if (smallCircle) return /* @__PURE__ */ import_react.createElement(Tooltip, { title: children }, node);
return node;
};
//#endregion
//#region node_modules/antd/es/progress/style/index.js
var LineStrokeColorVar = "--progress-line-stroke-color";
var genAntProgressActive = (isRtl) => {
const direction = isRtl ? "100%" : "-100%";
return new Keyframe(`antProgress${isRtl ? "RTL" : "LTR"}Active`, {
"0%": {
transform: `translateX(${direction}) scaleX(0)`,
opacity: .1
},
"20%": {
transform: `translateX(${direction}) scaleX(0)`,
opacity: .5
},
to: {
transform: "translateX(0) scaleX(1)",
opacity: 0
}
});
};
var genBaseStyle$6 = (token) => {
const { componentCls: progressCls, iconCls: iconPrefixCls } = token;
return { [progressCls]: {
...resetComponent(token),
display: "inline-flex",
"&-rtl": { direction: "rtl" },
[`${progressCls}-indicator`]: {
color: token.colorText,
lineHeight: 1,
whiteSpace: "nowrap",
verticalAlign: "middle",
wordBreak: "normal",
[iconPrefixCls]: { fontSize: token.fontSize }
},
[`&${progressCls}-status-exception`]: { [`${progressCls}-indicator`]: { color: token.colorError } },
[`&${progressCls}-status-success`]: { [`${progressCls}-indicator`]: { color: token.colorSuccess } }
} };
};
var genLineStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-line`]: {
position: "relative",
width: "100%",
fontSize: token.fontSize,
[`${componentCls}-body`]: {
display: "inline-flex",
alignItems: "center",
width: "100%",
gap: token.marginXS
},
[`${componentCls}-rail`]: {
flex: "auto",
background: token.remainingColor,
borderRadius: token.lineBorderRadius,
position: "relative",
width: "100%",
overflow: "hidden"
},
[`&${componentCls}-status-active`]: { [`${componentCls}-track:after`]: {
content: "\"\"",
position: "absolute",
inset: 0,
backgroundColor: token.colorBgContainer,
borderRadius: "inherit",
opacity: 0,
animationName: genAntProgressActive(),
animationDuration: token.progressActiveMotionDuration,
animationTimingFunction: token.motionEaseOutQuint,
animationIterationCount: "infinite"
} },
[`${componentCls}-track`]: {
position: "absolute",
insetInlineStart: 0,
insetBlock: 0,
borderRadius: "inherit",
background: token.defaultColor,
transition: `all ${token.motionDurationSlow} ${token.motionEaseInOutCirc}`,
minWidth: "max-content",
display: "flex",
alignItems: "center",
"&-success": { background: token.colorSuccess }
},
[`&${componentCls}-status-exception`]: { [`${componentCls}-track`]: { background: token.colorError } },
[`&${componentCls}-status-success`]: { [`${componentCls}-track`]: { background: token.colorSuccess } },
[`${componentCls}-indicator-outer`]: { [`&${componentCls}-indicator-start`]: { order: -1 } },
[`${componentCls}-body-layout-bottom`]: {
flexDirection: "column",
alignItems: "center",
gap: token.marginXXS
},
[`${componentCls}-indicator${componentCls}-indicator-inner`]: {
color: token.colorWhite,
paddingInline: token.paddingXXS,
width: "100%",
display: "flex",
justifyContent: "center",
[`&${componentCls}-indicator-end`]: { justifyContent: "end" },
[`&${componentCls}-indicator-start`]: { justifyContent: "start" },
[`&${componentCls}-indicator-bright`]: { color: "rgba(0, 0, 0, 0.45)" }
}
} };
};
var genCircleStyle = (token) => {
const { componentCls: progressCls, iconCls: iconPrefixCls } = token;
return {
[`${progressCls}-circle`]: {
[`${progressCls}-circle-rail`]: { stroke: token.remainingColor },
[`${progressCls}-body:not(${progressCls}-circle-gradient)`]: { [`${progressCls}-circle-path`]: { stroke: token.defaultColor } },
[`${progressCls}-body`]: {
position: "relative",
lineHeight: 1,
backgroundColor: "transparent"
},
[`${progressCls}-indicator`]: {
position: "absolute",
insetBlockStart: "50%",
insetInlineStart: 0,
width: "100%",
margin: 0,
padding: 0,
color: token.circleTextColor,
fontSize: token.circleTextFontSize,
lineHeight: 1,
whiteSpace: "normal",
textAlign: "center",
transform: "translateY(-50%)",
[iconPrefixCls]: { fontSize: token.circleIconFontSize }
},
[`&${progressCls}-status-exception`]: { [`${progressCls}-body:not(${progressCls}-circle-gradient)`]: { [`${progressCls}-circle-path`]: { stroke: token.colorError } } },
[`&${progressCls}-status-success`]: { [`${progressCls}-body:not(${progressCls}-circle-gradient)`]: { [`${progressCls}-circle-path`]: { stroke: token.colorSuccess } } }
},
[`${progressCls}-inline-circle`]: {
lineHeight: 1,
[`${progressCls}-inner`]: { verticalAlign: "bottom" }
}
};
};
var genStepStyle = (token) => {
const { componentCls: progressCls } = token;
return { [progressCls]: { [`${progressCls}-steps`]: {
display: "inline-block",
"&-body": {
display: "flex",
flexDirection: "row",
alignItems: "center",
gap: token.progressStepMarginInlineEnd,
[`${progressCls}-indicator`]: { marginInlineStart: token.marginXS }
},
"&-item": {
flexShrink: 0,
minWidth: token.progressStepMinWidth,
backgroundColor: token.remainingColor,
transition: `all ${token.motionDurationSlow}`,
"&-active": { backgroundColor: token.defaultColor }
}
} } };
};
var genSmallLine = (token) => {
const { componentCls: progressCls, iconCls: iconPrefixCls } = token;
return { [progressCls]: { [`${progressCls}-small&-line, ${progressCls}-small&-line ${progressCls}-indicator ${iconPrefixCls}`]: { fontSize: token.fontSizeSM } } };
};
var prepareComponentToken$15 = (token) => ({
circleTextColor: token.colorText,
defaultColor: token.colorInfo,
remainingColor: token.colorFillSecondary,
lineBorderRadius: 100,
circleTextFontSize: "1em",
circleIconFontSize: `${token.fontSize / token.fontSizeSM}em`
});
var style_default$15 = genStyleHooks("Progress", (token) => {
const progressStepMarginInlineEnd = token.calc(token.marginXXS).div(2).equal();
const progressToken = merge(token, {
progressStepMarginInlineEnd,
progressStepMinWidth: progressStepMarginInlineEnd,
progressActiveMotionDuration: "2.4s"
});
return [
genBaseStyle$6(progressToken),
genLineStyle(progressToken),
genCircleStyle(progressToken),
genStepStyle(progressToken),
genSmallLine(progressToken)
];
}, prepareComponentToken$15);
//#endregion
//#region node_modules/antd/es/progress/Line.js
/**
* @example
* {
* "0%": "#afc163",
* "75%": "#009900",
* "50%": "green", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'
* "25%": "#66FF00",
* "100%": "#ffffff"
* }
*/
var sortGradient = (gradients) => {
let tempArr = [];
Object.keys(gradients).forEach((key) => {
const formattedKey = Number.parseFloat(key.replace(/%/g, ""));
if (!Number.isNaN(formattedKey)) tempArr.push({
key: formattedKey,
value: gradients[key]
});
});
tempArr = tempArr.sort((a, b) => a.key - b.key);
return tempArr.map(({ key, value }) => `${value} ${key}%`).join(", ");
};
/**
* Then this man came to realize the truth: Besides six pence, there is the moon. Besides bread and
* butter, there is the bug. And... Besides women, there is the code.
*
* @example
* {
* "0%": "#afc163",
* "25%": "#66FF00",
* "50%": "#00CC00", // ====> linear-gradient(to right, #afc163 0%, #66FF00 25%,
* "75%": "#009900", // #00CC00 50%, #009900 75%, #ffffff 100%)
* "100%": "#ffffff"
* }
*/
var handleGradient = (strokeColor, directionConfig) => {
const { from = presetPrimaryColors.blue, to = presetPrimaryColors.blue, direction = directionConfig === "rtl" ? "to left" : "to right", ...rest } = strokeColor;
if (Object.keys(rest).length !== 0) {
const background = `linear-gradient(${direction}, ${sortGradient(rest)})`;
return {
background,
[LineStrokeColorVar]: background
};
}
const background = `linear-gradient(${direction}, ${from}, ${to})`;
return {
background,
[LineStrokeColorVar]: background
};
};
var Line = (props) => {
const { prefixCls, classNames, styles, direction: directionConfig, percent, size, strokeWidth, strokeColor, strokeLinecap = "round", children, railColor, trailColor, percentPosition, success } = props;
const { align: infoAlign, type: infoPosition } = percentPosition;
const mergedRailColor = railColor ?? trailColor;
const borderRadius = strokeLinecap === "square" || strokeLinecap === "butt" ? 0 : void 0;
devUseWarning("Progress").deprecated(!("strokeWidth" in props), "strokeWidth", "size");
const [width, height] = getSize(size ?? [-1, strokeWidth || (size === "small" ? 6 : 8)], "line", { strokeWidth });
const railStyle = {
backgroundColor: mergedRailColor || void 0,
borderRadius,
height
};
const trackCls = `${prefixCls}-track`;
const backgroundProps = strokeColor && typeof strokeColor !== "string" ? handleGradient(strokeColor, directionConfig) : {
[LineStrokeColorVar]: strokeColor,
background: strokeColor
};
const percentTrackStyle = {
width: `${validProgress(percent)}%`,
height,
borderRadius,
...backgroundProps
};
const successPercent = getSuccessPercent(props);
const successTrackStyle = {
width: `${validProgress(successPercent)}%`,
height,
borderRadius,
backgroundColor: success?.strokeColor
};
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-body`, classNames.body, { [`${prefixCls}-body-layout-bottom`]: infoAlign === "center" && infoPosition === "outer" }),
style: {
width: width > 0 ? width : "100%",
...styles.body
}
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-rail`, classNames.rail),
style: {
...railStyle,
...styles.rail
}
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(trackCls, classNames.track),
style: {
...percentTrackStyle,
...styles.track
}
}, infoPosition === "inner" && children), successPercent !== void 0 && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(trackCls, `${trackCls}-success`, classNames.track),
style: {
...successTrackStyle,
...styles.track
}
})), infoPosition === "outer" && children);
};
//#endregion
//#region node_modules/antd/es/progress/Steps.js
var Steps$2 = (props) => {
const { classNames, styles, size, steps, rounding: customRounding = Math.round, percent = 0, strokeWidth = 8, strokeColor, railColor, trailColor, prefixCls, children } = props;
const current = customRounding(steps * (percent / 100));
const [width, height] = getSize(size ?? [size === "small" ? 2 : 14, strokeWidth], "step", {
steps,
strokeWidth
});
const unitWidth = width / steps;
const styledSteps = Array.from({ length: steps });
const mergedRailColor = railColor ?? trailColor;
for (let i = 0; i < steps; i++) {
const color = Array.isArray(strokeColor) ? strokeColor[i] : strokeColor;
styledSteps[i] = /* @__PURE__ */ import_react.createElement("div", {
key: i,
className: clsx(`${prefixCls}-steps-item`, { [`${prefixCls}-steps-item-active`]: i <= current - 1 }, classNames.track),
style: {
backgroundColor: i <= current - 1 ? color : mergedRailColor,
width: unitWidth,
height,
...styles.track
}
});
}
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-steps-body`, classNames.body),
style: styles.body
}, styledSteps, children);
};
//#endregion
//#region node_modules/antd/es/progress/progress.js
var ProgressStatuses = [
"normal",
"exception",
"active",
"success"
];
var Progress = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, rootClassName, classNames, styles, steps, strokeColor, percent = 0, size = "medium", showInfo = true, type = "line", status, format, style, percentPosition = {}, ...restProps } = props;
const { align: infoAlign = "end", type: infoPosition = "outer" } = percentPosition;
const strokeColorNotArray = Array.isArray(strokeColor) ? strokeColor[0] : strokeColor;
const strokeColorNotGradient = typeof strokeColor === "string" || Array.isArray(strokeColor) ? strokeColor : void 0;
const strokeColorIsBright = import_react.useMemo(() => {
if (strokeColorNotArray) return new FastColor(typeof strokeColorNotArray === "string" ? strokeColorNotArray : Object.values(strokeColorNotArray)[0]).isLight();
return false;
}, [strokeColor]);
const percentNumber = import_react.useMemo(() => {
const successPercent = getSuccessPercent(props);
return Number.parseInt(successPercent !== void 0 ? (successPercent ?? 0)?.toString() : (percent ?? 0)?.toString(), 10);
}, [percent, props.success]);
const progressStatus = import_react.useMemo(() => {
if (!ProgressStatuses.includes(status) && percentNumber >= 100) return "success";
return status || "normal";
}, [status, percentNumber]);
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("progress");
const prefixCls = getPrefixCls("progress", customizePrefixCls);
const [hashId, cssVarCls] = style_default$15(prefixCls);
const mergedProps = {
...props,
percent,
type,
size,
showInfo,
percentPosition
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const isLineType = type === "line";
const isPureLineType = isLineType && !steps;
const progressInfo = import_react.useMemo(() => {
if (!showInfo) return null;
const successPercent = getSuccessPercent(props);
let text;
const textFormatter = format || ((number) => `${number}%`);
const isBrightInnerColor = isLineType && strokeColorIsBright && infoPosition === "inner";
if (infoPosition === "inner" || format || progressStatus !== "exception" && progressStatus !== "success") text = textFormatter(validProgress(percent), validProgress(successPercent));
else if (progressStatus === "exception") text = isLineType ? /* @__PURE__ */ import_react.createElement(RefIcon$3, null) : /* @__PURE__ */ import_react.createElement(RefIcon, null);
else if (progressStatus === "success") text = isLineType ? /* @__PURE__ */ import_react.createElement(RefIcon$1, null) : /* @__PURE__ */ import_react.createElement(RefIcon$9, null);
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-indicator`, {
[`${prefixCls}-indicator-bright`]: isBrightInnerColor,
[`${prefixCls}-indicator-${infoAlign}`]: isPureLineType,
[`${prefixCls}-indicator-${infoPosition}`]: isPureLineType
}, mergedClassNames.indicator),
style: mergedStyles.indicator,
title: typeof text === "string" ? text : void 0
}, text);
}, [
showInfo,
percent,
percentNumber,
progressStatus,
type,
prefixCls,
format,
isLineType,
strokeColorIsBright,
infoPosition,
infoAlign,
isPureLineType,
mergedClassNames.indicator,
mergedStyles.indicator
]);
{
const warning = devUseWarning("Progress");
[
["width", "size"],
["trailColor", "railColor"],
["gapPosition", "gapPlacement"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
if (type === "circle" || type === "dashboard") {
if (Array.isArray(size)) warning(false, "usage", "Type \"circle\" and \"dashboard\" do not accept array as `size`, please use number or preset size instead.");
else if (isPlainObject(size)) warning(false, "usage", "Type \"circle\" and \"dashboard\" do not accept object as `size`, please use number or preset size instead.");
}
warning.deprecated(size !== "default", "size=\"default\"", "size=\"medium\"");
}
const sharedProps = {
...props,
classNames: mergedClassNames,
styles: mergedStyles
};
let progress;
if (type === "line") progress = steps ? /* @__PURE__ */ import_react.createElement(Steps$2, {
...sharedProps,
strokeColor: strokeColorNotGradient,
prefixCls,
steps: isPlainObject(steps) ? steps.count : steps
}, progressInfo) : /* @__PURE__ */ import_react.createElement(Line, {
...sharedProps,
strokeColor: strokeColorNotArray,
prefixCls,
direction,
percentPosition: {
align: infoAlign,
type: infoPosition
}
}, progressInfo);
else if (type === "circle" || type === "dashboard") progress = /* @__PURE__ */ import_react.createElement(Circle, {
...sharedProps,
strokeColor: strokeColorNotArray,
prefixCls,
progressStatus
}, progressInfo);
const classString = clsx(prefixCls, `${prefixCls}-status-${progressStatus}`, {
[`${prefixCls}-${type === "dashboard" && "circle" || type}`]: type !== "line",
[`${prefixCls}-inline-circle`]: type === "circle" && getSize(size, "circle")[0] <= 20,
[`${prefixCls}-line`]: isPureLineType,
[`${prefixCls}-line-align-${infoAlign}`]: isPureLineType,
[`${prefixCls}-line-position-${infoPosition}`]: isPureLineType,
[`${prefixCls}-steps`]: steps,
[`${prefixCls}-show-info`]: showInfo,
[`${prefixCls}-small`]: size === "small",
[`${prefixCls}-rtl`]: direction === "rtl"
}, contextClassName, className, rootClassName, mergedClassNames.root, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement("div", {
ref,
style: {
...contextStyle,
...mergedStyles.root,
...style
},
className: classString,
role: "progressbar",
"aria-valuenow": percentNumber,
"aria-valuemin": 0,
"aria-valuemax": 100,
...omit(restProps, [
"railColor",
"trailColor",
"strokeWidth",
"width",
"gapDegree",
"gapPosition",
"gapPlacement",
"strokeLinecap",
"success"
])
}, progress);
});
Progress.displayName = "Progress";
//#endregion
//#region node_modules/antd/es/progress/index.js
var progress_default = Progress;
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js
function _createForOfIteratorHelper(r, e) {
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (!t) {
if (Array.isArray(r) || (t = _unsupportedIterableToArray$34(r)) || e && r && "number" == typeof r.length) {
t && (r = t);
var _n = 0, F = function F() {};
return {
s: F,
n: function n() {
return _n >= r.length ? { done: !0 } : {
done: !1,
value: r[_n++]
};
},
e: function e(r) {
throw r;
},
f: F
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var o, a = !0, u = !1;
return {
s: function s() {
t = t.call(r);
},
n: function n() {
var r = t.next();
return a = r.done, r;
},
e: function e(r) {
u = !0, o = r;
},
f: function f() {
try {
a || null == t["return"] || t["return"]();
} finally {
if (u) throw o;
}
}
};
}
//#endregion
//#region node_modules/@rc-component/qrcode/es/libs/qrcodegen.js
var _class, _class2;
function appendBits(val, len, bb) {
if (len < 0 || len > 31 || val >>> len != 0) throw new RangeError("Value out of range");
for (var i = len - 1; i >= 0; i--) bb.push(val >>> i & 1);
}
function getBit(x, i) {
return (x >>> i & 1) != 0;
}
function assert(cond) {
if (!cond) throw new Error("Assertion error");
}
var Mode = /* @__PURE__ */ function() {
function Mode(modeBits, numBitsCharCount) {
_classCallCheck$1(this, Mode);
_defineProperty$28(this, "modeBits", void 0);
_defineProperty$28(this, "numBitsCharCount", void 0);
this.modeBits = modeBits;
this.numBitsCharCount = numBitsCharCount;
}
_createClass$1(Mode, [{
key: "numCharCountBits",
value: function numCharCountBits(ver) {
return this.numBitsCharCount[Math.floor((ver + 7) / 17)];
}
}]);
return Mode;
}();
_class = Mode;
_defineProperty$28(Mode, "NUMERIC", new _class(1, [
10,
12,
14
]));
_defineProperty$28(Mode, "ALPHANUMERIC", new _class(2, [
9,
11,
13
]));
_defineProperty$28(Mode, "BYTE", new _class(4, [
8,
16,
16
]));
_defineProperty$28(Mode, "KANJI", new _class(8, [
8,
10,
12
]));
_defineProperty$28(Mode, "ECI", new _class(7, [
0,
0,
0
]));
var Ecc = /* @__PURE__ */ _createClass$1(function Ecc(ordinal, formatBits) {
_classCallCheck$1(this, Ecc);
_defineProperty$28(this, "ordinal", void 0);
_defineProperty$28(this, "formatBits", void 0);
this.ordinal = ordinal;
this.formatBits = formatBits;
});
_class2 = Ecc;
_defineProperty$28(Ecc, "LOW", new _class2(0, 1));
_defineProperty$28(Ecc, "MEDIUM", new _class2(1, 0));
_defineProperty$28(Ecc, "QUARTILE", new _class2(2, 3));
_defineProperty$28(Ecc, "HIGH", new _class2(3, 2));
var QrSegment = /* @__PURE__ */ function() {
function QrSegment(mode, numChars, bitData) {
_classCallCheck$1(this, QrSegment);
_defineProperty$28(this, "mode", void 0);
_defineProperty$28(this, "numChars", void 0);
_defineProperty$28(this, "bitData", void 0);
this.mode = mode;
this.numChars = numChars;
this.bitData = bitData;
if (numChars < 0) throw new RangeError("Invalid argument");
this.bitData = bitData.slice();
}
_createClass$1(QrSegment, [{
key: "getData",
value: function getData() {
return this.bitData.slice();
}
}], [
{
key: "makeBytes",
value: function makeBytes(data) {
var bb = [];
var _iterator = _createForOfIteratorHelper(data), _step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var b = _step.value;
appendBits(b, 8, bb);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return new QrSegment(Mode.BYTE, data.length, bb);
}
},
{
key: "makeNumeric",
value: function makeNumeric(digits) {
if (!QrSegment.isNumeric(digits)) throw new RangeError("String contains non-numeric characters");
var bb = [];
for (var i = 0; i < digits.length;) {
var n = Math.min(digits.length - i, 3);
appendBits(parseInt(digits.substring(i, i + n), 10), n * 3 + 1, bb);
i += n;
}
return new QrSegment(Mode.NUMERIC, digits.length, bb);
}
},
{
key: "makeAlphanumeric",
value: function makeAlphanumeric(text) {
if (!QrSegment.isAlphanumeric(text)) throw new RangeError("String contains unencodable characters in alphanumeric mode");
var bb = [];
var i;
for (i = 0; i + 2 <= text.length; i += 2) {
var temp = QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;
temp += QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));
appendBits(temp, 11, bb);
}
if (i < text.length) appendBits(QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);
return new QrSegment(Mode.ALPHANUMERIC, text.length, bb);
}
},
{
key: "makeSegments",
value: function makeSegments(text) {
if (text == "") return [];
else if (QrSegment.isNumeric(text)) return [QrSegment.makeNumeric(text)];
else if (QrSegment.isAlphanumeric(text)) return [QrSegment.makeAlphanumeric(text)];
else return [QrSegment.makeBytes(QrSegment.toUtf8ByteArray(text))];
}
},
{
key: "makeEci",
value: function makeEci(assignVal) {
var bb = [];
if (assignVal < 0) throw new RangeError("ECI assignment value out of range");
else if (assignVal < 128) appendBits(assignVal, 8, bb);
else if (assignVal < 16384) {
appendBits(2, 2, bb);
appendBits(assignVal, 14, bb);
} else if (assignVal < 1e6) {
appendBits(6, 3, bb);
appendBits(assignVal, 21, bb);
} else throw new RangeError("ECI assignment value out of range");
return new QrSegment(Mode.ECI, 0, bb);
}
},
{
key: "isNumeric",
value: function isNumeric(text) {
return QrSegment.NUMERIC_REGEX.test(text);
}
},
{
key: "isAlphanumeric",
value: function isAlphanumeric(text) {
return QrSegment.ALPHANUMERIC_REGEX.test(text);
}
},
{
key: "getTotalBits",
value: function getTotalBits(segs, version) {
var result = 0;
var _iterator2 = _createForOfIteratorHelper(segs), _step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var seg = _step2.value;
var ccbits = seg.mode.numCharCountBits(version);
if (seg.numChars >= 1 << ccbits) return Infinity;
result += 4 + ccbits + seg.bitData.length;
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
return result;
}
},
{
key: "toUtf8ByteArray",
value: function toUtf8ByteArray(input) {
var str = encodeURI(input);
var result = [];
for (var i = 0; i < str.length; i++) if (str.charAt(i) != "%") result.push(str.charCodeAt(i));
else {
result.push(parseInt(str.substring(i + 1, i + 3), 16));
i += 2;
}
return result;
}
}
]);
return QrSegment;
}();
_defineProperty$28(QrSegment, "NUMERIC_REGEX", /^[0-9]*$/);
_defineProperty$28(QrSegment, "ALPHANUMERIC_REGEX", /^[A-Z0-9 $%*+.\/:-]*$/);
_defineProperty$28(QrSegment, "ALPHANUMERIC_CHARSET", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:");
var QrCode = /* @__PURE__ */ function() {
function QrCode(version, errorCorrectionLevel, dataCodewords, oriMsk) {
_classCallCheck$1(this, QrCode);
_defineProperty$28(this, "size", void 0);
_defineProperty$28(this, "mask", void 0);
_defineProperty$28(this, "modules", []);
_defineProperty$28(this, "isFunction", []);
_defineProperty$28(this, "version", void 0);
_defineProperty$28(this, "errorCorrectionLevel", void 0);
var msk = oriMsk;
this.version = version;
this.errorCorrectionLevel = errorCorrectionLevel;
if (version < QrCode.MIN_VERSION || version > QrCode.MAX_VERSION) throw new RangeError("Version value out of range");
if (msk < -1 || msk > 7) throw new RangeError("Mask value out of range");
this.size = version * 4 + 17;
var row = [];
for (var i = 0; i < this.size; i++) row.push(false);
for (var _i = 0; _i < this.size; _i++) {
this.modules.push(row.slice());
this.isFunction.push(row.slice());
}
this.drawFunctionPatterns();
var allCodewords = this.addEccAndInterleave(dataCodewords);
this.drawCodewords(allCodewords);
if (msk == -1) {
var minPenalty = 1e9;
for (var _i2 = 0; _i2 < 8; _i2++) {
this.applyMask(_i2);
this.drawFormatBits(_i2);
var penalty = this.getPenaltyScore();
if (penalty < minPenalty) {
msk = _i2;
minPenalty = penalty;
}
this.applyMask(_i2);
}
}
assert(0 <= msk && msk <= 7);
this.mask = msk;
this.applyMask(msk);
this.drawFormatBits(msk);
this.isFunction = [];
}
_createClass$1(QrCode, [
{
key: "getModule",
value: function getModule(x, y) {
return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];
}
},
{
key: "getModules",
value: function getModules() {
return this.modules;
}
},
{
key: "drawFunctionPatterns",
value: function drawFunctionPatterns() {
for (var i = 0; i < this.size; i++) {
this.setFunctionModule(6, i, i % 2 == 0);
this.setFunctionModule(i, 6, i % 2 == 0);
}
this.drawFinderPattern(3, 3);
this.drawFinderPattern(this.size - 4, 3);
this.drawFinderPattern(3, this.size - 4);
var alignPatPos = this.getAlignmentPatternPositions();
var numAlign = alignPatPos.length;
for (var _i3 = 0; _i3 < numAlign; _i3++) for (var j = 0; j < numAlign; j++) if (!(_i3 == 0 && j == 0 || _i3 == 0 && j == numAlign - 1 || _i3 == numAlign - 1 && j == 0)) this.drawAlignmentPattern(alignPatPos[_i3], alignPatPos[j]);
this.drawFormatBits(0);
this.drawVersion();
}
},
{
key: "drawFormatBits",
value: function drawFormatBits(mask) {
var data = this.errorCorrectionLevel.formatBits << 3 | mask;
var rem = data;
for (var i = 0; i < 10; i++) rem = rem << 1 ^ (rem >>> 9) * 1335;
var bits = (data << 10 | rem) ^ 21522;
assert(bits >>> 15 == 0);
for (var _i4 = 0; _i4 <= 5; _i4++) this.setFunctionModule(8, _i4, getBit(bits, _i4));
this.setFunctionModule(8, 7, getBit(bits, 6));
this.setFunctionModule(8, 8, getBit(bits, 7));
this.setFunctionModule(7, 8, getBit(bits, 8));
for (var _i5 = 9; _i5 < 15; _i5++) this.setFunctionModule(14 - _i5, 8, getBit(bits, _i5));
for (var _i6 = 0; _i6 < 8; _i6++) this.setFunctionModule(this.size - 1 - _i6, 8, getBit(bits, _i6));
for (var _i7 = 8; _i7 < 15; _i7++) this.setFunctionModule(8, this.size - 15 + _i7, getBit(bits, _i7));
this.setFunctionModule(8, this.size - 8, true);
}
},
{
key: "drawVersion",
value: function drawVersion() {
if (this.version < 7) return;
var rem = this.version;
for (var i = 0; i < 12; i++) rem = rem << 1 ^ (rem >>> 11) * 7973;
var bits = this.version << 12 | rem;
assert(bits >>> 18 == 0);
for (var _i8 = 0; _i8 < 18; _i8++) {
var color = getBit(bits, _i8);
var a = this.size - 11 + _i8 % 3;
var b = Math.floor(_i8 / 3);
this.setFunctionModule(a, b, color);
this.setFunctionModule(b, a, color);
}
}
},
{
key: "drawFinderPattern",
value: function drawFinderPattern(x, y) {
for (var dy = -4; dy <= 4; dy++) for (var dx = -4; dx <= 4; dx++) {
var dist = Math.max(Math.abs(dx), Math.abs(dy));
var xx = x + dx;
var yy = y + dy;
if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size) this.setFunctionModule(xx, yy, dist != 2 && dist != 4);
}
}
},
{
key: "drawAlignmentPattern",
value: function drawAlignmentPattern(x, y) {
for (var dy = -2; dy <= 2; dy++) for (var dx = -2; dx <= 2; dx++) this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);
}
},
{
key: "setFunctionModule",
value: function setFunctionModule(x, y, isDark) {
this.modules[y][x] = isDark;
this.isFunction[y][x] = true;
}
},
{
key: "addEccAndInterleave",
value: function addEccAndInterleave(data) {
var ver = this.version;
var ecl = this.errorCorrectionLevel;
if (data.length != QrCode.getNumDataCodewords(ver, ecl)) throw new RangeError("Invalid argument");
var numBlocks = QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
var blockEccLen = QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];
var rawCodewords = Math.floor(QrCode.getNumRawDataModules(ver) / 8);
var numShortBlocks = numBlocks - rawCodewords % numBlocks;
var shortBlockLen = Math.floor(rawCodewords / numBlocks);
var blocks = [];
var rsDiv = QrCode.reedSolomonComputeDivisor(blockEccLen);
for (var i = 0, k = 0; i < numBlocks; i++) {
var dat = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));
k += dat.length;
var ecc = QrCode.reedSolomonComputeRemainder(dat, rsDiv);
if (i < numShortBlocks) dat.push(0);
blocks.push(dat.concat(ecc));
}
var result = [];
var _loop = function _loop(_i9) {
blocks.forEach(function(block, j) {
if (_i9 != shortBlockLen - blockEccLen || j >= numShortBlocks) result.push(block[_i9]);
});
};
for (var _i9 = 0; _i9 < blocks[0].length; _i9++) _loop(_i9);
assert(result.length == rawCodewords);
return result;
}
},
{
key: "drawCodewords",
value: function drawCodewords(data) {
if (data.length != Math.floor(QrCode.getNumRawDataModules(this.version) / 8)) throw new RangeError("Invalid argument");
var i = 0;
for (var right = this.size - 1; right >= 1; right -= 2) {
if (right == 6) right = 5;
for (var vert = 0; vert < this.size; vert++) for (var j = 0; j < 2; j++) {
var x = right - j;
var y = (right + 1 & 2) == 0 ? this.size - 1 - vert : vert;
if (!this.isFunction[y][x] && i < data.length * 8) {
this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));
i++;
}
}
}
assert(i == data.length * 8);
}
},
{
key: "applyMask",
value: function applyMask(mask) {
if (mask < 0 || mask > 7) throw new RangeError("Mask value out of range");
for (var y = 0; y < this.size; y++) for (var x = 0; x < this.size; x++) {
var invert = void 0;
switch (mask) {
case 0:
invert = (x + y) % 2 == 0;
break;
case 1:
invert = y % 2 == 0;
break;
case 2:
invert = x % 3 == 0;
break;
case 3:
invert = (x + y) % 3 == 0;
break;
case 4:
invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;
break;
case 5:
invert = x * y % 2 + x * y % 3 == 0;
break;
case 6:
invert = (x * y % 2 + x * y % 3) % 2 == 0;
break;
case 7:
invert = ((x + y) % 2 + x * y % 3) % 2 == 0;
break;
default: throw new Error("Unreachable");
}
if (!this.isFunction[y][x] && invert) this.modules[y][x] = !this.modules[y][x];
}
}
},
{
key: "getPenaltyScore",
value: function getPenaltyScore() {
var result = 0;
for (var y = 0; y < this.size; y++) {
var runColor = false;
var runX = 0;
var runHistory = [
0,
0,
0,
0,
0,
0,
0
];
for (var x = 0; x < this.size; x++) if (this.modules[y][x] == runColor) {
runX++;
if (runX == 5) result += QrCode.PENALTY_N1;
else if (runX > 5) result++;
} else {
this.finderPenaltyAddHistory(runX, runHistory);
if (!runColor) result += this.finderPenaltyCountPatterns(runHistory) * QrCode.PENALTY_N3;
runColor = this.modules[y][x];
runX = 1;
}
result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * QrCode.PENALTY_N3;
}
for (var _x = 0; _x < this.size; _x++) {
var _runColor = false;
var runY = 0;
var _runHistory = [
0,
0,
0,
0,
0,
0,
0
];
for (var _y = 0; _y < this.size; _y++) if (this.modules[_y][_x] == _runColor) {
runY++;
if (runY == 5) result += QrCode.PENALTY_N1;
else if (runY > 5) result++;
} else {
this.finderPenaltyAddHistory(runY, _runHistory);
if (!_runColor) result += this.finderPenaltyCountPatterns(_runHistory) * QrCode.PENALTY_N3;
_runColor = this.modules[_y][_x];
runY = 1;
}
result += this.finderPenaltyTerminateAndCount(_runColor, runY, _runHistory) * QrCode.PENALTY_N3;
}
for (var _y2 = 0; _y2 < this.size - 1; _y2++) for (var _x2 = 0; _x2 < this.size - 1; _x2++) {
var color = this.modules[_y2][_x2];
if (color == this.modules[_y2][_x2 + 1] && color == this.modules[_y2 + 1][_x2] && color == this.modules[_y2 + 1][_x2 + 1]) result += QrCode.PENALTY_N2;
}
var dark = 0;
var _iterator3 = _createForOfIteratorHelper(this.modules), _step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) dark = _step3.value.reduce(function(sum, color) {
return sum + (color ? 1 : 0);
}, dark);
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
var total = this.size * this.size;
var k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;
assert(0 <= k && k <= 9);
result += k * QrCode.PENALTY_N4;
assert(0 <= result && result <= 2568888);
return result;
}
},
{
key: "getAlignmentPatternPositions",
value: function getAlignmentPatternPositions() {
if (this.version == 1) return [];
else {
var numAlign = Math.floor(this.version / 7) + 2;
var step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;
var result = [6];
for (var pos = this.size - 7; result.length < numAlign; pos -= step) result.splice(1, 0, pos);
return result;
}
}
},
{
key: "finderPenaltyCountPatterns",
value: function finderPenaltyCountPatterns(runHistory) {
var n = runHistory[1];
assert(n <= this.size * 3);
var core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;
return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);
}
},
{
key: "finderPenaltyTerminateAndCount",
value: function finderPenaltyTerminateAndCount(currentRunColor, oriCurrentRunLength, runHistory) {
var currentRunLength = oriCurrentRunLength;
if (currentRunColor) {
this.finderPenaltyAddHistory(currentRunLength, runHistory);
currentRunLength = 0;
}
currentRunLength += this.size;
this.finderPenaltyAddHistory(currentRunLength, runHistory);
return this.finderPenaltyCountPatterns(runHistory);
}
},
{
key: "finderPenaltyAddHistory",
value: function finderPenaltyAddHistory(oriCurrentRunLength, runHistory) {
var currentRunLength = oriCurrentRunLength;
if (runHistory[0] == 0) currentRunLength += this.size;
runHistory.pop();
runHistory.unshift(currentRunLength);
}
}
], [
{
key: "encodeText",
value: function encodeText(text, ecl) {
var segs = QrSegment.makeSegments(text);
return QrCode.encodeSegments(segs, ecl);
}
},
{
key: "encodeBinary",
value: function encodeBinary(data, ecl) {
var seg = QrSegment.makeBytes(data);
return QrCode.encodeSegments([seg], ecl);
}
},
{
key: "encodeSegments",
value: function encodeSegments(segs, oriEcl) {
var minVersion = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
var maxVersion = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 40;
var mask = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
var boostEcl = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true;
if (!(QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= QrCode.MAX_VERSION) || mask < -1 || mask > 7) throw new RangeError("Invalid value");
var version;
var dataUsedBits;
for (version = minVersion;; version++) {
var _dataCapacityBits = QrCode.getNumDataCodewords(version, oriEcl) * 8;
var usedBits = QrSegment.getTotalBits(segs, version);
if (usedBits <= _dataCapacityBits) {
dataUsedBits = usedBits;
break;
}
if (version >= maxVersion) throw new RangeError("Data too long");
}
var ecl = oriEcl;
for (var _i10 = 0, _arr = [
Ecc.MEDIUM,
Ecc.QUARTILE,
Ecc.HIGH
]; _i10 < _arr.length; _i10++) {
var newEcl = _arr[_i10];
if (boostEcl && dataUsedBits <= QrCode.getNumDataCodewords(version, newEcl) * 8) ecl = newEcl;
}
var bb = [];
var _iterator4 = _createForOfIteratorHelper(segs), _step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
var seg = _step4.value;
appendBits(seg.mode.modeBits, 4, bb);
appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);
var _iterator5 = _createForOfIteratorHelper(seg.getData()), _step5;
try {
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
var b = _step5.value;
bb.push(b);
}
} catch (err) {
_iterator5.e(err);
} finally {
_iterator5.f();
}
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
assert(bb.length == dataUsedBits);
var dataCapacityBits = QrCode.getNumDataCodewords(version, ecl) * 8;
assert(bb.length <= dataCapacityBits);
appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);
appendBits(0, (8 - bb.length % 8) % 8, bb);
assert(bb.length % 8 == 0);
for (var padByte = 236; bb.length < dataCapacityBits; padByte ^= 253) appendBits(padByte, 8, bb);
var dataCodewords = [];
while (dataCodewords.length * 8 < bb.length) dataCodewords.push(0);
bb.forEach(function(b, i) {
dataCodewords[i >>> 3] |= b << 7 - (i & 7);
});
return new QrCode(version, ecl, dataCodewords, mask);
}
},
{
key: "getNumRawDataModules",
value: function getNumRawDataModules(ver) {
if (ver < QrCode.MIN_VERSION || ver > QrCode.MAX_VERSION) throw new RangeError("Version number out of range");
var result = (16 * ver + 128) * ver + 64;
if (ver >= 2) {
var numAlign = Math.floor(ver / 7) + 2;
result -= (25 * numAlign - 10) * numAlign - 55;
if (ver >= 7) result -= 36;
}
assert(208 <= result && result <= 29648);
return result;
}
},
{
key: "getNumDataCodewords",
value: function getNumDataCodewords(ver, ecl) {
return Math.floor(QrCode.getNumRawDataModules(ver) / 8) - QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];
}
},
{
key: "reedSolomonComputeDivisor",
value: function reedSolomonComputeDivisor(degree) {
if (degree < 1 || degree > 255) throw new RangeError("Degree out of range");
var result = [];
for (var i = 0; i < degree - 1; i++) result.push(0);
result.push(1);
var root = 1;
for (var _i11 = 0; _i11 < degree; _i11++) {
for (var j = 0; j < result.length; j++) {
result[j] = QrCode.reedSolomonMultiply(result[j], root);
if (j + 1 < result.length) result[j] ^= result[j + 1];
}
root = QrCode.reedSolomonMultiply(root, 2);
}
return result;
}
},
{
key: "reedSolomonComputeRemainder",
value: function reedSolomonComputeRemainder(data, divisor) {
var result = divisor.map(function() {
return 0;
});
var _iterator6 = _createForOfIteratorHelper(data), _step6;
try {
var _loop2 = function _loop2() {
var factor = _step6.value ^ result.shift();
result.push(0);
divisor.forEach(function(coef, i) {
result[i] ^= QrCode.reedSolomonMultiply(coef, factor);
});
};
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) _loop2();
} catch (err) {
_iterator6.e(err);
} finally {
_iterator6.f();
}
return result;
}
},
{
key: "reedSolomonMultiply",
value: function reedSolomonMultiply(x, y) {
if (x >>> 8 != 0 || y >>> 8 != 0) throw new RangeError("Byte out of range");
var z = 0;
for (var i = 7; i >= 0; i--) {
z = z << 1 ^ (z >>> 7) * 285;
z ^= (y >>> i & 1) * x;
}
assert(z >>> 8 == 0);
return z;
}
}
]);
return QrCode;
}();
_defineProperty$28(QrCode, "MIN_VERSION", 1);
_defineProperty$28(QrCode, "MAX_VERSION", 40);
_defineProperty$28(QrCode, "PENALTY_N1", 3);
_defineProperty$28(QrCode, "PENALTY_N2", 3);
_defineProperty$28(QrCode, "PENALTY_N3", 40);
_defineProperty$28(QrCode, "PENALTY_N4", 10);
_defineProperty$28(QrCode, "ECC_CODEWORDS_PER_BLOCK", [
[
-1,
7,
10,
15,
20,
26,
18,
20,
24,
30,
18,
20,
24,
26,
30,
22,
24,
28,
30,
28,
28,
28,
28,
30,
30,
26,
28,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30
],
[
-1,
10,
16,
26,
18,
24,
16,
18,
22,
22,
26,
30,
22,
22,
24,
24,
28,
28,
26,
26,
26,
26,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28,
28
],
[
-1,
13,
22,
18,
26,
18,
24,
18,
22,
20,
24,
28,
26,
24,
20,
30,
24,
28,
28,
26,
30,
28,
30,
30,
30,
30,
28,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30
],
[
-1,
17,
28,
22,
16,
22,
28,
26,
26,
24,
28,
24,
28,
22,
24,
24,
30,
28,
28,
26,
28,
30,
24,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30,
30
]
]);
_defineProperty$28(QrCode, "NUM_ERROR_CORRECTION_BLOCKS", [
[
-1,
1,
1,
1,
1,
1,
2,
2,
2,
2,
4,
4,
4,
4,
4,
6,
6,
6,
6,
7,
8,
8,
9,
9,
10,
12,
12,
12,
13,
14,
15,
16,
17,
18,
19,
19,
20,
21,
22,
24,
25
],
[
-1,
1,
1,
1,
2,
2,
4,
4,
4,
5,
5,
5,
8,
9,
9,
10,
10,
11,
13,
14,
16,
17,
17,
18,
20,
21,
23,
25,
26,
28,
29,
31,
33,
35,
37,
38,
40,
43,
45,
47,
49
],
[
-1,
1,
1,
2,
2,
4,
4,
6,
6,
8,
8,
8,
10,
12,
16,
12,
17,
16,
18,
21,
20,
23,
23,
25,
27,
29,
34,
34,
35,
38,
40,
43,
45,
48,
51,
53,
56,
59,
62,
65,
68
],
[
-1,
1,
1,
2,
4,
4,
4,
5,
6,
8,
8,
11,
11,
16,
16,
18,
16,
19,
21,
25,
25,
25,
34,
30,
32,
35,
37,
40,
42,
45,
48,
51,
54,
57,
60,
63,
66,
70,
74,
77,
81
]
]);
//#endregion
//#region node_modules/@rc-component/qrcode/es/utils.js
var ERROR_LEVEL_MAP = {
L: Ecc.LOW,
M: Ecc.MEDIUM,
Q: Ecc.QUARTILE,
H: Ecc.HIGH
};
var DEFAULT_BACKGROUND_COLOR = "#FFFFFF";
var DEFAULT_FRONT_COLOR = "#000000";
var DEFAULT_IMG_SCALE = .1;
/**
* Generate a path string from modules
* @param modules
* @param margin
* @returns
*/
var generatePath = function generatePath(modules) {
var margin = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
var ops = [];
modules.forEach(function(row, y) {
var start = null;
row.forEach(function(cell, x) {
if (!cell && start !== null) {
ops.push("M".concat(start + margin, " ").concat(y + margin, "h").concat(x - start, "v1H").concat(start + margin, "z"));
start = null;
return;
}
if (x === row.length - 1) {
if (!cell) return;
if (start === null) ops.push("M".concat(x + margin, ",").concat(y + margin, " h1v1H").concat(x + margin, "z"));
else ops.push("M".concat(start + margin, ",").concat(y + margin, " h").concat(x + 1 - start, "v1H").concat(start + margin, "z"));
return;
}
if (cell && start === null) start = x;
});
});
return ops.join("");
};
/**
* Excavate modules
* @param modules
* @param excavation
* @returns
*/
var excavateModules = function excavateModules(modules, excavation) {
return modules.slice().map(function(row, y) {
if (y < excavation.y || y >= excavation.y + excavation.h) return row;
return row.map(function(cell, x) {
if (x < excavation.x || x >= excavation.x + excavation.w) return cell;
return false;
});
});
};
/**
* Get image settings
* @param cells The modules of the QR code
* @param size The size of the QR code
* @param margin
* @param imageSettings
* @returns
*/
var getImageSettings = function getImageSettings(cells, size, margin, imageSettings) {
if (imageSettings == null) return null;
var numCells = cells.length + margin * 2;
var defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);
var scale = numCells / size;
var w = (imageSettings.width || defaultSize) * scale;
var h = (imageSettings.height || defaultSize) * scale;
var x = imageSettings.x == null ? cells.length / 2 - w / 2 : imageSettings.x * scale;
var y = imageSettings.y == null ? cells.length / 2 - h / 2 : imageSettings.y * scale;
var opacity = imageSettings.opacity == null ? 1 : imageSettings.opacity;
var excavation = null;
if (imageSettings.excavate) {
var floorX = Math.floor(x);
var floorY = Math.floor(y);
excavation = {
x: floorX,
y: floorY,
w: Math.ceil(w + x - floorX),
h: Math.ceil(h + y - floorY)
};
}
var crossOrigin = imageSettings.crossOrigin;
return {
x,
y,
h,
w,
excavation,
opacity,
crossOrigin
};
};
/**
* Get margin size
* @param needMargin Whether need margin
* @param marginSize Custom margin size
* @returns
*/
var getMarginSize = function getMarginSize(needMargin, marginSize) {
if (marginSize != null) return Math.max(Math.floor(marginSize), 0);
return needMargin ? 4 : 0;
};
/**
* Check if Path2D is supported
*/
var isSupportPath2d = function() {
try {
new Path2D().addPath(new Path2D());
} catch (_unused) {
return false;
}
return true;
}();
//#endregion
//#region node_modules/@rc-component/qrcode/es/hooks/useQRCode.js
var useQRCode = function useQRCode(opt) {
var value = opt.value, level = opt.level, minVersion = opt.minVersion, includeMargin = opt.includeMargin, marginSize = opt.marginSize, imageSettings = opt.imageSettings, size = opt.size, boostLevel = opt.boostLevel;
var memoizedQrcode = import_react.useMemo(function() {
var segments = (Array.isArray(value) ? value : [value]).reduce(function(acc, val) {
acc.push.apply(acc, _toConsumableArray$8(QrSegment.makeSegments(val)));
return acc;
}, []);
return QrCode.encodeSegments(segments, ERROR_LEVEL_MAP[level], minVersion, void 0, void 0, boostLevel);
}, [
value,
level,
minVersion,
boostLevel
]);
return import_react.useMemo(function() {
var cs = memoizedQrcode.getModules();
var mg = getMarginSize(includeMargin, marginSize);
return {
cells: cs,
margin: mg,
numCells: cs.length + mg * 2,
calculatedImageSettings: getImageSettings(cs, size, mg, imageSettings),
qrcode: memoizedQrcode
};
}, [
memoizedQrcode,
size,
imageSettings,
includeMargin,
marginSize
]);
};
//#endregion
//#region node_modules/@rc-component/qrcode/es/QRCodeCanvas.js
var _excluded$1 = [
"value",
"size",
"level",
"bgColor",
"fgColor",
"includeMargin",
"minVersion",
"marginSize",
"style",
"imageSettings",
"boostLevel"
];
var QRCodeCanvas = /* @__PURE__ */ import_react.forwardRef(function(props, ref) {
var value = props.value, _props$size = props.size, size = _props$size === void 0 ? 128 : _props$size, _props$level = props.level, level = _props$level === void 0 ? "L" : _props$level, _props$bgColor = props.bgColor, bgColor = _props$bgColor === void 0 ? DEFAULT_BACKGROUND_COLOR : _props$bgColor, _props$fgColor = props.fgColor, fgColor = _props$fgColor === void 0 ? DEFAULT_FRONT_COLOR : _props$fgColor, _props$includeMargin = props.includeMargin, includeMargin = _props$includeMargin === void 0 ? false : _props$includeMargin, _props$minVersion = props.minVersion, minVersion = _props$minVersion === void 0 ? 1 : _props$minVersion, marginSize = props.marginSize, style = props.style, imageSettings = props.imageSettings, boostLevel = props.boostLevel, otherProps = _objectWithoutProperties(props, _excluded$1);
var imgSrc = imageSettings === null || imageSettings === void 0 ? void 0 : imageSettings.src;
var _canvas = import_react.useRef(null);
var _image = import_react.useRef(null);
var setCanvasRef = import_react.useCallback(function(node) {
_canvas.current = node;
if (typeof ref === "function") ref(node);
else if (ref) ref.current = node;
}, [ref]);
var setIsImageLoaded = _slicedToArray$31(import_react.useState(false), 2)[1];
var _useQRCode = useQRCode({
value,
level,
minVersion,
includeMargin,
marginSize,
imageSettings,
size,
boostLevel
}), margin = _useQRCode.margin, cells = _useQRCode.cells, numCells = _useQRCode.numCells, calculatedImageSettings = _useQRCode.calculatedImageSettings;
import_react.useEffect(function() {
if (_canvas.current) {
var canvas = _canvas.current;
var ctx = canvas.getContext("2d");
if (!ctx) return;
var cellsToDraw = cells;
var image = _image.current;
var haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0;
if (haveImageToRender) {
if (calculatedImageSettings.excavation != null) cellsToDraw = excavateModules(cells, calculatedImageSettings.excavation);
}
var pixelRatio = window.devicePixelRatio || 1;
canvas.height = canvas.width = size * pixelRatio;
var scale = size / numCells * pixelRatio;
ctx.scale(scale, scale);
ctx.fillStyle = bgColor;
ctx.fillRect(0, 0, numCells, numCells);
ctx.fillStyle = fgColor;
if (isSupportPath2d) ctx.fill(new Path2D(generatePath(cellsToDraw, margin)));
else cells.forEach(function(row, rdx) {
row.forEach(function(cell, cdx) {
if (cell) ctx.fillRect(cdx + margin, rdx + margin, 1, 1);
});
});
if (calculatedImageSettings) ctx.globalAlpha = calculatedImageSettings.opacity;
if (haveImageToRender) ctx.drawImage(image, calculatedImageSettings.x + margin, calculatedImageSettings.y + margin, calculatedImageSettings.w, calculatedImageSettings.h);
}
});
import_react.useEffect(function() {
setIsImageLoaded(false);
}, [imgSrc]);
var canvasStyle = _objectSpread2({
height: size,
width: size
}, style);
var img = null;
if (imgSrc != null) img = /* @__PURE__ */ import_react.createElement("img", {
alt: "QR-Code",
src: imgSrc,
key: imgSrc,
style: { display: "none" },
onLoad: function onLoad() {
setIsImageLoaded(true);
},
ref: _image,
crossOrigin: calculatedImageSettings === null || calculatedImageSettings === void 0 ? void 0 : calculatedImageSettings.crossOrigin
});
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("canvas", _extends$91({
style: canvasStyle,
height: size,
width: size,
ref: setCanvasRef,
role: "img"
}, otherProps)), img);
});
QRCodeCanvas.displayName = "QRCodeCanvas";
//#endregion
//#region node_modules/@rc-component/qrcode/es/QRCodeSVG.js
var _excluded = [
"value",
"size",
"level",
"bgColor",
"fgColor",
"includeMargin",
"minVersion",
"title",
"marginSize",
"imageSettings",
"boostLevel"
];
var QRCodeSVG = /* @__PURE__ */ import_react.forwardRef(function(props, ref) {
var value = props.value, _props$size = props.size, size = _props$size === void 0 ? 128 : _props$size, _props$level = props.level, level = _props$level === void 0 ? "L" : _props$level, _props$bgColor = props.bgColor, bgColor = _props$bgColor === void 0 ? DEFAULT_BACKGROUND_COLOR : _props$bgColor, _props$fgColor = props.fgColor, fgColor = _props$fgColor === void 0 ? DEFAULT_FRONT_COLOR : _props$fgColor, _props$includeMargin = props.includeMargin, includeMargin = _props$includeMargin === void 0 ? false : _props$includeMargin, _props$minVersion = props.minVersion, minVersion = _props$minVersion === void 0 ? 1 : _props$minVersion, title = props.title, marginSize = props.marginSize, imageSettings = props.imageSettings, boostLevel = props.boostLevel, otherProps = _objectWithoutProperties(props, _excluded);
var _useQRCode = useQRCode({
value,
level,
minVersion,
includeMargin,
marginSize,
imageSettings,
size,
boostLevel
}), margin = _useQRCode.margin, cells = _useQRCode.cells, numCells = _useQRCode.numCells, calculatedImageSettings = _useQRCode.calculatedImageSettings;
var cellsToDraw = cells;
var image = null;
if (imageSettings != null && calculatedImageSettings != null) {
if (calculatedImageSettings.excavation != null) cellsToDraw = excavateModules(cells, calculatedImageSettings.excavation);
image = /* @__PURE__ */ import_react.createElement("image", {
href: imageSettings.src,
height: calculatedImageSettings.h,
width: calculatedImageSettings.w,
x: calculatedImageSettings.x + margin,
y: calculatedImageSettings.y + margin,
preserveAspectRatio: "none",
opacity: calculatedImageSettings.opacity,
crossOrigin: calculatedImageSettings.crossOrigin
});
}
var fgPath = generatePath(cellsToDraw, margin);
return /* @__PURE__ */ import_react.createElement("svg", _extends$91({
height: size,
width: size,
viewBox: "0 0 ".concat(numCells, " ").concat(numCells),
ref,
role: "img"
}, otherProps), !!title && /* @__PURE__ */ import_react.createElement("title", null, title), /* @__PURE__ */ import_react.createElement("path", {
fill: bgColor,
d: "M0,0 h".concat(numCells, "v").concat(numCells, "H0z"),
shapeRendering: "crispEdges"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: fgColor,
d: fgPath,
shapeRendering: "crispEdges"
}), image);
});
QRCodeSVG.displayName = "QRCodeSVG";
//#endregion
//#region node_modules/antd/es/qr-code/QrcodeStatus.js
var defaultSpin = /* @__PURE__ */ import_react.createElement(Spin, null);
function QRcodeStatus({ prefixCls, locale, onRefresh, statusRender, status }) {
const defaultNodes = {
expired: /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("p", { className: `${prefixCls}-expired` }, locale?.expired), onRefresh && /* @__PURE__ */ import_react.createElement(Button, {
type: "link",
icon: /* @__PURE__ */ import_react.createElement(RefIcon$31, null),
onClick: onRefresh
}, locale?.refresh)),
loading: defaultSpin,
scanned: /* @__PURE__ */ import_react.createElement("p", { className: `${prefixCls}-scanned` }, locale?.scanned)
};
const defaultStatusRender = (info) => defaultNodes[info.status];
return (statusRender ?? defaultStatusRender)({
status,
locale,
onRefresh
});
}
//#endregion
//#region node_modules/antd/es/qr-code/style/index.js
var genQRCodeStyle = (token) => {
const { componentCls, lineWidth, lineType, colorSplit } = token;
return {
[componentCls]: {
...resetComponent(token),
display: "flex",
justifyContent: "center",
alignItems: "center",
padding: token.paddingSM,
backgroundColor: token.colorWhite,
borderRadius: token.borderRadiusLG,
border: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
position: "relative",
overflow: "hidden",
[`& > ${componentCls}-cover`]: {
position: "absolute",
insetBlockStart: 0,
insetInlineStart: 0,
zIndex: 10,
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "100%",
color: token.colorText,
lineHeight: token.lineHeight,
background: token.QRCodeCoverBackgroundColor,
textAlign: "center",
[`& > ${componentCls}-expired, & > ${componentCls}-scanned`]: { color: token.QRCodeTextColor }
},
"> canvas": {
alignSelf: "stretch",
flex: "auto",
minWidth: 0
},
"&-icon": {
marginBlockEnd: token.marginXS,
fontSize: token.controlHeight
}
},
[`${componentCls}-borderless`]: {
borderColor: "transparent",
padding: 0,
borderRadius: 0
}
};
};
var prepareComponentToken$14 = (token) => ({ QRCodeCoverBackgroundColor: new FastColor(token.colorBgContainer).setA(.96).toRgbString() });
var style_default$14 = genStyleHooks("QRCode", (token) => {
return genQRCodeStyle(merge(token, { QRCodeTextColor: token.colorText }));
}, prepareComponentToken$14);
//#endregion
//#region node_modules/antd/es/qr-code/index.js
var QRCode = (props) => {
const [, token] = useToken$1();
const { value, type = "canvas", icon = "", size = 160, iconSize, color = token.colorText, errorLevel = "M", status = "active", bordered = true, onRefresh, style, className, rootClassName, prefixCls: customizePrefixCls, bgColor = "transparent", marginSize, statusRender, classNames, styles, boostLevel, ...rest } = props;
const { getPrefixCls, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("qrcode");
const mergedProps = {
...props,
bgColor,
type,
size,
status,
bordered,
errorLevel
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const prefixCls = getPrefixCls("qrcode", customizePrefixCls);
const [hashId, cssVarCls] = style_default$14(prefixCls);
const imageSettings = {
src: icon,
x: void 0,
y: void 0,
height: isNumber(iconSize) ? iconSize : iconSize?.height ?? 40,
width: isNumber(iconSize) ? iconSize : iconSize?.width ?? 40,
excavate: true,
crossOrigin: "anonymous"
};
const a11yProps = pickAttrs(rest, true);
const restProps = omit(rest, Object.keys(a11yProps));
const qrCodeProps = {
value,
size,
level: errorLevel,
bgColor,
fgColor: color,
style: {
width: style?.width,
height: style?.height
},
imageSettings: icon ? imageSettings : void 0,
marginSize,
boostLevel,
...a11yProps
};
const [locale] = useLocale$1("QRCode");
{
const warning = devUseWarning("QRCode");
warning(!!value, "usage", "need to receive `value` props");
warning(!(icon && errorLevel === "L"), "usage", "ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.");
}
if (!value) return null;
const rootClassNames = clsx(prefixCls, className, rootClassName, hashId, cssVarCls, contextClassName, mergedClassNames.root, { [`${prefixCls}-borderless`]: !bordered });
const rootStyle = {
backgroundColor: bgColor,
...mergedStyles.root,
...contextStyle,
...style,
width: style?.width ?? size,
height: style?.height ?? size
};
return /* @__PURE__ */ import_react.createElement("div", {
...restProps,
className: rootClassNames,
style: rootStyle
}, status !== "active" && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-cover`, mergedClassNames.cover),
style: mergedStyles.cover
}, /* @__PURE__ */ import_react.createElement(QRcodeStatus, {
prefixCls,
locale,
status,
onRefresh,
statusRender
})), type === "canvas" ? /* @__PURE__ */ import_react.createElement(QRCodeCanvas, { ...qrCodeProps }) : /* @__PURE__ */ import_react.createElement(QRCodeSVG, { ...qrCodeProps }));
};
QRCode.displayName = "QRCode";
//#endregion
//#region node_modules/@rc-component/rate/es/Star.js
function Star(props, ref) {
const { disabled, prefixCls, character, characterRender, index, count, value, allowHalf, focused, onHover, onClick } = props;
const onInternalHover = (e) => {
onHover(e, index);
};
const onInternalClick = (e) => {
onClick(e, index);
};
const onInternalKeyDown = (e) => {
if (e.keyCode === KeyCode.ENTER) onClick(e, index);
};
const starValue = index + 1;
const classNameList = new Set([prefixCls]);
if (value === 0 && index === 0 && focused) classNameList.add(`${prefixCls}-focused`);
else if (allowHalf && value + .5 >= starValue && value < starValue) {
classNameList.add(`${prefixCls}-half`);
classNameList.add(`${prefixCls}-active`);
if (focused) classNameList.add(`${prefixCls}-focused`);
} else {
if (starValue <= value) classNameList.add(`${prefixCls}-full`);
else classNameList.add(`${prefixCls}-zero`);
if (starValue === value && focused) classNameList.add(`${prefixCls}-focused`);
}
const characterNode = typeof character === "function" ? character(props) : character;
let start = /* @__PURE__ */ import_react.createElement("li", {
className: clsx(Array.from(classNameList)),
ref
}, /* @__PURE__ */ import_react.createElement("div", {
onClick: disabled ? null : onInternalClick,
onKeyDown: disabled ? null : onInternalKeyDown,
onMouseMove: disabled ? null : onInternalHover,
role: "radio",
"aria-checked": value > index ? "true" : "false",
"aria-posinset": index + 1,
"aria-setsize": count,
tabIndex: disabled ? -1 : 0
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-first` }, characterNode), /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-second` }, characterNode)));
if (characterRender) start = characterRender(start, props);
return start;
}
var Star_default = /* @__PURE__ */ import_react.forwardRef(Star);
//#endregion
//#region node_modules/@rc-component/rate/es/useRefs.js
function useRefs() {
const nodeRef = import_react.useRef({});
function getRef(index) {
return nodeRef.current[index];
}
function setRef(index) {
return (node) => {
nodeRef.current[index] = node;
};
}
return [getRef, setRef];
}
//#endregion
//#region node_modules/@rc-component/rate/es/util.js
function getScroll(w) {
let ret = w.pageXOffset;
const method = "scrollLeft";
if (typeof ret !== "number") {
const d = w.document;
ret = d.documentElement[method];
if (typeof ret !== "number") ret = d.body[method];
}
return ret;
}
function getClientPosition(elem) {
let x;
let y;
const doc = elem.ownerDocument;
const { body } = doc;
const docElem = doc && doc.documentElement;
const 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 getOffsetLeft(el) {
const pos = getClientPosition(el);
const doc = el.ownerDocument;
const w = doc.defaultView || doc.parentWindow;
pos.left += getScroll(w);
return pos.left;
}
//#endregion
//#region node_modules/@rc-component/rate/es/Rate.js
function _extends$25() {
_extends$25 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$25.apply(this, arguments);
}
function Rate$1(props, ref) {
const { prefixCls = "rc-rate", className, defaultValue, value: propValue, count = 5, allowHalf = false, allowClear = true, keyboard = true, character = "★", characterRender, disabled, direction = "ltr", tabIndex = 0, autoFocus, onHoverChange, onChange, onFocus, onBlur, onKeyDown, onMouseLeave, ...restProps } = props;
const [getStarRef, setStarRef] = useRefs();
const rateRef = import_react.useRef(null);
const triggerFocus = () => {
if (!disabled) rateRef.current?.focus();
};
import_react.useImperativeHandle(ref, () => ({
focus: triggerFocus,
blur: () => {
if (!disabled) rateRef.current?.blur();
}
}));
const [value, setValue] = useControlledState(defaultValue || 0, propValue);
const [cleanedValue, setCleanedValue] = useControlledState(null);
const getStarValue = (index, x) => {
const reverse = direction === "rtl";
let starValue = index + 1;
if (allowHalf) {
const starEle = getStarRef(index);
const leftDis = getOffsetLeft(starEle);
const width = starEle.clientWidth;
if (reverse && x - leftDis > width / 2) starValue -= .5;
else if (!reverse && x - leftDis < width / 2) starValue -= .5;
}
return starValue;
};
const changeValue = (nextValue) => {
setValue(nextValue);
onChange?.(nextValue);
};
const [focused, setFocused] = import_react.useState(false);
const onInternalFocus = () => {
setFocused(true);
onFocus?.();
};
const onInternalBlur = () => {
setFocused(false);
onBlur?.();
};
const [hoverValue, setHoverValue] = import_react.useState(null);
const onHover = (event, index) => {
const nextHoverValue = getStarValue(index, event.pageX);
if (nextHoverValue !== cleanedValue) {
setHoverValue(nextHoverValue);
setCleanedValue(null);
}
onHoverChange?.(nextHoverValue);
};
const onMouseLeaveCallback = (event) => {
if (!disabled) {
setHoverValue(null);
setCleanedValue(null);
onHoverChange?.(void 0);
}
if (event) onMouseLeave?.(event);
};
const onClick = (event, index) => {
const newValue = getStarValue(index, event.pageX);
let isReset = false;
if (allowClear) isReset = newValue === value;
onMouseLeaveCallback();
changeValue(isReset ? 0 : newValue);
setCleanedValue(isReset ? newValue : null);
};
const onInternalKeyDown = (event) => {
const { keyCode } = event;
const reverse = direction === "rtl";
const step = allowHalf ? .5 : 1;
if (keyboard) {
if (keyCode === KeyCode.RIGHT && value < count && !reverse) {
changeValue(value + step);
event.preventDefault();
} else if (keyCode === KeyCode.LEFT && value > 0 && !reverse) {
changeValue(value - step);
event.preventDefault();
} else if (keyCode === KeyCode.RIGHT && value > 0 && reverse) {
changeValue(value - step);
event.preventDefault();
} else if (keyCode === KeyCode.LEFT && value < count && reverse) {
changeValue(value + step);
event.preventDefault();
}
}
onKeyDown?.(event);
};
import_react.useEffect(() => {
if (autoFocus && !disabled) triggerFocus();
}, []);
const starNodes = new Array(count).fill(0).map((item, index) => /* @__PURE__ */ import_react.createElement(Star_default, {
ref: setStarRef(index),
index,
count,
disabled,
prefixCls: `${prefixCls}-star`,
allowHalf,
value: hoverValue === null ? value : hoverValue,
onClick,
onHover,
key: item || index,
character,
characterRender,
focused
}));
const classString = clsx(prefixCls, className, {
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-rtl`]: direction === "rtl"
});
return /* @__PURE__ */ import_react.createElement("ul", _extends$25({
className: classString,
onMouseLeave: onMouseLeaveCallback,
tabIndex: disabled ? -1 : tabIndex,
onFocus: disabled ? null : onInternalFocus,
onBlur: disabled ? null : onInternalBlur,
onKeyDown: disabled ? null : onInternalKeyDown,
ref: rateRef
}, pickAttrs(restProps, {
aria: true,
data: true,
attr: true
})), starNodes);
}
//#endregion
//#region node_modules/@rc-component/rate/es/index.js
var es_default$5 = /* @__PURE__ */ import_react.forwardRef(Rate$1);
//#endregion
//#region node_modules/antd/es/rate/style/index.js
var genRateStarStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-star`]: {
position: "relative",
display: "inline-block",
color: "inherit",
cursor: "pointer",
"&:not(:last-child)": { marginInlineEnd: token.marginXS },
"> div": {
transition: `all ${token.motionDurationMid}, outline 0s`,
"&:hover": { transform: token.starHoverScale },
"&:focus": { outline: 0 },
"&:focus-visible": {
outline: `${unit$1(token.lineWidth)} dashed ${token.starColor}`,
transform: token.starHoverScale
}
},
"&-first, &-second": {
color: token.starBg,
transition: `all ${token.motionDurationMid}`,
userSelect: "none"
},
"&-first": {
position: "absolute",
top: 0,
insetInlineStart: 0,
width: "50%",
height: "100%",
overflow: "hidden",
opacity: 0
},
[`&-half ${componentCls}-star-first, &-half ${componentCls}-star-second`]: { opacity: 1 },
[`&-half ${componentCls}-star-first, &-full ${componentCls}-star-second`]: { color: "inherit" }
} };
};
var genRateRtlStyle = (token) => ({ [`&-rtl${token.componentCls}`]: { direction: "rtl" } });
var genRateStyle = (token) => {
const { componentCls } = token;
return { [componentCls]: {
...resetComponent(token),
display: "inline-block",
margin: 0,
padding: 0,
color: token.starColor,
fontSize: token.starSize,
lineHeight: 1,
listStyle: "none",
outline: "none",
"&-small": { fontSize: token.starSizeSM },
"&-large": { fontSize: token.starSizeLG },
[`&-disabled${componentCls} ${componentCls}-star`]: {
cursor: "default",
"> div:hover": { transform: "scale(1)" }
},
...genRateStarStyle(token),
...genRateRtlStyle(token)
} };
};
var prepareComponentToken$13 = (token) => ({
starColor: token.yellow6,
starSize: token.controlHeight * .625,
starSizeSM: token.controlHeightSM * .625,
starSizeLG: token.controlHeightLG * .625,
starHoverScale: "scale(1.1)",
starBg: token.colorFillContent
});
var style_default$13 = genStyleHooks("Rate", (token) => {
return genRateStyle(merge(token, {}));
}, prepareComponentToken$13);
//#endregion
//#region node_modules/antd/es/rate/index.js
var Rate = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, className, rootClassName, style, tooltips, character = /* @__PURE__ */ import_react.createElement(RefIcon$32, null), disabled: customDisabled, size, ...rest } = props;
const characterRender = (node, { index }) => {
if (!tooltips) return node;
const tooltipsItem = tooltips[index];
if (isPlainObject(tooltipsItem)) return /* @__PURE__ */ import_react.createElement(Tooltip, { ...tooltipsItem }, node);
return /* @__PURE__ */ import_react.createElement(Tooltip, { title: tooltipsItem }, node);
};
const { getPrefixCls, direction, className: contextClassName, style: contextStyle } = useComponentConfig("rate");
const ratePrefixCls = getPrefixCls("rate", prefixCls);
const [hashId, cssVarCls] = style_default$13(ratePrefixCls);
const mergedStyle = {
...contextStyle,
...style
};
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const mergedSize = useSize((ctx) => size ?? ctx);
return /* @__PURE__ */ import_react.createElement(es_default$5, {
ref,
character,
characterRender,
disabled: mergedDisabled,
...rest,
className: clsx({
[`${ratePrefixCls}-large`]: mergedSize === "large",
[`${ratePrefixCls}-small`]: mergedSize === "small"
}, className, rootClassName, hashId, cssVarCls, contextClassName),
style: mergedStyle,
prefixCls: ratePrefixCls,
direction
});
});
Rate.displayName = "Rate";
//#endregion
//#region node_modules/antd/es/result/noFound.js
var NoFound = () => /* @__PURE__ */ import_react.createElement("svg", {
width: "252",
height: "294"
}, /* @__PURE__ */ import_react.createElement("title", null, "No Found"), /* @__PURE__ */ import_react.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */ import_react.createElement("circle", {
cx: "126.75",
cy: "128.1",
r: "126",
fill: "#E4EBF7"
}), /* @__PURE__ */ import_react.createElement("circle", {
cx: "31.55",
cy: "130.8",
r: "8.3",
fill: "#FFF"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "m37 134.3 10.5 6m.9 6.2-12.7 10.8",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M39.9 159.4a5.7 5.7 0 1 1-11.3-1.2 5.7 5.7 0 0 1 11.3 1.2m17.7-16.2a5.7 5.7 0 1 1-11.4-1.1 5.7 5.7 0 0 1 11.4 1.1M99 27h29.8a4.6 4.6 0 1 0 0-9.2H99a4.6 4.6 0 1 0 0 9.2m11.4 18.3h29.8a4.6 4.6 0 0 0 0-9.2h-29.8a4.6 4.6 0 1 0 0 9.2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M112.8 26.9h15.8a4.6 4.6 0 1 0 0 9.1h-15.8a4.6 4.6 0 0 0 0-9.1m71.7 108.8a10 10 0 1 1-19.8-2 10 10 0 0 1 19.8 2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "m179.3 141.8 12.6 7.1m1.1 7.6-15.2 13",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M184.7 170a6.8 6.8 0 1 1-13.6-1.3 6.8 6.8 0 0 1 13.6 1.4m18.6-16.8a6.9 6.9 0 1 1-13.7-1.4 6.9 6.9 0 0 1 13.7 1.4"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "M152 192.3a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.4 0zm73.3-76.2a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.5 0zm-9 35a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.5 0zM177 107.6a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm18.4-15.4a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.5 0zm6.8 88.5a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.5 0z",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "m214.4 153.3-2 20.2-10.8 6m-28-4.7-6.3 9.8H156l-4.5 6.5m23.5-66v-15.7m46 7.8-13 8-15.2-8V94.4",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M166.6 66h-4a4.8 4.8 0 0 1-4.7-4.8 4.8 4.8 0 0 1 4.7-4.7h4a4.8 4.8 0 0 1 4.7 4.7 4.8 4.8 0 0 1-4.7 4.7"
}), /* @__PURE__ */ import_react.createElement("circle", {
cx: "204.3",
cy: "30",
r: "29.5",
fill: "#1677ff"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M206 38.4c.5.5.7 1.1.7 2s-.2 1.4-.7 1.9a3 3 0 0 1-2 .7c-.8 0-1.5-.3-2-.8s-.8-1.1-.8-1.9.3-1.4.8-2c.5-.4 1.2-.7 2-.7.7 0 1.4.3 2 .8m4.2-19.5c1.5 1.3 2.2 3 2.2 5.2a7.2 7.2 0 0 1-1.5 4.5l-3 2.7a5 5 0 0 0-1.3 1.7 5.2 5.2 0 0 0-.6 2.4v.5h-4v-.5c0-1.4.1-2.5.6-3.5s1.9-2.5 4.2-4.5l.4-.5a4 4 0 0 0 1-2.6c0-1.2-.4-2-1-2.8-.7-.6-1.6-1-2.9-1-1.5 0-2.6.5-3.3 1.5-.4.5-.6 1-.8 1.9a2 2 0 0 1-2 1.6 2 2 0 0 1-2-2.4c.4-1.6 1-2.8 2.1-3.8a8.5 8.5 0 0 1 6.3-2.3c2.3 0 4.2.6 5.6 2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFB594",
d: "M52 76.1s21.8 5.4 27.3 16c5.6 10.7-6.3 9.2-15.7 5C52.8 92 39 85 52 76"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "m90.5 67.5-.5 2.9c-.7.5-4.7-2.7-4.7-2.7l-1.7.8-1.3-5.7s6.8-4.6 9-5c2.4-.5 9.8 1 10.6 2.3 0 0 1.3.4-2.2.6-3.6.3-5 .5-6.8 3.2l-2.4 3.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M128 111.4a36.7 36.7 0 0 0-8.9-15.5c-3.5-3-9.3-2.2-11.3-4.2-1.3-1.2-3.2-1.2-3.2-1.2L87.7 87c-2.3-.4-2.1-.7-6-1.4-1.6-1.9-3-1.1-3-1.1l-7-1.4c-1-1.5-2.5-1-2.5-1l-2.4-.9C65 91.2 59 95 59 95c1.8 1.1 15.7 8.3 15.7 8.3l5.1 37.1s-3.3 5.7 1.4 9.1c0 0 19.9-3.7 34.9-.3 0 0 3-2.6 1-8.8.5-3 1.4-8.3 1.7-11.6.4.7 2 1.9 3.1 3.4 0 0 9.4-7.3 11-14a17 17 0 0 1-2.2-2.4c-.5-.8-.3-2-.7-2.8-.7-1-1.8-1.3-2-1.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CBD1D1",
d: "M101 290s4.4 2 7.4 1c2.9-1 4.6.7 7.1 1.2 2.6.5 6.9 1.1 11.7-1.3 0-5.5-6.9-4-12-6.7-2.5-1.4-3.7-4.7-3.5-8.8h-9.5s-1.2 10.6-1 14.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#2B0849",
d: "M101 289.8s2.5 1.3 6.8.7c3-.5 3.7.5 7.4 1 3.8.6 10.8 0 11.9-.9.4 1.1-.4 2-.4 2s-1.5.7-4.8.9c-2 .1-5.8.3-7.6-.5-1.8-1.4-5.2-1.9-5.7-.2-4 1-7.4-.3-7.4-.3l-.1-2.7z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A4AABA",
d: "M108.3 276h3.1s0 6.7 4.6 8.6c-4.7.6-8.6-2.3-7.7-8.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CBD1D1",
d: "M57.5 272.4s-2 7.4-4.4 12.3c-1.8 3.7-4.3 7.5 5.4 7.5 6.7 0 9-.5 7.4-6.6-1.5-6.1.3-13.2.3-13.2h-8.7z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#2B0849",
d: "M51.5 289.8s2 1.2 6.6 1.2c6 0 8.3-1.7 8.3-1.7s.6 1.1-.7 2.2c-1 .8-3.6 1.6-7.4 1.5-4.1 0-5.8-.5-6.7-1.1-.8-.6-.7-1.6-.1-2.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A4AABA",
d: "M58.4 274.3s0 1.5-.3 3c-.3 1.4-1 3-1.1 4 0 1.2 4.5 1.7 5.1.1.6-1.5 1.3-6.4 2-7.2.6-.9-5-2.2-5.7.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#7BB2F9",
d: "m99.7 278.5 13.3.1s1.3-54.5 1.9-64.4c.5-9.9 3.8-43.4 1-63.1l-12.6-.7-22.8.8-1.2 10c0 .5-.7.8-.7 1.4-.1.5.4 1.3.3 2-2.4 14-6.4 33-8.8 46.6 0 .7-1.2 1-1.4 2.7 0 .3.2 1.5 0 1.8-6.8 18.7-10.9 47.8-14.2 61.9h14.6s2.2-8.6 4-17c2.9-12.9 23.2-85 23.2-85l3-.5 1 46.3s-.2 1.2.4 2c.5.8-.6 1.1-.4 2.3l.4 1.8-1 11.8c-.4 4.8 0 39.2 0 39.2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M76 221.6c1.2.1 4.1-2 7-5m23.4 8.5s2.7-1 6-3.8",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M107.3 222.1s2.7-1.1 6-3.9",
strokeLinecap: "round",
strokeLinejoin: "round"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M74.7 224.8s2.7-.6 6.5-3.4m4.8-69.8c-.2 3.1.3 8.6-4.3 9.2m22-11s0 14-1.4 15.1a15 15 0 0 1-3 2m.5-16.5s0 13-1.2 24.4m-5 1.1s7.3-1.7 9.5-1.7M74.3 206a212 212 0 0 1-1 4.5s-1.4 1.9-1 3.8c.5 2-1 2-5 15.4A353 353 0 0 0 61 257l-.2 1.2m14.9-60.5a321 321 0 0 1-.9 4.8m7.8-50.4-1.2 10.5s-1.1.1-.5 2.2c.1 1.4-2.7 15.8-5.2 30.5m-19.6 79h13.3",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#192064",
d: "M116.2 148.2s-17-3-35.9.2c.2 2.5 0 4.2 0 4.2s14.7-2.8 35.7-.3c.3-2.4.2-4 .2-4"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M106.3 151.2v-5a.8.8 0 0 0-.8-.8h-7.8a.8.8 0 0 0-.8.8v5a.8.8 0 0 0 .8.8h7.8a.8.8 0 0 0 .8-.8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#192064",
d: "M105.2 150.2v-3a.6.6 0 0 0-.6-.7 94.3 94.3 0 0 0-5.9 0 .7.7 0 0 0-.6.6v3.1a.6.6 0 0 0 .6.7 121.1 121.1 0 0 1 5.8 0c.4 0 .7-.3.7-.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M100.3 275.4h12.3m-11.2-4.9.1 6.5m0-12.5a915.8 915.8 0 0 0 0 4.4m-.5-94 .9 44.7s.7 1.6-.2 2.7c-1 1.1 2.4.7.9 2.2-1.6 1.6.9 1.2 0 3.4-.6 1.5-1 21.1-1.1 35.2",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M46.9 83.4s-.5 6 7.2 5.6c11.2-.7 9.2-9.4 31.5-21.7-.7-2.7-2.4-4.7-2.4-4.7s-11 3-22.6 8c-6.8 3-13.4 6.4-13.7 12.8m57.6 7.7.9-5.4-8.9-11.4-5 5.3-1.8 7.9a.3.3 0 0 0 .1.3c1 .8 6.5 5 14.4 3.5a.3.3 0 0 0 .3-.2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M94 79.4s-4.6-2.9-2.5-6.9c1.6-3 4.5 1.2 4.5 1.2s.5-3.7 3.1-3.7c.6-1 1.6-4.1 1.6-4.1l13.5 3c0 5.3-2.3 19.5-7.8 20-8.9.6-12.5-9.5-12.5-9.5"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#520038",
d: "M113.9 73.4c2.6-2 3.4-9.7 3.4-9.7s-2.4-.5-6.6-2c-4.7-2.1-12.8-4.8-17.5 1-9.6 3.2-2 19.8-2 19.8l2.7-3s-4-3.3-2-6.3c2-3.5 3.8 1 3.8 1s.7-2.3 3.6-3.3c.4-.7 1-2.6 1.4-3.8a1 1 0 0 1 1.3-.7l11.4 2.6c.5.2.8.7.8 1.2l-.3 3.2z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#552950",
d: "M105 76c-.1.7-.6 1.1-1 1-.6 0-.9-.6-.8-1.2.1-.6.6-1 1-1 .6 0 .9.7.8 1.3m7.1 1.6c0 .6-.5 1-1 1-.5-.1-.8-.7-.7-1.3 0-.6.5-1 1-1 .5.1.8.7.7 1.3"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "m110.1 74.8-.9 1.7-.3 4.3h-2.2",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#5C2552",
d: "M110.8 74.5s1.8-.7 2.6.5",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M92.4 74.3s.5-1.1 1.1-.7c.6.4 1.3 1.4.6 2-.8.5.1 1.6.1 1.6",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#5C2552",
d: "M103.3 73s1.8 1 4.1.9",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M103.7 81.8s2.2 1.2 4.4 1.2m-3.5 1.3s1 .4 1.6.3m-11.5-3.4s2.3 7.4 10.4 7.6",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M81.5 89.4s.4 5.6-5 12.8M69 82.7s-.7 9.2-8.2 14.2m68.6 26s-5.3 7.4-9.4 10.7m-.7-26.3s.5 4.4-2.1 32",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#F2D7AD",
d: "M150 151.2h-49.8a1 1 0 0 1-1-1v-31.7c0-.5.4-1 1-1H150c.6 0 1 .5 1 1v31.7a1 1 0 0 1-1 1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#F4D19D",
d: "M150.3 151.2h-19.9v-33.7h20.8v32.8a1 1 0 0 1-1 1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#F2D7AD",
d: "M123.6 127.9H92.9a.5.5 0 0 1-.4-.8l6.4-9.1c.2-.3.5-.5.8-.5h31.1l-7.2 10.4z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CC9B6E",
d: "M123.7 128.4H99.2v-.5h24.2l7.2-10.2.4.3z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#F4D19D",
d: "M158.3 127.9h-18.7a2 2 0 0 1-1.6-.8l-7.2-9.6h20c.5 0 1 .3 1.2.6l6.7 9a.5.5 0 0 1-.4.8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CC9B6E",
d: "M157.8 128.5h-19.3l-7.9-10.5.4-.3 7.7 10.3h19.1zm-27.2 22.2v-8.2h.4v8.2zm-.1-10.9v-21.4h.4l.1 21.4zm-18.6 1.1-.5-.1 1.5-5.2.5.2zm-3.5.2-2.6-3 2.6-3.4.4.3-2.4 3.1 2.4 2.6zm8.2 0-.4-.4 2.4-2.6-2.4-3 .4-.4 2.7 3.4z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "m154.3 131.9-3.1-2v3.5l-1 .1a85 85 0 0 1-4.8.3c-1.9 0-2.7 2.2 2.2 2.6l-2.6-.6s-2.2 1.3.5 2.3c0 0-1.6 1.2.6 2.6-.6 3.5 5.2 4 7 3.6a6.1 6.1 0 0 0 4.6-5.2 8 8 0 0 0-3.4-7.2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M153.7 133.6s-6.5.4-8.4.3c-1.8 0-1.9 2.2 2.4 2.3 3.7.2 5.4 0 5.4 0",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M145.2 135.9c-1.9 1.3.5 2.3.5 2.3s3.5 1 6.8.6m-.6 2.9s-6.3.1-6.7-2.1c-.3-1.4.4-1.4.4-1.4m.5 2.7s-1 3.1 5.5 3.5m-.4-14.5v3.5M52.8 89.3a18 18 0 0 0 13.6-7.8",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#5BA02E",
d: "M168.6 248.3a6.6 6.6 0 0 1-6.7-6.6v-66.5a6.6 6.6 0 1 1 13.3 0v66.5a6.6 6.6 0 0 1-6.6 6.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#92C110",
d: "M176.5 247.7a6.6 6.6 0 0 1-6.6-6.7v-33.2a6.6 6.6 0 1 1 13.3 0V241a6.6 6.6 0 0 1-6.7 6.7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#F2D7AD",
d: "M186.4 293.6H159a3.2 3.2 0 0 1-3.2-3.2v-46.1a3.2 3.2 0 0 1 3.2-3.2h27.5a3.2 3.2 0 0 1 3.2 3.2v46.1a3.2 3.2 0 0 1-3.2 3.2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M89 89.5s7.8 5.4 16.6 2.8",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
})));
//#endregion
//#region node_modules/antd/es/result/serverError.js
var ServerError = () => /* @__PURE__ */ import_react.createElement("svg", {
width: "254",
height: "294"
}, /* @__PURE__ */ import_react.createElement("title", null, "Server Error"), /* @__PURE__ */ import_react.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */ import_react.createElement("path", {
fill: "#E4EBF7",
d: "M0 128.1v-2C0 56.5 56.3.2 125.7.2h2.1C197.2.3 253.5 56.6 253.5 126v2.1c0 69.5-56.3 125.7-125.7 125.7h-2.1A125.7 125.7 0 0 1 0 128.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M40 132.1a8.3 8.3 0 1 1-16.6-1.7 8.3 8.3 0 0 1 16.6 1.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "m37.2 135.6 10.5 6m1 6.3-12.8 10.8",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M40.1 160.8a5.7 5.7 0 1 1-11.3-1.1 5.7 5.7 0 0 1 11.3 1.1M58 144.6a5.7 5.7 0 1 1-11.4-1.2 5.7 5.7 0 0 1 11.4 1.2M99.7 27.4h30a4.6 4.6 0 1 0 0-9.2h-30a4.6 4.6 0 0 0 0 9.2M111 46h30a4.6 4.6 0 1 0 0-9.3h-30a4.6 4.6 0 1 0 0 9.3m2.5-18.6h16a4.6 4.6 0 1 0 0 9.3h-16a4.6 4.6 0 0 0 0-9.3m36.7 42.7h-4a4.8 4.8 0 0 1-4.8-4.8 4.8 4.8 0 0 1 4.8-4.8h4a4.8 4.8 0 0 1 4.7 4.8 4.8 4.8 0 0 1-4.7 4.8"
}), /* @__PURE__ */ import_react.createElement("circle", {
cx: "201.35",
cy: "30.2",
r: "29.7",
fill: "#FF603B"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "m203.6 19.4-.7 15a1.5 1.5 0 0 1-3 0l-.7-15a2.2 2.2 0 1 1 4.4 0m-.3 19.4c.5.5.8 1.1.8 1.9s-.3 1.4-.8 1.9a3 3 0 0 1-2 .7 2.5 2.5 0 0 1-1.8-.7c-.6-.6-.8-1.2-.8-2 0-.7.2-1.3.8-1.8.5-.5 1.1-.7 1.8-.7.8 0 1.5.2 2 .7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFB594",
d: "M119.3 133.3c4.4-.6 3.6-1.2 4-4.8.8-5.2-3-17-8.2-25.1-1-10.7-12.6-11.3-12.6-11.3s4.3 5 4.2 16.2c1.4 5.3.8 14.5.8 14.5s5.3 11.4 11.8 10.5"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M101 91.6s1.4-.6 3.2.6c8 1.4 10.3 6.7 11.3 11.4 1.8 1.2 1.8 2.3 1.8 3.5l1.5 3s-7.2 1.7-11 6.7c-1.3-6.4-6.9-25.2-6.9-25.2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFB594",
d: "m94 90.5 1-5.8-9.2-11.9-5.2 5.6-2.6 9.9s8.4 5 16 2.2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M83 78.2s-4.6-2.9-2.5-6.9c1.6-3 4.5 1.2 4.5 1.2s.5-3.7 3.2-3.7c.5-1 1.5-4.2 1.5-4.2l13.6 3.2c0 5.2-2.3 19.5-7.9 20-8.9.6-12.5-9.6-12.5-9.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#520038",
d: "M103 72.2c2.6-2 3.5-9.7 3.5-9.7s-2.5-.5-6.7-2c-4.7-2.2-12.9-4.9-17.6.9-9.5 4.4-2 20-2 20l2.7-3.1s-4-3.3-2.1-6.3c2.2-3.5 4 1 4 1s.6-2.3 3.5-3.3c.4-.7 1-2.7 1.5-3.8A1 1 0 0 1 91 65l11.5 2.7c.5.1.8.6.8 1.2l-.3 3.2z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#552950",
d: "M101.2 76.5c0 .6-.6 1-1 1-.5-.1-.9-.7-.8-1.3.1-.6.6-1 1.1-1 .5.1.8.7.7 1.3m-7-1.4c0 .6-.5 1-1 1-.5-.1-.8-.7-.7-1.3 0-.6.6-1 1-1 .5.1.9.7.8 1.3"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "m99.2 73.6-.9 1.7-.3 4.3h-2.2",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#5C2552",
d: "M100 73.3s1.7-.7 2.4.5",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M81.4 73s.4-1 1-.6c.7.4 1.4 1.4.6 2s.2 1.6.2 1.6",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#5C2552",
d: "M92.3 71.7s1.9 1.1 4.2 1",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M92.7 80.6s2.3 1.2 4.4 1.2m-3.4 1.4s1 .4 1.5.3M83.7 80s1.8 6.6 9.2 8",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M95.5 91.7s-1 2.8-8.2 2c-7.3-.6-10.3-5-10.3-5",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M78.1 87.5s6.6 5 16.5 2.5c0 0 9.6 1 11.5 5.3 5.4 11.8.6 36.8 0 40 3.5 4-.4 8.4-.4 8.4-15.7-3.5-35.8-.6-35.8-.6-4.9-3.5-1.3-9-1.3-9l-6.2-23.8c-2.5-15.2.8-19.8 3.5-20.7 3-1 8-1.3 8-1.3.6 0 1.1 0 1.4-.2 2.4-1.3 2.8-.6 2.8-.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M65.8 89.8s-6.8.5-7.6 8.2c-.4 8.8 3 11 3 11s6.1 22 16.9 22.9c8.4-2.2 4.7-6.7 4.6-11.4-.2-11.3-7-17-7-17s-4.3-13.7-9.9-13.7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M71.7 124.2s.9 11.3 9.8 6.5c4.8-2.5 7.6-13.8 9.8-22.6A201 201 0 0 0 94 96l-5-1.7s-2.4 5.6-7.7 12.3c-4.4 5.5-9.2 11.1-9.5 17.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M108.5 105.2s1.7 2.7-2.4 30.5c2.4 2.2 1 6-.2 7.5",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M123.3 131.5s-.5 2.8-11.8 2c-15.2-1-25.3-3.2-25.3-3.2l.9-5.8s.7.2 9.7-.1c11.9-.4 18.7-6 25-1 4 3.2 1.5 8.1 1.5 8.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M70.2 91s-5.6-4.8-11 2.7c-3.3 7.2.5 15.2 2.6 19.5-.3 3.8 2.4 4.3 2.4 4.3s0 1 1.5 2.7c4-7 6.7-9.1 13.7-12.5-.3-.7-1.9-3.3-1.8-3.8.2-1.7-1.3-2.6-1.3-2.6s-.3-.2-1.2-2.8c-.8-2.3-2-5.1-4.9-7.5"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CBD1D1",
d: "M90.2 288s4.9 2.3 8.3 1.2c3.2-1 5.2.7 8 1.3a20 20 0 0 0 13.3-1.4c-.2-6.2-7.8-4.5-13.6-7.6-2.9-1.6-4.2-5.3-4-10H91.5s-1.5 12-1.3 16.5"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#2B0849",
d: "M90.2 287.8s2.8 1.5 7.6.8c3.5-.5 3.3.6 7.5 1.3 4.2.6 13-.2 14.3-1.2.5 1.3-.4 2.4-.4 2.4s-1.7.6-5.4.9c-2.3.1-8.1.3-10.2-.6-2-1.6-4.9-1.5-6-.3-4.5 1.1-7.2-.3-7.2-.3l-.2-3z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A4AABA",
d: "M98.4 272.3h3.5s0 7.5 5.2 9.6c-5.3.7-9.7-2.6-8.7-9.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CBD1D1",
d: "M44.4 272s-2.2 7.8-4.7 13c-1.9 3.8-4.4 7.8 5.8 7.8 7 0 9.3-.5 7.7-7-1.6-6.3.3-13.8.3-13.8h-9z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#2B0849",
d: "M38 290.3s2.3 1.2 7 1.2c6.4 0 8.7-1.7 8.7-1.7s.6 1.1-.7 2.2c-1 1-3.8 1.7-7.7 1.7-4.4 0-6.1-.6-7-1.3-1-.5-.8-1.6-.2-2.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A4AABA",
d: "M45.3 274s0 1.6-.3 3.1-1.1 3.3-1.2 4.4c0 1.2 4.8 1.6 5.4 0 .7-1.6 1.4-6.8 2-7.6.7-.9-5.1-2.2-5.9.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#7BB2F9",
d: "M89.5 277.6h13.9s1.3-56.6 1.9-66.8c.6-10.3 4-45.1 1-65.6l-13-.7-23.7.8-1.3 10.4c0 .5-.7.9-.8 1.4 0 .6.5 1.4.4 2L59.6 206c-.1.7-1.3 1-1.5 2.8 0 .3.2 1.6.1 1.8-7.1 19.5-12.2 52.6-15.6 67.2h15.1L62 259c3-13.3 24-88.3 24-88.3l3.2-1-.2 48.6s-.2 1.3.4 2.1c.5.8-.6 1.2-.4 2.4l.4 1.8-1 12.4c-.4 4.9 1.2 40.7 1.2 40.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M64.6 218.9c1.2 0 4.2-2.1 7.2-5.1m24.2 8.7s3-1.1 6.4-4",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M97 219.4s2.9-1.2 6.3-4",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M63.2 222.1s2.7-.6 6.7-3.5m5-72.4c-.3 3.2.3 8.8-4.5 9.4m22.8-11.3s.1 14.6-1.4 15.7c-2.3 1.7-3 2-3 2m.4-17s.3 13-1 25m-4.7.7s6.8-1 9.1-1M46 270l-.9 4.6m1.8-11.3-.8 4.1m16.6-64.9c-.3 1.6 0 2-.4 3.4 0 0-2.8 2-2.3 4s-.3 3.4-4.5 17.2c-1.8 5.8-4.3 19-6.2 28.3l-1.1 5.8m16-67-1 4.9m8.1-52.3-1.2 10.9s-1.2.1-.5 2.3c0 1.4-2.8 16.4-5.4 31.6m-20 82.1h13.9",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#192064",
d: "M106.2 142.1c-3-.5-18.8-2.7-36.2.2a.6.6 0 0 0-.6.7v3a.6.6 0 0 0 .8.6c3.3-.5 17-2.4 35.6-.3.4 0 .7-.2.7-.5.2-1.4.2-2.5.2-3a.6.6 0 0 0-.5-.7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M96.4 145.3v-5.1a.8.8 0 0 0-.8-.9 114.1 114.1 0 0 0-8.1 0 .8.8 0 0 0-.9.8v5.1c0 .5.4.9.9.9h8a.8.8 0 0 0 .9-.8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#192064",
d: "M95.2 144.3v-3.2a.7.7 0 0 0-.6-.7h-6.1a.7.7 0 0 0-.6.7v3.2c0 .4.3.7.6.7h6c.4 0 .7-.3.7-.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M90.1 273.5h12.8m-11.7-3.7v6.3m-.3-12.6v4.5m-.5-97.6 1 46.4s.7 1.6-.3 2.8c-.9 1.1 2.6.7 1 2.3-1.7 1.6.9 1.2 0 3.5-.6 1.6-1 22-1.2 36.5",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M73.7 98.7 76 103s2 .8 1.8 2.7l.8 2.2m-14.3 8.7c.2-1 2.2-7.1 12.6-10.5m.7-16s7.7 6 16.5 2.7",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M92 87s5.5-.9 7.5-4.6c1.3-.3.8 2.2-.3 3.7l-1 1.5s.2.3.2.9c0 .6-.2.6-.3 1v1l-.4 1c-.1.2 0 .6-.2.9-.2.4-1.6 1.8-2.6 2.8-3.8 3.6-5 1.7-6-.4-1-1.8-.7-5.1-.9-6.9-.3-2.9-2.6-3-2-4.4.4-.7 3 .7 3.4 1.8.7 2 2.9 1.8 2.6 1.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M99.8 82.4c-.5.1-.3.3-1 1.3-.6 1-4.8 2.9-6.4 3.2-2.5.5-2.2-1.6-4.2-2.9-1.7-1-3.6-.6-1.4 1.4 1 1 1 1.1 1.4 3.2.3 1.5-.7 3.7.7 5.6",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".8"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E59788",
d: "M79.5 108.7c-2 2.9-4.2 6.1-5.5 8.7",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M87.7 124.8s-2-2-5.1-2.8c-3-.7-3.6-.1-5.5.1-2 .3-4-.9-3.7.7.3 1.7 5 1 5.2 2.1.2 1.1-6.3 2.8-8.3 2.2-.8.8.5 1.9 2 2.2.3 1.5 2.3 1.5 2.3 1.5s.7 1 2.6 1.1c2.5 1.3 9-.7 11-1.5 2-.9-.5-5.6-.5-5.6"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E59788",
d: "M73.4 122.8s.7 1.2 3.2 1.4c2.3.3 2.6.6 2.6.6s-2.6 3-9.1 2.3m2.3 2.2s3.8 0 5-.7m-2.4 2.2s2 0 3.3-.6m-1 1.7s1.7 0 2.8-.5m-6.8-9s-.6-1.1 1.3-.5c1.7.5 2.8 0 5.1.1 1.4.1 3-.2 4 .2 1.6.8 3.6 2.2 3.6 2.2s10.6 1.2 19-1.1M79 108s-8.4 2.8-13.2 12.1",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".8"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M109.3 112.5s3.4-3.6 7.6-4.6",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E59788",
d: "M107.4 123s9.7-2.7 11.4-.9",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".8"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#BFCDDD",
d: "m194.6 83.7 4-4M187.2 91l3.7-3.6m.9-3-4.5-4.7m11.2 11.5-4.2-4.3m-65 76.3 3.7-3.7M122.3 170l3.5-3.5m.8-2.9-4.3-4.2M133 170l-4-4",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A3B4C6",
d: "M190.2 211.8h-1.6a4 4 0 0 1-4-4v-32.1a4 4 0 0 1 4-4h1.6a4 4 0 0 1 4 4v32a4 4 0 0 1-4 4"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A3B4C6",
d: "M237.8 213a4.8 4.8 0 0 1-4.8 4.8h-86.6a4.8 4.8 0 0 1 0-9.6H233a4.8 4.8 0 0 1 4.8 4.8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A3B4C6",
d: "M154.1 190.1h70.5v-84.6h-70.5z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#BFCDDD",
d: "M225 190.1h-71.2a3.2 3.2 0 0 1-3.2-3.2v-19a3.2 3.2 0 0 1 3.2-3.2h71.1a3.2 3.2 0 0 1 3.2 3.2v19a3.2 3.2 0 0 1-3.2 3.2m0-59.3h-71.1a3.2 3.2 0 0 1-3.2-3.2v-19a3.2 3.2 0 0 1 3.2-3.2h71.1a3.2 3.2 0 0 1 3.2 3.3v19a3.2 3.2 0 0 1-3.2 3.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M159.6 120.5a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m48.1 0h-22.4a.8.8 0 0 1-.8-.8v-3.2c0-.4.3-.8.8-.8h22.4c.5 0 .8.4.8.8v3.2c0 .5-.3.8-.8.8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#BFCDDD",
d: "M225 160.5h-71.2a3.2 3.2 0 0 1-3.2-3.2v-19a3.2 3.2 0 0 1 3.2-3.2h71.1a3.2 3.2 0 0 1 3.2 3.2v19a3.2 3.2 0 0 1-3.2 3.2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#7C90A5",
d: "M173.5 130.8h49.3m-57.8 0h6m-15 0h6.7m11.1 29.8h49.3m-57.7 0h6m-15.8 0h6.7",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M159.6 151a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m48.1 0h-22.4a.8.8 0 0 1-.8-.8V147c0-.4.3-.8.8-.8h22.4c.5 0 .8.4.8.8v3.2c0 .5-.3.8-.8.8m-63 29a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.5 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m7.4 0a2.4 2.4 0 1 1 0-4.8 2.4 2.4 0 0 1 0 4.8m48.1 0h-22.4a.8.8 0 0 1-.8-.8V176c0-.5.3-.8.8-.8h22.4c.5 0 .8.3.8.8v3.2c0 .4-.3.8-.8.8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#BFCDDD",
d: "M203 221.1h-27.3a2.4 2.4 0 0 1-2.4-2.4v-11.4a2.4 2.4 0 0 1 2.4-2.5H203a2.4 2.4 0 0 1 2.4 2.5v11.4a2.4 2.4 0 0 1-2.4 2.4"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#A3B4C6",
d: "M177.3 207.2v11.5m23.8-11.5v11.5",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#5BA02E",
d: "M162.9 267.9a9.4 9.4 0 0 1-9.4-9.4v-14.8a9.4 9.4 0 0 1 18.8 0v14.8a9.4 9.4 0 0 1-9.4 9.4"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#92C110",
d: "M171.2 267.8a9.4 9.4 0 0 1-9.4-9.4V255a9.4 9.4 0 0 1 18.8 0v3.4a9.4 9.4 0 0 1-9.4 9.4"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#F2D7AD",
d: "M181.3 293.7h-27.7a3.2 3.2 0 0 1-3.2-3.2v-20.7a3.2 3.2 0 0 1 3.2-3.2h27.7a3.2 3.2 0 0 1 3.2 3.2v20.7a3.2 3.2 0 0 1-3.2 3.2"
})));
//#endregion
//#region node_modules/antd/es/result/style/index.js
var genBaseStyle$5 = (token) => {
const { componentCls, lineHeightHeading3, iconCls, padding, paddingXL, paddingXS, paddingLG, marginXS, lineHeight } = token;
return {
[componentCls]: {
padding: `${unit$1(token.calc(paddingLG).mul(2).equal())} ${unit$1(paddingXL)}`,
"&-rtl": { direction: "rtl" }
},
[`${componentCls} ${componentCls}-image`]: {
width: token.imageWidth,
height: token.imageHeight,
margin: "auto"
},
[`${componentCls} ${componentCls}-icon`]: {
marginBottom: paddingLG,
textAlign: "center",
[`& > ${iconCls}`]: { fontSize: token.iconFontSize }
},
[`${componentCls} ${componentCls}-title`]: {
color: token.colorTextHeading,
fontSize: token.titleFontSize,
lineHeight: lineHeightHeading3,
marginBlock: marginXS,
textAlign: "center"
},
[`${componentCls} ${componentCls}-subtitle`]: {
color: token.colorTextDescription,
fontSize: token.subtitleFontSize,
lineHeight,
textAlign: "center"
},
[`${componentCls} ${componentCls}-body`]: {
marginTop: paddingLG,
padding: `${unit$1(paddingLG)} ${unit$1(token.calc(padding).mul(2.5).equal())}`,
backgroundColor: token.colorFillAlter
},
[`${componentCls} ${componentCls}-extra`]: {
margin: token.extraMargin,
textAlign: "center",
"& > *": {
marginInlineEnd: paddingXS,
"&:last-child": { marginInlineEnd: 0 }
}
}
};
};
var genStatusIconStyle = (token) => {
const { componentCls, iconCls } = token;
return {
[`${componentCls}-success ${componentCls}-icon > ${iconCls}`]: { color: token.resultSuccessIconColor },
[`${componentCls}-error ${componentCls}-icon > ${iconCls}`]: { color: token.resultErrorIconColor },
[`${componentCls}-info ${componentCls}-icon > ${iconCls}`]: { color: token.resultInfoIconColor },
[`${componentCls}-warning ${componentCls}-icon > ${iconCls}`]: { color: token.resultWarningIconColor }
};
};
var genResultStyle = (token) => [genBaseStyle$5(token), genStatusIconStyle(token)];
var prepareComponentToken$12 = (token) => ({
titleFontSize: token.fontSizeHeading3,
subtitleFontSize: token.fontSize,
iconFontSize: token.fontSizeHeading3 * 3,
extraMargin: `${token.paddingLG}px 0 0 0`
});
var style_default$12 = genStyleHooks("Result", (token) => {
const resultInfoIconColor = token.colorInfo;
const resultErrorIconColor = token.colorError;
const resultSuccessIconColor = token.colorSuccess;
const resultWarningIconColor = token.colorWarning;
return genResultStyle(merge(token, {
resultInfoIconColor,
resultErrorIconColor,
resultSuccessIconColor,
resultWarningIconColor,
imageWidth: 250,
imageHeight: 295
}));
}, prepareComponentToken$12);
//#endregion
//#region node_modules/antd/es/result/unauthorized.js
var Unauthorized = () => /* @__PURE__ */ import_react.createElement("svg", {
width: "251",
height: "294"
}, /* @__PURE__ */ import_react.createElement("title", null, "Unauthorized"), /* @__PURE__ */ import_react.createElement("g", {
fill: "none",
fillRule: "evenodd"
}, /* @__PURE__ */ import_react.createElement("path", {
fill: "#E4EBF7",
d: "M0 129v-2C0 58.3 55.6 2.7 124.2 2.7h2c68.6 0 124.2 55.6 124.2 124.1v2.1c0 68.6-55.6 124.2-124.1 124.2h-2.1A124.2 124.2 0 0 1 0 129"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M41.4 133a8.2 8.2 0 1 1-16.4-1.7 8.2 8.2 0 0 1 16.4 1.6"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "m38.7 136.4 10.4 5.9m.9 6.2-12.6 10.7",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M41.5 161.3a5.6 5.6 0 1 1-11.2-1.2 5.6 5.6 0 0 1 11.2 1.2m17.7-16a5.7 5.7 0 1 1-11.3-1.2 5.7 5.7 0 0 1 11.3 1.2m41.2-115.8H130a4.6 4.6 0 1 0 0-9.1h-29.6a4.6 4.6 0 0 0 0 9.1m11.3 18.3h29.7a4.6 4.6 0 1 0 0-9.2h-29.7a4.6 4.6 0 1 0 0 9.2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M114 29.5h15.8a4.6 4.6 0 1 0 0 9.1H114a4.6 4.6 0 0 0 0-9.1m71.3 108.2a10 10 0 1 1-19.8-2 10 10 0 0 1 19.8 2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "m180.2 143.8 12.5 7.1m1.1 7.5-15.1 13",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M185.6 172a6.8 6.8 0 1 1-13.6-1.4 6.8 6.8 0 0 1 13.5 1.3m18.6-16.6a6.8 6.8 0 1 1-13.6-1.4 6.8 6.8 0 0 1 13.6 1.4"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "M153 194a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm73-75.8a2.2 2.2 0 1 1-4.5 0 2.2 2.2 0 0 1 4.4 0zm-9 34.9a2.2 2.2 0 1 1-4.3 0 2.2 2.2 0 0 1 4.4 0zm-39.2-43.3a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm18.3-15.3a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0zm6.7 88a2.2 2.2 0 1 1-4.4 0 2.2 2.2 0 0 1 4.4 0z",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#FFF",
d: "m215.1 155.3-1.9 20-10.8 6m-27.8-4.7-6.3 9.8H157l-4.5 6.4m23.4-65.5v-15.7m45.6 7.8-12.8 7.9-15.2-7.9V96.7",
strokeWidth: "2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A26EF4",
d: "M180.7 29.3a29.3 29.3 0 1 1 58.6 0 29.3 29.3 0 0 1-58.6 0"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "m221.4 41.7-21.5-.1a1.7 1.7 0 0 1-1.7-1.8V27.6a1.7 1.7 0 0 1 1.8-1.7h21.5c1 0 1.8.9 1.8 1.8l-.1 12.3a1.7 1.7 0 0 1-1.7 1.7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M215.1 29.2c0 2.6-2 4.6-4.5 4.6a4.6 4.6 0 0 1-4.5-4.7v-6.9c0-2.6 2-4.6 4.6-4.6 2.5 0 4.5 2 4.4 4.7v6.9zm-4.5-14a6.9 6.9 0 0 0-7 6.8v7.3a6.9 6.9 0 0 0 13.8.1V22a6.9 6.9 0 0 0-6.8-6.9zm-43 53.2h-4a4.7 4.7 0 0 1-4.7-4.8 4.7 4.7 0 0 1 4.7-4.7h4a4.7 4.7 0 0 1 4.7 4.8 4.7 4.7 0 0 1-4.7 4.7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#5BA02E",
d: "M168.2 248.8a6.6 6.6 0 0 1-6.6-6.6v-66a6.6 6.6 0 0 1 13.2 0v66a6.6 6.6 0 0 1-6.6 6.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#92C110",
d: "M176.1 248.2a6.6 6.6 0 0 1-6.6-6.6v-33a6.6 6.6 0 1 1 13.3 0v33a6.6 6.6 0 0 1-6.7 6.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#F2D7AD",
d: "M186 293.9h-27.4a3.2 3.2 0 0 1-3.2-3.2v-45.9a3.2 3.2 0 0 1 3.2-3.1H186a3.2 3.2 0 0 1 3.2 3.1v46a3.2 3.2 0 0 1-3.2 3"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M82 147.7s6.3-1 17.5-1.3c11.8-.4 17.6 1 17.6 1s3.7-3.8 1-8.3c1.3-12.1 6-32.9.3-48.3-1.1-1.4-3.7-1.5-7.5-.6-1.4.3-7.2-.2-8-.1l-15.3-.4-8-.5c-1.6-.1-4.3-1.7-5.5-.3-.4.4-2.4 5.6-2 16l8.7 35.7s-3.2 3.6 1.2 7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "m75.8 73.3-1-6.4 12-6.5s7.4-.1 8 1.2c.8 1.3-5.5 1-5.5 1s-1.9 1.4-2.6 2.5c-1.7 2.4-1 6.5-8.4 6-1.7.3-2.5 2.2-2.5 2.2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFB594",
d: "M52.4 77.7S66.7 87 77.4 92c1 .5-2 16.2-11.9 11.8-7.4-3.3-20.1-8.4-21.5-14.5-.7-3.2 2.6-7.6 8.4-11.7M142 80s-6.7 3-13.9 6.9c-3.9 2.1-10.1 4.7-12.3 8-6.2 9.3 3.5 11.2 13 7.5 6.6-2.7 29-12.1 13.2-22.4"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "m76.2 66.4 3 3.8S76.4 73 73 76c-7 6.2-12.8 14.3-16 16.4-4 2.7-9.7 3.3-12.2 0-3.5-5.1.5-14.7 31.5-26"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M64.7 85.1s-2.4 8.4-9 14.5c.7.5 18.6 10.5 22.2 10 5.2-.6 6.4-19 1.2-20.5-.8-.2-6-1.3-8.9-2.2-.9-.2-1.6-1.7-3.5-1l-2-.8zm63.7.7s5.3 2 7.3 13.8c-.6.2-17.6 12.3-21.8 7.8-6.6-7-.8-17.4 4.2-18.6 4.7-1.2 5-1.4 10.3-3"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M78.2 94.7s.9 7.4-5 13",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M87.4 94.7s3.1 2.6 10.3 2.6c7.1 0 9-3.5 9-3.5",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".9"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "m117.2 68.6-6.8-6.1s-5.4-4.4-9.2-1c-3.9 3.5 4.4 2.2 5.6 4.2 1.2 2.1.9 1.2-2 .5-5.7-1.4-2.1.9 3 5.3 2 1.9 7 1 7 1l2.4-3.9z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFB594",
d: "m105.3 91.3-.3-11H89l-.5 10.5c0 .4.2.8.6 1 2 1.3 9.3 5 15.8.4.2-.2.4-.5.4-.9"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#5C2552",
d: "M107.6 74.2c.8-1.1 1-9 1-11.9a1 1 0 0 0-1-1l-4.6-.4c-7.7-1-17 .6-18.3 6.3-5.4 5.9-.4 13.3-.4 13.3s2 3.5 4.3 6.8c.8 1 .4-3.8 3-6a47.9 47.9 0 0 1 16-7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "M88.4 83.2s2.7 6.2 11.6 6.5c7.8.3 9-7 7.5-17.5l-1-5.5c-6-2.9-15.4.6-15.4.6s-.6 2-.2 5.5c-2.3 2-1.8 5.6-1.8 5.6s-1-2-2-2.3c-.9-.3-2 0-2.3 2-1 4.6 3.6 5.1 3.6 5.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "m100.8 77.1 1.7-1-1-4.3.7-1.4",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#552950",
d: "M105.5 74c0 .8-.4 1.4-1 1.4-.4 0-.8-.7-.8-1.4s.5-1.2 1-1.2.9.6.8 1.3m-8 .2c0 .8-.4 1.3-.9 1.3s-.9-.6-.9-1.3c0-.7.5-1.3 1-1.3s1 .6.9 1.3"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M91.1 86.8s5.3 5 12.7 2.3",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#DB836E",
d: "M99.8 81.9s-3.6.2-1.5-2.8c1.6-1.5 5-.4 5-.4s1 3.9-3.5 3.2"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#5C2552",
d: "M102.9 70.6s2.5.8 3.4.7m-12.4.7s2.5-1.2 4.8-1.1",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.5"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M86.3 77.4s1 .9 1.5 2c-.4.6-1 1.2-.3 1.9m11.8 2.4s2 .2 2.5-.2",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "m87.8 115.8 15.7-3m-3.3 3 10-2m-43.7-27s-1.6 8.8-6.7 14M128.3 88s3 4 4 11.7",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M64 84.8s-6 10-13.5 10",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".8"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFC6A0",
d: "m112.4 66-.2 5.2 12 9.2c4.5 3.6 8.9 7.5 11 8.7 4.8 2.8 8.9 3.3 11 1.8 4.1-2.9 4.4-9.9-8.1-15.3-4.3-1.8-16.1-6.3-25.7-9.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#DB836E",
d: "M130.5 85.5s4.6 5.7 11.7 6.2",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: ".8"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#E4EBF7",
d: "M121.7 105.7s-.4 8.6-1.3 13.6",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M115.8 161.5s-3.6-1.5-2.7-7.1",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CBD1D1",
d: "M101.5 290.2s4.3 2.1 7.4 1c2.9-.9 4.6.7 7.2 1.3 2.5.5 6.9 1 11.7-1.3 0-5.6-7-4-12-6.8-2.6-1.4-3.8-4.7-3.6-8.8h-9.5s-1.4 10.6-1.2 14.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#2B0849",
d: "M101.5 290s2.4 1.4 6.8.7c3-.4 3.7.5 7.5 1 3.7.6 10.8 0 11.9-.8.4 1-.4 2-.4 2s-1.5.7-4.8.9c-2 .1-5.8.3-7.7-.5-1.8-1.4-5.2-2-5.7-.3-4 1-7.4-.3-7.4-.3l-.2-2.6z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A4AABA",
d: "M108.8 276.2h3.1s0 6.7 4.6 8.6c-4.7.6-8.6-2.3-7.7-8.6"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#CBD1D1",
d: "M57.6 272.5s-2 7.5-4.5 12.4c-1.8 3.7-4.2 7.6 5.5 7.6 6.7 0 9-.5 7.5-6.7-1.5-6.1.3-13.3.3-13.3h-8.8z"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#2B0849",
d: "M51.5 290s2.2 1.2 6.7 1.2c6.1 0 8.3-1.6 8.3-1.6s.6 1-.6 2.1c-1 .9-3.6 1.6-7.4 1.6-4.2 0-6-.6-6.8-1.2-.9-.5-.7-1.6-.2-2"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#A4AABA",
d: "M58.5 274.4s0 1.6-.3 3-1 3.1-1.1 4.2c0 1.1 4.5 1.5 5.2 0 .6-1.6 1.3-6.5 1.9-7.3.6-.8-5-2.1-5.7.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#7BB2F9",
d: "m100.9 277 13.3.1s1.3-54.2 1.8-64c.6-9.9 3.8-43.2 1-62.8l-12.4-.7-22.8.8-1.2 10c0 .4-.6.8-.7 1.3 0 .6.4 1.3.3 2-2.3 14-6.3 32.9-8.7 46.4-.1.6-1.2 1-1.4 2.6 0 .3.2 1.6 0 1.8-6.8 18.7-10.8 47.6-14.1 61.6h14.5s2.2-8.6 4-17a3984 3984 0 0 1 23-84.5l3-.5 1 46.1s-.2 1.2.4 2c.5.8-.6 1.1-.4 2.3l.4 1.7-1 11.9c-.4 4.6 0 39 0 39"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M77.4 220.4c1.2.1 4-2 7-4.9m23.1 8.4s2.8-1 6.1-3.8",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M108.5 221s2.7-1.2 6-4",
strokeLinecap: "round",
strokeLinejoin: "round"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M76.1 223.6s2.6-.6 6.5-3.4m4.7-69.4c-.2 3.1.3 8.5-4.3 9m21.8-10.7s.1 14-1.3 15c-2.2 1.6-3 1.9-3 1.9m.5-16.4s0 12.8-1.2 24.3m-4.9 1s7.2-1.6 9.4-1.6m-28.6 31.5-1 4.5s-1.5 1.8-1 3.7c.4 2-1 2-5 15.3-1.7 5.6-4.4 18.5-6.3 27.5l-4 18.4M77 196.7a313.3 313.3 0 0 1-.8 4.8m7.7-50-1.2 10.3s-1 .2-.5 2.3c.1 1.3-2.6 15.6-5.1 30.2M57.6 273h13.2",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#192064",
d: "M117.4 147.4s-17-3-35.7.2v4.2s14.6-2.9 35.5-.4l.2-4"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#FFF",
d: "M107.5 150.4v-5a.8.8 0 0 0-.8-.7H99a.8.8 0 0 0-.7.8v4.8c0 .5.3.9.8.8a140.8 140.8 0 0 1 7.7 0 .8.8 0 0 0 .8-.7"
}), /* @__PURE__ */ import_react.createElement("path", {
fill: "#192064",
d: "M106.4 149.4v-3a.6.6 0 0 0-.6-.7 94.1 94.1 0 0 0-5.8 0 .6.6 0 0 0-.7.7v3c0 .4.3.7.7.7h5.7c.4 0 .7-.3.7-.7"
}), /* @__PURE__ */ import_react.createElement("path", {
stroke: "#648BD8",
d: "M101.5 274h12.3m-11.1-5v6.5m0-12.4v4.3m-.5-93.4.9 44.4s.7 1.6-.2 2.7c-1 1.1 2.4.7.9 2.2-1.6 1.6.9 1.1 0 3.4-.6 1.5-1 21-1.1 35",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: "1.1"
})));
//#endregion
//#region node_modules/antd/es/result/index.js
var IconMap = {
success: RefIcon$1,
error: RefIcon$3,
info: RefIcon$4,
warning: RefIcon$33
};
var ExceptionMap = {
"404": NoFound,
"500": ServerError,
"403": Unauthorized
};
var ExceptionStatus = Object.keys(ExceptionMap);
var Icon = ({ icon, status, className, style }) => {
devUseWarning("Result")(!(typeof icon === "string" && icon.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`);
if (ExceptionStatus.includes(`${status}`)) {
const SVGComponent = ExceptionMap[status];
return /* @__PURE__ */ import_react.createElement("div", {
className,
style
}, /* @__PURE__ */ import_react.createElement(SVGComponent, null));
}
const iconNode = /* @__PURE__ */ import_react.createElement(IconMap[status]);
if (icon === null || icon === false) return null;
return /* @__PURE__ */ import_react.createElement("div", {
className,
style
}, icon || iconNode);
};
var Extra = ({ className, extra, style }) => {
if (!extra) return null;
return /* @__PURE__ */ import_react.createElement("div", {
className,
style
}, extra);
};
var Result = (props) => {
const { prefixCls: customizePrefixCls, className: customizeClassName, rootClassName, subTitle, title, style, children, status = "info", icon, extra, styles, classNames, ...rest } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("result");
const mergedProps = {
...props,
status
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const prefixCls = getPrefixCls("result", customizePrefixCls);
const [hashId, cssVarCls] = style_default$12(prefixCls);
const rootClassNames = clsx(prefixCls, `${prefixCls}-${status}`, customizeClassName, contextClassName, rootClassName, { [`${prefixCls}-rtl`]: direction === "rtl" }, hashId, cssVarCls, mergedClassNames.root);
const titleClassNames = clsx(`${prefixCls}-title`, mergedClassNames.title);
const subTitleClassNames = clsx(`${prefixCls}-subtitle`, mergedClassNames.subTitle);
const extraClassNames = clsx(`${prefixCls}-extra`, mergedClassNames.extra);
const bodyClassNames = clsx(`${prefixCls}-body`, mergedClassNames.body);
const iconClassNames = clsx(`${prefixCls}-icon`, { [`${prefixCls}-image`]: ExceptionStatus.includes(`${status}`) }, mergedClassNames.icon);
const rootStyles = {
...mergedStyles.root,
...contextStyle,
...style
};
const restProps = pickAttrs(rest, {
aria: true,
data: true
});
return /* @__PURE__ */ import_react.createElement("div", {
...restProps,
className: rootClassNames,
style: rootStyles
}, /* @__PURE__ */ import_react.createElement(Icon, {
className: iconClassNames,
style: mergedStyles.icon,
status,
icon
}), /* @__PURE__ */ import_react.createElement("div", {
className: titleClassNames,
style: mergedStyles.title
}, title), subTitle && /* @__PURE__ */ import_react.createElement("div", {
className: subTitleClassNames,
style: mergedStyles.subTitle
}, subTitle), /* @__PURE__ */ import_react.createElement(Extra, {
className: extraClassNames,
extra,
style: mergedStyles.extra
}), children && /* @__PURE__ */ import_react.createElement("div", {
className: bodyClassNames,
style: mergedStyles.body
}, children));
};
Result.PRESENTED_IMAGE_403 = ExceptionMap["403"];
Result.PRESENTED_IMAGE_404 = ExceptionMap["404"];
Result.PRESENTED_IMAGE_500 = ExceptionMap["500"];
Result.displayName = "Result";
//#endregion
//#region node_modules/antd/es/row/index.js
var row_default = Row$1;
//#endregion
//#region node_modules/antd/es/splitter/Panel.js
var InternalPanel = /* @__PURE__ */ (0, import_react.forwardRef)((props, ref) => {
const { prefixCls, className, children, size, style = {} } = props;
const panelClassName = clsx(`${prefixCls}-panel`, { [`${prefixCls}-panel-hidden`]: size === 0 }, className);
const hasSize = size !== void 0;
return /* @__PURE__ */ import_react.createElement("div", {
ref,
className: panelClassName,
style: {
...style,
flexBasis: hasSize ? size : "auto",
flexGrow: hasSize ? 0 : 1
}
}, children);
});
InternalPanel.displayName = "Panel";
var Panel$1 = () => null;
//#endregion
//#region node_modules/antd/es/splitter/hooks/useItems.js
function getCollapsible(collapsible) {
if (isPlainObject(collapsible)) return {
...collapsible,
showCollapsibleIcon: collapsible.showCollapsibleIcon === void 0 ? "auto" : collapsible.showCollapsibleIcon
};
const mergedCollapsible = !!collapsible;
return {
start: mergedCollapsible,
end: mergedCollapsible,
showCollapsibleIcon: "auto"
};
}
/**
* Convert `children` into `items`.
*/
function useItems$1(children) {
return import_react.useMemo(() => toArray$8(children).filter((item) => /* @__PURE__ */ import_react.isValidElement(item)).map((node) => {
const { props } = node;
const { collapsible, ...restProps } = props;
return {
...restProps,
collapsible: getCollapsible(collapsible)
};
}), [children]);
}
//#endregion
//#region node_modules/antd/es/splitter/hooks/useResizable.js
function getShowCollapsibleIcon(prev, next) {
if (prev.collapsible && next.collapsible) {
if (prev.showCollapsibleIcon === true || next.showCollapsibleIcon === true) return true;
if (prev.showCollapsibleIcon === "auto" || next.showCollapsibleIcon === "auto") return "auto";
return false;
}
if (prev.collapsible) return prev.showCollapsibleIcon;
if (next.collapsible) return next.showCollapsibleIcon;
return false;
}
function useResizable(items, pxSizes, reverse) {
return import_react.useMemo(() => {
const resizeInfos = [];
for (let i = 0; i < items.length - 1; i += 1) {
const prevItem = items[i];
const nextItem = items[i + 1];
const prevSize = pxSizes[i];
const nextSize = pxSizes[i + 1];
const { resizable: prevResizable = true, min: prevMin, collapsible: prevCollapsible } = prevItem;
const { resizable: nextResizable = true, min: nextMin, collapsible: nextCollapsible } = nextItem;
const mergedResizable = prevResizable && nextResizable && (prevSize !== 0 || !prevMin) && (nextSize !== 0 || !nextMin);
const prevEndCollapsible = !!prevCollapsible.end && prevSize > 0;
const nextStartExpandable = !!nextCollapsible.start && nextSize === 0 && prevSize > 0;
const startCollapsible = prevEndCollapsible || nextStartExpandable;
const nextStartCollapsible = !!nextCollapsible.start && nextSize > 0;
const prevEndExpandable = !!prevCollapsible.end && prevSize === 0 && nextSize > 0;
const endCollapsible = nextStartCollapsible || prevEndExpandable;
const showStartCollapsibleIcon = getShowCollapsibleIcon({
collapsible: prevEndCollapsible,
showCollapsibleIcon: prevCollapsible.showCollapsibleIcon
}, {
collapsible: nextStartExpandable,
showCollapsibleIcon: nextCollapsible.showCollapsibleIcon
});
const showEndCollapsibleIcon = getShowCollapsibleIcon({
collapsible: nextStartCollapsible,
showCollapsibleIcon: nextCollapsible.showCollapsibleIcon
}, {
collapsible: prevEndExpandable,
showCollapsibleIcon: prevCollapsible.showCollapsibleIcon
});
resizeInfos[i] = {
resizable: mergedResizable,
startCollapsible: !!(reverse ? endCollapsible : startCollapsible),
endCollapsible: !!(reverse ? startCollapsible : endCollapsible),
showStartCollapsibleIcon: reverse ? showEndCollapsibleIcon : showStartCollapsibleIcon,
showEndCollapsibleIcon: reverse ? showStartCollapsibleIcon : showEndCollapsibleIcon
};
}
return resizeInfos;
}, [
pxSizes,
items,
reverse
]);
}
//#endregion
//#region node_modules/antd/es/splitter/hooks/sizeUtil.js
function autoPtgSizes(ptgSizes, minPtgSizes, maxPtgSizes) {
let currentTotalPtg = 0;
const undefinedIndexes = [];
ptgSizes.forEach((size, index) => {
if (size === void 0) undefinedIndexes.push(index);
else currentTotalPtg += size;
});
const restPtg = 1 - currentTotalPtg;
const undefinedCount = undefinedIndexes.length;
if (ptgSizes.length && !undefinedIndexes.length && currentTotalPtg !== 1) {
if (currentTotalPtg === 0) {
const avg = 1 / ptgSizes.length;
return ptgSizes.map(() => avg);
}
const scale = 1 / currentTotalPtg;
return ptgSizes.map((size) => size * scale);
}
if (restPtg < 0) {
const scale = 1 / currentTotalPtg;
return ptgSizes.map((size) => size === void 0 ? 0 : size * scale);
}
let sumMin = 0;
let sumMax = 0;
let limitMin = 0;
let limitMax = 1;
for (const index of undefinedIndexes) {
const min = minPtgSizes[index] || 0;
const max = maxPtgSizes[index] || 1;
sumMin += min;
sumMax += max;
limitMin = Math.max(limitMin, min);
limitMax = Math.min(limitMax, max);
}
if (sumMin > 1 && sumMax < 1) {
const avg = 1 / undefinedCount;
return ptgSizes.map((size) => size === void 0 ? avg : size);
}
const restAvg = restPtg / undefinedCount;
if (limitMin <= restAvg && restAvg <= limitMax) return ptgSizes.map((size) => size === void 0 ? restAvg : size);
const result = _toConsumableArray$8(ptgSizes);
let remain = restPtg - sumMin;
for (let i = 0; i < undefinedCount; i += 1) {
const index = undefinedIndexes[i];
const min = minPtgSizes[index] || 0;
const max = maxPtgSizes[index] || 1;
result[index] = min;
const canAdd = max - min;
const add = Math.min(canAdd, remain);
result[index] += add;
remain -= add;
}
return result;
}
//#endregion
//#region node_modules/antd/es/splitter/hooks/useSizes.js
function getPtg(str) {
return Number(str.slice(0, -1)) / 100;
}
function isPtg(itemSize) {
return typeof itemSize === "string" && itemSize.endsWith("%");
}
/**
* Save the size state.
* Align the size into flex percentage base.
*/
function useSizes(items, containerSize) {
const propSizes = items.map((item) => item.size);
const itemsCount = items.length;
const mergedContainerSize = containerSize || 0;
const ptg2px = (ptg) => ptg * mergedContainerSize;
const [innerSizes, setInnerSizes] = import_react.useState(() => items.map((item) => item.defaultSize));
const sizes = import_react.useMemo(() => {
return propSizes.some(isNonNullable) ? propSizes : innerSizes;
}, [
itemsCount,
innerSizes,
propSizes
]);
const postPercentMinSizes = import_react.useMemo(() => items.map((item) => {
if (isPtg(item.min)) return getPtg(item.min);
return (item.min || 0) / mergedContainerSize;
}), [items, mergedContainerSize]);
const postPercentMaxSizes = import_react.useMemo(() => items.map((item) => {
if (isPtg(item.max)) return getPtg(item.max);
return (item.max || mergedContainerSize) / mergedContainerSize;
}), [items, mergedContainerSize]);
const postPercentSizes = import_react.useMemo(() => {
const ptgList = [];
for (let i = 0; i < itemsCount; i += 1) {
const itemSize = sizes[i];
if (isPtg(itemSize)) ptgList[i] = getPtg(itemSize);
else if (itemSize || itemSize === 0) {
const num = Number(itemSize);
if (!Number.isNaN(num)) ptgList[i] = num / mergedContainerSize;
} else ptgList[i] = void 0;
}
return autoPtgSizes(ptgList, postPercentMinSizes, postPercentMaxSizes);
}, [
itemsCount,
sizes,
mergedContainerSize,
postPercentMinSizes,
postPercentMaxSizes
]);
const postPxSizes = import_react.useMemo(() => postPercentSizes.map(ptg2px), [postPercentSizes, mergedContainerSize]);
return [
import_react.useMemo(() => containerSize ? postPxSizes : sizes, [
postPxSizes,
sizes,
containerSize
]),
postPxSizes,
postPercentSizes,
postPercentMinSizes,
postPercentMaxSizes,
setInnerSizes
];
}
//#endregion
//#region node_modules/antd/es/splitter/hooks/useResize.js
/**
* Handle user drag resize logic.
*/
function useResize(items, resizableInfos, percentSizes, containerSize, updateSizes, reverse) {
const limitSizes = items.map((item) => [item.min, item.max]);
const mergedContainerSize = containerSize || 0;
const ptg2px = (ptg) => ptg * mergedContainerSize;
function getLimitSize(str, defaultLimit) {
if (typeof str === "string") return ptg2px(getPtg(str));
return str ?? defaultLimit;
}
const [cacheSizes, setCacheSizes] = import_react.useState([]);
const cacheCollapsedSizeRef = import_react.useRef([]);
/**
* When start drag, check the direct is `start` or `end`.
* This will handle when 2 splitter bar are in the same position.
*/
const [movingIndex, setMovingIndex] = import_react.useState(null);
const getPxSizes = () => percentSizes.map(ptg2px);
const onOffsetStart = (index) => {
setCacheSizes(getPxSizes());
setMovingIndex({
index,
confirmed: false
});
};
const onOffsetUpdate = (index, offset) => {
let confirmedIndex = null;
if ((!movingIndex || !movingIndex.confirmed) && offset !== 0) {
if (offset > 0) {
confirmedIndex = index;
setMovingIndex({
index,
confirmed: true
});
} else for (let i = index; i >= 0; i -= 1) if (cacheSizes[i] > 0 && resizableInfos[i].resizable) {
confirmedIndex = i;
setMovingIndex({
index: i,
confirmed: true
});
break;
}
}
const mergedIndex = confirmedIndex ?? movingIndex?.index ?? index;
const numSizes = _toConsumableArray$8(cacheSizes);
const nextIndex = mergedIndex + 1;
const startMinSize = getLimitSize(limitSizes[mergedIndex][0], 0);
const endMinSize = getLimitSize(limitSizes[nextIndex][0], 0);
const startMaxSize = getLimitSize(limitSizes[mergedIndex][1], mergedContainerSize);
const endMaxSize = getLimitSize(limitSizes[nextIndex][1], mergedContainerSize);
let mergedOffset = offset;
if (numSizes[mergedIndex] + mergedOffset < startMinSize) mergedOffset = startMinSize - numSizes[mergedIndex];
if (numSizes[nextIndex] - mergedOffset < endMinSize) mergedOffset = numSizes[nextIndex] - endMinSize;
if (numSizes[mergedIndex] + mergedOffset > startMaxSize) mergedOffset = startMaxSize - numSizes[mergedIndex];
if (numSizes[nextIndex] - mergedOffset > endMaxSize) mergedOffset = numSizes[nextIndex] - endMaxSize;
numSizes[mergedIndex] += mergedOffset;
numSizes[nextIndex] -= mergedOffset;
updateSizes(numSizes);
return numSizes;
};
const onOffsetEnd = () => {
setMovingIndex(null);
};
const onCollapse = (index, type) => {
const currentSizes = getPxSizes();
const adjustedType = reverse ? type === "start" ? "end" : "start" : type;
const currentIndex = adjustedType === "start" ? index : index + 1;
const targetIndex = adjustedType === "start" ? index + 1 : index;
const currentSize = currentSizes[currentIndex];
const targetSize = currentSizes[targetIndex];
if (currentSize !== 0 && targetSize !== 0) {
currentSizes[currentIndex] = 0;
currentSizes[targetIndex] += currentSize;
cacheCollapsedSizeRef.current[index] = currentSize;
} else {
const totalSize = currentSize + targetSize;
const currentSizeMin = getLimitSize(limitSizes[currentIndex][0], 0);
const currentSizeMax = getLimitSize(limitSizes[currentIndex][1], mergedContainerSize);
const targetSizeMin = getLimitSize(limitSizes[targetIndex][0], 0);
const targetSizeMax = getLimitSize(limitSizes[targetIndex][1], mergedContainerSize);
const limitStart = Math.max(currentSizeMin, totalSize - targetSizeMax);
const limitEnd = Math.min(currentSizeMax, totalSize - targetSizeMin);
const halfOffset = targetSizeMin || (limitEnd - limitStart) / 2;
const targetCacheCollapsedSize = cacheCollapsedSizeRef.current[index];
const currentCacheCollapsedSize = totalSize - targetCacheCollapsedSize;
if (targetCacheCollapsedSize && targetCacheCollapsedSize <= targetSizeMax && targetCacheCollapsedSize >= targetSizeMin && currentCacheCollapsedSize <= currentSizeMax && currentCacheCollapsedSize >= currentSizeMin) {
currentSizes[targetIndex] = targetCacheCollapsedSize;
currentSizes[currentIndex] = currentCacheCollapsedSize;
} else {
currentSizes[currentIndex] -= halfOffset;
currentSizes[targetIndex] += halfOffset;
}
}
updateSizes(currentSizes);
return currentSizes;
};
return [
onOffsetStart,
onOffsetUpdate,
onOffsetEnd,
onCollapse,
movingIndex?.index
];
}
//#endregion
//#region node_modules/antd/es/splitter/SplitBar.js
var getValidNumber = (num) => {
return isNumber(num) && Number.isFinite(num) ? Math.round(num) : 0;
};
var DOUBLE_CLICK_TIME_GAP = 300;
var SplitBar = (props) => {
const { prefixCls, rootPrefixCls, vertical, index, active, ariaNow, ariaMin, ariaMax, resizable, draggerIcon, draggerStyle, draggerClassName, collapsibleIcon, startCollapsible, endCollapsible, onDraggerDoubleClick, onOffsetStart, onOffsetUpdate, onOffsetEnd, onCollapse, lazy, containerSize, showStartCollapsibleIcon, showEndCollapsibleIcon } = props;
const splitBarPrefixCls = `${prefixCls}-bar`;
const lastClickTimeRef = (0, import_react.useRef)(0);
const [varName] = genCssVar(rootPrefixCls, "splitter");
const [startPos, setStartPos] = (0, import_react.useState)(null);
const [constrainedOffset, setConstrainedOffset] = (0, import_react.useState)(0);
const constrainedOffsetX = vertical ? 0 : constrainedOffset;
const constrainedOffsetY = vertical ? constrainedOffset : 0;
const onMouseDown = (e) => {
e.stopPropagation();
const currentTime = Date.now();
const timeGap = currentTime - lastClickTimeRef.current;
if (timeGap > 0 && timeGap < DOUBLE_CLICK_TIME_GAP) return;
lastClickTimeRef.current = currentTime;
if (resizable && e.currentTarget) {
setStartPos([e.pageX, e.pageY]);
onOffsetStart(index);
}
};
const onTouchStart = (e) => {
if (resizable && e.touches.length === 1) {
const touch = e.touches[0];
setStartPos([touch.pageX, touch.pageY]);
onOffsetStart(index);
}
};
const getConstrainedOffset = (rawOffset) => {
const currentPos = containerSize * ariaNow / 100;
const newPos = currentPos + rawOffset;
const minAllowed = Math.max(0, containerSize * ariaMin / 100);
const maxAllowed = Math.min(containerSize, containerSize * ariaMax / 100);
return Math.max(minAllowed, Math.min(maxAllowed, newPos)) - currentPos;
};
const handleLazyMove = useEvent((offsetX, offsetY) => {
setConstrainedOffset(getConstrainedOffset(vertical ? offsetY : offsetX));
});
const handleLazyEnd = useEvent(() => {
onOffsetUpdate(index, constrainedOffsetX, constrainedOffsetY, true);
setConstrainedOffset(0);
onOffsetEnd(true);
});
const getVisibilityClass = (mode) => {
switch (mode) {
case true: return `${splitBarPrefixCls}-collapse-bar-always-visible`;
case false: return `${splitBarPrefixCls}-collapse-bar-always-hidden`;
case "auto": return `${splitBarPrefixCls}-collapse-bar-hover-only`;
}
};
useLayoutEffect$1(() => {
if (!startPos) return;
const onMouseMove = (e) => {
const { pageX, pageY } = e;
const offsetX = pageX - startPos[0];
const offsetY = pageY - startPos[1];
if (lazy) handleLazyMove(offsetX, offsetY);
else onOffsetUpdate(index, offsetX, offsetY);
};
const onMouseUp = () => {
if (lazy) handleLazyEnd();
else onOffsetEnd();
setStartPos(null);
};
const handleTouchMove = (e) => {
if (e.touches.length === 1) {
const touch = e.touches[0];
const offsetX = touch.pageX - startPos[0];
const offsetY = touch.pageY - startPos[1];
if (lazy) handleLazyMove(offsetX, offsetY);
else onOffsetUpdate(index, offsetX, offsetY);
}
};
const handleTouchEnd = () => {
if (lazy) handleLazyEnd();
else onOffsetEnd();
setStartPos(null);
};
const eventHandlerMap = {
mousemove: onMouseMove,
mouseup: onMouseUp,
touchmove: handleTouchMove,
touchend: handleTouchEnd
};
for (const [event, handler] of Object.entries(eventHandlerMap)) window.addEventListener(event, handler);
return () => {
for (const [event, handler] of Object.entries(eventHandlerMap)) window.removeEventListener(event, handler);
};
}, [
startPos,
index,
lazy
]);
const transformStyle = { [varName("bar-preview-offset")]: `${constrainedOffset}px` };
const [startIcon, endIcon, startCustomize, endCustomize] = import_react.useMemo(() => {
let startIcon = null;
let endIcon = null;
const startCustomize = collapsibleIcon?.start !== void 0;
const endCustomize = collapsibleIcon?.end !== void 0;
if (vertical) {
startIcon = startCustomize ? collapsibleIcon.start : /* @__PURE__ */ import_react.createElement(RefIcon$15, null);
endIcon = endCustomize ? collapsibleIcon.end : /* @__PURE__ */ import_react.createElement(RefIcon$8, null);
} else {
startIcon = startCustomize ? collapsibleIcon.start : /* @__PURE__ */ import_react.createElement(RefIcon$12, null);
endIcon = endCustomize ? collapsibleIcon.end : /* @__PURE__ */ import_react.createElement(RefIcon$6, null);
}
return [
startIcon,
endIcon,
startCustomize,
endCustomize
];
}, [collapsibleIcon, vertical]);
return /* @__PURE__ */ import_react.createElement("div", {
className: splitBarPrefixCls,
role: "separator",
"aria-valuenow": getValidNumber(ariaNow),
"aria-valuemin": getValidNumber(ariaMin),
"aria-valuemax": getValidNumber(ariaMax)
}, lazy && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${splitBarPrefixCls}-preview`, { [`${splitBarPrefixCls}-preview-active`]: !!constrainedOffset }),
style: transformStyle
}), /* @__PURE__ */ import_react.createElement("div", {
style: draggerStyle,
className: clsx(`${splitBarPrefixCls}-dragger`, {
[`${splitBarPrefixCls}-dragger-disabled`]: !resizable,
[`${splitBarPrefixCls}-dragger-active`]: active,
[`${splitBarPrefixCls}-dragger-customize`]: draggerIcon !== void 0
}, draggerClassName?.default, active && draggerClassName?.active),
onMouseDown,
onTouchStart,
onDoubleClick: () => onDraggerDoubleClick?.(index)
}, draggerIcon !== void 0 ? /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${splitBarPrefixCls}-dragger-icon`) }, draggerIcon) : null), startCollapsible && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${splitBarPrefixCls}-collapse-bar`, `${splitBarPrefixCls}-collapse-bar-start`, { [`${splitBarPrefixCls}-collapse-bar-customize`]: startCustomize }, getVisibilityClass(showStartCollapsibleIcon)),
onClick: () => onCollapse(index, "start")
}, /* @__PURE__ */ import_react.createElement("span", { className: clsx(`${splitBarPrefixCls}-collapse-icon`, `${splitBarPrefixCls}-collapse-start`) }, startIcon)), endCollapsible && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${splitBarPrefixCls}-collapse-bar`, `${splitBarPrefixCls}-collapse-bar-end`, { [`${splitBarPrefixCls}-collapse-bar-customize`]: endCustomize }, getVisibilityClass(showEndCollapsibleIcon)),
onClick: () => onCollapse(index, "end")
}, /* @__PURE__ */ import_react.createElement("span", { className: clsx(`${splitBarPrefixCls}-collapse-icon`, `${splitBarPrefixCls}-collapse-end`) }, endIcon)));
};
//#endregion
//#region node_modules/antd/es/splitter/style/index.js
var centerStyle = {
position: "absolute",
top: "50%",
left: {
_skip_check_: true,
value: "50%"
},
transform: "translate(-50%, -50%)"
};
var genSplitterStyle = (token) => {
const { componentCls, colorFill, splitBarDraggableSize, splitBarSize, splitTriggerSize, controlItemBgHover, controlItemBgActive, controlItemBgActiveHover, colorPrimary, antCls, calc } = token;
const [, varRef] = genCssVar(antCls, "splitter");
const splitBarCls = `${componentCls}-bar`;
const splitMaskCls = `${componentCls}-mask`;
const splitPanelCls = `${componentCls}-panel`;
const halfTriggerSize = calc(splitTriggerSize).div(2).equal();
const splitterBarPreviewStyle = {
position: "absolute",
background: token.colorPrimary,
opacity: .2,
pointerEvents: "none",
transition: "none",
zIndex: 1,
display: "none"
};
return { [componentCls]: {
...resetComponent(token),
display: "flex",
width: "100%",
height: "100%",
alignItems: "stretch",
[`> ${splitBarCls}`]: {
flex: "none",
position: "relative",
userSelect: "none",
[`${splitBarCls}-dragger`]: {
...centerStyle,
zIndex: 1,
"&::before": {
content: "\"\"",
background: controlItemBgHover,
...centerStyle
},
"&::after": {
content: "\"\"",
background: colorFill,
...centerStyle
},
[`&:hover:not(${splitBarCls}-dragger-active)`]: { "&::before": { background: controlItemBgActive } },
"&-active": {
zIndex: 2,
"&::before": { background: controlItemBgActiveHover }
},
[`&-active${splitBarCls}-dragger-customize`]: { [`${splitBarCls}-dragger-icon`]: { color: colorPrimary } },
[`&-disabled${splitBarCls}-dragger`]: {
zIndex: 0,
"&, &:hover, &-active": {
cursor: "default",
"&::before": { background: controlItemBgHover }
},
"&::after": { display: "none" },
[`${splitBarCls}-dragger-icon`]: { display: "none" }
},
"&-customize": {
[`${splitBarCls}-dragger-icon`]: {
...centerStyle,
display: "flex",
alignItems: "center",
color: colorFill
},
"&::after": { display: "none" }
}
},
[`${splitBarCls}-collapse-bar`]: {
...centerStyle,
zIndex: token.zIndexPopupBase,
background: controlItemBgHover,
fontSize: token.fontSizeSM,
borderRadius: token.borderRadiusXS,
color: token.colorText,
cursor: "pointer",
opacity: 0,
display: "flex",
alignItems: "center",
justifyContent: "center",
[`&:hover:not(${splitBarCls}-collapse-bar-customize)`]: { background: controlItemBgActive },
[`&:active:not(${splitBarCls}-collapse-bar-customize)`]: { background: controlItemBgActiveHover },
[`${splitBarCls}-collapse-icon`]: {
display: "flex",
alignItems: "center"
}
},
[`${splitBarCls}-collapse-bar-customize`]: { background: "transparent" },
"&:hover, &:active": { [`${splitBarCls}-collapse-bar-hover-only`]: { opacity: 1 } },
[`${splitBarCls}-collapse-bar-hover-only`]: { "@media(hover:none)": { opacity: 1 } },
[`${splitBarCls}-collapse-bar-always-hidden`]: { display: "none" },
[`${splitBarCls}-collapse-bar-always-visible`]: { opacity: 1 }
},
[splitMaskCls]: {
position: "fixed",
zIndex: token.zIndexPopupBase,
inset: 0,
"&-horizontal": { cursor: "col-resize" },
"&-vertical": { cursor: "row-resize" }
},
"&-horizontal": {
flexDirection: "row",
[`> ${splitBarCls}`]: {
width: 0,
[`${splitBarCls}-preview`]: {
height: "100%",
width: splitBarSize,
...splitterBarPreviewStyle,
[`&${splitBarCls}-preview-active`]: {
display: "block",
transform: `translate3d(${varRef("bar-preview-offset")}, 0, 0)`
}
},
[`${splitBarCls}-dragger`]: {
cursor: "col-resize",
height: "100%",
width: splitTriggerSize,
"&::before": {
height: "100%",
width: splitBarSize
},
"&::after": {
height: splitBarDraggableSize,
width: splitBarSize
}
},
[`${splitBarCls}-collapse-bar`]: {
width: token.fontSizeSM,
height: token.controlHeightSM,
"&-start": {
left: {
_skip_check_: true,
value: "auto"
},
right: {
_skip_check_: true,
value: halfTriggerSize
},
transform: "translateY(-50%)"
},
"&-end": {
left: {
_skip_check_: true,
value: halfTriggerSize
},
right: {
_skip_check_: true,
value: "auto"
},
transform: "translateY(-50%)"
}
}
}
},
"&-vertical": {
flexDirection: "column",
[`> ${splitBarCls}`]: {
height: 0,
[`${splitBarCls}-preview`]: {
height: splitBarSize,
width: "100%",
...splitterBarPreviewStyle,
[`&${splitBarCls}-preview-active`]: {
display: "block",
transform: `translate3d(0, ${varRef("bar-preview-offset")}, 0)`
}
},
[`${splitBarCls}-dragger`]: {
cursor: "row-resize",
width: "100%",
height: splitTriggerSize,
"&::before": {
width: "100%",
height: splitBarSize
},
"&::after": {
width: splitBarDraggableSize,
height: splitBarSize
}
},
[`${splitBarCls}-collapse-bar`]: {
height: token.fontSizeSM,
width: token.controlHeightSM,
"&-start": {
top: "auto",
bottom: halfTriggerSize,
transform: "translateX(-50%)"
},
"&-end": {
top: halfTriggerSize,
bottom: "auto",
transform: "translateX(-50%)"
}
}
}
},
[splitPanelCls]: {
overflow: "auto",
padding: "0 1px",
scrollbarWidth: "thin",
boxSizing: "border-box",
"&-hidden": {
padding: 0,
overflow: "hidden"
},
[`&:has(${componentCls}:only-child)`]: { overflow: "hidden" }
}
} };
};
var prepareComponentToken$11 = (token) => {
const splitBarSize = token.splitBarSize || 2;
const splitTriggerSize = token.splitTriggerSize || 6;
const resizeSpinnerSize = token.resizeSpinnerSize || 20;
return {
splitBarSize,
splitTriggerSize,
splitBarDraggableSize: token.splitBarDraggableSize ?? resizeSpinnerSize,
resizeSpinnerSize
};
};
var style_default$11 = genStyleHooks("Splitter", genSplitterStyle, prepareComponentToken$11);
//#endregion
//#region node_modules/antd/es/splitter/Splitter.js
var Splitter$1 = (props) => {
const { prefixCls: customizePrefixCls, className, classNames, style, styles, layout, orientation, vertical, children, draggerIcon, collapsibleIcon, rootClassName, onDraggerDoubleClick, onResizeStart, onResize, onResizeEnd, lazy } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("splitter");
const prefixCls = getPrefixCls("splitter", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$11(prefixCls, rootCls);
const [mergedOrientation, isVertical] = useOrientation(orientation, vertical, layout);
const isRTL = direction === "rtl";
const reverse = !isVertical && isRTL;
const items = useItems$1(children);
{
const warning = devUseWarning("Splitter");
const existSize = items.some((item) => item.size !== void 0);
const existUndefinedSize = items.some((item) => item.size === void 0);
if (existSize && existUndefinedSize && !onResize) warning(false, "usage", "When part of `Splitter.Panel` has `size`, `onResize` is required or change `size` to `defaultSize`.");
warning.deprecated(!layout, "layout", "orientation");
}
const [containerSize, setContainerSize] = (0, import_react.useState)();
const onContainerResize = (size) => {
const { offsetWidth, offsetHeight } = size;
const containerSize = isVertical ? offsetHeight : offsetWidth;
if (containerSize === 0) return;
setContainerSize(containerSize);
};
const [panelSizes, itemPxSizes, itemPtgSizes, itemPtgMinSizes, itemPtgMaxSizes, updateSizes] = useSizes(items, containerSize);
const resizableInfos = useResizable(items, itemPxSizes, reverse);
const [onOffsetStart, onOffsetUpdate, onOffsetEnd, onCollapse, movingIndex] = useResize(items, resizableInfos, itemPtgSizes, containerSize, updateSizes, reverse);
const onInternalResizeStart = useEvent((index) => {
onOffsetStart(index);
onResizeStart?.(itemPxSizes);
});
const onInternalResizeUpdate = useEvent((index, offset, lazyEnd) => {
const nextSizes = onOffsetUpdate(index, offset);
if (lazyEnd) onResizeEnd?.(nextSizes);
else onResize?.(nextSizes);
});
const onInternalResizeEnd = useEvent((lazyEnd) => {
onOffsetEnd();
if (!lazyEnd) onResizeEnd?.(itemPxSizes);
});
const onInternalCollapse = useEvent((index, type) => {
const nextSizes = onCollapse(index, type);
onResize?.(nextSizes);
onResizeEnd?.(nextSizes);
const collapsed = nextSizes.map((size) => Math.abs(size) < Number.EPSILON);
props.onCollapse?.(collapsed, nextSizes);
});
const mergedProps = {
...props,
vertical: isVertical,
orientation: mergedOrientation
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { dragger: { _default: "default" } });
const containerClassName = clsx(prefixCls, className, `${prefixCls}-${mergedOrientation}`, { [`${prefixCls}-rtl`]: isRTL }, rootClassName, mergedClassNames.root, contextClassName, cssVarCls, rootCls, hashId);
const maskCls = `${prefixCls}-mask`;
const stackSizes = import_react.useMemo(() => {
const mergedSizes = [];
let stack = 0;
const len = items.length;
for (let i = 0; i < len; i += 1) {
stack += itemPtgSizes[i];
mergedSizes.push(stack);
}
return mergedSizes;
}, [itemPtgSizes, items.length]);
const mergedStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: onContainerResize }, /* @__PURE__ */ import_react.createElement("div", {
style: mergedStyle,
className: containerClassName
}, items.map((item, idx) => {
const panelProps = {
...item,
className: clsx(mergedClassNames.panel, item.className),
style: {
...mergedStyles.panel,
...item.style
}
};
const panel = /* @__PURE__ */ import_react.createElement(InternalPanel, {
...panelProps,
prefixCls,
size: panelSizes[idx]
});
let splitBar = null;
const resizableInfo = resizableInfos[idx];
if (resizableInfo) {
const ariaMinStart = (stackSizes[idx - 1] || 0) + itemPtgMinSizes[idx];
const ariaMinEnd = (stackSizes[idx + 1] || 100) - itemPtgMaxSizes[idx + 1];
const ariaMaxStart = (stackSizes[idx - 1] || 0) + itemPtgMaxSizes[idx];
const ariaMaxEnd = (stackSizes[idx + 1] || 100) - itemPtgMinSizes[idx + 1];
splitBar = /* @__PURE__ */ import_react.createElement(SplitBar, {
lazy,
index: idx,
active: movingIndex === idx,
prefixCls,
rootPrefixCls,
vertical: isVertical,
resizable: resizableInfo.resizable,
draggerStyle: mergedStyles.dragger,
draggerClassName: mergedClassNames.dragger,
draggerIcon,
collapsibleIcon,
ariaNow: stackSizes[idx] * 100,
ariaMin: Math.max(ariaMinStart, ariaMinEnd) * 100,
ariaMax: Math.min(ariaMaxStart, ariaMaxEnd) * 100,
startCollapsible: resizableInfo.startCollapsible,
endCollapsible: resizableInfo.endCollapsible,
showStartCollapsibleIcon: resizableInfo.showStartCollapsibleIcon,
showEndCollapsibleIcon: resizableInfo.showEndCollapsibleIcon,
onDraggerDoubleClick,
onOffsetStart: onInternalResizeStart,
onOffsetUpdate: (index, offsetX, offsetY, lazyEnd) => {
let offset = isVertical ? offsetY : offsetX;
if (reverse) offset = -offset;
onInternalResizeUpdate(index, offset, lazyEnd);
},
onOffsetEnd: onInternalResizeEnd,
onCollapse: onInternalCollapse,
containerSize: containerSize || 0
});
}
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, { key: `split-panel-${idx}` }, panel, splitBar);
}), isNumber(movingIndex) && /* @__PURE__ */ import_react.createElement("div", {
"aria-hidden": true,
className: clsx(maskCls, `${maskCls}-${mergedOrientation}`)
})));
};
Splitter$1.displayName = "Splitter";
//#endregion
//#region node_modules/antd/es/splitter/index.js
var Splitter = Splitter$1;
Splitter.Panel = Panel$1;
//#endregion
//#region node_modules/antd/es/statistic/Number.js
var StatisticNumber = (props) => {
const { value, formatter, precision, decimalSeparator, groupSeparator = "", prefixCls } = props;
let valueNode;
if (typeof formatter === "function") valueNode = formatter(value);
else {
const val = String(value);
const cells = val.match(/^(-?)(\d*)(\.(\d+))?$/);
if (!cells || val === "-") valueNode = val;
else {
const negative = cells[1];
let int = cells[2] || "0";
let decimal = cells[4] || "";
int = int.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
if (isNumber(precision)) decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
if (decimal) decimal = `${decimalSeparator}${decimal}`;
valueNode = [/* @__PURE__ */ import_react.createElement("span", {
key: "int",
className: `${prefixCls}-content-value-int`
}, negative, int), decimal && /* @__PURE__ */ import_react.createElement("span", {
key: "decimal",
className: `${prefixCls}-content-value-decimal`
}, decimal)];
}
}
return /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-content-value` }, valueNode);
};
//#endregion
//#region node_modules/antd/es/statistic/style/index.js
var genStatisticStyle = (token) => {
const { componentCls, marginXXS, padding, colorTextDescription, titleFontSize, colorTextHeading, contentFontSize, fontFamily } = token;
return { [componentCls]: {
...resetComponent(token),
[`${componentCls}-header`]: {
paddingBottom: marginXXS,
[`${componentCls}-title`]: {
color: colorTextDescription,
fontSize: titleFontSize
}
},
[`${componentCls}-skeleton`]: { paddingTop: padding },
[`${componentCls}-content`]: {
color: colorTextHeading,
fontSize: contentFontSize,
fontFamily,
[`${componentCls}-content-value`]: {
display: "inline-block",
direction: "ltr"
},
[`${componentCls}-content-prefix, ${componentCls}-content-suffix`]: { display: "inline-block" },
[`${componentCls}-content-prefix`]: { marginInlineEnd: marginXXS },
[`${componentCls}-content-suffix`]: { marginInlineStart: marginXXS }
}
} };
};
var prepareComponentToken$10 = (token) => {
const { fontSizeHeading3, fontSize } = token;
return {
titleFontSize: fontSize,
contentFontSize: fontSizeHeading3
};
};
var style_default$10 = genStyleHooks("Statistic", (token) => {
return genStatisticStyle(merge(token, {}));
}, prepareComponentToken$10);
//#endregion
//#region node_modules/antd/es/statistic/Statistic.js
var Statistic = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, rootClassName, style, valueStyle, value = 0, title, valueRender, prefix, suffix, loading = false, formatter, precision, decimalSeparator = ".", groupSeparator = ",", onMouseEnter, onMouseLeave, styles, classNames, ...rest } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("statistic");
const prefixCls = getPrefixCls("statistic", customizePrefixCls);
const [hashId, cssVarCls] = style_default$10(prefixCls);
const mergedProps = {
...props,
decimalSeparator,
groupSeparator,
loading,
value
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
{
const warning = devUseWarning("Statistic");
[["valueStyle", "styles.content"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
const valueNode = /* @__PURE__ */ import_react.createElement(StatisticNumber, {
decimalSeparator,
groupSeparator,
prefixCls,
formatter,
precision,
value
});
const rootClassNames = clsx(prefixCls, { [`${prefixCls}-rtl`]: direction === "rtl" }, contextClassName, className, rootClassName, mergedClassNames.root, hashId, cssVarCls);
const headerClassNames = clsx(`${prefixCls}-header`, mergedClassNames.header);
const titleClassNames = clsx(`${prefixCls}-title`, mergedClassNames.title);
const contentClassNames = clsx(`${prefixCls}-content`, mergedClassNames.content);
const prefixClassNames = clsx(`${prefixCls}-content-prefix`, mergedClassNames.prefix);
const suffixClassNames = clsx(`${prefixCls}-content-suffix`, mergedClassNames.suffix);
const internalRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({ nativeElement: internalRef.current }));
const restProps = pickAttrs(rest, {
aria: true,
data: true
});
return /* @__PURE__ */ import_react.createElement("div", {
...restProps,
className: rootClassNames,
style: {
...mergedStyles.root,
...contextStyle,
...style
},
ref: internalRef,
onMouseEnter,
onMouseLeave
}, title && /* @__PURE__ */ import_react.createElement("div", {
className: headerClassNames,
style: mergedStyles.header
}, /* @__PURE__ */ import_react.createElement("div", {
className: titleClassNames,
style: mergedStyles.title
}, title)), /* @__PURE__ */ import_react.createElement(skeleton_default, {
paragraph: false,
loading,
className: `${prefixCls}-skeleton`,
active: true
}, /* @__PURE__ */ import_react.createElement("div", {
className: contentClassNames,
style: {
...valueStyle,
...mergedStyles.content
}
}, prefix && /* @__PURE__ */ import_react.createElement("span", {
className: prefixClassNames,
style: mergedStyles.prefix
}, prefix), typeof valueRender === "function" ? valueRender(valueNode) : valueNode, suffix && /* @__PURE__ */ import_react.createElement("span", {
className: suffixClassNames,
style: mergedStyles.suffix
}, suffix))));
});
Statistic.displayName = "Statistic";
//#endregion
//#region node_modules/antd/es/statistic/utils.js
var timeUnits = [
["Y", 1e3 * 60 * 60 * 24 * 365],
["M", 1e3 * 60 * 60 * 24 * 30],
["D", 1e3 * 60 * 60 * 24],
["H", 1e3 * 60 * 60],
["m", 1e3 * 60],
["s", 1e3],
["S", 1]
];
function formatTimeStr(duration, format) {
let leftDuration = duration;
const escapeRegex = /\[[^\]]*]/g;
const keepList = (format.match(escapeRegex) || []).map((str) => str.slice(1, -1));
const templateText = format.replace(escapeRegex, "[]");
const replacedText = timeUnits.reduce((current, [name, unit]) => {
if (current.includes(name)) {
const value = Math.floor(leftDuration / unit);
leftDuration -= value * unit;
return current.replace(new RegExp(`${name}+`, "g"), (match) => {
const len = match.length;
return value.toString().padStart(len, "0");
});
}
return current;
}, templateText);
let index = 0;
return replacedText.replace(escapeRegex, () => {
const match = keepList[index];
index += 1;
return match;
});
}
function formatCounter(value, config, down) {
const { format = "" } = config;
const target = new Date(value).getTime();
const current = Date.now();
return formatTimeStr(down ? Math.max(target - current, 0) : Math.max(current - target, 0), format);
}
//#endregion
//#region node_modules/antd/es/statistic/Timer.js
var UPDATE_INTERVAL = 1e3 / 60;
function getTime(value) {
return new Date(value).getTime();
}
var StatisticTimer = (props) => {
const { value, format = "HH:mm:ss", onChange, onFinish, type, ...rest } = props;
const down = type === "countdown";
const [showTime, setShowTime] = import_react.useState(null);
const update = useEvent(() => {
const now = Date.now();
const timestamp = getTime(value);
setShowTime({});
const timeDiff = !down ? now - timestamp : timestamp - now;
onChange?.(timeDiff);
if (down && timestamp < now) {
onFinish?.();
return false;
}
return true;
});
import_react.useEffect(() => {
let intervalId;
const tick = () => {
if (!update()) window.clearInterval(intervalId);
};
const startTimer = () => {
intervalId = window.setInterval(tick, UPDATE_INTERVAL);
};
const stopTimer = () => {
window.clearInterval(intervalId);
};
startTimer();
return () => {
stopTimer();
};
}, [value, down]);
import_react.useEffect(() => {
setShowTime({});
}, []);
const formatter = (formatValue, config) => showTime ? formatCounter(formatValue, {
...config,
format
}, down) : "-";
const valueRender = (node) => cloneElement$1(node, { title: void 0 });
return /* @__PURE__ */ import_react.createElement(Statistic, {
...rest,
value,
valueRender,
formatter
});
};
//#endregion
//#region node_modules/antd/es/statistic/Countdown.js
var Countdown = (props) => {
devUseWarning("Countdown").deprecated(false, "", "");
return /* @__PURE__ */ import_react.createElement(StatisticTimer, {
...props,
type: "countdown"
});
};
var Countdown_default = /* @__PURE__ */ import_react.memo(Countdown);
//#endregion
//#region node_modules/antd/es/statistic/index.js
Statistic.Timer = StatisticTimer;
Statistic.Countdown = Countdown_default;
var statistic_default = Statistic;
//#endregion
//#region node_modules/@rc-component/steps/es/Rail.js
function Rail(props) {
const { prefixCls, className, style, status } = props;
const railCls = `${prefixCls}-rail`;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(railCls, `${railCls}-${status}`, className),
style
});
}
//#endregion
//#region node_modules/@rc-component/steps/es/UnstableContext.js
var UnstableContext$1 = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/steps/es/Context.js
var StepsContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/steps/es/StepIcon.js
function _extends$24() {
_extends$24 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$24.apply(this, arguments);
}
var StepIconSemanticContext = /* @__PURE__ */ import_react.createContext({});
var StepIcon = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { className, style, children, ...restProps } = props;
const { prefixCls, classNames, styles } = import_react.useContext(StepsContext);
const { className: itemClassName, style: itemStyle } = import_react.useContext(StepIconSemanticContext);
const itemCls = `${prefixCls}-item`;
return /* @__PURE__ */ import_react.createElement("div", _extends$24({}, pickAttrs(restProps, false), {
ref,
className: clsx(`${itemCls}-icon`, classNames.itemIcon, itemClassName, className),
style: {
...styles.itemIcon,
...itemStyle,
...style
}
}), children);
});
//#endregion
//#region node_modules/@rc-component/steps/es/Step.js
function _extends$23() {
_extends$23 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$23.apply(this, arguments);
}
function hasContent(value) {
return value !== void 0 && value !== null;
}
function Step(props) {
const { prefixCls, classNames, styles, data, last, nextStatus, active, index, itemRender, iconRender, itemWrapperRender, onClick } = props;
const itemCls = `${prefixCls}-item`;
const { railFollowPrevStatus } = import_react.useContext(UnstableContext$1);
const { ItemComponent } = import_react.useContext(StepsContext);
const { onClick: onItemClick, title, subTitle, content, description, disabled, icon, status, className, style, classNames: itemClassNames = {}, styles: itemStyles = {}, ...restItemProps } = data;
const mergedContent = content ?? description;
const renderInfo = {
item: {
...data,
content: mergedContent
},
index,
active
};
const clickable = !!(onClick || onItemClick) && !disabled;
const accessibilityProps = {};
if (clickable) {
accessibilityProps.role = "button";
accessibilityProps.tabIndex = 0;
accessibilityProps.onClick = (e) => {
onItemClick?.(e);
onClick(index);
};
accessibilityProps.onKeyDown = (e) => {
const { which } = e;
if (which === KeyCode.ENTER || which === KeyCode.SPACE) onClick(index);
};
}
const mergedStatus = status || "wait";
const hasTitle = hasContent(title);
const hasSubTitle = hasContent(subTitle);
const classString = clsx(itemCls, `${itemCls}-${mergedStatus}`, {
[`${itemCls}-custom`]: icon,
[`${itemCls}-active`]: active,
[`${itemCls}-disabled`]: disabled === true,
[`${itemCls}-empty-header`]: !hasTitle && !hasSubTitle
}, className, classNames.item, itemClassNames.root);
let iconNode = /* @__PURE__ */ import_react.createElement(StepIcon, null);
if (iconRender) iconNode = iconRender(iconNode, {
...renderInfo,
components: { Icon: StepIcon }
});
const wrapperNode = /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${itemCls}-wrapper`, classNames.itemWrapper, itemClassNames.wrapper),
style: {
...styles.itemWrapper,
...itemStyles.wrapper
}
}, /* @__PURE__ */ import_react.createElement(StepIconSemanticContext.Provider, { value: {
className: itemClassNames.icon,
style: itemStyles.icon
} }, iconNode), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${itemCls}-section`, classNames.itemSection, itemClassNames.section),
style: {
...styles.itemSection,
...itemStyles.section
}
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${itemCls}-header`, classNames.itemHeader, itemClassNames.header),
style: {
...styles.itemHeader,
...itemStyles.header
}
}, hasTitle && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${itemCls}-title`, classNames.itemTitle, itemClassNames.title),
style: {
...styles.itemTitle,
...itemStyles.title
}
}, title), hasSubTitle && /* @__PURE__ */ import_react.createElement("div", {
title: typeof subTitle === "string" ? subTitle : void 0,
className: clsx(`${itemCls}-subtitle`, classNames.itemSubtitle, itemClassNames.subtitle),
style: {
...styles.itemSubtitle,
...itemStyles.subtitle
}
}, subTitle), !last && /* @__PURE__ */ import_react.createElement(Rail, {
prefixCls: itemCls,
className: clsx(classNames.itemRail, itemClassNames.rail),
style: {
...styles.itemRail,
...itemStyles.rail
},
status: railFollowPrevStatus ? status : nextStatus
})), hasContent(mergedContent) && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${itemCls}-content`, classNames.itemContent, itemClassNames.content),
style: {
...styles.itemContent,
...itemStyles.content
}
}, mergedContent)));
let stepNode = /* @__PURE__ */ import_react.createElement(ItemComponent, _extends$23({}, restItemProps, accessibilityProps, {
className: classString,
style: {
...styles.item,
...itemStyles.root,
...style
}
}), itemWrapperRender ? itemWrapperRender(wrapperNode) : wrapperNode);
if (itemRender) stepNode = itemRender(stepNode, renderInfo) || null;
return stepNode;
}
//#endregion
//#region node_modules/@rc-component/steps/es/Steps.js
function _extends$22() {
_extends$22 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$22.apply(this, arguments);
}
var EmptyObject = {};
function Steps$1(props) {
const { prefixCls = "rc-steps", style, className, classNames = EmptyObject, styles = EmptyObject, rootClassName, orientation, titlePlacement, components, status = "process", current = 0, initial = 0, onChange, items, iconRender, itemRender, itemWrapperRender, ...restProps } = props;
const isVertical = orientation === "vertical";
const mergedOrientation = isVertical ? "vertical" : "horizontal";
const mergeTitlePlacement = !isVertical && titlePlacement === "vertical" ? "vertical" : "horizontal";
const classString = clsx(prefixCls, `${prefixCls}-${mergedOrientation}`, `${prefixCls}-title-${mergeTitlePlacement}`, rootClassName, className, classNames.root);
const mergedItems = import_react.useMemo(() => (items || []).filter(Boolean), [items]);
const statuses = import_react.useMemo(() => mergedItems.map(({ status: itemStatus }, index) => {
const stepNumber = initial + index;
if (!itemStatus) {
if (stepNumber === current) return status;
else if (stepNumber < current) return "finish";
return "wait";
}
return itemStatus;
}), [
mergedItems,
status,
current,
initial
]);
const onStepClick = (next) => {
if (onChange && current !== next) onChange(next);
};
const { root: RootComponent = "div", item: ItemComponent = "div" } = components || {};
const stepIconContext = import_react.useMemo(() => ({
prefixCls,
classNames,
styles,
ItemComponent
}), [
prefixCls,
classNames,
styles,
ItemComponent
]);
const renderStep = (item, index) => {
const stepIndex = initial + index;
const itemStatus = statuses[index];
const nextStatus = statuses[index + 1];
const data = {
...item,
status: itemStatus
};
return /* @__PURE__ */ import_react.createElement(Step, {
key: stepIndex,
prefixCls,
classNames,
styles,
data,
nextStatus,
active: stepIndex === current,
index: stepIndex,
last: mergedItems.length - 1 === index,
iconRender,
itemRender,
itemWrapperRender,
onClick: onChange && onStepClick
});
};
return /* @__PURE__ */ import_react.createElement(RootComponent, _extends$22({
className: classString,
style: {
...style,
...styles?.root
}
}, restProps), /* @__PURE__ */ import_react.createElement(StepsContext.Provider, { value: stepIconContext }, mergedItems.map(renderStep)));
}
//#endregion
//#region node_modules/@rc-component/steps/es/index.js
var es_default$4 = Steps$1;
//#endregion
//#region node_modules/antd/es/steps/context.js
/**
* When use this context. Will trade as sub component instead of root Steps component.
*/
var InternalContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/antd/es/steps/PanelArrow.js
var PanelArrow = (props) => {
const { prefixCls } = props;
return /* @__PURE__ */ import_react.createElement("svg", {
className: `${prefixCls}-panel-arrow`,
viewBox: "0 0 100 100",
xmlns: "http://www.w3.org/2000/svg",
preserveAspectRatio: "none"
}, /* @__PURE__ */ import_react.createElement("title", null, "Arrow"), /* @__PURE__ */ import_react.createElement("path", { d: "M 0 0 L 100 50 L 0 100" }));
};
//#endregion
//#region node_modules/antd/es/steps/ProgressIcon.js
var ProgressIcon = (props) => {
const { prefixCls, rootPrefixCls, children, percent } = props;
const progressCls = `${prefixCls}-item-progress-icon`;
const circleCls = `${progressCls}-circle`;
const [, varRef] = genCssVar(rootPrefixCls, "cmp-steps");
const dashArray = `calc(${varRef("progress-radius")} * 2 * ${Math.PI * percent / 100}) 9999`;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("svg", {
className: `${progressCls}-svg`,
viewBox: "0 0 100 100",
width: "100%",
height: "100%",
xmlns: "http://www.w3.org/2000/svg",
"aria-valuemax": 100,
"aria-valuemin": 0,
"aria-valuenow": percent
}, /* @__PURE__ */ import_react.createElement("title", null, "Progress"), /* @__PURE__ */ import_react.createElement("circle", { className: clsx(circleCls, `${circleCls}-rail`) }), /* @__PURE__ */ import_react.createElement("circle", {
className: clsx(circleCls, `${circleCls}-ptg`),
strokeDasharray: dashArray,
transform: "rotate(-90 50 50)"
})), children);
};
//#endregion
//#region node_modules/antd/es/steps/style/horizontal.js
var genHorizontalStyle$1 = (token) => {
const { componentCls, antCls } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [`${componentCls}-horizontal`]: { [`> ${itemCls}`]: {
flex: "1 1 auto",
minWidth: token.iconSize,
[`${itemCls}-rail`]: {
[varName("horizontal-rail-margin")]: `calc(${varRef("icon-size-max")} / 2 + ${varRef("item-wrapper-padding-top")})`,
position: "static",
marginTop: varRef("horizontal-rail-margin"),
width: "auto",
borderBlockStartWidth: varRef("rail-size"),
flex: 1,
minWidth: 0,
alignSelf: "flex-start",
transform: "translateY(-50%)"
}
} } };
};
//#endregion
//#region node_modules/antd/es/steps/style/icon.js
var genIconStyle = (token) => {
const { componentCls, customIconFontSize, motionDurationSlow, iconSize, lineWidth, lineType, antCls } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [componentCls]: {
[varName("icon-size")]: iconSize,
[varName("icon-border-width")]: lineWidth,
[`${itemCls}-icon`]: {
width: varRef("icon-size"),
height: varRef("icon-size"),
margin: 0,
flex: "none",
display: "flex",
alignItems: "center",
justifyContent: "center",
fontSize: token.iconFontSize,
fontFamily: token.fontFamily,
lineHeight: varRef("icon-size"),
textAlign: "center",
borderRadius: varRef("icon-size"),
border: `${varRef("icon-border-width")} ${lineType} transparent`,
transition: [
"background-color",
"border",
"color",
"inset",
"transform"
].map((key) => `${key} ${motionDurationSlow}`).join(", "),
zIndex: 1
},
[`${itemCls}-custom ${itemCls}-icon`]: {
background: "none",
border: 0,
fontSize: customIconFontSize
}
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/inline.js
var genInlineStyle = (token) => {
const { componentCls, inlineDotSize, paddingXS, lineWidth, antCls, calc } = token;
const containerPaddingTop = calc(paddingXS).add(lineWidth).equal();
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [`${componentCls}-inline`]: {
[varName("items-offset")]: "0",
[varName("item-wrapper-padding-top")]: containerPaddingTop,
display: "inline-flex",
"&:before": {
content: "\"\"",
flex: varRef("items-offset")
},
[itemCls]: {
[varName("title-vertical-row-gap")]: paddingXS,
[varName("icon-size")]: inlineDotSize,
[varName("icon-size-active")]: inlineDotSize,
[varName("title-font-size")]: token.fontSizeSM,
[varName("title-line-height")]: token.lineHeightSM,
[varName("item-title-color")]: token.colorTextSecondary,
[varName("subtitle-font-size")]: token.fontSizeSM,
[varName("subtitle-line-height")]: token.lineHeightSM,
[varName("item-subtitle-color")]: token.colorTextQuaternary,
[varName("rail-size")]: token.lineWidth,
[varName("title-horizontal-rail-gap")]: "0px",
flex: 1,
"&-wrapper": {
paddingInline: token.paddingXXS,
marginInline: token.calc(token.marginXXS).div(2).equal(),
borderRadius: token.borderRadiusSM,
cursor: "pointer",
transition: `background-color ${token.motionDurationMid}`,
"&:hover": { background: token.controlItemBgHover }
},
"&-icon": { [`${itemCls}-icon-dot`]: { "&:after": { display: "none" } } },
"&-title": {
fontWeight: "normal",
whiteSpace: "nowrap"
},
"&-content": { display: "none" }
}
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/util.js
function withoutVar(cssVar) {
return (cssVar || "--ant-not-exist").replace(/var\((.*)\)/, "$1");
}
/**
* Force override the width related styles.
* This should be multiple since will conflict with other `rail` styles.
*/
var getItemWithWidthStyle = (token, marginSize, optionalStyle) => {
const { calc, componentCls, descriptionMaxWidth, antCls } = token;
const itemCls = `${componentCls}-item`;
const [, varRef] = genCssVar(antCls, "cmp-steps");
return { [`@container style(${withoutVar(descriptionMaxWidth)})`]: [{
[`${itemCls}-icon`]: { marginInlineStart: calc(descriptionMaxWidth).sub(varRef("icon-size")).div(2).equal() },
[`${itemCls}-rail`]: {
width: "auto",
insetInlineStart: calc(descriptionMaxWidth).add(varRef("icon-size")).div(2).add(marginSize).equal(),
insetInlineEnd: calc(descriptionMaxWidth).sub(varRef("icon-size")).div(2).sub(marginSize).mul(-1).equal()
}
}, optionalStyle] };
};
//#endregion
//#region node_modules/antd/es/steps/style/label-placement.js
var genLabelPlacementStyle = (token) => {
const { componentCls, descriptionMaxWidth, marginXS, fontHeightLG, margin, paddingSM, marginXXS, antCls, calc } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return {
[componentCls]: {
[varName("icon-size-max")]: `max(${varRef("icon-size")}, ${varRef("icon-size-active", varRef("icon-size"))})`,
[`${itemCls}-icon`]: { marginBlockStart: `calc((${varRef("heading-height")} - ${varRef("icon-size")}) / 2)` }
},
[`${componentCls}-title-horizontal`]: {
[varName("title-horizontal-item-margin")]: margin,
[varName("title-horizontal-rail-margin")]: margin,
[varName("title-horizontal-title-height")]: fontHeightLG,
[varName("heading-height")]: `max(${varRef("icon-size")}, ${varRef("title-horizontal-title-height")})`,
[`&${componentCls}-horizontal, &${componentCls}-horizontal-alternate`]: {
[`${itemCls}:not(:first-child)`]: { marginInlineStart: varRef("title-horizontal-item-margin") },
[`${itemCls}:last-child`]: { flex: "0 1 auto" },
[`${itemCls}-wrapper`]: { columnGap: token.marginXS }
},
[`&${componentCls}-vertical`]: {
[`${itemCls}-wrapper`]: { columnGap: token.margin },
[`${itemCls}-empty-header`]: {
[`${itemCls}-header`]: { minHeight: "auto" },
[`${itemCls}-content`]: { marginTop: calc(varRef("heading-height")).sub(token.fontHeight).div(2).equal() }
}
},
[`${itemCls}-section`]: {
flex: 1,
minWidth: 0
},
[`${itemCls}-header`]: { minHeight: varRef("heading-height") },
[`${itemCls}-title`]: { flex: "0 1 auto" },
[`${itemCls}-content`]: { maxWidth: descriptionMaxWidth },
[`${itemCls}-subtitle`]: { flex: "0 9999 auto" },
[`&${componentCls}-horizontal ${itemCls}-rail`]: {
[varName("item-wrapper-padding-top")]: "0px",
flex: "1 1 0%",
marginInlineStart: varRef("title-horizontal-rail-margin")
}
},
[`${componentCls}-title-vertical`]: {
[varName("title-vertical-row-gap")]: paddingSM,
[varName("title-horizontal-rail-gap")]: marginXXS,
[varName("heading-height")]: varRef("icon-size-max"),
[`> ${itemCls}`]: {
flex: "1 1 0%",
[`${itemCls}-wrapper`]: {
flexDirection: "column",
rowGap: varRef("title-vertical-row-gap"),
alignItems: "center"
},
[`${itemCls}-section`]: { alignSelf: "stretch" },
[`${itemCls}-header`]: {
flexDirection: "column",
alignItems: "center"
},
[`${itemCls}-title, ${itemCls}-subtitle, ${itemCls}-content`]: {
textAlign: "center",
maxWidth: "100%"
},
[`${itemCls}-subtitle`]: { margin: 0 },
[`${itemCls}-rail`]: {
position: "absolute",
top: 0,
width: `calc(100% - ${varRef("icon-size")} - ${varRef("title-horizontal-rail-gap")} * 2)`,
insetInlineStart: `calc(50% + ${varRef("icon-size")} / 2 + ${varRef("title-horizontal-rail-gap")})`
}
},
...getItemWithWidthStyle(token, marginXS, {
[`${itemCls}:last-child`]: { flex: "none" },
[`${itemCls}-icon`]: { alignSelf: "flex-start" },
[`${itemCls}-section`]: { width: descriptionMaxWidth }
})
}
};
};
//#endregion
//#region node_modules/antd/es/steps/style/nav.js
var genLegacyNavStyle = (token) => {
const { componentCls, fontSizeIcon, navContentMaxWidth, navArrowColor, colorPrimary, motionDurationSlow, antCls, calc } = token;
const itemCls = `${componentCls}-item`;
const stepsNavActiveColor = colorPrimary;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [`${componentCls}${componentCls}-navigation`]: {
[itemCls.repeat(4)]: {
display: "flex",
justifyContent: "center",
position: "relative",
flex: 1,
marginInlineStart: 0,
[`${itemCls}-wrapper`]: { paddingBlock: token.paddingSM },
[`${itemCls}-section`]: { maxWidth: navContentMaxWidth },
[`${itemCls}-rail`]: { display: "none" },
"&:before": {
position: "absolute",
display: "block",
backgroundColor: stepsNavActiveColor,
transition: `all ${motionDurationSlow}`,
transitionTimingFunction: "ease-out",
content: "\"\""
},
"&:not(:last-child):after": {
position: "absolute",
display: "block",
borderTop: `${unit$1(token.lineWidth)} ${token.lineType} ${navArrowColor}`,
borderBottom: "none",
borderInlineStart: "none",
borderInlineEnd: `${unit$1(token.lineWidth)} ${token.lineType} ${navArrowColor}`,
content: "\"\""
},
[`&${itemCls}-active`]: {
[varName("item-content-active-color")]: varRef("item-content-color"),
[varName("item-icon-active-bg-color")]: varRef("item-icon-bg-color"),
[varName("item-icon-active-border-color")]: varRef("item-icon-border-color"),
[varName("item-icon-active-text-color")]: varRef("item-icon-text-color")
}
},
[`&${componentCls}-horizontal`]: { [itemCls]: {
"&:before": {
bottom: 0,
insetInlineStart: "50%",
width: 0,
height: token.lineWidthBold
},
[`&${itemCls}-active:before`]: {
insetInlineStart: 0,
width: "100%"
},
"&:not(:last-child):after": {
top: `50%`,
insetInlineStart: calc(fontSizeIcon).div(2).mul(-1).add("100%").equal(),
width: fontSizeIcon,
height: fontSizeIcon,
transform: "translateY(-50%) rotate(45deg)"
}
} },
[`&${componentCls}-vertical`]: { [itemCls.repeat(4)]: {
[`${itemCls}-content`]: { padding: 0 },
"&:before": {
insetInlineEnd: 0,
top: "50%",
width: token.lineWidthBold,
height: 0
},
[`&${itemCls}-active::before`]: {
top: 0,
height: "100%"
},
"&:not(:last-child):after": {
left: {
_skip_check_: true,
value: "50%"
},
top: "100%",
width: calc(fontSizeIcon).div(3).mul(2).equal(),
height: calc(fontSizeIcon).div(3).mul(2).equal(),
transform: "translateY(-50%) translateX(-50%) rotate(135deg)"
}
} }
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/panel.js
var genPanelStyle = (token) => {
const { componentCls, lineWidthBold, borderRadius, borderRadiusSM, motionDurationMid, paddingXS, lineType, paddingSM, antCls, calc } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
const borderStyle = `${unit$1(lineWidthBold)} ${lineType} ${varRef("panel-border-color")}`;
return { [`${componentCls}${componentCls}-panel`]: [
{
[`${itemCls}-rail`]: { display: "none" },
[`&${componentCls}-horizontal`]: {
alignItems: "stretch",
[itemCls]: {
flex: 1,
margin: 0
}
}
},
{
"&": {
[varName("panel-padding")]: paddingSM,
[varName("item-border-radius")]: borderRadius,
[itemCls]: {
[varName("panel-bg-color")]: varRef("item-icon-bg-color"),
[varName("panel-border-color")]: varRef("item-icon-border-color"),
[varName("panel-active-bg-color")]: varRef("item-icon-active-bg-color"),
[varName("panel-active-border-color")]: varRef("item-icon-active-border-color"),
[varName("panel-title-height")]: `calc(${varRef("title-font-size")} * ${varRef("title-line-height")})`,
[varName("item-base-height")]: calc(varRef("panel-padding")).mul(2).add(varRef("icon-size")).add(varRef("panel-title-height")).equal(),
[varName("item-base-width")]: `calc(${varRef("item-base-height")} * 0.7071)`,
transition: `background-color ${motionDurationMid}`
}
},
[`${itemCls}-icon`]: { display: "none" },
[`${itemCls}-header`]: { minHeight: "auto" },
[`${componentCls}-panel-arrow`]: {
position: "absolute",
top: calc(lineWidthBold).mul(-1).equal(),
insetInlineStart: "100%",
zIndex: 1,
height: calc(lineWidthBold).mul(2).add("100%").equal(),
width: varRef("item-base-width"),
overflow: "visible",
strokeLinecap: "round",
path: {
fill: varRef("panel-bg-color"),
stroke: varRef("panel-border-color"),
strokeWidth: lineWidthBold,
vectorEffect: "non-scaling-stroke",
transition: `fill ${motionDurationMid}`
}
},
[`${itemCls}:last-child ${componentCls}-panel-arrow`]: { display: "none" },
[itemCls]: {
padding: varRef("panel-padding"),
background: varRef("panel-bg-color"),
position: "relative",
borderBlock: borderStyle,
"&:not(:first-child)": { paddingInlineStart: `calc(${varRef("panel-padding")} + ${varRef("item-base-width")})` },
"&:first-child": {
borderInlineStart: borderStyle,
borderStartStartRadius: varRef("item-border-radius"),
borderEndStartRadius: varRef("item-border-radius")
},
"&:last-child": {
borderInlineEnd: borderStyle,
borderStartEndRadius: varRef("item-border-radius"),
borderEndEndRadius: varRef("item-border-radius")
},
"&-active": {
background: varRef("panel-active-bg-color"),
borderColor: varRef("panel-active-border-color"),
[`${componentCls}-panel-arrow`]: { path: {
fill: varRef("panel-active-bg-color"),
stroke: varRef("panel-active-border-color")
} },
[`${itemCls}-title, ${itemCls}-subtitle, ${itemCls}-content`]: { color: varRef("item-icon-active-text-color") }
}
}
},
{ [`&${componentCls}-small`]: {
[varName("panel-padding")]: paddingXS,
[varName("item-border-radius")]: borderRadiusSM
} },
{ [`&${componentCls}-filled`]: { [itemCls]: { "&:not(:first-child)": { clipPath: `polygon(${[
`${unit$1(lineWidthBold)} 0`,
`calc(100% + ${varRef("item-base-width")}) 0`,
`calc(100% + ${varRef("item-base-width")}) 100%`,
`${unit$1(lineWidthBold)} 100%`,
`calc(${varRef("item-base-width")} + ${unit$1(lineWidthBold)}) 50%`
].join(",")})` } } } },
{ [`&${componentCls}-outlined`]: { [`${componentCls}-panel-arrow`]: {
top: calc(lineWidthBold).div(2).mul(-1).equal(),
height: calc(lineWidthBold).add("100%").equal()
} } }
] };
};
//#endregion
//#region node_modules/antd/es/steps/style/progress.js
var genStepsProgressStyle = (token) => {
const { calc, antCls, componentCls, lineWidthBold, motionDurationSlow } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
const enhanceSize = calc(lineWidthBold).add(lineWidthBold).equal();
return { [`${componentCls}${componentCls}-with-progress`]: {
[varName("item-wrapper-padding-top")]: enhanceSize,
[`${itemCls}${itemCls}-process`]: { [`${itemCls}-icon`]: { position: "relative" } },
[`${itemCls}-progress-icon`]: {
"&-svg": {
[varName("svg-size")]: calc(enhanceSize).mul(2).add(varRef("icon-size")).equal(),
[varName("icon-size-ptg-unitless")]: `calc(100 / tan(atan2(${varRef("svg-size")}, 1px)))`,
fontSize: varRef("svg-size"),
lineHeight: varRef("icon-size-ptg-unitless"),
position: "absolute",
inset: calc(enhanceSize).mul(-1).equal(),
width: "auto",
height: "auto"
},
"&-circle": {
lineHeight: varRef("icon-size-ptg-unitless"),
strokeWidth: calc(varRef("icon-size-ptg-unitless")).mul(lineWidthBold).equal(),
[varName("progress-radius")]: calc(varRef("svg-size")).sub(lineWidthBold).mul(varRef("icon-size-ptg-unitless")).div(2).equal(),
r: varRef("progress-radius"),
fill: "none",
cx: 50,
cy: 50,
transition: `all ${motionDurationSlow} ease-in-out`,
"&-rail": { stroke: token.colorSplit },
"&-ptg": { stroke: token.colorPrimary }
}
}
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/progress-dot.js
var genDotStyle = (token) => {
const { componentCls, iconSize, dotSize, dotCurrentSize, marginXXS, lineWidthBold, fontSizeSM, antCls } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [`${componentCls}${componentCls}-dot`]: {
[varName("icon-size-active")]: dotCurrentSize,
[varName("icon-size")]: dotSize,
[varName("dot-icon-size")]: dotSize,
[varName("dot-icon-border-width")]: lineWidthBold,
[varName("rail-size")]: lineWidthBold,
[varName("icon-border-width")]: lineWidthBold,
[`${itemCls}-custom ${itemCls}-icon`]: { fontSize: fontSizeSM },
[`${itemCls}-icon`]: {
position: "relative",
"&:after": {
content: "\"\"",
width: iconSize,
height: iconSize,
display: "block",
position: "absolute",
top: "50%",
left: {
_skip_check_: true,
value: "50%"
},
transform: "translate(-50%, -50%)"
}
},
[`${itemCls}-active ${itemCls}-icon`]: { [varName("icon-size")]: varRef("icon-size-active") },
[`&${componentCls}-horizontal`]: { [`&, &${componentCls}-small`]: getItemWithWidthStyle(token, marginXXS) }
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/rtl.js
var genRTLStyle = (token) => {
const { componentCls, lineWidthBold, antCls } = token;
const itemCls = `${componentCls}-item`;
const [, varRef] = genCssVar(antCls, "cmp-steps");
return { [`${componentCls}${componentCls}-rtl`]: {
direction: "rtl",
[`&${componentCls}-navigation${componentCls}-horizontal`]: { [`${itemCls}:after`]: { transform: "translateY(-50%) rotate(-45deg)" } },
[`&${componentCls}-panel`]: {
[`${componentCls}-panel-arrow`]: { transform: `scaleX(-1)` },
[`&${componentCls}-filled`]: { [itemCls]: { "&:not(:first-child)": { clipPath: `polygon(${[
`calc(0px - ${varRef("item-base-width")}) 0px`,
`calc(100% - ${unit$1(lineWidthBold)}) 0px`,
`calc(100% - ${varRef("item-base-width")} - ${unit$1(lineWidthBold)}) 50%`,
`calc(100% - ${unit$1(lineWidthBold)}) 100%`,
`calc(0px - ${varRef("item-base-width")}) 100%`
].join(",")})` } } }
}
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/small.js
var genSmallStyle = (token) => {
const { componentCls, iconSizeSM, fontSize, lineHeight, marginXS, fontHeight, marginSM, paddingXS, antCls } = token;
const [varName] = genCssVar(antCls, "cmp-steps");
return { [`${componentCls}${componentCls}-small`]: {
[varName("icon-size")]: iconSizeSM,
[varName("title-horizontal-item-margin")]: marginSM,
[varName("title-vertical-row-gap")]: paddingXS,
[varName("title-font-size")]: fontSize,
[varName("title-line-height")]: lineHeight,
[varName("title-horizontal-rail-margin")]: marginXS,
[varName("title-horizontal-title-height")]: fontHeight,
[`&${componentCls}-horizontal${componentCls}-title-vertical`]: getItemWithWidthStyle(token, marginXS)
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/status.js
var STATUS_WAIT = "wait";
var STATUS_PROCESS = "process";
var STATUS_FINISH = "finish";
var STATUS_ERROR = "error";
var genStatusStyle = (token) => {
const { componentCls, colorTextDisabled, colorTextLightSolid, colorPrimary, colorTextLabel, colorError, colorErrorHover, colorErrorBgFilledHover, colorFillTertiary, colorErrorBg, colorPrimaryBgHover, colorPrimaryBg, colorText, colorTextDescription, colorBgContainer, colorPrimaryHover, lineType, antCls } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [componentCls]: [
{
[itemCls]: {
[varName("item-solid-line-color")]: "#000",
[varName("item-title-color")]: "#000",
[varName("item-content-color")]: "#000",
[varName("item-subtitle-color")]: varRef("item-content-color"),
[varName("item-icon-custom-color")]: "#000",
[varName("item-icon-bg-color")]: "#000",
[varName("item-icon-border-color")]: "#000",
[varName("item-icon-text-color")]: "#fff",
[varName("item-icon-dot-color")]: "#000",
[varName("item-icon-dot-bg-color")]: varRef("item-icon-dot-color"),
[varName("item-icon-dot-border-color")]: varRef("item-icon-dot-color"),
[varName("item-text-hover-color")]: "#000",
[varName("item-icon-bg-hover-color")]: varRef("item-icon-bg-color"),
[varName("item-icon-border-hover-color")]: varRef("item-icon-border-color"),
[varName("item-icon-text-hover-color")]: varRef("item-icon-text-color"),
[varName("item-content-active-color")]: varRef("item-content-color"),
[varName("item-icon-active-bg-color")]: varRef("item-icon-bg-color"),
[varName("item-icon-active-border-color")]: varRef("item-icon-border-color"),
[varName("item-icon-active-text-color")]: varRef("item-icon-text-color"),
[varName("item-process-rail-line-style")]: lineType
},
[`${itemCls}-rail`]: { borderColor: varRef("item-solid-line-color") },
[`${itemCls}-custom ${itemCls}-icon`]: { color: varRef("item-icon-custom-color") },
[`${itemCls}-title`]: { color: varRef("item-title-color") },
[`${itemCls}-subtitle`]: { color: varRef("item-subtitle-color") },
[`${itemCls}-content`]: { color: varRef("item-content-color") },
[`${itemCls}-active ${itemCls}-icon`]: {},
[`${itemCls}-active ${itemCls}-content`]: { color: varRef("item-content-active-color") },
[`${itemCls}[role='button']:not(${itemCls}-active):hover`]: { [`${itemCls}-title, ${itemCls}-content`]: { color: varRef("item-text-hover-color") } },
[`&:not(${componentCls}-dot)`]: { [`${itemCls}:not(${itemCls}-custom)`]: {
[`${itemCls}-icon`]: {
background: varRef("item-icon-bg-color"),
borderColor: varRef("item-icon-border-color"),
color: varRef("item-icon-text-color")
},
[`&[role='button']:not(${itemCls}-active):hover`]: { [`${itemCls}-icon`]: {
background: varRef("item-icon-bg-hover-color"),
borderColor: varRef("item-icon-border-hover-color"),
color: varRef("item-icon-text-hover-color")
} },
[`&${itemCls}-active`]: { [`${itemCls}-icon`]: {
background: varRef("item-icon-active-bg-color"),
borderColor: varRef("item-icon-active-border-color"),
color: varRef("item-icon-active-text-color")
} }
} },
[`&${componentCls}-dot`]: { [`${itemCls}-icon`]: {
background: varRef("item-icon-dot-bg-color"),
borderColor: varRef("item-icon-dot-border-color"),
color: varRef("item-icon-dot-color"),
[`&${itemCls}-icon-dot-custom`]: {
background: "transparent",
border: "none"
}
} }
},
{
[`${itemCls}-${STATUS_WAIT}`]: {
[varName("item-icon-custom-color")]: colorTextDisabled,
[varName("item-title-color")]: colorTextDescription,
[varName("item-content-color")]: colorTextDescription,
[varName("item-content-active-color")]: colorText,
[varName("item-text-hover-color")]: colorPrimaryHover
},
[`${itemCls}-rail-${STATUS_WAIT}`]: { [varName("item-solid-line-color")]: colorTextDisabled },
[`${itemCls}-${STATUS_PROCESS}`]: {
[varName("item-icon-custom-color")]: colorPrimary,
[varName("item-title-color")]: colorText,
[varName("item-content-color")]: colorTextDescription,
[varName("item-content-active-color")]: colorText,
[varName("item-text-hover-color")]: colorPrimaryHover
},
[`${itemCls}-rail-${STATUS_PROCESS}`]: {
[varName("item-solid-line-color")]: colorPrimary,
[varName("rail-line-style")]: varRef("item-process-rail-line-style")
},
[`${itemCls}-${STATUS_FINISH}`]: {
[varName("item-icon-custom-color")]: colorPrimary,
[varName("item-title-color")]: colorText,
[varName("item-content-color")]: colorTextDescription,
[varName("item-content-active-color")]: colorText,
[varName("item-text-hover-color")]: colorPrimaryHover
},
[`${itemCls}-rail-${STATUS_FINISH}`]: { [varName("item-solid-line-color")]: colorPrimary },
[`${itemCls}-${STATUS_ERROR}`]: {
[varName("item-icon-custom-color")]: colorError,
[varName("item-title-color")]: colorError,
[varName("item-content-color")]: colorError,
[varName("item-content-active-color")]: colorError,
[varName("item-text-hover-color")]: colorErrorHover
},
[`${itemCls}-rail-${STATUS_ERROR}`]: { [varName("item-solid-line-color")]: colorError }
},
{ [`&${componentCls}-filled`]: {
[itemCls]: { [varName("item-icon-dot-border-color")]: "transparent" },
[`${itemCls}-${STATUS_WAIT}`]: {
[varName("item-icon-bg-color")]: colorFillTertiary,
[varName("item-icon-border-color")]: "transparent",
[varName("item-icon-text-color")]: colorTextLabel,
[varName("item-icon-dot-bg-color")]: colorTextDisabled,
[varName("item-icon-bg-hover-color")]: colorPrimaryBgHover,
[varName("item-icon-border-hover-color")]: "transparent",
[varName("item-icon-text-hover-color")]: colorPrimary,
[varName("item-icon-active-bg-color")]: colorPrimary,
[varName("item-icon-active-border-color")]: "transparent",
[varName("item-icon-active-text-color")]: colorTextLightSolid
},
[`${itemCls}-${STATUS_PROCESS}, ${itemCls}-${STATUS_FINISH}`]: {
[varName("item-icon-bg-color")]: colorPrimaryBg,
[varName("item-icon-border-color")]: "transparent",
[varName("item-icon-text-color")]: colorPrimary,
[varName("item-icon-dot-bg-color")]: colorPrimary,
[varName("item-icon-bg-hover-color")]: colorPrimaryBgHover,
[varName("item-icon-border-hover-color")]: "transparent",
[varName("item-icon-text-hover-color")]: colorPrimary,
[varName("item-icon-active-bg-color")]: colorPrimary,
[varName("item-icon-active-border-color")]: "transparent",
[varName("item-icon-active-text-color")]: colorTextLightSolid
},
[`${itemCls}-${STATUS_ERROR}`]: {
[varName("item-icon-bg-color")]: colorErrorBg,
[varName("item-icon-border-color")]: "transparent",
[varName("item-icon-text-color")]: colorError,
[varName("item-icon-dot-bg-color")]: colorError,
[varName("item-icon-bg-hover-color")]: colorErrorBgFilledHover,
[varName("item-icon-border-hover-color")]: "transparent",
[varName("item-icon-text-hover-color")]: colorError,
[varName("item-icon-active-bg-color")]: colorError,
[varName("item-icon-active-border-color")]: "transparent",
[varName("item-icon-active-text-color")]: colorTextLightSolid
}
} },
{ [`&${componentCls}-outlined`]: {
[itemCls]: { [varName("item-icon-dot-bg-color")]: "transparent" },
[`${itemCls}-${STATUS_WAIT}`]: {
[varName("item-icon-bg-color")]: colorBgContainer,
[varName("item-icon-border-color")]: colorTextDisabled,
[varName("item-icon-text-color")]: colorTextDisabled,
[varName("item-icon-dot-color")]: colorTextDisabled,
[varName("item-icon-bg-hover-color")]: "transparent",
[varName("item-icon-border-hover-color")]: colorPrimaryHover,
[varName("item-icon-text-hover-color")]: colorPrimaryHover,
[varName("item-icon-active-bg-color")]: colorFillTertiary
},
[`${itemCls}-${STATUS_PROCESS}, ${itemCls}-${STATUS_FINISH}`]: {
[varName("item-icon-bg-color")]: colorBgContainer,
[varName("item-icon-border-color")]: colorPrimary,
[varName("item-icon-text-color")]: colorPrimary,
[varName("item-icon-dot-color")]: colorPrimary,
[varName("item-icon-bg-hover-color")]: "transparent",
[varName("item-icon-border-hover-color")]: colorPrimaryHover,
[varName("item-icon-text-hover-color")]: colorPrimaryHover,
[varName("item-icon-active-bg-color")]: colorPrimaryBg
},
[`${itemCls}-${STATUS_ERROR}`]: {
[varName("item-icon-bg-color")]: colorBgContainer,
[varName("item-icon-border-color")]: colorError,
[varName("item-icon-text-color")]: colorError,
[varName("item-icon-dot-color")]: colorError,
[varName("item-icon-bg-hover-color")]: "transparent",
[varName("item-icon-border-hover-color")]: colorErrorHover,
[varName("item-icon-text-hover-color")]: colorErrorHover,
[varName("item-icon-active-bg-color")]: colorErrorBg
}
} }
] };
};
//#endregion
//#region node_modules/antd/es/steps/style/vertical.js
var genVerticalStyle$1 = (token) => {
const { componentCls, marginXXS, paddingSM, controlHeight, antCls, calc } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [`${componentCls}-vertical`]: {
[varName("vertical-rail-margin")]: calc(marginXXS).mul(1.5).equal(),
flexDirection: "column",
alignItems: "stretch",
[`> ${itemCls}`]: {
minHeight: calc(controlHeight).mul(1.5).equal(),
paddingBottom: paddingSM,
"&:last-child": { paddingBottom: 0 },
[`${itemCls}-icon`]: { marginInlineStart: `calc((${varRef("icon-size-max")} - ${varRef("icon-size")}) / 2)` },
[`${itemCls}-rail`]: {
[varName("rail-offset")]: calc(varRef("heading-height")).sub(varRef("icon-size")).div(2).equal(),
borderInlineStartWidth: varRef("rail-size"),
position: "absolute",
top: calc(varRef("icon-size")).add(varRef("item-wrapper-padding-top")).add(varRef("rail-offset")).add(varRef("vertical-rail-margin")).equal(),
insetInlineStart: calc(varRef("icon-size-max")).div(2).equal(),
bottom: calc(varRef("vertical-rail-margin")).sub(varRef("rail-offset")).equal(),
marginInlineStart: `calc(${varRef("rail-size")} / -2)`
}
}
} };
};
//#endregion
//#region node_modules/antd/es/steps/style/index.js
var genBasicStyle = (token) => {
const { componentCls, antCls } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [componentCls]: {
[varName("title-font-size")]: token.fontSizeLG,
[varName("title-line-height")]: token.lineHeightLG,
[varName("subtitle-font-size")]: token.fontSize,
[varName("subtitle-line-height")]: token.lineHeight,
[varName("item-wrapper-padding-top")]: "0px",
[varName("rail-size")]: token.lineWidth,
[varName("rail-line-style")]: token.lineType,
...resetComponent(token),
display: "flex",
flexWrap: "nowrap",
alignItems: "flex-start",
[itemCls]: {
flex: "none",
position: "relative"
},
[`${itemCls}-wrapper`]: {
display: "flex",
flexWrap: "nowrap",
paddingTop: varRef("item-wrapper-padding-top")
},
[`${itemCls}-header`]: {
display: "flex",
flexWrap: "nowrap",
alignItems: "center"
},
[`${itemCls}-title`]: {
color: token.colorText,
fontSize: varRef("title-font-size"),
lineHeight: varRef("title-line-height"),
wordBreak: "break-word"
},
[`${itemCls}-subtitle`]: {
color: token.colorTextDescription,
fontWeight: "normal",
fontSize: varRef("subtitle-font-size"),
lineHeight: varRef("subtitle-line-height"),
marginInlineStart: token.marginXS,
wordBreak: "break-word"
},
[`${itemCls}-content`]: {
color: token.colorTextDescription,
fontSize: token.fontSize,
lineHeight: token.lineHeight,
wordBreak: "break-word"
},
[`${itemCls}-rail`]: {
borderStyle: varRef("rail-line-style"),
borderWidth: 0
},
[`${itemCls}-title, ${itemCls}-subtitle, ${itemCls}-content, ${itemCls}-rail`]: { transition: `all ${token.motionDurationSlow}` },
[`&${componentCls}-ellipsis`]: { [`${itemCls}-title, ${itemCls}-subtitle, ${itemCls}-content`]: textEllipsis },
[`${itemCls}[role='button']:not(${itemCls}-active):hover`]: { cursor: "pointer" }
} };
};
var prepareComponentToken$9 = (token) => ({
titleLineHeight: token.controlHeight,
customIconSize: token.controlHeight,
customIconTop: 0,
customIconFontSize: token.controlHeightSM,
iconSize: token.controlHeight,
iconTop: -.5,
iconFontSize: token.fontSize,
iconSizeSM: token.fontSizeHeading3,
dotSize: token.controlHeight / 4,
dotCurrentSize: token.controlHeightLG / 4,
navArrowColor: token.colorTextDisabled,
navContentMaxWidth: "unset",
descriptionMaxWidth: void 0,
waitIconColor: token.wireframe ? token.colorTextDisabled : token.colorTextLabel,
waitIconBgColor: token.wireframe ? token.colorBgContainer : token.colorFillContent,
waitIconBorderColor: token.wireframe ? token.colorTextDisabled : "transparent",
finishIconBgColor: token.wireframe ? token.colorBgContainer : token.controlItemBgActive,
finishIconBorderColor: token.wireframe ? token.colorPrimary : token.controlItemBgActive
});
var style_default$9 = genStyleHooks("Steps", (token) => {
const stepsToken = merge(token, { inlineDotSize: 6 });
return [
genBasicStyle(stepsToken),
genIconStyle(stepsToken),
genVerticalStyle$1(stepsToken),
genHorizontalStyle$1(stepsToken),
genLabelPlacementStyle(stepsToken),
genSmallStyle(stepsToken),
genDotStyle(stepsToken),
genStatusStyle(stepsToken),
genLegacyNavStyle(stepsToken),
genPanelStyle(stepsToken),
genInlineStyle(stepsToken),
genStepsProgressStyle(stepsToken),
genRTLStyle(stepsToken)
];
}, prepareComponentToken$9);
//#endregion
//#region node_modules/antd/es/steps/index.js
var waveEffectClassNames = { itemIcon: TARGET_CLS };
var Steps = (props) => {
const { size, className, rootClassName, style, variant = "filled", type, classNames, styles, direction, orientation, responsive = true, progressDot, labelPlacement, titlePlacement, ellipsis, offset = 0, items, percent, current = 0, onChange, iconRender, ...restProps } = props;
const internalContent = import_react.useContext(InternalContext);
const contextContent = useComponentConfig("steps");
const { getPrefixCls, direction: rtlDirection, className: contextClassName, style: contextStyle } = contextContent;
let contextClassNames;
let contextStyles;
let components = {};
if (internalContent) components = {
root: internalContent.rootComponent,
item: internalContent.itemComponent
};
else ({classNames: contextClassNames, styles: contextStyles} = contextContent);
const rootPrefixCls = getPrefixCls();
const prefixCls = getPrefixCls("steps", props.prefixCls);
const itemIconCls = `${prefixCls}-item-icon`;
const [hashId, cssVarCls] = style_default$9(prefixCls);
const [varName] = genCssVar(rootPrefixCls, "cmp-steps");
devUseWarning("Steps").deprecated(size !== "default", "size=\"default\"", "size=\"medium\"");
const mergedSize = useSize(size);
const mergedItems = import_react.useMemo(() => (items || []).filter(Boolean), [items]);
const { xs } = useBreakpoint$1(responsive);
const mergedType = import_react.useMemo(() => {
if (type && type !== "default") return type;
if (progressDot) return "dot";
return type;
}, [progressDot, type]);
const isInline = mergedType === "inline";
const isDot = mergedType === "dot" || mergedType === "inline";
const legacyProgressDotRender = import_react.useMemo(() => {
return mergedType === "dot" && typeof progressDot === "function" ? progressDot : void 0;
}, [mergedType, progressDot]);
const mergedOrientation = import_react.useMemo(() => {
const nextOrientation = orientation || direction;
if (mergedType === "panel") return "horizontal";
return responsive && xs || nextOrientation === "vertical" ? "vertical" : "horizontal";
}, [
orientation,
direction,
mergedType,
responsive,
xs
]);
const mergedTitlePlacement = import_react.useMemo(() => {
if (isDot || mergedOrientation === "vertical") return mergedOrientation === "vertical" ? "horizontal" : "vertical";
if (type === "navigation") return "horizontal";
return titlePlacement || labelPlacement || "horizontal";
}, [
isDot,
labelPlacement,
mergedOrientation,
titlePlacement,
type
]);
const mergedPercent = isInline ? void 0 : percent;
const mergedProps = {
...props,
variant,
size: mergedSize,
type: mergedType,
orientation: mergedOrientation,
titlePlacement: mergedTitlePlacement,
current,
percent: mergedPercent,
responsive,
offset
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([
waveEffectClassNames,
contextClassNames,
classNames
], [contextStyles, styles], { props: mergedProps });
const internalIconRender = (_, info) => {
const { item, index, active, components: { Icon: StepIcon } } = info;
const { status, icon } = item;
let iconContent = null;
if (isDot || icon) iconContent = icon;
else switch (status) {
case "finish":
iconContent = /* @__PURE__ */ import_react.createElement(RefIcon$9, { className: `${itemIconCls}-finish` });
break;
case "error":
iconContent = /* @__PURE__ */ import_react.createElement(RefIcon, { className: `${itemIconCls}-error` });
break;
default: {
let numNode = /* @__PURE__ */ import_react.createElement("span", { className: `${itemIconCls}-number` }, info.index + 1);
if (status === "process" && mergedPercent !== void 0) numNode = /* @__PURE__ */ import_react.createElement(ProgressIcon, {
prefixCls,
rootPrefixCls,
percent: mergedPercent
}, numNode);
iconContent = numNode;
}
}
let iconNode = /* @__PURE__ */ import_react.createElement(StepIcon, null, iconContent);
if (iconRender) iconNode = iconRender(iconNode, {
index,
active,
item,
components: { Icon: StepIcon }
});
else if (typeof legacyProgressDotRender === "function") iconNode = legacyProgressDotRender(iconNode, {
index,
...item
});
return iconNode;
};
const itemRender = (itemNode, itemInfo) => {
let content = itemNode;
if (isInline && itemInfo.item.content) content = /* @__PURE__ */ import_react.createElement(Tooltip, {
destroyOnHidden: true,
title: itemInfo.item.content
}, itemNode);
return /* @__PURE__ */ import_react.createElement(Wave, {
component: "Steps",
disabled: itemInfo.item.disabled || !onChange,
colorSource: variant === "filled" ? "color" : null
}, content);
};
const itemWrapperRender = mergedType === "panel" ? (itemNode) => {
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, itemNode, /* @__PURE__ */ import_react.createElement(PanelArrow, { prefixCls }));
} : void 0;
const mergedStyle = {
[varName("items-offset")]: `${offset}`,
...contextStyle,
...style
};
const stepsClassName = clsx(contextClassName, `${prefixCls}-${variant}`, {
[`${prefixCls}-${mergedType}`]: mergedType !== "dot" ? mergedType : false,
[`${prefixCls}-rtl`]: rtlDirection === "rtl",
[`${prefixCls}-dot`]: isDot,
[`${prefixCls}-ellipsis`]: ellipsis,
[`${prefixCls}-with-progress`]: mergedPercent !== void 0,
[`${prefixCls}-small`]: mergedSize === "small"
}, className, rootClassName, hashId, cssVarCls);
{
const warning = devUseWarning("Steps");
warning.deprecated(!labelPlacement, "labelPlacement", "titlePlacement");
warning.deprecated(!progressDot, "progressDot", "type=\"dot\"");
warning.deprecated(!direction, "direction", "orientation");
warning.deprecated(mergedItems.every((item) => !item.description), "items.description", "items.content");
}
return /* @__PURE__ */ import_react.createElement(es_default$4, {
...restProps,
prefixCls,
className: stepsClassName,
style: mergedStyle,
classNames: mergedClassNames,
styles: mergedStyles,
orientation: mergedOrientation,
titlePlacement: mergedTitlePlacement,
components,
current,
items: mergedItems,
onChange,
iconRender: internalIconRender,
itemRender,
itemWrapperRender
});
};
Steps.displayName = "Steps";
//#endregion
//#region node_modules/@rc-component/switch/es/index.js
function _extends$21() {
_extends$21 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$21.apply(this, arguments);
}
var Switch$1 = /* @__PURE__ */ import_react.forwardRef(({ prefixCls = "rc-switch", className, checked, defaultChecked, disabled, loadingIcon, checkedChildren, unCheckedChildren, onClick, onChange, onKeyDown, styles, classNames: switchClassNames, ...restProps }, ref) => {
const [innerChecked, setInnerChecked] = useControlledState(defaultChecked ?? false, checked);
function triggerChange(newChecked, event) {
let mergedChecked = innerChecked;
if (!disabled) {
mergedChecked = newChecked;
setInnerChecked(mergedChecked);
onChange?.(mergedChecked, event);
}
return mergedChecked;
}
function onInternalKeyDown(e) {
if (e.which === KeyCode.LEFT) triggerChange(false, e);
else if (e.which === KeyCode.RIGHT) triggerChange(true, e);
onKeyDown?.(e);
}
function onInternalClick(e) {
const ret = triggerChange(!innerChecked, e);
onClick?.(ret, e);
}
const switchClassName = clsx(prefixCls, className, {
[`${prefixCls}-checked`]: innerChecked,
[`${prefixCls}-disabled`]: disabled
});
return /* @__PURE__ */ import_react.createElement("button", _extends$21({}, restProps, {
type: "button",
role: "switch",
"aria-checked": innerChecked,
disabled,
className: switchClassName,
ref,
onKeyDown: onInternalKeyDown,
onClick: onInternalClick
}), loadingIcon, /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-inner` }, /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-inner-checked`, switchClassNames?.content),
style: styles?.content
}, checkedChildren), /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-inner-unchecked`, switchClassNames?.content),
style: styles?.content
}, unCheckedChildren)));
});
Switch$1.displayName = "Switch";
//#endregion
//#region node_modules/antd/es/switch/style/index.js
var genSwitchSmallStyle = (token) => {
const { componentCls, trackHeightSM, trackPadding, trackMinWidthSM, innerMinMarginSM, innerMaxMarginSM, handleSizeSM, calc } = token;
const switchInnerCls = `${componentCls}-inner`;
const trackPaddingCalc = unit$1(calc(handleSizeSM).add(calc(trackPadding).mul(2)).equal());
const innerMaxMarginCalc = unit$1(calc(innerMaxMarginSM).mul(2).equal());
return { [componentCls]: { [`&${componentCls}-small`]: {
minWidth: trackMinWidthSM,
height: trackHeightSM,
lineHeight: unit$1(trackHeightSM),
[`${componentCls}-inner`]: {
paddingInlineStart: innerMaxMarginSM,
paddingInlineEnd: innerMinMarginSM,
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: { minHeight: trackHeightSM },
[`${switchInnerCls}-checked`]: {
marginInlineStart: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`,
marginInlineEnd: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`
},
[`${switchInnerCls}-unchecked`]: {
marginTop: calc(trackHeightSM).mul(-1).equal(),
marginInlineStart: 0,
marginInlineEnd: 0
}
},
[`${componentCls}-handle`]: {
width: handleSizeSM,
height: handleSizeSM
},
[`${componentCls}-loading-icon`]: {
top: calc(calc(handleSizeSM).sub(token.switchLoadingIconSize)).div(2).equal(),
fontSize: token.switchLoadingIconSize
},
[`&${componentCls}-checked`]: {
[`${componentCls}-inner`]: {
paddingInlineStart: innerMinMarginSM,
paddingInlineEnd: innerMaxMarginSM,
[`${switchInnerCls}-checked`]: {
marginInlineStart: 0,
marginInlineEnd: 0
},
[`${switchInnerCls}-unchecked`]: {
marginInlineStart: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`,
marginInlineEnd: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`
}
},
[`${componentCls}-handle`]: { insetInlineStart: `calc(100% - ${unit$1(calc(handleSizeSM).add(trackPadding).equal())})` }
},
[`&:not(${componentCls}-disabled):active`]: {
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: { [`${switchInnerCls}-unchecked`]: {
marginInlineStart: calc(token.marginXXS).div(2).equal(),
marginInlineEnd: calc(token.marginXXS).mul(-1).div(2).equal()
} },
[`&${componentCls}-checked ${switchInnerCls}`]: { [`${switchInnerCls}-checked`]: {
marginInlineStart: calc(token.marginXXS).mul(-1).div(2).equal(),
marginInlineEnd: calc(token.marginXXS).div(2).equal()
} }
}
} } };
};
var genSwitchLoadingStyle = (token) => {
const { componentCls, handleSize, calc } = token;
return { [componentCls]: {
[`${componentCls}-loading-icon${token.iconCls}`]: {
position: "relative",
top: calc(calc(handleSize).sub(token.fontSize)).div(2).equal(),
color: token.switchLoadingIconColor,
verticalAlign: "top"
},
[`&${componentCls}-checked ${componentCls}-loading-icon`]: { color: token.switchColor }
} };
};
var genSwitchHandleStyle = (token) => {
const { componentCls, trackPadding, handleBg, handleShadow, handleSize, calc } = token;
const switchHandleCls = `${componentCls}-handle`;
return { [componentCls]: {
[switchHandleCls]: {
position: "absolute",
top: trackPadding,
insetInlineStart: trackPadding,
width: handleSize,
height: handleSize,
transition: `all ${token.switchDuration} ease-in-out`,
...genNoMotionStyle(),
"&::before": {
position: "absolute",
top: 0,
insetInlineEnd: 0,
bottom: 0,
insetInlineStart: 0,
backgroundColor: handleBg,
borderRadius: calc(handleSize).div(2).equal(),
boxShadow: handleShadow,
transition: `all ${token.switchDuration} ease-in-out`,
content: "\"\"",
...genNoMotionStyle()
}
},
[`&${componentCls}-checked ${switchHandleCls}`]: { insetInlineStart: `calc(100% - ${unit$1(calc(handleSize).add(trackPadding).equal())})` },
[`&:not(${componentCls}-disabled):active`]: {
[`${switchHandleCls}::before`]: {
insetInlineEnd: token.switchHandleActiveInset,
insetInlineStart: 0
},
[`&${componentCls}-checked ${switchHandleCls}::before`]: {
insetInlineEnd: 0,
insetInlineStart: token.switchHandleActiveInset
}
}
} };
};
var genSwitchInnerStyle = (token) => {
const { componentCls, trackHeight, trackPadding, innerMinMargin, innerMaxMargin, handleSize, switchDuration, calc } = token;
const switchInnerCls = `${componentCls}-inner`;
const trackPaddingCalc = unit$1(calc(handleSize).add(calc(trackPadding).mul(2)).equal());
const innerMaxMarginCalc = unit$1(calc(innerMaxMargin).mul(2).equal());
return { [componentCls]: {
[switchInnerCls]: {
display: "block",
overflow: "hidden",
borderRadius: 100,
height: "100%",
paddingInlineStart: innerMaxMargin,
paddingInlineEnd: innerMinMargin,
transition: [`padding-inline-start`, `padding-inline-end`].map((prop) => `${prop} ${switchDuration} ease-in-out`).join(", "),
...genNoMotionStyle(),
[`${switchInnerCls}-checked, ${switchInnerCls}-unchecked`]: {
display: "block",
color: token.colorTextLightSolid,
fontSize: token.fontSizeSM,
pointerEvents: "none",
minHeight: trackHeight,
transition: [`margin-inline-start`, `margin-inline-end`].map((prop) => `${prop} ${switchDuration} ease-in-out`).join(", "),
...genNoMotionStyle()
},
[`${switchInnerCls}-checked`]: {
marginInlineStart: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`,
marginInlineEnd: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`
},
[`${switchInnerCls}-unchecked`]: {
marginTop: calc(trackHeight).mul(-1).equal(),
marginInlineStart: 0,
marginInlineEnd: 0
}
},
[`&${componentCls}-checked ${switchInnerCls}`]: {
paddingInlineStart: innerMinMargin,
paddingInlineEnd: innerMaxMargin,
[`${switchInnerCls}-checked`]: {
marginInlineStart: 0,
marginInlineEnd: 0
},
[`${switchInnerCls}-unchecked`]: {
marginInlineStart: `calc(100% - ${trackPaddingCalc} + ${innerMaxMarginCalc})`,
marginInlineEnd: `calc(-100% + ${trackPaddingCalc} - ${innerMaxMarginCalc})`
}
},
[`&:not(${componentCls}-disabled):active`]: {
[`&:not(${componentCls}-checked) ${switchInnerCls}`]: { [`${switchInnerCls}-unchecked`]: {
marginInlineStart: calc(trackPadding).mul(2).equal(),
marginInlineEnd: calc(trackPadding).mul(-1).mul(2).equal()
} },
[`&${componentCls}-checked ${switchInnerCls}`]: { [`${switchInnerCls}-checked`]: {
marginInlineStart: calc(trackPadding).mul(-1).mul(2).equal(),
marginInlineEnd: calc(trackPadding).mul(2).equal()
} }
}
} };
};
var genSwitchStyle = (token) => {
const { componentCls, trackHeight, trackMinWidth } = token;
return { [componentCls]: {
...resetComponent(token),
position: "relative",
display: "inline-block",
boxSizing: "border-box",
minWidth: trackMinWidth,
height: trackHeight,
lineHeight: unit$1(trackHeight),
verticalAlign: "middle",
background: token.colorTextQuaternary,
border: "0",
borderRadius: 100,
cursor: "pointer",
transition: `all ${token.motionDurationMid}`,
userSelect: "none",
...genNoMotionStyle(),
[`&:hover:not(${componentCls}-disabled)`]: { background: token.colorTextTertiary },
...genFocusStyle(token),
[`&${componentCls}-checked`]: {
background: token.switchColor,
[`&:hover:not(${componentCls}-disabled)`]: { background: token.colorPrimaryHover }
},
[`&${componentCls}-loading, &${componentCls}-disabled`]: {
cursor: "not-allowed",
opacity: token.switchDisabledOpacity,
"*": {
boxShadow: "none",
cursor: "not-allowed"
}
},
[`&${componentCls}-rtl`]: { direction: "rtl" }
} };
};
var prepareComponentToken$8 = (token) => {
const { fontSize, lineHeight, controlHeight, colorWhite } = token;
const height = fontSize * lineHeight;
const heightSM = controlHeight / 2;
const padding = 2;
const handleSize = height - padding * 2;
const handleSizeSM = heightSM - padding * 2;
return {
trackHeight: height,
trackHeightSM: heightSM,
trackMinWidth: handleSize * 2 + padding * 4,
trackMinWidthSM: handleSizeSM * 2 + padding * 2,
trackPadding: padding,
handleBg: colorWhite,
handleSize,
handleSizeSM,
handleShadow: `0 2px 4px 0 ${new FastColor("#00230b").setA(.2).toRgbString()}`,
innerMinMargin: handleSize / 2,
innerMaxMargin: handleSize + padding + padding * 2,
innerMinMarginSM: handleSizeSM / 2,
innerMaxMarginSM: handleSizeSM + padding + padding * 2
};
};
var style_default$8 = genStyleHooks("Switch", (token) => {
const switchToken = merge(token, {
switchDuration: token.motionDurationMid,
switchColor: token.colorPrimary,
switchDisabledOpacity: token.opacityLoading,
switchLoadingIconSize: token.calc(token.fontSizeIcon).mul(.75).equal(),
switchLoadingIconColor: `rgba(0, 0, 0, ${token.opacityLoading})`,
switchHandleActiveInset: "-30%"
});
return [
genSwitchStyle(switchToken),
genSwitchInnerStyle(switchToken),
genSwitchHandleStyle(switchToken),
genSwitchLoadingStyle(switchToken),
genSwitchSmallStyle(switchToken)
];
}, prepareComponentToken$8);
//#endregion
//#region node_modules/antd/es/switch/index.js
var Switch = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, size: customizeSize, disabled: customDisabled, loading, className, rootClassName, style, checked: checkedProp, value, defaultChecked: defaultCheckedProp, defaultValue, onChange, styles, classNames, ...restProps } = props;
const [checked, setChecked] = useControlledState(defaultCheckedProp ?? defaultValue ?? false, checkedProp ?? value);
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("switch");
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = (customDisabled ?? disabled) || loading;
const prefixCls = getPrefixCls("switch", customizePrefixCls);
const [hashId, cssVarCls] = style_default$8(prefixCls);
devUseWarning("Switch").deprecated(customizeSize !== "default", "size=\"default\"", "size=\"medium\"");
const mergedSize = useSize(customizeSize);
const mergedProps = {
...props,
size: mergedSize,
disabled: mergedDisabled
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const loadingIcon = /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-handle`, mergedClassNames.indicator),
style: mergedStyles.indicator
}, loading && /* @__PURE__ */ import_react.createElement(RefIcon$5, { className: `${prefixCls}-loading-icon` }));
const classes = clsx(contextClassName, {
[`${prefixCls}-small`]: mergedSize === "small",
[`${prefixCls}-loading`]: loading,
[`${prefixCls}-rtl`]: direction === "rtl"
}, className, rootClassName, mergedClassNames.root, hashId, cssVarCls);
const mergedStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
const changeHandler = (...args) => {
setChecked(args[0]);
onChange?.(...args);
};
return /* @__PURE__ */ import_react.createElement(Wave, {
component: "Switch",
disabled: mergedDisabled
}, /* @__PURE__ */ import_react.createElement(Switch$1, {
...restProps,
classNames: mergedClassNames,
styles: mergedStyles,
checked,
onChange: changeHandler,
prefixCls,
className: classes,
style: mergedStyle,
disabled: mergedDisabled,
ref,
loadingIcon
}));
});
Switch.__ANT_SWITCH = true;
Switch.displayName = "Switch";
//#endregion
//#region node_modules/@rc-component/table/es/constant.js
var EXPAND_COLUMN = {};
var INTERNAL_HOOKS = "rc-table-internal-hook";
//#endregion
//#region node_modules/@rc-component/context/es/context.js
function createContext(defaultValue) {
const Context = /* @__PURE__ */ import_react.createContext(void 0);
const Provider = ({ value, children }) => {
const valueRef = import_react.useRef(value);
valueRef.current = value;
const [context] = import_react.useState(() => ({
getValue: () => valueRef.current,
listeners: /* @__PURE__ */ new Set()
}));
useLayoutEffect$1(() => {
(0, import_react_dom.unstable_batchedUpdates)(() => {
context.listeners.forEach((listener) => {
listener(value);
});
});
}, [value]);
return /* @__PURE__ */ import_react.createElement(Context.Provider, { value: context }, children);
};
return {
Context,
Provider,
defaultValue
};
}
/** e.g. useSelect(userContext) => user */
/** e.g. useSelect(userContext, user => user.name) => user.name */
/** e.g. useSelect(userContext, ['name', 'age']) => user { name, age } */
/** e.g. useSelect(userContext, 'name') => user.name */
function useContext$1(holder, selector) {
const eventSelector = useEvent(typeof selector === "function" ? selector : (ctx) => {
if (selector === void 0) return ctx;
if (!Array.isArray(selector)) return ctx[selector];
const obj = {};
selector.forEach((key) => {
obj[key] = ctx[key];
});
return obj;
});
const context = import_react.useContext(holder?.Context);
const { listeners, getValue } = context || {};
const valueRef = import_react.useRef();
valueRef.current = eventSelector(context ? getValue() : holder?.defaultValue);
const [, forceUpdate] = import_react.useState({});
useLayoutEffect$1(() => {
if (!context) return;
function trigger(nextValue) {
const nextSelectorValue = eventSelector(nextValue);
if (!isEqual(valueRef.current, nextSelectorValue, true)) forceUpdate({});
}
listeners.add(trigger);
return () => {
listeners.delete(trigger);
};
}, [context]);
return valueRef.current;
}
//#endregion
//#region node_modules/@rc-component/context/es/Immutable.js
function _extends$20() {
_extends$20 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$20.apply(this, arguments);
}
/**
* Create Immutable pair for `makeImmutable` and `responseImmutable`.
*/
function createImmutable() {
const ImmutableContext = /* @__PURE__ */ import_react.createContext(null);
/**
* Get render update mark by `makeImmutable` root.
* Do not deps on the return value as render times
* but only use for `useMemo` or `useCallback` deps.
*/
function useImmutableMark() {
return import_react.useContext(ImmutableContext);
}
/**
* Wrapped Component will be marked as Immutable.
* When Component parent trigger render,
* it will notice children component (use with `responseImmutable`) node that parent has updated.
* @param Component Passed Component
* @param triggerRender Customize trigger `responseImmutable` children re-render logic. Default will always trigger re-render when this component re-render.
*/
function makeImmutable(Component, shouldTriggerRender) {
const refAble = supportRef(Component);
const ImmutableComponent = (props, ref) => {
const refProps = refAble ? { ref } : {};
const renderTimesRef = import_react.useRef(0);
const prevProps = import_react.useRef(props);
if (useImmutableMark() !== null) return /* @__PURE__ */ import_react.createElement(Component, _extends$20({}, props, refProps));
if (!shouldTriggerRender || shouldTriggerRender(prevProps.current, props)) renderTimesRef.current += 1;
prevProps.current = props;
return /* @__PURE__ */ import_react.createElement(ImmutableContext.Provider, { value: renderTimesRef.current }, /* @__PURE__ */ import_react.createElement(Component, _extends$20({}, props, refProps)));
};
ImmutableComponent.displayName = `ImmutableRoot(${Component.displayName || Component.name})`;
return refAble ? /* @__PURE__ */ import_react.forwardRef(ImmutableComponent) : ImmutableComponent;
}
/**
* Wrapped Component with `React.memo`.
* But will rerender when parent with `makeImmutable` rerender.
*/
function responseImmutable(Component, propsAreEqual) {
const refAble = supportRef(Component);
const ImmutableComponent = (props, ref) => {
const refProps = refAble ? { ref } : {};
useImmutableMark();
return /* @__PURE__ */ import_react.createElement(Component, _extends$20({}, props, refProps));
};
ImmutableComponent.displayName = `ImmutableResponse(${Component.displayName || Component.name})`;
return /* @__PURE__ */ import_react.memo(refAble ? /* @__PURE__ */ import_react.forwardRef(ImmutableComponent) : ImmutableComponent, propsAreEqual);
}
return {
makeImmutable,
responseImmutable,
useImmutableMark
};
}
//#endregion
//#region node_modules/@rc-component/context/es/index.js
var { makeImmutable: makeImmutable$1, responseImmutable: responseImmutable$1, useImmutableMark: useImmutableMark$1 } = createImmutable();
//#endregion
//#region node_modules/@rc-component/table/es/context/TableContext.js
var { makeImmutable, responseImmutable, useImmutableMark } = createImmutable();
var TableContext = createContext();
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useRenderTimes.js
/* istanbul ignore file */
function useRenderTimes(props, debug) {
const timesRef = import_react.useRef(0);
timesRef.current += 1;
const propsRef = import_react.useRef(props);
const keys = [];
Object.keys(props || {}).map((key) => {
if (props?.[key] !== propsRef.current?.[key]) keys.push(key);
});
propsRef.current = props;
const keysRef = import_react.useRef([]);
if (keys.length) keysRef.current = keys;
import_react.useDebugValue(timesRef.current);
import_react.useDebugValue(keysRef.current.join(", "));
if (debug) console.log(`${debug}:`, timesRef.current, keysRef.current);
return timesRef.current;
}
var RenderBlock = /* @__PURE__ */ import_react.memo(() => {
const times = useRenderTimes();
return /* @__PURE__ */ import_react.createElement("h1", null, "Render Times: ", times);
});
RenderBlock.displayName = "RenderBlock";
//#endregion
//#region node_modules/@rc-component/table/es/context/PerfContext.js
var PerfContext = /* @__PURE__ */ import_react.createContext({ renderWithProps: false });
//#endregion
//#region node_modules/@rc-component/table/es/utils/valueUtil.js
var INTERNAL_KEY_PREFIX = "RC_TABLE_KEY";
function toArray$1(arr) {
if (arr === void 0 || arr === null) return [];
return Array.isArray(arr) ? arr : [arr];
}
function getColumnsKey(columns) {
const columnKeys = [];
const keys = {};
columns.forEach((column) => {
const { key, dataIndex } = column || {};
let mergedKey = key || toArray$1(dataIndex).join("-") || INTERNAL_KEY_PREFIX;
while (keys[mergedKey]) mergedKey = `${mergedKey}_next`;
keys[mergedKey] = true;
columnKeys.push(mergedKey);
});
return columnKeys;
}
function validateValue(val) {
return val !== null && val !== void 0;
}
function validNumberValue(value) {
return typeof value === "number" && !Number.isNaN(value);
}
//#endregion
//#region node_modules/@rc-component/table/es/Cell/useCellRender.js
function isRenderCell(data) {
return data && typeof data === "object" && !Array.isArray(data) && !/* @__PURE__ */ import_react.isValidElement(data);
}
function useCellRender(record, dataIndex, renderIndex, children, render, shouldCellUpdate) {
const perfRecord = import_react.useContext(PerfContext);
return useMemo$44(() => {
if (validateValue(children)) return [children];
const value = get(record, dataIndex === null || dataIndex === void 0 || dataIndex === "" ? [] : Array.isArray(dataIndex) ? dataIndex : [dataIndex]);
let returnChildNode = value;
let returnCellProps = void 0;
if (render) {
const renderData = render(value, record, renderIndex);
if (isRenderCell(renderData)) {
warningOnce(false, "`columns.render` return cell props is deprecated with perf issue, please use `onCell` instead.");
returnChildNode = renderData.children;
returnCellProps = renderData.props;
perfRecord.renderWithProps = true;
} else returnChildNode = renderData;
}
return [returnChildNode, returnCellProps];
}, [
useImmutableMark(),
record,
children,
dataIndex,
render,
renderIndex
], (prev, next) => {
if (shouldCellUpdate) {
const [, prevRecord] = prev;
const [, nextRecord] = next;
return shouldCellUpdate(nextRecord, prevRecord);
}
if (perfRecord.renderWithProps) return true;
return !isEqual(prev, next, true);
});
}
//#endregion
//#region node_modules/@rc-component/table/es/Cell/useHoverState.js
/** Check if cell is in hover range */
function inHoverRange(cellStartRow, cellRowSpan, startRow, endRow) {
const cellEndRow = cellStartRow + cellRowSpan - 1;
return cellStartRow <= endRow && cellEndRow >= startRow;
}
function useHoverState(rowIndex, rowSpan) {
return useContext$1(TableContext, (ctx) => {
return [inHoverRange(rowIndex, rowSpan || 1, ctx.hoverStartRow, ctx.hoverEndRow), ctx.onHover];
});
}
//#endregion
//#region node_modules/@rc-component/table/es/Cell/index.js
function _extends$19() {
_extends$19 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$19.apply(this, arguments);
}
var getTitleFromCellRenderChildren = ({ ellipsis, rowType, children }) => {
let title;
const ellipsisConfig = ellipsis === true ? { showTitle: true } : ellipsis;
if (ellipsisConfig && (ellipsisConfig.showTitle || rowType === "header")) {
if (typeof children === "string" || typeof children === "number") title = children.toString();
else if (/* @__PURE__ */ import_react.isValidElement(children) && typeof children.props?.children === "string") title = children.props?.children;
}
return title;
};
var Cell = (props) => {
useRenderTimes(props);
const { component: Component, children, ellipsis, scope, prefixCls, className, style, align, record, render, dataIndex, renderIndex, shouldCellUpdate, index, rowType, colSpan, rowSpan, fixStart, fixEnd, fixedStartShadow, fixedEndShadow, offsetFixedStartShadow, offsetFixedEndShadow, zIndex, zIndexReverse, appendNode, additionalProps = {}, isSticky } = props;
const cellPrefixCls = `${prefixCls}-cell`;
const { allColumnsFixedLeft, rowHoverable } = useContext$1(TableContext, ["allColumnsFixedLeft", "rowHoverable"]);
const [childNode, legacyCellProps] = useCellRender(record, dataIndex, renderIndex, children, render, shouldCellUpdate);
const fixedStyle = {};
const isFixStart = typeof fixStart === "number" && !allColumnsFixedLeft;
const isFixEnd = typeof fixEnd === "number" && !allColumnsFixedLeft;
const [showFixStartShadow, showFixEndShadow] = useContext$1(TableContext, ({ scrollInfo }) => {
if (!isFixStart && !isFixEnd) return [false, false];
const [absScroll, scrollWidth] = scrollInfo;
return [(isFixStart && fixedStartShadow && absScroll) - offsetFixedStartShadow >= 1, (isFixEnd && fixedEndShadow && scrollWidth - absScroll) - offsetFixedEndShadow > 1];
});
if (isFixStart) {
fixedStyle.insetInlineStart = fixStart;
fixedStyle["--z-offset"] = zIndex;
fixedStyle["--z-offset-reverse"] = zIndexReverse;
}
if (isFixEnd) {
fixedStyle.insetInlineEnd = fixEnd;
fixedStyle["--z-offset"] = zIndex;
fixedStyle["--z-offset-reverse"] = zIndexReverse;
}
const mergedColSpan = legacyCellProps?.colSpan ?? additionalProps.colSpan ?? colSpan ?? 1;
const mergedRowSpan = legacyCellProps?.rowSpan ?? additionalProps.rowSpan ?? rowSpan ?? 1;
const [hovering, onHover] = useHoverState(index, mergedRowSpan);
const onMouseEnter = useEvent((event) => {
if (record) onHover(index, index + mergedRowSpan - 1);
additionalProps?.onMouseEnter?.(event);
});
const onMouseLeave = useEvent((event) => {
if (record) onHover(-1, -1);
additionalProps?.onMouseLeave?.(event);
});
if (mergedColSpan === 0 || mergedRowSpan === 0) return null;
const title = additionalProps.title ?? getTitleFromCellRenderChildren({
rowType,
ellipsis,
children: childNode
});
const mergedClassName = clsx(cellPrefixCls, className, {
[`${cellPrefixCls}-fix`]: isFixStart || isFixEnd,
[`${cellPrefixCls}-fix-start`]: isFixStart,
[`${cellPrefixCls}-fix-end`]: isFixEnd,
[`${cellPrefixCls}-fix-start-shadow`]: fixedStartShadow,
[`${cellPrefixCls}-fix-start-shadow-show`]: fixedStartShadow && showFixStartShadow,
[`${cellPrefixCls}-fix-end-shadow`]: fixedEndShadow,
[`${cellPrefixCls}-fix-end-shadow-show`]: fixedEndShadow && showFixEndShadow,
[`${cellPrefixCls}-ellipsis`]: ellipsis,
[`${cellPrefixCls}-with-append`]: appendNode,
[`${cellPrefixCls}-fix-sticky`]: (isFixStart || isFixEnd) && isSticky,
[`${cellPrefixCls}-row-hover`]: !legacyCellProps && hovering
}, additionalProps.className, legacyCellProps?.className);
const alignStyle = {};
if (align) alignStyle.textAlign = align;
const mergedStyle = {
...legacyCellProps?.style,
...fixedStyle,
...alignStyle,
...additionalProps.style,
...style
};
let mergedChildNode = childNode;
if (typeof mergedChildNode === "object" && !Array.isArray(mergedChildNode) && !/* @__PURE__ */ import_react.isValidElement(mergedChildNode)) mergedChildNode = null;
if (ellipsis && (fixedStartShadow || fixedEndShadow)) mergedChildNode = /* @__PURE__ */ import_react.createElement("span", { className: `${cellPrefixCls}-content` }, mergedChildNode);
return /* @__PURE__ */ import_react.createElement(Component, _extends$19({}, legacyCellProps, additionalProps, {
className: mergedClassName,
style: mergedStyle,
title,
scope,
onMouseEnter: rowHoverable ? onMouseEnter : void 0,
onMouseLeave: rowHoverable ? onMouseLeave : void 0,
colSpan: mergedColSpan !== 1 ? mergedColSpan : null,
rowSpan: mergedRowSpan !== 1 ? mergedRowSpan : null
}), appendNode, mergedChildNode);
};
var Cell_default = /* @__PURE__ */ import_react.memo(Cell);
//#endregion
//#region node_modules/@rc-component/table/es/utils/fixUtil.js
function isFixedStart(column) {
return column.fixed === "start";
}
function isFixedEnd(column) {
return column.fixed === "end";
}
function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets) {
const startColumn = columns[colStart] || {};
const endColumn = columns[colEnd] || {};
let fixStart = null;
let fixEnd = null;
if (isFixedStart(startColumn) && isFixedStart(endColumn)) fixStart = stickyOffsets.start[colStart];
else if (isFixedEnd(endColumn) && isFixedEnd(startColumn)) fixEnd = stickyOffsets.end[colEnd];
let fixedStartShadow = false;
let fixedEndShadow = false;
let zIndex = 0;
let zIndexReverse = 0;
if (fixStart !== null) {
fixedStartShadow = !columns[colEnd + 1] || !isFixedStart(columns[colEnd + 1]);
zIndex = columns.length * 2 - colStart;
zIndexReverse = columns.length + colStart;
}
if (fixEnd !== null) {
fixedEndShadow = !columns[colStart - 1] || !isFixedEnd(columns[colStart - 1]);
zIndex = colEnd;
zIndexReverse = columns.length - colEnd;
}
let offsetFixedStartShadow = 0;
let offsetFixedEndShadow = 0;
if (fixedStartShadow) {
for (let i = 0; i < colStart; i += 1) if (!isFixedStart(columns[i])) offsetFixedStartShadow += stickyOffsets.widths[i] || 0;
}
if (fixedEndShadow) {
for (let i = columns.length - 1; i > colEnd; i -= 1) if (!isFixedEnd(columns[i])) offsetFixedEndShadow += stickyOffsets.widths[i] || 0;
}
return {
fixStart,
fixEnd,
fixedStartShadow,
fixedEndShadow,
offsetFixedStartShadow,
offsetFixedEndShadow,
isSticky: stickyOffsets.isSticky,
zIndex,
zIndexReverse
};
}
//#endregion
//#region node_modules/@rc-component/table/es/Footer/SummaryContext.js
var SummaryContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/table/es/Footer/Cell.js
function _extends$18() {
_extends$18 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$18.apply(this, arguments);
}
var SummaryCell = (props) => {
const { className, index, children, colSpan = 1, rowSpan, align } = props;
const { prefixCls } = useContext$1(TableContext, ["prefixCls"]);
const { scrollColumnIndex, stickyOffsets, flattenColumns } = import_react.useContext(SummaryContext);
const mergedColSpan = index + colSpan - 1 + 1 === scrollColumnIndex ? colSpan + 1 : colSpan;
const fixedInfo = import_react.useMemo(() => getCellFixedInfo(index, index + mergedColSpan - 1, flattenColumns, stickyOffsets), [
index,
mergedColSpan,
flattenColumns,
stickyOffsets
]);
return /* @__PURE__ */ import_react.createElement(Cell_default, _extends$18({
className,
index,
component: "td",
prefixCls,
record: null,
dataIndex: null,
align,
colSpan: mergedColSpan,
rowSpan,
render: () => children
}, fixedInfo));
};
//#endregion
//#region node_modules/@rc-component/table/es/Footer/Row.js
var FooterRow = (props) => {
const { children, ...restProps } = props;
return /* @__PURE__ */ import_react.createElement("tr", restProps, children);
};
//#endregion
//#region node_modules/@rc-component/table/es/Footer/Summary.js
/**
* Syntactic sugar. Do not support HOC.
*/
var Summary = (props) => {
const { children } = props;
return children;
};
Summary.Row = FooterRow;
Summary.Cell = SummaryCell;
//#endregion
//#region node_modules/@rc-component/table/es/Footer/index.js
var Footer = (props) => {
useRenderTimes(props);
const { children, stickyOffsets, flattenColumns } = props;
const prefixCls = useContext$1(TableContext, "prefixCls");
const lastColumnIndex = flattenColumns.length - 1;
const scrollColumn = flattenColumns[lastColumnIndex];
const summaryContext = import_react.useMemo(() => ({
stickyOffsets,
flattenColumns,
scrollColumnIndex: scrollColumn?.scrollbar ? lastColumnIndex : null
}), [
scrollColumn,
flattenColumns,
lastColumnIndex,
stickyOffsets
]);
return /* @__PURE__ */ import_react.createElement(SummaryContext.Provider, { value: summaryContext }, /* @__PURE__ */ import_react.createElement("tfoot", { className: `${prefixCls}-summary` }, children));
};
var Footer_default = responseImmutable(Footer);
var FooterComponents = Summary;
//#endregion
//#region node_modules/@rc-component/table/es/sugar/Column.js
/* istanbul ignore next */
/**
* This is a syntactic sugar for `columns` prop.
* So HOC will not work on this.
*/
function Column$1(_) {
return null;
}
//#endregion
//#region node_modules/@rc-component/table/es/sugar/ColumnGroup.js
/* istanbul ignore next */
/**
* This is a syntactic sugar for `columns` prop.
* So HOC will not work on this.
*/
function ColumnGroup$1(_) {
return null;
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useFlattenRecords.js
function fillRecords(list, record, indent, childrenColumnName, expandedKeys, getRowKey, index) {
const key = getRowKey(record, index);
list.push({
record,
indent,
index,
rowKey: key
});
const expanded = expandedKeys?.has(key);
if (record && Array.isArray(record[childrenColumnName]) && expanded) for (let i = 0; i < record[childrenColumnName].length; i += 1) fillRecords(list, record[childrenColumnName][i], indent + 1, childrenColumnName, expandedKeys, getRowKey, i);
}
/**
* flat tree data on expanded state
*
* @export
* @template T
* @param {*} data : table data
* @param {string} childrenColumnName : 指定树形结构的列名
* @param {Set} expandedKeys : 展开的行对应的keys
* @param {GetRowKey} getRowKey : 获取当前rowKey的方法
* @returns flattened data
*/
function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {
return import_react.useMemo(() => {
if (expandedKeys?.size) {
const list = [];
for (let i = 0; i < data?.length; i += 1) {
const record = data[i];
fillRecords(list, record, 0, childrenColumnName, expandedKeys, getRowKey, i);
}
return list;
}
return data?.map((item, index) => {
return {
record: item,
indent: 0,
index,
rowKey: getRowKey(item, index)
};
});
}, [
data,
childrenColumnName,
expandedKeys,
getRowKey
]);
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useRowInfo.js
function useRowInfo(record, rowKey, recordIndex, indent) {
const context = useContext$1(TableContext, [
"prefixCls",
"fixedInfoList",
"flattenColumns",
"expandableType",
"expandRowByClick",
"onTriggerExpand",
"rowClassName",
"expandedRowClassName",
"indentSize",
"expandIcon",
"expandedRowRender",
"expandIconColumnIndex",
"expandedKeys",
"childrenColumnName",
"rowExpandable",
"onRow"
]);
const { flattenColumns, expandableType, expandedKeys, childrenColumnName, onTriggerExpand, rowExpandable, onRow, expandRowByClick, rowClassName } = context;
const nestExpandable = expandableType === "nest";
const rowSupportExpand = expandableType === "row" && (!rowExpandable || rowExpandable(record));
const mergedExpandable = rowSupportExpand || nestExpandable;
const expanded = expandedKeys && expandedKeys.has(rowKey);
const hasNestChildren = childrenColumnName && record && record[childrenColumnName];
const onInternalTriggerExpand = useEvent(onTriggerExpand);
const rowProps = onRow?.(record, recordIndex);
const onRowClick = rowProps?.onClick;
const onClick = (event, ...args) => {
if (expandRowByClick && mergedExpandable) onTriggerExpand(record, event);
onRowClick?.(event, ...args);
};
let computeRowClassName;
if (typeof rowClassName === "string") computeRowClassName = rowClassName;
else if (typeof rowClassName === "function") computeRowClassName = rowClassName(record, recordIndex, indent);
const columnsKey = getColumnsKey(flattenColumns);
return {
...context,
columnsKey,
nestExpandable,
expanded,
hasNestChildren,
record,
onTriggerExpand: onInternalTriggerExpand,
rowSupportExpand,
expandable: mergedExpandable,
rowProps: {
...rowProps,
className: clsx(computeRowClassName, rowProps?.className),
onClick
}
};
}
//#endregion
//#region node_modules/@rc-component/table/es/Body/ExpandedRow.js
var ExpandedRow = (props) => {
useRenderTimes(props);
const { prefixCls, children, component: Component, cellComponent, className, expanded, colSpan, isEmpty, stickyOffset = 0 } = props;
const { scrollbarSize, fixHeader, fixColumn, componentWidth, horizonScroll } = useContext$1(TableContext, [
"scrollbarSize",
"fixHeader",
"fixColumn",
"componentWidth",
"horizonScroll"
]);
let contentNode = children;
if (isEmpty ? horizonScroll && componentWidth : fixColumn) contentNode = /* @__PURE__ */ import_react.createElement("div", {
style: {
width: componentWidth - stickyOffset - (fixHeader && !isEmpty ? scrollbarSize : 0),
position: "sticky",
left: stickyOffset,
overflow: "hidden"
},
className: `${prefixCls}-expanded-row-fixed`
}, contentNode);
return /* @__PURE__ */ import_react.createElement(Component, {
className,
style: { display: expanded ? null : "none" }
}, /* @__PURE__ */ import_react.createElement(Cell_default, {
component: cellComponent,
prefixCls,
colSpan
}, contentNode));
};
//#endregion
//#region node_modules/@rc-component/table/es/utils/expandUtil.js
function renderExpandIcon$1({ prefixCls, record, onExpand, expanded, expandable }) {
const expandClassName = `${prefixCls}-row-expand-icon`;
if (!expandable) return /* @__PURE__ */ import_react.createElement("span", { className: clsx(expandClassName, `${prefixCls}-row-spaced`) });
const onClick = (event) => {
onExpand(record, event);
event.stopPropagation();
};
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(expandClassName, {
[`${prefixCls}-row-expanded`]: expanded,
[`${prefixCls}-row-collapsed`]: !expanded
}),
onClick
});
}
function findAllChildrenKeys(data, getRowKey, childrenColumnName) {
const keys = [];
function dig(list) {
(list || []).forEach((item, index) => {
keys.push(getRowKey(item, index));
dig(item[childrenColumnName]);
});
}
dig(data);
return keys;
}
function computedExpandedClassName(cls, record, index, indent) {
if (typeof cls === "string") return cls;
if (typeof cls === "function") return cls(record, index, indent);
return "";
}
//#endregion
//#region node_modules/@rc-component/table/es/Body/BodyRow.js
function _extends$17() {
_extends$17 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$17.apply(this, arguments);
}
function getCellProps(rowInfo, column, colIndex, indent, index, rowKeys = [], expandedRowOffset = 0) {
const { record, prefixCls, columnsKey, fixedInfoList, expandIconColumnIndex, nestExpandable, indentSize, expandIcon, expanded, hasNestChildren, onTriggerExpand, expandable, expandedKeys } = rowInfo;
const key = columnsKey[colIndex];
const fixedInfo = fixedInfoList[colIndex];
let appendCellNode;
if (colIndex === (expandIconColumnIndex || 0) && nestExpandable) appendCellNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("span", {
style: { paddingLeft: `${indentSize * indent}px` },
className: `${prefixCls}-row-indent indent-level-${indent}`
}), expandIcon({
prefixCls,
expanded,
expandable: hasNestChildren,
record,
onExpand: onTriggerExpand
}));
const additionalCellProps = column.onCell?.(record, index) || {};
if (expandedRowOffset) {
const { rowSpan = 1 } = additionalCellProps;
if (expandable && rowSpan && colIndex < expandedRowOffset) {
let currentRowSpan = rowSpan;
for (let i = index; i < index + rowSpan; i += 1) {
const rowKey = rowKeys[i];
if (expandedKeys.has(rowKey)) currentRowSpan += 1;
}
additionalCellProps.rowSpan = currentRowSpan;
}
}
return {
key,
fixedInfo,
appendCellNode,
additionalCellProps
};
}
var BodyRow = (props) => {
useRenderTimes(props);
const { className, style, classNames, styles, record, index, renderIndex, rowKey, rowKeys, indent = 0, rowComponent: RowComponent, cellComponent, scopeCellComponent, expandedRowInfo } = props;
const rowInfo = useRowInfo(record, rowKey, index, indent);
const { prefixCls, flattenColumns, expandedRowClassName, expandedRowRender, rowProps, expanded, rowSupportExpand } = rowInfo;
const expandedRef = import_react.useRef(false);
expandedRef.current ||= expanded;
useRenderTimes(props);
const expandedClsName = computedExpandedClassName(expandedRowClassName, record, index, indent);
const baseRowNode = /* @__PURE__ */ import_react.createElement(RowComponent, _extends$17({}, rowProps, {
"data-row-key": rowKey,
className: clsx(className, `${prefixCls}-row`, `${prefixCls}-row-level-${indent}`, rowProps?.className, classNames.row, { [expandedClsName]: indent >= 1 }),
style: {
...style,
...rowProps?.style,
...styles.row
}
}), flattenColumns.map((column, colIndex) => {
const { render, dataIndex, className: columnClassName } = column;
const { key, fixedInfo, appendCellNode, additionalCellProps } = getCellProps(rowInfo, column, colIndex, indent, index, rowKeys, expandedRowInfo?.offset);
return /* @__PURE__ */ import_react.createElement(Cell_default, _extends$17({
className: clsx(columnClassName, classNames.cell),
style: styles.cell,
ellipsis: column.ellipsis,
align: column.align,
scope: column.rowScope,
component: column.rowScope ? scopeCellComponent : cellComponent,
prefixCls,
key,
record,
index,
renderIndex,
dataIndex,
render,
shouldCellUpdate: column.shouldCellUpdate
}, fixedInfo, {
appendNode: appendCellNode,
additionalProps: additionalCellProps
}));
}));
let expandRowNode;
if (rowSupportExpand && (expandedRef.current || expanded)) {
const expandContent = expandedRowRender(record, index, indent + 1, expanded);
expandRowNode = /* @__PURE__ */ import_react.createElement(ExpandedRow, {
expanded,
className: clsx(`${prefixCls}-expanded-row`, `${prefixCls}-expanded-row-level-${indent + 1}`, expandedClsName),
prefixCls,
component: RowComponent,
cellComponent,
colSpan: expandedRowInfo ? expandedRowInfo.colSpan : flattenColumns.length,
isEmpty: false,
stickyOffset: expandedRowInfo?.sticky
}, expandContent);
}
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, baseRowNode, expandRowNode);
};
BodyRow.displayName = "BodyRow";
var BodyRow_default = responseImmutable(BodyRow);
//#endregion
//#region node_modules/@rc-component/table/es/Body/MeasureCell.js
var MeasureCell = (props) => {
const { columnKey, onColumnResize, title } = props;
const cellRef = import_react.useRef(null);
useLayoutEffect$1(() => {
if (cellRef.current) onColumnResize(columnKey, cellRef.current.offsetWidth);
}, []);
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, { data: columnKey }, /* @__PURE__ */ import_react.createElement("td", {
ref: cellRef,
style: {
paddingTop: 0,
paddingBottom: 0,
borderTop: 0,
borderBottom: 0,
height: 0
}
}, /* @__PURE__ */ import_react.createElement("div", { style: {
height: 0,
overflow: "hidden",
fontWeight: "bold"
} }, title || "\xA0")));
};
//#endregion
//#region node_modules/@rc-component/table/es/Body/MeasureRow.js
var MeasureRow = ({ prefixCls, columnsKey, onColumnResize, columns }) => {
const ref = import_react.useRef(null);
const { measureRowRender } = useContext$1(TableContext, ["measureRowRender"]);
const measureRow = /* @__PURE__ */ import_react.createElement("tr", {
"aria-hidden": "true",
className: `${prefixCls}-measure-row`,
style: { height: 0 },
ref
}, /* @__PURE__ */ import_react.createElement(RefResizeObserver.Collection, { onBatchResize: (infoList) => {
if (isVisible_default(ref.current)) infoList.forEach(({ data: columnKey, size }) => {
onColumnResize(columnKey, size.offsetWidth);
});
} }, columnsKey.map((columnKey) => {
const rawTitle = columns.find((col) => col.key === columnKey)?.title;
const titleForMeasure = /* @__PURE__ */ import_react.isValidElement(rawTitle) ? /* @__PURE__ */ import_react.cloneElement(rawTitle, { ref: null }) : rawTitle;
return /* @__PURE__ */ import_react.createElement(MeasureCell, {
key: columnKey,
columnKey,
onColumnResize,
title: titleForMeasure
});
})));
return typeof measureRowRender === "function" ? measureRowRender(measureRow) : measureRow;
};
//#endregion
//#region node_modules/@rc-component/table/es/Body/index.js
var Body = (props) => {
useRenderTimes(props);
const { data, measureColumnWidth } = props;
const { prefixCls, getComponent, onColumnResize, flattenColumns, getRowKey, expandedKeys, childrenColumnName, emptyNode, classNames, styles, expandedRowOffset = 0, colWidths } = useContext$1(TableContext, [
"prefixCls",
"getComponent",
"onColumnResize",
"flattenColumns",
"getRowKey",
"expandedKeys",
"childrenColumnName",
"emptyNode",
"classNames",
"styles",
"expandedRowOffset",
"fixedInfoList",
"colWidths"
]);
const { body: bodyCls = {} } = classNames || {};
const { body: bodyStyles = {} } = styles || {};
const flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
const rowKeys = import_react.useMemo(() => flattenData.map((item) => item.rowKey), [flattenData]);
const perfRef = import_react.useRef({ renderWithProps: false });
const expandedRowInfo = import_react.useMemo(() => {
const expandedColSpan = flattenColumns.length - expandedRowOffset;
let expandedStickyStart = 0;
for (let i = 0; i < expandedRowOffset; i += 1) expandedStickyStart += colWidths[i] || 0;
return {
offset: expandedRowOffset,
colSpan: expandedColSpan,
sticky: expandedStickyStart
};
}, [
flattenColumns.length,
expandedRowOffset,
colWidths
]);
const WrapperComponent = getComponent(["body", "wrapper"], "tbody");
const trComponent = getComponent(["body", "row"], "tr");
const tdComponent = getComponent(["body", "cell"], "td");
const thComponent = getComponent(["body", "cell"], "th");
let rows;
if (data.length) rows = flattenData.map((item, idx) => {
const { record, indent, index: renderIndex, rowKey } = item;
return /* @__PURE__ */ import_react.createElement(BodyRow_default, {
classNames: bodyCls,
styles: bodyStyles,
key: rowKey,
rowKey,
rowKeys,
record,
index: idx,
renderIndex,
rowComponent: trComponent,
cellComponent: tdComponent,
scopeCellComponent: thComponent,
indent,
expandedRowInfo
});
});
else rows = /* @__PURE__ */ import_react.createElement(ExpandedRow, {
expanded: true,
className: `${prefixCls}-placeholder`,
prefixCls,
component: trComponent,
cellComponent: tdComponent,
colSpan: flattenColumns.length,
isEmpty: true
}, emptyNode);
const columnsKey = getColumnsKey(flattenColumns);
return /* @__PURE__ */ import_react.createElement(PerfContext.Provider, { value: perfRef.current }, /* @__PURE__ */ import_react.createElement(WrapperComponent, {
style: bodyStyles.wrapper,
className: clsx(`${prefixCls}-tbody`, bodyCls.wrapper)
}, measureColumnWidth && /* @__PURE__ */ import_react.createElement(MeasureRow, {
prefixCls,
columnsKey,
onColumnResize,
columns: flattenColumns
}), rows));
};
Body.displayName = "Body";
var Body_default = responseImmutable(Body);
//#endregion
//#region node_modules/@rc-component/table/es/utils/legacyUtil.js
var INTERNAL_COL_DEFINE = "RC_TABLE_INTERNAL_COL_DEFINE";
function getExpandableProps(props) {
const { expandable, ...legacyExpandableConfig } = props;
let config;
if ("expandable" in props) config = {
...legacyExpandableConfig,
...expandable
};
else {
if ([
"indentSize",
"expandedRowKeys",
"defaultExpandedRowKeys",
"defaultExpandAllRows",
"expandedRowRender",
"expandRowByClick",
"expandIcon",
"onExpand",
"onExpandedRowsChange",
"expandedRowClassName",
"expandIconColumnIndex",
"showExpandColumn",
"title"
].some((prop) => prop in props)) warningOnce(false, "expanded related props have been moved into `expandable`.");
config = legacyExpandableConfig;
}
if (config.showExpandColumn === false) config.expandIconColumnIndex = -1;
return config;
}
//#endregion
//#region node_modules/@rc-component/table/es/ColGroup.js
function _extends$16() {
_extends$16 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$16.apply(this, arguments);
}
var ColGroup = (props) => {
const { colWidths, columns, columCount } = props;
const { tableLayout } = useContext$1(TableContext, ["tableLayout"]);
const cols = [];
const len = columCount || columns.length;
let mustInsert = false;
for (let i = len - 1; i >= 0; i -= 1) {
const width = colWidths[i];
const column = columns && columns[i];
let additionalProps;
let minWidth;
if (column) {
additionalProps = column[INTERNAL_COL_DEFINE];
if (tableLayout === "auto") minWidth = column.minWidth;
}
if (width || minWidth || additionalProps || mustInsert) {
const { columnType, ...restAdditionalProps } = additionalProps || {};
cols.unshift(/* @__PURE__ */ import_react.createElement("col", _extends$16({
key: i,
style: {
width,
minWidth
}
}, restAdditionalProps)));
mustInsert = true;
}
}
return cols.length > 0 ? /* @__PURE__ */ import_react.createElement("colgroup", null, cols) : null;
};
//#endregion
//#region node_modules/@rc-component/table/es/FixedHolder/index.js
function useColumnWidth(colWidths, columCount) {
return (0, import_react.useMemo)(() => {
const cloneColumns = [];
for (let i = 0; i < columCount; i += 1) {
const val = colWidths[i];
if (val !== void 0) cloneColumns[i] = val;
else return null;
}
return cloneColumns;
}, [colWidths.join("_"), columCount]);
}
var FixedHolder = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
useRenderTimes(props);
const { className, style, noData, columns, flattenColumns, colWidths, colGroup, columCount, stickyOffsets, direction, fixHeader, stickyTopOffset, stickyBottomOffset, stickyClassName, scrollX, tableLayout = "fixed", onScroll, maxContentScroll, children, ...restProps } = props;
const { prefixCls, scrollbarSize, isSticky, getComponent } = useContext$1(TableContext, [
"prefixCls",
"scrollbarSize",
"isSticky",
"getComponent"
]);
const TableComponent = getComponent(["header", "table"], "table");
const combinationScrollBarSize = isSticky && !fixHeader ? 0 : scrollbarSize;
const scrollRef = import_react.useRef(null);
const setScrollRef = import_react.useCallback((element) => {
fillRef(ref, element);
fillRef(scrollRef, element);
}, []);
import_react.useEffect(() => {
function onWheel(e) {
const { currentTarget, deltaX } = e;
if (deltaX) {
const { scrollLeft, scrollWidth, clientWidth } = currentTarget;
const maxScrollWidth = scrollWidth - clientWidth;
let nextScroll = scrollLeft + deltaX;
if (direction === "rtl") {
nextScroll = Math.max(-maxScrollWidth, nextScroll);
nextScroll = Math.min(0, nextScroll);
} else {
nextScroll = Math.min(maxScrollWidth, nextScroll);
nextScroll = Math.max(0, nextScroll);
}
onScroll({
currentTarget,
scrollLeft: nextScroll
});
e.preventDefault();
}
}
const scrollEle = scrollRef.current;
scrollEle?.addEventListener("wheel", onWheel, { passive: false });
return () => {
scrollEle?.removeEventListener("wheel", onWheel);
};
}, []);
const lastColumn = flattenColumns[flattenColumns.length - 1];
const ScrollBarColumn = {
fixed: lastColumn ? lastColumn.fixed : null,
scrollbar: true,
onHeaderCell: () => ({ className: `${prefixCls}-cell-scrollbar` })
};
const columnsWithScrollbar = (0, import_react.useMemo)(() => combinationScrollBarSize ? [...columns, ScrollBarColumn] : columns, [combinationScrollBarSize, columns]);
const flattenColumnsWithScrollbar = (0, import_react.useMemo)(() => combinationScrollBarSize ? [...flattenColumns, ScrollBarColumn] : flattenColumns, [combinationScrollBarSize, flattenColumns]);
const headerStickyOffsets = (0, import_react.useMemo)(() => {
const { start, end } = stickyOffsets;
return {
...stickyOffsets,
start,
end: [...end.map((width) => width + combinationScrollBarSize), 0],
isSticky
};
}, [
combinationScrollBarSize,
stickyOffsets,
isSticky
]);
const mergedColumnWidth = useColumnWidth(colWidths, columCount);
const isColGroupEmpty = (0, import_react.useMemo)(() => {
const noWidth = !mergedColumnWidth || !mergedColumnWidth.length || mergedColumnWidth.every((w) => !w);
return noData || noWidth;
}, [noData, mergedColumnWidth]);
return /* @__PURE__ */ import_react.createElement("div", {
style: {
overflow: "hidden",
...isSticky ? {
top: stickyTopOffset,
bottom: stickyBottomOffset
} : {},
...style
},
ref: setScrollRef,
className: clsx(className, { [stickyClassName]: !!stickyClassName })
}, /* @__PURE__ */ import_react.createElement(TableComponent, { style: {
tableLayout,
minWidth: "100%",
width: scrollX
} }, isColGroupEmpty ? colGroup : /* @__PURE__ */ import_react.createElement(ColGroup, {
colWidths: [...mergedColumnWidth, combinationScrollBarSize],
columCount: columCount + 1,
columns: flattenColumnsWithScrollbar
}), children({
...restProps,
stickyOffsets: headerStickyOffsets,
columns: columnsWithScrollbar,
flattenColumns: flattenColumnsWithScrollbar
})));
});
FixedHolder.displayName = "FixedHolder";
/** Return a table in div as fixed element which contains sticky info */
var FixedHolder_default = /* @__PURE__ */ import_react.memo(FixedHolder);
//#endregion
//#region node_modules/@rc-component/table/es/Header/HeaderRow.js
function _extends$15() {
_extends$15 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$15.apply(this, arguments);
}
var HeaderRow = (props) => {
const { cells, stickyOffsets, flattenColumns, rowComponent: RowComponent, cellComponent: CellComponent, onHeaderRow, index, classNames, styles } = props;
const { prefixCls } = useContext$1(TableContext, ["prefixCls"]);
let rowProps;
if (onHeaderRow) rowProps = onHeaderRow(cells.map((cell) => cell.column), index);
const columnsKey = getColumnsKey(cells.map((cell) => cell.column));
return /* @__PURE__ */ import_react.createElement(RowComponent, _extends$15({}, rowProps, {
className: classNames.row,
style: styles.row
}), cells.map((cell, cellIndex) => {
const { column, colStart, colEnd, colSpan } = cell;
const fixedInfo = getCellFixedInfo(colStart, colEnd, flattenColumns, stickyOffsets);
const additionalProps = column?.onHeaderCell?.(column) || {};
return /* @__PURE__ */ import_react.createElement(Cell_default, _extends$15({}, cell, {
scope: column.title ? colSpan > 1 ? "colgroup" : "col" : null,
ellipsis: column.ellipsis,
align: column.align,
component: CellComponent,
prefixCls,
key: columnsKey[cellIndex]
}, fixedInfo, {
additionalProps,
rowType: "header"
}));
}));
};
HeaderRow.displayName = "HeaderRow";
//#endregion
//#region node_modules/@rc-component/table/es/Header/Header.js
function parseHeaderRows(rootColumns, classNames, styles) {
const rows = [];
function fillRowCells(columns, colIndex, rowIndex = 0) {
rows[rowIndex] = rows[rowIndex] || [];
let currentColIndex = colIndex;
return columns.filter(Boolean).map((column) => {
const cell = {
key: column.key,
className: clsx(column.className, classNames.cell) || "",
style: styles.cell,
children: column.title,
column,
colStart: currentColIndex
};
let colSpan = 1;
const subColumns = column.children;
if (subColumns && subColumns.length > 0) {
colSpan = fillRowCells(subColumns, currentColIndex, rowIndex + 1).reduce((total, count) => total + count, 0);
cell.hasSubColumns = true;
}
if ("colSpan" in column) ({colSpan} = column);
if ("rowSpan" in column) cell.rowSpan = column.rowSpan;
cell.colSpan = colSpan;
cell.colEnd = cell.colStart + colSpan - 1;
rows[rowIndex].push(cell);
currentColIndex += colSpan;
return colSpan;
});
}
fillRowCells(rootColumns, 0);
const rowCount = rows.length;
for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) rows[rowIndex].forEach((cell) => {
if (!("rowSpan" in cell) && !cell.hasSubColumns) cell.rowSpan = rowCount - rowIndex;
});
return rows;
}
var Header = (props) => {
useRenderTimes(props);
const { stickyOffsets, columns, flattenColumns, onHeaderRow } = props;
const { prefixCls, getComponent, classNames, styles } = useContext$1(TableContext, [
"prefixCls",
"getComponent",
"classNames",
"styles"
]);
const { header: headerCls = {} } = classNames || {};
const { header: headerStyles = {} } = styles || {};
const rows = import_react.useMemo(() => parseHeaderRows(columns, headerCls, headerStyles), [
columns,
headerCls,
headerStyles
]);
const WrapperComponent = getComponent(["header", "wrapper"], "thead");
const trComponent = getComponent(["header", "row"], "tr");
const thComponent = getComponent(["header", "cell"], "th");
return /* @__PURE__ */ import_react.createElement(WrapperComponent, {
className: clsx(`${prefixCls}-thead`, headerCls.wrapper),
style: headerStyles.wrapper
}, rows.map((row, rowIndex) => {
return /* @__PURE__ */ import_react.createElement(HeaderRow, {
classNames: headerCls,
styles: headerStyles,
key: rowIndex,
flattenColumns,
cells: row,
stickyOffsets,
rowComponent: trComponent,
cellComponent: thComponent,
onHeaderRow,
index: rowIndex
});
}));
};
var Header_default = responseImmutable(Header);
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useColumns/useWidthColumns.js
function parseColWidth(totalWidth, width = "") {
if (typeof width === "number") return width;
if (width.endsWith("%")) return totalWidth * parseFloat(width) / 100;
return null;
}
/**
* Fill all column with width
*/
function useWidthColumns(flattenColumns, scrollWidth, clientWidth) {
return import_react.useMemo(() => {
if (scrollWidth && scrollWidth > 0) {
let totalWidth = 0;
let missWidthCount = 0;
flattenColumns.forEach((col) => {
const colWidth = parseColWidth(scrollWidth, col.width);
if (colWidth) totalWidth += colWidth;
else missWidthCount += 1;
});
const maxFitWidth = Math.max(scrollWidth, clientWidth);
let restWidth = Math.max(maxFitWidth - totalWidth, missWidthCount);
let restCount = missWidthCount;
const avgWidth = restWidth / missWidthCount;
let realTotal = 0;
const filledColumns = flattenColumns.map((col) => {
const clone = { ...col };
const colWidth = parseColWidth(scrollWidth, clone.width);
if (colWidth) clone.width = colWidth;
else {
const colAvgWidth = Math.floor(avgWidth);
clone.width = restCount === 1 ? restWidth : colAvgWidth;
restWidth -= colAvgWidth;
restCount -= 1;
}
realTotal += clone.width;
return clone;
});
if (realTotal < maxFitWidth) {
const scale = maxFitWidth / realTotal;
restWidth = maxFitWidth;
filledColumns.forEach((col, index) => {
const colWidth = Math.floor(col.width * scale);
col.width = index === filledColumns.length - 1 ? restWidth : colWidth;
restWidth -= colWidth;
});
}
return [filledColumns, Math.max(realTotal, maxFitWidth)];
}
return [flattenColumns, scrollWidth];
}, [
flattenColumns,
scrollWidth,
clientWidth
]);
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useColumns/index.js
function convertChildrenToColumns(children) {
return toArray$8(children).filter((node) => /* @__PURE__ */ import_react.isValidElement(node)).map((node) => {
const { key, props } = node;
const { children: nodeChildren, ...restProps } = props;
const column = {
key,
...restProps
};
if (nodeChildren) column.children = convertChildrenToColumns(nodeChildren);
return column;
});
}
function filterHiddenColumns(columns) {
return columns.filter((column) => column && typeof column === "object" && !column.hidden).map((column) => {
const subColumns = column.children;
if (subColumns && subColumns.length > 0) return {
...column,
children: filterHiddenColumns(subColumns)
};
return column;
});
}
function flatColumns(columns, parentKey = "key") {
return columns.filter((column) => column && typeof column === "object").reduce((list, column, index) => {
const { fixed } = column;
const parsedFixed = fixed === true || fixed === "left" ? "start" : fixed === "right" ? "end" : fixed;
const mergedKey = `${parentKey}-${index}`;
const subColumns = column.children;
if (subColumns && subColumns.length > 0) return [...list, ...flatColumns(subColumns, mergedKey).map((subColum) => ({
...subColum,
fixed: subColum.fixed ?? parsedFixed
}))];
return [...list, {
key: mergedKey,
...column,
fixed: parsedFixed
}];
}, []);
}
/**
* Parse `columns` & `children` into `columns`.
*/
function useColumns({ prefixCls, columns, children, expandable, expandedKeys, columnTitle, getRowKey, onTriggerExpand, expandIcon, rowExpandable, expandIconColumnIndex, expandedRowOffset = 0, direction, expandRowByClick, columnWidth, fixed, scrollWidth, clientWidth }, transformColumns) {
const baseColumns = import_react.useMemo(() => {
return filterHiddenColumns((columns || convertChildrenToColumns(children) || []).slice());
}, [columns, children]);
const withExpandColumns = import_react.useMemo(() => {
if (expandable) {
let cloneColumns = baseColumns.slice();
if (expandIconColumnIndex >= 0) warningOnce(false, "`expandIconColumnIndex` is deprecated. Please use `Table.EXPAND_COLUMN` in `columns` instead.");
if (!cloneColumns.includes(EXPAND_COLUMN)) {
const expandColIndex = expandIconColumnIndex || 0;
const insertIndex = expandColIndex === 0 && (fixed === "right" || fixed === "end") ? baseColumns.length : expandColIndex;
if (insertIndex >= 0) cloneColumns.splice(insertIndex, 0, EXPAND_COLUMN);
}
if (cloneColumns.filter((c) => c === EXPAND_COLUMN).length > 1) warningOnce(false, "There exist more than one `EXPAND_COLUMN` in `columns`.");
const expandColumnIndex = cloneColumns.indexOf(EXPAND_COLUMN);
cloneColumns = cloneColumns.filter((column, index) => column !== EXPAND_COLUMN || index === expandColumnIndex);
const prevColumn = baseColumns[expandColumnIndex];
let fixedColumn;
if (fixed) fixedColumn = fixed;
else fixedColumn = prevColumn ? prevColumn.fixed : null;
const expandColumn = {
[INTERNAL_COL_DEFINE]: {
className: `${prefixCls}-expand-icon-col`,
columnType: "EXPAND_COLUMN"
},
title: columnTitle,
fixed: fixedColumn,
className: `${prefixCls}-row-expand-icon-cell`,
width: columnWidth,
render: (_, record, index) => {
const rowKey = getRowKey(record, index);
const icon = expandIcon({
prefixCls,
expanded: expandedKeys.has(rowKey),
expandable: rowExpandable ? rowExpandable(record) : true,
record,
onExpand: onTriggerExpand
});
if (expandRowByClick) return /* @__PURE__ */ import_react.createElement("span", { onClick: (e) => e.stopPropagation() }, icon);
return icon;
}
};
return cloneColumns.map((col, index) => {
const column = col === EXPAND_COLUMN ? expandColumn : col;
if (index < expandedRowOffset) return {
...column,
fixed: column.fixed || "start"
};
return column;
});
}
if (baseColumns.includes(EXPAND_COLUMN)) warningOnce(false, "`expandable` is not config but there exist `EXPAND_COLUMN` in `columns`.");
return baseColumns.filter((col) => col !== EXPAND_COLUMN);
}, [
expandable,
baseColumns,
getRowKey,
expandedKeys,
expandIcon,
direction,
expandedRowOffset
]);
const mergedColumns = import_react.useMemo(() => {
let finalColumns = withExpandColumns;
if (transformColumns) finalColumns = transformColumns(finalColumns);
if (!finalColumns.length) finalColumns = [{ render: () => null }];
return finalColumns;
}, [
transformColumns,
withExpandColumns,
direction
]);
const [filledColumns, realScrollWidth] = useWidthColumns(import_react.useMemo(() => flatColumns(mergedColumns), [
mergedColumns,
direction,
scrollWidth
]), scrollWidth, clientWidth);
return [
mergedColumns,
filledColumns,
realScrollWidth
];
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useExpand.js
function useExpand(props, mergedData, getRowKey) {
const expandableConfig = getExpandableProps(props);
const { expandIcon, expandedRowKeys, defaultExpandedRowKeys, defaultExpandAllRows, expandedRowRender, onExpand, onExpandedRowsChange, childrenColumnName } = expandableConfig;
const mergedExpandIcon = expandIcon || renderExpandIcon$1;
const mergedChildrenColumnName = childrenColumnName || "children";
const expandableType = import_react.useMemo(() => {
if (expandedRowRender) return "row";
/**
* Fix https://github.com/ant-design/ant-design/issues/21154
* This is a workaround to not to break current behavior.
* We can remove follow code after final release.
*
* To other developer:
* Do not use `__PARENT_RENDER_ICON__` in prod since we will remove this when refactor
*/
if (props.expandable && props.internalHooks === "rc-table-internal-hook" && props.expandable.__PARENT_RENDER_ICON__ || mergedData.some((record) => record && typeof record === "object" && record[mergedChildrenColumnName])) return "nest";
return false;
}, [!!expandedRowRender, mergedData]);
const [innerExpandedKeys, setInnerExpandedKeys] = import_react.useState(() => {
if (defaultExpandedRowKeys) return defaultExpandedRowKeys;
if (defaultExpandAllRows) return findAllChildrenKeys(mergedData, getRowKey, mergedChildrenColumnName);
return [];
});
const mergedExpandedKeys = import_react.useMemo(() => new Set(expandedRowKeys || innerExpandedKeys || []), [expandedRowKeys, innerExpandedKeys]);
const onTriggerExpand = import_react.useCallback((record) => {
const key = getRowKey(record, mergedData.indexOf(record));
let newExpandedKeys;
const hasKey = mergedExpandedKeys.has(key);
if (hasKey) {
mergedExpandedKeys.delete(key);
newExpandedKeys = [...mergedExpandedKeys];
} else newExpandedKeys = [...mergedExpandedKeys, key];
setInnerExpandedKeys(newExpandedKeys);
if (onExpand) onExpand(!hasKey, record);
if (onExpandedRowsChange) onExpandedRowsChange(newExpandedKeys);
}, [
getRowKey,
mergedExpandedKeys,
mergedData,
onExpand,
onExpandedRowsChange
]);
if (expandedRowRender && mergedData.some((record) => {
return Array.isArray(record?.[mergedChildrenColumnName]);
})) warningOnce(false, "`expandedRowRender` should not use with nested Table");
return [
expandableConfig,
expandableType,
mergedExpandedKeys,
mergedExpandIcon,
mergedChildrenColumnName,
onTriggerExpand
];
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useFixedInfo.js
function useFixedInfo(flattenColumns, stickyOffsets) {
const fixedInfoList = import_react.useMemo(() => flattenColumns.map((_, colIndex) => getCellFixedInfo(colIndex, colIndex, flattenColumns, stickyOffsets)), [flattenColumns, stickyOffsets]);
return useMemo$44(() => fixedInfoList, [fixedInfoList], (prev, next) => !isEqual(prev, next));
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useFrame.js
/**
* Execute code before next frame but async
*/
function useLayoutState(defaultState) {
const stateRef = (0, import_react.useRef)(defaultState);
const [, forceUpdate] = (0, import_react.useState)({});
const lastPromiseRef = (0, import_react.useRef)(null);
const updateBatchRef = (0, import_react.useRef)([]);
function setFrameState(updater) {
updateBatchRef.current.push(updater);
const promise = Promise.resolve();
lastPromiseRef.current = promise;
promise.then(() => {
if (lastPromiseRef.current === promise) {
const prevBatch = updateBatchRef.current;
const prevState = stateRef.current;
updateBatchRef.current = [];
prevBatch.forEach((batchUpdater) => {
stateRef.current = batchUpdater(stateRef.current);
});
lastPromiseRef.current = null;
if (prevState !== stateRef.current) forceUpdate({});
}
});
}
(0, import_react.useEffect)(() => () => {
lastPromiseRef.current = null;
}, []);
return [stateRef.current, setFrameState];
}
/** Lock frame, when frame pass reset the lock. */
function useTimeoutLock(defaultState) {
const frameRef = (0, import_react.useRef)(defaultState || null);
const timeoutRef = (0, import_react.useRef)(null);
function cleanUp() {
clearTimeout(timeoutRef.current);
}
function setState(newState) {
frameRef.current = newState;
cleanUp();
timeoutRef.current = setTimeout(() => {
frameRef.current = null;
timeoutRef.current = void 0;
}, 100);
}
function getState() {
return frameRef.current;
}
(0, import_react.useEffect)(() => cleanUp, []);
return [setState, getState];
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useHover.js
function useHover() {
const [startRow, setStartRow] = import_react.useState(-1);
const [endRow, setEndRow] = import_react.useState(-1);
return [
startRow,
endRow,
import_react.useCallback((start, end) => {
setStartRow(start);
setEndRow(end);
}, [])
];
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useSticky.js
var defaultContainer = canUseDom() ? window : null;
/** Sticky header hooks */
function useSticky(sticky, prefixCls) {
const { offsetHeader = 0, offsetSummary = 0, offsetScroll = 0, getContainer = () => defaultContainer } = typeof sticky === "object" ? sticky : {};
const container = getContainer() || defaultContainer;
const isSticky = !!sticky;
return import_react.useMemo(() => {
return {
isSticky,
stickyClassName: isSticky ? `${prefixCls}-sticky-holder` : "",
offsetHeader,
offsetSummary,
offsetScroll,
container
};
}, [
isSticky,
offsetScroll,
offsetHeader,
offsetSummary,
prefixCls,
container
]);
}
//#endregion
//#region node_modules/@rc-component/table/es/hooks/useStickyOffsets.js
/**
* Get sticky column offset width
*/
function useStickyOffsets(colWidths, flattenColumns) {
return (0, import_react.useMemo)(() => {
const columnCount = flattenColumns.length;
const getOffsets = (startIndex, endIndex, offset) => {
const offsets = [];
let total = 0;
for (let i = startIndex; i !== endIndex; i += offset) {
offsets.push(total);
if (flattenColumns[i].fixed) total += colWidths[i] || 0;
}
return offsets;
};
return {
start: getOffsets(0, columnCount, 1),
end: getOffsets(columnCount - 1, -1, -1).reverse(),
widths: colWidths
};
}, [colWidths, flattenColumns]);
}
//#endregion
//#region node_modules/@rc-component/table/es/Panel/index.js
var Panel = (props) => {
const { children, className, style } = props;
return /* @__PURE__ */ import_react.createElement("div", {
className,
style
}, children);
};
//#endregion
//#region node_modules/@rc-component/table/es/utils/offsetUtil.js
function getOffset(node) {
const box = getDOM(node).getBoundingClientRect();
const docElem = document.documentElement;
return {
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || document.body.clientLeft || 0),
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
};
}
//#endregion
//#region node_modules/@rc-component/table/es/stickyScrollBar.js
var MOUSEUP_EVENT = "mouseup";
var MOUSEMOVE_EVENT = "mousemove";
var SCROLL_EVENT = "scroll";
var RESIZE_EVENT = "resize";
var StickyScrollBar = (props, ref) => {
const { scrollBodyRef, onScroll, offsetScroll, container, direction } = props;
const prefixCls = useContext$1(TableContext, "prefixCls");
const bodyScrollWidth = scrollBodyRef.current?.scrollWidth || 0;
const bodyWidth = scrollBodyRef.current?.clientWidth || 0;
const scrollBarWidth = bodyScrollWidth && bodyWidth * (bodyWidth / bodyScrollWidth);
const scrollBarRef = import_react.useRef(null);
const [scrollState, setScrollState] = useLayoutState({
scrollLeft: 0,
isHiddenScrollBar: true
});
const refState = import_react.useRef({
delta: 0,
x: 0
});
const [isActive, setActive] = import_react.useState(false);
const rafRef = import_react.useRef(null);
import_react.useEffect(() => () => {
wrapperRaf.cancel(rafRef.current);
}, []);
const onMouseUp = () => {
setActive(false);
};
const onMouseDown = (event) => {
event.persist();
refState.current.delta = event.pageX - scrollState.scrollLeft;
refState.current.x = 0;
setActive(true);
event.preventDefault();
};
const onMouseMove = (event) => {
const { buttons } = event || window?.event;
if (!isActive || buttons === 0) {
if (isActive) setActive(false);
return;
}
let left = refState.current.x + event.pageX - refState.current.x - refState.current.delta;
const isRTL = direction === "rtl";
left = Math.max(isRTL ? scrollBarWidth - bodyWidth : 0, Math.min(isRTL ? 0 : bodyWidth - scrollBarWidth, left));
if (!isRTL || Math.abs(left) + Math.abs(scrollBarWidth) < bodyWidth) {
onScroll({ scrollLeft: left / bodyWidth * (bodyScrollWidth + 2) });
refState.current.x = event.pageX;
}
};
const checkScrollBarVisible = () => {
wrapperRaf.cancel(rafRef.current);
rafRef.current = wrapperRaf(() => {
if (!scrollBodyRef.current) return;
const tableOffsetTop = getOffset(scrollBodyRef.current).top;
const tableBottomOffset = tableOffsetTop + scrollBodyRef.current.offsetHeight;
const currentClientOffset = container === window ? document.documentElement.scrollTop + window.innerHeight : getOffset(container).top + container.clientHeight;
if (tableBottomOffset - getScrollBarSize() <= currentClientOffset || tableOffsetTop >= currentClientOffset - offsetScroll) setScrollState((state) => ({
...state,
isHiddenScrollBar: true
}));
else setScrollState((state) => ({
...state,
isHiddenScrollBar: false
}));
});
};
const setScrollLeft = (left) => {
setScrollState((state) => {
return {
...state,
scrollLeft: left / bodyScrollWidth * bodyWidth || 0
};
});
};
import_react.useImperativeHandle(ref, () => ({
setScrollLeft,
checkScrollBarVisible
}));
import_react.useEffect(() => {
document.body.addEventListener(MOUSEUP_EVENT, onMouseUp, false);
document.body.addEventListener(MOUSEMOVE_EVENT, onMouseMove, false);
checkScrollBarVisible();
return () => {
document.body.removeEventListener(MOUSEUP_EVENT, onMouseUp);
document.body.removeEventListener(MOUSEMOVE_EVENT, onMouseMove);
};
}, [scrollBarWidth, isActive]);
import_react.useEffect(() => {
if (scrollBodyRef.current) {
const scrollParents = [];
let parent = getDOM(scrollBodyRef.current);
while (parent) {
scrollParents.push(parent);
parent = parent.parentElement;
}
scrollParents.forEach((p) => {
p.addEventListener(SCROLL_EVENT, checkScrollBarVisible, false);
});
window.addEventListener(RESIZE_EVENT, checkScrollBarVisible, false);
window.addEventListener(SCROLL_EVENT, checkScrollBarVisible, false);
container.addEventListener(SCROLL_EVENT, checkScrollBarVisible, false);
return () => {
scrollParents.forEach((p) => {
p.removeEventListener(SCROLL_EVENT, checkScrollBarVisible);
});
window.removeEventListener(RESIZE_EVENT, checkScrollBarVisible);
window.removeEventListener(SCROLL_EVENT, checkScrollBarVisible);
container.removeEventListener(SCROLL_EVENT, checkScrollBarVisible);
};
}
}, [container]);
import_react.useEffect(() => {
if (!scrollState.isHiddenScrollBar) setScrollState((state) => {
const bodyNode = scrollBodyRef.current;
if (!bodyNode) return state;
return {
...state,
scrollLeft: bodyNode.scrollLeft / bodyNode.scrollWidth * bodyNode.clientWidth
};
});
}, [scrollState.isHiddenScrollBar]);
if (bodyScrollWidth <= bodyWidth || !scrollBarWidth || scrollState.isHiddenScrollBar) return null;
return /* @__PURE__ */ import_react.createElement("div", {
style: {
height: getScrollBarSize(),
width: bodyWidth,
bottom: offsetScroll
},
className: `${prefixCls}-sticky-scroll`
}, /* @__PURE__ */ import_react.createElement("div", {
onMouseDown,
ref: scrollBarRef,
className: clsx(`${prefixCls}-sticky-scroll-bar`, { [`${prefixCls}-sticky-scroll-bar-active`]: isActive }),
style: {
width: `${scrollBarWidth}px`,
transform: `translate3d(${scrollState.scrollLeft}px, 0, 0)`
}
}));
};
var stickyScrollBar_default = /* @__PURE__ */ import_react.forwardRef(StickyScrollBar);
//#endregion
//#region node_modules/@rc-component/table/es/Table.js
/**
* Feature:
* - fixed not need to set width
* - support `rowExpandable` to config row expand logic
* - add `summary` to support `() => ReactNode`
*
* Update:
* - `dataIndex` is `array[]` now
* - `expandable` wrap all the expand related props
*
* Removed:
* - expandIconAsCell
* - useFixedHeader
* - rowRef
* - columns[number].onCellClick
* - onRowClick
* - onRowDoubleClick
* - onRowMouseEnter
* - onRowMouseLeave
* - getBodyWrapper
* - bodyStyle
*
* Deprecated:
* - All expanded props, move into expandable
*/
function _extends$14() {
_extends$14 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$14.apply(this, arguments);
}
var DEFAULT_PREFIX = "rc-table";
var EMPTY_DATA = [];
var EMPTY_SCROLL_TARGET = {};
function defaultEmpty() {
return "No Data";
}
var Table$1 = (tableProps, ref) => {
const props = {
rowKey: "key",
prefixCls: DEFAULT_PREFIX,
emptyText: defaultEmpty,
...tableProps
};
const { prefixCls, className, rowClassName, style, classNames, styles, data, rowKey, scroll, tableLayout, direction, title, footer, summary, caption, id, showHeader, components, emptyText, onRow, onHeaderRow, measureRowRender, onScroll, internalHooks, transformColumns, internalRefs, tailor, getContainerWidth, sticky, rowHoverable = true } = props;
const mergedData = data || EMPTY_DATA;
const hasData = !!mergedData.length;
const useInternalHooks = internalHooks === INTERNAL_HOOKS;
[
"onRowClick",
"onRowDoubleClick",
"onRowContextMenu",
"onRowMouseEnter",
"onRowMouseLeave"
].forEach((name) => {
warningOnce(props[name] === void 0, `\`${name}\` is removed, please use \`onRow\` instead.`);
});
warningOnce(!("getBodyWrapper" in props), "`getBodyWrapper` is deprecated, please use custom `components` instead.");
const getComponent = import_react.useCallback((path, defaultComponent) => get(components, path) || defaultComponent, [components]);
const getRowKey = import_react.useMemo(() => {
if (typeof rowKey === "function") return rowKey;
return (record) => {
const key = record && record[rowKey];
warningOnce(key !== void 0, "Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key.");
return key;
};
}, [rowKey]);
const customizeScrollBody = getComponent(["body"]);
const [startRow, endRow, onHover] = useHover();
const [expandableConfig, expandableType, mergedExpandedKeys, mergedExpandIcon, mergedChildrenColumnName, onTriggerExpand] = useExpand(props, mergedData, getRowKey);
const scrollX = scroll?.x;
const [componentWidth, setComponentWidth] = import_react.useState(0);
const [columns, flattenColumns, flattenScrollX] = useColumns({
...props,
...expandableConfig,
expandable: !!expandableConfig.expandedRowRender,
columnTitle: expandableConfig.columnTitle,
expandedKeys: mergedExpandedKeys,
getRowKey,
onTriggerExpand,
expandIcon: mergedExpandIcon,
expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
direction,
scrollWidth: useInternalHooks && tailor && typeof scrollX === "number" ? scrollX : null,
clientWidth: componentWidth
}, useInternalHooks ? transformColumns : null);
const mergedScrollX = flattenScrollX ?? scrollX;
const columnContext = import_react.useMemo(() => ({
columns,
flattenColumns
}), [columns, flattenColumns]);
const fullTableRef = import_react.useRef(null);
const scrollHeaderRef = import_react.useRef(null);
const scrollBodyRef = import_react.useRef(null);
const scrollBodyContainerRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => {
return {
nativeElement: fullTableRef.current,
scrollTo: (config) => {
if (scrollBodyRef.current instanceof HTMLElement) {
const { index, top, key, offset } = config;
if (validNumberValue(top)) scrollBodyRef.current?.scrollTo({ top });
else {
const mergedKey = key ?? getRowKey(mergedData[index]);
const targetElement = scrollBodyRef.current.querySelector(`[data-row-key="${mergedKey}"]`);
if (targetElement) if (!offset) targetElement.scrollIntoView();
else {
const elementTop = targetElement.offsetTop;
scrollBodyRef.current.scrollTo({ top: elementTop + offset });
}
}
} else if (scrollBodyRef.current?.scrollTo) scrollBodyRef.current.scrollTo(config);
}
};
});
const scrollSummaryRef = import_react.useRef(null);
const [shadowStart, setShadowStart] = import_react.useState(false);
const [shadowEnd, setShadowEnd] = import_react.useState(false);
const [colsWidths, updateColsWidths] = import_react.useState(/* @__PURE__ */ new Map());
const pureColWidths = getColumnsKey(flattenColumns).map((columnKey) => colsWidths.get(columnKey));
const colWidths = import_react.useMemo(() => pureColWidths, [pureColWidths.join("_")]);
const stickyOffsets = useStickyOffsets(colWidths, flattenColumns);
const fixHeader = scroll && validateValue(scroll.y);
const horizonScroll = scroll && validateValue(mergedScrollX) || Boolean(expandableConfig.fixed);
const fixColumn = horizonScroll && flattenColumns.some(({ fixed }) => fixed);
const stickyRef = import_react.useRef(null);
const { isSticky, offsetHeader, offsetSummary, offsetScroll, stickyClassName, container } = useSticky(sticky, prefixCls);
const summaryNode = import_react.useMemo(() => summary?.(mergedData), [summary, mergedData]);
const fixFooter = (fixHeader || isSticky) && /* @__PURE__ */ import_react.isValidElement(summaryNode) && summaryNode.type === Summary && summaryNode.props.fixed;
let scrollXStyle;
let scrollYStyle;
let scrollTableStyle;
if (fixHeader) scrollYStyle = {
overflowY: hasData ? "scroll" : "auto",
maxHeight: scroll.y
};
if (horizonScroll) {
scrollXStyle = { overflowX: "auto" };
if (!fixHeader) scrollYStyle = { overflowY: "hidden" };
scrollTableStyle = {
width: mergedScrollX === true ? "auto" : mergedScrollX,
minWidth: "100%"
};
}
const onColumnResize = import_react.useCallback((columnKey, width) => {
updateColsWidths((widths) => {
if (widths.get(columnKey) !== width) {
const newWidths = new Map(widths);
newWidths.set(columnKey, width);
return newWidths;
}
return widths;
});
}, []);
const [setScrollTarget, getScrollTarget] = useTimeoutLock(null);
function forceScroll(scrollLeft, target) {
if (!target) return;
if (typeof target === "function") target(scrollLeft);
else if (target.scrollLeft !== scrollLeft) {
target.scrollLeft = scrollLeft;
if (target.scrollLeft !== scrollLeft) setTimeout(() => {
target.scrollLeft = scrollLeft;
}, 0);
}
}
const [scrollInfo, setScrollInfo] = import_react.useState([0, 0]);
const onInternalScroll = useEvent(({ currentTarget, scrollLeft }) => {
const mergedScrollLeft = typeof scrollLeft === "number" ? scrollLeft : currentTarget.scrollLeft;
const compareTarget = currentTarget || EMPTY_SCROLL_TARGET;
if (!getScrollTarget() || getScrollTarget() === compareTarget) {
setScrollTarget(compareTarget);
forceScroll(mergedScrollLeft, scrollHeaderRef.current);
forceScroll(mergedScrollLeft, scrollBodyRef.current);
forceScroll(mergedScrollLeft, scrollSummaryRef.current);
forceScroll(mergedScrollLeft, stickyRef.current?.setScrollLeft);
}
const measureTarget = currentTarget || scrollHeaderRef.current;
if (measureTarget) {
const scrollWidth = useInternalHooks && tailor && typeof mergedScrollX === "number" ? mergedScrollX : measureTarget.scrollWidth;
const clientWidth = measureTarget.clientWidth;
const absScrollStart = Math.abs(mergedScrollLeft);
setScrollInfo((ori) => {
const nextScrollInfo = [absScrollStart, scrollWidth - clientWidth];
return isEqual(ori, nextScrollInfo) ? ori : nextScrollInfo;
});
if (scrollWidth === clientWidth) {
setShadowStart(false);
setShadowEnd(false);
return;
}
setShadowStart(absScrollStart > 0);
setShadowEnd(absScrollStart < scrollWidth - clientWidth - 1);
}
});
const onBodyScroll = useEvent((e) => {
onInternalScroll(e);
onScroll?.(e);
});
const triggerOnScroll = () => {
if (horizonScroll && scrollBodyRef.current) onInternalScroll({
currentTarget: getDOM(scrollBodyRef.current),
scrollLeft: scrollBodyRef.current?.scrollLeft
});
else {
setShadowStart(false);
setShadowEnd(false);
}
};
const onFullTableResize = (offsetWidth) => {
stickyRef.current?.checkScrollBarVisible();
let mergedWidth = offsetWidth ?? fullTableRef.current?.offsetWidth ?? 0;
if (useInternalHooks && getContainerWidth && fullTableRef.current) mergedWidth = getContainerWidth(fullTableRef.current, mergedWidth) || mergedWidth;
if (mergedWidth !== componentWidth) {
triggerOnScroll();
setComponentWidth(mergedWidth);
}
};
useLayoutEffect$1(() => {
if (horizonScroll) onFullTableResize();
}, [horizonScroll]);
const mounted = import_react.useRef(false);
import_react.useEffect(() => {
if (mounted.current) triggerOnScroll();
}, [
horizonScroll,
data,
columns.length
]);
import_react.useEffect(() => {
mounted.current = true;
}, []);
const [scrollbarSize, setScrollbarSize] = import_react.useState(0);
useLayoutEffect$1(() => {
if (!tailor || !useInternalHooks) if (scrollBodyRef.current instanceof Element) setScrollbarSize(getTargetScrollBarSize(scrollBodyRef.current).width);
else setScrollbarSize(getTargetScrollBarSize(scrollBodyContainerRef.current).width);
}, []);
import_react.useEffect(() => {
if (useInternalHooks && internalRefs) internalRefs.body.current = scrollBodyRef.current;
});
const renderFixedHeaderTable = import_react.useCallback((fixedHolderPassProps) => /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(Header_default, fixedHolderPassProps), fixFooter === "top" && /* @__PURE__ */ import_react.createElement(Footer_default, fixedHolderPassProps, summaryNode)), [fixFooter, summaryNode]);
const renderFixedFooterTable = import_react.useCallback((fixedHolderPassProps) => /* @__PURE__ */ import_react.createElement(Footer_default, fixedHolderPassProps, summaryNode), [summaryNode]);
const TableComponent = getComponent(["table"], "table");
const mergedTableLayout = import_react.useMemo(() => {
if (tableLayout) return tableLayout;
if (fixColumn) return mergedScrollX === "max-content" ? "auto" : "fixed";
if (fixHeader || isSticky || flattenColumns.some(({ ellipsis }) => ellipsis)) return "fixed";
return "auto";
}, [
fixHeader,
fixColumn,
flattenColumns,
tableLayout,
isSticky
]);
let groupTableNode;
const headerProps = {
colWidths,
columCount: flattenColumns.length,
stickyOffsets,
onHeaderRow,
fixHeader,
scroll
};
const emptyNode = import_react.useMemo(() => {
if (hasData) return null;
if (typeof emptyText === "function") return emptyText();
return emptyText;
}, [hasData, emptyText]);
const bodyTable = /* @__PURE__ */ import_react.createElement(Body_default, {
data: mergedData,
measureColumnWidth: fixHeader || horizonScroll || isSticky
});
const bodyColGroup = /* @__PURE__ */ import_react.createElement(ColGroup, {
colWidths: flattenColumns.map(({ width }) => width),
columns: flattenColumns
});
const captionElement = caption !== null && caption !== void 0 ? /* @__PURE__ */ import_react.createElement("caption", { className: `${prefixCls}-caption` }, caption) : void 0;
const dataProps = pickAttrs(props, { data: true });
const ariaProps = pickAttrs(props, { aria: true });
if (fixHeader || isSticky) {
let bodyContent;
if (typeof customizeScrollBody === "function") {
bodyContent = customizeScrollBody(mergedData, {
scrollbarSize,
ref: scrollBodyRef,
onScroll: onInternalScroll
});
headerProps.colWidths = flattenColumns.map(({ width }, index) => {
const colWidth = index === flattenColumns.length - 1 ? width - scrollbarSize : width;
if (typeof colWidth === "number" && !Number.isNaN(colWidth)) return colWidth;
warningOnce(props.columns.length === 0, "When use `components.body` with render props. Each column should have a fixed `width` value.");
return 0;
});
} else bodyContent = /* @__PURE__ */ import_react.createElement("div", {
style: {
...scrollXStyle,
...scrollYStyle
},
onScroll: onBodyScroll,
ref: scrollBodyRef,
className: `${prefixCls}-body`
}, /* @__PURE__ */ import_react.createElement(TableComponent, _extends$14({ style: {
...scrollTableStyle,
tableLayout: mergedTableLayout
} }, ariaProps), captionElement, bodyColGroup, bodyTable, !fixFooter && summaryNode && /* @__PURE__ */ import_react.createElement(Footer_default, {
stickyOffsets,
flattenColumns
}, summaryNode)));
const fixedHolderProps = {
noData: !mergedData.length,
maxContentScroll: horizonScroll && mergedScrollX === "max-content",
...headerProps,
...columnContext,
direction,
stickyClassName,
scrollX: mergedScrollX,
tableLayout: mergedTableLayout,
onScroll: onInternalScroll
};
groupTableNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, showHeader !== false && /* @__PURE__ */ import_react.createElement(FixedHolder_default, _extends$14({}, fixedHolderProps, {
stickyTopOffset: offsetHeader,
className: `${prefixCls}-header`,
ref: scrollHeaderRef,
colGroup: bodyColGroup
}), renderFixedHeaderTable), bodyContent, fixFooter && fixFooter !== "top" && /* @__PURE__ */ import_react.createElement(FixedHolder_default, _extends$14({}, fixedHolderProps, {
stickyBottomOffset: offsetSummary,
className: `${prefixCls}-summary`,
ref: scrollSummaryRef,
colGroup: bodyColGroup
}), renderFixedFooterTable), isSticky && scrollBodyRef.current && scrollBodyRef.current instanceof Element && /* @__PURE__ */ import_react.createElement(stickyScrollBar_default, {
ref: stickyRef,
offsetScroll,
scrollBodyRef,
onScroll: onInternalScroll,
container,
direction
}));
} else groupTableNode = /* @__PURE__ */ import_react.createElement("div", {
style: {
...scrollXStyle,
...scrollYStyle,
...styles?.content
},
className: clsx(`${prefixCls}-content`, classNames?.content),
onScroll: onInternalScroll,
ref: scrollBodyRef
}, /* @__PURE__ */ import_react.createElement(TableComponent, _extends$14({ style: {
...scrollTableStyle,
tableLayout: mergedTableLayout
} }, ariaProps), captionElement, bodyColGroup, showHeader !== false && /* @__PURE__ */ import_react.createElement(Header_default, _extends$14({}, headerProps, columnContext)), bodyTable, summaryNode && /* @__PURE__ */ import_react.createElement(Footer_default, {
stickyOffsets,
flattenColumns
}, summaryNode)));
const tableStyle = { ...style };
if (isSticky) tableStyle["--columns-count"] = flattenColumns.length;
let fullTable = /* @__PURE__ */ import_react.createElement("div", _extends$14({
className: clsx(prefixCls, className, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-fix-start-shadow`]: horizonScroll,
[`${prefixCls}-fix-end-shadow`]: horizonScroll,
[`${prefixCls}-fix-start-shadow-show`]: horizonScroll && shadowStart,
[`${prefixCls}-fix-end-shadow-show`]: horizonScroll && shadowEnd,
[`${prefixCls}-layout-fixed`]: tableLayout === "fixed",
[`${prefixCls}-fixed-header`]: fixHeader,
/** No used but for compatible */
[`${prefixCls}-fixed-column`]: fixColumn,
[`${prefixCls}-scroll-horizontal`]: horizonScroll,
[`${prefixCls}-has-fix-start`]: flattenColumns[0]?.fixed,
[`${prefixCls}-has-fix-end`]: flattenColumns[flattenColumns.length - 1]?.fixed === "end"
}),
style: tableStyle,
id,
ref: fullTableRef
}, dataProps), title && /* @__PURE__ */ import_react.createElement(Panel, {
className: clsx(`${prefixCls}-title`, classNames?.title),
style: styles?.title
}, title(mergedData)), /* @__PURE__ */ import_react.createElement("div", {
ref: scrollBodyContainerRef,
className: clsx(`${prefixCls}-container`, classNames?.section),
style: styles?.section
}, groupTableNode), footer && /* @__PURE__ */ import_react.createElement(Panel, {
className: clsx(`${prefixCls}-footer`, classNames?.footer),
style: styles?.footer
}, footer(mergedData)));
if (horizonScroll) fullTable = /* @__PURE__ */ import_react.createElement(RefResizeObserver, { onResize: ({ offsetWidth }) => onFullTableResize(offsetWidth) }, fullTable);
const fixedInfoList = useFixedInfo(flattenColumns, stickyOffsets);
const TableContextValue = import_react.useMemo(() => ({
scrollX: mergedScrollX,
scrollInfo,
classNames,
styles,
prefixCls,
getComponent,
scrollbarSize,
direction,
fixedInfoList,
isSticky,
componentWidth,
fixHeader,
fixColumn,
horizonScroll,
tableLayout: mergedTableLayout,
rowClassName,
expandedRowClassName: expandableConfig.expandedRowClassName,
expandIcon: mergedExpandIcon,
expandableType,
expandRowByClick: expandableConfig.expandRowByClick,
expandedRowRender: expandableConfig.expandedRowRender,
expandedRowOffset: expandableConfig.expandedRowOffset,
onTriggerExpand,
expandIconColumnIndex: expandableConfig.expandIconColumnIndex,
indentSize: expandableConfig.indentSize,
allColumnsFixedLeft: flattenColumns.every((col) => col.fixed === "start"),
emptyNode,
columns,
flattenColumns,
onColumnResize,
colWidths,
hoverStartRow: startRow,
hoverEndRow: endRow,
onHover,
rowExpandable: expandableConfig.rowExpandable,
onRow,
getRowKey,
expandedKeys: mergedExpandedKeys,
childrenColumnName: mergedChildrenColumnName,
rowHoverable,
measureRowRender
}), [
mergedScrollX,
scrollInfo,
classNames,
styles,
prefixCls,
getComponent,
scrollbarSize,
direction,
fixedInfoList,
isSticky,
componentWidth,
fixHeader,
fixColumn,
horizonScroll,
mergedTableLayout,
rowClassName,
expandableConfig.expandedRowClassName,
mergedExpandIcon,
expandableType,
expandableConfig.expandRowByClick,
expandableConfig.expandedRowRender,
expandableConfig.expandedRowOffset,
onTriggerExpand,
expandableConfig.expandIconColumnIndex,
expandableConfig.indentSize,
emptyNode,
columns,
flattenColumns,
onColumnResize,
colWidths,
startRow,
endRow,
onHover,
expandableConfig.rowExpandable,
onRow,
getRowKey,
mergedExpandedKeys,
mergedChildrenColumnName,
rowHoverable,
measureRowRender
]);
return /* @__PURE__ */ import_react.createElement(TableContext.Provider, { value: TableContextValue }, fullTable);
};
var RefTable = /* @__PURE__ */ import_react.forwardRef(Table$1);
RefTable.displayName = "Table";
var genTable = (shouldTriggerRender) => {
return makeImmutable(RefTable, shouldTriggerRender);
};
var ImmutableTable = genTable();
ImmutableTable.EXPAND_COLUMN = EXPAND_COLUMN;
ImmutableTable.INTERNAL_HOOKS = INTERNAL_HOOKS;
ImmutableTable.Column = Column$1;
ImmutableTable.ColumnGroup = ColumnGroup$1;
ImmutableTable.Summary = FooterComponents;
//#endregion
//#region node_modules/@rc-component/table/es/VirtualTable/context.js
var StaticContext = createContext(null);
var GridContext = createContext(null);
//#endregion
//#region node_modules/@rc-component/table/es/VirtualTable/VirtualCell.js
function _extends$13() {
_extends$13 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$13.apply(this, arguments);
}
/**
* Return the width of the column by `colSpan`.
* When `colSpan` is `0` will be trade as `1`.
*/
function getColumnWidth(colIndex, colSpan, columnsOffset) {
return columnsOffset[colIndex + (colSpan || 1)] - (columnsOffset[colIndex] || 0);
}
var VirtualCell = (props) => {
const { rowInfo, column, colIndex, indent, index, component, renderIndex, record, style, className, inverse, getHeight } = props;
const { render, dataIndex, className: columnClassName, width: colWidth } = column;
const { columnsOffset } = useContext$1(GridContext, ["columnsOffset"]);
const { key, fixedInfo, appendCellNode, additionalCellProps } = getCellProps(rowInfo, column, colIndex, indent, index);
const { style: cellStyle, colSpan = 1, rowSpan = 1 } = additionalCellProps;
const concatColWidth = getColumnWidth(colIndex - 1, colSpan, columnsOffset);
const marginOffset = colSpan > 1 ? colWidth - concatColWidth : 0;
const mergedStyle = {
...cellStyle,
...style,
flex: `0 0 ${concatColWidth}px`,
width: `${concatColWidth}px`,
marginRight: marginOffset,
pointerEvents: "auto"
};
const needHide = import_react.useMemo(() => {
if (inverse) return rowSpan <= 1;
else return colSpan === 0 || rowSpan === 0 || rowSpan > 1;
}, [
rowSpan,
colSpan,
inverse
]);
if (needHide) mergedStyle.visibility = "hidden";
else if (inverse) mergedStyle.height = getHeight?.(rowSpan);
const mergedRender = needHide ? () => null : render;
const cellSpan = {};
if (rowSpan === 0 || colSpan === 0) {
cellSpan.rowSpan = 1;
cellSpan.colSpan = 1;
}
return /* @__PURE__ */ import_react.createElement(Cell_default, _extends$13({
className: clsx(columnClassName, className),
ellipsis: column.ellipsis,
align: column.align,
scope: column.rowScope,
component,
prefixCls: rowInfo.prefixCls,
key,
record,
index,
renderIndex,
dataIndex,
render: mergedRender,
shouldCellUpdate: column.shouldCellUpdate
}, fixedInfo, {
appendNode: appendCellNode,
additionalProps: {
...additionalCellProps,
style: mergedStyle,
...cellSpan
}
}));
};
//#endregion
//#region node_modules/@rc-component/table/es/VirtualTable/BodyLine.js
function _extends$12() {
_extends$12 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$12.apply(this, arguments);
}
var ResponseBodyLine = responseImmutable(/* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { data, index, className, rowKey, style, extra, getHeight, ...restProps } = props;
const { record, indent, index: renderIndex } = data;
const { scrollX, flattenColumns, prefixCls, fixColumn, componentWidth } = useContext$1(TableContext, [
"prefixCls",
"flattenColumns",
"fixColumn",
"componentWidth",
"scrollX"
]);
const { getComponent } = useContext$1(StaticContext, ["getComponent"]);
const rowInfo = useRowInfo(record, rowKey, index, indent);
const RowComponent = getComponent(["body", "row"], "div");
const cellComponent = getComponent(["body", "cell"], "div");
const { rowSupportExpand, expanded, rowProps, expandedRowRender, expandedRowClassName } = rowInfo;
let expandRowNode;
if (rowSupportExpand && expanded) {
const expandContent = expandedRowRender(record, index, indent + 1, expanded);
const expandedClsName = computedExpandedClassName(expandedRowClassName, record, index, indent);
let additionalProps = {};
if (fixColumn) additionalProps = { style: { ["--virtual-width"]: `${componentWidth}px` } };
const rowCellCls = `${prefixCls}-expanded-row-cell`;
expandRowNode = /* @__PURE__ */ import_react.createElement(RowComponent, { className: clsx(`${prefixCls}-expanded-row`, `${prefixCls}-expanded-row-level-${indent + 1}`, expandedClsName) }, /* @__PURE__ */ import_react.createElement(Cell_default, {
component: cellComponent,
prefixCls,
className: clsx(rowCellCls, { [`${rowCellCls}-fixed`]: fixColumn }),
additionalProps
}, expandContent));
}
const rowStyle = {
...style,
width: scrollX
};
if (extra) {
rowStyle.position = "absolute";
rowStyle.pointerEvents = "none";
}
const rowNode = /* @__PURE__ */ import_react.createElement(RowComponent, _extends$12({}, rowProps, restProps, {
"data-row-key": rowKey,
ref: rowSupportExpand ? null : ref,
className: clsx(className, `${prefixCls}-row`, rowProps?.className, { [`${prefixCls}-row-extra`]: extra }),
style: {
...rowStyle,
...rowProps?.style
}
}), flattenColumns.map((column, colIndex) => {
return /* @__PURE__ */ import_react.createElement(VirtualCell, {
key: colIndex,
component: cellComponent,
rowInfo,
column,
colIndex,
indent,
index,
renderIndex,
record,
inverse: extra,
getHeight
});
}));
if (rowSupportExpand) return /* @__PURE__ */ import_react.createElement("div", { ref }, rowNode, expandRowNode);
return rowNode;
}));
ResponseBodyLine.displayName = "BodyLine";
//#endregion
//#region node_modules/@rc-component/table/es/VirtualTable/BodyGrid.js
var ResponseGrid = responseImmutable(/* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { data, onScroll } = props;
const { flattenColumns, onColumnResize, getRowKey, expandedKeys, prefixCls, childrenColumnName, scrollX, direction } = useContext$1(TableContext, [
"flattenColumns",
"onColumnResize",
"getRowKey",
"prefixCls",
"expandedKeys",
"childrenColumnName",
"scrollX",
"direction"
]);
const { sticky, scrollY, listItemHeight, getComponent, onScroll: onTablePropScroll } = useContext$1(StaticContext);
const listRef = import_react.useRef(null);
const flattenData = useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey);
const columnsWidth = import_react.useMemo(() => {
let total = 0;
return flattenColumns.map(({ width, minWidth, key }) => {
const finalWidth = Math.max(width || 0, minWidth || 0);
total += finalWidth;
return [
key,
finalWidth,
total
];
});
}, [flattenColumns]);
const columnsOffset = import_react.useMemo(() => columnsWidth.map((colWidth) => colWidth[2]), [columnsWidth]);
import_react.useEffect(() => {
columnsWidth.forEach(([key, width]) => {
onColumnResize(key, width);
});
}, [columnsWidth]);
import_react.useImperativeHandle(ref, () => {
const obj = {
scrollTo: (config) => {
const { offset, ...restConfig } = config;
if (offset) listRef.current?.scrollTo({
...restConfig,
offset,
align: "top"
});
else listRef.current?.scrollTo(config);
},
nativeElement: listRef.current?.nativeElement
};
Object.defineProperty(obj, "scrollLeft", {
get: () => listRef.current?.getScrollInfo().x || 0,
set: (value) => {
listRef.current?.scrollTo({ left: value });
}
});
Object.defineProperty(obj, "scrollTop", {
get: () => listRef.current?.getScrollInfo().y || 0,
set: (value) => {
listRef.current?.scrollTo({ top: value });
}
});
return obj;
});
const getRowSpan = (column, index) => {
const record = flattenData[index]?.record;
const { onCell } = column;
if (onCell) return onCell(record, index)?.rowSpan ?? 1;
return 1;
};
const extraRender = (info) => {
const { start, end, getSize, offsetY } = info;
if (end < 0) return null;
let firstRowSpanColumns = flattenColumns.filter((column) => getRowSpan(column, start) === 0);
let startIndex = start;
for (let i = start; i >= 0; i -= 1) {
firstRowSpanColumns = firstRowSpanColumns.filter((column) => getRowSpan(column, i) === 0);
if (!firstRowSpanColumns.length) {
startIndex = i;
break;
}
}
let lastRowSpanColumns = flattenColumns.filter((column) => getRowSpan(column, end) !== 1);
let endIndex = end;
for (let i = end; i < flattenData.length; i += 1) {
lastRowSpanColumns = lastRowSpanColumns.filter((column) => getRowSpan(column, i) !== 1);
if (!lastRowSpanColumns.length) {
endIndex = Math.max(i - 1, end);
break;
}
}
const spanLines = [];
for (let i = startIndex; i <= endIndex; i += 1) {
if (!flattenData[i]) continue;
if (flattenColumns.some((column) => getRowSpan(column, i) > 1)) spanLines.push(i);
}
return spanLines.map((index) => {
const item = flattenData[index];
const rowKey = getRowKey(item.record, index);
const getHeight = (rowSpan) => {
const endItemIndex = index + rowSpan - 1;
const endItem = flattenData[endItemIndex];
if (!endItem || !endItem.record) {
const safeEndIndex = Math.min(endItemIndex, flattenData.length - 1);
const safeEndItem = flattenData[safeEndIndex];
const sizeInfo = getSize(rowKey, getRowKey(safeEndItem.record, safeEndIndex));
return sizeInfo.bottom - sizeInfo.top;
}
const sizeInfo = getSize(rowKey, getRowKey(endItem.record, endItemIndex));
return sizeInfo.bottom - sizeInfo.top;
};
const sizeInfo = getSize(rowKey);
return /* @__PURE__ */ import_react.createElement(ResponseBodyLine, {
key: index,
data: item,
rowKey,
index,
style: { top: -offsetY + sizeInfo.top },
extra: true,
getHeight
});
});
};
const gridContext = import_react.useMemo(() => ({ columnsOffset }), [columnsOffset]);
const tblPrefixCls = `${prefixCls}-tbody`;
const wrapperComponent = getComponent(["body", "wrapper"]);
const horizontalScrollBarStyle = {};
if (sticky) {
horizontalScrollBarStyle.position = "sticky";
horizontalScrollBarStyle.bottom = 0;
if (typeof sticky === "object" && sticky.offsetScroll) horizontalScrollBarStyle.bottom = sticky.offsetScroll;
}
return /* @__PURE__ */ import_react.createElement(GridContext.Provider, { value: gridContext }, /* @__PURE__ */ import_react.createElement(es_default$21, {
fullHeight: false,
ref: listRef,
prefixCls: `${tblPrefixCls}-virtual`,
styles: { horizontalScrollBar: horizontalScrollBarStyle },
className: tblPrefixCls,
height: scrollY,
itemHeight: listItemHeight || 24,
data: flattenData,
itemKey: (item) => getRowKey(item.record),
component: wrapperComponent,
scrollWidth: scrollX,
direction,
onVirtualScroll: ({ x }) => {
onScroll({
currentTarget: listRef.current?.nativeElement,
scrollLeft: x
});
},
onScroll: onTablePropScroll,
extraRender
}, (item, index, itemProps) => {
const rowKey = getRowKey(item.record, index);
return /* @__PURE__ */ import_react.createElement(ResponseBodyLine, {
data: item,
rowKey,
index,
style: itemProps.style
});
}));
}));
ResponseGrid.displayName = "ResponseGrid";
//#endregion
//#region node_modules/@rc-component/table/es/VirtualTable/index.js
function _extends$11() {
_extends$11 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$11.apply(this, arguments);
}
var renderBody = (rawData, props) => {
const { ref, onScroll } = props;
return /* @__PURE__ */ import_react.createElement(ResponseGrid, {
ref,
data: rawData,
onScroll
});
};
var VirtualTable = (props, ref) => {
const { data, columns, scroll, sticky, prefixCls = DEFAULT_PREFIX, className, listItemHeight, components, onScroll } = props;
let { x: scrollX, y: scrollY } = scroll || {};
if (typeof scrollX !== "number") {
warningOnce(!scrollX, "`scroll.x` in virtual table must be number.");
scrollX = 1;
}
if (typeof scrollY !== "number") {
scrollY = 500;
warningOnce(false, "`scroll.y` in virtual table must be number.");
}
const getComponent = useEvent((path, defaultComponent) => get(components, path) || defaultComponent);
const onInternalScroll = useEvent(onScroll);
const context = import_react.useMemo(() => ({
sticky,
scrollY,
listItemHeight,
getComponent,
onScroll: onInternalScroll
}), [
sticky,
scrollY,
listItemHeight,
getComponent,
onInternalScroll
]);
return /* @__PURE__ */ import_react.createElement(StaticContext.Provider, { value: context }, /* @__PURE__ */ import_react.createElement(ImmutableTable, _extends$11({}, props, {
className: clsx(className, `${prefixCls}-virtual`),
scroll: {
...scroll,
x: scrollX
},
components: {
...components,
body: data?.length ? renderBody : void 0
},
columns,
internalHooks: INTERNAL_HOOKS,
tailor: true,
ref
})));
};
var RefVirtualTable = /* @__PURE__ */ import_react.forwardRef(VirtualTable);
RefVirtualTable.displayName = "VirtualTable";
var genVirtualTable = (shouldTriggerRender) => {
return makeImmutable(RefVirtualTable, shouldTriggerRender);
};
genVirtualTable();
//#endregion
//#region node_modules/antd/es/table/Column.js
/* istanbul ignore next */
/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
var Column = (_) => null;
//#endregion
//#region node_modules/antd/es/table/ColumnGroup.js
/* istanbul ignore next */
/** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
var ColumnGroup = (_) => null;
//#endregion
//#region node_modules/@rc-component/tree/es/contextTypes.js
/**
* Webpack has bug for import loop, which is not the same behavior as ES module.
* When util.js imports the TreeNode for tree generate will cause treeContextTypes be empty.
*/
var TreeContext = /* @__PURE__ */ import_react.createContext(null);
/** Internal usage, safe to remove. Do not use in prod */
var UnstableContext = /* @__PURE__ */ import_react.createContext({});
//#endregion
//#region node_modules/@rc-component/tree/es/Indent.js
var Indent = ({ prefixCls, level, isStart, isEnd }) => {
const baseClassName = `${prefixCls}-indent-unit`;
const list = [];
for (let i = 0; i < level; i += 1) list.push(/* @__PURE__ */ import_react.createElement("span", {
key: i,
className: clsx(baseClassName, {
[`${baseClassName}-start`]: isStart[i],
[`${baseClassName}-end`]: isEnd[i]
})
}));
return /* @__PURE__ */ import_react.createElement("span", {
"aria-hidden": "true",
className: `${prefixCls}-indent`
}, list);
};
var Indent_default = /* @__PURE__ */ import_react.memo(Indent);
//#endregion
//#region node_modules/@rc-component/tree/es/TreeNode.js
function _extends$10() {
_extends$10 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$10.apply(this, arguments);
}
var ICON_OPEN = "open";
var ICON_CLOSE = "close";
var defaultTitle = "---";
var TreeNode$1 = (props) => {
const { eventKey, className, style, dragOver, dragOverGapTop, dragOverGapBottom, isLeaf, isStart, isEnd, expanded, selected, checked, halfChecked, loading, domRef, active, data, onMouseMove, selectable, treeId, ...otherProps } = props;
const nodeId = getId(treeId, eventKey);
const context = import_react.useContext(TreeContext);
const { classNames: treeClassNames, styles } = context || {};
const unstableContext = import_react.useContext(UnstableContext);
const selectHandleRef = import_react.useRef(null);
const [dragNodeHighlight, setDragNodeHighlight] = import_react.useState(false);
const isDisabled = !!(context.disabled || props.disabled || unstableContext.nodeDisabled?.(data));
const isCheckable = import_react.useMemo(() => {
if (!context.checkable || props.checkable === false) return false;
return context.checkable;
}, [context.checkable, props.checkable]);
const onSelect = (e) => {
if (isDisabled) return;
context.onNodeSelect(e, convertNodePropsToEventData(props));
};
const onCheck = (e) => {
if (isDisabled) return;
if (!isCheckable || props.disableCheckbox) return;
context.onNodeCheck(e, convertNodePropsToEventData(props), !checked);
};
const isSelectable = import_react.useMemo(() => {
if (typeof selectable === "boolean") return selectable;
return context.selectable;
}, [selectable, context.selectable]);
const onSelectorClick = (e) => {
context.onNodeClick(e, convertNodePropsToEventData(props));
if (isSelectable) onSelect(e);
else onCheck(e);
};
const onSelectorDoubleClick = (e) => {
context.onNodeDoubleClick(e, convertNodePropsToEventData(props));
};
const onMouseEnter = (e) => {
context.onNodeMouseEnter(e, convertNodePropsToEventData(props));
};
const onMouseLeave = (e) => {
context.onNodeMouseLeave(e, convertNodePropsToEventData(props));
};
const onContextMenu = (e) => {
context.onNodeContextMenu(e, convertNodePropsToEventData(props));
};
const isDraggable = import_react.useMemo(() => {
return !!(context.draggable && (!context.draggable.nodeDraggable || context.draggable.nodeDraggable(data)));
}, [context.draggable, data]);
const onDragStart = (e) => {
e.stopPropagation();
setDragNodeHighlight(true);
context.onNodeDragStart(e, props);
try {
e.dataTransfer.setData("text/plain", "");
} catch {}
};
const onDragEnter = (e) => {
e.preventDefault();
e.stopPropagation();
context.onNodeDragEnter(e, props);
};
const onDragOver = (e) => {
e.preventDefault();
e.stopPropagation();
context.onNodeDragOver(e, props);
};
const onDragLeave = (e) => {
e.stopPropagation();
context.onNodeDragLeave(e, props);
};
const onDragEnd = (e) => {
e.stopPropagation();
setDragNodeHighlight(false);
context.onNodeDragEnd(e, props);
};
const onDrop = (e) => {
e.preventDefault();
e.stopPropagation();
setDragNodeHighlight(false);
context.onNodeDrop(e, props);
};
const onExpand = (e) => {
if (loading) return;
context.onNodeExpand(e, convertNodePropsToEventData(props));
};
const hasChildren = import_react.useMemo(() => {
const { children } = getEntity(context.keyEntities, eventKey) || {};
return Boolean((children || []).length);
}, [context.keyEntities, eventKey]);
const memoizedIsLeaf = import_react.useMemo(() => {
return isLeafNode(isLeaf, context.loadData, hasChildren, props.loaded);
}, [
isLeaf,
context.loadData,
hasChildren,
props.loaded
]);
import_react.useEffect(() => {
if (loading) return;
if (typeof context.loadData === "function" && expanded && !memoizedIsLeaf && !props.loaded) context.onNodeLoad(convertNodePropsToEventData(props));
}, [
loading,
context.loadData,
context.onNodeLoad,
expanded,
memoizedIsLeaf,
props
]);
const dragHandlerNode = import_react.useMemo(() => {
if (!context.draggable?.icon) return null;
return /* @__PURE__ */ import_react.createElement("span", { className: `${context.prefixCls}-draggable-icon` }, context.draggable.icon);
}, [context.draggable]);
const renderSwitcherIconDom = (isInternalLeaf) => {
const switcherIcon = props.switcherIcon || context.switcherIcon;
if (typeof switcherIcon === "function") return switcherIcon({
...props,
isLeaf: isInternalLeaf
});
return switcherIcon;
};
const renderSwitcher = () => {
if (memoizedIsLeaf) {
const switcherIconDom = renderSwitcherIconDom(true);
return switcherIconDom !== false ? /* @__PURE__ */ import_react.createElement("span", { className: clsx(`${context.prefixCls}-switcher`, `${context.prefixCls}-switcher-noop`) }, switcherIconDom) : null;
}
const switcherIconDom = renderSwitcherIconDom(false);
return switcherIconDom !== false ? /* @__PURE__ */ import_react.createElement("span", {
onClick: onExpand,
className: clsx(`${context.prefixCls}-switcher`, `${context.prefixCls}-switcher_${expanded ? ICON_OPEN : ICON_CLOSE}`)
}, switcherIconDom) : null;
};
const checkboxNode = import_react.useMemo(() => {
if (!isCheckable) return null;
const $custom = typeof isCheckable !== "boolean" ? isCheckable : null;
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${context.prefixCls}-checkbox`, {
[`${context.prefixCls}-checkbox-checked`]: checked,
[`${context.prefixCls}-checkbox-indeterminate`]: !checked && halfChecked,
[`${context.prefixCls}-checkbox-disabled`]: isDisabled || props.disableCheckbox
}),
onClick: onCheck,
role: "checkbox",
"aria-checked": halfChecked ? "mixed" : checked,
"aria-disabled": isDisabled || props.disableCheckbox,
"aria-labelledby": nodeId
}, $custom);
}, [
isCheckable,
checked,
halfChecked,
isDisabled,
props.disableCheckbox,
nodeId
]);
const nodeState = import_react.useMemo(() => {
if (memoizedIsLeaf) return null;
return expanded ? ICON_OPEN : ICON_CLOSE;
}, [memoizedIsLeaf, expanded]);
const iconNode = import_react.useMemo(() => {
return /* @__PURE__ */ import_react.createElement("span", {
className: clsx(treeClassNames?.itemIcon, `${context.prefixCls}-iconEle`, `${context.prefixCls}-icon__${nodeState || "docu"}`, { [`${context.prefixCls}-icon_loading`]: loading }),
style: styles?.itemIcon
});
}, [
context.prefixCls,
nodeState,
loading
]);
const dropIndicatorNode = import_react.useMemo(() => {
const rootDraggable = Boolean(context.draggable);
if (!(!props.disabled && rootDraggable && context.dragOverNodeKey === eventKey)) return null;
return context.dropIndicatorRender({
dropPosition: context.dropPosition,
dropLevelOffset: context.dropLevelOffset,
indent: context.indent,
prefixCls: context.prefixCls,
direction: context.direction
});
}, [
context.dropPosition,
context.dropLevelOffset,
context.indent,
context.prefixCls,
context.direction,
context.draggable,
context.dragOverNodeKey,
context.dropIndicatorRender
]);
const selectorNode = import_react.useMemo(() => {
const { title = defaultTitle } = props;
const wrapClass = `${context.prefixCls}-node-content-wrapper`;
let $icon;
if (context.showIcon) {
const currentIcon = props.icon || context.icon;
$icon = currentIcon ? /* @__PURE__ */ import_react.createElement("span", {
className: clsx(treeClassNames?.itemIcon, `${context.prefixCls}-iconEle`, `${context.prefixCls}-icon__customize`),
style: styles?.itemIcon
}, typeof currentIcon === "function" ? currentIcon(props) : currentIcon) : iconNode;
} else if (context.loadData && loading) $icon = iconNode;
let titleNode;
if (typeof title === "function") titleNode = title(data);
else if (context.titleRender) titleNode = context.titleRender(data);
else titleNode = title;
return /* @__PURE__ */ import_react.createElement("span", {
ref: selectHandleRef,
title: typeof title === "string" ? title : "",
className: clsx(wrapClass, `${wrapClass}-${nodeState || "normal"}`, { [`${context.prefixCls}-node-selected`]: !isDisabled && (selected || dragNodeHighlight) }),
onMouseEnter,
onMouseLeave,
onContextMenu,
onClick: onSelectorClick,
onDoubleClick: onSelectorDoubleClick
}, $icon, /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${context.prefixCls}-title`, treeClassNames?.itemTitle),
style: styles?.itemTitle
}, titleNode), dropIndicatorNode);
}, [
context.prefixCls,
context.showIcon,
props,
context.icon,
iconNode,
context.titleRender,
data,
nodeState,
onMouseEnter,
onMouseLeave,
onContextMenu,
onSelectorClick,
onSelectorDoubleClick
]);
const dataOrAriaAttributeProps = pickAttrs(otherProps, {
aria: true,
data: true
});
const { level } = getEntity(context.keyEntities, eventKey) || {};
const isEndNode = isEnd[isEnd.length - 1];
const draggableWithoutDisabled = !isDisabled && isDraggable;
const dragging = context.draggingNodeKey === eventKey;
return /* @__PURE__ */ import_react.createElement("div", _extends$10({
ref: domRef,
role: "treeitem",
id: nodeId,
"aria-expanded": memoizedIsLeaf ? void 0 : expanded,
"aria-selected": isSelectable && !isDisabled ? selected : void 0,
"aria-checked": isCheckable && !isDisabled ? halfChecked ? "mixed" : checked : void 0,
"aria-disabled": isDisabled,
className: clsx(className, `${context.prefixCls}-treenode`, treeClassNames?.item, {
[`${context.prefixCls}-treenode-disabled`]: isDisabled,
[`${context.prefixCls}-treenode-switcher-${expanded ? "open" : "close"}`]: !isLeaf,
[`${context.prefixCls}-treenode-checkbox-checked`]: checked,
[`${context.prefixCls}-treenode-checkbox-indeterminate`]: halfChecked,
[`${context.prefixCls}-treenode-selected`]: selected,
[`${context.prefixCls}-treenode-loading`]: loading,
[`${context.prefixCls}-treenode-active`]: active,
[`${context.prefixCls}-treenode-leaf-last`]: isEndNode,
[`${context.prefixCls}-treenode-draggable`]: isDraggable,
dragging,
"drop-target": context.dropTargetKey === eventKey,
"drop-container": context.dropContainerKey === eventKey,
"drag-over": !isDisabled && dragOver,
"drag-over-gap-top": !isDisabled && dragOverGapTop,
"drag-over-gap-bottom": !isDisabled && dragOverGapBottom,
"filter-node": context.filterTreeNode?.(convertNodePropsToEventData(props)),
[`${context.prefixCls}-treenode-leaf`]: memoizedIsLeaf
}),
style: {
...style,
...styles?.item
},
draggable: draggableWithoutDisabled,
onDragStart: draggableWithoutDisabled ? onDragStart : void 0,
onDragEnter: isDraggable ? onDragEnter : void 0,
onDragOver: isDraggable ? onDragOver : void 0,
onDragLeave: isDraggable ? onDragLeave : void 0,
onDrop: isDraggable ? onDrop : void 0,
onDragEnd: isDraggable ? onDragEnd : void 0,
onMouseMove
}, dataOrAriaAttributeProps), /* @__PURE__ */ import_react.createElement(Indent_default, {
prefixCls: context.prefixCls,
level,
isStart,
isEnd
}), dragHandlerNode, renderSwitcher(), checkboxNode, selectorNode);
};
TreeNode$1.isTreeNode = 1;
TreeNode$1.displayName = "TreeNode";
//#endregion
//#region node_modules/@rc-component/tree/es/util.js
/**
* Legacy code. Should avoid to use if you are new to import these code.
*/
function arrDel(list, value) {
if (!list) return [];
const clone = list.slice();
const index = clone.indexOf(value);
if (index >= 0) clone.splice(index, 1);
return clone;
}
function arrAdd(list, value) {
const clone = (list || []).slice();
if (clone.indexOf(value) === -1) clone.push(value);
return clone;
}
function posToArr(pos) {
return pos.split("-");
}
function getDragChildrenKeys(dragNodeKey, keyEntities) {
const dragChildrenKeys = [];
const entity = getEntity(keyEntities, dragNodeKey);
function dig(list = []) {
list.forEach(({ key, children }) => {
dragChildrenKeys.push(key);
dig(children);
});
}
dig(entity.children);
return dragChildrenKeys;
}
function isLastChild(treeNodeEntity) {
if (treeNodeEntity.parent) {
const posArr = posToArr(treeNodeEntity.pos);
return Number(posArr[posArr.length - 1]) === treeNodeEntity.parent.children.length - 1;
}
return false;
}
function isFirstChild(treeNodeEntity) {
const posArr = posToArr(treeNodeEntity.pos);
return Number(posArr[posArr.length - 1]) === 0;
}
function calcDropPosition(event, dragNodeProps, targetNodeProps, indent, startMousePosition, allowDrop, flattenedNodes, keyEntities, expandKeys, direction) {
const { clientX, clientY } = event;
const { top, height } = event.target.getBoundingClientRect();
const rawDropLevelOffset = ((direction === "rtl" ? -1 : 1) * ((startMousePosition?.x || 0) - clientX) - 12) / indent;
const filteredExpandKeys = expandKeys.filter((key) => keyEntities[key]?.children?.length);
let abstractDropNodeEntity = getEntity(keyEntities, targetNodeProps.eventKey);
if (clientY < top + height / 2) {
const nodeIndex = flattenedNodes.findIndex((flattenedNode) => flattenedNode.key === abstractDropNodeEntity.key);
const prevNodeKey = flattenedNodes[nodeIndex <= 0 ? 0 : nodeIndex - 1].key;
abstractDropNodeEntity = getEntity(keyEntities, prevNodeKey);
}
const initialAbstractDropNodeKey = abstractDropNodeEntity.key;
const abstractDragOverEntity = abstractDropNodeEntity;
const dragOverNodeKey = abstractDropNodeEntity.key;
let dropPosition = 0;
let dropLevelOffset = 0;
if (!filteredExpandKeys.includes(initialAbstractDropNodeKey)) for (let i = 0; i < rawDropLevelOffset; i += 1) if (isLastChild(abstractDropNodeEntity)) {
abstractDropNodeEntity = abstractDropNodeEntity.parent;
dropLevelOffset += 1;
} else break;
const abstractDragDataNode = dragNodeProps.data;
const abstractDropDataNode = abstractDropNodeEntity.node;
let dropAllowed = true;
if (isFirstChild(abstractDropNodeEntity) && abstractDropNodeEntity.level === 0 && clientY < top + height / 2 && allowDrop({
dragNode: abstractDragDataNode,
dropNode: abstractDropDataNode,
dropPosition: -1
}) && abstractDropNodeEntity.key === targetNodeProps.eventKey) dropPosition = -1;
else if ((abstractDragOverEntity.children || []).length && filteredExpandKeys.includes(dragOverNodeKey)) if (allowDrop({
dragNode: abstractDragDataNode,
dropNode: abstractDropDataNode,
dropPosition: 0
})) dropPosition = 0;
else dropAllowed = false;
else if (dropLevelOffset === 0) if (rawDropLevelOffset > -1.5) if (allowDrop({
dragNode: abstractDragDataNode,
dropNode: abstractDropDataNode,
dropPosition: 1
})) dropPosition = 1;
else dropAllowed = false;
else if (allowDrop({
dragNode: abstractDragDataNode,
dropNode: abstractDropDataNode,
dropPosition: 0
})) dropPosition = 0;
else if (allowDrop({
dragNode: abstractDragDataNode,
dropNode: abstractDropDataNode,
dropPosition: 1
})) dropPosition = 1;
else dropAllowed = false;
else if (allowDrop({
dragNode: abstractDragDataNode,
dropNode: abstractDropDataNode,
dropPosition: 1
})) dropPosition = 1;
else dropAllowed = false;
return {
dropPosition,
dropLevelOffset,
dropTargetKey: abstractDropNodeEntity.key,
dropTargetPos: abstractDropNodeEntity.pos,
dragOverNodeKey,
dropContainerKey: dropPosition === 0 ? null : abstractDropNodeEntity.parent?.key || null,
dropAllowed
};
}
/**
* Return selectedKeys according with multiple prop
* @param selectedKeys
* @param props
* @returns [string]
*/
function calcSelectedKeys(selectedKeys, props) {
if (!selectedKeys) return void 0;
const { multiple } = props;
if (multiple) return selectedKeys.slice();
if (selectedKeys.length) return [selectedKeys[0]];
return selectedKeys;
}
/**
* Parse `checkedKeys` to { checkedKeys, halfCheckedKeys } style
*/
function parseCheckedKeys(keys) {
if (!keys) return null;
let keyProps;
if (Array.isArray(keys)) keyProps = {
checkedKeys: keys,
halfCheckedKeys: void 0
};
else if (typeof keys === "object") keyProps = {
checkedKeys: keys.checked || void 0,
halfCheckedKeys: keys.halfChecked || void 0
};
else {
warningOnce(false, "`checkedKeys` is not an array or an object");
return null;
}
return keyProps;
}
/**
* If user use `autoExpandParent` we should get the list of parent node
* @param keyList
* @param keyEntities
*/
function conductExpandParent(keyList, keyEntities) {
const expandedKeys = /* @__PURE__ */ new Set();
function conductUp(key) {
if (expandedKeys.has(key)) return;
const entity = getEntity(keyEntities, key);
if (!entity) return;
expandedKeys.add(key);
const { parent, node } = entity;
if (node.disabled) return;
if (parent) conductUp(parent.key);
}
(keyList || []).forEach((key) => {
conductUp(key);
});
return [...expandedKeys];
}
//#endregion
//#region node_modules/antd/es/table/hooks/useSelection.js
var SELECTION_COLUMN = {};
var SELECTION_ALL = "SELECT_ALL";
var SELECTION_INVERT = "SELECT_INVERT";
var SELECTION_NONE = "SELECT_NONE";
var EMPTY_LIST$1 = [];
var flattenData = (childrenColumnName, data, list = []) => {
(data || []).forEach((record) => {
list.push(record);
if (isPlainObject(record) && childrenColumnName in record) flattenData(childrenColumnName, record[childrenColumnName], list);
});
return list;
};
var useSelection$1 = (config, rowSelection) => {
const { preserveSelectedRowKeys, selectedRowKeys, defaultSelectedRowKeys, getCheckboxProps, getTitleCheckboxProps, onChange: onSelectionChange, onSelect, onSelectAll, onSelectInvert, onSelectNone, onSelectMultiple, columnWidth: selectionColWidth, type: selectionType, selections, fixed, renderCell: customizeRenderCell, hideSelectAll, checkStrictly = true } = rowSelection || {};
const { prefixCls, data, pageData, getRecordByKey, getRowKey, expandType, childrenColumnName, locale: tableLocale, getPopupContainer } = config;
const warning = devUseWarning("Table");
const [multipleSelect, updatePrevSelectedIndex] = useMultipleSelect((item) => item);
const [mergedSelectedKeys, setMergedSelectedKeys] = useControlledState(defaultSelectedRowKeys || EMPTY_LIST$1, selectedRowKeys);
const mergedSelectedKeyList = mergedSelectedKeys ?? EMPTY_LIST$1;
const preserveRecordsRef = import_react.useRef(/* @__PURE__ */ new Map());
const updatePreserveRecordsCache = (0, import_react.useCallback)((keys) => {
if (preserveSelectedRowKeys) {
const newCache = /* @__PURE__ */ new Map();
keys.forEach((key) => {
let record = getRecordByKey(key);
if (!record && preserveRecordsRef.current.has(key)) record = preserveRecordsRef.current.get(key);
newCache.set(key, record);
});
preserveRecordsRef.current = newCache;
}
}, [getRecordByKey, preserveSelectedRowKeys]);
import_react.useEffect(() => {
updatePreserveRecordsCache(mergedSelectedKeyList);
}, [mergedSelectedKeyList, updatePreserveRecordsCache]);
const flattedData = (0, import_react.useMemo)(() => flattenData(childrenColumnName, pageData), [childrenColumnName, pageData]);
const { keyEntities } = (0, import_react.useMemo)(() => {
if (checkStrictly) return { keyEntities: null };
let convertData = data;
if (preserveSelectedRowKeys) {
const keysSet = new Set(flattedData.map(getRowKey));
const preserveRecords = Array.from(preserveRecordsRef.current).reduce((total, [key, value]) => keysSet.has(key) ? total : total.concat(value), []);
convertData = [].concat(_toConsumableArray$8(convertData), _toConsumableArray$8(preserveRecords));
}
return convertDataToEntities(convertData, {
externalGetKey: getRowKey,
childrenPropName: childrenColumnName
});
}, [
data,
getRowKey,
checkStrictly,
childrenColumnName,
preserveSelectedRowKeys,
flattedData
]);
const checkboxPropsMap = (0, import_react.useMemo)(() => {
const map = /* @__PURE__ */ new Map();
flattedData.forEach((record, index) => {
const key = getRowKey(record, index);
const checkboxProps = (getCheckboxProps ? getCheckboxProps(record) : null) || {};
map.set(key, checkboxProps);
warning(!("checked" in checkboxProps || "defaultChecked" in checkboxProps), "usage", "Do not set `checked` or `defaultChecked` in `getCheckboxProps`. Please use `selectedRowKeys` instead.");
});
return map;
}, [
flattedData,
getRowKey,
getCheckboxProps
]);
const isCheckboxDisabled = (0, import_react.useCallback)((r) => {
const rowKey = getRowKey(r);
let checkboxProps;
if (checkboxPropsMap.has(rowKey)) checkboxProps = checkboxPropsMap.get(getRowKey(r));
else checkboxProps = getCheckboxProps ? getCheckboxProps(r) : void 0;
return !!checkboxProps?.disabled;
}, [checkboxPropsMap, getRowKey]);
const [derivedSelectedKeys, derivedHalfSelectedKeys] = (0, import_react.useMemo)(() => {
if (checkStrictly) return [mergedSelectedKeyList, []];
const { checkedKeys, halfCheckedKeys } = conductCheck(mergedSelectedKeyList, true, keyEntities, isCheckboxDisabled);
return [checkedKeys || [], halfCheckedKeys];
}, [
mergedSelectedKeyList,
checkStrictly,
keyEntities,
isCheckboxDisabled
]);
const derivedSelectedKeySet = (0, import_react.useMemo)(() => {
const keys = selectionType === "radio" ? derivedSelectedKeys.slice(0, 1) : derivedSelectedKeys;
return new Set(keys);
}, [derivedSelectedKeys, selectionType]);
const derivedHalfSelectedKeySet = (0, import_react.useMemo)(() => selectionType === "radio" ? /* @__PURE__ */ new Set() : new Set(derivedHalfSelectedKeys), [derivedHalfSelectedKeys, selectionType]);
import_react.useEffect(() => {
if (!rowSelection) setMergedSelectedKeys(EMPTY_LIST$1);
}, [!!rowSelection]);
const setSelectedKeys = (0, import_react.useCallback)((keys, method) => {
let availableKeys;
let records;
updatePreserveRecordsCache(keys);
if (preserveSelectedRowKeys) {
availableKeys = keys;
records = keys.map((key) => preserveRecordsRef.current.get(key));
} else {
availableKeys = [];
records = [];
keys.forEach((key) => {
const record = getRecordByKey(key);
if (record !== void 0) {
availableKeys.push(key);
records.push(record);
}
});
}
setMergedSelectedKeys(availableKeys);
onSelectionChange?.(availableKeys, records, { type: method });
}, [
setMergedSelectedKeys,
getRecordByKey,
onSelectionChange,
preserveSelectedRowKeys
]);
const triggerSingleSelection = (0, import_react.useCallback)((key, selected, keys, event) => {
if (onSelect) {
const rows = keys.map(getRecordByKey);
onSelect(getRecordByKey(key), selected, rows, event);
}
setSelectedKeys(keys, "single");
}, [
onSelect,
getRecordByKey,
setSelectedKeys
]);
const mergedSelections = (0, import_react.useMemo)(() => {
if (!selections || hideSelectAll) return null;
return (selections === true ? [
SELECTION_ALL,
SELECTION_INVERT,
SELECTION_NONE
] : selections).map((selection) => {
if (selection === "SELECT_ALL") return {
key: "all",
text: tableLocale.selectionAll,
onSelect() {
setSelectedKeys(data.map((record, index) => getRowKey(record, index)).filter((key) => {
return !checkboxPropsMap.get(key)?.disabled || derivedSelectedKeySet.has(key);
}), "all");
}
};
if (selection === "SELECT_INVERT") return {
key: "invert",
text: tableLocale.selectInvert,
onSelect() {
const keySet = new Set(derivedSelectedKeySet);
pageData.forEach((record, index) => {
const key = getRowKey(record, index);
if (!checkboxPropsMap.get(key)?.disabled) if (keySet.has(key)) keySet.delete(key);
else keySet.add(key);
});
const keys = Array.from(keySet);
if (onSelectInvert) {
warning.deprecated(false, "onSelectInvert", "onChange");
onSelectInvert(keys);
}
setSelectedKeys(keys, "invert");
}
};
if (selection === "SELECT_NONE") return {
key: "none",
text: tableLocale.selectNone,
onSelect() {
onSelectNone?.();
setSelectedKeys(Array.from(derivedSelectedKeySet).filter((key) => {
return checkboxPropsMap.get(key)?.disabled;
}), "none");
}
};
return selection;
}).map((selection) => ({
...selection,
onSelect: (...rest) => {
selection.onSelect?.(...rest);
updatePrevSelectedIndex(null);
}
}));
}, [
selections,
hideSelectAll,
tableLocale.selectionAll,
tableLocale.selectInvert,
tableLocale.selectNone,
checkboxPropsMap,
derivedSelectedKeySet,
data,
pageData,
getRowKey,
onSelectInvert,
setSelectedKeys
]);
return [(0, import_react.useCallback)((columns) => {
if (!rowSelection) {
warning(!columns.includes(SELECTION_COLUMN), "usage", "`rowSelection` is not config but `SELECTION_COLUMN` exists in the `columns`.");
return columns.filter((col) => col !== SELECTION_COLUMN);
}
let cloneColumns = _toConsumableArray$8(columns);
const keySet = new Set(derivedSelectedKeySet);
const recordKeys = flattedData.map(getRowKey).filter((key) => !checkboxPropsMap.get(key).disabled);
const checkedCurrentAll = recordKeys.every((key) => keySet.has(key));
const checkedCurrentSome = recordKeys.some((key) => keySet.has(key));
const onSelectAllChange = () => {
const changeKeys = [];
if (checkedCurrentAll) recordKeys.forEach((key) => {
keySet.delete(key);
changeKeys.push(key);
});
else recordKeys.forEach((key) => {
if (!keySet.has(key)) {
keySet.add(key);
changeKeys.push(key);
}
});
const keys = Array.from(keySet);
onSelectAll?.(!checkedCurrentAll, keys.map(getRecordByKey), changeKeys.map(getRecordByKey));
setSelectedKeys(keys, "all");
updatePrevSelectedIndex(null);
};
let title;
let columnTitleCheckbox;
if (selectionType !== "radio") {
let customizeSelections;
if (mergedSelections) {
const menu = {
getPopupContainer,
items: mergedSelections.map((selection, index) => {
const { key, text, onSelect: onSelectionClick } = selection;
return {
key: key ?? index,
onClick: () => {
onSelectionClick?.(recordKeys);
},
label: text
};
})
};
customizeSelections = /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-selection-extra` }, /* @__PURE__ */ import_react.createElement(Dropdown, {
menu,
getPopupContainer
}, /* @__PURE__ */ import_react.createElement("span", null, /* @__PURE__ */ import_react.createElement(RefIcon$8, null))));
}
const allDisabledData = flattedData.map((record, index) => {
const key = getRowKey(record, index);
const checkboxProps = checkboxPropsMap.get(key) || {};
return {
checked: keySet.has(key),
...checkboxProps
};
}).filter(({ disabled }) => disabled);
const allDisabled = !!allDisabledData.length && allDisabledData.length === flattedData.length;
const allDisabledAndChecked = allDisabled && allDisabledData.every(({ checked }) => checked);
const allDisabledSomeChecked = allDisabled && allDisabledData.some(({ checked }) => checked);
const customCheckboxProps = getTitleCheckboxProps?.() || {};
const { onChange, disabled } = customCheckboxProps;
columnTitleCheckbox = /* @__PURE__ */ import_react.createElement(Checkbox, {
"aria-label": customizeSelections ? "Custom selection" : "Select all",
...customCheckboxProps,
checked: !allDisabled ? !!flattedData.length && checkedCurrentAll : allDisabledAndChecked,
indeterminate: !allDisabled ? !checkedCurrentAll && checkedCurrentSome : !allDisabledAndChecked && allDisabledSomeChecked,
onChange: (e) => {
onSelectAllChange();
onChange?.(e);
},
disabled: disabled ?? (flattedData.length === 0 || allDisabled),
skipGroup: true
});
title = !hideSelectAll && /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-selection` }, columnTitleCheckbox, customizeSelections);
}
let renderCell;
if (selectionType === "radio") renderCell = (_, record, index) => {
const key = getRowKey(record, index);
const checked = keySet.has(key);
const checkboxProps = checkboxPropsMap.get(key);
return {
node: /* @__PURE__ */ import_react.createElement(Radio, {
...checkboxProps,
checked,
onClick: (e) => {
e.stopPropagation();
checkboxProps?.onClick?.(e);
},
onChange: (event) => {
if (!keySet.has(key)) triggerSingleSelection(key, true, [key], event.nativeEvent);
checkboxProps?.onChange?.(event);
}
}),
checked
};
};
else renderCell = (_, record, index) => {
const key = getRowKey(record, index);
const checked = keySet.has(key);
const indeterminate = derivedHalfSelectedKeySet.has(key);
const checkboxProps = checkboxPropsMap.get(key);
let mergedIndeterminate;
if (expandType === "nest") {
mergedIndeterminate = indeterminate;
warning(typeof checkboxProps?.indeterminate !== "boolean", "usage", "set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.");
} else mergedIndeterminate = checkboxProps?.indeterminate ?? indeterminate;
return {
node: /* @__PURE__ */ import_react.createElement(Checkbox, {
...checkboxProps,
indeterminate: mergedIndeterminate,
checked,
skipGroup: true,
onClick: (e) => {
e.stopPropagation();
checkboxProps?.onClick?.(e);
},
onChange: (event) => {
const { nativeEvent } = event;
const { shiftKey } = nativeEvent;
const currentSelectedIndex = recordKeys.indexOf(key);
const isMultiple = derivedSelectedKeys.some((item) => recordKeys.includes(item));
if (shiftKey && checkStrictly && isMultiple) {
const changedKeys = multipleSelect(currentSelectedIndex, recordKeys, keySet);
const keys = Array.from(keySet);
onSelectMultiple?.(!checked, keys.map(getRecordByKey), changedKeys.map(getRecordByKey));
setSelectedKeys(keys, "multiple");
} else {
const originCheckedKeys = derivedSelectedKeys;
if (checkStrictly) {
const checkedKeys = checked ? arrDel(originCheckedKeys, key) : arrAdd(originCheckedKeys, key);
triggerSingleSelection(key, !checked, checkedKeys, nativeEvent);
} else {
const { checkedKeys, halfCheckedKeys } = conductCheck([].concat(_toConsumableArray$8(originCheckedKeys), [key]), true, keyEntities, isCheckboxDisabled);
let nextCheckedKeys = checkedKeys;
if (checked) {
const tempKeySet = new Set(checkedKeys);
tempKeySet.delete(key);
nextCheckedKeys = conductCheck(Array.from(tempKeySet), {
checked: false,
halfCheckedKeys
}, keyEntities, isCheckboxDisabled).checkedKeys;
}
triggerSingleSelection(key, !checked, nextCheckedKeys, nativeEvent);
}
}
if (checked) updatePrevSelectedIndex(null);
else updatePrevSelectedIndex(currentSelectedIndex);
checkboxProps?.onChange?.(event);
}
}),
checked
};
};
const renderSelectionCell = (_, record, index) => {
const { node, checked } = renderCell(_, record, index);
if (customizeRenderCell) return customizeRenderCell(checked, record, index, node);
return node;
};
if (!cloneColumns.includes(SELECTION_COLUMN)) if (cloneColumns.findIndex((col) => col["RC_TABLE_INTERNAL_COL_DEFINE"]?.columnType === "EXPAND_COLUMN") === 0) {
const [expandColumn, ...restColumns] = cloneColumns;
cloneColumns = [expandColumn, SELECTION_COLUMN].concat(_toConsumableArray$8(restColumns));
} else cloneColumns = [SELECTION_COLUMN].concat(_toConsumableArray$8(cloneColumns));
const selectionColumnIndex = cloneColumns.indexOf(SELECTION_COLUMN);
warning(cloneColumns.filter((col) => col === SELECTION_COLUMN).length <= 1, "usage", "Multiple `SELECTION_COLUMN` exist in `columns`.");
cloneColumns = cloneColumns.filter((column, index) => column !== SELECTION_COLUMN || index === selectionColumnIndex);
const prevCol = cloneColumns[selectionColumnIndex - 1];
const nextCol = cloneColumns[selectionColumnIndex + 1];
let mergedFixed = fixed;
if (mergedFixed === void 0) {
if (nextCol?.fixed !== void 0) mergedFixed = nextCol.fixed;
else if (prevCol?.fixed !== void 0) mergedFixed = prevCol.fixed;
}
if (mergedFixed && prevCol && prevCol["RC_TABLE_INTERNAL_COL_DEFINE"]?.columnType === "EXPAND_COLUMN" && prevCol.fixed === void 0) prevCol.fixed = mergedFixed;
const columnCls = clsx(`${prefixCls}-selection-col`, { [`${prefixCls}-selection-col-with-dropdown`]: selections && selectionType === "checkbox" });
const renderColumnTitle = () => {
if (!rowSelection?.columnTitle) return title;
if (typeof rowSelection.columnTitle === "function") return rowSelection.columnTitle(columnTitleCheckbox);
return rowSelection.columnTitle;
};
const selectionColumn = {
fixed: mergedFixed,
width: selectionColWidth,
className: `${prefixCls}-selection-column`,
title: renderColumnTitle(),
render: renderSelectionCell,
onCell: rowSelection.onCell,
align: rowSelection.align,
[INTERNAL_COL_DEFINE]: { className: columnCls }
};
return cloneColumns.map((col) => col === SELECTION_COLUMN ? selectionColumn : col);
}, [
getRowKey,
flattedData,
rowSelection,
derivedSelectedKeys,
derivedSelectedKeySet,
derivedHalfSelectedKeySet,
selectionColWidth,
mergedSelections,
expandType,
checkboxPropsMap,
onSelectMultiple,
triggerSingleSelection,
isCheckboxDisabled
]), derivedSelectedKeySet];
};
//#endregion
//#region node_modules/antd/es/table/ExpandIcon.js
function renderExpandIcon(locale) {
return (props) => {
const { prefixCls, onExpand, record, expanded, expandable } = props;
const iconPrefix = `${prefixCls}-row-expand-icon`;
return /* @__PURE__ */ import_react.createElement("button", {
type: "button",
onClick: (e) => {
onExpand(record, e);
e.stopPropagation();
},
className: clsx(iconPrefix, {
[`${iconPrefix}-spaced`]: !expandable,
[`${iconPrefix}-expanded`]: expandable && expanded,
[`${iconPrefix}-collapsed`]: expandable && !expanded
}),
"aria-label": expanded ? locale.collapse : locale.expand,
"aria-expanded": expanded
});
};
}
//#endregion
//#region node_modules/antd/es/table/hooks/useContainerWidth.js
function useContainerWidth(prefixCls) {
const getContainerWidth = (ele, width) => {
const container = ele.querySelector(`.${prefixCls}-container`);
let returnWidth = width;
if (container) {
const style = getComputedStyle(container);
const borderLeft = Number.parseInt(style.borderLeftWidth, 10);
const borderRight = Number.parseInt(style.borderRightWidth, 10);
returnWidth = width - borderLeft - borderRight;
}
return returnWidth;
};
return getContainerWidth;
}
//#endregion
//#region node_modules/antd/es/table/util.js
var getColumnKey = (column, defaultKey) => {
if ("key" in column && isNonNullable(column.key)) return column.key;
if (column.dataIndex) return Array.isArray(column.dataIndex) ? column.dataIndex.join(".") : column.dataIndex;
return defaultKey;
};
function getColumnPos(index, pos) {
return pos ? `${pos}-${index}` : `${index}`;
}
var renderColumnTitle = (title, props) => {
if (typeof title === "function") return title(props);
return title;
};
/**
* Safe get column title
*
* Should filter [object Object]
*
* @param title
*/
var safeColumnTitle = (title, props) => {
const res = renderColumnTitle(title, props);
if (Object.prototype.toString.call(res) === "[object Object]") return "";
return res;
};
//#endregion
//#region node_modules/@rc-component/tree/es/DropIndicator.js
var DropIndicator = (props) => {
const { dropPosition, dropLevelOffset, indent } = props;
const style = {
pointerEvents: "none",
position: "absolute",
right: 0,
backgroundColor: "red",
height: 2
};
switch (dropPosition) {
case -1:
style.top = 0;
style.left = -dropLevelOffset * indent;
break;
case 1:
style.bottom = 0;
style.left = -dropLevelOffset * indent;
break;
case 0:
style.bottom = 0;
style.left = indent;
break;
}
return /* @__PURE__ */ import_react.createElement("div", { style });
};
DropIndicator.displayName = "DropIndicator";
//#endregion
//#region node_modules/@rc-component/tree/es/useUnmount.js
/**
* Trigger only when component unmount
*/
function useUnmount(triggerStart, triggerEnd) {
const [firstMount, setFirstMount] = import_react.useState(false);
useLayoutEffect$1(() => {
if (firstMount) {
triggerStart();
return () => {
triggerEnd();
};
}
}, [firstMount]);
useLayoutEffect$1(() => {
setFirstMount(true);
return () => {
setFirstMount(false);
};
}, []);
}
//#endregion
//#region node_modules/@rc-component/tree/es/MotionTreeNode.js
function _extends$9() {
_extends$9 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$9.apply(this, arguments);
}
var MotionTreeNode = /* @__PURE__ */ import_react.forwardRef((oriProps, ref) => {
const { className, style, motion, motionNodes, motionType, onMotionStart: onOriginMotionStart, onMotionEnd: onOriginMotionEnd, active, treeNodeRequiredProps, ...props } = oriProps;
const [visible, setVisible] = import_react.useState(true);
const { prefixCls } = import_react.useContext(TreeContext);
const targetVisible = motionNodes && motionType !== "hide";
useLayoutEffect$1(() => {
if (motionNodes) {
if (targetVisible !== visible) setVisible(targetVisible);
}
}, [motionNodes]);
const triggerMotionStart = () => {
if (motionNodes) onOriginMotionStart();
};
const triggerMotionEndRef = import_react.useRef(false);
const triggerMotionEnd = () => {
if (motionNodes && !triggerMotionEndRef.current) {
triggerMotionEndRef.current = true;
onOriginMotionEnd();
}
};
useUnmount(triggerMotionStart, triggerMotionEnd);
const onVisibleChanged = (nextVisible) => {
if (targetVisible === nextVisible) triggerMotionEnd();
};
if (motionNodes) return /* @__PURE__ */ import_react.createElement(es_default$28, _extends$9({
ref,
visible
}, motion, {
motionAppear: motionType === "show",
onVisibleChanged
}), ({ className: motionClassName, style: motionStyle }, motionRef) => /* @__PURE__ */ import_react.createElement("div", {
ref: motionRef,
className: clsx(`${prefixCls}-treenode-motion`, motionClassName),
style: motionStyle
}, motionNodes.map((treeNode) => {
const { data: { ...restProps }, title, key, isStart, isEnd } = treeNode;
delete restProps.children;
const treeNodeProps = getTreeNodeProps(key, treeNodeRequiredProps);
return /* @__PURE__ */ import_react.createElement(TreeNode$1, _extends$9({}, restProps, treeNodeProps, {
title,
active,
data: treeNode.data,
key,
isStart,
isEnd
}));
})));
return /* @__PURE__ */ import_react.createElement(TreeNode$1, _extends$9({
domRef: ref,
className,
style
}, props, { active }));
});
MotionTreeNode.displayName = "MotionTreeNode";
//#endregion
//#region node_modules/@rc-component/tree/es/utils/diffUtil.js
function findExpandedKeys(prev = [], next = []) {
const prevLen = prev.length;
const nextLen = next.length;
if (Math.abs(prevLen - nextLen) !== 1) return {
add: false,
key: null
};
function find(shorter, longer) {
const cache = /* @__PURE__ */ new Map();
shorter.forEach((key) => {
cache.set(key, true);
});
const keys = longer.filter((key) => !cache.has(key));
return keys.length === 1 ? keys[0] : null;
}
if (prevLen < nextLen) return {
add: true,
key: find(prev, next)
};
return {
add: false,
key: find(next, prev)
};
}
function getExpandRange(shorter, longer, key) {
const shorterEndNode = shorter[shorter.findIndex((data) => data.key === key) + 1];
const longerStartIndex = longer.findIndex((data) => data.key === key);
if (shorterEndNode) {
const longerEndIndex = longer.findIndex((data) => data.key === shorterEndNode.key);
return longer.slice(longerStartIndex + 1, longerEndIndex);
}
return longer.slice(longerStartIndex + 1);
}
//#endregion
//#region node_modules/@rc-component/tree/es/NodeList.js
/**
* Handle virtual list of the TreeNodes.
*/
function _extends$8() {
_extends$8 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$8.apply(this, arguments);
}
var MOTION_KEY = `RC_TREE_MOTION_${Math.random()}`;
var MotionNode = { key: MOTION_KEY };
var MotionEntity = {
key: MOTION_KEY,
level: 0,
index: 0,
pos: "0",
node: MotionNode,
nodes: [MotionNode]
};
var MotionFlattenData = {
parent: null,
children: [],
pos: MotionEntity.pos,
data: MotionNode,
title: null,
key: MOTION_KEY,
/** Hold empty list here since we do not use it */
isStart: [],
isEnd: []
};
/**
* We only need get visible content items to play the animation.
*/
function getMinimumRangeTransitionRange(list, virtual, height, itemHeight) {
if (virtual === false || !height) return list;
return list.slice(0, Math.ceil(height / itemHeight) + 1);
}
function itemKey(item) {
const { key, pos } = item;
return getKey(key, pos);
}
var NodeList = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls, data, selectable, checkable, expandedKeys, selectedKeys, checkedKeys, loadedKeys, loadingKeys, halfCheckedKeys, keyEntities, disabled, dragging, dragOverNodeKey, dropPosition, motion, height, itemHeight, virtual, scrollWidth, focusable, activeItem, tabIndex, onKeyDown, onFocus, onBlur, onMouseDown, onMouseUp, onActiveChange, onListChangeStart, onListChangeEnd, ...domProps } = props;
const treeId = useId_default();
const listRef = import_react.useRef(null);
const indentMeasurerRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({
scrollTo: (scroll) => {
listRef.current.scrollTo(scroll);
},
getIndentWidth: () => indentMeasurerRef.current.offsetWidth
}));
const [prevExpandedKeys, setPrevExpandedKeys] = import_react.useState(expandedKeys);
const [prevData, setPrevData] = import_react.useState(data);
const [transitionData, setTransitionData] = import_react.useState(data);
const [transitionRange, setTransitionRange] = import_react.useState([]);
const [motionType, setMotionType] = import_react.useState(null);
const dataRef = import_react.useRef(data);
dataRef.current = data;
function onMotionEnd() {
const latestData = dataRef.current;
setPrevData(latestData);
setTransitionData(latestData);
setTransitionRange([]);
setMotionType(null);
onListChangeEnd();
}
useLayoutEffect$1(() => {
setPrevExpandedKeys(expandedKeys);
const diffExpanded = findExpandedKeys(prevExpandedKeys, expandedKeys);
if (diffExpanded.key !== null) if (diffExpanded.add) {
const keyIndex = prevData.findIndex(({ key }) => key === diffExpanded.key);
const rangeNodes = getMinimumRangeTransitionRange(getExpandRange(prevData, data, diffExpanded.key), virtual, height, itemHeight);
const newTransitionData = prevData.slice();
newTransitionData.splice(keyIndex + 1, 0, MotionFlattenData);
setTransitionData(newTransitionData);
setTransitionRange(rangeNodes);
setMotionType("show");
} else {
const keyIndex = data.findIndex(({ key }) => key === diffExpanded.key);
const rangeNodes = getMinimumRangeTransitionRange(getExpandRange(data, prevData, diffExpanded.key), virtual, height, itemHeight);
const newTransitionData = data.slice();
newTransitionData.splice(keyIndex + 1, 0, MotionFlattenData);
setTransitionData(newTransitionData);
setTransitionRange(rangeNodes);
setMotionType("hide");
}
else if (prevData !== data) {
setPrevData(data);
setTransitionData(data);
}
}, [expandedKeys, data]);
import_react.useEffect(() => {
if (!dragging) onMotionEnd();
}, [dragging]);
const mergedData = motion ? transitionData : data;
const treeNodeRequiredProps = {
expandedKeys,
selectedKeys,
loadedKeys,
loadingKeys,
checkedKeys,
halfCheckedKeys,
dragOverNodeKey,
dropPosition,
keyEntities
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("div", {
className: `${prefixCls}-treenode`,
"aria-hidden": true,
style: {
position: "absolute",
pointerEvents: "none",
visibility: "hidden",
height: 0,
overflow: "hidden",
border: 0,
padding: 0
}
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-indent` }, /* @__PURE__ */ import_react.createElement("div", {
ref: indentMeasurerRef,
className: `${prefixCls}-indent-unit`
}))), /* @__PURE__ */ import_react.createElement(es_default$21, _extends$8({}, domProps, {
data: mergedData,
itemKey,
height,
fullHeight: false,
virtual,
itemHeight,
scrollWidth,
prefixCls: `${prefixCls}-list`,
ref: listRef,
role: "tree",
tabIndex: focusable !== false && !disabled ? tabIndex : void 0,
"aria-activedescendant": activeItem ? getId(treeId, activeItem.key) : void 0,
onKeyDown,
onFocus,
onBlur,
onMouseDown,
onMouseUp,
onVisibleChange: (originList) => {
if (originList.every((item) => itemKey(item) !== MOTION_KEY)) onMotionEnd();
}
}), (treeNode) => {
const { pos, data: { ...restProps }, title, key, isStart, isEnd } = treeNode;
const mergedKey = getKey(key, pos);
delete restProps.key;
delete restProps.children;
const treeNodeProps = getTreeNodeProps(mergedKey, treeNodeRequiredProps);
return /* @__PURE__ */ import_react.createElement(MotionTreeNode, _extends$8({}, restProps, treeNodeProps, {
title,
active: !!activeItem && key === activeItem.key,
pos,
data: treeNode.data,
isStart,
isEnd,
motion,
motionNodes: key === MOTION_KEY ? transitionRange : null,
motionType,
onMotionStart: onListChangeStart,
onMotionEnd,
treeNodeRequiredProps,
treeId,
onMouseMove: () => {
onActiveChange(null);
}
}));
}));
});
NodeList.displayName = "NodeList";
//#endregion
//#region node_modules/@rc-component/tree/es/Tree.js
function _extends$7() {
_extends$7 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$7.apply(this, arguments);
}
var MAX_RETRY_TIMES = 10;
var Tree$2 = class extends import_react.Component {
static defaultProps = {
prefixCls: "rc-tree",
showLine: false,
showIcon: true,
selectable: true,
multiple: false,
checkable: false,
disabled: false,
checkStrictly: false,
draggable: false,
defaultExpandParent: true,
autoExpandParent: false,
defaultExpandAll: false,
defaultExpandedKeys: [],
defaultCheckedKeys: [],
defaultSelectedKeys: [],
dropIndicatorRender: DropIndicator,
allowDrop: () => true,
expandAction: false
};
static TreeNode = TreeNode$1;
destroyed = false;
delayedDragEnterLogic;
loadingRetryTimes = {};
state = {
keyEntities: {},
indent: null,
selectedKeys: [],
checkedKeys: [],
halfCheckedKeys: [],
loadedKeys: [],
loadingKeys: [],
expandedKeys: [],
draggingNodeKey: null,
dragChildrenKeys: [],
dropTargetKey: null,
dropPosition: null,
dropContainerKey: null,
dropLevelOffset: null,
dropTargetPos: null,
dropAllowed: true,
dragOverNodeKey: null,
treeData: [],
flattenNodes: [],
activeKey: null,
listChanging: false,
prevProps: null,
fieldNames: fillFieldNames$1()
};
dragStartMousePosition = null;
dragNodeProps = null;
currentMouseOverDroppableNodeKey = null;
focusedByMouse = false;
listRef = /* @__PURE__ */ import_react.createRef();
componentDidMount() {
this.destroyed = false;
this.onUpdated();
}
componentDidUpdate() {
this.onUpdated();
}
onUpdated() {
const { activeKey, itemScrollOffset = 0 } = this.props;
if (activeKey !== void 0 && activeKey !== this.state.activeKey) {
this.setState({ activeKey });
if (activeKey !== null) this.scrollTo({
key: activeKey,
offset: itemScrollOffset
});
}
}
componentWillUnmount() {
window.removeEventListener("dragend", this.onWindowDragEnd);
this.destroyed = true;
}
static getDerivedStateFromProps(props, prevState) {
const { prevProps } = prevState;
const newState = { prevProps: props };
function needSync(name) {
return !prevProps && props.hasOwnProperty(name) || prevProps && prevProps[name] !== props[name];
}
let treeData;
let { fieldNames } = prevState;
if (needSync("fieldNames")) {
fieldNames = fillFieldNames$1(props.fieldNames);
newState.fieldNames = fieldNames;
}
if (needSync("treeData")) ({treeData} = props);
else if (needSync("children")) {
warningOnce(false, "`children` of Tree is deprecated. Please use `treeData` instead.");
treeData = convertTreeToData(props.children);
}
if (treeData) {
newState.treeData = treeData;
const entitiesMap = convertDataToEntities(treeData, { fieldNames });
newState.keyEntities = {
[MOTION_KEY]: MotionEntity,
...entitiesMap.keyEntities
};
warningWithoutKey(treeData, fieldNames);
}
const keyEntities = newState.keyEntities || prevState.keyEntities;
if (needSync("expandedKeys") || prevProps && needSync("autoExpandParent")) newState.expandedKeys = props.autoExpandParent || !prevProps && props.defaultExpandParent ? conductExpandParent(props.expandedKeys, keyEntities) : props.expandedKeys;
else if (!prevProps && props.defaultExpandAll) {
const cloneKeyEntities = { ...keyEntities };
delete cloneKeyEntities[MOTION_KEY];
const nextExpandedKeys = [];
Object.keys(cloneKeyEntities).forEach((key) => {
const entity = cloneKeyEntities[key];
if (entity.children && entity.children.length) nextExpandedKeys.push(entity.key);
});
newState.expandedKeys = nextExpandedKeys;
} else if (!prevProps && props.defaultExpandedKeys) newState.expandedKeys = props.autoExpandParent || props.defaultExpandParent ? conductExpandParent(props.defaultExpandedKeys, keyEntities) : props.defaultExpandedKeys;
if (!newState.expandedKeys) delete newState.expandedKeys;
if (treeData || newState.expandedKeys) newState.flattenNodes = flattenTreeData(treeData || prevState.treeData, newState.expandedKeys || prevState.expandedKeys, fieldNames);
if (props.selectable) {
if (needSync("selectedKeys")) newState.selectedKeys = calcSelectedKeys(props.selectedKeys, props);
else if (!prevProps && props.defaultSelectedKeys) newState.selectedKeys = calcSelectedKeys(props.defaultSelectedKeys, props);
}
if (props.checkable) {
let checkedKeyEntity;
if (needSync("checkedKeys")) checkedKeyEntity = parseCheckedKeys(props.checkedKeys) || {};
else if (!prevProps && props.defaultCheckedKeys) checkedKeyEntity = parseCheckedKeys(props.defaultCheckedKeys) || {};
else if (treeData) checkedKeyEntity = parseCheckedKeys(props.checkedKeys) || {
checkedKeys: prevState.checkedKeys,
halfCheckedKeys: prevState.halfCheckedKeys
};
if (checkedKeyEntity) {
let { checkedKeys = [], halfCheckedKeys = [] } = checkedKeyEntity;
if (!props.checkStrictly) {
const conductKeys = conductCheck(checkedKeys, true, keyEntities);
({checkedKeys, halfCheckedKeys} = conductKeys);
}
newState.checkedKeys = checkedKeys;
newState.halfCheckedKeys = halfCheckedKeys;
}
}
if (needSync("loadedKeys")) newState.loadedKeys = props.loadedKeys;
return newState;
}
onNodeDragStart = (event, nodeProps) => {
const { expandedKeys, keyEntities } = this.state;
const { onDragStart } = this.props;
const { eventKey } = nodeProps;
this.dragNodeProps = nodeProps;
this.dragStartMousePosition = {
x: event.clientX,
y: event.clientY
};
const newExpandedKeys = arrDel(expandedKeys, eventKey);
this.setState({
draggingNodeKey: eventKey,
dragChildrenKeys: getDragChildrenKeys(eventKey, keyEntities),
indent: this.listRef.current.getIndentWidth()
});
this.setExpandedKeys(newExpandedKeys);
window.addEventListener("dragend", this.onWindowDragEnd);
onDragStart?.({
event,
node: convertNodePropsToEventData(nodeProps)
});
};
/**
* [Legacy] Select handler is smaller than node,
* so that this will trigger when drag enter node or select handler.
* This is a little tricky if customize css without padding.
* Better for use mouse move event to refresh drag state.
* But let's just keep it to avoid event trigger logic change.
*/
onNodeDragEnter = (event, nodeProps) => {
const { expandedKeys, keyEntities, dragChildrenKeys, flattenNodes, indent } = this.state;
const { onDragEnter, onExpand, allowDrop, direction } = this.props;
const { pos, eventKey } = nodeProps;
if (this.currentMouseOverDroppableNodeKey !== eventKey) this.currentMouseOverDroppableNodeKey = eventKey;
if (!this.dragNodeProps) {
this.resetDragState();
return;
}
const { dropPosition, dropLevelOffset, dropTargetKey, dropContainerKey, dropTargetPos, dropAllowed, dragOverNodeKey } = calcDropPosition(event, this.dragNodeProps, nodeProps, indent, this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction);
if (dragChildrenKeys.includes(dropTargetKey) || !dropAllowed) {
this.resetDragState();
return;
}
if (!this.delayedDragEnterLogic) this.delayedDragEnterLogic = {};
Object.keys(this.delayedDragEnterLogic).forEach((key) => {
clearTimeout(this.delayedDragEnterLogic[key]);
});
if (this.dragNodeProps.eventKey !== nodeProps.eventKey) {
event.persist();
this.delayedDragEnterLogic[pos] = window.setTimeout(() => {
if (this.state.draggingNodeKey === null) return;
let newExpandedKeys = [...expandedKeys];
const entity = getEntity(keyEntities, nodeProps.eventKey);
if (entity && (entity.children || []).length) newExpandedKeys = arrAdd(expandedKeys, nodeProps.eventKey);
if (!this.props.hasOwnProperty("expandedKeys")) this.setExpandedKeys(newExpandedKeys);
onExpand?.(newExpandedKeys, {
node: convertNodePropsToEventData(nodeProps),
expanded: true,
nativeEvent: event.nativeEvent
});
}, 800);
}
if (this.dragNodeProps.eventKey === dropTargetKey && dropLevelOffset === 0) {
this.resetDragState();
return;
}
this.setState({
dragOverNodeKey,
dropPosition,
dropLevelOffset,
dropTargetKey,
dropContainerKey,
dropTargetPos,
dropAllowed
});
onDragEnter?.({
event,
node: convertNodePropsToEventData(nodeProps),
expandedKeys
});
};
onNodeDragOver = (event, nodeProps) => {
const { dragChildrenKeys, flattenNodes, keyEntities, expandedKeys, indent } = this.state;
const { onDragOver, allowDrop, direction } = this.props;
if (!this.dragNodeProps) return;
const { dropPosition, dropLevelOffset, dropTargetKey, dropContainerKey, dropTargetPos, dropAllowed, dragOverNodeKey } = calcDropPosition(event, this.dragNodeProps, nodeProps, indent, this.dragStartMousePosition, allowDrop, flattenNodes, keyEntities, expandedKeys, direction);
if (dragChildrenKeys.includes(dropTargetKey) || !dropAllowed) return;
if (this.dragNodeProps.eventKey === dropTargetKey && dropLevelOffset === 0) {
if (!(this.state.dropPosition === null && this.state.dropLevelOffset === null && this.state.dropTargetKey === null && this.state.dropContainerKey === null && this.state.dropTargetPos === null && this.state.dropAllowed === false && this.state.dragOverNodeKey === null)) this.resetDragState();
} else if (!(dropPosition === this.state.dropPosition && dropLevelOffset === this.state.dropLevelOffset && dropTargetKey === this.state.dropTargetKey && dropContainerKey === this.state.dropContainerKey && dropTargetPos === this.state.dropTargetPos && dropAllowed === this.state.dropAllowed && dragOverNodeKey === this.state.dragOverNodeKey)) this.setState({
dropPosition,
dropLevelOffset,
dropTargetKey,
dropContainerKey,
dropTargetPos,
dropAllowed,
dragOverNodeKey
});
onDragOver?.({
event,
node: convertNodePropsToEventData(nodeProps)
});
};
onNodeDragLeave = (event, nodeProps) => {
if (this.currentMouseOverDroppableNodeKey === nodeProps.eventKey && !event.currentTarget.contains(event.relatedTarget)) {
this.resetDragState();
this.currentMouseOverDroppableNodeKey = null;
}
const { onDragLeave } = this.props;
onDragLeave?.({
event,
node: convertNodePropsToEventData(nodeProps)
});
};
onWindowDragEnd = (event) => {
this.onNodeDragEnd(event, null, true);
window.removeEventListener("dragend", this.onWindowDragEnd);
};
onNodeDragEnd = (event, nodeProps) => {
const { onDragEnd } = this.props;
this.setState({ dragOverNodeKey: null });
this.cleanDragState();
onDragEnd?.({
event,
node: convertNodePropsToEventData(nodeProps)
});
this.dragNodeProps = null;
window.removeEventListener("dragend", this.onWindowDragEnd);
};
onNodeDrop = (event, _, outsideTree = false) => {
const { dragChildrenKeys, dropPosition, dropTargetKey, dropTargetPos, dropAllowed } = this.state;
if (!dropAllowed) return;
const { onDrop } = this.props;
this.setState({ dragOverNodeKey: null });
this.cleanDragState();
if (dropTargetKey === null) return;
const abstractDropNodeProps = {
...getTreeNodeProps(dropTargetKey, this.getTreeNodeRequiredProps()),
active: this.getActiveItem()?.key === dropTargetKey,
data: getEntity(this.state.keyEntities, dropTargetKey).node
};
warningOnce(!dragChildrenKeys.includes(dropTargetKey), "Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");
const posArr = posToArr(dropTargetPos);
const dropResult = {
event,
node: convertNodePropsToEventData(abstractDropNodeProps),
dragNode: this.dragNodeProps ? convertNodePropsToEventData(this.dragNodeProps) : null,
dragNodesKeys: [this.dragNodeProps.eventKey].concat(dragChildrenKeys),
dropToGap: dropPosition !== 0,
dropPosition: dropPosition + Number(posArr[posArr.length - 1])
};
if (!outsideTree) onDrop?.(dropResult);
this.dragNodeProps = null;
};
resetDragState() {
this.setState({
dragOverNodeKey: null,
dropPosition: null,
dropLevelOffset: null,
dropTargetKey: null,
dropContainerKey: null,
dropTargetPos: null,
dropAllowed: false
});
}
cleanDragState = () => {
const { draggingNodeKey } = this.state;
if (draggingNodeKey !== null) this.setState({
draggingNodeKey: null,
dropPosition: null,
dropContainerKey: null,
dropTargetKey: null,
dropLevelOffset: null,
dropAllowed: true,
dragOverNodeKey: null
});
this.dragStartMousePosition = null;
this.currentMouseOverDroppableNodeKey = null;
};
triggerExpandActionExpand = (e, treeNode) => {
const { expandedKeys, flattenNodes } = this.state;
const { expanded, key, isLeaf } = treeNode;
if (isLeaf || e.shiftKey || e.metaKey || e.ctrlKey) return;
const node = flattenNodes.filter((nodeItem) => nodeItem.key === key)[0];
const eventNode = convertNodePropsToEventData({
...getTreeNodeProps(key, this.getTreeNodeRequiredProps()),
data: node.data
});
this.setExpandedKeys(expanded ? arrDel(expandedKeys, key) : arrAdd(expandedKeys, key));
this.onNodeExpand(e, eventNode);
};
onNodeClick = (e, treeNode) => {
const { onClick, expandAction } = this.props;
if (expandAction === "click") this.triggerExpandActionExpand(e, treeNode);
onClick?.(e, treeNode);
};
onNodeDoubleClick = (e, treeNode) => {
const { onDoubleClick, expandAction } = this.props;
if (expandAction === "doubleClick") this.triggerExpandActionExpand(e, treeNode);
onDoubleClick?.(e, treeNode);
};
onNodeSelect = (e, treeNode) => {
let { selectedKeys } = this.state;
const { keyEntities, fieldNames } = this.state;
const { onSelect, multiple } = this.props;
const { selected } = treeNode;
const key = treeNode[fieldNames.key];
const targetSelected = !selected;
if (!targetSelected) selectedKeys = arrDel(selectedKeys, key);
else if (!multiple) selectedKeys = [key];
else selectedKeys = arrAdd(selectedKeys, key);
const selectedNodes = selectedKeys.map((selectedKey) => {
const entity = getEntity(keyEntities, selectedKey);
return entity ? entity.node : null;
}).filter(Boolean);
this.setUncontrolledState({ selectedKeys });
onSelect?.(selectedKeys, {
event: "select",
selected: targetSelected,
node: treeNode,
selectedNodes,
nativeEvent: e.nativeEvent
});
};
onNodeCheck = (e, treeNode, checked) => {
const { keyEntities, checkedKeys: oriCheckedKeys, halfCheckedKeys: oriHalfCheckedKeys } = this.state;
const { checkStrictly, onCheck } = this.props;
const { key } = treeNode;
let checkedObj;
const eventObj = {
event: "check",
node: treeNode,
checked,
nativeEvent: e.nativeEvent
};
if (checkStrictly) {
const checkedKeys = checked ? arrAdd(oriCheckedKeys, key) : arrDel(oriCheckedKeys, key);
checkedObj = {
checked: checkedKeys,
halfChecked: arrDel(oriHalfCheckedKeys, key)
};
eventObj.checkedNodes = checkedKeys.map((checkedKey) => getEntity(keyEntities, checkedKey)).filter(Boolean).map((entity) => entity.node);
this.setUncontrolledState({ checkedKeys });
} else {
let { checkedKeys, halfCheckedKeys } = conductCheck([...oriCheckedKeys, key], true, keyEntities);
if (!checked) {
const keySet = new Set(checkedKeys);
keySet.delete(key);
({checkedKeys, halfCheckedKeys} = conductCheck(Array.from(keySet), {
checked: false,
halfCheckedKeys
}, keyEntities));
}
checkedObj = checkedKeys;
eventObj.checkedNodes = [];
eventObj.checkedNodesPositions = [];
eventObj.halfCheckedKeys = halfCheckedKeys;
checkedKeys.forEach((checkedKey) => {
const entity = getEntity(keyEntities, checkedKey);
if (!entity) return;
const { node, pos } = entity;
eventObj.checkedNodes.push(node);
eventObj.checkedNodesPositions.push({
node,
pos
});
});
this.setUncontrolledState({ checkedKeys }, false, { halfCheckedKeys });
}
onCheck?.(checkedObj, eventObj);
};
onNodeLoad = (treeNode) => {
const { key } = treeNode;
const { keyEntities } = this.state;
if (getEntity(keyEntities, key)?.children?.length) return;
const loadPromise = new Promise((resolve, reject) => {
this.setState(({ loadedKeys = [], loadingKeys = [] }) => {
const { loadData, onLoad } = this.props;
if (!loadData || loadedKeys.includes(key) || loadingKeys.includes(key)) return null;
loadData(treeNode).then(() => {
const { loadedKeys: currentLoadedKeys } = this.state;
const newLoadedKeys = arrAdd(currentLoadedKeys, key);
onLoad?.(newLoadedKeys, {
event: "load",
node: treeNode
});
this.setUncontrolledState({ loadedKeys: newLoadedKeys });
this.setState((prevState) => ({ loadingKeys: arrDel(prevState.loadingKeys, key) }));
resolve();
}).catch((e) => {
this.setState((prevState) => ({ loadingKeys: arrDel(prevState.loadingKeys, key) }));
this.loadingRetryTimes[key] = (this.loadingRetryTimes[key] || 0) + 1;
if (this.loadingRetryTimes[key] >= MAX_RETRY_TIMES) {
const { loadedKeys: currentLoadedKeys } = this.state;
warningOnce(false, "Retry for `loadData` many times but still failed. No more retry.");
this.setUncontrolledState({ loadedKeys: arrAdd(currentLoadedKeys, key) });
resolve();
}
reject(e);
});
return { loadingKeys: arrAdd(loadingKeys, key) };
});
});
loadPromise.catch(() => {});
return loadPromise;
};
onNodeMouseEnter = (event, node) => {
const { onMouseEnter } = this.props;
onMouseEnter?.({
event,
node
});
};
onNodeMouseLeave = (event, node) => {
const { onMouseLeave } = this.props;
onMouseLeave?.({
event,
node
});
};
onNodeContextMenu = (event, node) => {
const { onRightClick } = this.props;
if (onRightClick) {
event.preventDefault();
onRightClick({
event,
node
});
}
};
onMouseDown = (event) => {
this.focusedByMouse = true;
const { onMouseDown } = this.props;
onMouseDown?.(event);
};
onMouseUp = (event) => {
this.focusedByMouse = false;
const { onMouseUp } = this.props;
onMouseUp?.(event);
};
onFocus = (...args) => {
const { onFocus, disabled } = this.props;
const { activeKey, selectedKeys, flattenNodes } = this.state;
if (!this.focusedByMouse && !disabled && activeKey === null) {
const visibleSelectedKey = selectedKeys.find((key) => {
return flattenNodes.some((nodeItem) => nodeItem.key === key);
});
if (visibleSelectedKey !== void 0) this.onActiveChange(visibleSelectedKey);
else this.onActiveChange(flattenNodes?.[0]?.key || null);
}
onFocus?.(...args);
};
onBlur = (...args) => {
this.focusedByMouse = false;
const { onBlur } = this.props;
this.onActiveChange(null);
onBlur?.(...args);
};
getTreeNodeRequiredProps = () => {
const { expandedKeys, selectedKeys, loadedKeys, loadingKeys, checkedKeys, halfCheckedKeys, dragOverNodeKey, dropPosition, keyEntities } = this.state;
return {
expandedKeys: expandedKeys || [],
selectedKeys: selectedKeys || [],
loadedKeys: loadedKeys || [],
loadingKeys: loadingKeys || [],
checkedKeys: checkedKeys || [],
halfCheckedKeys: halfCheckedKeys || [],
dragOverNodeKey,
dropPosition,
keyEntities
};
};
/** Set uncontrolled `expandedKeys`. This will also auto update `flattenNodes`. */
setExpandedKeys = (expandedKeys) => {
const { treeData, fieldNames } = this.state;
const flattenNodes = flattenTreeData(treeData, expandedKeys, fieldNames);
this.setUncontrolledState({
expandedKeys,
flattenNodes
}, true);
};
onNodeExpand = (e, treeNode) => {
let { expandedKeys } = this.state;
const { listChanging, fieldNames } = this.state;
const { onExpand, loadData } = this.props;
const { expanded } = treeNode;
const key = treeNode[fieldNames.key];
if (listChanging) return;
const certain = expandedKeys.includes(key);
const targetExpanded = !expanded;
warningOnce(expanded && certain || !expanded && !certain, "Expand state not sync with index check");
expandedKeys = targetExpanded ? arrAdd(expandedKeys, key) : arrDel(expandedKeys, key);
this.setExpandedKeys(expandedKeys);
onExpand?.(expandedKeys, {
node: treeNode,
expanded: targetExpanded,
nativeEvent: e.nativeEvent
});
if (targetExpanded && loadData) {
const loadPromise = this.onNodeLoad(treeNode);
if (loadPromise) loadPromise.then(() => {
const newFlattenTreeData = flattenTreeData(this.state.treeData, expandedKeys, fieldNames);
this.setUncontrolledState({ flattenNodes: newFlattenTreeData });
}).catch(() => {
const { expandedKeys: currentExpandedKeys } = this.state;
const expandedKeysToRestore = arrDel(currentExpandedKeys, key);
this.setExpandedKeys(expandedKeysToRestore);
});
}
};
onListChangeStart = () => {
this.setUncontrolledState({ listChanging: true });
};
onListChangeEnd = () => {
setTimeout(() => {
this.setUncontrolledState({ listChanging: false });
});
};
onActiveChange = (newActiveKey) => {
const { activeKey } = this.state;
const { onActiveChange, itemScrollOffset = 0 } = this.props;
if (activeKey === newActiveKey) return;
this.setState({ activeKey: newActiveKey });
if (newActiveKey !== null) this.scrollTo({
key: newActiveKey,
offset: itemScrollOffset
});
onActiveChange?.(newActiveKey);
};
getActiveItem = () => {
const { activeKey, flattenNodes } = this.state;
if (activeKey === null) return null;
return flattenNodes.find(({ key }) => key === activeKey) || null;
};
offsetActiveKey = (offset) => {
const { flattenNodes, activeKey } = this.state;
let index = flattenNodes.findIndex(({ key }) => key === activeKey);
if (index === -1 && offset < 0) index = flattenNodes.length;
index = (index + offset + flattenNodes.length) % flattenNodes.length;
const item = flattenNodes[index];
if (item) {
const { key } = item;
this.onActiveChange(key);
} else this.onActiveChange(null);
};
onKeyDown = (event) => {
const { activeKey, expandedKeys, checkedKeys, flattenNodes, keyEntities } = this.state;
const { onKeyDown, checkable, selectable, disabled, loadData } = this.props;
if (disabled) return;
switch (event.key) {
case "ArrowUp":
this.offsetActiveKey(-1);
event.preventDefault();
break;
case "ArrowDown":
this.offsetActiveKey(1);
event.preventDefault();
break;
case "Home":
this.onActiveChange(flattenNodes?.[0]?.key);
event.preventDefault();
break;
case "End":
this.onActiveChange(flattenNodes?.[flattenNodes.length - 1]?.key);
event.preventDefault();
break;
}
const activeItem = this.getActiveItem();
if (activeItem && activeItem.data) {
const eventNode = convertNodePropsToEventData({
...getTreeNodeProps(activeKey, this.getTreeNodeRequiredProps()),
data: activeItem.data,
active: true
});
const hasChildren = !!getEntity(keyEntities, activeKey)?.children?.length;
const expandable = !isLeafNode(activeItem.data.isLeaf, loadData, hasChildren, eventNode.loaded);
const canCheck = checkable && !eventNode.disabled && eventNode.checkable !== false && !eventNode.disableCheckbox;
const canSelect = !checkable && selectable && !eventNode.disabled && eventNode.selectable !== false;
switch (event.key) {
case "ArrowLeft":
if (expandable && expandedKeys.includes(activeKey)) this.onNodeExpand({}, eventNode);
else if (activeItem.parent) this.onActiveChange(activeItem.parent.key);
event.preventDefault();
break;
case "ArrowRight":
if (expandable && !expandedKeys.includes(activeKey)) this.onNodeExpand({}, eventNode);
else if (activeItem.children && activeItem.children.length) this.onActiveChange(activeItem.children[0].key);
event.preventDefault();
break;
case "Enter":
if (expandable) {
event.preventDefault();
this.onNodeExpand({}, eventNode);
} else if (canCheck) {
if (!checkedKeys.includes(activeKey)) {
event.preventDefault();
this.onNodeCheck({}, eventNode, true);
}
} else if (canSelect && !eventNode.selected) {
event.preventDefault();
this.onNodeSelect({}, eventNode);
}
break;
case " ":
if (canCheck) {
event.preventDefault();
this.onNodeCheck({}, eventNode, !checkedKeys.includes(activeKey));
} else if (canSelect) {
event.preventDefault();
this.onNodeSelect({}, eventNode);
}
break;
}
}
onKeyDown?.(event);
};
/**
* Only update the value which is not in props
*/
setUncontrolledState = (state, atomic = false, forceState = null) => {
if (!this.destroyed) {
let needSync = false;
let allPassed = true;
const newState = {};
Object.keys(state).forEach((name) => {
if (this.props.hasOwnProperty(name)) {
allPassed = false;
return;
}
needSync = true;
newState[name] = state[name];
});
if (needSync && (!atomic || allPassed)) this.setState({
...newState,
...forceState
});
}
};
scrollTo = (scroll) => {
this.listRef.current.scrollTo(scroll);
};
render() {
const { flattenNodes, keyEntities, draggingNodeKey, dropLevelOffset, dropContainerKey, dropTargetKey, dropPosition, dragOverNodeKey, indent } = this.state;
const { prefixCls, className, style, styles, classNames: treeClassNames, showLine, focusable, tabIndex = 0, selectable, showIcon, icon, switcherIcon, draggable, checkable, checkStrictly, disabled, motion, loadData, filterTreeNode, height, itemHeight, scrollWidth, virtual, titleRender, dropIndicatorRender, onContextMenu, onScroll, direction, rootClassName, rootStyle } = this.props;
const domProps = pickAttrs(this.props, {
aria: true,
data: true
});
let draggableConfig;
if (draggable) if (typeof draggable === "object") draggableConfig = draggable;
else if (typeof draggable === "function") draggableConfig = { nodeDraggable: draggable };
else draggableConfig = {};
const contextValue = {
styles,
classNames: treeClassNames,
prefixCls,
selectable,
showIcon,
icon,
switcherIcon,
draggable: draggableConfig,
draggingNodeKey,
checkable,
checkStrictly,
disabled,
keyEntities,
dropLevelOffset,
dropContainerKey,
dropTargetKey,
dropPosition,
dragOverNodeKey,
indent,
direction,
dropIndicatorRender,
loadData,
filterTreeNode,
titleRender,
onNodeClick: this.onNodeClick,
onNodeDoubleClick: this.onNodeDoubleClick,
onNodeExpand: this.onNodeExpand,
onNodeSelect: this.onNodeSelect,
onNodeCheck: this.onNodeCheck,
onNodeLoad: this.onNodeLoad,
onNodeMouseEnter: this.onNodeMouseEnter,
onNodeMouseLeave: this.onNodeMouseLeave,
onNodeContextMenu: this.onNodeContextMenu,
onNodeDragStart: this.onNodeDragStart,
onNodeDragEnter: this.onNodeDragEnter,
onNodeDragOver: this.onNodeDragOver,
onNodeDragLeave: this.onNodeDragLeave,
onNodeDragEnd: this.onNodeDragEnd,
onNodeDrop: this.onNodeDrop
};
return /* @__PURE__ */ import_react.createElement(TreeContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(prefixCls, className, rootClassName, { [`${prefixCls}-show-line`]: showLine }),
style: rootStyle
}, /* @__PURE__ */ import_react.createElement(NodeList, _extends$7({
ref: this.listRef,
prefixCls,
style,
data: flattenNodes,
disabled,
selectable,
checkable: !!checkable,
motion,
dragging: draggingNodeKey !== null,
height,
itemHeight,
virtual,
focusable,
tabIndex,
activeItem: this.getActiveItem(),
onFocus: this.onFocus,
onMouseDown: this.onMouseDown,
onMouseUp: this.onMouseUp,
onBlur: this.onBlur,
onKeyDown: this.onKeyDown,
onActiveChange: this.onActiveChange,
onListChangeStart: this.onListChangeStart,
onListChangeEnd: this.onListChangeEnd,
onContextMenu,
onScroll,
scrollWidth
}, this.getTreeNodeRequiredProps(), domProps))));
}
};
//#endregion
//#region node_modules/@rc-component/tree/es/index.js
var es_default$3 = Tree$2;
//#endregion
//#region node_modules/antd/es/tree/style/directory.js
var genDirectoryStyle = ({ treeCls, treeNodeCls, directoryNodeSelectedBg, directoryNodeSelectedColor, motionDurationMid, borderRadius, controlItemBgHover }) => ({ [`${treeCls}${treeCls}-directory ${treeNodeCls}`]: {
[`${treeCls}-node-content-wrapper`]: {
position: "static",
[`&:has(${treeCls}-drop-indicator)`]: { position: "relative" },
[`> *:not(${treeCls}-drop-indicator)`]: { position: "relative" },
"&:hover": { background: "transparent" },
"&:before": {
position: "absolute",
inset: 0,
transition: `background-color ${motionDurationMid}`,
content: "\"\"",
borderRadius
},
"&:hover:before": { background: controlItemBgHover }
},
[`${treeCls}-switcher, ${treeCls}-checkbox, ${treeCls}-draggable-icon`]: { zIndex: 1 },
"&-selected": {
background: directoryNodeSelectedBg,
borderRadius,
[`${treeCls}-switcher, ${treeCls}-draggable-icon`]: { color: directoryNodeSelectedColor },
[`${treeCls}-node-content-wrapper`]: {
color: directoryNodeSelectedColor,
background: "transparent",
"&, &:hover": { color: directoryNodeSelectedColor },
"&:before, &:hover:before": { background: directoryNodeSelectedBg }
}
}
} });
//#endregion
//#region node_modules/antd/es/tree/style/index.js
var treeNodeFX = new Keyframe("ant-tree-node-fx-do-not-use", {
"0%": { opacity: 0 },
"100%": { opacity: 1 }
});
var getSwitchStyle = (prefixCls, token) => ({ [`.${prefixCls}-switcher-icon`]: {
display: "inline-block",
fontSize: 10,
verticalAlign: "baseline",
svg: { transition: `transform ${token.motionDurationSlow}` }
} });
var getDropIndicatorStyle = (prefixCls, token) => ({ [`.${prefixCls}-drop-indicator`]: {
position: "absolute",
zIndex: 1,
height: 2,
backgroundColor: token.colorPrimary,
borderRadius: 1,
pointerEvents: "none",
"&:after": {
position: "absolute",
top: -3,
insetInlineStart: -6,
width: 8,
height: 8,
backgroundColor: "transparent",
border: `${unit$1(token.lineWidthBold)} solid ${token.colorPrimary}`,
borderRadius: "50%",
content: "\"\""
}
} });
var genBaseStyle$4 = (prefixCls, token) => {
const { treeCls, treeNodeCls, treeNodePadding, titleHeight, indentSize, switcherSize, motionDurationMid, nodeSelectedBg, nodeHoverBg, colorTextQuaternary, controlItemBgActiveDisabled } = token;
return { [treeCls]: {
...resetComponent(token),
["--rc-virtual-list-scrollbar-bg"]: token.colorSplit,
background: token.colorBgContainer,
borderRadius: token.borderRadius,
transition: `background-color ${token.motionDurationSlow}`,
"&-rtl": { direction: "rtl" },
[`&${treeCls}-rtl ${treeCls}-switcher_close ${treeCls}-switcher-icon svg`]: { transform: "rotate(90deg)" },
[`${treeCls}-list`]: { "&:focus-visible": {
outline: "none",
[`${treeNodeCls}-active ${treeCls}-node-content-wrapper`]: { ...genFocusOutline(token) }
} },
[`${treeCls}-list-holder-inner`]: { alignItems: "flex-start" },
[`&${treeCls}-block-node`]: { [`${treeCls}-list-holder-inner`]: {
alignItems: "stretch",
[`${treeCls}-node-content-wrapper`]: { flex: "auto" },
[`${treeNodeCls}.dragging:after`]: {
position: "absolute",
inset: 0,
border: `1px solid ${token.colorPrimary}`,
opacity: 0,
animationName: treeNodeFX,
animationDuration: token.motionDurationSlow,
animationPlayState: "running",
animationFillMode: "forwards",
content: "\"\"",
pointerEvents: "none",
borderRadius: token.borderRadius
}
} },
[treeNodeCls]: {
display: "flex",
alignItems: "flex-start",
marginBottom: treeNodePadding,
lineHeight: unit$1(titleHeight),
position: "relative",
"&:before": {
content: "\"\"",
position: "absolute",
zIndex: 1,
insetInlineStart: 0,
width: "100%",
top: "100%",
height: treeNodePadding
},
[`&-disabled ${treeCls}-node-content-wrapper`]: {
color: token.colorTextDisabled,
cursor: "not-allowed",
"&:hover": { background: "transparent" }
},
[`${treeCls}-checkbox-disabled + ${treeCls}-node-selected,&${treeNodeCls}-disabled${treeNodeCls}-selected ${treeCls}-node-content-wrapper`]: { backgroundColor: controlItemBgActiveDisabled },
[`${treeCls}-checkbox-disabled`]: { pointerEvents: "unset" },
[`&:not(${treeNodeCls}-disabled)`]: { [`${treeCls}-node-content-wrapper`]: { "&:hover": { color: token.nodeHoverColor } } },
[`&-active ${treeCls}-node-content-wrapper`]: { background: token.controlItemBgHover },
[`&:not(${treeNodeCls}-disabled).filter-node ${treeCls}-title`]: {
color: token.colorPrimary,
fontWeight: token.fontWeightStrong
},
"&-draggable": {
cursor: "grab",
[`${treeCls}-draggable-icon`]: {
flexShrink: 0,
width: switcherSize,
textAlign: "center",
visibility: "visible",
color: colorTextQuaternary
},
[`&${treeNodeCls}-disabled ${treeCls}-draggable-icon`]: { visibility: "hidden" }
}
},
[`${treeCls}-indent`]: {
alignSelf: "stretch",
whiteSpace: "nowrap",
userSelect: "none",
"&-unit": {
display: "inline-block",
width: indentSize
}
},
[`${treeCls}-draggable-icon`]: { visibility: "hidden" },
[`${treeCls}-switcher, ${treeCls}-checkbox`]: { marginInlineEnd: token.calc(token.calc(switcherSize).sub(token.controlInteractiveSize)).div(2).equal() },
[`${treeCls}-checkbox`]: {
flexShrink: 0,
alignSelf: "flex-start",
marginBlockStart: token.calc(token.calc(titleHeight).sub(token.controlInteractiveSize)).div(2).equal()
},
[`${treeCls}-switcher`]: {
...getSwitchStyle(prefixCls, token),
position: "relative",
flex: "none",
alignSelf: "stretch",
width: switcherSize,
textAlign: "center",
cursor: "pointer",
userSelect: "none",
transition: `all ${token.motionDurationSlow}`,
"&-noop": { cursor: "unset" },
"&:before": {
pointerEvents: "none",
content: "\"\"",
width: switcherSize,
height: titleHeight,
position: "absolute",
left: {
_skip_check_: true,
value: 0
},
top: 0,
borderRadius: token.borderRadius,
transition: `all ${token.motionDurationSlow}`
},
[`&:not(${treeCls}-switcher-noop):hover:before`]: { backgroundColor: token.colorBgTextHover },
[`&_close ${treeCls}-switcher-icon svg`]: { transform: "rotate(-90deg)" },
"&-loading-icon": { color: token.colorPrimary },
"&-leaf-line": {
position: "relative",
zIndex: 1,
display: "inline-block",
width: "100%",
height: "100%",
"&:before": {
position: "absolute",
top: 0,
insetInlineEnd: token.calc(switcherSize).div(2).equal(),
bottom: token.calc(treeNodePadding).mul(-1).equal(),
marginInlineStart: -1,
borderInlineEnd: `1px solid ${token.colorBorder}`,
content: "\"\""
},
"&:after": {
position: "absolute",
width: token.calc(token.calc(switcherSize).div(2).equal()).mul(.8).equal(),
height: token.calc(titleHeight).div(2).equal(),
borderBottom: `1px solid ${token.colorBorder}`,
content: "\"\""
}
}
},
[`${treeCls}-node-content-wrapper`]: {
position: "relative",
minHeight: titleHeight,
paddingBlock: 0,
paddingInline: token.paddingXS,
background: "transparent",
borderRadius: token.borderRadius,
cursor: "pointer",
transition: [
`all ${motionDurationMid}`,
"border 0s",
"line-height 0s",
"box-shadow 0s"
].join(", "),
...getDropIndicatorStyle(prefixCls, token),
"&:hover": { backgroundColor: nodeHoverBg },
[`&${treeCls}-node-selected`]: {
color: token.nodeSelectedColor,
backgroundColor: nodeSelectedBg
},
[`${treeCls}-iconEle`]: {
display: "inline-block",
width: switcherSize,
height: titleHeight,
textAlign: "center",
verticalAlign: "top",
"&:empty": { display: "none" }
}
},
[`${treeCls}-unselectable ${treeCls}-node-content-wrapper:hover`]: { backgroundColor: "transparent" },
[`${treeNodeCls}.drop-container > [draggable]`]: { boxShadow: `0 0 0 2px ${token.colorPrimary}` },
"&-show-line": {
[`${treeCls}-indent-unit`]: {
position: "relative",
height: "100%",
"&:before": {
position: "absolute",
top: 0,
insetInlineEnd: token.calc(switcherSize).div(2).equal(),
bottom: token.calc(treeNodePadding).mul(-1).equal(),
borderInlineEnd: `1px solid ${token.colorBorder}`,
content: "\"\""
},
"&-end:before": { display: "none" }
},
[`${treeCls}-switcher`]: {
background: "transparent",
"&-line-icon": { verticalAlign: "-0.15em" }
}
},
[`${treeNodeCls}-leaf-last ${treeCls}-switcher-leaf-line:before`]: {
top: "auto !important",
bottom: "auto !important",
height: `${unit$1(token.calc(titleHeight).div(2).equal())} !important`
}
} };
};
var genTreeStyle = (prefixCls, token, enableDirectory = true) => {
const treeCls = `.${prefixCls}`;
const treeToken = merge(token, {
treeCls,
treeNodeCls: `${treeCls}-treenode`,
treeNodePadding: token.calc(token.paddingXS).div(2).equal()
});
return [genBaseStyle$4(prefixCls, treeToken), enableDirectory && genDirectoryStyle(treeToken)].filter(Boolean);
};
var initComponentToken = (token) => {
const { controlHeightSM, controlItemBgHover, controlItemBgActive } = token;
const titleHeight = controlHeightSM;
return {
titleHeight,
switcherSize: titleHeight,
indentSize: titleHeight,
nodeHoverBg: controlItemBgHover,
nodeHoverColor: token.colorText,
nodeSelectedBg: controlItemBgActive,
nodeSelectedColor: token.colorText
};
};
var prepareComponentToken$7 = (token) => {
const { colorTextLightSolid, colorPrimary } = token;
return {
...initComponentToken(token),
directoryNodeSelectedColor: colorTextLightSolid,
directoryNodeSelectedBg: colorPrimary
};
};
var style_default$7 = genStyleHooks("Tree", (token, { prefixCls }) => [
{ [token.componentCls]: getStyle(`${prefixCls}-checkbox`, token) },
genTreeStyle(prefixCls, token),
genCollapseMotion(token)
], prepareComponentToken$7);
var dropIndicatorRender = (props) => {
const { dropPosition, dropLevelOffset, prefixCls, indent, direction = "ltr" } = props;
const startPosition = direction === "ltr" ? "left" : "right";
const endPosition = direction === "ltr" ? "right" : "left";
const style = {
[startPosition]: -dropLevelOffset * indent + 4,
[endPosition]: 0
};
switch (dropPosition) {
case -1:
style.top = -3;
break;
case 1:
style.bottom = -3;
break;
default:
style.bottom = -3;
style[startPosition] = indent + 4;
break;
}
return /* @__PURE__ */ import_react.createElement("div", {
style,
className: `${prefixCls}-drop-indicator`
});
};
//#endregion
//#region node_modules/antd/es/tree/utils/iconUtil.js
var SwitcherIconCom = (props) => {
const { prefixCls, switcherIcon, treeNodeProps, showLine, switcherLoadingIcon } = props;
const { isLeaf, expanded, loading } = treeNodeProps;
if (loading) {
if (/* @__PURE__ */ import_react.isValidElement(switcherLoadingIcon)) return switcherLoadingIcon;
return /* @__PURE__ */ import_react.createElement(RefIcon$5, { className: `${prefixCls}-switcher-loading-icon` });
}
let showLeafIcon;
if (isPlainObject(showLine)) showLeafIcon = showLine.showLeafIcon;
if (isLeaf) {
if (!showLine) return null;
if (typeof showLeafIcon !== "boolean" && !!showLeafIcon) {
const leafIcon = typeof showLeafIcon === "function" ? showLeafIcon(treeNodeProps) : showLeafIcon;
const leafCls = `${prefixCls}-switcher-line-custom-icon`;
if (/* @__PURE__ */ import_react.isValidElement(leafIcon)) return cloneElement$1(leafIcon, { className: clsx(leafIcon.props?.className, leafCls) });
return leafIcon;
}
return showLeafIcon ? /* @__PURE__ */ import_react.createElement(RefIcon$34, { className: `${prefixCls}-switcher-line-icon` }) : /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-switcher-leaf-line` });
}
const switcherCls = `${prefixCls}-switcher-icon`;
const switcher = typeof switcherIcon === "function" ? switcherIcon(treeNodeProps) : switcherIcon;
if (/* @__PURE__ */ import_react.isValidElement(switcher)) return cloneElement$1(switcher, { className: clsx(switcher.props?.className, showLine ? `${prefixCls}-switcher-line-icon` : switcherCls) });
if (switcher !== void 0) return switcher;
if (showLine) return expanded ? /* @__PURE__ */ import_react.createElement(RefIcon$35, { className: `${prefixCls}-switcher-line-icon` }) : /* @__PURE__ */ import_react.createElement(RefIcon$36, { className: `${prefixCls}-switcher-line-icon` });
return /* @__PURE__ */ import_react.createElement(RefIcon$37, { className: switcherCls });
};
//#endregion
//#region node_modules/antd/es/tree/Tree.js
var Tree$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("tree");
const { virtual } = import_react.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className, showIcon = false, showLine, switcherIcon, switcherLoadingIcon, blockNode = false, children, checkable = false, selectable = true, draggable, disabled, motion: customMotion, style, rootClassName, classNames, styles, icon } = props;
const contextDisabled = import_react.useContext(DisabledContext);
const mergedDisabled = disabled ?? contextDisabled;
const prefixCls = getPrefixCls("tree", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const motion = customMotion ?? {
...initCollapseMotion(rootPrefixCls),
motionAppear: false
};
const mergedProps = {
...props,
showIcon,
blockNode,
checkable,
selectable,
disabled: mergedDisabled,
motion
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const newProps = {
...mergedProps,
showLine: Boolean(showLine),
icon,
dropIndicatorRender
};
const [hashId, cssVarCls] = style_default$7(prefixCls);
const [, token] = useToken$1();
const itemHeight = token.paddingXS / 2 + (token.Tree?.titleHeight || token.controlHeightSM);
const draggableConfig = import_react.useMemo(() => {
if (!draggable) return false;
let mergedDraggable = {};
switch (typeof draggable) {
case "function":
mergedDraggable.nodeDraggable = draggable;
break;
case "object":
mergedDraggable = { ...draggable };
break;
default: break;
}
if (mergedDraggable.icon !== false) mergedDraggable.icon = mergedDraggable.icon || /* @__PURE__ */ import_react.createElement(RefIcon$38, null);
return mergedDraggable;
}, [draggable]);
const renderSwitcherIcon = (nodeProps) => /* @__PURE__ */ import_react.createElement(SwitcherIconCom, {
prefixCls,
switcherIcon,
switcherLoadingIcon,
treeNodeProps: nodeProps,
showLine
});
return /* @__PURE__ */ import_react.createElement(es_default$3, {
itemHeight,
ref,
virtual,
...newProps,
prefixCls,
className: clsx({
[`${prefixCls}-icon-hide`]: !showIcon,
[`${prefixCls}-block-node`]: blockNode,
[`${prefixCls}-unselectable`]: !selectable,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-disabled`]: mergedDisabled
}, contextClassName, className, hashId, cssVarCls),
style: {
...contextStyle,
...style
},
rootClassName: clsx(mergedClassNames.root, rootClassName),
rootStyle: mergedStyles.root,
classNames: mergedClassNames,
styles: mergedStyles,
direction,
checkable: checkable ? /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-checkbox-inner` }) : checkable,
selectable,
switcherIcon: renderSwitcherIcon,
draggable: draggableConfig
}, children);
});
Tree$1.displayName = "Tree";
//#endregion
//#region node_modules/antd/es/tree/utils/dictUtil.js
var RECORD_NONE = 0;
var RECORD_START = 1;
var RECORD_END = 2;
function traverseNodesKey(treeData, callback, fieldNames) {
const { key: fieldKey, children: fieldChildren } = fieldNames;
function processNode(dataNode) {
const key = dataNode[fieldKey];
const children = dataNode[fieldChildren];
if (callback(key, dataNode) !== false) traverseNodesKey(children || [], callback, fieldNames);
}
treeData.forEach(processNode);
}
/** 计算选中范围,只考虑expanded情况以优化性能 */
function calcRangeKeys({ treeData, expandedKeys, startKey, endKey, fieldNames }) {
const keys = [];
let record = RECORD_NONE;
if (startKey && startKey === endKey) return [startKey];
if (!startKey || !endKey) return [];
function matchKey(key) {
return key === startKey || key === endKey;
}
traverseNodesKey(treeData, (key) => {
if (record === RECORD_END) return false;
if (matchKey(key)) {
keys.push(key);
if (record === RECORD_NONE) record = RECORD_START;
else if (record === RECORD_START) {
record = RECORD_END;
return false;
}
} else if (record === RECORD_START) keys.push(key);
return expandedKeys.includes(key);
}, fillFieldNames$1(fieldNames));
return keys;
}
function convertDirectoryKeysToNodes(treeData, keys, fieldNames) {
const restKeys = _toConsumableArray$8(keys);
const nodes = [];
traverseNodesKey(treeData, (key, node) => {
const index = restKeys.indexOf(key);
if (index !== -1) {
nodes.push(node);
restKeys.splice(index, 1);
}
return !!restKeys.length;
}, fillFieldNames$1(fieldNames));
return nodes;
}
//#endregion
//#region node_modules/antd/es/tree/DirectoryTree.js
function getIcon(props) {
const { isLeaf, expanded } = props;
if (isLeaf) return /* @__PURE__ */ import_react.createElement(RefIcon$34, null);
return expanded ? /* @__PURE__ */ import_react.createElement(RefIcon$39, null) : /* @__PURE__ */ import_react.createElement(RefIcon$40, null);
}
function getTreeData({ treeData, children }) {
return treeData || convertTreeToData(children);
}
var DirectoryTree = /* @__PURE__ */ import_react.forwardRef((oriProps, ref) => {
const { defaultExpandAll, defaultExpandParent, defaultExpandedKeys, ...props } = oriProps;
const lastSelectedKeyRef = import_react.useRef(null);
const cachedSelectedKeysRef = import_react.useRef(null);
const getInitExpandedKeys = () => {
const { keyEntities } = convertDataToEntities(getTreeData(props), { fieldNames: props.fieldNames });
let initExpandedKeys;
const mergedExpandedKeys = props.expandedKeys || defaultExpandedKeys || [];
if (defaultExpandAll) initExpandedKeys = Object.keys(keyEntities);
else if (defaultExpandParent) initExpandedKeys = conductExpandParent(mergedExpandedKeys, keyEntities);
else initExpandedKeys = mergedExpandedKeys;
return initExpandedKeys;
};
const [selectedKeys, setSelectedKeys] = import_react.useState(props.selectedKeys || props.defaultSelectedKeys || []);
const [expandedKeys, setExpandedKeys] = import_react.useState(() => getInitExpandedKeys());
import_react.useEffect(() => {
if ("selectedKeys" in props) setSelectedKeys(props.selectedKeys);
}, [props.selectedKeys]);
import_react.useEffect(() => {
if ("expandedKeys" in props) setExpandedKeys(props.expandedKeys);
}, [props.expandedKeys]);
const onExpand = (keys, info) => {
if (!("expandedKeys" in props)) setExpandedKeys(keys);
return props.onExpand?.(keys, info);
};
const onSelect = (keys, event) => {
const { multiple, fieldNames } = props;
const { node, nativeEvent } = event;
const { key = "" } = node;
const treeData = getTreeData(props);
const newEvent = {
...event,
selected: true
};
const ctrlPick = nativeEvent?.ctrlKey || nativeEvent?.metaKey;
const shiftPick = nativeEvent?.shiftKey;
let newSelectedKeys;
if (multiple && ctrlPick) {
newSelectedKeys = keys;
lastSelectedKeyRef.current = key;
cachedSelectedKeysRef.current = newSelectedKeys;
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
} else if (multiple && shiftPick) {
newSelectedKeys = Array.from(new Set([].concat(_toConsumableArray$8(cachedSelectedKeysRef.current || []), _toConsumableArray$8(calcRangeKeys({
treeData,
expandedKeys,
startKey: key,
endKey: lastSelectedKeyRef.current,
fieldNames
})))));
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
} else {
newSelectedKeys = [key];
lastSelectedKeyRef.current = key;
cachedSelectedKeysRef.current = newSelectedKeys;
newEvent.selectedNodes = convertDirectoryKeysToNodes(treeData, newSelectedKeys, fieldNames);
}
props.onSelect?.(newSelectedKeys, newEvent);
if (!("selectedKeys" in props)) setSelectedKeys(newSelectedKeys);
};
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className, showIcon = true, expandAction = "click", ...restProps } = props;
const prefixCls = getPrefixCls("tree", customizePrefixCls);
const connectClassName = clsx(`${prefixCls}-directory`, { [`${prefixCls}-directory-rtl`]: direction === "rtl" }, className);
return /* @__PURE__ */ import_react.createElement(Tree$1, {
icon: getIcon,
ref,
blockNode: true,
...restProps,
showIcon,
expandAction,
prefixCls,
className: connectClassName,
expandedKeys,
selectedKeys,
onSelect,
onExpand
});
});
DirectoryTree.displayName = "DirectoryTree";
//#endregion
//#region node_modules/antd/es/tree/index.js
var Tree = Tree$1;
Tree.DirectoryTree = DirectoryTree;
Tree.TreeNode = TreeNode$1;
//#endregion
//#region node_modules/antd/es/table/hooks/useFilter/FilterSearch.js
var FilterSearch = (props) => {
const { value, filterSearch, tablePrefixCls, locale, onChange } = props;
if (!filterSearch) return null;
return /* @__PURE__ */ import_react.createElement("div", { className: `${tablePrefixCls}-filter-dropdown-search` }, /* @__PURE__ */ import_react.createElement(Input$1, {
prefix: /* @__PURE__ */ import_react.createElement(RefIcon$7, null),
placeholder: locale.filterSearchPlaceholder,
onChange,
value,
htmlSize: 1,
className: `${tablePrefixCls}-filter-dropdown-search-input`
}));
};
//#endregion
//#region node_modules/antd/es/table/hooks/useFilter/FilterWrapper.js
var onKeyDown = (event) => {
const { keyCode } = event;
if (keyCode === KeyCode.ENTER) event.stopPropagation();
};
var FilterDropdownMenuWrapper = /* @__PURE__ */ import_react.forwardRef((props, ref) => /* @__PURE__ */ import_react.createElement("div", {
className: props.className,
onClick: (e) => e.stopPropagation(),
onKeyDown,
ref
}, props.children));
FilterDropdownMenuWrapper.displayName = "FilterDropdownMenuWrapper";
//#endregion
//#region node_modules/antd/es/table/hooks/useFilter/FilterDropdown.js
function flattenKeys$1(filters) {
let keys = [];
(filters || []).forEach(({ value, children }) => {
keys.push(value);
if (children) keys = [].concat(_toConsumableArray$8(keys), _toConsumableArray$8(flattenKeys$1(children)));
});
return keys;
}
function hasSubMenu(filters) {
return filters.some(({ children }) => children);
}
var searchValueMatched = (normalizedSearchValue, text) => {
if (typeof text === "string" || isNumber(text)) return text.toString().toLowerCase().includes(normalizedSearchValue);
return false;
};
var renderFilterItems = (options) => {
const { filters, prefixCls, filteredKeys, filterMultiple, searchValue, normalizedSearchValue, filterSearch } = options;
return filters.map((filter, index) => {
const key = String(filter.value);
if (filter.children) return {
key: key || index,
label: filter.text,
popupClassName: `${prefixCls}-dropdown-submenu`,
children: renderFilterItems({
filters: filter.children,
prefixCls,
filteredKeys,
filterMultiple,
searchValue,
normalizedSearchValue,
filterSearch
})
};
const Component = filterMultiple ? Checkbox : Radio;
const item = {
key: filter.value !== void 0 ? key : index,
label: /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(Component, { checked: filteredKeys.includes(key) }), /* @__PURE__ */ import_react.createElement("span", null, filter.text))
};
if (normalizedSearchValue) {
if (typeof filterSearch === "function") return filterSearch(normalizedSearchValue, filter) ? item : null;
return searchValueMatched(normalizedSearchValue, filter.text) ? item : null;
}
return item;
});
};
function wrapStringListType(keys) {
return keys || [];
}
var FilterDropdown = (props) => {
const { tablePrefixCls, prefixCls, column, dropdownPrefixCls, columnKey, filterOnClose, filterMultiple, filterMode = "menu", filterSearch = false, filterState, triggerFilter, locale, children, getPopupContainer, rootClassName } = props;
const { filterResetToDefaultFilteredValue, defaultFilteredValue, filterDropdownProps = {}, filterDropdownOpen, onFilterDropdownOpenChange } = column;
const [visible, setVisible] = import_react.useState(false);
const inMeasureRow = import_react.useContext(TableMeasureRowContext);
const filtered = !!(filterState && (filterState.filteredKeys?.length || filterState.forceFiltered));
const triggerVisible = (newVisible) => {
setVisible(newVisible);
filterDropdownProps.onOpenChange?.(newVisible);
onFilterDropdownOpenChange?.(newVisible);
};
{
const warning = devUseWarning("Table");
[["filterDropdownOpen", "filterDropdownProps.open"], ["onFilterDropdownOpenChange", "filterDropdownProps.onOpenChange"]].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in column), deprecatedName, newName);
});
warning.deprecated(!("filterCheckall" in locale), "filterCheckall", "locale.filterCheckAll");
}
const mergedVisible = filterDropdownProps.open ?? filterDropdownOpen ?? visible;
const propFilteredKeys = filterState?.filteredKeys;
const [getFilteredKeysSync, setFilteredKeysSync] = useSyncState$2(wrapStringListType(propFilteredKeys));
const onSelectKeys = ({ selectedKeys }) => {
setFilteredKeysSync(selectedKeys);
};
const onCheck = (keys, { node, checked }) => {
if (!filterMultiple) onSelectKeys({ selectedKeys: checked && node.key ? [node.key] : [] });
else onSelectKeys({ selectedKeys: keys });
};
import_react.useEffect(() => {
if (!visible) return;
onSelectKeys({ selectedKeys: wrapStringListType(propFilteredKeys) });
}, [propFilteredKeys]);
const [openKeys, setOpenKeys] = import_react.useState([]);
const onOpenChange = (keys) => {
setOpenKeys(keys);
};
const [searchValue, setSearchValue] = import_react.useState("");
const normalizedSearchValue = import_react.useMemo(() => searchValue.trim().toLowerCase(), [searchValue]);
const onSearch = (e) => {
const { value } = e.target;
setSearchValue(value);
};
import_react.useEffect(() => {
if (!visible) setSearchValue("");
}, [visible]);
const internalTriggerFilter = (keys) => {
const mergedKeys = keys?.length ? keys : null;
if (mergedKeys === null && (!filterState || !filterState.filteredKeys)) return null;
if (isEqual(mergedKeys, filterState?.filteredKeys, true)) return null;
triggerFilter({
column,
key: columnKey,
filteredKeys: mergedKeys
});
};
const onConfirm = () => {
triggerVisible(false);
internalTriggerFilter(getFilteredKeysSync());
};
const onReset = ({ confirm, closeDropdown } = {
confirm: false,
closeDropdown: false
}) => {
if (confirm) internalTriggerFilter([]);
if (closeDropdown) triggerVisible(false);
setSearchValue("");
if (filterResetToDefaultFilteredValue) setFilteredKeysSync((defaultFilteredValue || []).map(String));
else setFilteredKeysSync([]);
};
const doFilter = ({ closeDropdown } = { closeDropdown: true }) => {
if (closeDropdown) triggerVisible(false);
internalTriggerFilter(getFilteredKeysSync());
};
const onVisibleChange = (newVisible, info) => {
if (info.source === "trigger") {
if (newVisible && propFilteredKeys !== void 0) setFilteredKeysSync(wrapStringListType(propFilteredKeys));
triggerVisible(newVisible);
if (!newVisible && !column.filterDropdown && filterOnClose) onConfirm();
}
};
const dropdownMenuClass = clsx({ [`${dropdownPrefixCls}-menu-without-submenu`]: !hasSubMenu(column.filters || []) });
const onCheckAll = (e) => {
if (e.target.checked) setFilteredKeysSync(flattenKeys$1(column?.filters).map(String));
else setFilteredKeysSync([]);
};
const getTreeData = ({ filters }) => (filters || []).map((filter, index) => {
const key = String(filter.value);
const item = {
title: filter.text,
key: filter.value !== void 0 ? key : String(index)
};
if (filter.children) item.children = getTreeData({ filters: filter.children });
return item;
});
const getFilterData = (node) => ({
...node,
text: node.title,
value: node.key,
children: node.children?.map(getFilterData) || []
});
let dropdownContent;
const { direction, renderEmpty } = import_react.useContext(ConfigContext);
if (typeof column.filterDropdown === "function") dropdownContent = column.filterDropdown({
prefixCls: `${dropdownPrefixCls}-custom`,
setSelectedKeys: (selectedKeys) => onSelectKeys({ selectedKeys }),
selectedKeys: getFilteredKeysSync(),
confirm: doFilter,
clearFilters: onReset,
filters: column.filters,
visible: mergedVisible,
close: () => {
triggerVisible(false);
}
});
else if (column.filterDropdown) dropdownContent = column.filterDropdown;
else {
const selectedKeys = getFilteredKeysSync() || [];
const getFilterComponent = () => {
const empty = renderEmpty?.("Table.filter") ?? /* @__PURE__ */ import_react.createElement(Empty, {
image: Empty.PRESENTED_IMAGE_SIMPLE,
description: locale.filterEmptyText,
styles: { image: { height: 24 } },
style: {
margin: 0,
padding: "16px 0"
}
});
if ((column.filters || []).length === 0) return empty;
if (filterMode === "tree") return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(FilterSearch, {
filterSearch,
value: searchValue,
onChange: onSearch,
tablePrefixCls,
locale
}), /* @__PURE__ */ import_react.createElement("div", { className: `${tablePrefixCls}-filter-dropdown-tree` }, filterMultiple ? /* @__PURE__ */ import_react.createElement(Checkbox, {
checked: selectedKeys.length === flattenKeys$1(column.filters).length,
indeterminate: selectedKeys.length > 0 && selectedKeys.length < flattenKeys$1(column.filters).length,
className: `${tablePrefixCls}-filter-dropdown-checkall`,
onChange: onCheckAll
}, locale?.filterCheckall ?? locale?.filterCheckAll) : null, /* @__PURE__ */ import_react.createElement(Tree, {
checkable: true,
selectable: false,
blockNode: true,
multiple: filterMultiple,
checkStrictly: !filterMultiple,
className: `${dropdownPrefixCls}-menu`,
onCheck,
checkedKeys: selectedKeys,
selectedKeys,
showIcon: false,
treeData: getTreeData({ filters: column.filters }),
autoExpandParent: true,
defaultExpandAll: true,
filterTreeNode: normalizedSearchValue ? (node) => {
if (typeof filterSearch === "function") return filterSearch(searchValue, getFilterData(node));
return searchValueMatched(normalizedSearchValue, node.title);
} : void 0
})));
const items = renderFilterItems({
filters: column.filters || [],
filterSearch,
prefixCls,
filteredKeys: getFilteredKeysSync(),
filterMultiple,
searchValue,
normalizedSearchValue
});
const isEmpty = items.every((item) => item === null);
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(FilterSearch, {
filterSearch,
value: searchValue,
onChange: onSearch,
tablePrefixCls,
locale
}), isEmpty ? empty : /* @__PURE__ */ import_react.createElement(Menu, {
selectable: true,
multiple: filterMultiple,
prefixCls: `${dropdownPrefixCls}-menu`,
className: dropdownMenuClass,
onSelect: onSelectKeys,
onDeselect: onSelectKeys,
selectedKeys,
getPopupContainer,
openKeys,
onOpenChange,
items
}));
};
const getResetDisabled = () => {
if (filterResetToDefaultFilteredValue) return isEqual((defaultFilteredValue || []).map(String), selectedKeys, true);
return selectedKeys.length === 0;
};
dropdownContent = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, getFilterComponent(), /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-dropdown-btns` }, /* @__PURE__ */ import_react.createElement(Button, {
type: "link",
size: "small",
disabled: getResetDisabled(),
onClick: () => onReset()
}, locale.filterReset), /* @__PURE__ */ import_react.createElement(Button, {
type: "primary",
size: "small",
onClick: onConfirm
}, locale.filterConfirm)));
}
if (column.filterDropdown) dropdownContent = /* @__PURE__ */ import_react.createElement(OverrideProvider, { selectable: void 0 }, dropdownContent);
dropdownContent = /* @__PURE__ */ import_react.createElement(FilterDropdownMenuWrapper, { className: `${prefixCls}-dropdown` }, dropdownContent);
const getDropdownTrigger = () => {
let filterIcon;
if (typeof column.filterIcon === "function") filterIcon = column.filterIcon(filtered);
else if (column.filterIcon) filterIcon = column.filterIcon;
else filterIcon = /* @__PURE__ */ import_react.createElement(RefIcon$41, null);
return /* @__PURE__ */ import_react.createElement("span", {
role: "button",
tabIndex: -1,
className: clsx(`${prefixCls}-trigger`, { active: filtered }),
onClick: (e) => {
e.stopPropagation();
}
}, filterIcon);
};
const triggerNode = getDropdownTrigger();
if (inMeasureRow) return /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-column` }, /* @__PURE__ */ import_react.createElement("span", { className: `${tablePrefixCls}-column-title` }, children), triggerNode);
const mergedDropdownProps = mergeProps$1({
trigger: ["click"],
placement: direction === "rtl" ? "bottomLeft" : "bottomRight",
children: triggerNode,
getPopupContainer
}, {
...filterDropdownProps,
rootClassName: clsx(rootClassName, filterDropdownProps.rootClassName),
open: mergedVisible,
onOpenChange: onVisibleChange,
popupRender: () => {
if (typeof filterDropdownProps?.dropdownRender === "function") return filterDropdownProps.dropdownRender(dropdownContent);
return dropdownContent;
}
});
return /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-column` }, /* @__PURE__ */ import_react.createElement("span", { className: `${tablePrefixCls}-column-title` }, children), /* @__PURE__ */ import_react.createElement(Dropdown, { ...mergedDropdownProps }));
};
//#endregion
//#region node_modules/antd/es/table/hooks/useFilter/index.js
var collectFilterStates = (columns, init, pos) => {
let filterStates = [];
(columns || []).forEach((column, index) => {
const columnPos = getColumnPos(index, pos);
const filterDropdownIsDefined = column.filterDropdown !== void 0;
if (column.filters || filterDropdownIsDefined || "onFilter" in column) if ("filteredValue" in column) {
let filteredValues = column.filteredValue;
if (!filterDropdownIsDefined) filteredValues = filteredValues?.map(String) ?? filteredValues;
filterStates.push({
column,
key: getColumnKey(column, columnPos),
filteredKeys: filteredValues,
forceFiltered: column.filtered
});
} else filterStates.push({
column,
key: getColumnKey(column, columnPos),
filteredKeys: init && column.defaultFilteredValue ? column.defaultFilteredValue : void 0,
forceFiltered: column.filtered
});
if ("children" in column) filterStates = [].concat(_toConsumableArray$8(filterStates), _toConsumableArray$8(collectFilterStates(column.children, init, columnPos)));
});
return filterStates;
};
function injectFilter(prefixCls, dropdownPrefixCls, columns, filterStates, locale, triggerFilter, getPopupContainer, pos, rootClassName) {
return columns.map((column, index) => {
const columnPos = getColumnPos(index, pos);
const { filterOnClose = true, filterMultiple = true, filterMode, filterSearch } = column;
let newColumn = column;
if (newColumn.filters || newColumn.filterDropdown) {
const columnKey = getColumnKey(newColumn, columnPos);
const filterState = filterStates.find(({ key }) => columnKey === key);
newColumn = {
...newColumn,
title: (renderProps) => /* @__PURE__ */ import_react.createElement(FilterDropdown, {
tablePrefixCls: prefixCls,
prefixCls: `${prefixCls}-filter`,
dropdownPrefixCls,
column: newColumn,
columnKey,
filterState,
filterOnClose,
filterMultiple,
filterMode,
filterSearch,
triggerFilter,
locale,
getPopupContainer,
rootClassName
}, renderColumnTitle(column.title, renderProps))
};
}
if ("children" in newColumn) newColumn = {
...newColumn,
children: injectFilter(prefixCls, dropdownPrefixCls, newColumn.children, filterStates, locale, triggerFilter, getPopupContainer, columnPos, rootClassName)
};
return newColumn;
});
}
var generateFilterInfo = (filterStates) => {
const currentFilters = {};
filterStates.forEach(({ key, filteredKeys, column }) => {
const keyAsString = key;
const { filters, filterDropdown } = column;
if (filterDropdown) currentFilters[keyAsString] = filteredKeys || null;
else if (Array.isArray(filteredKeys)) currentFilters[keyAsString] = flattenKeys$1(filters).filter((originKey) => filteredKeys.includes(String(originKey)));
else currentFilters[keyAsString] = null;
});
return currentFilters;
};
var getFilterData = (data, filterStates, childrenColumnName) => {
return filterStates.reduce((currentData, filterState) => {
const { column: { onFilter, filters }, filteredKeys } = filterState;
if (onFilter && filteredKeys && filteredKeys.length) {
const flatKeys = flattenKeys$1(filters);
const keyMap = /* @__PURE__ */ new Map();
flatKeys.forEach((k) => {
const strKey = String(k);
if (!keyMap.has(strKey)) keyMap.set(strKey, k);
});
const realKeys = filteredKeys.map((key) => {
const strKey = String(key);
return keyMap.get(strKey) ?? key;
});
const internalFilter = (subset) => subset.reduce((acc, record) => {
const clonedRecord = { ...record };
if (clonedRecord[childrenColumnName]) clonedRecord[childrenColumnName] = getFilterData(clonedRecord[childrenColumnName], filterStates, childrenColumnName);
if (realKeys.some((realKey) => onFilter(realKey, clonedRecord))) acc.push(clonedRecord);
return acc;
}, []);
return internalFilter(currentData);
}
return currentData;
}, data);
};
var getMergedColumns = (rawMergedColumns) => rawMergedColumns.flatMap((column) => {
if ("children" in column) return [column].concat(_toConsumableArray$8(getMergedColumns(column.children || [])));
return [column];
});
var useFilter = (props) => {
const { prefixCls, dropdownPrefixCls, mergedColumns: rawMergedColumns, onFilterChange, getPopupContainer, locale: tableLocale, rootClassName } = props;
const warning = devUseWarning("Table");
const mergedColumns = import_react.useMemo(() => getMergedColumns(rawMergedColumns || []), [rawMergedColumns]);
const [filterStates, setFilterStates] = import_react.useState(() => collectFilterStates(mergedColumns, true));
const mergedFilterStates = import_react.useMemo(() => {
const collectedStates = collectFilterStates(mergedColumns, false);
if (collectedStates.length === 0) return collectedStates;
let filteredKeysIsAllNotControlled = true;
let filteredKeysIsAllControlled = true;
collectedStates.forEach(({ filteredKeys }) => {
if (filteredKeys !== void 0) filteredKeysIsAllNotControlled = false;
else filteredKeysIsAllControlled = false;
});
if (filteredKeysIsAllNotControlled) {
const keyList = (mergedColumns || []).map((column, index) => getColumnKey(column, getColumnPos(index)));
return filterStates.filter(({ key }) => keyList.includes(key)).map((item) => {
const col = mergedColumns[keyList.indexOf(item.key)];
return {
...item,
column: {
...item.column,
...col
},
forceFiltered: col.filtered
};
});
}
warning(filteredKeysIsAllControlled, "usage", "Columns should all contain `filteredValue` or not contain `filteredValue`.");
return collectedStates;
}, [mergedColumns, filterStates]);
const filters = import_react.useMemo(() => generateFilterInfo(mergedFilterStates), [mergedFilterStates]);
const triggerFilter = (filterState) => {
const newFilterStates = mergedFilterStates.filter(({ key }) => key !== filterState.key);
newFilterStates.push(filterState);
setFilterStates(newFilterStates);
onFilterChange(generateFilterInfo(newFilterStates), newFilterStates);
};
const transformColumns = (innerColumns) => injectFilter(prefixCls, dropdownPrefixCls, innerColumns, mergedFilterStates, tableLocale, triggerFilter, getPopupContainer, void 0, rootClassName);
return [
transformColumns,
mergedFilterStates,
filters
];
};
//#endregion
//#region node_modules/antd/es/table/hooks/useLazyKVMap.js
var useLazyKVMap = (data, childrenColumnName, getRowKey) => {
const mapCacheRef = import_react.useRef({});
function getRecordByKey(key) {
if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {
const kvMap = /* @__PURE__ */ new Map();
function dig(records) {
records.forEach((record, index) => {
const rowKey = getRowKey(record, index);
kvMap.set(rowKey, record);
if (isPlainObject(record) && childrenColumnName in record) dig(record[childrenColumnName] || []);
});
}
dig(data);
mapCacheRef.current = {
data,
childrenColumnName,
kvMap,
getRowKey
};
}
return mapCacheRef.current.kvMap?.get(key);
}
return [getRecordByKey];
};
function getPaginationParam(mergedPagination, pagination) {
const param = {
current: mergedPagination.current,
pageSize: mergedPagination.pageSize
};
const paginationObj = isPlainObject(pagination) ? pagination : {};
Object.keys(paginationObj).forEach((pageProp) => {
const value = mergedPagination[pageProp];
if (typeof value !== "function") param[pageProp] = value;
});
return param;
}
function usePagination(total, onChange, pagination) {
const { total: paginationTotal = 0, ...paginationObj } = isPlainObject(pagination) ? pagination : {};
const [innerPagination, setInnerPagination] = (0, import_react.useState)(() => ({
current: "defaultCurrent" in paginationObj ? paginationObj.defaultCurrent : 1,
pageSize: "defaultPageSize" in paginationObj ? paginationObj.defaultPageSize : 10
}));
const mergedPagination = mergeProps$1(innerPagination, paginationObj, { total: paginationTotal > 0 ? paginationTotal : total });
const maxPage = Math.ceil((paginationTotal || total) / mergedPagination.pageSize);
if (mergedPagination.current > maxPage) mergedPagination.current = maxPage || 1;
const refreshPagination = (current, pageSize) => {
setInnerPagination({
current: current ?? 1,
pageSize: pageSize || mergedPagination.pageSize
});
};
const onInternalChange = (current, pageSize) => {
if (pagination) pagination.onChange?.(current, pageSize);
refreshPagination(current, pageSize);
onChange(current, pageSize || mergedPagination?.pageSize);
};
if (pagination === false) return [{}, () => {}];
return [{
...mergedPagination,
onChange: onInternalChange
}, refreshPagination];
}
//#endregion
//#region node_modules/antd/es/table/hooks/useSorter.js
var ASCEND = "ascend";
var DESCEND = "descend";
var getMultiplePriority = (column) => {
if (column.sorter && typeof column.sorter === "object" && isNumber(column.sorter.multiple)) return column.sorter.multiple;
return false;
};
var getSortFunction = (sorter) => {
if (typeof sorter === "function") return sorter;
if (isPlainObject(sorter) && sorter.compare) return sorter.compare;
return false;
};
var nextSortDirection = (sortDirections, current) => {
if (!current) return sortDirections[0];
return sortDirections[sortDirections.indexOf(current) + 1];
};
var collectSortStates = (columns, init, pos) => {
let sortStates = [];
const pushState = (column, columnPos) => {
sortStates.push({
column,
key: getColumnKey(column, columnPos),
multiplePriority: getMultiplePriority(column),
sortOrder: column.sortOrder
});
};
(columns || []).forEach((column, index) => {
const columnPos = getColumnPos(index, pos);
if (column.children) {
if ("sortOrder" in column) pushState(column, columnPos);
sortStates = [].concat(_toConsumableArray$8(sortStates), _toConsumableArray$8(collectSortStates(column.children, init, columnPos)));
} else if (column.sorter) {
if ("sortOrder" in column) pushState(column, columnPos);
else if (init && column.defaultSortOrder) sortStates.push({
column,
key: getColumnKey(column, columnPos),
multiplePriority: getMultiplePriority(column),
sortOrder: column.defaultSortOrder
});
}
});
return sortStates;
};
var injectSorter = (prefixCls, columns, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, pos, a11yLocale) => {
return (columns || []).map((column, index) => {
const columnPos = getColumnPos(index, pos);
let newColumn = column;
if (newColumn.sorter) {
const sortDirections = newColumn.sortDirections || defaultSortDirections;
const showSorterTooltip = newColumn.showSorterTooltip === void 0 ? tableShowSorterTooltip : newColumn.showSorterTooltip;
const columnKey = getColumnKey(newColumn, columnPos);
const sorterState = sorterStates.find(({ key }) => key === columnKey);
const sortOrder = sorterState ? sorterState.sortOrder : null;
const nextSortOrder = nextSortDirection(sortDirections, sortOrder);
let sorter;
if (column.sortIcon) sorter = column.sortIcon({ sortOrder });
else {
const upNode = sortDirections.includes(ASCEND) && /* @__PURE__ */ import_react.createElement(RefIcon$42, { className: clsx(`${prefixCls}-column-sorter-up`, { active: sortOrder === ASCEND }) });
const downNode = sortDirections.includes(DESCEND) && /* @__PURE__ */ import_react.createElement(RefIcon$43, { className: clsx(`${prefixCls}-column-sorter-down`, { active: sortOrder === DESCEND }) });
sorter = /* @__PURE__ */ import_react.createElement("span", { className: clsx(`${prefixCls}-column-sorter`, { [`${prefixCls}-column-sorter-full`]: !!(upNode && downNode) }) }, /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-column-sorter-inner`,
"aria-hidden": "true"
}, upNode, downNode));
}
const { cancelSort, triggerAsc, triggerDesc } = tableLocale || {};
let sortTip = cancelSort;
if (nextSortOrder === DESCEND) sortTip = triggerDesc;
else if (nextSortOrder === ASCEND) sortTip = triggerAsc;
const tooltipProps = isPlainObject(showSorterTooltip) ? {
title: sortTip,
...showSorterTooltip
} : { title: sortTip };
newColumn = {
...newColumn,
className: clsx(newColumn.className, { [`${prefixCls}-column-sort`]: sortOrder }),
title: (renderProps) => {
const columnSortersClass = `${prefixCls}-column-sorters`;
const renderColumnTitleWrapper = /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-column-title` }, renderColumnTitle(column.title, renderProps));
const renderSortTitle = /* @__PURE__ */ import_react.createElement("div", { className: columnSortersClass }, renderColumnTitleWrapper, sorter);
if (showSorterTooltip) {
if (typeof showSorterTooltip !== "boolean" && showSorterTooltip?.target === "sorter-icon") return /* @__PURE__ */ import_react.createElement("div", { className: clsx(columnSortersClass, `${columnSortersClass}-tooltip-target-sorter`) }, renderColumnTitleWrapper, /* @__PURE__ */ import_react.createElement(Tooltip, { ...tooltipProps }, sorter));
return /* @__PURE__ */ import_react.createElement(Tooltip, { ...tooltipProps }, renderSortTitle);
}
return renderSortTitle;
},
onHeaderCell: (col) => {
const cell = column.onHeaderCell?.(col) || {};
const originOnClick = cell.onClick;
const originOKeyDown = cell.onKeyDown;
cell.onClick = (event) => {
triggerSorter({
column,
key: columnKey,
sortOrder: nextSortOrder,
multiplePriority: getMultiplePriority(column)
});
originOnClick?.(event);
};
cell.onKeyDown = (event) => {
if (event.keyCode === KeyCode.ENTER) {
triggerSorter({
column,
key: columnKey,
sortOrder: nextSortOrder,
multiplePriority: getMultiplePriority(column)
});
originOKeyDown?.(event);
}
};
const renderTitle = safeColumnTitle(column.title, {});
const displayTitle = renderTitle?.toString();
if (sortOrder) cell["aria-sort"] = sortOrder === "ascend" ? "ascending" : "descending";
cell["aria-description"] = a11yLocale?.sortable;
cell["aria-label"] = displayTitle || "";
cell.className = clsx(cell.className, `${prefixCls}-column-has-sorters`);
cell.tabIndex = 0;
if (column.ellipsis) cell.title = (renderTitle ?? "").toString();
return cell;
}
};
}
if ("children" in newColumn) newColumn = {
...newColumn,
children: injectSorter(prefixCls, newColumn.children, sorterStates, triggerSorter, defaultSortDirections, tableLocale, tableShowSorterTooltip, columnPos, a11yLocale)
};
return newColumn;
});
};
var stateToInfo = (sorterState) => {
const { column, sortOrder } = sorterState;
return {
column,
order: sortOrder,
field: column.dataIndex,
columnKey: column.key
};
};
var generateSorterInfo = (sorterStates) => {
const activeSorters = sorterStates.filter(({ sortOrder }) => sortOrder).map(stateToInfo);
if (activeSorters.length === 0 && sorterStates.length) return {
...stateToInfo(sorterStates[sorterStates.length - 1]),
column: void 0,
order: void 0,
field: void 0,
columnKey: void 0
};
if (activeSorters.length <= 1) return activeSorters[0] || {};
return activeSorters;
};
var getSortData = (data, sortStates, childrenColumnName) => {
const innerSorterStates = sortStates.slice().sort((a, b) => b.multiplePriority - a.multiplePriority);
const cloneData = data.slice();
const runningSorters = innerSorterStates.filter(({ column: { sorter }, sortOrder }) => getSortFunction(sorter) && sortOrder);
if (!runningSorters.length) return cloneData;
return cloneData.sort((record1, record2) => {
for (let i = 0; i < runningSorters.length; i += 1) {
const { column: { sorter }, sortOrder } = runningSorters[i];
const compareFn = getSortFunction(sorter);
if (compareFn && sortOrder) {
const compareResult = compareFn(record1, record2, sortOrder);
if (compareResult !== 0) return sortOrder === ASCEND ? compareResult : -compareResult;
}
}
return 0;
}).map((record) => {
const subRecords = record[childrenColumnName];
if (subRecords) return {
...record,
[childrenColumnName]: getSortData(subRecords, sortStates, childrenColumnName)
};
return record;
});
};
var useFilterSorter = (props) => {
const { prefixCls, mergedColumns, sortDirections, tableLocale, showSorterTooltip, onSorterChange, globalLocale } = props;
const [sortStates, setSortStates] = import_react.useState(() => collectSortStates(mergedColumns, true));
const getColumnKeys = (columns, pos) => {
const newKeys = [];
columns.forEach((item, index) => {
const columnPos = getColumnPos(index, pos);
newKeys.push(getColumnKey(item, columnPos));
if (Array.isArray(item.children)) {
const childKeys = getColumnKeys(item.children, columnPos);
newKeys.push.apply(newKeys, _toConsumableArray$8(childKeys));
}
});
return newKeys;
};
const mergedSorterStates = import_react.useMemo(() => {
let validate = true;
const collectedStates = collectSortStates(mergedColumns, false);
if (!collectedStates.length) {
const mergedColumnsKeys = getColumnKeys(mergedColumns);
return sortStates.filter(({ key }) => mergedColumnsKeys.includes(key));
}
const validateStates = [];
function patchStates(state) {
if (validate) validateStates.push(state);
else validateStates.push({
...state,
sortOrder: null
});
}
let multipleMode = null;
collectedStates.forEach((state) => {
if (multipleMode === null) {
patchStates(state);
if (state.sortOrder) if (state.multiplePriority === false) validate = false;
else multipleMode = true;
} else if (multipleMode && state.multiplePriority !== false) patchStates(state);
else {
validate = false;
patchStates(state);
}
});
return validateStates;
}, [mergedColumns, sortStates]);
const columnTitleSorterProps = import_react.useMemo(() => {
const sortColumns = mergedSorterStates.map(({ column, sortOrder }) => ({
column,
order: sortOrder
}));
return {
sortColumns,
sortColumn: sortColumns[0]?.column,
sortOrder: sortColumns[0]?.order
};
}, [mergedSorterStates]);
const triggerSorter = (sortState) => {
let newSorterStates;
if (sortState.multiplePriority === false || !mergedSorterStates.length || mergedSorterStates[0].multiplePriority === false) newSorterStates = [sortState];
else newSorterStates = [].concat(_toConsumableArray$8(mergedSorterStates.filter(({ key }) => key !== sortState.key)), [sortState]);
setSortStates(newSorterStates);
onSorterChange(generateSorterInfo(newSorterStates), newSorterStates);
};
const transformColumns = (innerColumns) => injectSorter(prefixCls, innerColumns, mergedSorterStates, triggerSorter, sortDirections, tableLocale, showSorterTooltip, void 0, globalLocale);
const getSorters = () => generateSorterInfo(mergedSorterStates);
return [
transformColumns,
mergedSorterStates,
columnTitleSorterProps,
getSorters
];
};
//#endregion
//#region node_modules/antd/es/table/hooks/useTitleColumns.js
var fillTitle = (columns, columnTitleProps) => {
return columns.map((column) => {
const cloneColumn = { ...column };
cloneColumn.title = renderColumnTitle(column.title, columnTitleProps);
if ("children" in cloneColumn) cloneColumn.children = fillTitle(cloneColumn.children, columnTitleProps);
return cloneColumn;
});
};
var useTitleColumns = (columnTitleProps) => {
return [import_react.useCallback((columns) => fillTitle(columns, columnTitleProps), [columnTitleProps])];
};
//#endregion
//#region node_modules/antd/es/table/RcTable/index.js
/**
* Same as `rc-component/table` but we modify trigger children update logic instead.
*/
var RcTable = genTable((prev, next) => {
const { _renderTimes: prevRenderTimes } = prev;
const { _renderTimes: nextRenderTimes } = next;
return prevRenderTimes !== nextRenderTimes;
});
//#endregion
//#region node_modules/antd/es/table/RcTable/VirtualTable.js
/**
* Same as `rc-component/table` but we modify trigger children update logic instead.
*/
var RcVirtualTable = genVirtualTable((prev, next) => {
const { _renderTimes: prevRenderTimes } = prev;
const { _renderTimes: nextRenderTimes } = next;
return prevRenderTimes !== nextRenderTimes;
});
//#endregion
//#region node_modules/antd/es/table/style/bordered.js
var genBorderedStyle = (token) => {
const { componentCls, lineWidth, lineType, tableBorderColor, tableHeaderBg, tablePaddingVertical, tablePaddingHorizontal, calc } = token;
const tableBorder = `${unit$1(lineWidth)} ${lineType} ${tableBorderColor}`;
const getSizeBorderStyle = (size, paddingVertical, paddingHorizontal) => ({ [`&${componentCls}-${size}`]: { [`> ${componentCls}-container`]: { [`> ${componentCls}-content, > ${componentCls}-body`]: { "> table > tbody > tr > th, > table > tbody > tr > td": { [`> ${componentCls}-expanded-row-fixed`]: { margin: `${unit$1(calc(paddingVertical).mul(-1).equal())}
${unit$1(calc(calc(paddingHorizontal).add(lineWidth)).mul(-1).equal())}` } } } } } });
return { [`${componentCls}-wrapper`]: {
[`${componentCls}${componentCls}-bordered`]: {
[`> ${componentCls}-title`]: {
border: tableBorder,
borderBottom: 0
},
[`> ${componentCls}-container`]: {
borderInlineStart: tableBorder,
borderTop: tableBorder,
[`> ${componentCls}-content, > ${componentCls}-header, > ${componentCls}-body, > ${componentCls}-summary`]: { "> table": {
"> thead > tr > th, > thead > tr > td, > tbody > tr > th, > tbody > tr > td, > tfoot > tr > th, > tfoot > tr > td": { borderInlineEnd: tableBorder },
"> thead": {
"> tr:not(:last-child) > th": { borderBottom: tableBorder },
"> tr > th::before": { backgroundColor: "transparent !important" }
},
"> thead > tr, > tbody > tr, > tfoot > tr": { [`> ${componentCls}-cell-fix-right-first::after`]: { borderInlineEnd: tableBorder } },
"> tbody > tr > th, > tbody > tr > td": { [`> ${componentCls}-expanded-row-fixed`]: {
margin: `${unit$1(calc(tablePaddingVertical).mul(-1).equal())} ${unit$1(calc(calc(tablePaddingHorizontal).add(lineWidth)).mul(-1).equal())}`,
"&::after": {
position: "absolute",
top: 0,
insetInlineEnd: lineWidth,
bottom: 0,
borderInlineEnd: tableBorder,
content: "\"\""
}
} }
} }
},
[`&${componentCls}-scroll-horizontal`]: { [`> ${componentCls}-container > ${componentCls}-body`]: { "> table > tbody": { [`
> tr${componentCls}-expanded-row,
> tr${componentCls}-placeholder
`]: { "> th, > td": { borderInlineEnd: 0 } } } } },
...getSizeBorderStyle("medium", token.tablePaddingVerticalMiddle, token.tablePaddingHorizontalMiddle),
...getSizeBorderStyle("small", token.tablePaddingVerticalSmall, token.tablePaddingHorizontalSmall),
[`> ${componentCls}-footer`]: {
border: tableBorder,
borderTop: 0
}
},
[`${componentCls}-cell`]: {
[`${componentCls}-container:first-child`]: { borderTop: 0 },
"&-scrollbar:not([rowspan])": { boxShadow: `0 ${unit$1(lineWidth)} 0 ${unit$1(lineWidth)} ${tableHeaderBg}` }
},
[`${componentCls}-bordered ${componentCls}-cell-scrollbar`]: { borderInlineEnd: tableBorder }
} };
};
//#endregion
//#region node_modules/antd/es/table/style/ellipsis.js
var genEllipsisStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-wrapper`]: { [`${componentCls}-cell-ellipsis`]: {
...textEllipsis,
wordBreak: "keep-all",
[`
&${componentCls}-cell-fix-start-shadow,
&${componentCls}-cell-fix-end-shadow
`]: {
overflow: "visible",
[`${componentCls}-cell-content`]: {
...textEllipsis,
display: "block"
}
},
[`${componentCls}-column-title`]: {
...textEllipsis,
wordBreak: "keep-all"
}
} } };
};
//#endregion
//#region node_modules/antd/es/table/style/empty.js
var genEmptyStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-wrapper`]: { [`${componentCls}-tbody > tr${componentCls}-placeholder`]: {
textAlign: "center",
color: token.colorTextDisabled,
"&:hover > th, &:hover > td": { background: token.colorBgContainer }
} } };
};
//#endregion
//#region node_modules/antd/es/table/style/expand.js
var genExpandStyle = (token) => {
const { componentCls, antCls, motionDurationSlow, lineWidth, paddingXS, lineType, tableBorderColor, tableExpandIconBg, tableExpandColumnWidth, borderRadius, tablePaddingVertical, tablePaddingHorizontal, tableExpandedRowBg, paddingXXS, expandIconMarginTop, expandIconSize, expandIconHalfInner, expandIconScale, calc } = token;
const tableBorder = `${unit$1(lineWidth)} ${lineType} ${tableBorderColor}`;
const expandIconLineOffset = calc(paddingXXS).sub(lineWidth).equal();
return { [`${componentCls}-wrapper`]: {
[`${componentCls}-expand-icon-col`]: { width: tableExpandColumnWidth },
[`${componentCls}-row-expand-icon-cell`]: {
textAlign: "center",
[`${componentCls}-row-expand-icon`]: {
display: "inline-flex",
float: "none",
verticalAlign: "sub"
}
},
[`${componentCls}-row-indent`]: {
height: 1,
float: "left"
},
[`${componentCls}-row-expand-icon`]: {
...operationUnit(token),
position: "relative",
float: "left",
width: expandIconSize,
height: expandIconSize,
color: "inherit",
lineHeight: unit$1(expandIconSize),
background: tableExpandIconBg,
border: tableBorder,
borderRadius,
transform: `scale(${expandIconScale})`,
"&:focus, &:hover, &:active": { borderColor: "currentcolor" },
"&::before, &::after": {
position: "absolute",
background: "currentcolor",
transition: `transform ${motionDurationSlow} ease-out`,
content: "\"\""
},
"&::before": {
top: expandIconHalfInner,
insetInlineEnd: expandIconLineOffset,
insetInlineStart: expandIconLineOffset,
height: lineWidth
},
"&::after": {
top: expandIconLineOffset,
bottom: expandIconLineOffset,
insetInlineStart: expandIconHalfInner,
width: lineWidth,
transform: "rotate(90deg)"
},
"&-collapsed::before": { transform: "rotate(-180deg)" },
"&-collapsed::after": { transform: "rotate(0deg)" },
"&-spaced": {
"&::before, &::after": {
display: "none",
content: "none"
},
background: "transparent",
border: 0,
visibility: "hidden"
}
},
[`${componentCls}-row-indent + ${componentCls}-row-expand-icon`]: {
marginTop: expandIconMarginTop,
marginInlineEnd: paddingXS
},
[`tr${componentCls}-expanded-row`]: {
"&, &:hover": { "> th, > td": { background: tableExpandedRowBg } },
[`${antCls}-descriptions-view`]: {
display: "flex",
table: {
flex: "auto",
width: "100%"
}
}
},
[`${componentCls}-expanded-row-fixed`]: {
position: "relative",
margin: `${unit$1(calc(tablePaddingVertical).mul(-1).equal())} ${unit$1(calc(tablePaddingHorizontal).mul(-1).equal())}`,
padding: `${unit$1(tablePaddingVertical)} ${unit$1(tablePaddingHorizontal)}`
}
} };
};
//#endregion
//#region node_modules/antd/es/table/style/filter.js
var genFilterStyle = (token) => {
const { componentCls, antCls, iconCls, tableFilterDropdownWidth, tableFilterDropdownSearchWidth, paddingXXS, paddingXS, colorText, lineWidth, lineType, tableBorderColor, headerIconColor, fontSizeSM, tablePaddingHorizontal, borderRadius, motionDurationSlow, colorIcon, colorPrimary, tableHeaderFilterActiveBg, colorTextDisabled, tableFilterDropdownBg, tableFilterDropdownHeight, controlItemBgHover, controlItemBgActive, boxShadowSecondary, filterDropdownMenuBg, calc } = token;
const dropdownPrefixCls = `${antCls}-dropdown`;
const tableFilterDropdownPrefixCls = `${componentCls}-filter-dropdown`;
const treePrefixCls = `${antCls}-tree`;
const tableBorder = `${unit$1(lineWidth)} ${lineType} ${tableBorderColor}`;
return [
{ [`${componentCls}-wrapper`]: {
[`${componentCls}-filter-column`]: {
display: "flex",
justifyContent: "space-between"
},
[`${componentCls}-filter-trigger`]: {
position: "relative",
display: "flex",
alignItems: "center",
marginBlock: calc(paddingXXS).mul(-1).equal(),
marginInline: `${unit$1(paddingXXS)} ${unit$1(calc(tablePaddingHorizontal).div(2).mul(-1).equal())}`,
padding: `0 ${unit$1(paddingXXS)}`,
color: headerIconColor,
fontSize: fontSizeSM,
borderRadius,
cursor: "pointer",
transition: `all ${motionDurationSlow}`,
"&:hover": {
color: colorIcon,
background: tableHeaderFilterActiveBg
},
"&.active": { color: colorPrimary }
}
} },
{ [`${antCls}-dropdown`]: { [tableFilterDropdownPrefixCls]: {
...resetComponent(token),
minWidth: tableFilterDropdownWidth,
backgroundColor: tableFilterDropdownBg,
borderRadius,
boxShadow: boxShadowSecondary,
overflow: "hidden",
[`${dropdownPrefixCls}-menu`]: {
maxHeight: tableFilterDropdownHeight,
overflowX: "hidden",
border: 0,
boxShadow: "none",
borderRadius: "unset",
backgroundColor: filterDropdownMenuBg,
"&:empty::after": {
display: "block",
padding: `${unit$1(paddingXS)} 0`,
color: colorTextDisabled,
fontSize: fontSizeSM,
textAlign: "center",
content: "\"Not Found\""
}
},
[`${tableFilterDropdownPrefixCls}-tree`]: {
paddingBlock: `${unit$1(paddingXS)} 0`,
paddingInline: paddingXS,
[treePrefixCls]: { padding: 0 },
[`${treePrefixCls}-treenode ${treePrefixCls}-node-content-wrapper:hover`]: { backgroundColor: controlItemBgHover },
[`${treePrefixCls}-treenode-checkbox-checked ${treePrefixCls}-node-content-wrapper`]: { "&, &:hover": { backgroundColor: controlItemBgActive } }
},
[`${tableFilterDropdownPrefixCls}-search`]: {
padding: paddingXS,
borderBottom: tableBorder,
"&-input": {
input: { minWidth: tableFilterDropdownSearchWidth },
[iconCls]: { color: colorTextDisabled }
}
},
[`${tableFilterDropdownPrefixCls}-checkall`]: {
width: "100%",
marginBottom: paddingXXS,
marginInlineStart: paddingXXS
},
[`${tableFilterDropdownPrefixCls}-btns`]: {
display: "flex",
justifyContent: "space-between",
padding: `${unit$1(calc(paddingXS).sub(lineWidth).equal())} ${unit$1(paddingXS)}`,
overflow: "hidden",
borderTop: tableBorder
}
} } },
{ [`${antCls}-dropdown ${tableFilterDropdownPrefixCls}, ${tableFilterDropdownPrefixCls}-submenu`]: {
[`${antCls}-checkbox-wrapper + span`]: {
paddingInlineStart: paddingXS,
color: colorText
},
"> ul": {
maxHeight: "calc(100vh - 130px)",
overflowX: "hidden",
overflowY: "auto"
}
} }
];
};
//#endregion
//#region node_modules/antd/es/table/style/fixed.js
function getShadowStyle({ colorSplit: shadowColor }) {
return [{ boxShadow: `inset 10px 0 8px -8px ${shadowColor}` }, { boxShadow: `inset -10px 0 8px -8px ${shadowColor}` }];
}
var genFixedStyle = (token) => {
const { componentCls, lineWidth, motionDurationSlow, zIndexTableFixed, tableBg, calc } = token;
const cellCls = `${componentCls}-cell`;
const fixCellCls = `${cellCls}-fix`;
const sharedShadowStyle = {
position: "absolute",
top: 0,
bottom: calc(lineWidth).mul(-1).equal(),
width: 30,
transition: `box-shadow ${motionDurationSlow}`,
content: "\"\"",
pointerEvents: "none"
};
const [leftShadowStyle, rightShadowStyle] = getShadowStyle(token);
return { [`${componentCls}-wrapper`]: {
[`${cellCls}${fixCellCls}`]: { position: "sticky" },
[fixCellCls]: {
zIndex: `calc(var(--z-offset-reverse) + ${zIndexTableFixed})`,
background: tableBg,
"&:after": sharedShadowStyle,
"&-start:after": { insetInlineStart: "100%" },
"&-end:after": { insetInlineEnd: "100%" },
"&-start-shadow-show:after": leftShadowStyle,
"&-end-shadow-show:after": rightShadowStyle
},
[`${componentCls}-container`]: {
position: "relative",
"&:before, &:after": {
...sharedShadowStyle,
zIndex: `calc(var(--columns-count) * 2 + ${zIndexTableFixed} + 1)`
},
"&:before": { insetInlineStart: 0 },
"&:after": { insetInlineEnd: 0 }
},
[`${componentCls}-has-fix-start ${componentCls}-container:before`]: { display: "none" },
[`${componentCls}-has-fix-end ${componentCls}-container:after`]: { display: "none" },
[`${componentCls}-fix-start-shadow-show ${componentCls}-container:before`]: leftShadowStyle,
[`${componentCls}-fix-end-shadow-show ${componentCls}-container:after`]: rightShadowStyle
} };
};
//#endregion
//#region node_modules/antd/es/table/style/pagination.js
var genPaginationStyle = (token) => {
const { componentCls, antCls, margin } = token;
return { [`${componentCls}-wrapper`]: {
[`${componentCls}-pagination${antCls}-pagination`]: { margin: `${unit$1(margin)} 0` },
[`${componentCls}-pagination`]: {
display: "flex",
flexWrap: "wrap",
rowGap: token.paddingXS,
"> *": { flex: "none" },
"&-start": { justifyContent: "flex-start" },
"&-center": { justifyContent: "center" },
"&-end": { justifyContent: "flex-end" }
}
} };
};
//#endregion
//#region node_modules/antd/es/table/style/radius.js
var genRadiusStyle = (token) => {
const { componentCls, tableRadius } = token;
return { [`${componentCls}-wrapper`]: { [componentCls]: {
[`${componentCls}-title, ${componentCls}-header`]: { borderRadius: `${unit$1(tableRadius)} ${unit$1(tableRadius)} 0 0` },
[`${componentCls}-title + ${componentCls}-container`]: {
borderStartStartRadius: 0,
borderStartEndRadius: 0,
[`${componentCls}-header, table`]: { borderRadius: 0 },
"table > thead > tr:first-child": { "th:first-child, th:last-child, td:first-child, td:last-child": { borderRadius: 0 } }
},
"&-container": {
borderStartStartRadius: tableRadius,
borderStartEndRadius: tableRadius,
"&::before": { borderStartStartRadius: tableRadius },
"&::after": { borderStartEndRadius: tableRadius },
[`> ${componentCls}-content`]: {
borderStartStartRadius: tableRadius,
borderStartEndRadius: tableRadius
},
"table > thead > tr:first-child": {
"> *:first-child": { borderStartStartRadius: tableRadius },
"> *:last-child": { borderStartEndRadius: tableRadius }
}
},
"&-footer": { borderRadius: `0 0 ${unit$1(tableRadius)} ${unit$1(tableRadius)}` }
} } };
};
//#endregion
//#region node_modules/antd/es/table/style/rtl.js
var genStyle = (token) => {
const { componentCls } = token;
const [leftShadowStyle, rightShadowStyle] = getShadowStyle(token);
return { [`${componentCls}-wrapper-rtl`]: {
direction: "rtl",
table: { direction: "rtl" },
[`${componentCls}-row-expand-icon`]: {
float: "right",
"&::after": { transform: "rotate(-90deg)" },
"&-collapsed::before": { transform: "rotate(180deg)" },
"&-collapsed::after": { transform: "rotate(0deg)" }
},
[`${componentCls}-cell-fix`]: {
"&-start-shadow-show:after": rightShadowStyle,
"&-end-shadow-show:after": leftShadowStyle
},
[`${componentCls}-container`]: { [`${componentCls}-row-indent`]: { float: "right" } },
[`${componentCls}-fix-start-shadow-show ${componentCls}-container:before`]: rightShadowStyle,
[`${componentCls}-fix-end-shadow-show ${componentCls}-container:after`]: leftShadowStyle
} };
};
//#endregion
//#region node_modules/antd/es/table/style/selection.js
var genSelectionStyle = (token) => {
const { componentCls, antCls, iconCls, fontSizeIcon, padding, paddingXS, headerIconColor, headerIconHoverColor, tableSelectionColumnWidth, tableSelectedRowBg, tableSelectedRowHoverBg, tableRowHoverBg, tablePaddingHorizontal, calc } = token;
return { [`${componentCls}-wrapper`]: {
[`${componentCls}-selection-col`]: {
width: tableSelectionColumnWidth,
[`&${componentCls}-selection-col-with-dropdown`]: { width: calc(tableSelectionColumnWidth).add(fontSizeIcon).add(calc(padding).div(4)).equal() }
},
[`${componentCls}-bordered ${componentCls}-selection-col`]: {
width: calc(tableSelectionColumnWidth).add(calc(paddingXS).mul(2)).equal(),
[`&${componentCls}-selection-col-with-dropdown`]: { width: calc(tableSelectionColumnWidth).add(fontSizeIcon).add(calc(padding).div(4)).add(calc(paddingXS).mul(2)).equal() }
},
[`
table tr th${componentCls}-selection-column,
table tr td${componentCls}-selection-column,
${componentCls}-selection-column
`]: {
paddingInlineEnd: token.paddingXS,
paddingInlineStart: token.paddingXS,
textAlign: "center",
[`${antCls}-radio-wrapper`]: { marginInlineEnd: 0 }
},
[`table tr th${componentCls}-selection-column${componentCls}-cell-fix-left`]: { zIndex: calc(token.zIndexTableFixed).add(1).equal({ unit: false }) },
[`table tr th${componentCls}-selection-column::after`]: { backgroundColor: "transparent !important" },
[`${componentCls}-selection`]: {
position: "relative",
display: "inline-flex",
flexDirection: "column"
},
[`${componentCls}-selection-extra`]: {
position: "absolute",
top: 0,
zIndex: 1,
cursor: "pointer",
transition: `all ${token.motionDurationSlow}`,
marginInlineStart: "100%",
paddingInlineStart: unit$1(calc(tablePaddingHorizontal).div(4).equal()),
[iconCls]: {
color: headerIconColor,
fontSize: fontSizeIcon,
verticalAlign: "baseline",
"&:hover": { color: headerIconHoverColor }
}
},
[`${componentCls}-tbody`]: { [`${componentCls}-row`]: {
[`&${componentCls}-row-selected`]: { [`> ${componentCls}-cell`]: {
background: tableSelectedRowBg,
"&-row-hover": { background: tableSelectedRowHoverBg }
} },
[`> ${componentCls}-cell-row-hover`]: { background: tableRowHoverBg }
} }
} };
};
//#endregion
//#region node_modules/antd/es/table/style/size.js
var genSizeStyle = (token) => {
const { componentCls, tableExpandColumnWidth, calc } = token;
const getSizeStyle = (size, paddingVertical, paddingHorizontal, fontSize) => ({ [`${componentCls}${componentCls}-${size}`]: {
fontSize,
[`
${componentCls}-title,
${componentCls}-footer,
${componentCls}-cell,
${componentCls}-thead > tr > th,
${componentCls}-tbody > tr > th,
${componentCls}-tbody > tr > td,
tfoot > tr > th,
tfoot > tr > td
`]: { padding: `${unit$1(paddingVertical)} ${unit$1(paddingHorizontal)}` },
[`${componentCls}-filter-trigger`]: { marginInlineEnd: unit$1(calc(paddingHorizontal).div(2).mul(-1).equal()) },
[`${componentCls}-expanded-row-fixed`]: { margin: `${unit$1(calc(paddingVertical).mul(-1).equal())} ${unit$1(calc(paddingHorizontal).mul(-1).equal())}` },
[`${componentCls}-tbody`]: { [`${componentCls}-wrapper:only-child ${componentCls}`]: {
marginBlock: unit$1(calc(paddingVertical).mul(-1).equal()),
marginInline: `${unit$1(calc(tableExpandColumnWidth).sub(paddingHorizontal).equal())} ${unit$1(calc(paddingHorizontal).mul(-1).equal())}`
} },
[`${componentCls}-selection-extra`]: { paddingInlineStart: unit$1(calc(paddingHorizontal).div(4).equal()) }
} });
return { [`${componentCls}-wrapper`]: {
...getSizeStyle("medium", token.tablePaddingVerticalMiddle, token.tablePaddingHorizontalMiddle, token.tableFontSizeMiddle),
...getSizeStyle("small", token.tablePaddingVerticalSmall, token.tablePaddingHorizontalSmall, token.tableFontSizeSmall)
} };
};
//#endregion
//#region node_modules/antd/es/table/style/sorter.js
var genSorterStyle = (token) => {
const { componentCls, marginXXS, fontSizeIcon, headerIconColor, headerIconHoverColor } = token;
return { [`${componentCls}-wrapper`]: {
[`${componentCls}-thead th${componentCls}-column-has-sorters`]: {
outline: "none",
cursor: "pointer",
transition: `all ${token.motionDurationSlow}, left 0s`,
"&:hover": {
background: token.tableHeaderSortHoverBg,
"&::before": { backgroundColor: "transparent !important" }
},
"&:focus-visible": { color: token.colorPrimary },
[`
&${componentCls}-cell-fix-left:hover,
&${componentCls}-cell-fix-right:hover
`]: { background: token.tableFixedHeaderSortActiveBg }
},
[`${componentCls}-thead th${componentCls}-column-sort`]: {
background: token.tableHeaderSortBg,
"&::before": { backgroundColor: "transparent !important" }
},
[`td${componentCls}-column-sort`]: { background: token.tableBodySortBg },
[`${componentCls}-column-title`]: {
position: "relative",
zIndex: 1,
flex: 1,
minWidth: 0
},
[`${componentCls}-column-sorters`]: {
display: "flex",
flex: "auto",
alignItems: "center",
justifyContent: "space-between",
"&::after": {
position: "absolute",
inset: 0,
width: "100%",
height: "100%",
content: "\"\""
}
},
[`${componentCls}-column-sorters-tooltip-target-sorter`]: { "&::after": { content: "none" } },
[`${componentCls}-column-sorter`]: {
marginInlineStart: marginXXS,
color: headerIconColor,
fontSize: 0,
transition: `color ${token.motionDurationSlow}`,
"&-inner": {
display: "inline-flex",
flexDirection: "column",
alignItems: "center"
},
"&-up, &-down": {
fontSize: fontSizeIcon,
"&.active": { color: token.colorPrimary }
},
[`${componentCls}-column-sorter-up + ${componentCls}-column-sorter-down`]: { marginTop: "-0.3em" }
},
[`${componentCls}-column-sorters:hover ${componentCls}-column-sorter`]: { color: headerIconHoverColor }
} };
};
//#endregion
//#region node_modules/antd/es/table/style/sticky.js
var genStickyStyle = (token) => {
const { componentCls, opacityLoading, tableScrollThumbBg, tableScrollThumbBgHover, tableScrollThumbSize, tableScrollBg, stickyScrollBarBorderRadius, lineWidth, lineType, tableBorderColor, zIndexTableFixed } = token;
const tableBorder = `${unit$1(lineWidth)} ${lineType} ${tableBorderColor}`;
return { [`${componentCls}-wrapper`]: { [`${componentCls}-sticky`]: {
"&-holder": {
position: "sticky",
zIndex: `calc(var(--columns-count) * 2 + ${zIndexTableFixed} + 1)`,
background: token.colorBgContainer
},
"&-scroll": {
position: "sticky",
bottom: 0,
height: `${unit$1(tableScrollThumbSize)} !important`,
zIndex: `calc(var(--columns-count) * 2 + ${zIndexTableFixed} + 1)`,
display: "flex",
alignItems: "center",
background: tableScrollBg,
borderTop: tableBorder,
opacity: opacityLoading,
"&:hover": { transformOrigin: "center bottom" },
"&-bar": {
height: tableScrollThumbSize,
backgroundColor: tableScrollThumbBg,
borderRadius: stickyScrollBarBorderRadius,
transition: `all ${token.motionDurationSlow}, transform 0s`,
position: "absolute",
bottom: 0,
"&:hover, &-active": { backgroundColor: tableScrollThumbBgHover }
}
}
} } };
};
//#endregion
//#region node_modules/antd/es/table/style/summary.js
var genSummaryStyle = (token) => {
const { componentCls, lineWidth, tableBorderColor, calc } = token;
const tableBorder = `${unit$1(lineWidth)} ${token.lineType} ${tableBorderColor}`;
return { [`${componentCls}-wrapper`]: {
[`${componentCls}-summary`]: {
position: "relative",
zIndex: token.zIndexTableFixed,
background: token.tableBg,
"> tr": { "> th, > td": { borderBottom: tableBorder } }
},
[`div${componentCls}-summary`]: { boxShadow: `0 ${unit$1(calc(lineWidth).mul(-1).equal())} 0 ${tableBorderColor}` }
} };
};
//#endregion
//#region node_modules/antd/es/table/style/virtual.js
var genVirtualStyle = (token) => {
const { componentCls, motionDurationMid, lineWidth, lineType, tableBorderColor, calc } = token;
const tableBorder = `${unit$1(lineWidth)} ${lineType} ${tableBorderColor}`;
const rowCellCls = `${componentCls}-expanded-row-cell`;
return { [`${componentCls}-wrapper`]: {
[`${componentCls}-tbody-virtual`]: {
[`${componentCls}-tbody-virtual-holder-inner`]: { [`
& > ${componentCls}-row,
& > div:not(${componentCls}-row) > ${componentCls}-row
`]: {
display: "flex",
boxSizing: "border-box",
width: "100%"
} },
[`${componentCls}-cell`]: {
borderBottom: tableBorder,
transition: `background-color ${motionDurationMid}`
},
[`${componentCls}-expanded-row`]: { [`${rowCellCls}${rowCellCls}-fixed`]: {
position: "sticky",
insetInlineStart: 0,
overflow: "hidden",
width: `calc(var(--virtual-width) - ${unit$1(lineWidth)})`,
borderInlineEnd: "none"
} }
},
[`${componentCls}-bordered`]: {
[`${componentCls}-tbody-virtual`]: {
"&:after": {
content: "\"\"",
insetInline: 0,
bottom: 0,
borderBottom: tableBorder,
position: "absolute"
},
[`${componentCls}-cell`]: {
borderInlineEnd: tableBorder,
[`&${componentCls}-cell-fix-right-first:before`]: {
content: "\"\"",
position: "absolute",
insetBlock: 0,
insetInlineStart: calc(lineWidth).mul(-1).equal(),
borderInlineStart: tableBorder
}
}
},
[`&${componentCls}-virtual`]: { [`${componentCls}-placeholder ${componentCls}-cell`]: {
borderInlineEnd: tableBorder,
borderBottom: tableBorder
} }
}
} };
};
//#endregion
//#region node_modules/antd/es/table/style/index.js
var genTableStyle = (token) => {
const { componentCls, fontWeightStrong, tablePaddingVertical, tablePaddingHorizontal, tableExpandColumnWidth, lineWidth, lineType, tableBorderColor, tableFontSize, tableBg, tableRadius, tableHeaderTextColor, motionDurationMid, tableHeaderBg, tableHeaderCellSplitColor, tableFooterTextColor, tableFooterBg, calc } = token;
const tableBorder = `${unit$1(lineWidth)} ${lineType} ${tableBorderColor}`;
return { [`${componentCls}-wrapper`]: {
clear: "both",
maxWidth: "100%",
["--rc-virtual-list-scrollbar-bg"]: token.tableScrollBg,
...clearFix(),
[componentCls]: {
...resetComponent(token),
fontSize: tableFontSize,
background: tableBg,
borderRadius: `${unit$1(tableRadius)} ${unit$1(tableRadius)} 0 0`,
scrollbarColor: `${token.tableScrollThumbBg} ${token.tableScrollBg}`
},
table: {
width: "100%",
textAlign: "start",
borderRadius: `${unit$1(tableRadius)} ${unit$1(tableRadius)} 0 0`,
borderCollapse: "separate",
borderSpacing: 0
},
[`
${componentCls}-cell,
${componentCls}-thead > tr > th,
${componentCls}-tbody > tr > th,
${componentCls}-tbody > tr > td,
tfoot > tr > th,
tfoot > tr > td
`]: {
position: "relative",
padding: `${unit$1(tablePaddingVertical)} ${unit$1(tablePaddingHorizontal)}`,
overflowWrap: "break-word"
},
[`${componentCls}-title`]: { padding: `${unit$1(tablePaddingVertical)} ${unit$1(tablePaddingHorizontal)}` },
[`${componentCls}-thead`]: {
"> tr > th, > tr > td": {
position: "relative",
color: tableHeaderTextColor,
fontWeight: fontWeightStrong,
textAlign: "start",
background: tableHeaderBg,
borderBottom: tableBorder,
transition: `background-color ${motionDurationMid} ease`,
"&[colspan]:not([colspan='1'])": { textAlign: "center" },
[`&:not(:last-child):not(${componentCls}-selection-column):not(${componentCls}-row-expand-icon-cell):not([colspan])::before`]: {
position: "absolute",
top: "50%",
insetInlineEnd: 0,
width: 1,
height: "1.6em",
backgroundColor: tableHeaderCellSplitColor,
transform: "translateY(-50%)",
transition: `background-color ${motionDurationMid}`,
content: "\"\""
}
},
"> tr:not(:last-child) > th[colspan]": { borderBottom: 0 }
},
[`${componentCls}-tbody`]: { "> tr": {
"> th, > td": {
borderBottom: tableBorder,
transition: [`background-color`, `border-color`].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
[`
> ${componentCls}-wrapper:only-child,
> ${componentCls}-expanded-row-fixed > ${componentCls}-wrapper:only-child
`]: { [componentCls]: {
marginBlock: unit$1(calc(tablePaddingVertical).mul(-1).equal()),
marginInline: `${unit$1(calc(tableExpandColumnWidth).sub(tablePaddingHorizontal).equal())}
${unit$1(calc(tablePaddingHorizontal).mul(-1).equal())}`,
[`${componentCls}-tbody > tr:last-child > td`]: {
borderBottomWidth: 0,
"&:first-child, &:last-child": { borderRadius: 0 }
}
} }
},
"> th": {
position: "relative",
color: tableHeaderTextColor,
fontWeight: fontWeightStrong,
textAlign: "start",
background: tableHeaderBg,
borderBottom: tableBorder,
transition: `background-color ${motionDurationMid} ease`
},
[`& > ${componentCls}-measure-cell`]: {
paddingBlock: `0 !important`,
borderBlock: `0 !important`,
[`${componentCls}-measure-cell-content`]: {
height: 0,
overflow: "hidden",
pointerEvents: "none"
}
}
} },
[`${componentCls}-footer`]: {
padding: `${unit$1(tablePaddingVertical)} ${unit$1(tablePaddingHorizontal)}`,
color: tableFooterTextColor,
background: tableFooterBg
}
} };
};
var prepareComponentToken$6 = (token) => {
const { colorFillAlter, colorBgContainer, colorTextHeading, colorFillSecondary, colorFillContent, controlItemBgActive, controlItemBgActiveHover, padding, paddingSM, paddingXS, colorBorderSecondary, borderRadiusLG, controlHeight, colorTextPlaceholder, fontSize, fontSizeSM, lineHeight, lineWidth, colorIcon, colorIconHover, opacityLoading, controlInteractiveSize } = token;
const colorFillSecondarySolid = new FastColor(colorFillSecondary).onBackground(colorBgContainer).toHexString();
const colorFillContentSolid = new FastColor(colorFillContent).onBackground(colorBgContainer).toHexString();
const colorFillAlterSolid = new FastColor(colorFillAlter).onBackground(colorBgContainer).toHexString();
const baseColorAction = new FastColor(colorIcon);
const baseColorActionHover = new FastColor(colorIconHover);
const expandIconHalfInner = controlInteractiveSize / 2 - lineWidth;
const expandIconSize = expandIconHalfInner * 2 + lineWidth * 3;
return {
headerBg: colorFillAlterSolid,
headerColor: colorTextHeading,
headerSortActiveBg: colorFillSecondarySolid,
headerSortHoverBg: colorFillContentSolid,
bodySortBg: colorFillAlterSolid,
rowHoverBg: colorFillAlterSolid,
rowSelectedBg: controlItemBgActive,
rowSelectedHoverBg: controlItemBgActiveHover,
rowExpandedBg: colorFillAlter,
cellPaddingBlock: padding,
cellPaddingInline: padding,
cellPaddingBlockMD: paddingSM,
cellPaddingInlineMD: paddingXS,
cellPaddingBlockSM: paddingXS,
cellPaddingInlineSM: paddingXS,
borderColor: colorBorderSecondary,
headerBorderRadius: borderRadiusLG,
footerBg: colorFillAlterSolid,
footerColor: colorTextHeading,
cellFontSize: fontSize,
cellFontSizeMD: fontSize,
cellFontSizeSM: fontSize,
headerSplitColor: colorBorderSecondary,
fixedHeaderSortActiveBg: colorFillSecondarySolid,
headerFilterHoverBg: colorFillContent,
filterDropdownMenuBg: colorBgContainer,
filterDropdownBg: colorBgContainer,
expandIconBg: colorBgContainer,
selectionColumnWidth: controlHeight,
stickyScrollBarBg: colorTextPlaceholder,
stickyScrollBarBorderRadius: 100,
expandIconMarginTop: (fontSize * lineHeight - lineWidth * 3) / 2 - Math.ceil((fontSizeSM * 1.4 - lineWidth * 3) / 2),
headerIconColor: baseColorAction.clone().setA(baseColorAction.a * opacityLoading).toRgbString(),
headerIconHoverColor: baseColorActionHover.clone().setA(baseColorActionHover.a * opacityLoading).toRgbString(),
expandIconHalfInner,
expandIconSize,
expandIconScale: controlInteractiveSize / expandIconSize
};
};
var zIndexTableFixed = 2;
var style_default$6 = genStyleHooks("Table", (token) => {
const { colorTextHeading, colorSplit, colorBgContainer, controlInteractiveSize: checkboxSize, headerBg, headerColor, headerSortActiveBg, headerSortHoverBg, bodySortBg, rowHoverBg, rowSelectedBg, rowSelectedHoverBg, rowExpandedBg, cellPaddingBlock, cellPaddingInline, cellPaddingBlockMD, cellPaddingInlineMD, cellPaddingBlockSM, cellPaddingInlineSM, borderColor, footerBg, footerColor, headerBorderRadius, cellFontSize, cellFontSizeMD, cellFontSizeSM, headerSplitColor, fixedHeaderSortActiveBg, headerFilterHoverBg, filterDropdownBg, expandIconBg, selectionColumnWidth, stickyScrollBarBg, calc } = token;
const tableToken = merge(token, {
tableFontSize: cellFontSize,
tableBg: colorBgContainer,
tableRadius: headerBorderRadius,
tablePaddingVertical: cellPaddingBlock,
tablePaddingHorizontal: cellPaddingInline,
tablePaddingVerticalMiddle: cellPaddingBlockMD,
tablePaddingHorizontalMiddle: cellPaddingInlineMD,
tablePaddingVerticalSmall: cellPaddingBlockSM,
tablePaddingHorizontalSmall: cellPaddingInlineSM,
tableBorderColor: borderColor,
tableHeaderTextColor: headerColor,
tableHeaderBg: headerBg,
tableFooterTextColor: footerColor,
tableFooterBg: footerBg,
tableHeaderCellSplitColor: headerSplitColor,
tableHeaderSortBg: headerSortActiveBg,
tableHeaderSortHoverBg: headerSortHoverBg,
tableBodySortBg: bodySortBg,
tableFixedHeaderSortActiveBg: fixedHeaderSortActiveBg,
tableHeaderFilterActiveBg: headerFilterHoverBg,
tableFilterDropdownBg: filterDropdownBg,
tableRowHoverBg: rowHoverBg,
tableSelectedRowBg: rowSelectedBg,
tableSelectedRowHoverBg: rowSelectedHoverBg,
zIndexTableFixed,
tableFontSizeMiddle: cellFontSizeMD,
tableFontSizeSmall: cellFontSizeSM,
tableSelectionColumnWidth: selectionColumnWidth,
tableExpandIconBg: expandIconBg,
tableExpandColumnWidth: calc(checkboxSize).add(calc(token.padding).mul(2)).equal(),
tableExpandedRowBg: rowExpandedBg,
tableFilterDropdownWidth: 120,
tableFilterDropdownHeight: 264,
tableFilterDropdownSearchWidth: 140,
tableScrollThumbSize: 8,
tableScrollThumbBg: stickyScrollBarBg,
tableScrollThumbBgHover: colorTextHeading,
tableScrollBg: colorSplit
});
return [
genTableStyle(tableToken),
genPaginationStyle(tableToken),
genSummaryStyle(tableToken),
genSorterStyle(tableToken),
genFilterStyle(tableToken),
genBorderedStyle(tableToken),
genRadiusStyle(tableToken),
genExpandStyle(tableToken),
genSummaryStyle(tableToken),
genEmptyStyle(tableToken),
genSelectionStyle(tableToken),
genFixedStyle(tableToken),
genStickyStyle(tableToken),
genEllipsisStyle(tableToken),
genSizeStyle(tableToken),
genStyle(tableToken),
genVirtualStyle(tableToken)
];
}, prepareComponentToken$6, {
resetFont: false,
unitless: { expandIconScale: true }
});
//#endregion
//#region node_modules/antd/es/table/InternalTable.js
var EMPTY_LIST = [];
var InternalTable = (props, ref) => {
const { prefixCls: customizePrefixCls, className, rootClassName, style, classNames, styles, size: customizeSize, bordered, dropdownPrefixCls: customizeDropdownPrefixCls, dataSource, pagination, rowSelection: customizeRowSelection, rowKey: customizeRowKey, rowClassName, columns, children, childrenColumnName: legacyChildrenColumnName, onChange, getPopupContainer, loading, expandIcon, expandable, expandedRowRender, expandIconColumnIndex, indentSize, scroll, sortDirections, locale, showSorterTooltip = { target: "full-header" }, virtual } = props;
const warning = devUseWarning("Table");
const baseColumns = import_react.useMemo(() => columns || convertChildrenToColumns(children), [columns, children]);
const screens = useBreakpoint$1(import_react.useMemo(() => baseColumns.some((col) => col.responsive), [baseColumns]));
const mergedColumns = import_react.useMemo(() => {
const matched = new Set(Object.keys(screens).filter((m) => screens[m]));
return baseColumns.filter((c) => !c.responsive || c.responsive.some((r) => matched.has(r)));
}, [baseColumns, screens]);
const tableProps = omit(props, [
"className",
"style",
"columns"
]);
const { locale: contextLocale = localeValues, table } = import_react.useContext(ConfigContext);
const { getPrefixCls, direction, renderEmpty, getPopupContainer: getContextPopupContainer, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("table");
const mergedSize = useSize((ctx) => customizeSize === "middle" ? "medium" : customizeSize ?? ctx);
const mergedProps = {
...props,
size: mergedSize,
bordered
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, {
pagination: { _default: "root" },
header: { _default: "wrapper" },
body: { _default: "wrapper" }
});
const tableLocale = {
...contextLocale.Table,
...locale
};
const [globalLocale] = useLocale$1("global", localeValues.global);
const rawData = dataSource || EMPTY_LIST;
const prefixCls = getPrefixCls("table", customizePrefixCls);
const dropdownPrefixCls = getPrefixCls("dropdown", customizeDropdownPrefixCls);
const [, token] = useToken$1();
const mergedRowSelection = import_react.useMemo(() => {
return isPlainObject(customizeRowSelection) ? {
columnWidth: token.Table?.selectionColumnWidth,
...customizeRowSelection
} : customizeRowSelection;
}, [customizeRowSelection, token.Table?.selectionColumnWidth]);
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = style_default$6(prefixCls, rootCls);
const mergedExpandable = {
childrenColumnName: legacyChildrenColumnName,
expandIconColumnIndex,
...expandable,
expandIcon: expandable?.expandIcon ?? table?.expandable?.expandIcon
};
const { childrenColumnName = "children" } = mergedExpandable;
const expandType = import_react.useMemo(() => {
if (rawData.some((item) => item?.[childrenColumnName])) return "nest";
if (expandedRowRender || expandable?.expandedRowRender) return "row";
return null;
}, [childrenColumnName, rawData]);
const internalRef = { body: import_react.useRef(null) };
const getContainerWidth = useContainerWidth(prefixCls);
const rootRef = import_react.useRef(null);
const tblRef = import_react.useRef(null);
useProxyImperativeHandle(ref, () => ({
...tblRef.current,
nativeElement: rootRef.current
}));
const rowKey = customizeRowKey || table?.rowKey || "key";
const mergedScroll = scroll ?? table?.scroll;
warning(!(typeof rowKey === "function" && rowKey.length > 1), "usage", "`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected.");
const getRowKey = import_react.useMemo(() => {
if (typeof rowKey === "function") return rowKey;
return (record) => record?.[rowKey];
}, [rowKey]);
const [getRecordByKey] = useLazyKVMap(rawData, childrenColumnName, getRowKey);
const changeEventInfo = {};
const triggerOnChange = (info, action, reset = false) => {
const changeInfo = {
...changeEventInfo,
...info
};
if (reset) {
changeEventInfo.resetPagination?.();
if (changeInfo.pagination?.current) changeInfo.pagination.current = 1;
if (pagination) pagination.onChange?.(1, changeInfo.pagination?.pageSize);
}
if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRef.body.current) scrollTo(0, { getContainer: () => internalRef.body.current });
onChange?.(changeInfo.pagination, changeInfo.filters, changeInfo.sorter, {
currentDataSource: getFilterData(getSortData(rawData, changeInfo.sorterStates, childrenColumnName), changeInfo.filterStates, childrenColumnName),
action
});
};
/**
* Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read
* state out and then put it back to title render. Move these code into `hooks` but still too
* complex. We should provides Table props like `sorter` & `filter` to handle control in next big
* version.
*/
const onSorterChange = (sorter, sorterStates) => {
triggerOnChange({
sorter,
sorterStates
}, "sort", false);
};
const [transformSorterColumns, sortStates, sorterTitleProps, getSorters] = useFilterSorter({
prefixCls,
mergedColumns,
onSorterChange,
sortDirections: sortDirections || ["ascend", "descend"],
tableLocale,
showSorterTooltip,
globalLocale
});
const sortedData = import_react.useMemo(() => getSortData(rawData, sortStates, childrenColumnName), [
childrenColumnName,
rawData,
sortStates
]);
changeEventInfo.sorter = getSorters();
changeEventInfo.sorterStates = sortStates;
const onFilterChange = (filters, filterStates) => {
triggerOnChange({
filters,
filterStates
}, "filter", true);
};
const [transformFilterColumns, filterStates, filters] = useFilter({
prefixCls,
locale: tableLocale,
dropdownPrefixCls,
mergedColumns,
onFilterChange,
getPopupContainer: getPopupContainer || getContextPopupContainer,
rootClassName: clsx(rootClassName, rootCls)
});
const mergedData = getFilterData(sortedData, filterStates, childrenColumnName);
changeEventInfo.filters = filters;
changeEventInfo.filterStates = filterStates;
const [transformTitleColumns] = useTitleColumns(import_react.useMemo(() => {
const mergedFilters = {};
Object.keys(filters).forEach((filterKey) => {
if (filters[filterKey] !== null) mergedFilters[filterKey] = filters[filterKey];
});
return {
...sorterTitleProps,
filters: mergedFilters
};
}, [sorterTitleProps, filters]));
const onPaginationChange = (current, pageSize) => {
triggerOnChange({ pagination: {
...changeEventInfo.pagination,
current,
pageSize
} }, "paginate");
};
const [mergedPagination, resetPagination] = usePagination(mergedData.length, onPaginationChange, pagination);
changeEventInfo.pagination = pagination === false ? {} : getPaginationParam(mergedPagination, pagination);
changeEventInfo.resetPagination = resetPagination;
const pageData = import_react.useMemo(() => {
if (pagination === false || !mergedPagination.pageSize) return mergedData;
const { current = 1, total, pageSize = 10 } = mergedPagination;
warning(current > 0, "usage", "`current` should be positive number.");
if (mergedData.length < total) {
if (mergedData.length > pageSize) {
warning(false, "usage", "`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.");
return mergedData.slice((current - 1) * pageSize, current * pageSize);
}
return mergedData;
}
return mergedData.slice((current - 1) * pageSize, current * pageSize);
}, [
!!pagination,
mergedData,
mergedPagination?.current,
mergedPagination?.pageSize,
mergedPagination?.total
]);
const [transformSelectionColumns, selectedKeySet] = useSelection$1({
prefixCls,
data: mergedData,
pageData,
getRowKey,
getRecordByKey,
expandType,
childrenColumnName,
locale: tableLocale,
getPopupContainer: getPopupContainer || getContextPopupContainer
}, mergedRowSelection);
const internalRowClassName = (record, index, indent) => {
const resolvedRowClassName = typeof rowClassName === "function" ? rowClassName(record, index, indent) : rowClassName;
return clsx({ [`${prefixCls}-row-selected`]: selectedKeySet.has(getRowKey(record, index)) }, resolvedRowClassName);
};
mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;
mergedExpandable.expandIcon = mergedExpandable.expandIcon || expandIcon || renderExpandIcon(tableLocale);
if (expandType === "nest" && mergedExpandable.expandIconColumnIndex === void 0) mergedExpandable.expandIconColumnIndex = mergedRowSelection ? 1 : 0;
else if (mergedExpandable.expandIconColumnIndex > 0 && mergedRowSelection) mergedExpandable.expandIconColumnIndex -= 1;
if (typeof mergedExpandable.indentSize !== "number") mergedExpandable.indentSize = isNumber(indentSize) ? indentSize : 15;
const transformColumns = import_react.useCallback((innerColumns) => transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns)))), [
transformSorterColumns,
transformFilterColumns,
transformSelectionColumns
]);
let topPaginationNode;
let bottomPaginationNode;
if (pagination !== false && mergedPagination?.total) {
let paginationSize;
if (mergedPagination.size) paginationSize = mergedPagination.size;
else paginationSize = mergedSize === "small" || mergedSize === "medium" ? "small" : void 0;
const renderPagination = (placement = "end") => /* @__PURE__ */ import_react.createElement(pagination_default, {
...mergedPagination,
classNames: mergedClassNames.pagination,
styles: mergedStyles.pagination,
className: clsx(`${prefixCls}-pagination ${prefixCls}-pagination-${placement}`, mergedPagination.className),
size: paginationSize
});
const { placement, position } = mergedPagination;
const mergedPlacement = placement ?? position;
const normalizePlacement = (pos) => {
const lowerPos = pos.toLowerCase();
if (lowerPos.includes("center")) return "center";
return lowerPos.includes("left") || lowerPos.includes("start") ? "start" : "end";
};
if (Array.isArray(mergedPlacement)) {
const [topPos, bottomPos] = ["top", "bottom"].map((dir) => mergedPlacement.find((p) => p.includes(dir)));
const isDisable = mergedPlacement.every((p) => `${p}` === "none");
if (!topPos && !bottomPos && !isDisable) bottomPaginationNode = renderPagination();
if (topPos) topPaginationNode = renderPagination(normalizePlacement(topPos));
if (bottomPos) bottomPaginationNode = renderPagination(normalizePlacement(bottomPos));
} else bottomPaginationNode = renderPagination();
warning.deprecated(!position, "pagination.position", "pagination.placement");
}
const spinProps = import_react.useMemo(() => {
if (typeof loading === "boolean") return { spinning: loading };
else if (isPlainObject(loading)) return {
spinning: true,
...loading
};
else return;
}, [loading]);
const wrappercls = clsx(cssVarCls, rootCls, `${prefixCls}-wrapper`, contextClassName, { [`${prefixCls}-wrapper-rtl`]: direction === "rtl" }, className, rootClassName, mergedClassNames.root, hashId);
const mergedStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
const mergedEmptyNode = import_react.useMemo(() => {
if (spinProps?.spinning && rawData === EMPTY_LIST) return null;
if (typeof locale?.emptyText !== "undefined") return locale.emptyText;
return renderEmpty?.("Table") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "Table" });
}, [
spinProps?.spinning,
rawData,
locale?.emptyText,
renderEmpty
]);
const TableComponent = virtual ? RcVirtualTable : RcTable;
const virtualProps = {};
const listItemHeight = import_react.useMemo(() => {
const { fontSize, lineHeight, lineWidth, padding, paddingXS, paddingSM } = token;
const fontHeight = Math.floor(fontSize * lineHeight);
switch (mergedSize) {
case "medium": return paddingSM * 2 + fontHeight + lineWidth;
case "small": return paddingXS * 2 + fontHeight + lineWidth;
default: return padding * 2 + fontHeight + lineWidth;
}
}, [token, mergedSize]);
if (virtual) virtualProps.listItemHeight = listItemHeight;
return /* @__PURE__ */ import_react.createElement("div", {
ref: rootRef,
className: wrappercls,
style: mergedStyle
}, /* @__PURE__ */ import_react.createElement(Spin, {
spinning: false,
...spinProps
}, topPaginationNode, /* @__PURE__ */ import_react.createElement(TableComponent, {
...virtualProps,
...tableProps,
scroll: mergedScroll,
classNames: mergedClassNames,
styles: mergedStyles,
ref: tblRef,
columns: mergedColumns,
direction,
expandable: mergedExpandable,
prefixCls,
className: clsx({
[`${prefixCls}-medium`]: mergedSize === "medium",
[`${prefixCls}-small`]: mergedSize === "small",
[`${prefixCls}-bordered`]: bordered,
[`${prefixCls}-empty`]: rawData.length === 0
}, cssVarCls, rootCls, hashId),
data: pageData,
rowKey: getRowKey,
rowClassName: internalRowClassName,
emptyText: mergedEmptyNode,
internalHooks: INTERNAL_HOOKS,
internalRefs: internalRef,
transformColumns,
getContainerWidth,
measureRowRender: (measureRow) => /* @__PURE__ */ import_react.createElement(TableMeasureRowContext.Provider, { value: true }, /* @__PURE__ */ import_react.createElement(ConfigProvider, { getPopupContainer: (node) => node }, measureRow))
}), bottomPaginationNode));
};
var InternalTable_default = /* @__PURE__ */ import_react.forwardRef(InternalTable);
//#endregion
//#region node_modules/antd/es/table/Table.js
var Table = (props, ref) => {
const renderTimesRef = import_react.useRef(0);
renderTimesRef.current += 1;
return /* @__PURE__ */ import_react.createElement(InternalTable_default, {
...props,
ref,
_renderTimes: renderTimesRef.current
});
};
var ForwardTable = /* @__PURE__ */ import_react.forwardRef(Table);
ForwardTable.SELECTION_COLUMN = SELECTION_COLUMN;
ForwardTable.EXPAND_COLUMN = EXPAND_COLUMN;
ForwardTable.SELECTION_ALL = SELECTION_ALL;
ForwardTable.SELECTION_INVERT = SELECTION_INVERT;
ForwardTable.SELECTION_NONE = SELECTION_NONE;
ForwardTable.Column = Column;
ForwardTable.ColumnGroup = ColumnGroup;
ForwardTable.Summary = FooterComponents;
ForwardTable.displayName = "Table";
//#endregion
//#region node_modules/antd/es/table/index.js
var table_default = ForwardTable;
//#endregion
//#region node_modules/antd/es/tag/style/index.js
var genBaseStyle$3 = (token) => {
const { paddingXXS, lineWidth, tagPaddingHorizontal, componentCls, calc } = token;
const paddingInline = calc(tagPaddingHorizontal).sub(lineWidth).equal();
const iconMarginInline = calc(paddingXXS).sub(lineWidth).equal();
return {
[componentCls]: {
...resetComponent(token),
display: "inline-block",
height: "auto",
paddingInline,
fontSize: token.tagFontSize,
lineHeight: token.tagLineHeight,
whiteSpace: "nowrap",
backgroundColor: token.defaultBg,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderRadius: token.borderRadiusSM,
opacity: 1,
transition: `all ${token.motionDurationMid}`,
textAlign: "start",
position: "relative",
[`&${componentCls}-rtl`]: { direction: "rtl" },
"&, a, a:hover": { color: token.defaultColor },
[`${componentCls}-close-icon`]: {
marginInlineStart: iconMarginInline,
fontSize: token.tagIconSize,
color: token.colorIcon,
cursor: "pointer",
transition: `all ${token.motionDurationMid}`,
"&:hover": { color: token.colorTextHeading }
},
"&-checkable": {
backgroundColor: "transparent",
borderColor: "transparent",
cursor: "pointer",
[`&:not(${componentCls}-checkable-checked):hover`]: {
color: token.colorPrimary,
backgroundColor: token.colorFillSecondary
},
"&:active, &-checked": { color: token.colorTextLightSolid },
"&-checked": {
backgroundColor: token.colorPrimary,
"&:hover": { backgroundColor: token.colorPrimaryHover }
},
"&:active": { backgroundColor: token.colorPrimaryActive },
"&-disabled": {
cursor: "not-allowed",
[`&:not(${componentCls}-checkable-checked)`]: {
color: token.colorTextDisabled,
"&:hover": { backgroundColor: "transparent" }
},
[`&${componentCls}-checkable-checked`]: {
color: token.colorTextDisabled,
backgroundColor: token.colorBgContainerDisabled
},
"&:hover, &:active": {
backgroundColor: token.colorBgContainerDisabled,
color: token.colorTextDisabled
},
[`&:not(${componentCls}-checkable-checked):hover`]: { color: token.colorTextDisabled }
},
"&-group": {
display: "flex",
flexWrap: "wrap",
gap: token.paddingXS
}
},
"&-hidden": { display: "none" },
[`> ${token.iconCls} + span, > span + ${token.iconCls}`]: { marginInlineStart: paddingInline }
},
[`&${token.componentCls}-solid`]: {
borderColor: "transparent",
color: token.colorTextLightSolid,
backgroundColor: token.colorBgSolid,
[`&${componentCls}-default`]: { color: token.solidTextColor }
},
[`${componentCls}-filled`]: {
borderColor: "transparent",
backgroundColor: token.tagBorderlessBg
},
[`&${componentCls}-disabled`]: {
color: token.colorTextDisabled,
cursor: "not-allowed",
backgroundColor: token.colorBgContainerDisabled,
a: {
cursor: "not-allowed",
pointerEvents: "none",
color: token.colorTextDisabled,
"&:hover": { color: token.colorTextDisabled }
},
"a&": { "&:hover, &:active": { color: token.colorTextDisabled } },
[`&${componentCls}-outlined`]: { borderColor: token.colorBorderDisabled },
[`&${componentCls}-solid, &${componentCls}-filled`]: {
color: token.colorTextDisabled,
[`${componentCls}-close-icon`]: { color: token.colorTextDisabled }
},
[`${componentCls}-close-icon`]: {
cursor: "not-allowed",
color: token.colorTextDisabled,
"&:hover": { color: token.colorTextDisabled }
}
}
};
};
var prepareToken = (token) => {
const { lineWidth, fontSizeIcon, calc } = token;
const tagFontSize = token.fontSizeSM;
return merge(token, {
tagFontSize,
tagLineHeight: unit$1(calc(token.lineHeightSM).mul(tagFontSize).equal()),
tagIconSize: calc(fontSizeIcon).sub(calc(lineWidth).mul(2)).equal(),
tagPaddingHorizontal: 8,
tagBorderlessBg: token.defaultBg
});
};
var prepareComponentToken$5 = (token) => {
const solidTextColor = isBright(new AggregationColor(token.colorBgSolid), "#fff") ? "#000" : "#fff";
return {
defaultBg: new FastColor(token.colorFillTertiary).onBackground(token.colorBgContainer).toHexString(),
defaultColor: token.colorText,
solidTextColor
};
};
var style_default$5 = genStyleHooks("Tag", (token) => {
return genBaseStyle$3(prepareToken(token));
}, prepareComponentToken$5);
//#endregion
//#region node_modules/antd/es/tag/CheckableTag.js
var CheckableTag = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, style, className, checked, children, icon, onChange, onClick, disabled: customDisabled, ...restProps } = props;
const { getPrefixCls, tag } = import_react.useContext(ConfigContext);
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const handleClick = (e) => {
if (mergedDisabled) return;
onChange?.(!checked);
onClick?.(e);
};
const prefixCls = getPrefixCls("tag", customizePrefixCls);
const [hashId, cssVarCls] = style_default$5(prefixCls);
const cls = clsx(prefixCls, `${prefixCls}-checkable`, {
[`${prefixCls}-checkable-checked`]: checked,
[`${prefixCls}-checkable-disabled`]: mergedDisabled
}, tag?.className, className, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement("span", {
...restProps,
ref,
style: {
...style,
...tag?.style
},
className: cls,
onClick: handleClick
}, icon, /* @__PURE__ */ import_react.createElement("span", null, children));
});
//#endregion
//#region node_modules/antd/es/tag/CheckableTagGroup.js
var CheckableTagGroup = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { id, prefixCls: customizePrefixCls, rootClassName, className, style, classNames, styles, disabled, options, value, defaultValue, onChange, multiple, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("tag");
const prefixCls = getPrefixCls("tag", customizePrefixCls);
const groupPrefixCls = `${prefixCls}-checkable-group`;
const [hashId, cssVarCls] = style_default$5(prefixCls, useCSSVarCls(prefixCls));
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props });
const parsedOptions = (0, import_react.useMemo)(() => {
if (!Array.isArray(options)) return [];
return options.map((option) => {
if (isPlainObject(option)) return option;
return {
value: option,
label: option
};
});
}, [options]);
const [mergedValue, setMergedValue] = useControlledState(defaultValue, value);
const handleChange = (checked, option) => {
let newValue = null;
if (multiple) {
const valueList = mergedValue || [];
newValue = checked ? [].concat(_toConsumableArray$8(valueList), [option.value]) : valueList.filter((item) => item !== option.value);
} else newValue = checked ? option.value : null;
setMergedValue(newValue);
onChange?.(newValue);
};
const divRef = import_react.useRef(null);
(0, import_react.useImperativeHandle)(ref, () => ({ nativeElement: divRef.current }));
const ariaProps = pickAttrs(restProps, {
aria: true,
data: true
});
return /* @__PURE__ */ import_react.createElement("div", {
...ariaProps,
className: clsx(groupPrefixCls, contextClassName, rootClassName, {
[`${groupPrefixCls}-disabled`]: disabled,
[`${groupPrefixCls}-rtl`]: direction === "rtl"
}, hashId, cssVarCls, className, mergedClassNames.root),
style: {
...contextStyle,
...mergedStyles.root,
...style
},
id,
ref: divRef
}, parsedOptions.map((option) => /* @__PURE__ */ import_react.createElement(CheckableTag, {
key: option.value,
className: clsx(`${groupPrefixCls}-item`, mergedClassNames.item),
style: mergedStyles.item,
checked: multiple ? (mergedValue || []).includes(option.value) : mergedValue === option.value,
onChange: (checked) => handleChange(checked, option),
disabled
}, option.label)));
});
CheckableTagGroup.displayName = "CheckableTagGroup";
//#endregion
//#region node_modules/antd/es/tag/hooks/useColor.js
/**
* Convert color related props to a unified object,
* which is used to flatten the compatibility requirements.
*/
function useColor(props, contextVariant) {
const { color, variant, bordered } = props;
return import_react.useMemo(() => {
const isInverseColor = color?.endsWith("-inverse");
let nextVariant;
if (variant) nextVariant = variant;
else if (isInverseColor) nextVariant = "solid";
else if (bordered === false) nextVariant = "filled";
else nextVariant = contextVariant || "filled";
const nextColor = isInverseColor ? color?.replace("-inverse", "") : color;
const nextIsPreset = isPresetColor(color);
const nextIsStatus = isPresetStatusColor(color);
const tagStyle = {};
if (!nextIsPreset && !nextIsStatus && nextColor) if (nextVariant === "solid") tagStyle.backgroundColor = color;
else {
const hsl = new FastColor(nextColor).toHsl();
hsl.l = .95;
tagStyle.backgroundColor = new FastColor(hsl).toHexString();
tagStyle.color = color;
if (nextVariant === "outlined") tagStyle.borderColor = color;
}
return [
nextVariant,
nextColor,
nextIsPreset,
nextIsStatus,
tagStyle
];
}, [
color,
variant,
bordered,
contextVariant
]);
}
//#endregion
//#region node_modules/antd/es/tag/style/presetCmp.js
var genPresetStyle = (token) => genPresetColor$1(token, (colorKey, { textColor, lightBorderColor, lightColor, darkColor }) => ({ [`${token.componentCls}${token.componentCls}-${colorKey}:not(${token.componentCls}-disabled)`]: {
[`&${token.componentCls}-outlined`]: {
backgroundColor: lightColor,
borderColor: lightBorderColor,
color: textColor
},
[`&${token.componentCls}-solid`]: {
backgroundColor: darkColor,
borderColor: darkColor,
color: token.colorTextLightSolid
},
[`&${token.componentCls}-filled`]: {
backgroundColor: lightColor,
color: textColor
}
} }));
var presetCmp_default = genSubStyleComponent(["Tag", "preset"], (token) => {
return genPresetStyle(prepareToken(token));
}, prepareComponentToken$5);
//#endregion
//#region node_modules/antd/es/_util/capitalize.js
function capitalize(str) {
if (typeof str !== "string") return str;
return str.charAt(0).toUpperCase() + str.slice(1);
}
//#endregion
//#region node_modules/antd/es/tag/style/statusCmp.js
var genTagStatusStyle = (token, status, cssVariableType) => {
const capitalizedCssVariableType = capitalize(cssVariableType);
return { [`${token.componentCls}${token.componentCls}-${status}:not(${token.componentCls}-disabled)`]: {
[`&${token.componentCls}-outlined`]: {
backgroundColor: token[`color${capitalizedCssVariableType}Bg`],
borderColor: token[`color${capitalizedCssVariableType}Border`],
color: token[`color${cssVariableType}`]
},
[`&${token.componentCls}-solid`]: {
backgroundColor: token[`color${cssVariableType}`],
borderColor: token[`color${cssVariableType}`]
},
[`&${token.componentCls}-filled`]: {
backgroundColor: token[`color${capitalizedCssVariableType}Bg`],
color: token[`color${cssVariableType}`]
}
} };
};
var statusCmp_default = genSubStyleComponent(["Tag", "status"], (token) => {
const tagToken = prepareToken(token);
return [
genTagStatusStyle(tagToken, "success", "Success"),
genTagStatusStyle(tagToken, "processing", "Info"),
genTagStatusStyle(tagToken, "error", "Error"),
genTagStatusStyle(tagToken, "warning", "Warning")
];
}, prepareComponentToken$5);
//#endregion
//#region node_modules/antd/es/tag/index.js
var Tag = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, rootClassName, style, children, icon, color, variant: _variant, onClose, bordered, disabled: customDisabled, href, target, styles, classNames, ...restProps } = props;
const { getPrefixCls, direction, className: contextClassName, variant: contextVariant, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("tag");
{
const warning = devUseWarning("Tag");
warning.deprecated(bordered !== false, "bordered={false}", "variant=\"filled\"");
warning.deprecated(!color?.endsWith("-inverse"), "color=\"xxx-inverse\"", "variant=\"solid\"");
}
const [mergedVariant, mergedColor, isPreset, isStatus, customTagStyle] = useColor(props, contextVariant);
const isInternalColor = isPreset || isStatus;
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const { tag: tagContext } = import_react.useContext(ConfigContext);
const [visible, setVisible] = import_react.useState(true);
const domProps = omit(restProps, ["closeIcon", "closable"]);
const mergedProps = {
...props,
color: mergedColor,
variant: mergedVariant,
disabled: mergedDisabled
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const tagStyle = import_react.useMemo(() => {
let nextTagStyle = {
...mergedStyles.root,
...contextStyle,
...style
};
if (!mergedDisabled) nextTagStyle = {
...customTagStyle,
...nextTagStyle
};
return nextTagStyle;
}, [
mergedStyles.root,
contextStyle,
style,
customTagStyle,
mergedDisabled
]);
const prefixCls = getPrefixCls("tag", customizePrefixCls);
const [hashId, cssVarCls] = style_default$5(prefixCls);
const tagClassName = clsx(prefixCls, contextClassName, mergedClassNames.root, `${prefixCls}-${mergedVariant}`, {
[`${prefixCls}-${mergedColor}`]: isInternalColor,
[`${prefixCls}-hidden`]: !visible,
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-disabled`]: mergedDisabled
}, className, rootClassName, hashId, cssVarCls);
const handleCloseClick = (e) => {
if (mergedDisabled) return;
e.stopPropagation();
onClose?.(e);
if (e.defaultPrevented) return;
setVisible(false);
};
const [, mergedCloseIcon] = useClosable$1(pickClosable(props), pickClosable(tagContext), {
closable: false,
closeIconRender: (iconNode) => {
return replaceElement(iconNode, /* @__PURE__ */ import_react.createElement("span", {
className: `${prefixCls}-close-icon`,
onClick: handleCloseClick
}, iconNode), (originProps) => ({
onClick: (e) => {
originProps?.onClick?.(e);
handleCloseClick(e);
},
className: clsx(originProps?.className, `${prefixCls}-close-icon`)
}));
}
});
const isNeedWave = typeof restProps.onClick === "function" || children && children.type === "a";
const iconNode = cloneElement$1(icon, {
className: clsx(/* @__PURE__ */ import_react.isValidElement(icon) ? icon.props?.className : void 0, mergedClassNames.icon),
style: mergedStyles.icon
});
const child = iconNode ? /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, iconNode, children && /* @__PURE__ */ import_react.createElement("span", {
className: mergedClassNames.content,
style: mergedStyles.content
}, children)) : children;
const TagWrapper = href ? "a" : "span";
const tagNode = /* @__PURE__ */ import_react.createElement(TagWrapper, {
...domProps,
ref,
className: tagClassName,
style: tagStyle,
href: mergedDisabled ? void 0 : href,
target,
onClick: mergedDisabled ? void 0 : domProps.onClick,
...href && mergedDisabled ? { "aria-disabled": true } : {}
}, child, mergedCloseIcon, isPreset && /* @__PURE__ */ import_react.createElement(presetCmp_default, {
key: "preset",
prefixCls
}), isStatus && /* @__PURE__ */ import_react.createElement(statusCmp_default, {
key: "status",
prefixCls
}));
return isNeedWave ? /* @__PURE__ */ import_react.createElement(Wave, { component: "Tag" }, tagNode) : tagNode;
});
Tag.displayName = "Tag";
Tag.CheckableTag = CheckableTag;
Tag.CheckableTagGroup = CheckableTagGroup;
//#endregion
//#region node_modules/antd/es/theme/getDesignToken.js
var getDesignToken = (config) => {
const theme = config?.algorithm ? createTheme(config.algorithm) : defaultTheme;
return getComputedToken$1({
...seedToken,
...config?.token
}, { override: config?.token }, theme, formatToken);
};
//#endregion
//#region node_modules/antd/es/theme/themes/compact/genCompactSizeMapToken.js
function genSizeMapToken(token) {
const { sizeUnit, sizeStep } = token;
const compactSizeStep = sizeStep - 2;
return {
sizeXXL: sizeUnit * (compactSizeStep + 10),
sizeXL: sizeUnit * (compactSizeStep + 6),
sizeLG: sizeUnit * (compactSizeStep + 2),
sizeMD: sizeUnit * (compactSizeStep + 2),
sizeMS: sizeUnit * (compactSizeStep + 1),
size: sizeUnit * compactSizeStep,
sizeSM: sizeUnit * compactSizeStep,
sizeXS: sizeUnit * (compactSizeStep - 1),
sizeXXS: sizeUnit * (compactSizeStep - 1)
};
}
//#endregion
//#region node_modules/antd/es/theme/themes/compact/index.js
var derivative$1 = (token, mapToken) => {
const mergedMapToken = mapToken ?? derivative$2(token);
const fontSize = mergedMapToken.fontSizeSM;
const controlHeight = mergedMapToken.controlHeight - 4;
return {
...mergedMapToken,
...genSizeMapToken(mapToken ?? token),
...genFontMapToken(fontSize),
controlHeight,
...genControlHeight({
...mergedMapToken,
controlHeight
})
};
};
//#endregion
//#region node_modules/antd/es/theme/themes/dark/colorAlgorithm.js
var getAlphaColor = (baseColor, alpha) => new FastColor(baseColor).setA(alpha).toRgbString();
var getSolidColor = (baseColor, brightness) => {
return new FastColor(baseColor).lighten(brightness).toHexString();
};
//#endregion
//#region node_modules/antd/es/theme/themes/dark/colors.js
var generateColorPalettes = (baseColor) => {
const colors = generate(baseColor, { theme: "dark" });
return {
1: colors[0],
2: colors[1],
3: colors[2],
4: colors[3],
5: colors[6],
6: colors[5],
7: colors[4],
8: colors[6],
9: colors[5],
10: colors[4]
};
};
var generateNeutralColorPalettes = (bgBaseColor, textBaseColor, shadowColor) => {
const colorBgBase = bgBaseColor || "#000";
const colorTextBase = textBaseColor || "#fff";
return {
colorBgBase,
colorTextBase,
colorShadow: shadowColor || "rgba(255, 255, 255, 0.2)",
colorText: getAlphaColor(colorTextBase, .85),
colorTextSecondary: getAlphaColor(colorTextBase, .65),
colorTextTertiary: getAlphaColor(colorTextBase, .45),
colorTextQuaternary: getAlphaColor(colorTextBase, .25),
colorFill: getAlphaColor(colorTextBase, .18),
colorFillSecondary: getAlphaColor(colorTextBase, .12),
colorFillTertiary: getAlphaColor(colorTextBase, .08),
colorFillQuaternary: getAlphaColor(colorTextBase, .04),
colorBgSolid: getAlphaColor(colorTextBase, .95),
colorBgSolidHover: getAlphaColor(colorTextBase, 1),
colorBgSolidActive: getAlphaColor(colorTextBase, .9),
colorBgElevated: getSolidColor(colorBgBase, 12),
colorBgContainer: getSolidColor(colorBgBase, 8),
colorBgLayout: getSolidColor(colorBgBase, 0),
colorBgSpotlight: getSolidColor(colorBgBase, 26),
colorBgBlur: getAlphaColor(colorTextBase, .04),
colorBorder: getSolidColor(colorBgBase, 26),
colorBorderDisabled: getSolidColor(colorBgBase, 26),
colorBorderSecondary: getSolidColor(colorBgBase, 19)
};
};
//#endregion
//#region node_modules/antd/es/theme/themes/dark/index.js
var derivative = (token, mapToken) => {
const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
const colors = generate(token[colorKey], { theme: "dark" });
return Array.from({ length: 10 }, () => 1).reduce((prev, _, i) => {
prev[`${colorKey}-${i + 1}`] = colors[i];
prev[`${colorKey}${i + 1}`] = colors[i];
return prev;
}, {});
}).reduce((prev, cur) => {
prev = {
...prev,
...cur
};
return prev;
}, {});
const mergedMapToken = mapToken ?? derivative$2(token);
const colorMapToken = genColorMapToken(token, {
generateColorPalettes,
generateNeutralColorPalettes
});
const presetColorHoverActiveTokens = PresetColors.reduce((prev, colorKey) => {
const colorBase = token[colorKey];
if (colorBase) {
const colorPalette = generateColorPalettes(colorBase);
prev[`${colorKey}Hover`] = colorPalette[7];
prev[`${colorKey}Active`] = colorPalette[5];
}
return prev;
}, {});
return {
...mergedMapToken,
...colorPalettes,
...colorMapToken,
...presetColorHoverActiveTokens,
colorPrimaryBg: colorMapToken.colorPrimaryBorder,
colorPrimaryBgHover: colorMapToken.colorPrimaryBorderHover
};
};
//#endregion
//#region node_modules/antd/es/theme/index.js
/** Get current context Design Token. Will be different if you are using nest theme config. */
function useToken() {
const [theme, token, hashId, cssVar] = useToken$1();
return {
theme,
token,
hashId,
cssVar
};
}
var theme_default = {
/** Default seedToken */
defaultSeed: defaultConfig.token,
useToken,
defaultAlgorithm: derivative$2,
darkAlgorithm: derivative,
compactAlgorithm: derivative$1,
getDesignToken,
/**
* @private Private variable
* @warring 🔥 Do not use in production. 🔥
*/
defaultConfig,
/**
* @private Private variable
* @warring 🔥 Do not use in production. 🔥
*/
_internalContext: DesignTokenContext
};
//#endregion
//#region node_modules/antd/es/time-picker/index.js
var { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker;
var RangePicker = /* @__PURE__ */ import_react.forwardRef((props, ref) => /* @__PURE__ */ import_react.createElement(InternalRangePicker, {
...props,
picker: "time",
mode: void 0,
ref
}));
var TimePicker = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { addon, renderExtraFooter, variant, bordered, classNames, styles, popupClassName, popupStyle, ...restProps } = props;
devUseWarning("TimePicker").deprecated(!addon, "addon", "renderExtraFooter");
const [mergedVariant] = useVariant("timePicker", variant, bordered);
const internalRenderExtraFooter = import_react.useMemo(() => {
if (renderExtraFooter) return renderExtraFooter;
if (addon) return addon;
}, [addon, renderExtraFooter]);
const [mergedClassNames, mergedStyles] = useMergedPickerSemantic("timePicker", classNames, styles, popupClassName, popupStyle, {
...props,
variant: mergedVariant
});
return /* @__PURE__ */ import_react.createElement(InternalTimePicker, {
...restProps,
mode: void 0,
ref,
renderExtraFooter: internalRenderExtraFooter,
variant: mergedVariant,
classNames: mergedClassNames,
styles: mergedStyles
});
});
TimePicker.displayName = "TimePicker";
/* istanbul ignore next */
var PurePanel$2 = genPurePanel(TimePicker, "popupAlign", void 0, "picker");
TimePicker._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$2;
TimePicker.RangePicker = RangePicker;
TimePicker._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$2;
//#endregion
//#region node_modules/antd/es/timeline/style/horizontal.js
var genHorizontalStyle = (token) => {
const { componentCls, fontHeight, antCls, paddingXS } = token;
const [stepsVarName, stepsVarRef] = genCssVar(antCls, "cmp-steps");
const [timelineVarName, timelineVarRef] = genCssVar(antCls, "timeline");
const itemCls = `${componentCls}-item`;
return { [`${componentCls}-horizontal`]: {
[stepsVarName("title-vertical-row-gap")]: paddingXS,
[timelineVarName("content-height")]: unit$1(fontHeight),
alignItems: "stretch",
[`&${componentCls}-layout-alternate`]: { [itemCls]: {
[`${itemCls}-wrapper`]: {
[timelineVarName("alternate-content-offset")]: `calc(${timelineVarRef("content-height")} + ${stepsVarRef("title-vertical-row-gap")} * 2 + ${stepsVarRef("icon-size-max")})`,
height: `calc(${timelineVarRef("content-height")} * 2 + ${stepsVarRef("title-vertical-row-gap")} * 2 + ${stepsVarRef("icon-size-max")})`
},
[`${itemCls}-icon`]: { position: "absolute" },
[`${itemCls}-icon, ${itemCls}-rail`]: {
position: "absolute",
top: "50%",
transform: "translateY(-50%)",
margin: 0
},
[`${itemCls}-title, ${itemCls}-subtitle, ${itemCls}-content`]: {
whiteSpace: "nowrap",
maxWidth: "unset"
},
[`${itemCls}-title`]: {
position: "absolute",
left: {
_skip_check_: true,
value: "50%"
},
transform: "translateX(-50%)"
},
[`${itemCls}-content`]: {
position: "absolute",
left: {
_skip_check_: true,
value: "50%"
},
transform: "translateX(-50%)"
},
"&-placement-start": {
[`${itemCls}-title`]: { bottom: timelineVarRef("alternate-content-offset") },
[`${itemCls}-content`]: { top: timelineVarRef("alternate-content-offset") }
},
"&-placement-end": {
[`${itemCls}-title`]: { top: timelineVarRef("alternate-content-offset") },
[`${itemCls}-content`]: { bottom: timelineVarRef("alternate-content-offset") }
}
} },
[`&:not(${componentCls}-layout-alternate)`]: { [`${itemCls}-placement-end`]: {
display: "flex",
alignItems: "flex-end",
[`${itemCls}-wrapper`]: {
flex: "auto",
flexDirection: "column-reverse"
},
[`${itemCls}-rail`]: {
top: "auto",
bottom: stepsVarRef("horizontal-rail-margin"),
transform: "translateY(50%)"
}
} }
} };
};
//#endregion
//#region node_modules/antd/es/timeline/style/index.js
var genTimelineStyle = (token) => {
const { componentCls, tailColor, fontHeight, dotSize, dotBg, dotBorderWidth, fontSize, lineHeight, colorText, tailWidth, colorPrimary, colorError, colorSuccess, colorTextDisabled, antCls } = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = genCssVar(antCls, "cmp-steps");
return { [componentCls]: [{
...resetComponent(token),
[itemCls]: {
[varName("title-horizontal-title-height")]: fontHeight,
[varName("vertical-rail-margin")]: "0px",
[varName("title-horizontal-rail-gap")]: "0px",
[varName("icon-dot-size-origin")]: varRef("icon-size-active"),
[varName("icon-dot-size-custom")]: dotSize,
[varName("item-icon-dot-bg-color-origin")]: varRef("item-icon-dot-bg-color"),
[varName("item-icon-dot-bg-color-custom")]: dotBg,
[varName("icon-size")]: varRef("icon-dot-size-custom", varRef("icon-dot-size-origin")),
[`${itemCls}-icon`]: {
[varName("dot-icon-border-width")]: dotBorderWidth,
[varName("dot-icon-size")]: varRef("icon-size"),
[varName("item-icon-dot-bg-color")]: varRef("item-icon-dot-bg-color-custom", varRef("item-icon-dot-bg-color-origin"))
},
[`${itemCls}-title`]: {
fontSize,
lineHeight
},
[`${itemCls}-content`]: { color: colorText },
[`${itemCls}-rail`]: {
[varName("item-solid-line-color")]: tailColor,
[varName("rail-size")]: tailWidth
}
}
}, {
[itemCls]: { [varName("item-process-rail-line-style")]: "dotted" },
[`${itemCls}${itemCls}${itemCls}-color`]: {
"&-blue": { [varName("item-icon-dot-color")]: colorPrimary },
"&-red": { [varName("item-icon-dot-color")]: colorError },
"&-green": { [varName("item-icon-dot-color")]: colorSuccess },
"&-gray": { [varName("item-icon-dot-color")]: colorTextDisabled }
}
}] };
};
var genVerticalStyle = (token) => {
const { calc, componentCls, itemPaddingBottom, margin, antCls } = token;
const itemCls = `${componentCls}-item`;
const [, stepsVarRef] = genCssVar(antCls, "cmp-steps");
const [timelineVarName, timelineVarRef] = genCssVar(antCls, "timeline");
return { [`${componentCls}:not(${componentCls}-horizontal)`]: {
[timelineVarName("head-span")]: "12",
[timelineVarName("head-span-ptg")]: `calc(${timelineVarRef("head-span")} / 24 * 100%)`,
[`&${componentCls}-layout-alternate`]: { [itemCls]: {
[timelineVarName("alternate-gap")]: calc(margin).mul(2).add(stepsVarRef("dot-icon-size")).equal(),
minHeight: "auto",
paddingBottom: itemPaddingBottom,
[`${itemCls}-icon, ${itemCls}-rail`]: {
position: "absolute",
insetInlineStart: timelineVarRef("head-span-ptg")
},
[`${itemCls}-icon`]: { marginInlineStart: `calc(${stepsVarRef("icon-size")} / -2)` },
[`${itemCls}-section`]: {
display: "flex",
flexWrap: "nowrap",
gap: timelineVarRef("alternate-gap")
},
[`${itemCls}-header`]: {
textAlign: "end",
flexDirection: "column",
alignItems: "stretch",
flex: `1 1 calc(${timelineVarRef("head-span-ptg")} - ${timelineVarRef("alternate-gap")} / 2)`
},
[`${itemCls}-content`]: {
textAlign: "start",
flex: `1 1 calc(100% - ${timelineVarRef("head-span-ptg")} - ${timelineVarRef("alternate-gap")} / 2)`
},
"&-placement-end": {
[`${itemCls}-header`]: {
textAlign: "start",
order: 1
},
[`${itemCls}-content`]: { textAlign: "end" },
[`${itemCls}-icon, ${itemCls}-rail`]: { insetInlineStart: `calc(100% - ${timelineVarRef("head-span-ptg")})` }
}
} },
[`&:not(${componentCls}-layout-alternate)`]: { [`${itemCls}-placement-end`]: {
textAlign: "end",
[`${itemCls}-icon`]: { order: 1 },
[`${itemCls}-rail`]: {
insetInlineStart: "auto",
insetInlineEnd: `calc(${stepsVarRef("icon-size")} / 2)`,
marginInlineEnd: `calc(${stepsVarRef("rail-size")} / -2)`
}
} }
} };
};
var prepareComponentToken$4 = (token) => ({
tailColor: token.colorSplit,
tailWidth: token.lineWidthBold,
dotBorderWidth: token.lineWidthBold,
dotBg: void 0,
dotSize: void 0,
itemPaddingBottom: token.padding * 1.25
});
var style_default$4 = genStyleHooks("Timeline", (token) => {
const timeLineToken = merge(token, {
itemHeadSize: 10,
customHeadPaddingVertical: token.paddingXXS,
paddingInlineEnd: 2
});
return [
genTimelineStyle(timeLineToken),
genVerticalStyle(timeLineToken),
genHorizontalStyle(timeLineToken)
];
}, prepareComponentToken$4);
//#endregion
//#region node_modules/antd/es/timeline/useItems.js
var useItems = (rootPrefixCls, prefixCls, mode, items, children, pending, pendingDot) => {
const itemCls = `${prefixCls}-item`;
const [varName] = genCssVar(rootPrefixCls, "cmp-steps");
const parseItems = import_react.useMemo(() => {
return Array.isArray(items) ? items : toArray$8(children).map((ele) => ({ ...ele.props }));
}, [items, children]);
return import_react.useMemo(() => {
const mergedItems = parseItems.map((item, index) => {
const { label, children, title, content, color, className, style, icon, dot, placement, position, loading, ...restProps } = item;
let mergedStyle = style;
let mergedClassName = className;
if (color) if ([
"blue",
"red",
"green",
"gray"
].includes(color)) mergedClassName = clsx(className, `${itemCls}-color-${color}`);
else mergedStyle = {
[varName("item-icon-dot-color")]: color,
...style
};
const mergedPlacement = placement ?? position ?? (mode === "alternate" ? index % 2 === 0 ? "start" : "end" : mode);
mergedClassName = clsx(mergedClassName, `${itemCls}-placement-${mergedPlacement}`);
let mergedIcon = icon ?? dot;
if (!mergedIcon && loading) mergedIcon = /* @__PURE__ */ import_react.createElement(RefIcon$5, null);
return {
...restProps,
title: title ?? label,
content: content ?? children,
style: mergedStyle,
className: mergedClassName,
icon: mergedIcon,
status: loading ? "process" : "finish"
};
});
if (pending) mergedItems.push({
icon: pendingDot ?? /* @__PURE__ */ import_react.createElement(RefIcon$5, null),
content: pending,
status: "process"
});
return mergedItems;
}, [
parseItems,
pending,
mode,
itemCls,
varName,
pendingDot
]);
};
//#endregion
//#region node_modules/antd/es/timeline/Timeline.js
var stepInternalContext = {
rootComponent: "ol",
itemComponent: "li"
};
var Timeline = (props) => {
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("timeline");
const { prefixCls: customizePrefixCls, className, style, classNames, styles, variant = "outlined", mode, orientation = "vertical", titleSpan, items, children, reverse, pending, pendingDot, ...restProps } = props;
const rootPrefixCls = getPrefixCls();
const prefixCls = getPrefixCls("timeline", customizePrefixCls);
const [hashId, cssVarCls] = style_default$4(prefixCls);
const [varName] = genCssVar(rootPrefixCls, "timeline");
const stepsClassNames = import_react.useMemo(() => ({
item: `${prefixCls}-item`,
itemTitle: `${prefixCls}-item-title`,
itemIcon: `${prefixCls}-item-icon`,
itemContent: `${prefixCls}-item-content`,
itemRail: `${prefixCls}-item-rail`,
itemWrapper: `${prefixCls}-item-wrapper`,
itemSection: `${prefixCls}-item-section`,
itemHeader: `${prefixCls}-item-header`
}), [prefixCls]);
const mergedMode = import_react.useMemo(() => {
if (mode === "left") return "start";
if (mode === "right") return "end";
return [
"alternate",
"start",
"end"
].includes(mode) ? mode : "start";
}, [mode]);
const rawItems = useItems(rootPrefixCls, prefixCls, mergedMode, items, children, pending, pendingDot);
const mergedItems = import_react.useMemo(() => reverse ? _toConsumableArray$8(rawItems).reverse() : rawItems, [reverse, rawItems]);
const mergedProps = {
...props,
variant,
mode: mergedMode,
orientation,
items: mergedItems
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([
stepsClassNames,
contextClassNames,
classNames
], [contextStyles, styles], { props: mergedProps });
const stepContext = import_react.useMemo(() => ({ railFollowPrevStatus: reverse }), [reverse]);
const layoutAlternate = import_react.useMemo(() => mergedMode === "alternate" || orientation === "vertical" && mergedItems.some((item) => item.title), [
mergedItems,
mergedMode,
orientation
]);
{
const warning = devUseWarning("Timeline");
warning.deprecated(!children, "Timeline.Item", "items");
const pendingWarning = "You can create a `item` as pending node directly.";
warning.deprecated(!pending, "pending", "items", pendingWarning);
warning.deprecated(!pendingDot, "pendingDot", "items", pendingWarning);
warning.deprecated(mode !== "left" && mode !== "right", "mode=left|right", "mode=start|end");
const warnItems = items || [];
[
["label", "title"],
["children", "content"],
["dot", "icon"],
["position", "placement"]
].forEach(([oldProp, newProp]) => {
warning.deprecated(warnItems.every((item) => !item[oldProp]), `items.${oldProp}`, `items.${newProp}`);
});
}
const stepStyle = {
...contextStyle,
...style
};
if (isNonNullable(titleSpan) && mergedMode !== "alternate") if (isNumber(titleSpan)) stepStyle[varName("head-span")] = titleSpan;
else stepStyle[varName("head-span-ptg")] = titleSpan;
return /* @__PURE__ */ import_react.createElement(InternalContext.Provider, { value: stepInternalContext }, /* @__PURE__ */ import_react.createElement(UnstableContext$1.Provider, { value: stepContext }, /* @__PURE__ */ import_react.createElement(Steps, {
...restProps,
className: clsx(prefixCls, contextClassName, className, hashId, cssVarCls, {
[`${prefixCls}-${orientation}`]: orientation === "horizontal",
[`${prefixCls}-layout-alternate`]: layoutAlternate,
[`${prefixCls}-rtl`]: direction === "rtl"
}),
style: stepStyle,
classNames: mergedClassNames,
styles: mergedStyles,
variant,
orientation,
type: "dot",
items: mergedItems,
current: mergedItems.length - 1
})));
};
Timeline.Item = () => {};
Timeline.displayName = "Timeline";
//#endregion
//#region node_modules/antd/es/timeline/index.js
var timeline_default = Timeline;
//#endregion
//#region node_modules/@rc-component/tour/es/hooks/useClosable.js
function isConfigObj(closable) {
return closable !== null && typeof closable === "object";
}
/**
* Convert `closable` to ClosableConfig.
* When `preset` is true, will auto fill ClosableConfig with default value.
*/
function getClosableConfig(closable, closeIcon, preset) {
if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable.closeIcon)) return null;
const mergedCloseIcon = typeof closeIcon !== "boolean" ? closeIcon : void 0;
if (isConfigObj(closable)) return {
...closable,
closeIcon: closable.closeIcon ?? mergedCloseIcon
};
return preset || closable || closeIcon ? { closeIcon: mergedCloseIcon } : "empty";
}
function useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {
return import_react.useMemo(() => {
const stepClosableConfig = getClosableConfig(stepClosable, stepCloseIcon, false);
const rootClosableConfig = getClosableConfig(closable, closeIcon, true);
if (stepClosableConfig !== "empty") return stepClosableConfig;
return rootClosableConfig;
}, [
closable,
closeIcon,
stepClosable,
stepCloseIcon
]);
}
//#endregion
//#region node_modules/@rc-component/tour/es/util.js
function isInViewPort(element) {
const viewWidth = window.innerWidth || document.documentElement.clientWidth;
const viewHeight = window.innerHeight || document.documentElement.clientHeight;
const { top, right, bottom, left } = element.getBoundingClientRect();
return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight;
}
function getPlacement(targetElement, placement, stepPlacement) {
return stepPlacement ?? placement ?? (targetElement === null ? "center" : "bottom");
}
//#endregion
//#region node_modules/@rc-component/tour/es/hooks/useTarget.js
function isValidNumber(val) {
return typeof val === "number" && !Number.isNaN(val);
}
function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeholderRef) {
const [targetElement, setTargetElement] = (0, import_react.useState)(void 0);
useLayoutEffect$1(() => {
setTargetElement((typeof target === "function" ? target() : target) || null);
});
const [posInfo, setPosInfo] = (0, import_react.useState)(null);
const updatePos = useEvent(() => {
if (targetElement) {
if (!inlineMode && !isInViewPort(targetElement) && open) targetElement.scrollIntoView(scrollIntoViewOptions);
const { left, top, width, height } = targetElement.getBoundingClientRect();
const nextPosInfo = {
left,
top,
width,
height,
radius: 0
};
if (inlineMode) {
const parentRect = placeholderRef.current?.parentElement?.getBoundingClientRect();
if (parentRect) {
nextPosInfo.left -= parentRect.left;
nextPosInfo.top -= parentRect.top;
}
}
setPosInfo((origin) => {
if (JSON.stringify(origin) !== JSON.stringify(nextPosInfo)) return nextPosInfo;
return origin;
});
} else setPosInfo(null);
});
const getGapOffset = (index) => (Array.isArray(gap?.offset) ? gap?.offset[index] : gap?.offset) ?? 6;
useLayoutEffect$1(() => {
updatePos();
window.addEventListener("resize", updatePos);
window.addEventListener("scroll", updatePos);
return () => {
window.removeEventListener("resize", updatePos);
window.removeEventListener("scroll", updatePos);
};
}, [
targetElement,
open,
updatePos
]);
return [(0, import_react.useMemo)(() => {
if (!posInfo) return posInfo;
const gapOffsetX = getGapOffset(0);
const gapOffsetY = getGapOffset(1);
const gapRadius = isValidNumber(gap?.radius) ? gap?.radius : 2;
return {
left: posInfo.left - gapOffsetX,
top: posInfo.top - gapOffsetY,
width: posInfo.width + gapOffsetX * 2,
height: posInfo.height + gapOffsetY * 2,
radius: gapRadius
};
}, [posInfo, gap]), targetElement];
}
//#endregion
//#region node_modules/@rc-component/tour/es/Mask.js
function _extends$6() {
_extends$6 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$6.apply(this, arguments);
}
var COVER_PROPS = {
fill: "transparent",
pointerEvents: "auto"
};
var Mask = (props) => {
const { prefixCls, rootClassName, pos, showMask, style = {}, fill = "rgba(0,0,0,0.5)", open, animated, zIndex, disabledInteraction, styles, classNames: tourClassNames, getPopupContainer, onEsc } = props;
const maskId = `${prefixCls}-mask-${useId_default()}`;
const mergedAnimated = typeof animated === "object" ? animated?.placeholder : animated;
const maskRectSize = typeof navigator !== "undefined" && /^((?!chrome|android).)*safari/i.test(navigator.userAgent) ? {
width: "100%",
height: "100%"
} : {
width: "100vw",
height: "100vh"
};
const inlineMode = getPopupContainer === false;
return /* @__PURE__ */ import_react.createElement(es_default$27, {
open,
autoLock: !inlineMode,
getContainer: getPopupContainer,
onEsc
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-mask`, rootClassName, tourClassNames?.mask),
style: {
position: inlineMode ? "absolute" : "fixed",
left: 0,
right: 0,
top: 0,
bottom: 0,
zIndex,
pointerEvents: pos && !disabledInteraction ? "none" : "auto",
...style,
...styles?.mask
}
}, showMask ? /* @__PURE__ */ import_react.createElement("svg", { style: {
width: "100%",
height: "100%"
} }, /* @__PURE__ */ import_react.createElement("defs", null, /* @__PURE__ */ import_react.createElement("mask", { id: maskId }, /* @__PURE__ */ import_react.createElement("rect", _extends$6({
x: "0",
y: "0"
}, maskRectSize, { fill: "white" })), pos && /* @__PURE__ */ import_react.createElement("rect", {
x: pos.left,
y: pos.top,
rx: pos.radius,
width: pos.width,
height: pos.height,
fill: "black",
className: mergedAnimated ? `${prefixCls}-placeholder-animated` : ""
}))), /* @__PURE__ */ import_react.createElement("rect", {
x: "0",
y: "0",
width: "100%",
height: "100%",
fill,
mask: `url(#${maskId})`
}), pos && /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("rect", _extends$6({}, COVER_PROPS, {
x: "0",
y: "0",
width: "100%",
height: Math.max(pos.top, 0)
})), /* @__PURE__ */ import_react.createElement("rect", _extends$6({}, COVER_PROPS, {
x: "0",
y: "0",
width: Math.max(pos.left, 0),
height: "100%"
})), /* @__PURE__ */ import_react.createElement("rect", _extends$6({}, COVER_PROPS, {
x: "0",
y: pos.top + pos.height,
width: "100%",
height: `calc(100% - ${pos.top + pos.height}px)`
})), /* @__PURE__ */ import_react.createElement("rect", _extends$6({}, COVER_PROPS, {
x: pos.left + pos.width,
y: "0",
width: `calc(100% - ${pos.left + pos.width}px)`,
height: "100%"
})))) : null));
};
//#endregion
//#region node_modules/@rc-component/tour/es/placements.js
var targetOffset = [0, 0];
var basePlacements = {
left: {
points: ["cr", "cl"],
offset: [-8, 0]
},
right: {
points: ["cl", "cr"],
offset: [8, 0]
},
top: {
points: ["bc", "tc"],
offset: [0, -8]
},
bottom: {
points: ["tc", "bc"],
offset: [0, 8]
},
topLeft: {
points: ["bl", "tl"],
offset: [0, -8]
},
leftTop: {
points: ["tr", "tl"],
offset: [-8, 0]
},
topRight: {
points: ["br", "tr"],
offset: [0, -8]
},
rightTop: {
points: ["tl", "tr"],
offset: [8, 0]
},
bottomRight: {
points: ["tr", "br"],
offset: [0, 8]
},
rightBottom: {
points: ["bl", "br"],
offset: [8, 0]
},
bottomLeft: {
points: ["tl", "bl"],
offset: [0, 8]
},
leftBottom: {
points: ["br", "bl"],
offset: [-8, 0]
}
};
function getPlacements(arrowPointAtCenter = false) {
const placements = {};
Object.keys(basePlacements).forEach((key) => {
placements[key] = {
...basePlacements[key],
autoArrow: arrowPointAtCenter,
targetOffset
};
});
return placements;
}
getPlacements();
//#endregion
//#region node_modules/@rc-component/tour/es/TourStep/DefaultPanel.js
function _extends$5() {
_extends$5 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$5.apply(this, arguments);
}
function DefaultPanel(props) {
const { prefixCls, current, total, title, description, onClose, onPrev, onNext, onFinish, className, closable, classNames: tourClassNames, styles } = props;
const ariaProps = pickAttrs(closable || {}, true);
const closeIcon = closable?.closeIcon ?? /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-close-x` }, "×");
const mergedClosable = !!closable;
return /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-panel`, className) }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-section`, tourClassNames?.section),
style: styles?.section
}, mergedClosable && /* @__PURE__ */ import_react.createElement("button", _extends$5({
type: "button",
onClick: onClose,
"aria-label": "Close"
}, ariaProps, { className: `${prefixCls}-close` }), closeIcon), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-header`, tourClassNames?.header),
style: styles?.header
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, tourClassNames?.title),
style: styles?.title
}, title)), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-description`, tourClassNames?.description),
style: styles?.description
}, description), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-footer`, tourClassNames?.footer),
style: styles?.footer
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-sliders` }, total > 1 ? [...Array.from({ length: total }).keys()].map((item, index) => {
return /* @__PURE__ */ import_react.createElement("span", {
key: item,
className: index === current ? "active" : ""
});
}) : null), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-actions`, tourClassNames?.actions),
style: styles?.actions
}, current !== 0 ? /* @__PURE__ */ import_react.createElement("button", {
className: `${prefixCls}-prev-btn`,
onClick: onPrev
}, "Prev") : null, current === total - 1 ? /* @__PURE__ */ import_react.createElement("button", {
className: `${prefixCls}-finish-btn`,
onClick: onFinish
}, "Finish") : /* @__PURE__ */ import_react.createElement("button", {
className: `${prefixCls}-next-btn`,
onClick: onNext
}, "Next")))));
}
//#endregion
//#region node_modules/@rc-component/tour/es/TourStep/index.js
var TourStep = (props) => {
const { current, renderPanel } = props;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, typeof renderPanel === "function" ? renderPanel(props, current) : /* @__PURE__ */ import_react.createElement(DefaultPanel, props));
};
//#endregion
//#region node_modules/@rc-component/tour/es/Placeholder.js
var Placeholder = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { open, autoLock, getContainer, domRef, className, style, fallbackDOM } = props;
import_react.useImperativeHandle(ref, () => domRef.current || fallbackDOM());
return /* @__PURE__ */ import_react.createElement(es_default$27, {
open,
autoLock,
getContainer
}, /* @__PURE__ */ import_react.createElement("div", {
ref: domRef,
className,
style
}));
});
Placeholder.displayName = "Placeholder";
//#endregion
//#region node_modules/@rc-component/tour/es/Tour.js
function _extends$4() {
_extends$4 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$4.apply(this, arguments);
}
var CENTER_PLACEHOLDER = {
left: "50%",
top: "50%",
width: 1,
height: 1
};
var defaultScrollIntoViewOptions = {
block: "center",
inline: "center"
};
var Tour$1 = (props) => {
const { prefixCls = "rc-tour", steps = [], defaultCurrent, current, keyboard = true, onChange, onClose, onFinish, open, defaultOpen, mask = true, arrow = true, rootClassName, placement, renderPanel, gap, animated, scrollIntoViewOptions = defaultScrollIntoViewOptions, zIndex = 1001, closeIcon, closable, builtinPlacements, disabledInteraction, styles, classNames: tourClassNames, className, style, getPopupContainer, ...restProps } = props;
const triggerRef = import_react.useRef();
const [mergedCurrent, setMergedCurrent] = useControlledState(defaultCurrent || 0, current);
const [internalOpen, setMergedOpen] = useControlledState(defaultOpen, open);
const mergedOpen = mergedCurrent < 0 || mergedCurrent >= steps.length ? false : internalOpen ?? true;
const [hasOpened, setHasOpened] = import_react.useState(mergedOpen);
const openRef = import_react.useRef(mergedOpen);
useLayoutEffect$1(() => {
if (mergedOpen) {
if (!openRef.current) setMergedCurrent(0);
setHasOpened(true);
}
openRef.current = mergedOpen;
}, [mergedOpen, setMergedCurrent]);
const { target, placement: stepPlacement, style: stepStyle, arrow: stepArrow, className: stepClassName, mask: stepMask, scrollIntoViewOptions: stepScrollIntoViewOptions = defaultScrollIntoViewOptions, closeIcon: stepCloseIcon, closable: stepClosable } = steps[mergedCurrent] || {};
const mergedClosable = useClosable(stepClosable, stepCloseIcon, closable, closeIcon);
const mergedMask = mergedOpen && (stepMask ?? mask);
const mergedScrollIntoViewOptions = stepScrollIntoViewOptions ?? scrollIntoViewOptions;
const placeholderRef = import_react.useRef(null);
const inlineMode = getPopupContainer === false;
const [posInfo, targetElement] = useTarget(target, open, gap, mergedScrollIntoViewOptions, inlineMode, placeholderRef);
const mergedPlacement = getPlacement(targetElement, placement, stepPlacement);
const mergedArrow = targetElement ? typeof stepArrow === "undefined" ? arrow : stepArrow : false;
const arrowPointAtCenter = typeof mergedArrow === "object" ? mergedArrow.pointAtCenter : false;
useLayoutEffect$1(() => {
triggerRef.current?.forceAlign();
}, [arrowPointAtCenter, mergedCurrent]);
const onInternalChange = (nextCurrent) => {
setMergedCurrent(nextCurrent);
onChange?.(nextCurrent);
};
const mergedBuiltinPlacements = (0, import_react.useMemo)(() => {
if (builtinPlacements) return typeof builtinPlacements === "function" ? builtinPlacements({ arrowPointAtCenter }) : builtinPlacements;
return getPlacements(arrowPointAtCenter);
}, [builtinPlacements, arrowPointAtCenter]);
const handleClose = () => {
setMergedOpen(false);
onClose?.(mergedCurrent);
};
const handleEscClose = useEvent(({ event }) => {
if (keyboard && mergedClosable !== null) {
event.preventDefault();
handleClose();
}
});
const keyboardHandler = useEvent((e) => {
if (KeyCode.isEditableTarget(e)) return;
if (keyboard && e.key === "ArrowLeft") {
if (mergedCurrent > 0) {
e.preventDefault();
onInternalChange(mergedCurrent - 1);
}
return;
}
if (keyboard && e.key === "ArrowRight") {
if (mergedCurrent < steps.length - 1) {
e.preventDefault();
onInternalChange(mergedCurrent + 1);
}
return;
}
});
useLayoutEffect$1(() => {
if (!mergedOpen) return;
window.addEventListener("keydown", keyboardHandler);
return () => {
window.removeEventListener("keydown", keyboardHandler);
};
}, [mergedOpen, keyboardHandler]);
if (targetElement === void 0 || !hasOpened) return null;
const getPopupElement = () => /* @__PURE__ */ import_react.createElement(TourStep, _extends$4({
styles,
classNames: tourClassNames,
arrow: mergedArrow,
key: "content",
prefixCls,
total: steps.length,
renderPanel,
onPrev: () => {
onInternalChange(mergedCurrent - 1);
},
onNext: () => {
onInternalChange(mergedCurrent + 1);
},
onClose: handleClose,
current: mergedCurrent,
onFinish: () => {
handleClose();
onFinish?.();
}
}, steps[mergedCurrent], { closable: mergedClosable }));
const mergedShowMask = typeof mergedMask === "boolean" ? mergedMask : !!mergedMask;
const mergedMaskStyle = typeof mergedMask === "boolean" ? void 0 : mergedMask;
const fallbackDOM = () => {
return targetElement || document.body;
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(Mask, {
getPopupContainer,
styles,
classNames: tourClassNames,
zIndex,
prefixCls,
pos: posInfo,
showMask: mergedShowMask,
style: mergedMaskStyle?.style,
fill: mergedMaskStyle?.color,
open: mergedOpen,
animated,
rootClassName,
disabledInteraction,
onEsc: handleEscClose
}), /* @__PURE__ */ import_react.createElement(es_default$26, _extends$4({}, restProps, {
getPopupContainer,
builtinPlacements: mergedBuiltinPlacements,
ref: triggerRef,
popupStyle: stepStyle,
popupPlacement: mergedPlacement,
popupVisible: mergedOpen,
popupClassName: clsx(rootClassName, stepClassName),
prefixCls,
popup: getPopupElement,
forceRender: false,
autoDestroy: true,
zIndex,
arrow: !!mergedArrow
}), /* @__PURE__ */ import_react.createElement(Placeholder, {
open: mergedOpen,
autoLock: !inlineMode,
getContainer: getPopupContainer,
domRef: placeholderRef,
fallbackDOM,
className: clsx(className, rootClassName, `${prefixCls}-target-placeholder`),
style: {
...posInfo || CENTER_PLACEHOLDER,
position: inlineMode ? "absolute" : "fixed",
pointerEvents: "none",
...style
}
})));
};
//#endregion
//#region node_modules/@rc-component/tour/es/index.js
var es_default$2 = Tour$1;
//#endregion
//#region node_modules/antd/es/tour/panelRender.js
var TourPanel = (props) => {
const { stepProps, current, type, indicatorsRender, actionsRender } = props;
const { prefixCls, total = 1, title, onClose, onPrev, onNext, onFinish, cover, description, nextButtonProps, prevButtonProps, type: stepType, closable, classNames = {}, styles = {} } = stepProps;
const mergedType = stepType ?? type;
const ariaProps = pickAttrs(closable ?? {}, true);
const [contextLocaleGlobal] = useLocale$1("global", localeValues.global);
const [contextLocaleTour] = useLocale$1("Tour", localeValues.Tour);
const mergedCloseIcon = /* @__PURE__ */ import_react.createElement("button", {
type: "button",
onClick: onClose,
className: `${prefixCls}-close`,
"aria-label": contextLocaleGlobal?.close,
...ariaProps
}, closable?.closeIcon || /* @__PURE__ */ import_react.createElement(RefIcon, { className: `${prefixCls}-close-icon` }));
const isLastStep = current === total - 1;
const prevBtnClick = () => {
onPrev?.();
prevButtonProps?.onClick?.();
};
const nextBtnClick = () => {
if (isLastStep) onFinish?.();
else onNext?.();
nextButtonProps?.onClick?.();
};
const headerNode = isNonNullable(title) ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-header`, classNames.header),
style: styles.header
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-title`, classNames.title),
style: styles.title
}, title)) : null;
const descriptionNode = isNonNullable(description) ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-description`, classNames.description),
style: styles.description
}, description) : null;
const coverNode = isNonNullable(cover) ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-cover`, classNames.cover),
style: styles.cover
}, cover) : null;
let mergedIndicatorNode;
if (indicatorsRender) mergedIndicatorNode = indicatorsRender(current, total);
else mergedIndicatorNode = _toConsumableArray$8(Array.from({ length: total }).keys()).map((stepItem, index) => /* @__PURE__ */ import_react.createElement("span", {
key: stepItem,
className: clsx(index === current && `${prefixCls}-indicator-active`, `${prefixCls}-indicator`, classNames.indicator),
style: styles.indicator
}));
const mainBtnType = mergedType === "primary" ? "default" : "primary";
const secondaryBtnProps = {
type: "default",
ghost: mergedType === "primary"
};
const defaultActionsNode = /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, current !== 0 ? /* @__PURE__ */ import_react.createElement(Button, {
size: "small",
...secondaryBtnProps,
...prevButtonProps,
onClick: prevBtnClick,
className: clsx(`${prefixCls}-prev-btn`, prevButtonProps?.className)
}, prevButtonProps?.children ?? contextLocaleTour?.Previous) : null, /* @__PURE__ */ import_react.createElement(Button, {
size: "small",
type: mainBtnType,
...nextButtonProps,
onClick: nextBtnClick,
className: clsx(`${prefixCls}-next-btn`, nextButtonProps?.className)
}, nextButtonProps?.children ?? (isLastStep ? contextLocaleTour?.Finish : contextLocaleTour?.Next)));
return /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-panel` }, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-section`, classNames.section),
style: styles.section
}, closable && mergedCloseIcon, coverNode, headerNode, descriptionNode, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-footer`, classNames.footer),
style: styles.footer
}, total > 1 && /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-indicators`, classNames.indicators),
style: styles.indicators
}, mergedIndicatorNode), /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-actions`, classNames.actions),
style: styles.actions
}, actionsRender ? actionsRender(defaultActionsNode, {
current,
total
}) : defaultActionsNode))));
};
//#endregion
//#region node_modules/antd/es/tour/style/index.js
var genBaseStyle$2 = (token) => {
const { componentCls, padding, paddingXS, borderRadius, borderRadiusXS, colorPrimary, colorFill, indicatorHeight, indicatorWidth, boxShadowTertiary, zIndexPopup, colorBgElevated, fontWeightStrong, marginXS, colorTextLightSolid, tourBorderRadius, colorWhite, primaryNextBtnHoverBg, closeBtnSize, motionDurationSlow, antCls, primaryPrevBtnBg, motionDurationMid } = token;
const [varName, varRef] = genCssVar(antCls, "tooltip");
return [{
[componentCls]: {
...resetComponent(token),
position: "absolute",
zIndex: zIndexPopup,
maxWidth: "fit-content",
visibility: "visible",
width: 520,
[varName("arrow-background-color")]: colorBgElevated,
"&-pure": {
maxWidth: "100%",
position: "relative"
},
[`&${componentCls}-hidden`]: { display: "none" },
[`${componentCls}-panel`]: { position: "relative" },
[`${componentCls}-section`]: {
textAlign: "start",
textDecoration: "none",
borderRadius: tourBorderRadius,
boxShadow: boxShadowTertiary,
position: "relative",
backgroundColor: colorBgElevated,
border: "none",
backgroundClip: "padding-box",
[`${componentCls}-close`]: {
position: "absolute",
top: padding,
insetInlineEnd: padding,
color: token.colorIcon,
background: "none",
border: "none",
width: closeBtnSize,
height: closeBtnSize,
borderRadius: token.borderRadiusSM,
transition: ["color", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
display: "flex",
alignItems: "center",
justifyContent: "center",
cursor: "pointer",
"&:hover": {
color: token.colorIconHover,
backgroundColor: token.colorBgTextHover
},
"&:active": { backgroundColor: token.colorBgTextActive },
...genFocusStyle(token)
},
[`${componentCls}-cover`]: {
textAlign: "center",
padding: `${unit$1(token.calc(padding).add(closeBtnSize).add(paddingXS).equal())} ${unit$1(padding)} 0`,
img: { width: "100%" }
},
[`${componentCls}-header`]: {
padding: `${unit$1(padding)} ${unit$1(padding)} ${unit$1(paddingXS)}`,
width: `calc(100% - ${unit$1(closeBtnSize)})`,
wordBreak: "break-word",
[`${componentCls}-title`]: { fontWeight: fontWeightStrong }
},
[`${componentCls}-description`]: {
padding: `0 ${unit$1(padding)}`,
wordWrap: "break-word"
},
[`${componentCls}-footer`]: {
padding: `${unit$1(paddingXS)} ${unit$1(padding)} ${unit$1(padding)}`,
textAlign: "end",
borderRadius: `0 0 ${unit$1(borderRadiusXS)} ${unit$1(borderRadiusXS)}`,
display: "flex",
[`${componentCls}-indicators`]: {
display: "inline-block",
[`${componentCls}-indicator`]: {
width: indicatorWidth,
height: indicatorHeight,
display: "inline-block",
borderRadius: "50%",
background: colorFill,
"&:not(:last-child)": { marginInlineEnd: indicatorHeight },
"&-active": { background: colorPrimary }
}
},
[`${componentCls}-actions`]: {
marginInlineStart: "auto",
[`${antCls}-btn`]: { marginInlineStart: marginXS }
}
}
},
[`${componentCls}-primary, &${componentCls}-primary`]: {
[varName("arrow-background-color")]: colorPrimary,
[`${componentCls}-section`]: {
color: colorTextLightSolid,
textAlign: "start",
textDecoration: "none",
backgroundColor: colorPrimary,
borderRadius,
boxShadow: boxShadowTertiary,
[`${componentCls}-close`]: { color: colorTextLightSolid },
[`${componentCls}-indicators`]: { [`${componentCls}-indicator`]: {
background: primaryPrevBtnBg,
"&-active": { background: colorTextLightSolid }
} },
[`${componentCls}-prev-btn`]: {
color: colorTextLightSolid,
borderColor: primaryPrevBtnBg,
backgroundColor: colorPrimary,
"&:hover": {
backgroundColor: primaryPrevBtnBg,
borderColor: "transparent"
}
},
[`${componentCls}-next-btn`]: {
color: colorPrimary,
borderColor: "transparent",
background: colorWhite,
"&:hover": { background: primaryNextBtnHoverBg }
}
}
}
},
[`${componentCls}-mask`]: { [`${componentCls}-placeholder-animated`]: { transition: `all ${motionDurationSlow}` } },
[[
"&-placement-left",
"&-placement-leftTop",
"&-placement-leftBottom",
"&-placement-right",
"&-placement-rightTop",
"&-placement-rightBottom"
].join(",")]: { [`${componentCls}-section`]: { borderRadius: token.min(tourBorderRadius, 8) } }
}, getArrowStyle(token, varRef("arrow-background-color"))];
};
var prepareComponentToken$3 = (token) => ({
zIndexPopup: token.zIndexPopupBase + 70,
closeBtnSize: token.fontSize * token.lineHeight,
primaryPrevBtnBg: new FastColor(token.colorTextLightSolid).setA(.15).toRgbString(),
primaryNextBtnHoverBg: new FastColor(token.colorBgTextHover).onBackground(token.colorWhite).toRgbString(),
...getArrowOffsetToken({
contentRadius: token.borderRadiusLG,
limitVerticalRadius: true
}),
...getArrowToken(token)
});
var style_default$3 = genStyleHooks("Tour", (token) => {
const { borderRadiusLG } = token;
return genBaseStyle$2(merge(token, {
indicatorWidth: 6,
indicatorHeight: 6,
tourBorderRadius: borderRadiusLG
}));
}, prepareComponentToken$3);
//#endregion
//#region node_modules/antd/es/tour/PurePanel.js
var PurePanel$1 = (props) => {
const { prefixCls: customizePrefixCls, current = 0, total = 6, className, style, type, closable, closeIcon, ...restProps } = props;
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("tour", customizePrefixCls);
const [hashId, cssVarCls] = style_default$3(prefixCls);
const [mergedClosable, mergedCloseIcon] = useClosable$1({
closable,
closeIcon
}, null, {
closable: true,
closeIconRender: (icon) => /* @__PURE__ */ import_react.isValidElement(icon) ? cloneElement$1(icon, { className: clsx(icon.props?.className, `${prefixCls}-close-icon`) }) : icon
});
return /* @__PURE__ */ import_react.createElement(RawPurePanel, {
prefixCls,
hashId,
className: clsx(className, `${prefixCls}-pure`, type && `${prefixCls}-${type}`, cssVarCls),
style
}, /* @__PURE__ */ import_react.createElement(TourPanel, {
stepProps: {
...restProps,
prefixCls,
total,
closable: mergedClosable ? { closeIcon: mergedCloseIcon } : void 0
},
current,
type
}));
};
var PurePanel_default = withPureRenderTheme(PurePanel$1);
//#endregion
//#region node_modules/antd/es/tour/index.js
var Tour = (props) => {
const { prefixCls: customizePrefixCls, type, rootClassName, indicatorsRender, actionsRender, steps, closeIcon, keyboard = true, classNames, styles, className, style, ...restProps } = props;
const { getPrefixCls, direction, closeIcon: contextCloseIcon, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("tour");
const prefixCls = getPrefixCls("tour", customizePrefixCls);
const [hashId, cssVarCls] = style_default$3(prefixCls);
const [, token] = useToken$1();
const mergedSteps = import_react.useMemo(() => steps?.map((step) => ({
...step,
className: clsx(step.className, { [`${prefixCls}-primary`]: (step.type ?? type) === "primary" })
})), [
prefixCls,
steps,
type
]);
const mergedProps = {
...props,
steps: mergedSteps
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const builtinPlacements = (config) => getPlacements$1({
arrowPointAtCenter: config?.arrowPointAtCenter ?? true,
autoAdjustOverflow: true,
offset: token.marginXXS,
arrowWidth: token.sizePopupArrow,
borderRadius: token.borderRadius
});
const mergedRootClassName = clsx({ [`${prefixCls}-rtl`]: direction === "rtl" }, hashId, cssVarCls, rootClassName, contextClassName, mergedClassNames.root, className);
const semanticStyles = {
...mergedStyles,
mask: {
...mergedStyles.root,
...mergedStyles.mask,
...contextStyle,
...style
}
};
const mergedRenderPanel = (stepProps, stepCurrent) => /* @__PURE__ */ import_react.createElement(TourPanel, {
styles: semanticStyles,
classNames: mergedClassNames,
type,
stepProps,
current: stepCurrent,
indicatorsRender,
actionsRender
});
const [zIndex, contextZIndex] = useZIndex("Tour", restProps.zIndex);
return /* @__PURE__ */ import_react.createElement(ZIndexContext.Provider, { value: contextZIndex }, /* @__PURE__ */ import_react.createElement(es_default$2, {
...restProps,
styles: semanticStyles,
classNames: mergedClassNames,
closeIcon: closeIcon ?? contextCloseIcon,
keyboard,
zIndex,
rootClassName: mergedRootClassName,
prefixCls,
animated: true,
renderPanel: mergedRenderPanel,
builtinPlacements,
steps: mergedSteps
}));
};
Tour.displayName = "Tour";
Tour._InternalPanelDoNotUseOrYouWillBeFired = PurePanel_default;
//#endregion
//#region node_modules/antd/es/_util/transKeys.js
var groupKeysMap = (keys) => {
const map = /* @__PURE__ */ new Map();
keys.forEach((key, index) => {
map.set(key, index);
});
return map;
};
var groupDisabledKeysMap = (dataSource) => {
const map = /* @__PURE__ */ new Map();
dataSource.forEach(({ disabled, key }, index) => {
if (disabled) map.set(key, index);
});
return map;
};
//#endregion
//#region node_modules/antd/es/transfer/Actions.js
function getArrowIcon(type, direction) {
const isRight = type === "right";
if (direction !== "rtl") return isRight ? /* @__PURE__ */ import_react.createElement(RefIcon$6, null) : /* @__PURE__ */ import_react.createElement(RefIcon$12, null);
return isRight ? /* @__PURE__ */ import_react.createElement(RefIcon$12, null) : /* @__PURE__ */ import_react.createElement(RefIcon$6, null);
}
var Action = ({ type, actions, moveToLeft, moveToRight, leftActive, rightActive, direction, disabled }) => {
const isRight = type === "right";
const button = isRight ? actions[0] : actions[1];
const moveHandler = isRight ? moveToRight : moveToLeft;
const active = isRight ? rightActive : leftActive;
const icon = getArrowIcon(type, direction);
if (/* @__PURE__ */ import_react.isValidElement(button)) {
const element = button;
const onClick = (event) => {
element?.props?.onClick?.(event);
moveHandler?.(event);
};
return /* @__PURE__ */ import_react.cloneElement(element, {
disabled: disabled || !active,
onClick
});
}
return /* @__PURE__ */ import_react.createElement(Button, {
type: "primary",
size: "small",
disabled: disabled || !active,
onClick: (event) => moveHandler?.(event),
icon
}, button);
};
var Actions = (props) => {
const { className, style, oneWay, actions, ...restProps } = props;
return /* @__PURE__ */ import_react.createElement("div", {
className,
style
}, /* @__PURE__ */ import_react.createElement(Action, {
type: "right",
actions,
...restProps
}), !oneWay && /* @__PURE__ */ import_react.createElement(Action, {
type: "left",
actions,
...restProps
}), actions.slice(oneWay ? 1 : 2));
};
Actions.displayName = "Actions";
//#endregion
//#region node_modules/antd/es/transfer/hooks/useData.js
var useData = (dataSource, rowKey, targetKeys) => {
const mergedDataSource = import_react.useMemo(() => (dataSource || []).map((record) => {
if (rowKey) return {
...record,
key: rowKey(record)
};
return record;
}), [dataSource, rowKey]);
const [leftDataSource, rightDataSource] = import_react.useMemo(() => {
const leftData = [];
const rightData = Array.from({ length: targetKeys?.length ?? 0 });
const targetKeysMap = groupKeysMap(targetKeys || []);
mergedDataSource.forEach((record) => {
if (targetKeysMap.has(record.key)) {
const idx = targetKeysMap.get(record.key);
rightData[idx] = record;
} else leftData.push(record);
});
return [leftData, rightData];
}, [mergedDataSource, targetKeys]);
return [
mergedDataSource,
leftDataSource.filter(Boolean),
rightDataSource.filter(Boolean)
];
};
//#endregion
//#region node_modules/antd/es/transfer/hooks/useSelection.js
var EMPTY_KEYS = [];
function filterKeys(keys, dataKeys) {
const filteredKeys = keys.filter((key) => dataKeys.has(key));
return keys.length === filteredKeys.length ? keys : filteredKeys;
}
function flattenKeys(keys) {
return Array.from(keys).join(";");
}
function useSelection(leftDataSource, rightDataSource, selectedKeys) {
const [leftKeys, rightKeys] = import_react.useMemo(() => [new Set(leftDataSource.map((src) => src?.key)), new Set(rightDataSource.map((src) => src?.key))], [leftDataSource, rightDataSource]);
const [mergedSelectedKeys, setMergedSelectedKeys] = useControlledState(EMPTY_KEYS, selectedKeys);
const sourceSelectedKeys = import_react.useMemo(() => filterKeys(mergedSelectedKeys, leftKeys), [mergedSelectedKeys, leftKeys]);
const targetSelectedKeys = import_react.useMemo(() => filterKeys(mergedSelectedKeys, rightKeys), [mergedSelectedKeys, rightKeys]);
import_react.useEffect(() => {
setMergedSelectedKeys([].concat(_toConsumableArray$8(filterKeys(mergedSelectedKeys, leftKeys)), _toConsumableArray$8(filterKeys(mergedSelectedKeys, rightKeys))));
}, [flattenKeys(leftKeys), flattenKeys(rightKeys)]);
return [
sourceSelectedKeys,
targetSelectedKeys,
useEvent((nextSrcKeys) => {
setMergedSelectedKeys([].concat(_toConsumableArray$8(nextSrcKeys), _toConsumableArray$8(targetSelectedKeys)));
}),
useEvent((nextTargetKeys) => {
setMergedSelectedKeys([].concat(_toConsumableArray$8(sourceSelectedKeys), _toConsumableArray$8(nextTargetKeys)));
})
];
}
//#endregion
//#region node_modules/antd/es/transfer/search.js
var Search = (props) => {
const { placeholder = "", value, prefixCls, disabled, onChange, handleClear } = props;
const handleChange = import_react.useCallback((e) => {
onChange?.(e);
if (e.target.value === "") handleClear?.();
}, [onChange]);
return /* @__PURE__ */ import_react.createElement(Input$1, {
placeholder,
className: prefixCls,
value,
onChange: handleChange,
disabled,
allowClear: true,
prefix: /* @__PURE__ */ import_react.createElement(RefIcon$7, null)
});
};
Search.displayName = "Search";
//#endregion
//#region node_modules/antd/es/transfer/ListItem.js
var ListItem$1 = (props) => {
const { prefixCls, classNames, styles, renderedText, renderedEl, item, checked, disabled, onClick, onRemove, showRemove } = props;
const mergedDisabled = disabled || item?.disabled;
const classes = clsx(`${prefixCls}-content-item`, classNames.item, {
[`${prefixCls}-content-item-disabled`]: mergedDisabled,
[`${prefixCls}-content-item-checked`]: checked && !mergedDisabled
});
let title;
if (typeof renderedText === "string" || isNumber(renderedText)) title = String(renderedText);
const [contextLocale] = useLocale$1("Transfer", localeValues.Transfer);
const liProps = {
className: classes,
style: styles.item,
title
};
const labelNode = /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${prefixCls}-content-item-text`, classNames.itemContent),
style: styles.itemContent
}, renderedEl);
if (showRemove) return /* @__PURE__ */ import_react.createElement("li", { ...liProps }, labelNode, /* @__PURE__ */ import_react.createElement("button", {
type: "button",
disabled: mergedDisabled,
className: `${prefixCls}-content-item-remove`,
"aria-label": contextLocale?.remove,
onClick: () => onRemove?.(item)
}, /* @__PURE__ */ import_react.createElement(RefIcon$44, null)));
liProps.onClick = mergedDisabled ? void 0 : (event) => onClick(item, event);
return /* @__PURE__ */ import_react.createElement("li", { ...liProps }, /* @__PURE__ */ import_react.createElement(Checkbox, {
className: clsx(`${prefixCls}-checkbox`, classNames.itemIcon),
style: styles.itemIcon,
checked,
disabled: mergedDisabled
}), labelNode);
};
var ListItem_default = /* @__PURE__ */ import_react.memo(ListItem$1);
//#endregion
//#region node_modules/antd/es/transfer/ListBody.js
var OmitProps = [
"handleFilter",
"handleClear",
"checkedKeys"
];
var parsePagination = (pagination) => {
return {
simple: true,
showSizeChanger: false,
showLessItems: false,
...pagination
};
};
var TransferListBody = (props, ref) => {
const { prefixCls, classNames, styles, filteredRenderItems, selectedKeys, disabled: globalDisabled, showRemove, pagination, onScroll, onItemSelect, onItemRemove } = props;
const [current, setCurrent] = import_react.useState(1);
const mergedPagination = import_react.useMemo(() => {
if (!pagination) return null;
return parsePagination(isPlainObject(pagination) ? pagination : {});
}, [pagination]);
const [pageSize, setPageSize] = useControlledState(10, mergedPagination?.pageSize);
import_react.useEffect(() => {
if (mergedPagination) {
const maxPageCount = Math.ceil(filteredRenderItems.length / pageSize);
setCurrent(Math.min(current, maxPageCount));
}
}, [
filteredRenderItems,
mergedPagination,
pageSize
]);
const onInternalClick = (item, e) => {
onItemSelect(item.key, !selectedKeys.includes(item.key), e);
};
const onRemove = (item) => {
onItemRemove?.([item.key]);
};
const onPageChange = (cur) => {
setCurrent(cur);
};
const onSizeChange = (cur, size) => {
setCurrent(cur);
setPageSize(size);
};
const memoizedItems = import_react.useMemo(() => {
return mergedPagination ? filteredRenderItems.slice((current - 1) * pageSize, current * pageSize) : filteredRenderItems;
}, [
current,
filteredRenderItems,
mergedPagination,
pageSize
]);
import_react.useImperativeHandle(ref, () => ({ items: memoizedItems }));
const paginationNode = mergedPagination ? /* @__PURE__ */ import_react.createElement(pagination_default, {
size: "small",
disabled: globalDisabled,
simple: mergedPagination.simple,
pageSize,
showLessItems: mergedPagination.showLessItems,
showSizeChanger: mergedPagination.showSizeChanger,
className: `${prefixCls}-pagination`,
total: filteredRenderItems.length,
current,
onChange: onPageChange,
onShowSizeChange: onSizeChange
}) : null;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement("ul", {
className: clsx(`${prefixCls}-content`, classNames.list, { [`${prefixCls}-content-show-remove`]: showRemove }),
style: styles.list,
onScroll
}, (memoizedItems || []).map(({ renderedEl, renderedText, item }) => /* @__PURE__ */ import_react.createElement(ListItem_default, {
key: item.key,
prefixCls,
classNames,
styles,
item,
renderedText,
renderedEl,
showRemove,
onClick: onInternalClick,
onRemove,
checked: selectedKeys.includes(item.key),
disabled: globalDisabled
}))), paginationNode);
};
TransferListBody.displayName = "TransferListBody";
var ListBody_default = /* @__PURE__ */ import_react.forwardRef(TransferListBody);
//#endregion
//#region node_modules/antd/es/transfer/Section.js
var defaultRender = () => null;
function isRenderResultPlainObject(result) {
return !!(result && !/* @__PURE__ */ import_react.isValidElement(result) && Object.prototype.toString.call(result) === "[object Object]");
}
function getEnabledItemKeys(items) {
return items.filter((data) => !data.disabled).map((data) => data.key);
}
function getTextFromRenderResult(renderResult, item) {
for (const v of [
renderResult,
item.title,
item.key
]) if (typeof v === "string" || isNumber(v)) return String(v);
return "";
}
var isValidIcon = (icon) => icon !== void 0;
var getShowSearchOption = (showSearch) => {
if (isPlainObject(showSearch)) return {
...showSearch,
defaultValue: showSearch.defaultValue || ""
};
return {
defaultValue: "",
placeholder: ""
};
};
var TransferSection = (props) => {
const { prefixCls, style, classNames, styles, dataSource = [], titleText = "", checkedKeys, disabled, showSearch = false, searchPlaceholder, notFoundContent, selectAll, deselectAll, selectCurrent, selectInvert, removeAll, removeCurrent, showSelectAll = true, showRemove, pagination, direction, itemsUnit, itemUnit, selectAllLabel, selectionsIcon, footer, renderList, onItemSelectAll, onItemRemove, handleFilter, handleClear, filterOption, render = defaultRender } = props;
const sectionPrefixCls = `${prefixCls}-section`;
const listPrefixCls = `${prefixCls}-list`;
const searchOptions = getShowSearchOption(showSearch);
const [filterValue, setFilterValue] = (0, import_react.useState)(searchOptions.defaultValue);
const listBodyRef = (0, import_react.useRef)({});
const internalHandleFilter = (e) => {
setFilterValue(e.target.value);
handleFilter(e);
};
const internalHandleClear = () => {
setFilterValue("");
handleClear();
};
const matchFilter = (text, item) => {
if (typeof filterOption === "function") return filterOption(filterValue, item, direction);
return text.includes(filterValue);
};
const customRenderListBody = (listProps) => {
let bodyContent = renderList ? renderList({
...listProps,
onItemSelect: (key, check) => listProps.onItemSelect(key, check)
}) : null;
const customize = !!bodyContent;
if (!customize) bodyContent = /* @__PURE__ */ import_react.createElement(ListBody_default, {
ref: listBodyRef,
...listProps,
prefixCls: listPrefixCls
});
return {
customize,
bodyContent
};
};
const renderItem = (item) => {
const renderResult = render(item);
const isRenderResultPlain = isRenderResultPlainObject(renderResult);
return {
item,
renderedEl: isRenderResultPlain ? renderResult.label : renderResult,
renderedText: isRenderResultPlain ? renderResult.value : getTextFromRenderResult(renderResult, item)
};
};
const notFoundContentEle = (0, import_react.useMemo)(() => Array.isArray(notFoundContent) ? notFoundContent[direction === "left" ? 0 : 1] : notFoundContent, [notFoundContent, direction]);
const [filteredItems, filteredRenderItems] = (0, import_react.useMemo)(() => {
const filterItems = [];
const filterRenderItems = [];
dataSource.forEach((item) => {
const renderedItem = renderItem(item);
if (filterValue && !matchFilter(renderedItem.renderedText, item)) return;
filterItems.push(item);
filterRenderItems.push(renderedItem);
});
return [filterItems, filterRenderItems];
}, [dataSource, filterValue]);
const checkedActiveItems = (0, import_react.useMemo)(() => {
return filteredItems.filter((item) => checkedKeys.includes(item.key) && !item.disabled);
}, [checkedKeys, filteredItems]);
const checkStatus = (0, import_react.useMemo)(() => {
if (checkedActiveItems.length === 0) return "none";
const checkedKeysMap = groupKeysMap(checkedKeys);
if (filteredItems.every((item) => checkedKeysMap.has(item.key) || !!item.disabled)) return "all";
return "part";
}, [
checkedActiveItems.length,
checkedKeys,
filteredItems
]);
const renderListBody = () => {
const search = showSearch ? /* @__PURE__ */ import_react.createElement("div", { className: `${listPrefixCls}-body-search-wrapper` }, /* @__PURE__ */ import_react.createElement(Search, {
prefixCls: `${listPrefixCls}-search`,
onChange: internalHandleFilter,
handleClear: internalHandleClear,
placeholder: searchOptions.placeholder || searchPlaceholder,
value: filterValue,
disabled
})) : null;
const { customize, bodyContent } = customRenderListBody({
...omit(props, OmitProps),
filteredItems,
filteredRenderItems,
selectedKeys: checkedKeys,
classNames,
styles
});
let bodyNode;
if (customize) bodyNode = /* @__PURE__ */ import_react.createElement("div", { className: `${listPrefixCls}-body-customize-wrapper` }, bodyContent);
else bodyNode = filteredItems.length ? bodyContent : /* @__PURE__ */ import_react.createElement("div", { className: `${listPrefixCls}-body-not-found` }, notFoundContentEle);
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${listPrefixCls}-body`, { [`${listPrefixCls}-body-with-search`]: showSearch }, classNames.body),
style: styles.body
}, search, bodyNode);
};
const checkBox = /* @__PURE__ */ import_react.createElement(Checkbox, {
disabled: dataSource.filter((d) => !d.disabled).length === 0 || disabled,
checked: checkStatus === "all",
indeterminate: checkStatus === "part",
className: `${listPrefixCls}-checkbox`,
onChange: () => {
onItemSelectAll?.(filteredItems.filter((item) => !item.disabled).map(({ key }) => key), checkStatus !== "all");
}
});
const getSelectAllLabel = (selectedCount, totalCount) => {
if (selectAllLabel) return typeof selectAllLabel === "function" ? selectAllLabel({
selectedCount,
totalCount
}) : selectAllLabel;
const unit = totalCount > 1 ? itemsUnit : itemUnit;
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, (selectedCount > 0 ? `${selectedCount}/` : "") + totalCount, " ", unit);
};
const footerDom = footer && (footer.length < 2 ? footer(props) : footer(props, { direction }));
const listFooter = footerDom ? /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${listPrefixCls}-footer`, classNames.footer),
style: styles.footer
}, footerDom) : null;
const checkAllCheckbox = !showRemove && !pagination && checkBox;
let items;
if (showRemove) items = [pagination ? {
key: "removeCurrent",
label: removeCurrent,
onClick() {
const pageKeys = getEnabledItemKeys((listBodyRef.current?.items || []).map((entity) => entity.item));
onItemRemove?.(pageKeys);
}
} : null, {
key: "removeAll",
label: removeAll,
onClick() {
onItemRemove?.(getEnabledItemKeys(filteredItems));
}
}].filter(Boolean);
else items = [
{
key: "selectAll",
label: checkStatus === "all" ? deselectAll : selectAll,
onClick() {
const keys = getEnabledItemKeys(filteredItems);
onItemSelectAll?.(keys, keys.length !== checkedKeys.length);
}
},
pagination ? {
key: "selectCurrent",
label: selectCurrent,
onClick() {
const pageItems = listBodyRef.current?.items || [];
onItemSelectAll?.(getEnabledItemKeys(pageItems.map((entity) => entity.item)), true);
}
} : null,
{
key: "selectInvert",
label: selectInvert,
onClick() {
const availablePageItemKeys = getEnabledItemKeys((listBodyRef.current?.items || []).map((entity) => entity.item));
const checkedKeySet = new Set(checkedKeys);
const newCheckedKeysSet = new Set(checkedKeySet);
availablePageItemKeys.forEach((key) => {
if (checkedKeySet.has(key)) newCheckedKeysSet.delete(key);
else newCheckedKeysSet.add(key);
});
onItemSelectAll?.(_toConsumableArray$8(newCheckedKeysSet), "replace");
}
}
];
const dropdown = /* @__PURE__ */ import_react.createElement(Dropdown, {
className: `${listPrefixCls}-header-dropdown`,
menu: { items },
disabled
}, isValidIcon(selectionsIcon) ? selectionsIcon : /* @__PURE__ */ import_react.createElement(RefIcon$8, null));
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(sectionPrefixCls, classNames.section, {
[`${sectionPrefixCls}-with-pagination`]: !!pagination,
[`${sectionPrefixCls}-with-footer`]: !!footerDom
}),
style: {
...style,
...styles.section
}
}, /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${listPrefixCls}-header`, classNames.header),
style: styles.header
}, showSelectAll ? /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, checkAllCheckbox, dropdown) : null, /* @__PURE__ */ import_react.createElement("span", { className: `${listPrefixCls}-header-selected` }, getSelectAllLabel(checkedActiveItems.length, filteredItems.length)), /* @__PURE__ */ import_react.createElement("span", {
className: clsx(`${listPrefixCls}-header-title`, classNames.title),
style: styles.title
}, titleText)), renderListBody(), listFooter);
};
TransferSection.displayName = "TransferSection";
//#endregion
//#region node_modules/antd/es/transfer/style/index.js
var genTransferCustomizeStyle = (token) => {
const { antCls, componentCls, listHeight, controlHeightLG } = token;
const tableCls = `${antCls}-table`;
const inputCls = `${antCls}-input`;
return { [`${componentCls}-customize-list`]: {
[`${componentCls}-section`]: {
flex: "1 1 50%",
width: "auto",
height: "auto",
minHeight: listHeight,
minWidth: 0
},
[`${tableCls}-wrapper`]: {
[`${tableCls}-small`]: {
border: 0,
borderRadius: 0,
[`${tableCls}-selection-column`]: {
width: controlHeightLG,
minWidth: controlHeightLG
}
},
[`${tableCls}-pagination${tableCls}-pagination`]: {
margin: 0,
padding: token.paddingXS
}
},
[`${inputCls}[disabled]`]: { backgroundColor: "transparent" }
} };
};
var genTransferStatusColor = (token, color) => {
const { componentCls, colorBorder } = token;
return { [`${componentCls}-section`]: {
borderColor: color,
[`${componentCls}-list-search:not([disabled])`]: { borderColor: colorBorder }
} };
};
var genTransferStatusStyle = (token) => {
const { componentCls } = token;
return {
[`${componentCls}-status-error`]: { ...genTransferStatusColor(token, token.colorError) },
[`${componentCls}-status-warning`]: { ...genTransferStatusColor(token, token.colorWarning) }
};
};
var genTransferListStyle = (token) => {
const { componentCls, colorBorder, colorSplit, lineWidth, itemHeight, headerHeight, transferHeaderVerticalPadding, itemPaddingBlock, controlItemBgActive, colorTextDisabled, colorTextSecondary, listHeight, listWidth, listWidthLG, fontSizeIcon, marginXS, paddingSM, lineType, antCls, iconCls, motionDurationSlow, controlItemBgHover, borderRadiusLG, colorBgContainer, colorText, controlItemBgActiveHover } = token;
const contentBorderRadius = unit$1(token.calc(borderRadiusLG).sub(lineWidth).equal());
return {
display: "flex",
flexDirection: "column",
width: listWidth,
height: listHeight,
border: `${unit$1(lineWidth)} ${lineType} ${colorBorder}`,
borderRadius: token.borderRadiusLG,
"&-with-pagination": {
width: listWidthLG,
height: "auto"
},
[`${componentCls}-list`]: {
"&-search": { [`${iconCls}-search`]: { color: colorTextDisabled } },
"&-header": {
display: "flex",
flex: "none",
alignItems: "center",
height: headerHeight,
padding: `${unit$1(token.calc(transferHeaderVerticalPadding).sub(lineWidth).equal())} ${unit$1(paddingSM)} ${unit$1(transferHeaderVerticalPadding)}`,
color: colorText,
background: colorBgContainer,
borderBottom: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
borderRadius: `${unit$1(borderRadiusLG)} ${unit$1(borderRadiusLG)} 0 0`,
"> *:not(:last-child)": { marginInlineEnd: 4 },
"> *": { flex: "none" },
"&-title": {
...textEllipsis,
flex: "0 1 auto",
textAlign: "end",
marginInlineStart: "auto"
},
"&-dropdown": {
...resetIcon(),
fontSize: fontSizeIcon,
transform: "translateY(10%)",
cursor: "pointer",
"&[disabled]": { cursor: "not-allowed" }
}
},
"&-body": {
display: "flex",
flex: "auto",
flexDirection: "column",
fontSize: token.fontSize,
minHeight: 0,
"&-search-wrapper": {
position: "relative",
flex: "none",
padding: paddingSM
}
},
"&-content": {
flex: "auto",
margin: 0,
padding: 0,
overflow: "auto",
listStyle: "none",
borderRadius: `0 0 ${contentBorderRadius} ${contentBorderRadius}`,
"&-item": {
display: "flex",
alignItems: "center",
minHeight: itemHeight,
padding: `${unit$1(itemPaddingBlock)} ${unit$1(paddingSM)}`,
transition: `all ${motionDurationSlow}`,
"> *:not(:last-child)": { marginInlineEnd: marginXS },
"> *": { flex: "none" },
"&-text": {
...textEllipsis,
flex: "auto"
},
"&-remove": {
...operationUnit(token),
color: colorBorder,
"&:hover, &:focus": { color: colorTextSecondary },
"&:disabled": {
color: colorTextDisabled,
cursor: "not-allowed"
}
},
[`&:not(${componentCls}-list-content-item-disabled)`]: {
"&:hover": {
backgroundColor: controlItemBgHover,
cursor: "pointer"
},
[`&${componentCls}-list-content-item-checked:hover`]: { backgroundColor: controlItemBgActiveHover }
},
"&-checked": { backgroundColor: controlItemBgActive },
"&-disabled": {
color: colorTextDisabled,
cursor: "not-allowed"
}
},
[`&-show-remove ${componentCls}-list-content-item:not(${componentCls}-list-content-item-disabled):hover`]: {
background: "transparent",
cursor: "default"
}
},
"&-pagination": {
padding: token.paddingXS,
textAlign: "end",
borderTop: `${unit$1(lineWidth)} ${lineType} ${colorSplit}`,
[`${antCls}-pagination-options`]: { paddingInlineEnd: token.paddingXS }
},
"&-body-not-found": {
flex: "none",
width: "100%",
margin: "auto 0",
color: colorTextDisabled,
textAlign: "center"
},
"&-footer": { borderTop: `${unit$1(lineWidth)} ${lineType} ${colorSplit}` },
"&-checkbox": { lineHeight: 1 }
}
};
};
var genTransferStyle = (token) => {
const { antCls, iconCls, componentCls, marginXS, marginXXS, fontSizeIcon, colorBgContainerDisabled } = token;
return { [componentCls]: {
...resetComponent(token),
position: "relative",
display: "flex",
alignItems: "stretch",
[`${componentCls}-disabled`]: { [`${componentCls}-section`]: { background: colorBgContainerDisabled } },
[`${componentCls}-section`]: genTransferListStyle(token),
[`${componentCls}-actions`]: {
display: "flex",
flex: "none",
flexDirection: "column",
alignSelf: "center",
margin: `0 ${unit$1(marginXS)}`,
verticalAlign: "middle",
gap: marginXXS,
[`${antCls}-btn ${iconCls}`]: { fontSize: fontSizeIcon }
}
} };
};
var genTransferRTLStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-rtl`]: { direction: "rtl" } };
};
var prepareComponentToken$2 = (token) => {
const { fontSize, lineHeight, controlHeight, controlHeightLG, lineWidth } = token;
const fontHeight = Math.round(fontSize * lineHeight);
return {
listWidth: 180,
listHeight: 200,
listWidthLG: 250,
headerHeight: controlHeightLG,
itemHeight: controlHeight,
itemPaddingBlock: (controlHeight - fontHeight) / 2,
transferHeaderVerticalPadding: Math.ceil((controlHeightLG - lineWidth - fontHeight) / 2)
};
};
var style_default$2 = genStyleHooks("Transfer", (token) => {
const transferToken = merge(token);
return [
genTransferStyle(transferToken),
genTransferCustomizeStyle(transferToken),
genTransferStatusStyle(transferToken),
genTransferRTLStyle(transferToken)
];
}, prepareComponentToken$2);
//#endregion
//#region node_modules/antd/es/transfer/index.js
var Transfer = (props) => {
const { prefixCls: customizePrefixCls, className, rootClassName, classNames, styles, style, listStyle, operationStyle, operations, actions, dataSource, targetKeys = [], selectedKeys, selectAllLabels = [], locale = {}, titles, disabled, showSearch = false, showSelectAll, oneWay, pagination, status: customStatus, selectionsIcon, filterOption, render, footer, children, rowKey, onScroll, onChange, onSearch, onSelectChange } = props;
const { getPrefixCls, renderEmpty, direction: dir, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles, selectionsIcon: contextSelectionsIcon } = useComponentConfig("transfer");
const contextDisabled = (0, import_react.useContext)(DisabledContext);
const mergedDisabled = disabled ?? contextDisabled;
const mergedProps = {
...props,
disabled: mergedDisabled
};
const prefixCls = getPrefixCls("transfer", customizePrefixCls);
const [hashId, cssVarCls] = style_default$2(prefixCls);
const mergedActions = actions || operations || [];
const isRtl = dir === "rtl";
const [mergedDataSource, leftDataSource, rightDataSource] = useData(dataSource, rowKey, targetKeys);
const [sourceSelectedKeys, targetSelectedKeys, setSourceSelectedKeys, setTargetSelectedKeys] = useSelection(leftDataSource, rightDataSource, selectedKeys);
const [leftMultipleSelect, updateLeftPrevSelectedIndex] = useMultipleSelect((item) => item.key);
const [rightMultipleSelect, updateRightPrevSelectedIndex] = useMultipleSelect((item) => item.key);
const setStateKeys = (0, import_react.useCallback)((direction, keys) => {
if (direction === "left") setSourceSelectedKeys(typeof keys === "function" ? keys(sourceSelectedKeys || []) : keys);
else setTargetSelectedKeys(typeof keys === "function" ? keys(targetSelectedKeys || []) : keys);
}, [sourceSelectedKeys, targetSelectedKeys]);
const setPrevSelectedIndex = (direction, value) => {
(direction === "left" ? updateLeftPrevSelectedIndex : updateRightPrevSelectedIndex)(value);
};
const handleSelectChange = (0, import_react.useCallback)((direction, holder) => {
if (direction === "left") onSelectChange?.(holder, targetSelectedKeys);
else onSelectChange?.(sourceSelectedKeys, holder);
}, [sourceSelectedKeys, targetSelectedKeys]);
const getTitles = (transferLocale) => titles ?? transferLocale.titles ?? [];
const handleLeftScroll = (e) => {
onScroll?.("left", e);
};
const handleRightScroll = (e) => {
onScroll?.("right", e);
};
const moveTo = (direction) => {
const moveKeys = direction === "right" ? sourceSelectedKeys : targetSelectedKeys;
const dataSourceDisabledKeysMap = groupDisabledKeysMap(mergedDataSource);
const newMoveKeys = moveKeys.filter((key) => !dataSourceDisabledKeysMap.has(key));
const newMoveKeysMap = groupKeysMap(newMoveKeys);
const newTargetKeys = direction === "right" ? newMoveKeys.concat(targetKeys) : targetKeys.filter((targetKey) => !newMoveKeysMap.has(targetKey));
const oppositeDirection = direction === "right" ? "left" : "right";
setStateKeys(oppositeDirection, []);
handleSelectChange(oppositeDirection, []);
onChange?.(newTargetKeys, direction, newMoveKeys);
};
const moveToLeft = () => {
moveTo("left");
setPrevSelectedIndex("left", null);
};
const moveToRight = () => {
moveTo("right");
setPrevSelectedIndex("right", null);
};
const onItemSelectAll = (direction, keys, checkAll) => {
setStateKeys(direction, (prevKeys) => {
let mergedCheckedKeys = [];
if (checkAll === "replace") mergedCheckedKeys = keys;
else if (checkAll) mergedCheckedKeys = Array.from(new Set([].concat(_toConsumableArray$8(prevKeys), _toConsumableArray$8(keys))));
else {
const selectedKeysMap = groupKeysMap(keys);
mergedCheckedKeys = prevKeys.filter((key) => !selectedKeysMap.has(key));
}
handleSelectChange(direction, mergedCheckedKeys);
return mergedCheckedKeys;
});
setPrevSelectedIndex(direction, null);
};
const onLeftItemSelectAll = (keys, checkAll) => onItemSelectAll("left", keys, checkAll);
const onRightItemSelectAll = (keys, checkAll) => onItemSelectAll("right", keys, checkAll);
const leftFilter = (e) => onSearch?.("left", e.target.value);
const rightFilter = (e) => onSearch?.("right", e.target.value);
const handleLeftClear = () => onSearch?.("left", "");
const handleRightClear = () => onSearch?.("right", "");
const handleSingleSelect = (direction, holder, selectedKey, checked, currentSelectedIndex) => {
if (holder.has(selectedKey)) {
holder.delete(selectedKey);
setPrevSelectedIndex(direction, null);
}
if (checked) {
holder.add(selectedKey);
setPrevSelectedIndex(direction, currentSelectedIndex);
}
};
const handleMultipleSelect = (direction, data, holder, currentSelectedIndex) => {
(direction === "left" ? leftMultipleSelect : rightMultipleSelect)(currentSelectedIndex, data, holder);
};
const onItemSelect = (direction, selectedKey, checked, multiple) => {
const isLeftDirection = direction === "left";
const holder = isLeftDirection ? sourceSelectedKeys : targetSelectedKeys;
const holderSet = new Set(holder);
const data = (isLeftDirection ? leftDataSource : rightDataSource).filter((item) => !item.disabled);
const currentSelectedIndex = data.findIndex((item) => item.key === selectedKey);
if (multiple && holder.length > 0) handleMultipleSelect(direction, data, holderSet, currentSelectedIndex);
else handleSingleSelect(direction, holderSet, selectedKey, checked, currentSelectedIndex);
const holderArr = Array.from(holderSet);
handleSelectChange(direction, holderArr);
if (!props.selectedKeys) setStateKeys(direction, holderArr);
};
const onLeftItemSelect = (selectedKey, checked, e) => {
onItemSelect("left", selectedKey, checked, e?.shiftKey);
};
const onRightItemSelect = (selectedKey, checked, e) => onItemSelect("right", selectedKey, checked, e?.shiftKey);
const onRightItemRemove = (keys) => {
setStateKeys("right", []);
onChange?.(targetKeys.filter((key) => !keys.includes(key)), "left", _toConsumableArray$8(keys));
};
const handleListStyle = (direction) => {
if (typeof listStyle === "function") return listStyle({ direction });
return listStyle || {};
};
const { hasFeedback, status } = (0, import_react.useContext)(FormItemInputContext);
const getLocale = (transferLocale) => ({
...transferLocale,
notFoundContent: renderEmpty?.("Transfer") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "Transfer" }),
...locale
});
const mergedStatus = getMergedStatus(status, customStatus);
const mergedPagination = !children && pagination;
const leftActive = rightDataSource.filter((d) => targetSelectedKeys.includes(d.key) && !d.disabled).length > 0;
const rightActive = leftDataSource.filter((d) => sourceSelectedKeys.includes(d.key) && !d.disabled).length > 0;
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const cls = clsx(prefixCls, {
[`${prefixCls}-disabled`]: mergedDisabled,
[`${prefixCls}-customize-list`]: !!children,
[`${prefixCls}-rtl`]: isRtl
}, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), contextClassName, className, rootClassName, hashId, cssVarCls, mergedClassNames.root);
const [contextLocale] = useLocale$1("Transfer", localeValues.Transfer);
const listLocale = getLocale(contextLocale);
const [leftTitle, rightTitle] = getTitles(listLocale);
const mergedSelectionsIcon = selectionsIcon ?? contextSelectionsIcon;
{
const warning = devUseWarning("Transfer");
warning(!pagination || !children, "usage", "`pagination` not support customize render list.");
[
["listStyle", "styles.section"],
["operationStyle", "styles.actions"],
["operations", "actions"]
].forEach(([deprecatedName, newName]) => {
warning.deprecated(!(deprecatedName in props), deprecatedName, newName);
});
}
return /* @__PURE__ */ import_react.createElement("div", {
className: cls,
style: {
...contextStyle,
...mergedStyles.root,
...style
}
}, /* @__PURE__ */ import_react.createElement(TransferSection, {
prefixCls,
style: handleListStyle("left"),
classNames: mergedClassNames,
styles: mergedStyles,
titleText: leftTitle,
dataSource: leftDataSource,
filterOption,
checkedKeys: sourceSelectedKeys,
handleFilter: leftFilter,
handleClear: handleLeftClear,
onItemSelect: onLeftItemSelect,
onItemSelectAll: onLeftItemSelectAll,
render,
showSearch,
renderList: children,
footer,
onScroll: handleLeftScroll,
disabled: mergedDisabled,
direction: isRtl ? "right" : "left",
showSelectAll,
selectAllLabel: selectAllLabels[0],
pagination: mergedPagination,
selectionsIcon: mergedSelectionsIcon,
...listLocale
}), /* @__PURE__ */ import_react.createElement(Actions, {
className: clsx(`${prefixCls}-actions`, mergedClassNames.actions),
rightActive,
moveToRight,
leftActive,
actions: mergedActions,
moveToLeft,
style: {
...operationStyle,
...mergedStyles.actions
},
disabled: mergedDisabled,
direction: dir,
oneWay
}), /* @__PURE__ */ import_react.createElement(TransferSection, {
prefixCls,
style: handleListStyle("right"),
classNames: mergedClassNames,
styles: mergedStyles,
titleText: rightTitle,
dataSource: rightDataSource,
filterOption,
checkedKeys: targetSelectedKeys,
handleFilter: rightFilter,
handleClear: handleRightClear,
onItemSelect: onRightItemSelect,
onItemSelectAll: onRightItemSelectAll,
onItemRemove: onRightItemRemove,
render,
showSearch,
renderList: children,
footer,
onScroll: handleRightScroll,
disabled: mergedDisabled,
direction: isRtl ? "left" : "right",
showSelectAll,
selectAllLabel: selectAllLabels[1],
showRemove: oneWay,
pagination: mergedPagination,
selectionsIcon: mergedSelectionsIcon,
...listLocale
}));
};
Transfer.displayName = "Transfer";
Transfer.List = TransferSection;
Transfer.Search = Search;
Transfer.Operation = Actions;
//#endregion
//#region node_modules/@rc-component/tree-select/es/hooks/useCache.js
/**
* This function will try to call requestIdleCallback if available to save performance.
* No need `getLabel` here since already fetch on `rawLabeledValue`.
*/
var useCache_default = ((values) => {
const cacheRef = import_react.useRef({ valueLabels: /* @__PURE__ */ new Map() });
return import_react.useMemo(() => {
const { valueLabels } = cacheRef.current;
const valueLabelsCache = /* @__PURE__ */ new Map();
const filledValues = values.map((item) => {
const { value, label } = item;
const mergedLabel = label ?? valueLabels.get(value);
valueLabelsCache.set(value, mergedLabel);
return {
...item,
label: mergedLabel
};
});
cacheRef.current.valueLabels = valueLabelsCache;
return [filledValues];
}, [values]);
});
//#endregion
//#region node_modules/@rc-component/tree-select/es/hooks/useCheckedKeys.js
var useCheckedKeys = (rawLabeledValues, rawHalfCheckedValues, treeConduction, keyEntities) => {
return import_react.useMemo(() => {
const extractValues = (values) => values.map(({ value }) => value);
const checkedKeys = extractValues(rawLabeledValues);
const halfCheckedKeys = extractValues(rawHalfCheckedValues);
const missingValues = checkedKeys.filter((key) => !keyEntities[key]);
let finalCheckedKeys = checkedKeys;
let finalHalfCheckedKeys = halfCheckedKeys;
if (treeConduction) {
const conductResult = conductCheck(checkedKeys, true, keyEntities);
finalCheckedKeys = conductResult.checkedKeys;
finalHalfCheckedKeys = conductResult.halfCheckedKeys;
}
return [Array.from(new Set([...missingValues, ...finalCheckedKeys])), finalHalfCheckedKeys];
}, [
rawLabeledValues,
rawHalfCheckedValues,
treeConduction,
keyEntities
]);
};
//#endregion
//#region node_modules/@rc-component/tree-select/es/utils/valueUtil.js
var toArray = (value) => Array.isArray(value) ? value : value !== void 0 ? [value] : [];
var fillFieldNames = (fieldNames) => {
const { label, value, children } = fieldNames || {};
return {
_title: label ? [label] : ["title", "label"],
value: value || "value",
key: value || "value",
children: children || "children"
};
};
var isCheckDisabled = (node) => !node || node.disabled || node.disableCheckbox || node.checkable === false;
var getAllKeys = (treeData, fieldNames) => {
const keys = [];
const dig = (list) => {
list.forEach((item) => {
const children = item[fieldNames.children];
if (children) {
keys.push(item[fieldNames.value]);
dig(children);
}
});
};
dig(treeData);
return keys;
};
var isNil = (val) => val === null || val === void 0;
//#endregion
//#region node_modules/@rc-component/tree-select/es/hooks/useDataEntities.js
var useDataEntities_default = ((treeData, fieldNames) => import_react.useMemo(() => {
return convertDataToEntities(treeData, {
fieldNames,
initWrapper: (wrapper) => ({
...wrapper,
valueEntities: /* @__PURE__ */ new Map()
}),
processEntity: (entity, wrapper) => {
const val = entity.node[fieldNames.value];
{
const key = entity.node.key;
warningOnce(!isNil(val), "TreeNode `value` is invalidate: undefined");
warningOnce(!wrapper.valueEntities.has(val), `Same \`value\` exist in the tree: ${val}`);
warningOnce(!key || String(key) === String(val), `\`key\` or \`value\` with TreeNode must be the same or you can remove one of them. key: ${key}, value: ${val}.`);
}
wrapper.valueEntities.set(val, entity);
}
});
}, [treeData, fieldNames]));
//#endregion
//#region node_modules/@rc-component/tree-select/es/TreeNode.js
/* istanbul ignore file */
/** This is a placeholder, not real render in dom */
var TreeNode = () => null;
//#endregion
//#region node_modules/@rc-component/tree-select/es/utils/legacyUtil.js
function convertChildrenToData(nodes) {
return toArray$8(nodes).map((node) => {
if (!/* @__PURE__ */ import_react.isValidElement(node) || !node.type) return null;
const { key, props: { children, value, ...restProps } } = node;
const data = {
key,
value,
...restProps
};
const childData = convertChildrenToData(children);
if (childData.length) data.children = childData;
return data;
}).filter((data) => data);
}
function fillLegacyProps(dataNode) {
if (!dataNode) return dataNode;
const cloneNode = { ...dataNode };
if (!("props" in cloneNode)) Object.defineProperty(cloneNode, "props", { get() {
warningOnce(false, "New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access.");
return cloneNode;
} });
return cloneNode;
}
function fillAdditionalInfo(extra, triggerValue, checkedValues, treeData, showPosition, fieldNames) {
let triggerNode = null;
let nodeList = null;
function generateMap() {
function dig(list, level = "0", parentIncluded = false) {
return list.map((option, index) => {
const pos = `${level}-${index}`;
const value = option[fieldNames.value];
const included = checkedValues.includes(value);
const children = dig(option[fieldNames.children] || [], pos, included);
const node = /* @__PURE__ */ import_react.createElement(TreeNode, option, children.map((child) => child.node));
if (triggerValue === value) triggerNode = node;
if (included) {
const checkedNode = {
pos,
node,
children
};
if (!parentIncluded) nodeList.push(checkedNode);
return checkedNode;
}
return null;
}).filter((node) => node);
}
if (!nodeList) {
nodeList = [];
dig(treeData);
nodeList.sort(({ node: { props: { value: val1 } } }, { node: { props: { value: val2 } } }) => {
return checkedValues.indexOf(val1) - checkedValues.indexOf(val2);
});
}
}
Object.defineProperty(extra, "triggerNode", { get() {
warningOnce(false, "`triggerNode` is deprecated. Please consider decoupling data with node.");
generateMap();
return triggerNode;
} });
Object.defineProperty(extra, "allCheckedNodes", { get() {
warningOnce(false, "`allCheckedNodes` is deprecated. Please consider decoupling data with node.");
generateMap();
if (showPosition) return nodeList;
return nodeList.map(({ node }) => node);
} });
}
//#endregion
//#region node_modules/@rc-component/tree-select/es/hooks/useFilterTreeData.js
var useFilterTreeData = (treeData, searchValue, options) => {
const { fieldNames, treeNodeFilterProp, filterTreeNode } = options;
const { children: fieldChildren } = fieldNames;
return import_react.useMemo(() => {
if (!searchValue || filterTreeNode === false) return treeData;
const filterOptionFunc = typeof filterTreeNode === "function" ? filterTreeNode : (_, dataNode) => String(dataNode[treeNodeFilterProp]).toUpperCase().includes(searchValue.toUpperCase());
const filterTreeNodes = (nodes, keepAll = false) => nodes.reduce((filtered, node) => {
const children = node[fieldChildren];
const isMatch = keepAll || filterOptionFunc(searchValue, fillLegacyProps(node));
const filteredChildren = filterTreeNodes(children || [], isMatch);
if (isMatch || filteredChildren.length) filtered.push({
...node,
isLeaf: void 0,
[fieldChildren]: filteredChildren
});
return filtered;
}, []);
return filterTreeNodes(treeData);
}, [
treeData,
searchValue,
fieldChildren,
treeNodeFilterProp,
filterTreeNode
]);
};
//#endregion
//#region node_modules/@rc-component/tree-select/es/hooks/useRefFunc.js
/**
* Same as `React.useCallback` but always return a memoized function
* but redirect to real function.
*/
function useRefFunc(callback) {
const funcRef = import_react.useRef();
funcRef.current = callback;
return import_react.useCallback((...args) => {
return funcRef.current(...args);
}, []);
}
//#endregion
//#region node_modules/@rc-component/tree-select/es/hooks/useTreeData.js
function buildTreeStructure(nodes, config) {
const { id, pId, rootPId } = config;
const nodeMap = /* @__PURE__ */ new Map();
const rootNodes = [];
nodes.forEach((node) => {
const nodeKey = node[id];
const clonedNode = {
...node,
key: node.key || nodeKey
};
nodeMap.set(nodeKey, clonedNode);
});
nodeMap.forEach((node) => {
const parentKey = node[pId];
const parent = nodeMap.get(parentKey);
if (parent) {
parent.children = parent.children || [];
parent.children.push(node);
} else if (parentKey === rootPId || rootPId === null) rootNodes.push(node);
});
return rootNodes;
}
/**
* 将 `treeData` 或 `children` 转换为格式化的 `treeData`。
* 如果 `treeData` 或 `children` 没有变化,则不会重新计算。
*/
function useTreeData(treeData, children, simpleMode) {
return import_react.useMemo(() => {
if (treeData) {
if (simpleMode) return buildTreeStructure(treeData, {
id: "id",
pId: "pId",
rootPId: null,
...typeof simpleMode === "object" ? simpleMode : {}
});
return treeData;
}
return convertChildrenToData(children);
}, [
children,
simpleMode,
treeData
]);
}
//#endregion
//#region node_modules/@rc-component/tree-select/es/LegacyContext.js
var LegacySelectContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/tree-select/es/TreeSelectContext.js
var TreeSelectContext = /* @__PURE__ */ import_react.createContext(null);
//#endregion
//#region node_modules/@rc-component/tree-select/es/OptionList.js
function _extends$3() {
_extends$3 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$3.apply(this, arguments);
}
var HIDDEN_STYLE = {
width: 0,
height: 0,
display: "flex",
overflow: "hidden",
opacity: 0,
border: 0,
padding: 0,
margin: 0
};
var OptionList = (_, ref) => {
const { prefixCls, multiple, searchValue, toggleOpen, open, notFoundContent } = useBaseProps();
const { virtual, listHeight, listItemHeight, listItemScrollOffset, treeData, fieldNames, onSelect, popupMatchSelectWidth, treeExpandAction, treeTitleRender, onPopupScroll, leftMaxCount, leafCountOnly, valueEntities, classNames: treeClassNames, styles } = import_react.useContext(TreeSelectContext);
const { checkable, checkedKeys, halfCheckedKeys, treeExpandedKeys, treeDefaultExpandAll, treeDefaultExpandedKeys, onTreeExpand, treeIcon, showTreeIcon, switcherIcon, treeLine, treeNodeFilterProp, loadData, treeLoadedKeys, treeMotion, onTreeLoad, keyEntities } = import_react.useContext(LegacySelectContext);
const treeRef = import_react.useRef();
const memoTreeData = useMemo$44(() => treeData, [open, treeData], (prev, next) => next[0] && prev[1] !== next[1]);
const mergedCheckedKeys = import_react.useMemo(() => {
if (!checkable) return null;
return {
checked: checkedKeys,
halfChecked: halfCheckedKeys
};
}, [
checkable,
checkedKeys,
halfCheckedKeys
]);
import_react.useEffect(() => {
if (open && !multiple && checkedKeys.length) treeRef.current?.scrollTo({ key: checkedKeys[0] });
}, [open]);
const onListMouseDown = (event) => {
event.preventDefault();
};
const onInternalSelect = (__, info) => {
const { node } = info;
if (checkable && isCheckDisabled(node)) return;
onSelect(node.key, { selected: !checkedKeys.includes(node.key) });
if (!multiple) toggleOpen(false);
};
const [expandedKeys, setExpandedKeys] = import_react.useState(treeDefaultExpandedKeys);
const [searchExpandedKeys, setSearchExpandedKeys] = import_react.useState(null);
const mergedExpandedKeys = import_react.useMemo(() => {
if (treeExpandedKeys) return [...treeExpandedKeys];
return searchValue ? searchExpandedKeys : expandedKeys;
}, [
expandedKeys,
searchExpandedKeys,
treeExpandedKeys,
searchValue
]);
const onInternalExpand = (keys) => {
setExpandedKeys(keys);
setSearchExpandedKeys(keys);
if (onTreeExpand) onTreeExpand(keys);
};
const lowerSearchValue = String(searchValue).toLowerCase();
const filterTreeNode = (treeNode) => {
if (!lowerSearchValue) return false;
return String(treeNode[treeNodeFilterProp]).toLowerCase().includes(lowerSearchValue);
};
import_react.useEffect(() => {
if (searchValue) setSearchExpandedKeys(getAllKeys(treeData, fieldNames));
}, [searchValue]);
const [disabledCache, setDisabledCache] = import_react.useState(() => /* @__PURE__ */ new Map());
import_react.useEffect(() => {
if (leftMaxCount) setDisabledCache(/* @__PURE__ */ new Map());
}, [leftMaxCount]);
function getDisabledWithCache(node) {
const value = node[fieldNames.value];
if (!disabledCache.has(value)) {
const entity = valueEntities.get(value);
if (!((entity.children || []).length === 0)) {
const checkableChildrenCount = entity.children.filter((childTreeNode) => !childTreeNode.node.disabled && !childTreeNode.node.disableCheckbox && !checkedKeys.includes(childTreeNode.node[fieldNames.value])).length;
disabledCache.set(value, checkableChildrenCount > leftMaxCount);
} else disabledCache.set(value, false);
}
return disabledCache.get(value);
}
const nodeDisabled = useEvent((node) => {
const nodeValue = node[fieldNames.value];
if (checkedKeys.includes(nodeValue)) return false;
if (leftMaxCount === null) return false;
if (leftMaxCount <= 0) return true;
if (leafCountOnly && leftMaxCount) return getDisabledWithCache(node);
return false;
});
const getFirstMatchingNode = (nodes) => {
for (const node of nodes) {
if (node.disabled || node.selectable === false) continue;
if (searchValue) {
if (filterTreeNode(node)) return node;
} else return node;
if (node[fieldNames.children]) {
const matchInChildren = getFirstMatchingNode(node[fieldNames.children]);
if (matchInChildren) return matchInChildren;
}
}
return null;
};
const [activeKey, setActiveKey] = import_react.useState(null);
const activeEntity = keyEntities[activeKey];
import_react.useEffect(() => {
if (!open) return;
let nextActiveKey = null;
const getFirstNode = () => {
const firstNode = getFirstMatchingNode(memoTreeData);
return firstNode ? firstNode[fieldNames.value] : null;
};
if (!multiple && checkedKeys.length && !searchValue) nextActiveKey = checkedKeys[0];
else nextActiveKey = getFirstNode();
setActiveKey(nextActiveKey);
}, [open, searchValue]);
import_react.useImperativeHandle(ref, () => ({
scrollTo: treeRef.current?.scrollTo,
onKeyDown: (event) => {
const { which } = event;
switch (which) {
case KeyCode.UP:
case KeyCode.DOWN:
case KeyCode.LEFT:
case KeyCode.RIGHT:
treeRef.current?.onKeyDown(event);
break;
case KeyCode.ENTER:
if (activeEntity) {
const isNodeDisabled = nodeDisabled(activeEntity.node);
const { selectable, value, disabled } = activeEntity?.node || {};
if (selectable !== false && !disabled && !isNodeDisabled) onInternalSelect(null, {
node: { key: activeKey },
selected: !checkedKeys.includes(value)
});
}
break;
case KeyCode.ESC: toggleOpen(false);
}
},
onKeyUp: () => {}
}));
const syncLoadData = useMemo$44(() => searchValue ? false : true, [searchValue, treeExpandedKeys || expandedKeys], ([preSearchValue], [nextSearchValue, nextExcludeSearchExpandedKeys]) => preSearchValue !== nextSearchValue && !!(nextSearchValue || nextExcludeSearchExpandedKeys)) ? loadData : null;
if (memoTreeData.length === 0) return /* @__PURE__ */ import_react.createElement("div", {
role: "listbox",
className: `${prefixCls}-empty`,
onMouseDown: onListMouseDown
}, notFoundContent);
const treeProps = { fieldNames };
if (treeLoadedKeys) treeProps.loadedKeys = treeLoadedKeys;
if (mergedExpandedKeys) treeProps.expandedKeys = mergedExpandedKeys;
return /* @__PURE__ */ import_react.createElement("div", { onMouseDown: onListMouseDown }, activeEntity && open && /* @__PURE__ */ import_react.createElement("span", {
style: HIDDEN_STYLE,
"aria-live": "assertive"
}, activeEntity.node.value), /* @__PURE__ */ import_react.createElement(UnstableContext.Provider, { value: { nodeDisabled } }, /* @__PURE__ */ import_react.createElement(es_default$3, _extends$3({
classNames: treeClassNames?.popup,
styles: styles?.popup,
ref: treeRef,
focusable: false,
prefixCls: `${prefixCls}-tree`,
treeData: memoTreeData,
height: listHeight,
itemHeight: listItemHeight,
itemScrollOffset: listItemScrollOffset,
virtual: virtual !== false && popupMatchSelectWidth !== false,
multiple,
icon: treeIcon,
showIcon: showTreeIcon,
switcherIcon,
showLine: treeLine,
loadData: syncLoadData,
motion: treeMotion,
activeKey,
checkable,
checkStrictly: true,
checkedKeys: mergedCheckedKeys,
selectedKeys: !checkable ? checkedKeys : [],
defaultExpandAll: treeDefaultExpandAll,
titleRender: treeTitleRender
}, treeProps, {
onActiveChange: setActiveKey,
onSelect: onInternalSelect,
onCheck: onInternalSelect,
onExpand: onInternalExpand,
onLoad: onTreeLoad,
filterTreeNode,
expandAction: treeExpandAction,
onScroll: onPopupScroll
}))));
};
var RefOptionList = /* @__PURE__ */ import_react.forwardRef(OptionList);
RefOptionList.displayName = "OptionList";
//#endregion
//#region node_modules/@rc-component/tree-select/es/utils/strategyUtil.js
var SHOW_ALL = "SHOW_ALL";
var SHOW_PARENT = "SHOW_PARENT";
var SHOW_CHILD = "SHOW_CHILD";
function formatStrategyValues(values, strategy, keyEntities, fieldNames) {
const valueSet = new Set(values);
if (strategy === "SHOW_CHILD") return values.filter((key) => {
const entity = keyEntities[key];
return !entity || !entity.children || !entity.children.some(({ node }) => valueSet.has(node[fieldNames.value])) || !entity.children.every(({ node }) => isCheckDisabled(node) || valueSet.has(node[fieldNames.value]));
});
if (strategy === "SHOW_PARENT") return values.filter((key) => {
const entity = keyEntities[key];
const parent = entity ? entity.parent : null;
return !parent || isCheckDisabled(parent.node) || !valueSet.has(parent.key);
});
return values;
}
//#endregion
//#region node_modules/@rc-component/tree-select/es/utils/warningPropsUtil.js
function warningProps(props) {
const { searchPlaceholder, treeCheckStrictly, treeCheckable, labelInValue, value, multiple, showCheckedStrategy, maxCount } = props;
warningOnce(!searchPlaceholder, "`searchPlaceholder` has been removed.");
if (treeCheckStrictly && labelInValue === false) warningOnce(false, "`treeCheckStrictly` will force set `labelInValue` to `true`.");
if (labelInValue || treeCheckStrictly) warningOnce(toArray(value).every((val) => val && typeof val === "object" && "value" in val), "Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead.");
if (treeCheckStrictly || multiple || treeCheckable) warningOnce(!value || Array.isArray(value), "`value` should be an array when `TreeSelect` is checkable or multiple.");
else warningOnce(!Array.isArray(value), "`value` should not be array when `TreeSelect` is single mode.");
if (maxCount && (showCheckedStrategy === "SHOW_ALL" && !treeCheckStrictly || showCheckedStrategy === "SHOW_PARENT")) warningOnce(false, "`maxCount` not work with `showCheckedStrategy=SHOW_ALL` (when `treeCheckStrictly=false`) or `showCheckedStrategy=SHOW_PARENT`.");
}
//#endregion
//#region node_modules/@rc-component/tree-select/es/hooks/useSearchConfig.js
function useSearchConfig(showSearch, props) {
const { searchValue, inputValue, onSearch, autoClearSearchValue, filterTreeNode, treeNodeFilterProp } = props;
return import_react.useMemo(() => {
const isObject = typeof showSearch === "object";
const searchConfig = {
searchValue: searchValue ?? inputValue,
onSearch,
autoClearSearchValue,
filterTreeNode,
treeNodeFilterProp,
...isObject ? showSearch : {}
};
return [isObject ? true : showSearch, searchConfig];
}, [
showSearch,
searchValue,
inputValue,
onSearch,
autoClearSearchValue,
filterTreeNode,
treeNodeFilterProp
]);
}
//#endregion
//#region node_modules/@rc-component/tree-select/es/TreeSelect.js
function _extends$2() {
_extends$2 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$2.apply(this, arguments);
}
function isRawValue(value) {
return !value || typeof value !== "object";
}
var TreeSelect$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { id, prefixCls = "rc-tree-select", value, defaultValue, onChange, onSelect, onDeselect, showSearch, searchValue: legacySearchValue, inputValue: legacyinputValue, onSearch: legacyOnSearch, autoClearSearchValue: legacyAutoClearSearchValue, filterTreeNode: legacyFilterTreeNode, treeNodeFilterProp: legacytreeNodeFilterProp, showCheckedStrategy, treeNodeLabelProp, multiple, treeCheckable, treeCheckStrictly, labelInValue, maxCount, fieldNames, treeDataSimpleMode, treeData, children, loadData, treeLoadedKeys, onTreeLoad, treeDefaultExpandAll, treeExpandedKeys, treeDefaultExpandedKeys, onTreeExpand, treeExpandAction, virtual, listHeight = 200, listItemHeight = 20, listItemScrollOffset = 0, onPopupVisibleChange, popupMatchSelectWidth = true, treeLine, treeIcon, showTreeIcon, switcherIcon, treeMotion, treeTitleRender, onPopupScroll, classNames: treeSelectClassNames, styles, ...restProps } = props;
const mergedId = useId_default(id);
const treeConduction = treeCheckable && !treeCheckStrictly;
const mergedCheckable = treeCheckable || treeCheckStrictly;
const mergedLabelInValue = treeCheckStrictly || labelInValue;
const mergedMultiple = mergedCheckable || multiple;
const [mergedShowSearch, searchConfig] = useSearchConfig(showSearch, {
searchValue: legacySearchValue,
inputValue: legacyinputValue,
onSearch: legacyOnSearch,
autoClearSearchValue: legacyAutoClearSearchValue,
filterTreeNode: legacyFilterTreeNode,
treeNodeFilterProp: legacytreeNodeFilterProp
});
const { searchValue, onSearch, autoClearSearchValue = true, filterTreeNode, treeNodeFilterProp = "value" } = searchConfig;
const [internalValue, setInternalValue] = useControlledState(defaultValue, value);
const mergedShowCheckedStrategy = import_react.useMemo(() => {
if (!treeCheckable) return SHOW_ALL;
return showCheckedStrategy || "SHOW_CHILD";
}, [showCheckedStrategy, treeCheckable]);
warningProps(props);
const mergedFieldNames = import_react.useMemo(() => fillFieldNames(fieldNames), [JSON.stringify(fieldNames)]);
const [internalSearchValue, setSearchValue] = useControlledState("", searchValue);
const mergedSearchValue = internalSearchValue || "";
const onInternalSearch = (searchText) => {
setSearchValue(searchText);
onSearch?.(searchText);
};
const mergedTreeData = useTreeData(treeData, children, treeDataSimpleMode);
const { keyEntities, valueEntities } = useDataEntities_default(mergedTreeData, mergedFieldNames);
/** Get `missingRawValues` which not exist in the tree yet */
const splitRawValues = import_react.useCallback((newRawValues) => {
const missingRawValues = [];
const existRawValues = [];
newRawValues.forEach((val) => {
if (valueEntities.has(val)) existRawValues.push(val);
else missingRawValues.push(val);
});
return {
missingRawValues,
existRawValues
};
}, [valueEntities]);
const filteredTreeData = useFilterTreeData(mergedTreeData, mergedSearchValue, {
fieldNames: mergedFieldNames,
treeNodeFilterProp,
filterTreeNode
});
const getLabel = import_react.useCallback((item) => {
if (item) {
if (treeNodeLabelProp) return item[treeNodeLabelProp];
const { _title: titleList } = mergedFieldNames;
for (let i = 0; i < titleList.length; i += 1) {
const title = item[titleList[i]];
if (title !== void 0) return title;
}
}
}, [mergedFieldNames, treeNodeLabelProp]);
const toLabeledValues = import_react.useCallback((draftValues) => {
return toArray(draftValues).map((val) => {
if (isRawValue(val)) return { value: val };
return val;
});
}, []);
const convert2LabelValues = import_react.useCallback((draftValues) => {
return toLabeledValues(draftValues).map((item) => {
let { label: rawLabel } = item;
const { value: rawValue, halfChecked: rawHalfChecked } = item;
let rawDisabled;
const entity = valueEntities.get(rawValue);
if (entity) {
rawLabel = treeTitleRender ? treeTitleRender(entity.node) : rawLabel ?? getLabel(entity.node);
rawDisabled = entity.node.disabled;
} else if (rawLabel === void 0) rawLabel = toLabeledValues(internalValue).find((labeledItem) => labeledItem.value === rawValue).label;
return {
label: rawLabel,
value: rawValue,
halfChecked: rawHalfChecked,
disabled: rawDisabled
};
});
}, [
valueEntities,
getLabel,
toLabeledValues,
internalValue
]);
const rawMixedLabeledValues = import_react.useMemo(() => toLabeledValues(internalValue === null ? [] : internalValue), [toLabeledValues, internalValue]);
const [rawLabeledValues, rawHalfLabeledValues] = import_react.useMemo(() => {
const fullCheckValues = [];
const halfCheckValues = [];
rawMixedLabeledValues.forEach((item) => {
if (item.halfChecked) halfCheckValues.push(item);
else fullCheckValues.push(item);
});
return [fullCheckValues, halfCheckValues];
}, [rawMixedLabeledValues]);
const rawValues = import_react.useMemo(() => rawLabeledValues.map((item) => item.value), [rawLabeledValues]);
const [rawCheckedValues, rawHalfCheckedValues] = useCheckedKeys(rawLabeledValues, rawHalfLabeledValues, treeConduction, keyEntities);
const [cachedDisplayValues] = useCache_default(import_react.useMemo(() => {
const rawDisplayValues = convert2LabelValues(formatStrategyValues(rawCheckedValues, mergedShowCheckedStrategy, keyEntities, mergedFieldNames).map((key) => keyEntities[key]?.node?.[mergedFieldNames.value] ?? key).map((val) => {
const targetItem = rawLabeledValues.find((item) => item.value === val);
return {
value: val,
label: labelInValue ? targetItem?.label : treeTitleRender?.(targetItem)
};
}));
const firstVal = rawDisplayValues[0];
if (!mergedMultiple && firstVal && isNil(firstVal.value) && isNil(firstVal.label)) return [];
return rawDisplayValues.map((item) => ({
...item,
label: item.label ?? item.value
}));
}, [
mergedFieldNames,
mergedMultiple,
rawCheckedValues,
rawLabeledValues,
convert2LabelValues,
mergedShowCheckedStrategy,
keyEntities
]));
const mergedMaxCount = import_react.useMemo(() => {
if (mergedMultiple && (mergedShowCheckedStrategy === "SHOW_CHILD" || treeCheckStrictly || !treeCheckable)) return maxCount;
return null;
}, [
maxCount,
mergedMultiple,
treeCheckStrictly,
mergedShowCheckedStrategy,
treeCheckable
]);
const triggerChange = useRefFunc((newRawValues, extra, source) => {
const formattedKeyList = formatStrategyValues(newRawValues, mergedShowCheckedStrategy, keyEntities, mergedFieldNames);
if (mergedMaxCount && formattedKeyList.length > mergedMaxCount) return;
setInternalValue(convert2LabelValues(newRawValues));
if (autoClearSearchValue) setSearchValue("");
if (onChange) {
let eventValues = newRawValues;
if (treeConduction) eventValues = formattedKeyList.map((key) => {
const entity = valueEntities.get(key);
return entity ? entity.node[mergedFieldNames.value] : key;
});
const { triggerValue, selected } = extra || {
triggerValue: void 0,
selected: void 0
};
let returnRawValues = eventValues;
if (treeCheckStrictly) {
const halfValues = rawHalfLabeledValues.filter((item) => !eventValues.includes(item.value));
returnRawValues = [...returnRawValues, ...halfValues];
}
const returnLabeledValues = convert2LabelValues(returnRawValues);
const additionalInfo = {
preValue: rawLabeledValues,
triggerValue
};
let showPosition = true;
if (treeCheckStrictly || source === "selection" && !selected) showPosition = false;
fillAdditionalInfo(additionalInfo, triggerValue, newRawValues, mergedTreeData, showPosition, mergedFieldNames);
if (mergedCheckable) additionalInfo.checked = selected;
else additionalInfo.selected = selected;
const returnValues = mergedLabelInValue ? returnLabeledValues : returnLabeledValues.map((item) => item.value);
onChange(mergedMultiple ? returnValues : returnValues[0], mergedLabelInValue ? null : returnLabeledValues.map((item) => item.label), additionalInfo);
}
});
/** Trigger by option list */
const onOptionSelect = import_react.useCallback((selectedKey, { selected, source }) => {
const node = keyEntities[selectedKey]?.node;
const selectedValue = node?.[mergedFieldNames.value] ?? selectedKey;
if (!mergedMultiple) triggerChange([selectedValue], {
selected: true,
triggerValue: selectedValue
}, "option");
else {
let newRawValues = selected ? [...rawValues, selectedValue] : rawCheckedValues.filter((v) => v !== selectedValue);
if (treeConduction) {
const { missingRawValues, existRawValues } = splitRawValues(newRawValues);
const keyList = existRawValues.map((val) => valueEntities.get(val).key);
let checkedKeys;
if (selected) ({checkedKeys} = conductCheck(keyList, true, keyEntities));
else ({checkedKeys} = conductCheck(keyList, {
checked: false,
halfCheckedKeys: rawHalfCheckedValues
}, keyEntities));
newRawValues = [...missingRawValues, ...checkedKeys.map((key) => keyEntities[key].node[mergedFieldNames.value])];
}
triggerChange(newRawValues, {
selected,
triggerValue: selectedValue
}, source || "option");
}
if (selected || !mergedMultiple) onSelect?.(selectedValue, fillLegacyProps(node));
else onDeselect?.(selectedValue, fillLegacyProps(node));
}, [
splitRawValues,
valueEntities,
keyEntities,
mergedFieldNames,
mergedMultiple,
rawValues,
triggerChange,
treeConduction,
onSelect,
onDeselect,
rawCheckedValues,
rawHalfCheckedValues,
maxCount
]);
const onInternalPopupVisibleChange = import_react.useCallback((open) => {
if (onPopupVisibleChange) onPopupVisibleChange(open);
}, [onPopupVisibleChange]);
const onDisplayValuesChange = useRefFunc((newValues, info) => {
const newRawValues = newValues.map((item) => item.value);
if (info.type === "clear") {
triggerChange(newRawValues, {}, "selection");
return;
}
if (info.values.length) onOptionSelect(info.values[0].value, {
selected: false,
source: "selection"
});
});
const treeSelectContext = import_react.useMemo(() => {
return {
virtual,
popupMatchSelectWidth,
listHeight,
listItemHeight,
listItemScrollOffset,
treeData: filteredTreeData,
fieldNames: mergedFieldNames,
onSelect: onOptionSelect,
treeExpandAction,
treeTitleRender,
onPopupScroll,
leftMaxCount: maxCount === void 0 ? null : maxCount - cachedDisplayValues.length,
leafCountOnly: mergedShowCheckedStrategy === "SHOW_CHILD" && !treeCheckStrictly && !!treeCheckable,
valueEntities,
classNames: treeSelectClassNames,
styles
};
}, [
virtual,
popupMatchSelectWidth,
listHeight,
listItemHeight,
listItemScrollOffset,
filteredTreeData,
mergedFieldNames,
onOptionSelect,
treeExpandAction,
treeTitleRender,
onPopupScroll,
maxCount,
cachedDisplayValues.length,
mergedShowCheckedStrategy,
treeCheckStrictly,
treeCheckable,
valueEntities,
treeSelectClassNames,
styles
]);
const legacyContext = import_react.useMemo(() => ({
checkable: mergedCheckable,
loadData,
treeLoadedKeys,
onTreeLoad,
checkedKeys: rawCheckedValues,
halfCheckedKeys: rawHalfCheckedValues,
treeDefaultExpandAll,
treeExpandedKeys,
treeDefaultExpandedKeys,
onTreeExpand,
treeIcon,
treeMotion,
showTreeIcon,
switcherIcon,
treeLine,
treeNodeFilterProp,
keyEntities
}), [
mergedCheckable,
loadData,
treeLoadedKeys,
onTreeLoad,
rawCheckedValues,
rawHalfCheckedValues,
treeDefaultExpandAll,
treeExpandedKeys,
treeDefaultExpandedKeys,
onTreeExpand,
treeIcon,
treeMotion,
showTreeIcon,
switcherIcon,
treeLine,
treeNodeFilterProp,
keyEntities
]);
return /* @__PURE__ */ import_react.createElement(TreeSelectContext.Provider, { value: treeSelectContext }, /* @__PURE__ */ import_react.createElement(LegacySelectContext.Provider, { value: legacyContext }, /* @__PURE__ */ import_react.createElement(BaseSelect, _extends$2({ ref }, restProps, {
classNames: treeSelectClassNames,
styles,
id: mergedId,
prefixCls,
mode: mergedMultiple ? "multiple" : void 0,
displayValues: cachedDisplayValues,
onDisplayValuesChange,
autoClearSearchValue,
showSearch: mergedShowSearch,
searchValue: mergedSearchValue,
onSearch: onInternalSearch,
OptionList: RefOptionList,
emptyOptions: !mergedTreeData.length,
onPopupVisibleChange: onInternalPopupVisibleChange,
popupMatchSelectWidth
}))));
});
TreeSelect$1.displayName = "TreeSelect";
var GenericTreeSelect = TreeSelect$1;
GenericTreeSelect.TreeNode = TreeNode;
GenericTreeSelect.SHOW_ALL = SHOW_ALL;
GenericTreeSelect.SHOW_PARENT = SHOW_PARENT;
GenericTreeSelect.SHOW_CHILD = SHOW_CHILD;
//#endregion
//#region node_modules/@rc-component/tree-select/es/index.js
var es_default$1 = GenericTreeSelect;
//#endregion
//#region node_modules/antd/es/tree-select/style/index.js
var genBaseStyle$1 = (token) => {
const { componentCls, treePrefixCls, colorBgElevated } = token;
const treeCls = `.${treePrefixCls}`;
return [{ [`${componentCls}-dropdown`]: [
{ padding: `${unit$1(token.paddingXS)} ${unit$1(token.calc(token.paddingXS).div(2).equal())}` },
genTreeStyle(treePrefixCls, merge(token, { colorBgContainer: colorBgElevated }), false),
{ [treeCls]: {
borderRadius: 0,
[`${treeCls}-list-holder-inner`]: {
alignItems: "stretch",
[`${treeCls}-treenode`]: { [`${treeCls}-node-content-wrapper`]: { flex: "auto" } }
}
} },
getStyle(`${treePrefixCls}-checkbox`, token),
{ "&-rtl": {
direction: "rtl",
[`${treeCls}-switcher${treeCls}-switcher_close`]: { [`${treeCls}-switcher-icon svg`]: { transform: "rotate(90deg)" } }
} }
] }];
};
function useTreeSelectStyle(prefixCls, treePrefixCls, rootCls) {
return genStyleHooks("TreeSelect", (token) => {
return genBaseStyle$1(merge(token, { treePrefixCls }));
}, initComponentToken, { resetFont: false })(prefixCls, rootCls);
}
//#endregion
//#region node_modules/antd/es/tree-select/index.js
var InternalTreeSelect = (props, ref) => {
const { prefixCls: customizePrefixCls, size: customizeSize, disabled: customDisabled, bordered = true, style, className, rootClassName, treeCheckable, multiple, listHeight = 256, listItemHeight: customListItemHeight, placement, notFoundContent, switcherIcon: customSwitcherIcon, treeLine, getPopupContainer, popupClassName, dropdownClassName, treeIcon = false, transitionName, choiceTransitionName = "", status: customStatus, treeExpandAction, builtinPlacements, dropdownMatchSelectWidth, popupMatchSelectWidth, allowClear, variant: customVariant, dropdownStyle: _dropdownStyle, dropdownRender, popupRender, onDropdownVisibleChange, onOpenChange, tagRender, maxCount, showCheckedStrategy, treeCheckStrictly, styles, classNames, ...restProps } = props;
const { getPrefixCls, getPopupContainer: getContextPopupContainer, direction, styles: contextStyles, classNames: contextClassNames, switcherIcon } = useComponentConfig("treeSelect");
const { renderEmpty, virtual, popupMatchSelectWidth: contextPopupMatchSelectWidth, popupOverflow } = import_react.useContext(ConfigContext);
const [, token] = useToken$1();
const listItemHeight = customListItemHeight ?? token?.controlHeightSM + token?.paddingXXS;
{
const warning = devUseWarning("TreeSelect");
Object.entries({
dropdownMatchSelectWidth: "popupMatchSelectWidth",
dropdownStyle: "styles.popup.root",
dropdownClassName: "classNames.popup.root",
popupClassName: "classNames.popup.root",
dropdownRender: "popupRender",
onDropdownVisibleChange: "onOpenChange",
bordered: "variant"
}).forEach(([oldProp, newProp]) => {
warning.deprecated(!(oldProp in props), oldProp, newProp);
});
warning(multiple !== false || !treeCheckable, "usage", "`multiple` will always be `true` when `treeCheckable` is true");
warning(!("showArrow" in props), "deprecated", "`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null.");
}
const rootPrefixCls = getPrefixCls();
const prefixCls = getPrefixCls("select", customizePrefixCls);
const treePrefixCls = getPrefixCls("select-tree", customizePrefixCls);
const treeSelectPrefixCls = getPrefixCls("tree-select", customizePrefixCls);
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const rootCls = useCSSVarCls(prefixCls);
const treeSelectRootCls = useCSSVarCls(treeSelectPrefixCls);
const [hashId, cssVarCls] = style_default$52(prefixCls, rootCls);
useTreeSelectStyle(treeSelectPrefixCls, treePrefixCls, treeSelectRootCls);
const [variant, enableVariantCls] = useVariant("treeSelect", customVariant, bordered);
const mergedSize = useSize((ctx) => customizeSize ?? compactSize ?? ctx);
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const { status: contextStatus, hasFeedback, isFormItemInput, feedbackIcon } = import_react.useContext(FormItemInputContext);
const mergedStatus = getMergedStatus(contextStatus, customStatus);
const mergedProps = {
...props,
size: mergedSize,
disabled: mergedDisabled,
status: mergedStatus,
variant
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps }, { popup: { _default: "root" } });
const mergedPopupClassName = clsx(popupClassName || dropdownClassName, `${treeSelectPrefixCls}-dropdown`, { [`${treeSelectPrefixCls}-dropdown-rtl`]: direction === "rtl" }, rootClassName, mergedClassNames.root, mergedClassNames.popup?.root, cssVarCls, rootCls, treeSelectRootCls, hashId);
const mergedPopupRender = usePopupRender(popupRender || dropdownRender);
const mergedOnOpenChange = onOpenChange || onDropdownVisibleChange;
const isMultiple = !!(treeCheckable || multiple);
const mergedMaxCount = import_react.useMemo(() => {
if (maxCount && (showCheckedStrategy === "SHOW_ALL" && !treeCheckStrictly || showCheckedStrategy === "SHOW_PARENT")) return;
return maxCount;
}, [
maxCount,
showCheckedStrategy,
treeCheckStrictly
]);
const showSuffixIcon = useShowArrow(props.suffixIcon, props.showArrow);
const mergedPopupMatchSelectWidth = popupMatchSelectWidth ?? dropdownMatchSelectWidth ?? contextPopupMatchSelectWidth;
const { suffixIcon, removeIcon, clearIcon } = useIcons$2({
...restProps,
multiple: isMultiple,
showSuffixIcon,
hasFeedback,
feedbackIcon,
prefixCls,
componentName: "TreeSelect"
});
const mergedAllowClear = allowClear === true ? { clearIcon } : allowClear;
let mergedNotFound;
if (notFoundContent !== void 0) mergedNotFound = notFoundContent;
else mergedNotFound = renderEmpty?.("Select") || /* @__PURE__ */ import_react.createElement(DefaultRenderEmpty, { componentName: "Select" });
const selectProps = omit(restProps, [
"suffixIcon",
"removeIcon",
"clearIcon"
]);
const memoizedPlacement = import_react.useMemo(() => {
if (placement !== void 0) return placement;
return direction === "rtl" ? "bottomRight" : "bottomLeft";
}, [placement, direction]);
const mergedClassName = clsx(!customizePrefixCls && treeSelectPrefixCls, {
[`${prefixCls}-lg`]: mergedSize === "large",
[`${prefixCls}-sm`]: mergedSize === "small",
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-${variant}`]: enableVariantCls,
[`${prefixCls}-in-form-item`]: isFormItemInput
}, getStatusClassNames(prefixCls, mergedStatus, hasFeedback), compactItemClassnames, className, rootClassName, mergedClassNames?.root, cssVarCls, rootCls, treeSelectRootCls, hashId);
const mergedSwitcherIcon = customSwitcherIcon ?? switcherIcon;
const renderSwitcherIcon = (nodeProps) => /* @__PURE__ */ import_react.createElement(SwitcherIconCom, {
prefixCls: treePrefixCls,
switcherIcon: mergedSwitcherIcon,
treeNodeProps: nodeProps,
showLine: treeLine
});
const [zIndex] = useZIndex("SelectLike", mergedStyles.popup?.root?.zIndex);
return /* @__PURE__ */ import_react.createElement(es_default$1, {
classNames: mergedClassNames,
styles: mergedStyles,
virtual,
disabled: mergedDisabled,
...selectProps,
popupMatchSelectWidth: mergedPopupMatchSelectWidth,
builtinPlacements: mergedBuiltinPlacements(builtinPlacements, popupOverflow),
ref,
prefixCls,
className: mergedClassName,
style: {
...mergedStyles?.root,
...style
},
listHeight,
listItemHeight,
treeCheckable: treeCheckable ? /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-tree-checkbox-inner` }) : treeCheckable,
treeLine: !!treeLine,
suffixIcon,
multiple: isMultiple,
placement: memoizedPlacement,
removeIcon,
allowClear: mergedAllowClear,
switcherIcon: renderSwitcherIcon,
showTreeIcon: treeIcon,
notFoundContent: mergedNotFound,
getPopupContainer: getPopupContainer || getContextPopupContainer,
treeMotion: null,
popupClassName: mergedPopupClassName,
popupStyle: {
...mergedStyles.root,
...mergedStyles.popup?.root,
zIndex
},
popupRender: mergedPopupRender,
onPopupVisibleChange: mergedOnOpenChange,
choiceTransitionName: getTransitionName(rootPrefixCls, "", choiceTransitionName),
transitionName: getTransitionName(rootPrefixCls, "slide-up", transitionName),
treeExpandAction,
tagRender: isMultiple ? tagRender : void 0,
maxCount: mergedMaxCount,
showCheckedStrategy,
treeCheckStrictly
});
};
var TreeSelect = /* @__PURE__ */ import_react.forwardRef(InternalTreeSelect);
/* istanbul ignore next */
var PurePanel = genPurePanel(TreeSelect, "popupAlign", (props) => omit(props, ["visible"]));
TreeSelect.TreeNode = TreeNode;
TreeSelect.SHOW_ALL = SHOW_ALL;
TreeSelect.SHOW_PARENT = SHOW_PARENT;
TreeSelect.SHOW_CHILD = SHOW_CHILD;
TreeSelect._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;
TreeSelect.displayName = "TreeSelect";
//#endregion
//#region node_modules/antd/es/typography/style/mixins.js
var getTitleStyle = (fontSize, lineHeight, color, token) => {
const { titleMarginBottom, fontWeightStrong } = token;
return {
marginBottom: titleMarginBottom,
color,
fontWeight: fontWeightStrong,
fontSize,
lineHeight
};
};
var getTitleStyles = (token) => {
const headings = [
1,
2,
3,
4,
5
];
const styles = {};
headings.forEach((headingLevel) => {
styles[`
h${headingLevel}&,
div&-h${headingLevel},
div&-h${headingLevel} > textarea,
h${headingLevel}
`] = getTitleStyle(token[`fontSizeHeading${headingLevel}`], token[`lineHeightHeading${headingLevel}`], token.colorTextHeading, token);
});
return styles;
};
var getLinkStyles = (token) => {
const { componentCls } = token;
return { [`&${`${componentCls}-link`}`]: {
...operationUnit(token),
userSelect: "text",
[`&[disabled], &${componentCls}-disabled`]: {
color: token.colorTextDisabled,
cursor: "not-allowed",
"&:active, &:hover": { color: token.colorTextDisabled },
"&:active": {
pointerEvents: "none",
[`${componentCls}-actions`]: { pointerEvents: "auto" }
}
}
} };
};
var getResetStyles = (token) => ({
code: {
margin: "0 0.2em",
paddingInline: "0.4em",
paddingBlock: "0.2em 0.1em",
fontSize: "85%",
fontFamily: token.fontFamilyCode,
background: "rgba(150, 150, 150, 0.1)",
border: "1px solid rgba(100, 100, 100, 0.2)",
borderRadius: 3
},
kbd: {
margin: "0 0.2em",
paddingInline: "0.4em",
paddingBlock: "0.15em 0.1em",
fontSize: "90%",
fontFamily: token.fontFamilyCode,
background: "rgba(150, 150, 150, 0.06)",
border: "1px solid rgba(100, 100, 100, 0.2)",
borderBottomWidth: 2,
borderRadius: 3
},
mark: {
padding: 0,
backgroundColor: gold[2]
},
"u, ins": {
textDecoration: "underline",
textDecorationSkipInk: "auto"
},
"s, del": { textDecoration: "line-through" },
strong: { fontWeight: token.fontWeightStrong },
"ul, ol": {
marginInline: 0,
marginBlock: "0 1em",
padding: 0,
li: {
marginInline: "20px 0",
marginBlock: 0,
paddingInline: "4px 0",
paddingBlock: 0
}
},
ul: {
listStyleType: "circle",
ul: { listStyleType: "disc" }
},
ol: { listStyleType: "decimal" },
"pre, blockquote": { margin: "1em 0" },
pre: {
padding: "0.4em 0.6em",
whiteSpace: "pre-wrap",
wordWrap: "break-word",
background: "rgba(150, 150, 150, 0.1)",
border: "1px solid rgba(100, 100, 100, 0.2)",
borderRadius: 3,
fontFamily: token.fontFamilyCode,
code: {
display: "inline",
margin: 0,
padding: 0,
fontSize: "inherit",
fontFamily: "inherit",
background: "transparent",
border: 0
}
},
blockquote: {
paddingInline: "0.6em 0",
paddingBlock: 0,
borderInlineStart: "4px solid rgba(100, 100, 100, 0.2)",
opacity: .85
}
});
var getEditableStyles = (token) => {
const { componentCls, paddingSM } = token;
const inputShift = paddingSM;
return { "&-edit-content": {
position: "relative",
"div&": {
insetInlineStart: token.calc(token.paddingSM).mul(-1).equal(),
insetBlockStart: token.calc(inputShift).div(-2).add(1).equal(),
marginBottom: token.calc(inputShift).div(2).sub(2).equal()
},
[`${componentCls}-edit-content-confirm`]: {
position: "absolute",
insetInlineEnd: token.calc(token.marginXS).add(2).equal(),
insetBlockEnd: token.marginXS,
color: token.colorIcon,
fontWeight: "normal",
fontSize: token.fontSize,
fontStyle: "normal",
pointerEvents: "none"
},
textarea: {
margin: "0!important",
MozTransition: "none",
height: "1em"
}
} };
};
var getCopyableStyles = (token) => ({
[`${token.componentCls}-copy-success`]: { "&, &:hover, &:focus": { color: token.colorSuccess } },
[`${token.componentCls}-copy-icon-only`]: { marginInlineStart: 0 }
});
var getEllipsisStyles = () => ({
"a&-ellipsis, span&-ellipsis": {
display: "inline-block",
maxWidth: "100%"
},
"&-ellipsis-single-line": {
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
"a&, span&": { verticalAlign: "bottom" },
"> code": {
paddingBlock: 0,
maxWidth: "calc(100% - 1.2em)",
display: "inline-block",
overflow: "hidden",
textOverflow: "ellipsis",
verticalAlign: "bottom",
boxSizing: "content-box"
}
},
"&-ellipsis-multiple-line": {
display: "-webkit-box",
overflow: "hidden",
WebkitLineClamp: 3,
WebkitBoxOrient: "vertical"
}
});
//#endregion
//#region node_modules/antd/es/typography/style/index.js
var genTypographyStyle = (token) => {
const { componentCls, titleMarginTop } = token;
return { [componentCls]: {
color: token.colorText,
wordBreak: "break-word",
lineHeight: token.lineHeight,
[`&${componentCls}-secondary, &${componentCls}-link${componentCls}-secondary`]: { color: token.colorTextDescription },
[`&${componentCls}-success, &${componentCls}-link${componentCls}-success`]: { color: token.colorSuccessText },
[`&${componentCls}-warning, &${componentCls}-link${componentCls}-warning`]: { color: token.colorWarningText },
[`&${componentCls}-danger, &${componentCls}-link${componentCls}-danger`]: {
color: token.colorErrorText,
[`&${componentCls}-link:active, &${componentCls}-link:focus`]: { color: token.colorErrorTextActive },
[`&${componentCls}-link:hover`]: { color: token.colorErrorTextHover }
},
[`&${componentCls}-disabled`]: {
color: token.colorTextDisabled,
cursor: "not-allowed",
userSelect: "none"
},
"div&, p": { marginBottom: "1em" },
...getTitleStyles(token),
[`& + h1${componentCls}, & + h2${componentCls}, & + h3${componentCls}, & + h4${componentCls}, & + h5${componentCls}`]: { marginTop: titleMarginTop },
"div, ul, li, p, h1, h2, h3, h4, h5": { "+ h1, + h2, + h3, + h4, + h5": { marginTop: titleMarginTop } },
...getResetStyles(token),
...getLinkStyles(token),
[`${componentCls}-actions`]: { display: "inline" },
[`
${componentCls}-expand,
${componentCls}-collapse,
${componentCls}-edit,
${componentCls}-copy
`]: {
...operationUnit(token),
marginInlineStart: token.marginXXS
},
...getEditableStyles(token),
...getCopyableStyles(token),
...getEllipsisStyles(),
"&-rtl": { direction: "rtl" }
} };
};
var prepareComponentToken$1 = () => ({
titleMarginTop: "1.2em",
titleMarginBottom: "0.5em"
});
var style_default$1 = genStyleHooks("Typography", genTypographyStyle, prepareComponentToken$1);
//#endregion
//#region node_modules/antd/es/typography/Editable.js
var Editable = (props) => {
const { prefixCls, "aria-label": ariaLabel, className, style, direction, maxLength, autoSize = true, value, onSave, onCancel, onEnd, component, enterIcon = /* @__PURE__ */ import_react.createElement(RefIcon$45, null) } = props;
const ref = import_react.useRef(null);
const inCompositionRef = import_react.useRef(false);
const lastKeyCodeRef = import_react.useRef(null);
const [current, setCurrent] = import_react.useState(value);
import_react.useEffect(() => {
setCurrent(value);
}, [value]);
import_react.useEffect(() => {
if (ref.current?.resizableTextArea) {
const { textArea } = ref.current.resizableTextArea;
textArea.focus();
const { length } = textArea.value;
textArea.setSelectionRange(length, length);
}
}, []);
const onChange = ({ target }) => {
setCurrent(target.value.replace(/[\n\r]/g, ""));
};
const onCompositionStart = () => {
inCompositionRef.current = true;
};
const onCompositionEnd = () => {
inCompositionRef.current = false;
};
const onKeyDown = ({ keyCode }) => {
if (inCompositionRef.current) return;
lastKeyCodeRef.current = keyCode;
};
const confirmChange = () => {
onSave(current.trim());
};
const onKeyUp = ({ keyCode, ctrlKey, altKey, metaKey, shiftKey }) => {
if (lastKeyCodeRef.current !== keyCode || inCompositionRef.current || ctrlKey || altKey || metaKey || shiftKey) return;
if (keyCode === KeyCode.ENTER) {
confirmChange();
onEnd?.();
} else if (keyCode === KeyCode.ESC) onCancel();
};
const onBlur = () => {
confirmChange();
};
const [hashId, cssVarCls] = style_default$1(prefixCls);
const textAreaClassName = clsx(prefixCls, `${prefixCls}-edit-content`, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-${component}`]: !!component
}, className, hashId, cssVarCls);
return /* @__PURE__ */ import_react.createElement("div", {
className: textAreaClassName,
style
}, /* @__PURE__ */ import_react.createElement(TextArea, {
ref,
maxLength,
value: current,
onChange,
onKeyDown,
onKeyUp,
onCompositionStart,
onCompositionEnd,
onBlur,
"aria-label": ariaLabel,
rows: 1,
autoSize
}), enterIcon !== null ? cloneElement$1(enterIcon, { className: `${prefixCls}-edit-content-confirm` }) : null);
};
//#endregion
//#region node_modules/antd/es/_util/copy.js
var execCopy = (text, isHtmlFormat) => {
let copySuccess = false;
const onCopy = (event) => {
event.stopPropagation();
event.preventDefault();
event.clipboardData?.clearData();
event.clipboardData?.setData("text/plain", text);
if (isHtmlFormat) event.clipboardData?.setData("text/html", text);
copySuccess = true;
};
try {
document.addEventListener("copy", onCopy, { capture: true });
document.execCommand("copy");
return copySuccess;
} catch {
return false;
} finally {
document.removeEventListener("copy", onCopy, { capture: true });
}
};
var asyncCopy = async (text, isHtmlFormat) => {
try {
if (isHtmlFormat) await navigator.clipboard.write([new ClipboardItem({
"text/html": new Blob([text], { type: "text/html" }),
"text/plain": new Blob([text], { type: "text/plain" })
})]);
else await navigator.clipboard.writeText(text);
return true;
} catch {
return false;
}
};
async function copy(text, config) {
if (typeof text !== "string") {
warning$1(false, "The clipboard content must be of string type", "");
return false;
}
const isHtmlFormat = config?.format === "text/html";
if (await asyncCopy(text, isHtmlFormat)) return true;
if (execCopy(text, isHtmlFormat)) return true;
return false;
}
//#endregion
//#region node_modules/antd/es/typography/hooks/useCopyClick.js
var useCopyClick = ({ copyConfig, children }) => {
const [copied, setCopied] = import_react.useState(false);
const [copyLoading, setCopyLoading] = import_react.useState(false);
const copyIdRef = import_react.useRef(null);
const cleanCopyId = () => {
if (copyIdRef.current) clearTimeout(copyIdRef.current);
};
const copyOptions = {};
if (copyConfig.format) copyOptions.format = copyConfig.format;
import_react.useEffect(() => cleanCopyId, []);
return {
copied,
copyLoading,
onClick: useEvent(async (e) => {
e?.preventDefault();
e?.stopPropagation();
setCopyLoading(true);
try {
await copy((typeof copyConfig.text === "function" ? await copyConfig.text() : copyConfig.text) || toList(children, { skipEmpty: true }).join("") || "", copyOptions);
setCopyLoading(false);
setCopied(true);
cleanCopyId();
copyIdRef.current = setTimeout(() => {
setCopied(false);
}, 3e3);
copyConfig.onCopy?.(e);
} catch (error) {
setCopyLoading(false);
throw error;
}
})
};
};
//#endregion
//#region node_modules/antd/es/typography/hooks/useMergedConfig.js
function useMergedConfig(propConfig, templateConfig) {
return import_react.useMemo(() => {
const support = !!propConfig;
return [support, {
...templateConfig,
...support && typeof propConfig === "object" ? propConfig : null
}];
}, [propConfig]);
}
//#endregion
//#region node_modules/antd/es/typography/hooks/usePrevious.js
var usePrevious = (value) => {
const ref = (0, import_react.useRef)(void 0);
(0, import_react.useEffect)(() => {
ref.current = value;
});
return ref.current;
};
//#endregion
//#region node_modules/antd/es/typography/hooks/useTooltipProps.js
var useTooltipProps = (tooltip, editConfigText, children) => (0, import_react.useMemo)(() => {
if (tooltip === true) return { title: editConfigText ?? children };
if (/* @__PURE__ */ (0, import_react.isValidElement)(tooltip)) return { title: tooltip };
if (isPlainObject(tooltip)) return {
title: editConfigText ?? children,
...tooltip
};
return { title: tooltip };
}, [
tooltip,
editConfigText,
children
]);
//#endregion
//#region node_modules/antd/es/typography/Typography.js
var Typography$1 = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, component: Component = "article", className, rootClassName, children, direction: typographyDirection, style, ...restProps } = props;
const { getPrefixCls, direction: contextDirection, className: contextClassName, style: contextStyle } = useComponentConfig("typography");
const direction = typographyDirection ?? contextDirection;
const prefixCls = getPrefixCls("typography", customizePrefixCls);
const [hashId, cssVarCls] = style_default$1(prefixCls);
const componentClassName = clsx(prefixCls, contextClassName, { [`${prefixCls}-rtl`]: direction === "rtl" }, className, rootClassName, hashId, cssVarCls);
const mergedStyle = {
...contextStyle,
...style
};
return /* @__PURE__ */ import_react.createElement(Component, {
className: componentClassName,
style: mergedStyle,
ref,
...restProps
}, children);
});
Typography$1.displayName = "Typography";
//#endregion
//#region node_modules/antd/es/typography/Base/util.js
var toCopyConfigList = (val) => {
if (val === false) return [false, false];
return toList(val);
};
function getNode(dom, defaultNode, needDom) {
if (dom === true || dom === void 0) return defaultNode;
return dom || needDom && defaultNode;
}
/**
* Check for element is native ellipsis
* ref:
* - https://github.com/ant-design/ant-design/issues/50143
* - https://github.com/ant-design/ant-design/issues/50414
*/
function isEleEllipsis(ele) {
const childDiv = document.createElement("em");
ele.appendChild(childDiv);
childDiv.className = "ant-typography-css-ellipsis-content-measure";
const rect = ele.getBoundingClientRect();
const childRect = childDiv.getBoundingClientRect();
ele.removeChild(childDiv);
return rect.left > childRect.left || childRect.right > rect.right || rect.top > childRect.top || childRect.bottom > rect.bottom;
}
var isValidText = (val) => ["string", "number"].includes(typeof val);
//#endregion
//#region node_modules/antd/es/typography/Base/CopyBtn.js
var CopyBtn = (props) => {
const { prefixCls, copied, locale, iconOnly, tooltips, icon, tabIndex, onCopy, loading: btnLoading } = props;
const tooltipNodes = toCopyConfigList(tooltips);
const iconNodes = toCopyConfigList(icon);
const { copied: copiedText, copy: copyText } = locale ?? {};
const systemStr = copied ? copiedText : copyText;
const copyTitle = getNode(tooltipNodes[copied ? 1 : 0], systemStr);
const ariaLabel = typeof copyTitle === "string" ? copyTitle : systemStr;
return /* @__PURE__ */ import_react.createElement(Tooltip, { title: copyTitle }, /* @__PURE__ */ import_react.createElement("button", {
type: "button",
className: clsx(`${prefixCls}-copy`, {
[`${prefixCls}-copy-success`]: copied,
[`${prefixCls}-copy-icon-only`]: iconOnly
}),
onClick: onCopy,
"aria-label": ariaLabel,
tabIndex
}, copied ? getNode(iconNodes[1], /* @__PURE__ */ import_react.createElement(RefIcon$9, null), true) : getNode(iconNodes[0], btnLoading ? /* @__PURE__ */ import_react.createElement(RefIcon$5, null) : /* @__PURE__ */ import_react.createElement(RefIcon$46, null), true)));
};
//#endregion
//#region node_modules/antd/es/typography/Base/Ellipsis.js
var MeasureText = /* @__PURE__ */ import_react.forwardRef(({ style, children }, ref) => {
const spanRef = import_react.useRef(null);
import_react.useImperativeHandle(ref, () => ({
isExceed: () => {
const span = spanRef.current;
return span.scrollHeight > span.clientHeight;
},
getHeight: () => spanRef.current.clientHeight
}));
return /* @__PURE__ */ import_react.createElement("span", {
"aria-hidden": true,
ref: spanRef,
style: {
position: "fixed",
display: "block",
left: 0,
top: 0,
pointerEvents: "none",
backgroundColor: "rgba(255, 0, 0, 0.65)",
...style
}
}, children);
});
var getNodesLen = (nodeList) => nodeList.reduce((totalLen, node) => totalLen + (isValidText(node) ? String(node).length : 1), 0);
function sliceNodes(nodeList, len) {
let currLen = 0;
const currentNodeList = [];
for (let i = 0; i < nodeList.length; i += 1) {
if (currLen === len) return currentNodeList;
const node = nodeList[i];
const nodeLen = isValidText(node) ? String(node).length : 1;
const nextLen = currLen + nodeLen;
if (nextLen > len) {
const restLen = len - currLen;
currentNodeList.push(String(node).slice(0, restLen));
return currentNodeList;
}
currentNodeList.push(node);
currLen = nextLen;
}
return nodeList;
}
var STATUS_MEASURE_NONE = 0;
var STATUS_MEASURE_PREPARE = 1;
var STATUS_MEASURE_START = 2;
var STATUS_MEASURE_NEED_ELLIPSIS = 3;
var STATUS_MEASURE_NO_NEED_ELLIPSIS = 4;
var lineClipStyle = {
display: "-webkit-box",
overflow: "hidden",
WebkitBoxOrient: "vertical"
};
function EllipsisMeasure(props) {
const { enableMeasure, width, text, children, rows, expanded, miscDeps, onEllipsis } = props;
const nodeList = import_react.useMemo(() => toArray$8(text), [text]);
const nodeLen = import_react.useMemo(() => getNodesLen(nodeList), [text]);
const fullContent = import_react.useMemo(() => children(nodeList, false), [text]);
const [ellipsisCutIndex, setEllipsisCutIndex] = import_react.useState(null);
const cutMidRef = import_react.useRef(null);
const measureWhiteSpaceRef = import_react.useRef(null);
const needEllipsisRef = import_react.useRef(null);
const descRowsEllipsisRef = import_react.useRef(null);
const symbolRowEllipsisRef = import_react.useRef(null);
const [canEllipsis, setCanEllipsis] = import_react.useState(false);
const [needEllipsis, setNeedEllipsis] = import_react.useState(STATUS_MEASURE_NONE);
const [ellipsisHeight, setEllipsisHeight] = import_react.useState(0);
const [parentWhiteSpace, setParentWhiteSpace] = import_react.useState(null);
useLayoutEffect$1(() => {
if (enableMeasure && width && nodeLen) setNeedEllipsis(STATUS_MEASURE_PREPARE);
else setNeedEllipsis(STATUS_MEASURE_NONE);
}, [
width,
text,
rows,
enableMeasure,
nodeList
]);
useLayoutEffect$1(() => {
if (needEllipsis === STATUS_MEASURE_PREPARE) {
setNeedEllipsis(STATUS_MEASURE_START);
setParentWhiteSpace(measureWhiteSpaceRef.current && getComputedStyle(measureWhiteSpaceRef.current).whiteSpace);
} else if (needEllipsis === STATUS_MEASURE_START) {
const isOverflow = !!needEllipsisRef.current?.isExceed();
setNeedEllipsis(isOverflow ? STATUS_MEASURE_NEED_ELLIPSIS : STATUS_MEASURE_NO_NEED_ELLIPSIS);
setEllipsisCutIndex(isOverflow ? [0, nodeLen] : null);
setCanEllipsis(isOverflow);
const baseRowsEllipsisHeight = needEllipsisRef.current?.getHeight() || 0;
const descRowsEllipsisHeight = rows === 1 ? 0 : descRowsEllipsisRef.current?.getHeight() || 0;
const symbolRowEllipsisHeight = symbolRowEllipsisRef.current?.getHeight() || 0;
setEllipsisHeight(Math.max(baseRowsEllipsisHeight, descRowsEllipsisHeight + symbolRowEllipsisHeight) + 1);
onEllipsis(isOverflow);
}
}, [needEllipsis]);
const cutMidIndex = ellipsisCutIndex ? Math.ceil((ellipsisCutIndex[0] + ellipsisCutIndex[1]) / 2) : 0;
useLayoutEffect$1(() => {
const [minIndex, maxIndex] = ellipsisCutIndex || [0, 0];
if (minIndex !== maxIndex) {
const isOverflow = (cutMidRef.current?.getHeight() || 0) > ellipsisHeight;
let targetMidIndex = cutMidIndex;
if (maxIndex - minIndex === 1) targetMidIndex = isOverflow ? minIndex : maxIndex;
setEllipsisCutIndex(isOverflow ? [minIndex, targetMidIndex] : [targetMidIndex, maxIndex]);
}
}, [ellipsisCutIndex, cutMidIndex]);
const finalContent = import_react.useMemo(() => {
if (!enableMeasure) return children(nodeList, false);
if (needEllipsis !== STATUS_MEASURE_NEED_ELLIPSIS || !ellipsisCutIndex || ellipsisCutIndex[0] !== ellipsisCutIndex[1]) {
const content = children(nodeList, false);
if ([STATUS_MEASURE_NO_NEED_ELLIPSIS, STATUS_MEASURE_NONE].includes(needEllipsis)) return content;
return /* @__PURE__ */ import_react.createElement("span", { style: {
...lineClipStyle,
WebkitLineClamp: rows
} }, content);
}
return children(expanded ? nodeList : sliceNodes(nodeList, ellipsisCutIndex[0]), canEllipsis);
}, [
expanded,
needEllipsis,
ellipsisCutIndex,
nodeList
].concat(_toConsumableArray$8(miscDeps)));
const measureStyle = {
width,
margin: 0,
padding: 0,
whiteSpace: parentWhiteSpace === "nowrap" ? "normal" : "inherit"
};
return /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, finalContent, needEllipsis === STATUS_MEASURE_START && /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, /* @__PURE__ */ import_react.createElement(MeasureText, {
style: {
...measureStyle,
...lineClipStyle,
WebkitLineClamp: rows
},
ref: needEllipsisRef
}, fullContent), /* @__PURE__ */ import_react.createElement(MeasureText, {
style: {
...measureStyle,
...lineClipStyle,
WebkitLineClamp: rows - 1
},
ref: descRowsEllipsisRef
}, fullContent), /* @__PURE__ */ import_react.createElement(MeasureText, {
style: {
...measureStyle,
...lineClipStyle,
WebkitLineClamp: 1
},
ref: symbolRowEllipsisRef
}, children([], true))), needEllipsis === STATUS_MEASURE_NEED_ELLIPSIS && ellipsisCutIndex && ellipsisCutIndex[0] !== ellipsisCutIndex[1] && /* @__PURE__ */ import_react.createElement(MeasureText, {
style: {
...measureStyle,
top: 400
},
ref: cutMidRef
}, children(sliceNodes(nodeList, cutMidIndex), true)), needEllipsis === STATUS_MEASURE_PREPARE && /* @__PURE__ */ import_react.createElement("span", {
style: { whiteSpace: "inherit" },
ref: measureWhiteSpaceRef
}));
}
//#endregion
//#region node_modules/antd/es/typography/Base/EllipsisTooltip.js
var EllipsisTooltip = ({ enableEllipsis, isEllipsis, open, children, tooltipProps }) => {
if (!tooltipProps?.title || !enableEllipsis) return children;
const mergedOpen = open && isEllipsis;
return /* @__PURE__ */ import_react.createElement(Tooltip, {
open: mergedOpen,
...tooltipProps
}, children);
};
EllipsisTooltip.displayName = "EllipsisTooltip";
//#endregion
//#region node_modules/antd/es/typography/Base/index.js
function wrapperDecorations({ mark, code, underline, delete: del, strong, keyboard, italic }, content) {
let currentContent = content;
function wrap(tag, needed) {
if (!needed) return;
currentContent = /* @__PURE__ */ import_react.createElement(tag, {}, currentContent);
}
wrap("strong", strong);
wrap("u", underline);
wrap("del", del);
wrap("code", code);
wrap("mark", mark);
wrap("kbd", keyboard);
wrap("i", italic);
return currentContent;
}
var ELLIPSIS_STR = "...";
var DECORATION_PROPS = [
"delete",
"mark",
"code",
"underline",
"strong",
"keyboard",
"italic"
];
var Base = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { prefixCls: customizePrefixCls, className, style, type, disabled, children, ellipsis, editable, copyable, component, title, onMouseEnter, onMouseLeave, ...restProps } = props;
const { getPrefixCls, direction } = import_react.useContext(ConfigContext);
const [textLocale] = useLocale$1("Text");
const typographyRef = import_react.useRef(null);
const editIconRef = import_react.useRef(null);
const prefixCls = getPrefixCls("typography", customizePrefixCls);
const textProps = omit(restProps, DECORATION_PROPS);
const [enableEdit, editConfig] = useMergedConfig(editable);
const [editing, setEditing] = useControlledState(false, editConfig.editing);
const { triggerType = ["icon"] } = editConfig;
const triggerEdit = (edit) => {
if (edit) editConfig.onStart?.();
setEditing(edit);
};
const prevEditing = usePrevious(editing);
useLayoutEffect$1(() => {
if (!editing && prevEditing) editIconRef.current?.focus();
}, [editing]);
const onEditClick = (e) => {
e?.preventDefault();
triggerEdit(true);
};
const onEditChange = (value) => {
editConfig.onChange?.(value);
triggerEdit(false);
};
const onEditCancel = () => {
editConfig.onCancel?.();
triggerEdit(false);
};
const [enableCopy, copyConfig] = useMergedConfig(copyable);
const { copied, copyLoading, onClick: onCopyClick } = useCopyClick({
copyConfig,
children
});
const [isLineClampSupport, setIsLineClampSupport] = import_react.useState(false);
const [isTextOverflowSupport, setIsTextOverflowSupport] = import_react.useState(false);
const [isJsEllipsis, setIsJsEllipsis] = import_react.useState(false);
const [isNativeEllipsis, setIsNativeEllipsis] = import_react.useState(false);
const [isNativeVisible, setIsNativeVisible] = import_react.useState(true);
const [enableEllipsis, ellipsisConfig] = useMergedConfig(ellipsis, {
expandable: false,
symbol: (isExpanded) => isExpanded ? textLocale?.collapse : textLocale?.expand
});
const [expanded, setExpanded] = useControlledState(ellipsisConfig.defaultExpanded || false, ellipsisConfig.expanded);
const mergedEnableEllipsis = enableEllipsis && (!expanded || ellipsisConfig.expandable === "collapsible");
const { rows = 1 } = ellipsisConfig;
const needMeasureEllipsis = import_react.useMemo(() => mergedEnableEllipsis && (ellipsisConfig.suffix !== void 0 || ellipsisConfig.onEllipsis || ellipsisConfig.expandable || enableEdit || enableCopy), [
mergedEnableEllipsis,
ellipsisConfig,
enableEdit,
enableCopy
]);
useLayoutEffect$1(() => {
if (enableEllipsis && !needMeasureEllipsis) {
setIsLineClampSupport(isStyleSupport("webkitLineClamp"));
setIsTextOverflowSupport(isStyleSupport("textOverflow"));
}
}, [needMeasureEllipsis, enableEllipsis]);
const [cssEllipsis, setCssEllipsis] = import_react.useState(mergedEnableEllipsis);
const canUseCssEllipsis = import_react.useMemo(() => {
if (needMeasureEllipsis) return false;
if (rows === 1) return isTextOverflowSupport;
return isLineClampSupport;
}, [
needMeasureEllipsis,
isTextOverflowSupport,
isLineClampSupport
]);
useLayoutEffect$1(() => {
setCssEllipsis(canUseCssEllipsis && mergedEnableEllipsis);
}, [canUseCssEllipsis, mergedEnableEllipsis]);
const tooltipProps = useTooltipProps(ellipsisConfig.tooltip, editConfig.text, children);
const needNativeEllipsisMeasure = cssEllipsis && !!tooltipProps.title;
const isMergedEllipsis = mergedEnableEllipsis && (cssEllipsis ? needNativeEllipsisMeasure && isNativeEllipsis : isJsEllipsis);
const cssTextOverflow = mergedEnableEllipsis && rows === 1 && cssEllipsis;
const cssLineClamp = mergedEnableEllipsis && rows > 1 && cssEllipsis;
const onExpandClick = (e, info) => {
setExpanded(info.expanded);
ellipsisConfig.onExpand?.(e, info);
};
const [ellipsisWidth, setEllipsisWidth] = import_react.useState(0);
const [isHoveringOperations, setIsHoveringOperations] = import_react.useState(false);
const [isHoveringTypography, setIsHoveringTypography] = import_react.useState(false);
const onResize = ({ offsetWidth }) => {
setEllipsisWidth(offsetWidth);
};
const onJsEllipsis = (jsEllipsis) => {
setIsJsEllipsis(jsEllipsis);
if (isJsEllipsis !== jsEllipsis) ellipsisConfig.onEllipsis?.(jsEllipsis);
};
import_react.useEffect(() => {
const textEle = typographyRef.current;
if (enableEllipsis && needNativeEllipsisMeasure && textEle) {
const currentEllipsis = isEleEllipsis(textEle);
if (isNativeEllipsis !== currentEllipsis) setIsNativeEllipsis(currentEllipsis);
}
}, [
enableEllipsis,
needNativeEllipsisMeasure,
children,
cssLineClamp,
isNativeVisible,
ellipsisWidth
]);
import_react.useEffect(() => {
const textEle = typographyRef.current;
if (typeof IntersectionObserver === "undefined" || !textEle || !needNativeEllipsisMeasure || !mergedEnableEllipsis) return;
const observer = new IntersectionObserver(() => {
setIsNativeVisible(!!textEle.offsetParent);
});
observer.observe(textEle);
return () => {
observer.disconnect();
};
}, [needNativeEllipsisMeasure, mergedEnableEllipsis]);
const topAriaLabel = import_react.useMemo(() => {
if (!enableEllipsis || cssEllipsis) return;
return [
editConfig.text,
children,
title,
tooltipProps.title
].find(isValidText);
}, [
enableEllipsis,
cssEllipsis,
title,
tooltipProps.title,
isMergedEllipsis
]);
if (editing) return /* @__PURE__ */ import_react.createElement(Editable, {
value: editConfig.text ?? (typeof children === "string" ? children : ""),
onSave: onEditChange,
onCancel: onEditCancel,
onEnd: editConfig.onEnd,
prefixCls,
className,
style,
direction,
component,
maxLength: editConfig.maxLength,
autoSize: editConfig.autoSize,
enterIcon: editConfig.enterIcon
});
const renderExpand = () => {
const { expandable, symbol } = ellipsisConfig;
return expandable ? /* @__PURE__ */ import_react.createElement("button", {
type: "button",
key: "expand",
className: `${prefixCls}-${expanded ? "collapse" : "expand"}`,
onClick: (e) => onExpandClick(e, { expanded: !expanded }),
"aria-label": expanded ? textLocale.collapse : textLocale?.expand
}, typeof symbol === "function" ? symbol(expanded) : symbol) : null;
};
const renderEdit = () => {
if (!enableEdit) return;
const { icon, tooltip, tabIndex } = editConfig;
const editTitle = toArray$8(tooltip)[0] || textLocale?.edit;
const ariaLabel = typeof editTitle === "string" ? editTitle : "";
return triggerType.includes("icon") ? /* @__PURE__ */ import_react.createElement(Tooltip, {
key: "edit",
title: tooltip === false ? "" : editTitle
}, /* @__PURE__ */ import_react.createElement("button", {
type: "button",
ref: editIconRef,
className: `${prefixCls}-edit`,
onClick: onEditClick,
"aria-label": ariaLabel,
tabIndex
}, icon || /* @__PURE__ */ import_react.createElement(RefIcon$47, { role: "button" }))) : null;
};
const renderCopy = () => {
if (!enableCopy) return null;
return /* @__PURE__ */ import_react.createElement(CopyBtn, {
key: "copy",
...copyConfig,
prefixCls,
copied,
locale: textLocale,
onCopy: onCopyClick,
loading: copyLoading,
iconOnly: !isNonNullable(children)
});
};
const renderOperations = (canEllipsis) => {
const expandNode = canEllipsis && renderExpand();
const editNode = renderEdit();
const copyNode = renderCopy();
if (!expandNode && !editNode && !copyNode) return null;
return /* @__PURE__ */ import_react.createElement("span", {
key: "operations",
className: `${prefixCls}-actions`,
onMouseEnter: () => setIsHoveringOperations(true),
onMouseLeave: () => setIsHoveringOperations(false)
}, expandNode, editNode, copyNode);
};
const renderEllipsis = (canEllipsis) => [
canEllipsis && !expanded && /* @__PURE__ */ import_react.createElement("span", {
"aria-hidden": true,
key: "ellipsis"
}, ELLIPSIS_STR),
ellipsisConfig.suffix,
renderOperations(canEllipsis)
];
return /* @__PURE__ */ import_react.createElement(RefResizeObserver, {
onResize,
disabled: !mergedEnableEllipsis
}, (resizeRef) => /* @__PURE__ */ import_react.createElement(EllipsisTooltip, {
tooltipProps,
enableEllipsis: mergedEnableEllipsis,
isEllipsis: isMergedEllipsis,
open: isHoveringTypography && !isHoveringOperations
}, /* @__PURE__ */ import_react.createElement(Typography$1, {
onMouseEnter: (e) => {
setIsHoveringTypography(true);
onMouseEnter?.(e);
},
onMouseLeave: (e) => {
setIsHoveringTypography(false);
onMouseLeave?.(e);
},
className: clsx({
[`${prefixCls}-${type}`]: type,
[`${prefixCls}-disabled`]: disabled,
[`${prefixCls}-ellipsis`]: enableEllipsis,
[`${prefixCls}-ellipsis-single-line`]: cssTextOverflow,
[`${prefixCls}-ellipsis-multiple-line`]: cssLineClamp,
[`${prefixCls}-link`]: component === "a"
}, className),
prefixCls: customizePrefixCls,
style: {
...style,
WebkitLineClamp: cssLineClamp ? rows : void 0
},
component,
ref: composeRef(resizeRef, typographyRef, ref),
direction,
onClick: triggerType.includes("text") ? onEditClick : void 0,
"aria-label": topAriaLabel?.toString(),
title,
...textProps
}, /* @__PURE__ */ import_react.createElement(EllipsisMeasure, {
enableMeasure: mergedEnableEllipsis && !cssEllipsis,
text: children,
rows,
width: ellipsisWidth,
onEllipsis: onJsEllipsis,
expanded,
miscDeps: [
copied,
expanded,
copyLoading,
enableEdit,
enableCopy,
textLocale
].concat(_toConsumableArray$8(DECORATION_PROPS.map((key) => props[key])))
}, (node, canEllipsis) => wrapperDecorations(props, /* @__PURE__ */ import_react.createElement(import_react.Fragment, null, node.length > 0 && canEllipsis && !expanded && topAriaLabel ? /* @__PURE__ */ import_react.createElement("span", {
key: "show-content",
"aria-hidden": true
}, node) : node, renderEllipsis(canEllipsis)))))));
});
//#endregion
//#region node_modules/antd/es/typography/Link.js
var Link = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { ellipsis, rel, children, navigate: _navigate, ...restProps } = props;
devUseWarning("Typography.Link")(typeof ellipsis !== "object", "usage", "`ellipsis` only supports boolean value.");
const mergedProps = {
...restProps,
rel: rel === void 0 && restProps.target === "_blank" ? "noopener noreferrer" : rel
};
return /* @__PURE__ */ import_react.createElement(Base, {
...mergedProps,
ref,
ellipsis: !!ellipsis,
component: "a"
}, children);
});
//#endregion
//#region node_modules/antd/es/typography/Paragraph.js
var Paragraph = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { children, ...restProps } = props;
return /* @__PURE__ */ import_react.createElement(Base, {
ref,
...restProps,
component: "div"
}, children);
});
//#endregion
//#region node_modules/antd/es/typography/Text.js
var Text = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { ellipsis, children, ...restProps } = props;
const mergedEllipsis = import_react.useMemo(() => {
if (isPlainObject(ellipsis)) return omit(ellipsis, ["expandable", "rows"]);
return ellipsis;
}, [ellipsis]);
devUseWarning("Typography.Text")(typeof ellipsis !== "object" || !ellipsis || !("expandable" in ellipsis) && !("rows" in ellipsis), "usage", "`ellipsis` do not support `expandable` or `rows` props.");
return /* @__PURE__ */ import_react.createElement(Base, {
ref,
...restProps,
ellipsis: mergedEllipsis,
component: "span"
}, children);
});
//#endregion
//#region node_modules/antd/es/typography/Title.js
var TITLE_ELE_LIST = [
1,
2,
3,
4,
5
];
var Title = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { level = 1, children, ...restProps } = props;
devUseWarning("Typography.Title")(TITLE_ELE_LIST.includes(level), "usage", "Title only accept `1 | 2 | 3 | 4 | 5` as `level` value. And `5` need 4.6.0+ version.");
const component = TITLE_ELE_LIST.includes(level) ? `h${level}` : `h1`;
return /* @__PURE__ */ import_react.createElement(Base, {
ref,
...restProps,
component
}, children);
});
//#endregion
//#region node_modules/antd/es/typography/index.js
var Typography = Typography$1;
Typography.Text = Text;
Typography.Link = Link;
Typography.Title = Title;
Typography.Paragraph = Paragraph;
//#endregion
//#region node_modules/@rc-component/upload/es/attr-accept.js
var attr_accept_default = ((file, acceptedFiles) => {
if (file && acceptedFiles) {
const acceptedFilesArray = Array.isArray(acceptedFiles) ? acceptedFiles : acceptedFiles.split(",");
const fileName = file.name || "";
const mimeType = file.type || "";
const baseMimeType = mimeType.replace(/\/.*$/, "");
return acceptedFilesArray.some((type) => {
const validType = type.trim();
if (/^\*(\/\*)?$/.test(type)) return true;
if (validType.charAt(0) === ".") {
const lowerFileName = fileName.toLowerCase();
const lowerType = validType.toLowerCase();
let affixList = [lowerType];
if (lowerType === ".jpg" || lowerType === ".jpeg") affixList = [".jpg", ".jpeg"];
return affixList.some((affix) => lowerFileName.endsWith(affix));
}
if (/\/\*$/.test(validType)) return baseMimeType === validType.replace(/\/.*$/, "");
if (mimeType === validType) return true;
if (/^\w+$/.test(validType)) {
warningOnce(false, `Upload takes an invalidate 'accept' type '${validType}'.Skip for check.`);
return true;
}
return false;
});
}
return true;
});
//#endregion
//#region node_modules/@rc-component/upload/es/request.js
function getError(option, xhr) {
const msg = `cannot ${option.method} ${option.action} ${xhr.status}'`;
const err = new Error(msg);
err.status = xhr.status;
err.method = option.method;
err.url = option.action;
return err;
}
function getBody(xhr) {
const text = xhr.responseText || xhr.response;
if (!text) return text;
try {
return JSON.parse(text);
} catch (e) {
return text;
}
}
function upload(option) {
const xhr = new XMLHttpRequest();
if (option.onProgress && xhr.upload) xhr.upload.onprogress = function progress(e) {
if (e.total > 0) e.percent = e.loaded / e.total * 100;
option.onProgress(e);
};
const formData = new FormData();
if (option.data) Object.keys(option.data).forEach((key) => {
const value = option.data[key];
if (Array.isArray(value)) {
value.forEach((item) => {
formData.append(`${key}[]`, item);
});
return;
}
formData.append(key, value);
});
if (option.file instanceof Blob) formData.append(option.filename, option.file, option.file.name);
else formData.append(option.filename, option.file);
xhr.onerror = function error(e) {
option.onError(e);
};
xhr.onload = function onload() {
if (xhr.status < 200 || xhr.status >= 300) return option.onError(getError(option, xhr), getBody(xhr));
return option.onSuccess(getBody(xhr), xhr);
};
xhr.open(option.method, option.action, true);
if (option.withCredentials && "withCredentials" in xhr) xhr.withCredentials = true;
const headers = option.headers || {};
if (headers["X-Requested-With"] !== null) xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
Object.keys(headers).forEach((h) => {
if (headers[h] !== null) xhr.setRequestHeader(h, headers[h]);
});
xhr.send(formData);
return { abort() {
xhr.abort();
} };
}
//#endregion
//#region node_modules/@rc-component/upload/es/traverseFileTree.js
var traverseFileTree = async (files, isAccepted) => {
const flattenFileList = [];
const progressFileList = [];
files.forEach((file) => progressFileList.push(file.webkitGetAsEntry()));
async function readDirectory(directory) {
const dirReader = directory.createReader();
const entries = [];
while (true) {
const results = await new Promise((resolve) => {
dirReader.readEntries(resolve, () => resolve([]));
});
const n = results.length;
if (!n) break;
for (let i = 0; i < n; i++) entries.push(results[i]);
}
return entries;
}
async function readFile(item) {
return new Promise((reslove) => {
item.file((file) => {
if (isAccepted(file)) {
if (item.fullPath && !file.webkitRelativePath) {
Object.defineProperties(file, { webkitRelativePath: { writable: true } });
file.webkitRelativePath = item.fullPath.replace(/^\//, "");
Object.defineProperties(file, { webkitRelativePath: { writable: false } });
}
reslove(file);
} else reslove(null);
});
});
}
const _traverseFileTree = async (item, path) => {
if (!item) return;
item.path = path || "";
if (item.isFile) {
const file = await readFile(item);
if (file) flattenFileList.push(file);
} else if (item.isDirectory) {
const entries = await readDirectory(item);
progressFileList.push(...entries);
}
};
let wipIndex = 0;
while (wipIndex < progressFileList.length) {
await _traverseFileTree(progressFileList[wipIndex]);
wipIndex++;
}
return flattenFileList;
};
//#endregion
//#region node_modules/@rc-component/upload/es/uid.js
var now = +/* @__PURE__ */ new Date();
var index = 0;
function uid() {
return `rc-upload-${now}-${++index}`;
}
//#endregion
//#region node_modules/@rc-component/upload/es/AjaxUploader.js
function _extends$1() {
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends$1.apply(this, arguments);
}
var AjaxUploader = class extends import_react.Component {
state = { uid: uid() };
reqs = {};
fileInput;
_isMounted;
filterFile = (file, force = false) => {
const { accept, directory } = this.props;
let filterFn;
let acceptFormat;
if (typeof accept === "string") acceptFormat = accept;
else {
const { filter, format } = accept || {};
acceptFormat = format;
if (filter === "native") filterFn = () => true;
else filterFn = filter;
}
return (filterFn || (directory || force ? (currentFile) => attr_accept_default(currentFile, acceptFormat) : () => true))(file);
};
onChange = (e) => {
const { files } = e.target;
const acceptedFiles = [...files].filter((file) => this.filterFile(file));
this.uploadFiles(acceptedFiles);
this.reset();
};
onClick = (event) => {
const el = this.fileInput;
if (!el) return;
const target = event.target;
const { onClick } = this.props;
if (target && target.tagName === "BUTTON") {
el.parentNode.focus();
target.blur();
}
el.click();
if (onClick) onClick(event);
};
onKeyDown = (e) => {
if (e.key === "Enter") this.onClick(e);
};
onDataTransferFiles = async (dataTransfer, existFileCallback) => {
const { multiple, directory } = this.props;
const items = [...dataTransfer.items || []];
let files = [...dataTransfer.files || []];
if (files.length > 0 || items.some((item) => item.kind === "file")) existFileCallback?.();
if (directory) {
files = await traverseFileTree(Array.prototype.slice.call(items), this.filterFile);
this.uploadFiles(files);
} else {
let acceptFiles = [...files].filter((file) => this.filterFile(file, true));
if (multiple === false) acceptFiles = files.slice(0, 1);
this.uploadFiles(acceptFiles);
}
};
onFilePaste = async (e) => {
const { pastable } = this.props;
if (!pastable) return;
if (e.type === "paste") {
const clipboardData = e.clipboardData;
return this.onDataTransferFiles(clipboardData, () => {
e.preventDefault();
});
}
};
onFileDragOver = (e) => {
e.preventDefault();
};
onFileDrop = async (e) => {
e.preventDefault();
if (e.type === "drop") {
const dataTransfer = e.dataTransfer;
return this.onDataTransferFiles(dataTransfer);
}
};
componentDidMount() {
this._isMounted = true;
const { pastable } = this.props;
if (pastable) document.addEventListener("paste", this.onFilePaste);
}
componentWillUnmount() {
this._isMounted = false;
this.abort();
document.removeEventListener("paste", this.onFilePaste);
}
componentDidUpdate(prevProps) {
const { pastable } = this.props;
if (pastable && !prevProps.pastable) document.addEventListener("paste", this.onFilePaste);
else if (!pastable && prevProps.pastable) document.removeEventListener("paste", this.onFilePaste);
}
uploadFiles = (files) => {
const originFiles = [...files];
const postFiles = originFiles.map((file) => {
file.uid = uid();
return this.processFile(file, originFiles);
});
Promise.all(postFiles).then((fileList) => {
const { onBatchStart } = this.props;
onBatchStart?.(fileList.map(({ origin, parsedFile }) => ({
file: origin,
parsedFile
})));
fileList.filter((file) => file.parsedFile !== null).forEach((file) => {
this.post(file);
});
});
};
/**
* Process file before upload. When all the file is ready, we start upload.
*/
processFile = async (file, fileList) => {
const { beforeUpload } = this.props;
let transformedFile = file;
if (beforeUpload) {
try {
transformedFile = await beforeUpload(file, fileList);
} catch (e) {
transformedFile = false;
}
if (transformedFile === false) return {
origin: file,
parsedFile: null,
action: null,
data: null
};
}
const { action } = this.props;
let mergedAction;
if (typeof action === "function") mergedAction = await action(file);
else mergedAction = action;
const { data } = this.props;
let mergedData;
if (typeof data === "function") mergedData = await data(file);
else mergedData = data;
const parsedData = (typeof transformedFile === "object" || typeof transformedFile === "string") && transformedFile ? transformedFile : file;
let parsedFile;
if (parsedData instanceof File) parsedFile = parsedData;
else parsedFile = new File([parsedData], file.name, { type: file.type });
const mergedParsedFile = parsedFile;
mergedParsedFile.uid = file.uid;
return {
origin: file,
data: mergedData,
parsedFile: mergedParsedFile,
action: mergedAction
};
};
post({ data, origin, action, parsedFile }) {
if (!this._isMounted) return;
const { onStart, customRequest, name, headers, withCredentials, method } = this.props;
const { uid } = origin;
const request = customRequest || upload;
const requestOption = {
action,
filename: name,
data,
file: parsedFile,
headers,
withCredentials,
method: method || "post",
onProgress: (e) => {
const { onProgress } = this.props;
onProgress?.(e, parsedFile);
},
onSuccess: (ret, xhr) => {
const { onSuccess } = this.props;
onSuccess?.(ret, parsedFile, xhr);
delete this.reqs[uid];
},
onError: (err, ret) => {
const { onError } = this.props;
onError?.(err, ret, parsedFile);
delete this.reqs[uid];
}
};
onStart(origin);
this.reqs[uid] = request(requestOption, { defaultRequest: upload });
}
reset() {
this.setState({ uid: uid() });
}
abort(file) {
const { reqs } = this;
if (file) {
const uid = file.uid ? file.uid : file;
if (reqs[uid] && reqs[uid].abort) reqs[uid].abort();
delete reqs[uid];
} else Object.keys(reqs).forEach((uid) => {
if (reqs[uid] && reqs[uid].abort) reqs[uid].abort();
delete reqs[uid];
});
}
saveFileInput = (node) => {
this.fileInput = node;
};
render() {
const { component: Tag, prefixCls, className, classNames = {}, disabled, id, name, style, styles = {}, multiple, accept, capture, children, directory, openFileDialogOnClick, onMouseEnter, onMouseLeave, hasControlInside, ...otherProps } = this.props;
const acceptFormat = typeof accept === "string" ? accept : accept?.format;
const cls = clsx(prefixCls, {
[`${prefixCls}-disabled`]: disabled,
[className]: className
});
const dirProps = directory ? {
directory: "directory",
webkitdirectory: "webkitdirectory"
} : {};
const events = disabled ? {} : {
onClick: openFileDialogOnClick ? this.onClick : () => {},
onKeyDown: openFileDialogOnClick ? this.onKeyDown : () => {},
onMouseEnter,
onMouseLeave,
onDrop: this.onFileDrop,
onDragOver: this.onFileDragOver,
tabIndex: hasControlInside ? void 0 : "0"
};
return /* @__PURE__ */ import_react.createElement(Tag, _extends$1({}, events, {
className: cls,
role: hasControlInside ? void 0 : "button",
style
}), /* @__PURE__ */ import_react.createElement("input", _extends$1({}, pickAttrs(otherProps, {
aria: true,
data: true
}), {
id,
name,
disabled,
type: "file",
ref: this.saveFileInput,
onClick: (e) => e.stopPropagation(),
key: this.state.uid,
style: {
display: "none",
...styles.input
},
className: classNames.input,
accept: acceptFormat
}, dirProps, {
multiple,
onChange: this.onChange
}, capture != null ? { capture } : {})), children);
}
};
//#endregion
//#region node_modules/@rc-component/upload/es/Upload.js
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
}
return target;
};
return _extends.apply(this, arguments);
}
function empty() {}
var Upload$2 = class extends import_react.Component {
static defaultProps = {
component: "span",
prefixCls: "rc-upload",
data: {},
headers: {},
name: "file",
multipart: false,
onStart: empty,
onError: empty,
onSuccess: empty,
multiple: false,
beforeUpload: null,
customRequest: null,
withCredentials: false,
openFileDialogOnClick: true,
hasControlInside: false
};
uploader;
abort(file) {
this.uploader.abort(file);
}
saveUploader = (node) => {
this.uploader = node;
};
render() {
return /* @__PURE__ */ import_react.createElement(AjaxUploader, _extends({}, this.props, { ref: this.saveUploader }));
}
};
//#endregion
//#region node_modules/@rc-component/upload/es/index.js
var es_default = Upload$2;
//#endregion
//#region node_modules/antd/es/upload/style/dragger.js
var genDraggerStyle = (token) => {
const { componentCls, iconCls } = token;
return { [`${componentCls}-wrapper`]: { [`${componentCls}-drag`]: {
position: "relative",
width: "100%",
height: "100%",
textAlign: "center",
background: token.colorFillAlter,
border: `${unit$1(token.lineWidth)} dashed ${token.colorBorder}`,
borderRadius: token.borderRadiusLG,
cursor: "pointer",
transition: `border-color ${token.motionDurationSlow}`,
[componentCls]: { padding: token.padding },
[`${componentCls}-btn`]: {
display: "table",
width: "100%",
height: "100%",
outline: "none",
borderRadius: token.borderRadiusLG,
"&:focus-visible": { outline: `${unit$1(token.lineWidthFocus)} solid ${token.colorPrimaryBorder}` }
},
[`${componentCls}-drag-container`]: {
display: "table-cell",
verticalAlign: "middle"
},
[`
&:not(${componentCls}-disabled):hover,
&-hover:not(${componentCls}-disabled)
`]: { borderColor: token.colorPrimaryHover },
[`p${componentCls}-drag-icon`]: {
marginBottom: token.margin,
[iconCls]: {
color: token.colorPrimary,
fontSize: token.uploadThumbnailSize
}
},
[`p${componentCls}-text`]: {
margin: `0 0 ${unit$1(token.marginXXS)}`,
color: token.colorTextHeading,
fontSize: token.fontSizeLG
},
[`p${componentCls}-hint`]: {
color: token.colorTextDescription,
fontSize: token.fontSize
},
[`&${componentCls}-disabled`]: { [`p${componentCls}-drag-icon ${iconCls},
p${componentCls}-text,
p${componentCls}-hint
`]: { color: token.colorTextDisabled } }
} } };
};
//#endregion
//#region node_modules/antd/es/upload/style/list.js
var genListStyle = (token) => {
const { componentCls, iconCls, fontSize, lineHeight, motionDurationSlow, calc } = token;
const itemCls = `${componentCls}-list-item`;
const actionsCls = `${itemCls}-actions`;
const actionCls = `${itemCls}-action`;
return { [`${componentCls}-wrapper`]: { [`${componentCls}-list`]: {
...clearFix(),
lineHeight: token.lineHeight,
[itemCls]: {
position: "relative",
height: calc(token.lineHeight).mul(fontSize).equal(),
marginTop: token.marginXS,
fontSize,
display: "flex",
alignItems: "center",
transition: `background-color ${motionDurationSlow}`,
borderRadius: token.borderRadiusSM,
"&:hover": { backgroundColor: token.controlItemBgHover },
[`${itemCls}-name`]: {
...textEllipsis,
padding: `0 ${unit$1(token.paddingXS)}`,
lineHeight,
flex: "auto",
transition: `all ${motionDurationSlow}`
},
[actionsCls]: {
whiteSpace: "nowrap",
[actionCls]: { opacity: 0 },
"@media (hover: none), (pointer: coarse)": { [actionCls]: { opacity: 1 } },
[iconCls]: {
color: token.actionsColor,
transition: `all ${motionDurationSlow}`
},
[`
${actionCls}:focus-visible,
&.picture ${actionCls}
`]: { opacity: 1 }
},
[`${componentCls}-icon ${iconCls}`]: {
color: token.colorIcon,
fontSize
},
[`${itemCls}-progress`]: {
position: "absolute",
bottom: token.calc(token.uploadProgressOffset).mul(-1).equal(),
width: "100%",
paddingInlineStart: calc(fontSize).add(token.paddingXS).equal(),
fontSize,
lineHeight: 0,
pointerEvents: "none",
"> div": { margin: 0 }
}
},
[`${itemCls}:hover ${actionCls}`]: { opacity: 1 },
[`${itemCls}-error`]: {
color: token.colorError,
[`${itemCls}-name, ${componentCls}-icon ${iconCls}`]: { color: token.colorError },
[actionsCls]: {
[`${iconCls}, ${iconCls}:hover`]: { color: token.colorError },
[actionCls]: { opacity: 1 }
}
},
[`${componentCls}-list-item-container`]: {
transition: ["opacity", "height"].map((prop) => `${prop} ${motionDurationSlow}`).join(", "),
"&::before": {
display: "table",
width: 0,
height: 0,
content: "\"\""
}
}
} } };
};
//#endregion
//#region node_modules/antd/es/upload/style/motion.js
var genMotionStyle = (token) => {
const { componentCls } = token;
const uploadAnimateInlineIn = new Keyframe("uploadAnimateInlineIn", { from: {
width: 0,
height: 0,
padding: 0,
opacity: 0,
margin: token.calc(token.marginXS).div(-2).equal()
} });
const uploadAnimateInlineOut = new Keyframe("uploadAnimateInlineOut", { to: {
width: 0,
height: 0,
padding: 0,
opacity: 0,
margin: token.calc(token.marginXS).div(-2).equal()
} });
const inlineCls = `${componentCls}-animate-inline`;
return [
{ [`${componentCls}-wrapper`]: {
[`${inlineCls}-appear, ${inlineCls}-enter, ${inlineCls}-leave`]: {
animationDuration: token.motionDurationSlow,
animationTimingFunction: token.motionEaseInOutCirc,
animationFillMode: "forwards"
},
[`${inlineCls}-appear, ${inlineCls}-enter`]: { animationName: uploadAnimateInlineIn },
[`${inlineCls}-leave`]: { animationName: uploadAnimateInlineOut }
} },
{ [`${componentCls}-wrapper`]: initFadeMotion(token) },
uploadAnimateInlineIn,
uploadAnimateInlineOut
];
};
//#endregion
//#region node_modules/antd/es/upload/style/picture.js
var genPictureStyle = (token) => {
const { componentCls, iconCls, uploadThumbnailSize, uploadProgressOffset, calc } = token;
const listCls = `${componentCls}-list`;
const itemCls = `${listCls}-item`;
return { [`${componentCls}-wrapper`]: {
[`
${listCls}${listCls}-picture,
${listCls}${listCls}-picture-card,
${listCls}${listCls}-picture-circle
`]: {
[itemCls]: {
position: "relative",
height: calc(uploadThumbnailSize).add(calc(token.lineWidth).mul(2)).add(calc(token.paddingXS).mul(2)).equal(),
padding: token.paddingXS,
border: `${unit$1(token.lineWidth)} ${token.lineType} ${token.colorBorder}`,
borderRadius: token.borderRadiusLG,
"&:hover": { background: "transparent" },
[`${itemCls}-thumbnail`]: {
...textEllipsis,
width: uploadThumbnailSize,
height: uploadThumbnailSize,
lineHeight: unit$1(calc(uploadThumbnailSize).add(token.paddingSM).equal()),
textAlign: "center",
flex: "none",
[iconCls]: {
fontSize: token.fontSizeHeading2,
color: token.colorPrimary
},
img: {
display: "block",
width: "100%",
height: "100%",
overflow: "hidden"
}
},
[`${itemCls}-progress`]: {
bottom: calc(token.fontSize).mul(token.lineHeight).div(2).add(uploadProgressOffset).equal(),
width: `calc(100% - ${unit$1(calc(token.paddingSM).mul(2).equal())})`,
marginTop: 0,
paddingInlineStart: calc(uploadThumbnailSize).add(token.paddingXS).equal()
}
},
[`${itemCls}-error`]: {
borderColor: token.colorError,
[`${itemCls}-thumbnail ${iconCls}`]: {
[`svg path[fill='${blue[0]}']`]: { fill: token.colorErrorBg },
[`svg path[fill='${blue.primary}']`]: { fill: token.colorError }
}
},
[`${itemCls}-uploading`]: {
borderStyle: "dashed",
[`${itemCls}-name`]: { marginBottom: uploadProgressOffset }
}
},
[`${listCls}${listCls}-picture-circle ${itemCls}`]: { [`&, &::before, ${itemCls}-thumbnail`]: { borderRadius: "50%" } }
} };
};
var genPictureCardStyle = (token) => {
const { componentCls, iconCls, fontSizeLG, colorTextLightSolid, calc } = token;
const listCls = `${componentCls}-list`;
const itemCls = `${listCls}-item`;
const uploadPictureCardSize = token.uploadPicCardSize;
return {
[`
${componentCls}-wrapper${componentCls}-picture-card-wrapper,
${componentCls}-wrapper${componentCls}-picture-circle-wrapper
`]: {
...clearFix(),
display: "block",
[`${componentCls}${componentCls}-select`]: {
width: uploadPictureCardSize,
height: uploadPictureCardSize,
textAlign: "center",
verticalAlign: "top",
backgroundColor: token.colorFillAlter,
border: `${unit$1(token.lineWidth)} dashed ${token.colorBorder}`,
borderRadius: token.borderRadiusLG,
cursor: "pointer",
transition: `border-color ${token.motionDurationSlow}`,
[`> ${componentCls}`]: {
display: "flex",
alignItems: "center",
justifyContent: "center",
height: "100%",
textAlign: "center"
},
[`&:not(${componentCls}-disabled):hover`]: { borderColor: token.colorPrimary }
},
[`${listCls}${listCls}-picture-card, ${listCls}${listCls}-picture-circle`]: {
display: "flex",
flexWrap: "wrap",
"&:not(:empty)": { minHeight: uploadPictureCardSize },
"@supports not (gap: 1px)": { "& > *": {
marginBlockEnd: token.marginXS,
marginInlineEnd: token.marginXS
} },
"@supports (gap: 1px)": { gap: token.marginXS },
[`${listCls}-item-container`]: {
display: "inline-block",
width: uploadPictureCardSize,
height: uploadPictureCardSize,
verticalAlign: "top"
},
"&::after": { display: "none" },
"&::before": { display: "none" },
[itemCls]: {
height: "100%",
margin: 0,
"&::before": {
position: "absolute",
zIndex: 1,
width: `calc(100% - ${unit$1(calc(token.paddingXS).mul(2).equal())})`,
height: `calc(100% - ${unit$1(calc(token.paddingXS).mul(2).equal())})`,
backgroundColor: token.colorBgMask,
opacity: 0,
transition: `all ${token.motionDurationSlow}`,
content: "\" \""
}
},
[`${itemCls}:hover`]: { [`&::before, ${itemCls}-actions`]: { opacity: 1 } },
[`${itemCls}-actions`]: {
position: "absolute",
insetInlineStart: 0,
zIndex: 10,
width: "100%",
whiteSpace: "nowrap",
textAlign: "center",
opacity: 0,
transition: `all ${token.motionDurationSlow}`,
[`
${iconCls}-eye,
${iconCls}-download,
${iconCls}-delete
`]: {
zIndex: 10,
width: fontSizeLG,
margin: `0 ${unit$1(token.marginXXS)}`,
fontSize: fontSizeLG,
cursor: "pointer",
transition: `all ${token.motionDurationSlow}`,
color: colorTextLightSolid,
"&:hover": { color: colorTextLightSolid },
svg: { verticalAlign: "baseline" }
}
},
[`${itemCls}-thumbnail, ${itemCls}-thumbnail img`]: {
position: "static",
display: "block",
width: "100%",
height: "100%",
objectFit: "contain"
},
[`${itemCls}-name`]: {
display: "none",
textAlign: "center"
},
[`${itemCls}-file + ${itemCls}-name`]: {
position: "absolute",
bottom: token.margin,
display: "block",
width: `calc(100% - ${unit$1(calc(token.paddingXS).mul(2).equal())})`
},
[`${itemCls}-uploading`]: {
[`&${itemCls}`]: { backgroundColor: token.colorFillAlter },
[`&::before, ${iconCls}-eye, ${iconCls}-download, ${iconCls}-delete`]: { display: "none" }
},
[`${itemCls}-progress`]: {
bottom: token.marginXL,
width: `calc(100% - ${unit$1(calc(token.paddingXS).mul(2).equal())})`,
paddingInlineStart: 0
}
}
},
[`${componentCls}-wrapper${componentCls}-picture-circle-wrapper`]: { [`${componentCls}${componentCls}-select`]: { borderRadius: "50%" } }
};
};
//#endregion
//#region node_modules/antd/es/upload/style/rtl.js
var genRtlStyle = (token) => {
const { componentCls } = token;
return { [`${componentCls}-rtl`]: { direction: "rtl" } };
};
//#endregion
//#region node_modules/antd/es/upload/style/index.js
var genBaseStyle = (token) => {
const { componentCls, colorTextDisabled } = token;
return { [`${componentCls}-wrapper`]: {
...resetComponent(token),
[componentCls]: {
outline: 0,
"input[type='file']": { cursor: "pointer" }
},
[`${componentCls}-select`]: { display: "inline-block" },
[`${componentCls}-hidden`]: { display: "none" },
[`${componentCls}-disabled`]: {
color: colorTextDisabled,
cursor: "not-allowed"
}
} };
};
var prepareComponentToken = (token) => ({
actionsColor: token.colorIcon,
pictureCardSize: token.controlHeightLG * 2.55
});
var style_default = genStyleHooks("Upload", (token) => {
const { fontSizeHeading3, marginXS, lineWidth, pictureCardSize, calc } = token;
const uploadToken = merge(token, {
uploadThumbnailSize: calc(fontSizeHeading3).mul(2).equal(),
uploadProgressOffset: calc(calc(marginXS).div(2)).add(lineWidth).equal(),
uploadPicCardSize: pictureCardSize
});
return [
genBaseStyle(uploadToken),
genDraggerStyle(uploadToken),
genPictureStyle(uploadToken),
genPictureCardStyle(uploadToken),
genListStyle(uploadToken),
genMotionStyle(uploadToken),
genRtlStyle(uploadToken),
genCollapseMotion(uploadToken)
];
}, prepareComponentToken);
//#endregion
//#region node_modules/antd/es/upload/utils.js
function file2Obj(file) {
return {
...file,
lastModified: file.lastModified,
lastModifiedDate: file.lastModifiedDate,
name: file.name,
size: file.size,
type: file.type,
uid: file.uid,
percent: 0,
originFileObj: file
};
}
/** Upload fileList. Replace file if exist or just push into it. */
function updateFileList(file, fileList) {
const nextFileList = _toConsumableArray$8(fileList);
const fileIndex = nextFileList.findIndex(({ uid }) => uid === file.uid);
if (fileIndex === -1) nextFileList.push(file);
else nextFileList[fileIndex] = file;
return nextFileList;
}
function getFileItem(file, fileList) {
const matchKey = file.uid !== void 0 ? "uid" : "name";
return fileList.filter((item) => item[matchKey] === file[matchKey])[0];
}
function removeFileItem(file, fileList) {
const matchKey = file.uid !== void 0 ? "uid" : "name";
const removed = fileList.filter((item) => item[matchKey] !== file[matchKey]);
if (removed.length === fileList.length) return null;
return removed;
}
var extname = (url = "") => {
const temp = url.split("/");
const filenameWithoutSuffix = temp[temp.length - 1].split(/#|\?/)[0];
return (/\.[^./\\]*$/.exec(filenameWithoutSuffix) || [""])[0];
};
var isImageFileType = (type) => type.indexOf("image/") === 0;
var isImageUrl = (file) => {
if (file.type && !file.thumbUrl) return isImageFileType(file.type);
const url = file.thumbUrl || file.url || "";
const extension = extname(url);
if (/^data:image\//.test(url) || /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(extension)) return true;
if (/^data:/.test(url)) return false;
if (extension) return false;
return true;
};
var MEASURE_SIZE = 200;
function previewImage(file) {
return new Promise((resolve) => {
if (!file.type || !isImageFileType(file.type)) {
resolve("");
return;
}
const canvas = document.createElement("canvas");
canvas.width = MEASURE_SIZE;
canvas.height = MEASURE_SIZE;
canvas.style.cssText = `position: fixed; left: 0; top: 0; width: ${MEASURE_SIZE}px; height: ${MEASURE_SIZE}px; z-index: 9999; display: none;`;
document.body.appendChild(canvas);
const ctx = canvas.getContext("2d");
const img = new Image();
img.onload = () => {
const { width, height } = img;
let drawWidth = MEASURE_SIZE;
let drawHeight = MEASURE_SIZE;
let offsetX = 0;
let offsetY = 0;
if (width > height) {
drawHeight = height * (MEASURE_SIZE / width);
offsetY = -(drawHeight - drawWidth) / 2;
} else {
drawWidth = width * (MEASURE_SIZE / height);
offsetX = -(drawWidth - drawHeight) / 2;
}
ctx.drawImage(img, offsetX, offsetY, drawWidth, drawHeight);
const dataURL = canvas.toDataURL();
document.body.removeChild(canvas);
window.URL.revokeObjectURL(img.src);
resolve(dataURL);
};
img.crossOrigin = "anonymous";
if (file.type.startsWith("image/svg+xml")) {
const reader = new FileReader();
reader.onload = () => {
if (reader.result && typeof reader.result === "string") img.src = reader.result;
};
reader.readAsDataURL(file);
} else if (file.type.startsWith("image/gif")) {
const reader = new FileReader();
reader.onload = () => {
if (reader.result) resolve(reader.result);
};
reader.readAsDataURL(file);
} else img.src = window.URL.createObjectURL(file);
});
}
//#endregion
//#region node_modules/antd/es/upload/UploadList/ListItem.js
var ListItem = /* @__PURE__ */ import_react.forwardRef(({ prefixCls, className, style, classNames: itemClassNames, styles, locale, listType, file, items, progress: progressProps, iconRender, actionIconRender, itemRender, isImgUrl, showPreviewIcon, showRemoveIcon, showDownloadIcon, previewIcon: customPreviewIcon, removeIcon: customRemoveIcon, downloadIcon: customDownloadIcon, extra: customExtra, onPreview, onDownload, onClose }, ref) => {
const { status } = file;
const [mergedStatus, setMergedStatus] = import_react.useState(status);
import_react.useEffect(() => {
if (status !== "removed") setMergedStatus(status);
}, [status]);
const [showProgress, setShowProgress] = import_react.useState(false);
import_react.useEffect(() => {
const timer = setTimeout(() => {
setShowProgress(true);
}, 300);
return () => {
clearTimeout(timer);
};
}, []);
const iconNode = iconRender(file);
let icon = /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-icon` }, iconNode);
if (listType === "picture" || listType === "picture-card" || listType === "picture-circle") if (mergedStatus === "uploading" || !file.thumbUrl && !file.url) {
const uploadingClassName = clsx(`${prefixCls}-list-item-thumbnail`, { [`${prefixCls}-list-item-file`]: mergedStatus !== "uploading" });
icon = /* @__PURE__ */ import_react.createElement("div", { className: uploadingClassName }, iconNode);
} else {
const thumbnail = isImgUrl?.(file) ? /* @__PURE__ */ import_react.createElement("img", {
src: file.thumbUrl || file.url,
alt: file.name,
className: `${prefixCls}-list-item-image`,
crossOrigin: file.crossOrigin
}) : iconNode;
const aClassName = clsx(`${prefixCls}-list-item-thumbnail`, { [`${prefixCls}-list-item-file`]: isImgUrl && !isImgUrl(file) });
icon = /* @__PURE__ */ import_react.createElement("a", {
className: aClassName,
onClick: (e) => onPreview(file, e),
href: file.url || file.thumbUrl,
target: "_blank",
rel: "noopener noreferrer"
}, thumbnail);
}
const listItemClassName = clsx(`${prefixCls}-list-item`, `${prefixCls}-list-item-${mergedStatus}`, itemClassNames?.item);
const linkProps = typeof file.linkProps === "string" ? JSON.parse(file.linkProps) : file.linkProps;
const removeIcon = (typeof showRemoveIcon === "function" ? showRemoveIcon(file) : showRemoveIcon) ? actionIconRender((typeof customRemoveIcon === "function" ? customRemoveIcon(file) : customRemoveIcon) || /* @__PURE__ */ import_react.createElement(RefIcon$44, null), () => onClose(file), prefixCls, locale.removeFile, true) : null;
const downloadIcon = (typeof showDownloadIcon === "function" ? showDownloadIcon(file) : showDownloadIcon) && mergedStatus === "done" ? actionIconRender((typeof customDownloadIcon === "function" ? customDownloadIcon(file) : customDownloadIcon) || /* @__PURE__ */ import_react.createElement(RefIcon$48, null), () => onDownload(file), prefixCls, locale.downloadFile) : null;
const downloadOrDelete = listType !== "picture-card" && listType !== "picture-circle" && /* @__PURE__ */ import_react.createElement("span", {
key: "download-delete",
className: clsx(`${prefixCls}-list-item-actions`, { picture: listType === "picture" })
}, downloadIcon, removeIcon);
const extraContent = typeof customExtra === "function" ? customExtra(file) : customExtra;
const extra = extraContent && /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-list-item-extra` }, extraContent);
const listItemNameClass = clsx(`${prefixCls}-list-item-name`);
const fileName = file.url ? /* @__PURE__ */ import_react.createElement("a", {
key: "view",
target: "_blank",
rel: "noopener noreferrer",
className: listItemNameClass,
title: file.name,
...linkProps,
href: file.url,
onClick: (e) => onPreview(file, e)
}, file.name, extra) : /* @__PURE__ */ import_react.createElement("span", {
key: "view",
className: listItemNameClass,
onClick: (e) => onPreview(file, e),
title: file.name
}, file.name, extra);
const previewIcon = (typeof showPreviewIcon === "function" ? showPreviewIcon(file) : showPreviewIcon) && (file.url || file.thumbUrl) ? /* @__PURE__ */ import_react.createElement("a", {
href: file.url || file.thumbUrl,
target: "_blank",
rel: "noopener noreferrer",
onClick: (e) => onPreview(file, e),
title: locale.previewFile
}, typeof customPreviewIcon === "function" ? customPreviewIcon(file) : customPreviewIcon || /* @__PURE__ */ import_react.createElement(RefIcon$27, null)) : null;
const pictureCardActions = (listType === "picture-card" || listType === "picture-circle") && mergedStatus !== "uploading" && /* @__PURE__ */ import_react.createElement("span", { className: `${prefixCls}-list-item-actions` }, previewIcon, mergedStatus === "done" && downloadIcon, removeIcon);
const { getPrefixCls } = import_react.useContext(ConfigContext);
const rootPrefixCls = getPrefixCls();
const dom = /* @__PURE__ */ import_react.createElement("div", {
className: listItemClassName,
style: styles?.item
}, icon, fileName, downloadOrDelete, pictureCardActions, showProgress && /* @__PURE__ */ import_react.createElement(es_default$28, {
motionName: `${rootPrefixCls}-fade`,
visible: mergedStatus === "uploading",
motionDeadline: 2e3
}, ({ className: motionClassName }) => {
const loadingProgress = "percent" in file ? /* @__PURE__ */ import_react.createElement(progress_default, {
type: "line",
percent: file.percent,
"aria-label": file["aria-label"],
"aria-labelledby": file["aria-labelledby"],
...progressProps
}) : null;
return /* @__PURE__ */ import_react.createElement("div", { className: clsx(`${prefixCls}-list-item-progress`, motionClassName) }, loadingProgress);
}));
const message = file.response && typeof file.response === "string" ? file.response : file.error?.statusText || file.error?.message || locale.uploadError;
const item = mergedStatus === "error" ? /* @__PURE__ */ import_react.createElement(Tooltip, {
title: message,
getPopupContainer: (node) => node.parentNode
}, dom) : dom;
return /* @__PURE__ */ import_react.createElement("div", {
className: clsx(`${prefixCls}-list-item-container`, className),
style,
ref
}, itemRender ? itemRender(item, file, items, {
download: onDownload.bind(null, file),
preview: onPreview.bind(null, file),
remove: onClose.bind(null, file)
}) : item);
});
//#endregion
//#region node_modules/antd/es/upload/UploadList/index.js
var InternalUploadList = (props, ref) => {
const { listType = "text", previewFile = previewImage, onPreview, onDownload, onRemove, locale, iconRender, isImageUrl: isImgUrl = isImageUrl, prefixCls: customizePrefixCls, items = [], showPreviewIcon = true, showRemoveIcon = true, showDownloadIcon = false, removeIcon, previewIcon, downloadIcon, extra, progress = {
size: [-1, 2],
showInfo: false
}, appendAction, appendActionVisible = true, itemRender, disabled, classNames: uploadListClassNames, styles } = props;
const [, forceUpdate] = useForceUpdate();
const [motionAppear, setMotionAppear] = import_react.useState(false);
const isPictureCardOrCirle = ["picture-card", "picture-circle"].includes(listType);
import_react.useEffect(() => {
if (!listType.startsWith("picture")) return;
(items || []).forEach((file) => {
if (!(file.originFileObj instanceof File || file.originFileObj instanceof Blob) || file.thumbUrl !== void 0) return;
file.thumbUrl = "";
previewFile?.(file.originFileObj).then((previewDataUrl) => {
file.thumbUrl = previewDataUrl || "";
forceUpdate();
});
});
}, [
listType,
items,
previewFile
]);
import_react.useEffect(() => {
setMotionAppear(true);
}, []);
const onInternalPreview = (file, e) => {
if (!onPreview) return;
e?.preventDefault();
return onPreview(file);
};
const onInternalDownload = (file) => {
if (typeof onDownload === "function") onDownload(file);
else if (file.url) window.open(file.url);
};
const onInternalClose = (file) => {
onRemove?.(file);
};
const internalIconRender = (file) => {
if (iconRender) return iconRender(file, listType);
const isLoading = file.status === "uploading";
if (listType.startsWith("picture")) {
const loadingIcon = listType === "picture" ? /* @__PURE__ */ import_react.createElement(RefIcon$5, null) : locale.uploading;
const fileIcon = isImgUrl?.(file) ? /* @__PURE__ */ import_react.createElement(RefIcon$49, null) : /* @__PURE__ */ import_react.createElement(RefIcon$50, null);
return isLoading ? loadingIcon : fileIcon;
}
return isLoading ? /* @__PURE__ */ import_react.createElement(RefIcon$5, null) : /* @__PURE__ */ import_react.createElement(RefIcon$51, null);
};
const actionIconRender = (customIcon, callback, prefixCls, title, acceptUploadDisabled) => {
const btnProps = {
type: "text",
size: "small",
title,
onClick: (e) => {
callback();
if (/* @__PURE__ */ import_react.isValidElement(customIcon)) customIcon.props.onClick?.(e);
},
className: `${prefixCls}-list-item-action`,
disabled: acceptUploadDisabled ? disabled : false
};
return /* @__PURE__ */ import_react.isValidElement(customIcon) ? /* @__PURE__ */ import_react.createElement(Button, {
...btnProps,
icon: cloneElement$1(customIcon, {
...customIcon.props,
onClick: () => {}
})
}) : /* @__PURE__ */ import_react.createElement(Button, { ...btnProps }, /* @__PURE__ */ import_react.createElement("span", null, customIcon));
};
import_react.useImperativeHandle(ref, () => ({
handlePreview: onInternalPreview,
handleDownload: onInternalDownload
}));
const { getPrefixCls } = import_react.useContext(ConfigContext);
const prefixCls = getPrefixCls("upload", customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const listClassNames = clsx(`${prefixCls}-list`, `${prefixCls}-list-${listType}`, uploadListClassNames?.list);
const listItemMotion = import_react.useMemo(() => omit(initCollapseMotion(rootPrefixCls), [
"onAppearEnd",
"onEnterEnd",
"onLeaveEnd"
]), [rootPrefixCls]);
const motionConfig = {
...isPictureCardOrCirle ? {} : listItemMotion,
motionDeadline: 2e3,
motionName: `${prefixCls}-${isPictureCardOrCirle ? "animate-inline" : "animate"}`,
keys: _toConsumableArray$8(items.map((file) => ({
key: file.uid,
file
}))),
motionAppear
};
return /* @__PURE__ */ import_react.createElement("div", {
className: listClassNames,
style: styles?.list
}, /* @__PURE__ */ import_react.createElement(CSSMotionList_default, {
...motionConfig,
component: false
}, ({ key, file, className: motionClassName, style: motionStyle }) => /* @__PURE__ */ import_react.createElement(ListItem, {
key,
locale,
prefixCls,
className: motionClassName,
style: motionStyle,
classNames: uploadListClassNames,
styles,
file,
items,
progress,
listType,
isImgUrl,
showPreviewIcon,
showRemoveIcon,
showDownloadIcon,
removeIcon,
previewIcon,
downloadIcon,
extra,
iconRender: internalIconRender,
actionIconRender,
itemRender,
onPreview: onInternalPreview,
onDownload: onInternalDownload,
onClose: onInternalClose
})), appendAction && /* @__PURE__ */ import_react.createElement(es_default$28, {
...motionConfig,
visible: appendActionVisible,
forceRender: true
}, ({ className: motionClassName, style: motionStyle }) => cloneElement$1(appendAction, (oriProps) => ({
className: clsx(oriProps.className, motionClassName),
style: {
...motionStyle,
pointerEvents: motionClassName ? "none" : void 0,
...oriProps.style
}
}))));
};
var UploadList = /* @__PURE__ */ import_react.forwardRef(InternalUploadList);
UploadList.displayName = "UploadList";
//#endregion
//#region node_modules/antd/es/upload/Upload.js
var LIST_IGNORE = `__LIST_IGNORE_${Date.now()}__`;
var InternalUpload = (props, ref) => {
const config = useComponentConfig("upload");
const { fileList, defaultFileList, onRemove, showUploadList = true, listType = "text", onPreview, onDownload, onChange, onDrop, previewFile, disabled: customDisabled, locale: propLocale, iconRender, isImageUrl, progress, prefixCls: customizePrefixCls, className, type = "select", children, style, itemRender, maxCount, data = {}, multiple = false, hasControlInside = true, action = "", accept = "", supportServerRender = true, rootClassName, styles, classNames } = props;
const disabled = import_react.useContext(DisabledContext);
const mergedDisabled = customDisabled ?? disabled;
const customRequest = props.customRequest || config.customRequest;
const [internalFileList, setMergedFileList] = useControlledState(defaultFileList, fileList);
const mergedFileList = internalFileList || [];
const [dragState, setDragState] = import_react.useState("drop");
const uploadRef = import_react.useRef(null);
const wrapRef = import_react.useRef(null);
devUseWarning("Upload")("fileList" in props || !("value" in props), "usage", "`value` is not a valid prop, do you mean `fileList`?");
import_react.useMemo(() => {
const timestamp = Date.now();
(fileList || []).forEach((file, index) => {
if (!file.uid && !Object.isFrozen(file)) file.uid = `__AUTO__${timestamp}_${index}__`;
});
}, [fileList]);
const onInternalChange = (file, changedFileList, event) => {
let cloneList = _toConsumableArray$8(changedFileList);
let exceedMaxCount = false;
if (maxCount === 1) cloneList = cloneList.slice(-1);
else if (maxCount) {
exceedMaxCount = cloneList.length > maxCount;
cloneList = cloneList.slice(0, maxCount);
}
(0, import_react_dom.flushSync)(() => {
setMergedFileList(cloneList);
});
const changeInfo = {
file,
fileList: cloneList
};
if (event) changeInfo.event = event;
if (!exceedMaxCount || file.status === "removed" || cloneList.some((f) => f.uid === file.uid)) (0, import_react_dom.flushSync)(() => {
onChange?.(changeInfo);
});
};
const mergedBeforeUpload = async (file, fileListArgs) => {
const { beforeUpload } = props;
let parsedFile = file;
if (beforeUpload) {
const result = await beforeUpload(file, fileListArgs);
if (result === false) return false;
delete file[LIST_IGNORE];
if (result === LIST_IGNORE) {
Object.defineProperty(file, LIST_IGNORE, {
value: true,
configurable: true
});
return false;
}
if (isPlainObject(result)) parsedFile = result;
}
return parsedFile;
};
const onBatchStart = (batchFileInfoList) => {
const filteredFileInfoList = batchFileInfoList.filter((info) => !info.file[LIST_IGNORE]);
if (!filteredFileInfoList.length) return;
const objectFileList = filteredFileInfoList.map((info) => file2Obj(info.file));
let newFileList = _toConsumableArray$8(mergedFileList);
objectFileList.forEach((fileObj) => {
newFileList = updateFileList(fileObj, newFileList);
});
objectFileList.forEach((fileObj, index) => {
let triggerFileObj = fileObj;
if (!filteredFileInfoList[index].parsedFile) {
const { originFileObj } = fileObj;
let clone;
try {
clone = new File([originFileObj], originFileObj.name, { type: originFileObj.type });
} catch {
clone = new Blob([originFileObj], { type: originFileObj.type });
clone.name = originFileObj.name;
clone.lastModifiedDate = /* @__PURE__ */ new Date();
clone.lastModified = (/* @__PURE__ */ new Date()).getTime();
}
clone.uid = fileObj.uid;
triggerFileObj = clone;
} else fileObj.status = "uploading";
onInternalChange(triggerFileObj, newFileList);
});
};
const onSuccess = (response, file, xhr) => {
try {
if (typeof response === "string") response = JSON.parse(response);
} catch {}
if (!getFileItem(file, mergedFileList)) return;
const targetItem = file2Obj(file);
targetItem.status = "done";
targetItem.percent = 100;
targetItem.response = response;
targetItem.xhr = xhr;
onInternalChange(targetItem, updateFileList(targetItem, mergedFileList));
};
const onProgress = (e, file) => {
if (!getFileItem(file, mergedFileList)) return;
const targetItem = file2Obj(file);
targetItem.status = "uploading";
targetItem.percent = e.percent;
onInternalChange(targetItem, updateFileList(targetItem, mergedFileList), e);
};
const onError = (error, response, file) => {
if (!getFileItem(file, mergedFileList)) return;
const targetItem = file2Obj(file);
targetItem.error = error;
targetItem.response = response;
targetItem.status = "error";
onInternalChange(targetItem, updateFileList(targetItem, mergedFileList));
};
const handleRemove = (file) => {
let currentFile;
Promise.resolve(typeof onRemove === "function" ? onRemove(file) : onRemove).then((ret) => {
if (ret === false) return;
const removedFileList = removeFileItem(file, mergedFileList);
if (removedFileList) {
currentFile = {
...file,
status: "removed"
};
mergedFileList?.forEach((item) => {
const matchKey = currentFile.uid !== void 0 ? "uid" : "name";
if (item[matchKey] === currentFile[matchKey] && !Object.isFrozen(item)) item.status = "removed";
});
uploadRef.current?.abort(currentFile);
onInternalChange(currentFile, removedFileList);
}
});
};
const onFileDrop = (e) => {
setDragState(e.type);
if (e.type === "drop") onDrop?.(e);
};
import_react.useImperativeHandle(ref, () => ({
onBatchStart,
onSuccess,
onProgress,
onError,
fileList: mergedFileList,
upload: uploadRef.current,
nativeElement: wrapRef.current
}));
const { getPrefixCls, direction, className: contextClassName, style: contextStyle, classNames: contextClassNames, styles: contextStyles } = useComponentConfig("upload");
const prefixCls = getPrefixCls("upload", customizePrefixCls);
const mergedProps = {
...props,
listType,
showUploadList,
type,
multiple,
hasControlInside,
supportServerRender,
disabled: mergedDisabled
};
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], { props: mergedProps });
const rcUploadProps = {
onBatchStart,
onError,
onProgress,
onSuccess,
...props,
customRequest,
data,
multiple,
action,
accept,
supportServerRender,
prefixCls,
disabled: mergedDisabled,
beforeUpload: mergedBeforeUpload,
onChange: void 0,
hasControlInside
};
delete rcUploadProps.className;
delete rcUploadProps.style;
if (!children || mergedDisabled) delete rcUploadProps.id;
const wrapperCls = `${prefixCls}-wrapper`;
const [hashId, cssVarCls] = style_default(prefixCls, wrapperCls);
const [contextLocale] = useLocale$1("Upload", localeValues.Upload);
const { showRemoveIcon, showPreviewIcon, showDownloadIcon, removeIcon, previewIcon, downloadIcon, extra } = typeof showUploadList === "boolean" ? {} : showUploadList;
const realShowRemoveIcon = typeof showRemoveIcon === "undefined" ? !mergedDisabled : showRemoveIcon;
const renderUploadList = (button, buttonVisible) => {
if (!showUploadList) return button;
return /* @__PURE__ */ import_react.createElement(UploadList, {
classNames: mergedClassNames,
styles: mergedStyles,
prefixCls,
listType,
items: mergedFileList,
previewFile,
onPreview,
onDownload,
onRemove: handleRemove,
showRemoveIcon: realShowRemoveIcon,
showPreviewIcon,
showDownloadIcon,
removeIcon,
previewIcon,
downloadIcon,
iconRender,
extra,
locale: {
...contextLocale,
...propLocale
},
isImageUrl,
progress,
appendAction: button,
appendActionVisible: buttonVisible,
itemRender,
disabled: mergedDisabled
});
};
const mergedRootCls = clsx(wrapperCls, className, rootClassName, hashId, cssVarCls, contextClassName, mergedClassNames.root, {
[`${prefixCls}-rtl`]: direction === "rtl",
[`${prefixCls}-picture-card-wrapper`]: listType === "picture-card",
[`${prefixCls}-picture-circle-wrapper`]: listType === "picture-circle"
});
const mergedRootStyle = { ...mergedStyles.root };
const mergedStyle = {
...contextStyle,
...style
};
if (type === "drag") {
const dragCls = clsx(hashId, prefixCls, `${prefixCls}-drag`, {
[`${prefixCls}-drag-uploading`]: mergedFileList.some((file) => file.status === "uploading"),
[`${prefixCls}-drag-hover`]: dragState === "dragover",
[`${prefixCls}-disabled`]: mergedDisabled,
[`${prefixCls}-rtl`]: direction === "rtl"
}, mergedClassNames.trigger);
return /* @__PURE__ */ import_react.createElement("span", {
className: mergedRootCls,
ref: wrapRef,
style: mergedRootStyle
}, /* @__PURE__ */ import_react.createElement("div", {
className: dragCls,
style: {
...mergedStyle,
...mergedStyles.trigger
},
onDrop: onFileDrop,
onDragOver: onFileDrop,
onDragLeave: onFileDrop
}, /* @__PURE__ */ import_react.createElement(es_default, {
...rcUploadProps,
ref: uploadRef,
className: `${prefixCls}-btn`
}, /* @__PURE__ */ import_react.createElement("div", { className: `${prefixCls}-drag-container` }, children))), renderUploadList());
}
const uploadBtnCls = clsx(prefixCls, `${prefixCls}-select`, {
[`${prefixCls}-disabled`]: mergedDisabled,
[`${prefixCls}-hidden`]: !children
}, mergedClassNames.trigger);
const uploadButton = /* @__PURE__ */ import_react.createElement("div", {
className: uploadBtnCls,
style: {
...mergedStyle,
...mergedStyles.trigger
}
}, /* @__PURE__ */ import_react.createElement(es_default, {
...rcUploadProps,
ref: uploadRef
}));
if (listType === "picture-card" || listType === "picture-circle") return /* @__PURE__ */ import_react.createElement("span", {
className: mergedRootCls,
ref: wrapRef,
style: mergedRootStyle
}, renderUploadList(uploadButton, !!children));
return /* @__PURE__ */ import_react.createElement("span", {
className: mergedRootCls,
ref: wrapRef,
style: mergedRootStyle
}, uploadButton, renderUploadList());
};
var Upload$1 = /* @__PURE__ */ import_react.forwardRef(InternalUpload);
Upload$1.displayName = "Upload";
//#endregion
//#region node_modules/antd/es/upload/Dragger.js
var Dragger = /* @__PURE__ */ import_react.forwardRef((props, ref) => {
const { style, height, hasControlInside = false, children, ...restProps } = props;
const mergedStyle = {
...style,
height
};
return /* @__PURE__ */ import_react.createElement(Upload$1, {
ref,
hasControlInside,
...restProps,
style: mergedStyle,
type: "drag"
}, children);
});
Dragger.displayName = "Dragger";
//#endregion
//#region node_modules/antd/es/upload/index.js
var Upload = Upload$1;
Upload.Dragger = Dragger;
Upload.LIST_IGNORE = LIST_IGNORE;
//#endregion
//#region node_modules/@rc-component/mutate-observer/es/useMutateObserver.js
var defaultOptions = {
subtree: true,
childList: true,
attributeFilter: ["style", "class"]
};
var useMutateObserver = (nodeOrList, callback, options = defaultOptions) => {
import_react.useEffect(() => {
if (!canUseDom() || !nodeOrList) return;
let instance;
const nodeList = Array.isArray(nodeOrList) ? nodeOrList : [nodeOrList];
if ("MutationObserver" in window) {
instance = new MutationObserver(callback);
nodeList.forEach((element) => {
instance.observe(element, options);
});
}
return () => {
instance?.takeRecords();
instance?.disconnect();
};
}, [options, nodeOrList]);
};
var prepareCanvas = (width, height, ratio = 1) => {
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const realWidth = width * ratio;
const realHeight = height * ratio;
canvas.setAttribute("width", `${realWidth}px`);
canvas.setAttribute("height", `${realHeight}px`);
ctx.save();
return [
ctx,
canvas,
realWidth,
realHeight
];
};
var getRotatePos = (x, y, angle) => {
return [x * Math.cos(angle) - y * Math.sin(angle), x * Math.sin(angle) + y * Math.cos(angle)];
};
/**
* Get the clips of text content.
* This is a lazy hook function since SSR no need this
*/
var useClips = () => {
const getClips = (content, rotate, ratio, width, height, font, gapX, gapY) => {
const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio);
if (content instanceof HTMLImageElement) ctx.drawImage(content, 0, 0, contentWidth, contentHeight);
else {
const { color, fontSize, fontStyle, fontWeight, fontFamily, textAlign } = font;
const mergedFontSize = Number(fontSize) * ratio;
ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`;
ctx.fillStyle = color;
ctx.textAlign = textAlign;
ctx.textBaseline = "top";
toList(content)?.forEach((item, index) => {
ctx.fillText(item ?? "", contentWidth / 2, index * (mergedFontSize + 3 * ratio));
});
}
const angle = Math.PI / 180 * Number(rotate);
const maxSize = Math.max(width, height);
const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio);
rCtx.translate(realMaxSize / 2, realMaxSize / 2);
rCtx.rotate(angle);
if (contentWidth > 0 && contentHeight > 0) rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2);
let left = 0;
let right = 0;
let top = 0;
let bottom = 0;
const halfWidth = contentWidth / 2;
const halfHeight = contentHeight / 2;
[
[0 - halfWidth, 0 - halfHeight],
[0 + halfWidth, 0 - halfHeight],
[0 + halfWidth, 0 + halfHeight],
[0 - halfWidth, 0 + halfHeight]
].forEach(([x, y]) => {
const [targetX, targetY] = getRotatePos(x, y, angle);
left = Math.min(left, targetX);
right = Math.max(right, targetX);
top = Math.min(top, targetY);
bottom = Math.max(bottom, targetY);
});
const cutLeft = left + realMaxSize / 2;
const cutTop = top + realMaxSize / 2;
const cutWidth = right - left;
const cutHeight = bottom - top;
const realGapX = gapX * ratio;
const realGapY = gapY * ratio;
const filledWidth = (cutWidth + realGapX) * 2;
const filledHeight = cutHeight + realGapY;
const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight);
const drawImg = (targetX = 0, targetY = 0) => {
fCtx.drawImage(rCanvas, cutLeft, cutTop, cutWidth, cutHeight, targetX, targetY, cutWidth, cutHeight);
};
drawImg();
drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2);
drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2);
return [
fCanvas.toDataURL(),
filledWidth / ratio,
filledHeight / ratio
];
};
return import_react.useCallback(getClips, []);
};
//#endregion
//#region node_modules/antd/es/watermark/useRafDebounce.js
/**
* Callback will only execute last one for each raf
*/
function useRafDebounce(callback) {
const executeRef = import_react.useRef(false);
const rafRef = import_react.useRef(null);
const wrapperCallback = useEvent(callback);
return () => {
if (executeRef.current) return;
executeRef.current = true;
wrapperCallback();
rafRef.current = wrapperRaf(() => {
executeRef.current = false;
});
};
}
//#endregion
//#region node_modules/antd/es/watermark/useSingletonCache.js
/**
* Singleton cache will only take latest `cacheParams` as key
* and return the result for callback matching.
*/
function useSingletonCache() {
const cacheRef = import_react.useRef([null, null]);
const getCache = (cacheKeys, callback) => {
const filteredKeys = cacheKeys.map((item) => item instanceof HTMLElement || Number.isNaN(item) ? "" : item);
if (!isEqual(cacheRef.current[0], filteredKeys)) cacheRef.current = [filteredKeys, callback()];
return cacheRef.current[1];
};
return getCache;
}
//#endregion
//#region node_modules/antd/es/watermark/utils.js
/** converting camel-cased strings to be lowercase and link it with Separator */
function toLowercaseSeparator(key) {
return key.replace(/([A-Z])/g, "-$1").toLowerCase();
}
function getStyleStr(style) {
return Object.keys(style).map((key) => `${toLowercaseSeparator(key)}: ${style[key]};`).join(" ");
}
/** Returns the ratio of the device's physical pixel resolution to the css pixel resolution */
function getPixelRatio() {
return window.devicePixelRatio || 1;
}
/** Whether to re-render the watermark */
var reRendering = (mutation, isWatermarkEle) => {
let flag = false;
if (mutation.removedNodes.length) flag = Array.from(mutation.removedNodes).some(isWatermarkEle);
if (mutation.type === "attributes" && isWatermarkEle(mutation.target)) flag = true;
return flag;
};
//#endregion
//#region node_modules/antd/es/watermark/useWatermark.js
var emphasizedStyle = { visibility: "visible !important" };
var noop = () => {};
function useWatermark(markStyle, onRemove) {
const watermarkMapRef = import_react.useRef(/* @__PURE__ */ new Map());
const onRemoveEvent = useEvent(onRemove ?? noop);
const appendWatermark = (base64Url, markWidth, container) => {
if (container) {
const exist = watermarkMapRef.current.get(container);
if (!exist) {
const newWatermarkEle = document.createElement("div");
watermarkMapRef.current.set(container, newWatermarkEle);
}
const watermarkEle = watermarkMapRef.current.get(container);
watermarkEle.setAttribute("style", getStyleStr({
...markStyle,
backgroundImage: `url('${base64Url}')`,
backgroundSize: `${Math.floor(markWidth)}px`,
...emphasizedStyle
}));
watermarkEle.removeAttribute("class");
watermarkEle.removeAttribute("hidden");
if (watermarkEle.parentElement !== container) {
if (exist && onRemove) onRemoveEvent();
container.append(watermarkEle);
}
}
return watermarkMapRef.current.get(container);
};
const removeWatermark = (container) => {
const watermarkEle = watermarkMapRef.current.get(container);
if (watermarkEle && container) container.removeChild(watermarkEle);
watermarkMapRef.current.delete(container);
};
const isWatermarkEle = (ele) => Array.from(watermarkMapRef.current.values()).includes(ele);
return [
appendWatermark,
removeWatermark,
isWatermarkEle
];
}
//#endregion
//#region node_modules/antd/es/watermark/index.js
/**
* Only return `next` when size changed.
* This is only used for elements compare, not a shallow equal!
*/
function getSizeDiff(prev, next) {
return prev.size === next.size ? prev : next;
}
var DEFAULT_GAP_X = 100;
var DEFAULT_GAP_Y = 100;
var fixedStyle = {
position: "relative",
overflow: "hidden"
};
var Watermark = (props) => {
const { zIndex = 9, rotate = -22, width, height, image, content, font = {}, style, className, rootClassName, gap = [DEFAULT_GAP_X, DEFAULT_GAP_Y], offset, children, inherit = true, onRemove } = props;
const { className: contextClassName, style: contextStyle } = useComponentConfig("watermark");
const mergedStyle = {
...fixedStyle,
...contextStyle,
...style
};
const [, token] = useToken$1();
const { color = token.colorFill, fontSize = token.fontSizeLG, fontWeight = "normal", fontStyle = "normal", fontFamily = "sans-serif", textAlign = "center" } = font;
const [gapX = DEFAULT_GAP_X, gapY = DEFAULT_GAP_Y] = gap;
const gapXCenter = gapX / 2;
const gapYCenter = gapY / 2;
const offsetLeft = offset?.[0] ?? gapXCenter;
const offsetTop = offset?.[1] ?? gapYCenter;
const markStyle = import_react.useMemo(() => {
const mergedMarkStyle = {
zIndex,
position: "absolute",
left: 0,
top: 0,
width: "100%",
height: "100%",
pointerEvents: "none",
backgroundRepeat: "repeat"
};
/** Calculate the style of the offset */
let positionLeft = offsetLeft - gapXCenter;
let positionTop = offsetTop - gapYCenter;
if (positionLeft > 0) {
mergedMarkStyle.left = `${positionLeft}px`;
mergedMarkStyle.width = `calc(100% - ${positionLeft}px)`;
positionLeft = 0;
}
if (positionTop > 0) {
mergedMarkStyle.top = `${positionTop}px`;
mergedMarkStyle.height = `calc(100% - ${positionTop}px)`;
positionTop = 0;
}
mergedMarkStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
return mergedMarkStyle;
}, [
zIndex,
offsetLeft,
gapXCenter,
offsetTop,
gapYCenter
]);
const [container, setContainer] = import_react.useState();
const [subElements, setSubElements] = import_react.useState(() => /* @__PURE__ */ new Set());
const targetElements = import_react.useMemo(() => {
const list = container ? [container] : [];
return [].concat(list, _toConsumableArray$8(Array.from(subElements)));
}, [container, subElements]);
/**
* Get the width and height of the watermark. The default values are as follows
* Image: [120, 64]; Content: It's calculated by content;
*/
const getMarkSize = (ctx) => {
let defaultWidth = 120;
let defaultHeight = 64;
if (!image && ctx.measureText) {
ctx.font = `${Number(fontSize)}px ${fontFamily}`;
const contents = toList(content);
const sizes = contents.map((item) => {
const metrics = ctx.measureText(item);
return [metrics.width, metrics.fontBoundingBoxAscent + metrics.fontBoundingBoxDescent];
});
defaultWidth = Math.ceil(Math.max.apply(Math, _toConsumableArray$8(sizes.map((size) => size[0]))));
defaultHeight = Math.ceil(Math.max.apply(Math, _toConsumableArray$8(sizes.map((size) => size[1])))) * contents.length + (contents.length - 1) * 3;
}
return [width ?? defaultWidth, height ?? defaultHeight];
};
const getClips = useClips();
const getClipsCache = useSingletonCache();
const [watermarkInfo, setWatermarkInfo] = import_react.useState(null);
const renderWatermark = () => {
const ctx = document.createElement("canvas").getContext("2d");
if (ctx) {
const ratio = getPixelRatio();
const [markWidth, markHeight] = getMarkSize(ctx);
const drawCanvas = (drawContent) => {
const params = [
drawContent || "",
rotate,
ratio,
markWidth,
markHeight,
{
color,
fontSize,
fontStyle,
fontWeight,
fontFamily,
textAlign
},
gapX,
gapY
];
const [nextClips, clipWidth] = getClipsCache(params, () => getClips.apply(void 0, params));
setWatermarkInfo([nextClips, clipWidth]);
};
if (image) {
const img = new Image();
img.onload = () => {
drawCanvas(img);
};
img.onerror = () => {
drawCanvas(content);
};
img.crossOrigin = "anonymous";
img.referrerPolicy = "no-referrer";
img.src = image;
} else drawCanvas(content);
}
};
const syncWatermark = useRafDebounce(renderWatermark);
const [appendWatermark, removeWatermark, isWatermarkEle] = useWatermark(markStyle, onRemove);
(0, import_react.useEffect)(() => {
if (watermarkInfo) targetElements.forEach((holder) => {
appendWatermark(watermarkInfo[0], watermarkInfo[1], holder);
});
}, [watermarkInfo, targetElements]);
useMutateObserver(targetElements, useEvent((mutations) => {
mutations.forEach((mutation) => {
if (reRendering(mutation, isWatermarkEle)) syncWatermark();
else if (mutation.target === container && mutation.attributeName === "style") {
const keyStyles = Object.keys(fixedStyle);
for (let i = 0; i < keyStyles.length; i += 1) {
const key = keyStyles[i];
const oriValue = mergedStyle[key];
const currentValue = container.style[key];
if (oriValue && oriValue !== currentValue) container.style[key] = oriValue;
}
}
});
}));
(0, import_react.useEffect)(syncWatermark, [
rotate,
zIndex,
width,
height,
image,
content,
color,
fontSize,
fontWeight,
fontStyle,
fontFamily,
textAlign,
gapX,
gapY,
offsetLeft,
offsetTop
]);
const watermarkContext = import_react.useMemo(() => ({
add: (ele) => {
setSubElements((prev) => {
const clone = new Set(prev);
clone.add(ele);
return getSizeDiff(prev, clone);
});
},
remove: (ele) => {
removeWatermark(ele);
setSubElements((prev) => {
const clone = new Set(prev);
clone.delete(ele);
return getSizeDiff(prev, clone);
});
}
}), []);
const childNode = inherit ? /* @__PURE__ */ import_react.createElement(WatermarkContext.Provider, { value: watermarkContext }, children) : children;
return /* @__PURE__ */ import_react.createElement("div", {
ref: setContainer,
className: clsx(className, contextClassName, rootClassName),
style: mergedStyle
}, childNode);
};
Watermark.displayName = "Watermark";
//#endregion
//#region node_modules/antd/es/index.js
var unstableSetRender = () => {
warning$1(false, "compatible", "antd v6 support React 19 already, it's no need to call the compatible function or just remove `@ant-design/v5-patch-for-react-19`");
};
warning$1(getReactMajorVersion() >= 18, "version", `antd v6 no longer supports React versions below 18. Please upgrade to React 18 or higher.`);
//#endregion
export { Affix, Alert, Anchor, App, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, button_default as Button, Calendar, Card, Carousel, Cascader, Checkbox, col_default as Col, collapse_default as Collapse, color_picker_default as ColorPicker, ConfigProvider, DatePicker, Descriptions, Divider, drawer_default as Drawer, Dropdown, Empty, Flex, float_button_default as FloatButton, Form, grid_default as Grid, Image$1 as Image, Input, TypedInputNumber as InputNumber, Layout, List, masonry_default as Masonry, Mentions, Menu, Modal, pagination_default as Pagination, Popconfirm, Popover, progress_default as Progress, QRCode, Radio, Rate, Result, row_default as Row, Segmented, Select, skeleton_default as Skeleton, Slider, Space, Spin, Splitter, statistic_default as Statistic, Steps, Switch, table_default as Table, Tabs, Tag, TimePicker, timeline_default as Timeline, Tooltip, Tour, Transfer, Tree, TreeSelect, Typography, Upload, Watermark, staticMethods as message, staticMethods$1 as notification, theme_default as theme, unstableSetRender, version_default as version };
//# sourceMappingURL=antd.js.map