PromoCursed/node_modules/.cache/babel-loader/c7127acaf71d2b3e849276532f258d893831746d3db32a4e87237374fa9e0381.json

1 line
13 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport EyeOutlined from \"@ant-design/icons/es/icons/EyeOutlined\";\nimport classNames from 'classnames';\nimport RcImage from 'rc-image';\nimport { useZIndex } from '../_util/hooks/useZIndex';\nimport { getTransitionName } from '../_util/motion';\nimport { ConfigContext } from '../config-provider';\nimport useCSSVarCls from '../config-provider/hooks/useCSSVarCls';\nimport defaultLocale from '../locale/en_US';\nimport PreviewGroup, { icons } from './PreviewGroup';\nimport useStyle from './style';\nconst Image = props => {\n var _a;\n const {\n prefixCls: customizePrefixCls,\n preview,\n className,\n rootClassName,\n style\n } = props,\n otherProps = __rest(props, [\"prefixCls\", \"preview\", \"className\", \"rootClassName\", \"style\"]);\n const {\n getPrefixCls,\n locale: contextLocale = defaultLocale,\n getPopupContainer: getContextPopupContainer,\n image\n } = React.useContext(ConfigContext);\n const prefixCls = getPrefixCls('image', customizePrefixCls);\n const rootPrefixCls = getPrefixCls();\n const imageLocale = contextLocale.Image || defaultLocale.Image;\n // Style\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n const mergedRootClassName = classNames(rootClassName, hashId, cssVarCls, rootCls);\n const mergedClassName = classNames(className, hashId, image === null || image === void 0 ? void 0 : image.className);\n const [zIndex] = useZIndex('ImagePreview', typeof preview === 'object' ? preview.zIndex : undefined);\n const mergedPreview = React.useMemo(() => {\n var _a;\n if (preview === false) {\n return preview;\n }\n const _preview = typeof preview === 'object' ? preview : {};\n const {\n getContainer,\n closeIcon\n } = _preview,\n restPreviewProps = __rest(_preview, [\"getContainer\", \"closeIcon\"]);\n return Object.assign(Object.assign({\n mask: ( /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-mask-info`\n }, /*#__PURE__*/React.createElement(EyeOutlined, null), imageLocale === null || imageLocale === void 0 ? void 0 : imageLocale.preview)),\n icons\n }, restPreviewProps), {\n getContainer: getContainer !== null && getContainer !== void 0 ? getContainer : getContextPopupContainer,\n transitionName: getTransitionName(rootPrefixCls, 'zoom', _preview.transitionName),\n maskTransitionName: getTransitionName(rootPrefixCls, 'fade', _preview.maskTransitionName),\n zIndex,\n closeIcon: closeIcon !== null && closeIcon !== void 0 ? closeIcon : (_a = image === null || image === void 0 ? void 0 : image.preview) === null || _a === void 0 ? void 0 : _a.closeIcon\n });\n }, [preview, imageLocale, (_a = image === null || image === void 0 ? void 0 : image.preview) === null || _a === void 0 ? void 0 : _a.closeIcon]);\n const mergedStyle = Object.assign(Object.assign({}, image === null || image === void 0 ? void 0 : image.style), style);\n return wrapCSSVar( /*#__PURE__*/React.createElement(RcImage, Object.assign({\n prefixCls: prefixCls,\n preview: mergedPreview,\n rootClassName: mergedRootClassName,\n className: mergedClassName,\n style: mergedStyle\n }, otherProps)));\n};\nImage.PreviewGroup = PreviewGroup;\nif (process.env.NODE_ENV !== 'production') {\n Image.displayName = 'Image';\n}\nexport default Image;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","p