"use strict"; (self["webpackChunk_core_volunteer_app"] = self["webpackChunk_core_volunteer_app"] || []).push([["vendors-node_modules_antd_lib__util_ActionButton_js-node_modules_antd_lib__util_ContextIsolat-b90fcb"],{ /***/ "../../../node_modules/antd/lib/_util/ActionButton.js": /*!************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/ActionButton.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use client"; var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _useState = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/hooks/useState */ "../../../node_modules/rc-util/lib/hooks/useState.js")); var _button = _interopRequireDefault(__webpack_require__(/*! ../button */ "../../../node_modules/antd/lib/button/index.js")); var _buttonHelpers = __webpack_require__(/*! ../button/buttonHelpers */ "../../../node_modules/antd/lib/button/buttonHelpers.js"); const isThenable = thing => { return typeof (thing === null || thing === void 0 ? void 0 : thing.then) === 'function'; }; const ActionButton = props => { const { type, children, prefixCls, buttonProps, close, autoFocus, emitEvent, isSilent, quitOnNullishReturnValue, actionFn } = props; const clickedRef = React.useRef(false); const buttonRef = React.useRef(null); const [loading, setLoading] = (0, _useState.default)(false); const onInternalClose = (...args) => { close === null || close === void 0 ? void 0 : close.apply(void 0, args); }; React.useEffect(() => { let timeoutId = null; if (autoFocus) { timeoutId = setTimeout(() => { var _a; (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.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 => { // See: https://github.com/ant-design/ant-design/issues/6183 setLoading(false, true); clickedRef.current = false; // Do not throw if is `await` mode if (isSilent === null || isSilent === void 0 ? void 0 : 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); // https://github.com/ant-design/ant-design/issues/23358 clickedRef.current = false; } else { returnValueOfOnOk = actionFn(); if (!isThenable(returnValueOfOnOk)) { onInternalClose(); return; } } handlePromiseOnOk(returnValueOfOnOk); }; return /*#__PURE__*/React.createElement(_button.default, Object.assign({}, (0, _buttonHelpers.convertLegacyProps)(type), { onClick: onClick, loading: loading, prefixCls: prefixCls }, buttonProps, { ref: buttonRef }), children); }; var _default = exports["default"] = ActionButton; /***/ }), /***/ "../../../node_modules/antd/lib/_util/ContextIsolator.js": /*!***************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/ContextIsolator.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use client"; var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _context = __webpack_require__(/*! ../form/context */ "../../../node_modules/antd/lib/form/context.js"); var _Compact = __webpack_require__(/*! ../space/Compact */ "../../../node_modules/antd/lib/space/Compact.js"); const ContextIsolator = props => { const { space, form, children } = props; if (children === undefined || children === null) { return null; } let result = children; if (form) { result = /*#__PURE__*/_react.default.createElement(_context.NoFormStyle, { override: true, status: true }, result); } if (space) { result = /*#__PURE__*/_react.default.createElement(_Compact.NoCompactStyle, null, result); } return result; }; var _default = exports["default"] = ContextIsolator; /***/ }), /***/ "../../../node_modules/antd/lib/_util/PurePanel.js": /*!*********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/PurePanel.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use client"; var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; exports.withPureRenderTheme = withPureRenderTheme; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _useMergedState = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/hooks/useMergedState */ "../../../node_modules/rc-util/lib/hooks/useMergedState.js")); var _configProvider = _interopRequireWildcard(__webpack_require__(/*! ../config-provider */ "../../../node_modules/antd/lib/config-provider/index.js")); function withPureRenderTheme(Component) { return props => (/*#__PURE__*/React.createElement(_configProvider.default, { theme: { token: { motion: false, zIndexPopupBase: 0 } } }, /*#__PURE__*/React.createElement(Component, Object.assign({}, props)))); } /* istanbul ignore next */ const genPurePanel = (Component, alignPropName, postProps, defaultPrefixCls, getDropdownCls) => { const PurePanel = props => { const { prefixCls: customizePrefixCls, style } = props; const holderRef = React.useRef(null); const [popupHeight, setPopupHeight] = React.useState(0); const [popupWidth, setPopupWidth] = React.useState(0); const [open, setOpen] = (0, _useMergedState.default)(false, { value: props.open }); const { getPrefixCls } = React.useContext(_configProvider.ConfigContext); const prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls); React.useEffect(() => { // We do not care about ssr 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(() => { var _a; const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`; const popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls); if (popup) { clearInterval(interval); resizeObserver.observe(popup); } }, 10); return () => { clearInterval(interval); resizeObserver.disconnect(); }; } }, [prefixCls]); let mergedProps = Object.assign(Object.assign({}, props), { style: Object.assign(Object.assign({}, style), { margin: 0 }), open, visible: open, getPopupContainer: () => holderRef.current }); if (postProps) { mergedProps = postProps(mergedProps); } if (alignPropName) { Object.assign(mergedProps, { [alignPropName]: { overflow: { adjustX: false, adjustY: false } } }); } const mergedStyle = { paddingBottom: popupHeight, position: 'relative', minWidth: popupWidth }; return /*#__PURE__*/React.createElement("div", { ref: holderRef, style: mergedStyle }, /*#__PURE__*/React.createElement(Component, Object.assign({}, mergedProps))); }; return withPureRenderTheme(PurePanel); }; var _default = exports["default"] = genPurePanel; /***/ }), /***/ "../../../node_modules/antd/lib/_util/capitalize.js": /*!**********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/capitalize.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = capitalize; function capitalize(str) { if (typeof str !== 'string') { return str; } const ret = str.charAt(0).toUpperCase() + str.slice(1); return ret; } /***/ }), /***/ "../../../node_modules/antd/lib/_util/colors.js": /*!******************************************************!*\ !*** ../../../node_modules/antd/lib/_util/colors.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PresetStatusColorTypes = void 0; exports.isPresetColor = isPresetColor; exports.isPresetStatusColor = isPresetStatusColor; var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../../../node_modules/@babel/runtime/helpers/toConsumableArray.js")); var _interface = __webpack_require__(/*! ../theme/interface */ "../../../node_modules/antd/lib/theme/interface/index.js"); const inverseColors = _interface.PresetColors.map(color => `${color}-inverse`); const PresetStatusColorTypes = exports.PresetStatusColorTypes = ['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((0, _toConsumableArray2.default)(inverseColors), (0, _toConsumableArray2.default)(_interface.PresetColors)).includes(color); } return _interface.PresetColors.includes(color); } function isPresetStatusColor(color) { return PresetStatusColorTypes.includes(color); } /***/ }), /***/ "../../../node_modules/antd/lib/_util/convertToTooltipProps.js": /*!*********************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/convertToTooltipProps.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = __webpack_require__(/*! react */ "../../../node_modules/react/index.js"); function convertToTooltipProps(tooltip) { // isNil if (tooltip === undefined || tooltip === null) { return null; } if (typeof tooltip === 'object' && ! /*#__PURE__*/(0, _react.isValidElement)(tooltip)) { return tooltip; } return { title: tooltip }; } var _default = exports["default"] = convertToTooltipProps; /***/ }), /***/ "../../../node_modules/antd/lib/_util/easings.js": /*!*******************************************************!*\ !*** ../../../node_modules/antd/lib/_util/easings.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.easeInOutCubic = easeInOutCubic; function easeInOutCubic(t, b, c, d) { const cc = c - b; t /= d / 2; if (t < 1) { return cc / 2 * t * t * t + b; } // biome-ignore lint: it is a common easing function return cc / 2 * ((t -= 2) * t * t + 2) + b; } /***/ }), /***/ "../../../node_modules/antd/lib/_util/extendsObject.js": /*!*************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/extendsObject.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; function mergeProps(...items) { const ret = {}; items.forEach(item => { if (item) { Object.keys(item).forEach(key => { if (item[key] !== undefined) { ret[key] = item[key]; } }); } }); return ret; } var _default = exports["default"] = mergeProps; /***/ }), /***/ "../../../node_modules/antd/lib/_util/gapSize.js": /*!*******************************************************!*\ !*** ../../../node_modules/antd/lib/_util/gapSize.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isPresetSize = isPresetSize; exports.isValidGapNumber = isValidGapNumber; function isPresetSize(size) { return ['small', 'middle', 'large'].includes(size); } function isValidGapNumber(size) { if (!size) { // The case of size = 0 is deliberately excluded here, because the default value of the gap attribute in CSS is 0, so if the user passes 0 in, we can directly ignore it. return false; } return typeof size === 'number' && !Number.isNaN(size); } /***/ }), /***/ "../../../node_modules/antd/lib/_util/getAllowClear.js": /*!*************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/getAllowClear.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use client"; var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _CloseCircleFilled = _interopRequireDefault(__webpack_require__(/*! @ant-design/icons/CloseCircleFilled */ "../../../node_modules/@ant-design/icons/CloseCircleFilled.js")); const getAllowClear = allowClear => { let mergedAllowClear; if (typeof allowClear === 'object' && (allowClear === null || allowClear === void 0 ? void 0 : allowClear.clearIcon)) { mergedAllowClear = allowClear; } else if (allowClear) { mergedAllowClear = { clearIcon: /*#__PURE__*/_react.default.createElement(_CloseCircleFilled.default, null) }; } return mergedAllowClear; }; var _default = exports["default"] = getAllowClear; /***/ }), /***/ "../../../node_modules/antd/lib/_util/getRenderPropValue.js": /*!******************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/getRenderPropValue.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRenderPropValue = void 0; const getRenderPropValue = propValue => { if (!propValue) { return null; } return typeof propValue === 'function' ? propValue() : propValue; }; exports.getRenderPropValue = getRenderPropValue; /***/ }), /***/ "../../../node_modules/antd/lib/_util/getScroll.js": /*!*********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/getScroll.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; exports.isWindow = isWindow; function isWindow(obj) { return obj !== null && obj !== undefined && obj === obj.window; } const getScroll = target => { var _a, _b; 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) { // According to the type inference, the `target` is `never` type. // Since we configured the loose mode type checking, and supports mocking the target with such shape below:: // `{ documentElement: { scrollLeft: 200, scrollTop: 400 } }`, // the program may falls into this branch. // Check the corresponding tests for details. Don't sure what is the real scenario this happens. /* biome-ignore lint/complexity/useLiteralKeys: target is a never type */ /* eslint-disable-next-line dot-notation */ result = target['scrollTop']; } if (target && !isWindow(target) && typeof result !== 'number') { result = (_b = ((_a = target.ownerDocument) !== null && _a !== void 0 ? _a : target).documentElement) === null || _b === void 0 ? void 0 : _b.scrollTop; } return result; }; var _default = exports["default"] = getScroll; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/index.js": /*!***********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/index.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); var _useClosable = __webpack_require__(/*! ./useClosable */ "../../../node_modules/antd/lib/_util/hooks/useClosable.js"); Object.keys(_useClosable).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _useClosable[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _useClosable[key]; } }); }); var _useForceUpdate = __webpack_require__(/*! ./useForceUpdate */ "../../../node_modules/antd/lib/_util/hooks/useForceUpdate.js"); Object.keys(_useForceUpdate).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _useForceUpdate[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _useForceUpdate[key]; } }); }); var _useMergeSemantic = __webpack_require__(/*! ./useMergeSemantic */ "../../../node_modules/antd/lib/_util/hooks/useMergeSemantic.js"); Object.keys(_useMergeSemantic).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _useMergeSemantic[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _useMergeSemantic[key]; } }); }); var _useMultipleSelect = __webpack_require__(/*! ./useMultipleSelect */ "../../../node_modules/antd/lib/_util/hooks/useMultipleSelect.js"); Object.keys(_useMultipleSelect).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _useMultipleSelect[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _useMultipleSelect[key]; } }); }); var _usePatchElement = __webpack_require__(/*! ./usePatchElement */ "../../../node_modules/antd/lib/_util/hooks/usePatchElement.js"); Object.keys(_usePatchElement).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _usePatchElement[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _usePatchElement[key]; } }); }); var _useProxyImperativeHandle = __webpack_require__(/*! ./useProxyImperativeHandle */ "../../../node_modules/antd/lib/_util/hooks/useProxyImperativeHandle.js"); Object.keys(_useProxyImperativeHandle).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _useProxyImperativeHandle[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _useProxyImperativeHandle[key]; } }); }); var _useSyncState = __webpack_require__(/*! ./useSyncState */ "../../../node_modules/antd/lib/_util/hooks/useSyncState.js"); Object.keys(_useSyncState).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _useSyncState[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _useSyncState[key]; } }); }); var _useZIndex = __webpack_require__(/*! ./useZIndex */ "../../../node_modules/antd/lib/_util/hooks/useZIndex.js"); Object.keys(_useZIndex).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _useZIndex[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _useZIndex[key]; } }); }); /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/useClosable.js": /*!*****************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/useClosable.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use client"; var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.pickClosable = pickClosable; exports.useClosable = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _CloseOutlined = _interopRequireDefault(__webpack_require__(/*! @ant-design/icons/CloseOutlined */ "../../../node_modules/@ant-design/icons/CloseOutlined.js")); var _pickAttrs = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/pickAttrs */ "../../../node_modules/rc-util/lib/pickAttrs.js")); var _locale = __webpack_require__(/*! ../../locale */ "../../../node_modules/antd/lib/locale/index.js"); var _en_US = _interopRequireDefault(__webpack_require__(/*! ../../locale/en_US */ "../../../node_modules/antd/lib/locale/en_US.js")); var _extendsObject = _interopRequireDefault(__webpack_require__(/*! ../extendsObject */ "../../../node_modules/antd/lib/_util/extendsObject.js")); function pickClosable(context) { if (!context) { return undefined; } const { closable, closeIcon } = context; return { closable, closeIcon }; } /** Convert `closable` and `closeIcon` to config object */ function useClosableConfig(closableCollection) { const { closable, closeIcon } = closableCollection || {}; return _react.default.useMemo(() => { if ( // If `closable`, whatever rest be should be true !closable && (closable === false || closeIcon === false || closeIcon === null)) { return false; } if (closable === undefined && closeIcon === undefined) { return null; } let closableConfig = { closeIcon: typeof closeIcon !== 'boolean' && closeIcon !== null ? closeIcon : undefined }; if (closable && typeof closable === 'object') { closableConfig = Object.assign(Object.assign({}, closableConfig), closable); } return closableConfig; }, [closable, closeIcon]); } /** Use same object to support `useMemo` optimization */ const EmptyFallbackCloseCollection = {}; const useClosable = (propCloseCollection, contextCloseCollection, fallbackCloseCollection = EmptyFallbackCloseCollection) => { // Align the `props`, `context` `fallback` to config object first const propCloseConfig = useClosableConfig(propCloseCollection); const contextCloseConfig = useClosableConfig(contextCloseCollection); const [contextLocale] = (0, _locale.useLocale)('global', _en_US.default.global); const closeBtnIsDisabled = typeof propCloseConfig !== 'boolean' ? !!(propCloseConfig === null || propCloseConfig === void 0 ? void 0 : propCloseConfig.disabled) : false; const mergedFallbackCloseCollection = _react.default.useMemo(() => Object.assign({ closeIcon: /*#__PURE__*/_react.default.createElement(_CloseOutlined.default, null) }, fallbackCloseCollection), [fallbackCloseCollection]); // Use fallback logic to fill the config const mergedClosableConfig = _react.default.useMemo(() => { // ================ Props First ================ // Skip if prop is disabled if (propCloseConfig === false) { return false; } if (propCloseConfig) { return (0, _extendsObject.default)(mergedFallbackCloseCollection, contextCloseConfig, propCloseConfig); } // =============== Context Second ============== // Skip if context is disabled if (contextCloseConfig === false) { return false; } if (contextCloseConfig) { return (0, _extendsObject.default)(mergedFallbackCloseCollection, contextCloseConfig); } // ============= Fallback Default ============== return !mergedFallbackCloseCollection.closable ? false : mergedFallbackCloseCollection; }, [propCloseConfig, contextCloseConfig, mergedFallbackCloseCollection]); // Calculate the final closeIcon return _react.default.useMemo(() => { var _a, _b; if (mergedClosableConfig === false) { return [false, null, closeBtnIsDisabled, {}]; } const { closeIconRender } = mergedFallbackCloseCollection; const { closeIcon } = mergedClosableConfig; let mergedCloseIcon = closeIcon; // Wrap the closeIcon with aria props const ariaOrDataProps = (0, _pickAttrs.default)(mergedClosableConfig, true); if (mergedCloseIcon !== null && mergedCloseIcon !== undefined) { // Wrap the closeIcon if needed if (closeIconRender) { mergedCloseIcon = closeIconRender(closeIcon); } mergedCloseIcon = /*#__PURE__*/_react.default.isValidElement(mergedCloseIcon) ? (/*#__PURE__*/_react.default.cloneElement(mergedCloseIcon, Object.assign(Object.assign(Object.assign({}, mergedCloseIcon.props), { 'aria-label': (_b = (_a = mergedCloseIcon.props) === null || _a === void 0 ? void 0 : _a['aria-label']) !== null && _b !== void 0 ? _b : contextLocale.close }), ariaOrDataProps))) : (/*#__PURE__*/_react.default.createElement("span", Object.assign({ "aria-label": contextLocale.close }, ariaOrDataProps), mergedCloseIcon)); } return [true, mergedCloseIcon, closeBtnIsDisabled, ariaOrDataProps]; }, [closeBtnIsDisabled, contextLocale.close, mergedClosableConfig, mergedFallbackCloseCollection]); }; exports.useClosable = useClosable; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/useForceUpdate.js": /*!********************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/useForceUpdate.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.useForceUpdate = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); const useForceUpdate = () => { return _react.default.useReducer(ori => ori + 1, 0); }; exports.useForceUpdate = useForceUpdate; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/useMergeSemantic.js": /*!**********************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/useMergeSemantic.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.mergeClassNames = mergeClassNames; exports.useMergeSemantic = void 0; var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../../../node_modules/@babel/runtime/helpers/toConsumableArray.js")); var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../../../node_modules/classnames/index.js")); // ========================= ClassNames ========================= function mergeClassNames(schema, ...classNames) { const mergedSchema = schema || {}; return classNames.reduce((acc, cur) => { // Loop keys of the current classNames Object.keys(cur || {}).forEach(key => { const keySchema = mergedSchema[key]; const curVal = cur[key]; if (keySchema && typeof keySchema === 'object') { if (curVal && typeof curVal === 'object') { // Loop fill acc[key] = mergeClassNames(keySchema, acc[key], curVal); } else { // Covert string to object structure const { _default: defaultField } = keySchema; if (defaultField) { acc[key] = acc[key] || {}; acc[key][defaultField] = (0, _classnames.default)(acc[key][defaultField], curVal); } } } else { // Flatten fill acc[key] = (0, _classnames.default)(acc[key], curVal); } }); return acc; }, {}); } function useSemanticClassNames(schema, ...classNames) { return React.useMemo(() => mergeClassNames.apply(void 0, [schema].concat(classNames)), [classNames, schema]); } // =========================== Styles =========================== function useSemanticStyles(...styles) { return React.useMemo(() => { return styles.reduce((acc, cur = {}) => { Object.keys(cur).forEach(key => { acc[key] = Object.assign(Object.assign({}, acc[key]), cur[key]); }); return acc; }, {}); }, [styles]); } // =========================== Export =========================== function fillObjectBySchema(obj, schema) { const newObj = Object.assign({}, 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; } /** * Merge classNames and styles from multiple sources. * When `schema` is provided, it will **must** provide the nest object structure. */ const useMergeSemantic = (classNamesList, stylesList, schema) => { const mergedClassNames = useSemanticClassNames.apply(void 0, [schema].concat((0, _toConsumableArray2.default)(classNamesList))); const mergedStyles = useSemanticStyles.apply(void 0, (0, _toConsumableArray2.default)(stylesList)); return React.useMemo(() => { return [fillObjectBySchema(mergedClassNames, schema), fillObjectBySchema(mergedStyles, schema)]; }, [mergedClassNames, mergedStyles, schema]); }; exports.useMergeSemantic = useMergeSemantic; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/useMultipleSelect.js": /*!***********************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/useMultipleSelect.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.useMultipleSelect = void 0; var _react = __webpack_require__(/*! react */ "../../../node_modules/react/index.js"); /** * @title multipleSelect hooks * @description multipleSelect by hold down shift key */ const useMultipleSelect = getKey => { const [prevSelectedIndex, setPrevSelectedIndex] = (0, _react.useState)(null); const multipleSelect = (0, _react.useCallback)((currentSelectedIndex, data, selectedKeys) => { const configPrevSelectedIndex = prevSelectedIndex !== null && prevSelectedIndex !== void 0 ? prevSelectedIndex : currentSelectedIndex; // add/delete the selected range 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]); return [multipleSelect, setPrevSelectedIndex]; }; exports.useMultipleSelect = useMultipleSelect; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/usePatchElement.js": /*!*********************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/usePatchElement.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.usePatchElement = void 0; var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../../../node_modules/@babel/runtime/helpers/toConsumableArray.js")); var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); const usePatchElement = () => { const [elements, setElements] = React.useState([]); const patchElement = React.useCallback(element => { // append a new element to elements (and create a new ref) setElements(originElements => [].concat((0, _toConsumableArray2.default)(originElements), [element])); // return a function that removes the new element out of elements (and create a new ref) // it works a little like useEffect return () => { setElements(originElements => originElements.filter(ele => ele !== element)); }; }, []); return [elements, patchElement]; }; exports.usePatchElement = usePatchElement; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/useProxyImperativeHandle.js": /*!******************************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/useProxyImperativeHandle.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.useProxyImperativeHandle = void 0; var _react = __webpack_require__(/*! react */ "../../../node_modules/react/index.js"); // Proxy the dom ref with `{ nativeElement, otherFn }` type // ref: https://github.com/ant-design/ant-design/discussions/45242 function 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; } const useProxyImperativeHandle = (ref, init) => { return (0, _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); } }); } // Fallback of IE return fillProxy(nativeElement, refObj); }); }; exports.useProxyImperativeHandle = useProxyImperativeHandle; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/useSyncState.js": /*!******************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/useSyncState.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.useSyncState = void 0; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _useForceUpdate = __webpack_require__(/*! ./useForceUpdate */ "../../../node_modules/antd/lib/_util/hooks/useForceUpdate.js"); const useSyncState = initialValue => { const ref = React.useRef(initialValue); const [, forceUpdate] = (0, _useForceUpdate.useForceUpdate)(); return [() => ref.current, newValue => { ref.current = newValue; // re-render forceUpdate(); }]; }; exports.useSyncState = useSyncState; /***/ }), /***/ "../../../node_modules/antd/lib/_util/hooks/useZIndex.js": /*!***************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/hooks/useZIndex.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.useZIndex = exports.containerBaseZIndexOffset = exports.consumerBaseZIndexOffset = exports.CONTAINER_MAX_OFFSET = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _useToken = _interopRequireDefault(__webpack_require__(/*! ../../theme/useToken */ "../../../node_modules/antd/lib/theme/useToken.js")); var _warning = __webpack_require__(/*! ../warning */ "../../../node_modules/antd/lib/_util/warning.js"); var _zindexContext = _interopRequireDefault(__webpack_require__(/*! ../zindexContext */ "../../../node_modules/antd/lib/_util/zindexContext.js")); // Z-Index control range // Container: 1000 + offset 100 (max base + 10 * offset = 2000) // Popover: offset 50 // Notification: Container Max zIndex + componentOffset const CONTAINER_OFFSET = 100; const CONTAINER_OFFSET_MAX_COUNT = 10; const CONTAINER_MAX_OFFSET = exports.CONTAINER_MAX_OFFSET = CONTAINER_OFFSET * CONTAINER_OFFSET_MAX_COUNT; /** * 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`. */ const CONTAINER_MAX_OFFSET_WITH_CHILDREN = CONTAINER_MAX_OFFSET + CONTAINER_OFFSET; const containerBaseZIndexOffset = exports.containerBaseZIndexOffset = { Modal: CONTAINER_OFFSET, Drawer: CONTAINER_OFFSET, Popover: CONTAINER_OFFSET, Popconfirm: CONTAINER_OFFSET, Tooltip: CONTAINER_OFFSET, Tour: CONTAINER_OFFSET, FloatButton: CONTAINER_OFFSET }; const consumerBaseZIndexOffset = exports.consumerBaseZIndexOffset = { SelectLike: 50, Dropdown: 50, DatePicker: 50, Menu: 50, ImagePreview: 1 }; function isContainerType(type) { return type in containerBaseZIndexOffset; } const useZIndex = (componentType, customZIndex) => { const [, token] = (0, _useToken.default)(); const parentZIndex = _react.default.useContext(_zindexContext.default); const isContainer = isContainerType(componentType); let result; if (customZIndex !== undefined) { result = [customZIndex, customZIndex]; } else { let zIndex = parentZIndex !== null && parentZIndex !== void 0 ? parentZIndex : 0; if (isContainer) { zIndex += // Use preset token zIndex by default but not stack when has parent container (parentZIndex ? 0 : token.zIndexPopupBase) + // Container offset containerBaseZIndexOffset[componentType]; } else { zIndex += consumerBaseZIndexOffset[componentType]; } result = [parentZIndex === undefined ? customZIndex : zIndex, zIndex]; } if (true) { const warning = (0, _warning.devUseWarning)(componentType); const maxZIndex = token.zIndexPopupBase + CONTAINER_MAX_OFFSET_WITH_CHILDREN; const currentZIndex = result[0] || 0; true ? warning(customZIndex !== undefined || currentZIndex <= maxZIndex, 'usage', '`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.') : 0; } return result; }; exports.useZIndex = useZIndex; /***/ }), /***/ "../../../node_modules/antd/lib/_util/isPrimitive.js": /*!***********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/isPrimitive.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; const isPrimitive = value => typeof value !== 'object' && typeof value !== 'function' || value === null; var _default = exports["default"] = isPrimitive; /***/ }), /***/ "../../../node_modules/antd/lib/_util/mediaQueryUtil.js": /*!**************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/mediaQueryUtil.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.removeMediaQueryListener = exports.addMediaQueryListener = void 0; const addMediaQueryListener = (mql, handler) => { // Don't delete here, please keep the code compatible if (typeof (mql === null || mql === void 0 ? void 0 : mql.addEventListener) !== 'undefined') { mql.addEventListener('change', handler); } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.addListener) !== 'undefined') { mql.addListener(handler); } }; exports.addMediaQueryListener = addMediaQueryListener; const removeMediaQueryListener = (mql, handler) => { // Don't delete here, please keep the code compatible if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeEventListener) !== 'undefined') { mql.removeEventListener('change', handler); } else if (typeof (mql === null || mql === void 0 ? void 0 : mql.removeListener) !== 'undefined') { mql.removeListener(handler); } }; exports.removeMediaQueryListener = removeMediaQueryListener; /***/ }), /***/ "../../../node_modules/antd/lib/_util/motion.js": /*!******************************************************!*\ !*** ../../../node_modules/antd/lib/_util/motion.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getTransitionName = exports["default"] = void 0; var _configProvider = __webpack_require__(/*! ../config-provider */ "../../../node_modules/antd/lib/config-provider/index.js"); // ================== Collapse Motion ================== const getCollapsedHeight = () => ({ height: 0, opacity: 0 }); const getRealHeight = node => { const { scrollHeight } = node; return { height: scrollHeight, opacity: 1 }; }; const getCurrentHeight = node => ({ height: node ? node.offsetHeight : 0 }); const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height'; const initCollapseMotion = (rootCls = _configProvider.defaultPrefixCls) => ({ motionName: `${rootCls}-motion-collapse`, onAppearStart: getCollapsedHeight, onEnterStart: getCollapsedHeight, onAppearActive: getRealHeight, onEnterActive: getRealHeight, onLeaveStart: getCurrentHeight, onLeaveActive: getCollapsedHeight, onAppearEnd: skipOpacityTransition, onEnterEnd: skipOpacityTransition, onLeaveEnd: skipOpacityTransition, motionDeadline: 500 }); const _SelectPlacements = ['bottomLeft', 'bottomRight', 'topLeft', 'topRight']; const getTransitionName = (rootPrefixCls, motion, transitionName) => { if (transitionName !== undefined) { return transitionName; } return `${rootPrefixCls}-${motion}`; }; exports.getTransitionName = getTransitionName; var _default = exports["default"] = initCollapseMotion; /***/ }), /***/ "../../../node_modules/antd/lib/_util/placements.js": /*!**********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/placements.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = getPlacements; exports.getOverflowOptions = getOverflowOptions; var _placementArrow = __webpack_require__(/*! ../style/placementArrow */ "../../../node_modules/antd/lib/style/placementArrow.js"); function getOverflowOptions(placement, arrowOffset, arrowWidth, autoAdjustOverflow) { if (autoAdjustOverflow === false) { return { adjustX: false, adjustY: false }; } const overflow = autoAdjustOverflow && typeof autoAdjustOverflow === 'object' ? 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 = Object.assign(Object.assign({}, baseOverflow), overflow); // Support auto shift if (!mergedOverflow.shiftX) { mergedOverflow.adjustX = true; } if (!mergedOverflow.shiftY) { mergedOverflow.adjustY = true; } return mergedOverflow; } const 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'] } }; const 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'] } }; const DisableAutoArrowList = new Set(['topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom']); function getPlacements(config) { const { arrowWidth, autoAdjustOverflow, arrowPointAtCenter, offset, borderRadius, visibleFirst } = config; const halfArrowWidth = arrowWidth / 2; const placementMap = {}; // Dynamic offset const arrowOffset = (0, _placementArrow.getArrowOffsetToken)({ contentRadius: borderRadius, limitVerticalRadius: true }); Object.keys(PlacementAlignMap).forEach(key => { const template = arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key]; const placementInfo = Object.assign(Object.assign({}, template), { offset: [0, 0], dynamicInset: true }); placementMap[key] = placementInfo; // Disable autoArrow since design is fixed position if (DisableAutoArrowList.has(key)) { placementInfo.autoArrow = false; } // Static offset 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; } } // Overflow placementInfo.overflow = getOverflowOptions(key, arrowOffset, arrowWidth, autoAdjustOverflow); // VisibleFirst if (visibleFirst) { placementInfo.htmlRegion = 'visibleFirst'; } }); return placementMap; } /***/ }), /***/ "../../../node_modules/antd/lib/_util/reactNode.js": /*!*********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/reactNode.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.cloneElement = cloneElement; exports.isFragment = isFragment; exports.replaceElement = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); function isFragment(child) { return child && /*#__PURE__*/_react.default.isValidElement(child) && child.type === _react.default.Fragment; } const replaceElement = (element, replacement, props) => { if (! /*#__PURE__*/_react.default.isValidElement(element)) { return replacement; } return /*#__PURE__*/_react.default.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props); }; exports.replaceElement = replaceElement; function cloneElement(element, props) { return replaceElement(element, element, props); } /***/ }), /***/ "../../../node_modules/antd/lib/_util/responsiveObserver.js": /*!******************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/responsiveObserver.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.responsiveArray = exports.matchScreen = exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _internal = __webpack_require__(/*! ../theme/internal */ "../../../node_modules/antd/lib/theme/internal.js"); var _mediaQueryUtil = __webpack_require__(/*! ./mediaQueryUtil */ "../../../node_modules/antd/lib/_util/mediaQueryUtil.js"); const responsiveArray = exports.responsiveArray = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs']; const 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)` }); /** * Ensures that the breakpoints token are valid, in good order * For each breakpoint : screenMin <= screen <= screenMax and screenMax <= nextScreenMin */ const 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 nextBreakpointUpperMin = revBreakpoints[i + 1].toUpperCase(); const nextScreenMin = `screen${nextBreakpointUpperMin}Min`; if (!(indexableToken[screenMax] <= indexableToken[nextScreenMin])) { throw new Error(`${screenMax}<=${nextScreenMin} fails : !(${indexableToken[screenMax]}<=${indexableToken[nextScreenMin]})`); } } }); return token; }; const matchScreen = (screens, screenSizes) => { if (!screenSizes) { return; } for (const breakpoint of responsiveArray) { if (screens[breakpoint] && (screenSizes === null || screenSizes === void 0 ? void 0 : screenSizes[breakpoint]) !== undefined) { return screenSizes[breakpoint]; } } }; exports.matchScreen = matchScreen; const useResponsiveObserver = () => { const [, token] = (0, _internal.useToken)(); const responsiveMap = getResponsiveMap(validateBreakpoints(token)); // To avoid repeat create instance, we add `useMemo` here. return _react.default.useMemo(() => { const subscribers = 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(Object.assign(Object.assign({}, screens), { [screen]: matches })); }; const mql = window.matchMedia(mediaQuery); (0, _mediaQueryUtil.addMediaQueryListener)(mql, listener); this.matchHandlers[mediaQuery] = { mql, listener }; listener(mql); }); }, unregister() { Object.values(responsiveMap).forEach(mediaQuery => { const handler = this.matchHandlers[mediaQuery]; (0, _mediaQueryUtil.removeMediaQueryListener)(handler === null || handler === void 0 ? void 0 : handler.mql, handler === null || handler === void 0 ? void 0 : handler.listener); }); subscribers.clear(); } }; }, [responsiveMap]); }; var _default = exports["default"] = useResponsiveObserver; /***/ }), /***/ "../../../node_modules/antd/lib/_util/scrollTo.js": /*!********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/scrollTo.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = scrollTo; var _raf = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/raf */ "../../../node_modules/rc-util/lib/raf.js")); var _easings = __webpack_require__(/*! ./easings */ "../../../node_modules/antd/lib/_util/easings.js"); var _getScroll = _interopRequireWildcard(__webpack_require__(/*! ./getScroll */ "../../../node_modules/antd/lib/_util/getScroll.js")); function scrollTo(y, options = {}) { const { getContainer = () => window, callback, duration = 450 } = options; const container = getContainer(); const scrollTop = (0, _getScroll.default)(container); const startTime = Date.now(); const frameFunc = () => { const timestamp = Date.now(); const time = timestamp - startTime; const nextScrollTop = (0, _easings.easeInOutCubic)(time > duration ? duration : time, scrollTop, y, duration); if ((0, _getScroll.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) { (0, _raf.default)(frameFunc); } else if (typeof callback === 'function') { callback(); } }; (0, _raf.default)(frameFunc); } /***/ }), /***/ "../../../node_modules/antd/lib/_util/statusUtils.js": /*!***********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/statusUtils.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getMergedStatus = void 0; exports.getStatusClassNames = getStatusClassNames; var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../../../node_modules/classnames/index.js")); const _InputStatuses = ['warning', 'error', '']; function getStatusClassNames(prefixCls, status, hasFeedback) { return (0, _classnames.default)({ [`${prefixCls}-status-success`]: status === 'success', [`${prefixCls}-status-warning`]: status === 'warning', [`${prefixCls}-status-error`]: status === 'error', [`${prefixCls}-status-validating`]: status === 'validating', [`${prefixCls}-has-feedback`]: hasFeedback }); } const getMergedStatus = (contextStatus, customStatus) => customStatus || contextStatus; exports.getMergedStatus = getMergedStatus; /***/ }), /***/ "../../../node_modules/antd/lib/_util/styleChecker.js": /*!************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/styleChecker.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.canUseDocElement = void 0; Object.defineProperty(exports, "isStyleSupport", ({ enumerable: true, get: function () { return _styleChecker.isStyleSupport; } })); var _canUseDom = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/Dom/canUseDom */ "../../../node_modules/rc-util/lib/Dom/canUseDom.js")); var _styleChecker = __webpack_require__(/*! rc-util/lib/Dom/styleChecker */ "../../../node_modules/rc-util/lib/Dom/styleChecker.js"); const canUseDocElement = () => (0, _canUseDom.default)() && window.document.documentElement; exports.canUseDocElement = canUseDocElement; /***/ }), /***/ "../../../node_modules/antd/lib/_util/toList.js": /*!******************************************************!*\ !*** ../../../node_modules/antd/lib/_util/toList.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; const toList = (candidate, skipEmpty = false) => { if (skipEmpty && (candidate === undefined || candidate === null)) { return []; } return Array.isArray(candidate) ? candidate : [candidate]; }; var _default = exports["default"] = toList; /***/ }), /***/ "../../../node_modules/antd/lib/_util/warning.js": /*!*******************************************************!*\ !*** ../../../node_modules/antd/lib/_util/warning.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.devUseWarning = exports["default"] = exports.WarningContext = void 0; exports.noop = noop; exports.resetWarned = resetWarned; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _warning2 = _interopRequireWildcard(__webpack_require__(/*! rc-util/lib/warning */ "../../../node_modules/rc-util/lib/warning.js")); function noop() {} let deprecatedWarnList = null; function resetWarned() { deprecatedWarnList = null; (0, _warning2.resetWarned)(); } let _warning = noop; if (true) { _warning = (valid, component, message) => { (0, _warning2.default)(valid, `[antd: ${component}] ${message}`); // StrictMode will inject console which will not throw warning in React 17. if (false) // removed by dead control flow {} }; } const warning = _warning; const WarningContext = exports.WarningContext = /*#__PURE__*/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 */ const devUseWarning = exports.devUseWarning = true ? component => { const { strict } = 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 || ''); } // Warning for the first time if (!existWarning) { console.warn('[antd] There exists deprecated usage in your code:', deprecatedWarnList); } } else { true ? warning(valid, component, message) : 0; } } }; typeWarning.deprecated = (valid, oldProp, newProp, message) => { typeWarning(valid, 'deprecated', `\`${oldProp}\` is deprecated. Please use \`${newProp}\` instead.${message ? ` ${message}` : ''}`); }; return typeWarning; } : 0; var _default = exports["default"] = warning; /***/ }), /***/ "../../../node_modules/antd/lib/_util/wave/WaveEffect.js": /*!***************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/wave/WaveEffect.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use client"; var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../../../node_modules/classnames/index.js")); var _rcMotion = _interopRequireDefault(__webpack_require__(/*! rc-motion */ "../../../node_modules/rc-motion/es/index.js")); var _raf = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/raf */ "../../../node_modules/rc-util/lib/raf.js")); var _ref = __webpack_require__(/*! rc-util/lib/ref */ "../../../node_modules/rc-util/lib/ref.js"); var _UnstableContext = __webpack_require__(/*! ../../config-provider/UnstableContext */ "../../../node_modules/antd/lib/config-provider/UnstableContext.js"); var _interface = __webpack_require__(/*! ./interface */ "../../../node_modules/antd/lib/_util/wave/interface.js"); var _util = __webpack_require__(/*! ./util */ "../../../node_modules/antd/lib/_util/wave/util.js"); function validateNum(value) { return Number.isNaN(value) ? 0 : value; } const WaveEffect = props => { const { className, target, component, registerUnmount } = props; const divRef = React.useRef(null); // ====================== Refs ====================== const unmountRef = React.useRef(null); React.useEffect(() => { unmountRef.current = registerUnmount(); }, []); // ===================== Effect ===================== const [color, setWaveColor] = React.useState(null); const [borderRadius, setBorderRadius] = React.useState([]); const [left, setLeft] = React.useState(0); const [top, setTop] = React.useState(0); const [width, setWidth] = React.useState(0); const [height, setHeight] = React.useState(0); const [enabled, setEnabled] = React.useState(false); const waveStyle = { left, top, width, height, borderRadius: borderRadius.map(radius => `${radius}px`).join(' ') }; if (color) { waveStyle['--wave-color'] = color; } function syncPos() { const nodeStyle = getComputedStyle(target); // Get wave color from target setWaveColor((0, _util.getTargetWaveColor)(target)); const isStatic = nodeStyle.position === 'static'; // Rect 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); // Get border radius const { borderTopLeftRadius, borderTopRightRadius, borderBottomLeftRadius, borderBottomRightRadius } = nodeStyle; setBorderRadius([borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius].map(radius => validateNum(Number.parseFloat(radius)))); } React.useEffect(() => { if (target) { // We need delay to check position here // since UI may change after click const id = (0, _raf.default)(() => { syncPos(); setEnabled(true); }); // Add resize observer to follow size let resizeObserver; if (typeof ResizeObserver !== 'undefined') { resizeObserver = new ResizeObserver(syncPos); resizeObserver.observe(target); } return () => { _raf.default.cancel(id); resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect(); }; } }, [target]); if (!enabled) { return null; } const isSmallComponent = (component === 'Checkbox' || component === 'Radio') && (target === null || target === void 0 ? void 0 : target.classList.contains(_interface.TARGET_CLS)); return /*#__PURE__*/React.createElement(_rcMotion.default, { visible: true, motionAppear: true, motionName: "wave-motion", motionDeadline: 5000, onAppearEnd: (_, event) => { var _a, _b; if (event.deadline || event.propertyName === 'opacity') { const holder = (_a = divRef.current) === null || _a === void 0 ? void 0 : _a.parentElement; (_b = unmountRef.current) === null || _b === void 0 ? void 0 : _b.call(unmountRef).then(() => { holder === null || holder === void 0 ? void 0 : holder.remove(); }); } return false; } }, ({ className: motionClassName }, ref) => (/*#__PURE__*/React.createElement("div", { ref: (0, _ref.composeRef)(divRef, ref), className: (0, _classnames.default)(className, motionClassName, { 'wave-quick': isSmallComponent }), style: waveStyle }))); }; const showWaveEffect = (target, info) => { var _a; const { component } = info; // Skip for unchecked checkbox if (component === 'Checkbox' && !((_a = target.querySelector('input')) === null || _a === void 0 ? void 0 : _a.checked)) { return; } // Create holder const holder = document.createElement('div'); holder.style.position = 'absolute'; holder.style.left = '0px'; holder.style.top = '0px'; target === null || target === void 0 ? void 0 : target.insertBefore(holder, target === null || target === void 0 ? void 0 : target.firstChild); const reactRender = (0, _UnstableContext.unstableSetRender)(); let unmountCallback = null; function registerUnmount() { return unmountCallback; } unmountCallback = reactRender(/*#__PURE__*/React.createElement(WaveEffect, Object.assign({}, info, { target: target, registerUnmount: registerUnmount })), holder); }; var _default = exports["default"] = showWaveEffect; /***/ }), /***/ "../../../node_modules/antd/lib/_util/wave/index.js": /*!**********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/wave/index.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../../../node_modules/classnames/index.js")); var _isVisible = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/Dom/isVisible */ "../../../node_modules/rc-util/lib/Dom/isVisible.js")); var _ref = __webpack_require__(/*! rc-util/lib/ref */ "../../../node_modules/rc-util/lib/ref.js"); var _configProvider = __webpack_require__(/*! ../../config-provider */ "../../../node_modules/antd/lib/config-provider/index.js"); var _reactNode = __webpack_require__(/*! ../reactNode */ "../../../node_modules/antd/lib/_util/reactNode.js"); var _style = _interopRequireDefault(__webpack_require__(/*! ./style */ "../../../node_modules/antd/lib/_util/wave/style.js")); var _useWave = _interopRequireDefault(__webpack_require__(/*! ./useWave */ "../../../node_modules/antd/lib/_util/wave/useWave.js")); const Wave = props => { const { children, disabled, component } = props; const { getPrefixCls } = (0, _react.useContext)(_configProvider.ConfigContext); const containerRef = (0, _react.useRef)(null); // ============================== Style =============================== const prefixCls = getPrefixCls('wave'); const [, hashId] = (0, _style.default)(prefixCls); // =============================== Wave =============================== const showWave = (0, _useWave.default)(containerRef, (0, _classnames.default)(prefixCls, hashId), component); // ============================== Effect ============================== _react.default.useEffect(() => { const node = containerRef.current; if (!node || node.nodeType !== window.Node.ELEMENT_NODE || disabled) { return; } // Click handler const onClick = e => { // Fix radio button click twice if (!(0, _isVisible.default)(e.target) || // No need wave !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); }; // Bind events node.addEventListener('click', onClick, true); return () => { node.removeEventListener('click', onClick, true); }; }, [disabled]); // ============================== Render ============================== if (! /*#__PURE__*/_react.default.isValidElement(children)) { return children !== null && children !== void 0 ? children : null; } const ref = (0, _ref.supportRef)(children) ? (0, _ref.composeRef)((0, _ref.getNodeRef)(children), containerRef) : containerRef; return (0, _reactNode.cloneElement)(children, { ref }); }; if (true) { Wave.displayName = 'Wave'; } var _default = exports["default"] = Wave; /***/ }), /***/ "../../../node_modules/antd/lib/_util/wave/interface.js": /*!**************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/wave/interface.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TARGET_CLS = void 0; var _configProvider = __webpack_require__(/*! ../../config-provider */ "../../../node_modules/antd/lib/config-provider/index.js"); const TARGET_CLS = exports.TARGET_CLS = `${_configProvider.defaultPrefixCls}-wave-target`; /***/ }), /***/ "../../../node_modules/antd/lib/_util/wave/style.js": /*!**********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/wave/style.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _internal = __webpack_require__(/*! ../../theme/internal */ "../../../node_modules/antd/lib/theme/internal.js"); const genWaveStyle = token => { const { componentCls, colorPrimary } = token; return { [componentCls]: { position: 'absolute', background: 'transparent', pointerEvents: 'none', boxSizing: 'border-box', color: `var(--wave-color, ${colorPrimary})`, boxShadow: `0 0 0 0 currentcolor`, opacity: 0.2, // =================== Motion =================== '&.wave-motion-appear': { transition: [`box-shadow 0.4s ${token.motionEaseOutCirc}`, `opacity 2s ${token.motionEaseOutCirc}`].join(','), '&-active': { boxShadow: `0 0 0 6px currentcolor`, opacity: 0 }, '&.wave-quick': { transition: [`box-shadow ${token.motionDurationSlow} ${token.motionEaseInOut}`, `opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`].join(',') } } } }; }; var _default = exports["default"] = (0, _internal.genComponentStyleHook)('Wave', genWaveStyle); /***/ }), /***/ "../../../node_modules/antd/lib/_util/wave/useWave.js": /*!************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/wave/useWave.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); var _interopRequireWildcard = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); var _useEvent = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/hooks/useEvent */ "../../../node_modules/rc-util/lib/hooks/useEvent.js")); var _raf = _interopRequireDefault(__webpack_require__(/*! rc-util/lib/raf */ "../../../node_modules/rc-util/lib/raf.js")); var _configProvider = __webpack_require__(/*! ../../config-provider */ "../../../node_modules/antd/lib/config-provider/index.js"); var _useToken = _interopRequireDefault(__webpack_require__(/*! ../../theme/useToken */ "../../../node_modules/antd/lib/theme/useToken.js")); var _interface = __webpack_require__(/*! ./interface */ "../../../node_modules/antd/lib/_util/wave/interface.js"); var _WaveEffect = _interopRequireDefault(__webpack_require__(/*! ./WaveEffect */ "../../../node_modules/antd/lib/_util/wave/WaveEffect.js")); const useWave = (nodeRef, className, component) => { const { wave } = React.useContext(_configProvider.ConfigContext); const [, token, hashId] = (0, _useToken.default)(); const showWave = (0, _useEvent.default)(event => { const node = nodeRef.current; if ((wave === null || wave === void 0 ? void 0 : wave.disabled) || !node) { return; } const targetNode = node.querySelector(`.${_interface.TARGET_CLS}`) || node; const { showEffect } = wave || {}; // Customize wave effect (showEffect || _WaveEffect.default)(targetNode, { className, token, component, event, hashId }); }); const rafId = React.useRef(null); // Merge trigger event into one for each frame const showDebounceWave = event => { _raf.default.cancel(rafId.current); rafId.current = (0, _raf.default)(() => { showWave(event); }); }; return showDebounceWave; }; var _default = exports["default"] = useWave; /***/ }), /***/ "../../../node_modules/antd/lib/_util/wave/util.js": /*!*********************************************************!*\ !*** ../../../node_modules/antd/lib/_util/wave/util.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getTargetWaveColor = getTargetWaveColor; exports.isValidWaveColor = isValidWaveColor; function isValidWaveColor(color) { return color && color !== '#fff' && color !== '#ffffff' && color !== 'rgb(255, 255, 255)' && color !== 'rgba(255, 255, 255, 1)' && !/rgba\((?:\d*, ){3}0\)/.test(color) && // any transparent rgba color color !== 'transparent' && color !== 'canvastext'; } function getTargetWaveColor(node) { var _a; const { borderTopColor, borderColor, backgroundColor } = getComputedStyle(node); return (_a = [borderTopColor, borderColor, backgroundColor].find(isValidWaveColor)) !== null && _a !== void 0 ? _a : null; } /***/ }), /***/ "../../../node_modules/antd/lib/_util/zindexContext.js": /*!*************************************************************!*\ !*** ../../../node_modules/antd/lib/_util/zindexContext.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { var _interopRequireDefault = (__webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js")["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "../../../node_modules/react/index.js")); const zIndexContext = /*#__PURE__*/_react.default.createContext(undefined); if (true) { zIndexContext.displayName = 'zIndexContext'; } var _default = exports["default"] = zIndexContext; /***/ }) }]); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianMvdmVuZG9ycy1ub2RlX21vZHVsZXNfYW50ZF9saWJfX3V0aWxfQWN0aW9uQnV0dG9uX2pzLW5vZGVfbW9kdWxlc19hbnRkX2xpYl9fdXRpbF9Db250ZXh0SXNvbGF0LWI5MGZjYi52b2x1bnRlZXJhcGkuZTM1ODVhNWM5Y2Q3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25hbWVzLmRlZmF1bHQpKGFjY1trZXldW2RlZmF1bHRGaWVsZF0sIGN1clZhbCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBGbGF0dGVuIGZpbGxcbiAgICAgICAgYWNjW2tleV0gPSAoMCwgX2NsYXNzbmFtZXMuZGVmYXVsdCkoYWNjW2tleV0sIGN1clZhbCk7XG4gICAgICB9XG4gICAgfSk7XG4gICAgcmV0dXJuIGFjYztcbiAgfSwge30pO1xufVxuZnVuY3Rpb24gdXNlU2VtYW50aWNDbGFzc05hbWVzKHNjaGVtYSwgLi4uY2xhc3NOYW1lcykge1xuICByZXR1cm4gUmVhY3QudXNlTWVtbygoKSA9PiBtZXJnZUNsYXNzTmFtZXMuYXBwbHkodm9pZCAwLCBbc2NoZW1hXS5jb25jYXQoY2xhc3NOYW1lcykpLCBbY2xhc3NOYW1lcywgc2NoZW1hXSk7XG59XG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT0gU3R5bGVzID09PT09PT09PT09PT09PT09PT09PT09PT09PVxuZnVuY3Rpb24gdXNlU2VtYW50aWNTdHlsZXMoLi4uc3R5bGVzKSB7XG4gIHJldHVybiBSZWFjdC51c2VNZW1vKCgpID0+IHtcbiAgICByZXR1cm4gc3R5bGVzLnJlZHVjZSgoYWNjLCBjdXIgPSB7fSkgPT4ge1xuICAgICAgT2JqZWN0LmtleXMoY3VyKS5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgIGFjY1trZXldID0gT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LCBhY2Nba2V5XSksIGN1cltrZXldKTtcbiAgICAgIH0pO1xuICAgICAgcmV0dXJuIGFjYztcbiAgICB9LCB7fSk7XG4gIH0sIFtzdHlsZXNdKTtcbn1cbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PSBFeHBvcnQgPT09PT09PT09PT09PT09PT09PT09PT09PT09XG5mdW5jdGlvbiBmaWxsT2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G4gIGVsZW1lbnQuX2FudFByb3h5ID0gZWxlbWVudC5fYW50UHJveHkgfHwge307XG4gIE9iamVjdC5rZXlzKGhhbmRsZXIpLmZvckVhY2goa2V5ID0+IHtcbiAgICBpZiAoIShrZXkgaW4gZWxlbWVudC5fYW50UHJveHkpKSB7XG4gICAgICBjb25zdCBvcmkgPSBlbGVtZW50W2tleV07XG4gICAgICBlbGVtZW50Ll9hbnRQcm94eVtrZXldID0gb3JpO1xuICAgICAgZWxlbWVudFtrZXldID0gaGFuZGxlcltrZXldO1xuICAgIH1cbiAgfSk7XG4gIHJldHVybiBlbGVtZW50O1xufVxuY29uc3QgdXNlUHJveHlJbXBlcmF0aXZlSGFuZGxlID0gKHJlZiwgaW5pdCkgPT4ge1xuICByZXR1cm4gKDAsIF9yZWFjdC51c2VJbXBlcmF0aXZlSGFuZGxlKShyZWYsICgpID0+IHtcbiAgICBjb25zdCByZWZPYmogPSBpbml0KCk7XG4gICAgY29uc3Qge1xuICAgICAgbmF0aXZlRWxlbWVudFxuICAgIH0gPSByZWZPYmo7XG4gICAgaWYgKHR5cGVvZiBQcm94eSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgIHJldHVybiBuZXcgUHJveHkobmF0aXZlRWxlbWVudCwge1xuICAgICAgICBnZXQob2JqLCBwcm9wKSB7XG4gICAgICAgICAgaWYgKHJlZk9ialtwcm9wXSkge1xuICAgICAgICAgICAgcmV0dXJuIHJlZk9ialtwcm9wXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIFJlZmxlY3QuZ2V0KG9iaiwgcHJvcCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgIH1cbiAgICAvLyBGYWxsYmFjayBvZiBJRVxuICAgIHJldHVybiBmaWxsUHJveHkobmF0aXZlRWxlbWVudCwgcmVmT2JqKTtcbiAgfSk7XG59O1xuZXhwb3J0cy51c2VQcm94eUltcGVyYXRpdmVIYW5kbGUgPSB1c2VQcm94eUltcGVyYXRpdm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4uL3JlYWN0Tm9kZVwiKTtcbnZhciBfc3R5bGUgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KHJlcXVpcmUoXCIuL3N0eWxlXCIpKTtcbnZhciBfdXNlV2F2ZSA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQocmVxdWlyZShcIi4vdXNlV2F2ZVwiKSk7XG5jb25zdCBXYXZlID0gcHJvcHMgPT4ge1xuICBjb25zdCB7XG4gICAgY2hpbGRyZW4sXG4gICAgZGlzYWJsZWQsXG4gICAgY29tcG9uZW50XG4gIH0gPSBwcm9wcztcbiAgY29uc3Qge1xuICAgIGdldFByZWZpeENsc1xuICB9ID0gKDAsIF9yZWFjdC51c2VDb250ZXh0KShfY29uZmlnUHJvdmlkZXIuQ29uZmlnQ29udGV4dCk7XG4gIGNvbnN0IGNvbnRhaW5lclJlZiA9ICgwLCBfcmVhY3QudXNlUmVmKShudWxsKTtcbiAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IFN0eWxlID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgY29uc3QgcHJlZml4Q2xzID0gZ2V0UHJlZml4Q2xzKCd3YXZlJyk7XG4gIGNvbnN0IFssIGhhc2hJZF0gPSAoMCwgX3N0eWxlLmRlZmF1bHQpKHByZWZpeENscyk7XG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gV2F2ZSA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gIGNvbnN0IHNob3dXYXZlID0gKDAsIF91c2VXYXZlLmRlZmF1bHQpKGNvbnRhaW5lclJlZiwgKDAsIF9jbGFzc25hbWVzLmRlZmF1bHQpKHByZWZpeENscywgaGFzaElkKSwgY29tcG9uZW50KTtcbiAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IEVmZmVjdCA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgX3JlYWN0LmRlZmF1bHQudXNlRWZmZWN0KCgpID0+IHtc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