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

1 line
24 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"src\", \"alt\", \"onPreviewClose\", \"prefixCls\", \"previewPrefixCls\", \"placeholder\", \"fallback\", \"width\", \"height\", \"style\", \"preview\", \"className\", \"onClick\", \"onError\", \"wrapperClassName\", \"wrapperStyle\", \"rootClassName\"],\n _excluded2 = [\"src\", \"visible\", \"onVisibleChange\", \"getContainer\", \"mask\", \"maskClassName\", \"movable\", \"icons\", \"scaleStep\", \"minScale\", \"maxScale\", \"imageRender\", \"toolbarRender\"];\nimport cn from 'classnames';\nimport { getOffset } from \"rc-util/es/Dom/css\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport { useContext, useMemo, useState } from 'react';\nimport Preview from \"./Preview\";\nimport PreviewGroup from \"./PreviewGroup\";\nimport { COMMON_PROPS } from \"./common\";\nimport { PreviewGroupContext } from \"./context\";\nimport useRegisterImage from \"./hooks/useRegisterImage\";\nimport useStatus from \"./hooks/useStatus\";\nvar ImageInternal = function ImageInternal(props) {\n var imgSrc = props.src,\n alt = props.alt,\n onInitialPreviewClose = props.onPreviewClose,\n _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-image' : _props$prefixCls,\n _props$previewPrefixC = props.previewPrefixCls,\n previewPrefixCls = _props$previewPrefixC === void 0 ? \"\".concat(prefixCls, \"-preview\") : _props$previewPrefixC,\n placeholder = props.placeholder,\n fallback = props.fallback,\n width = props.width,\n height = props.height,\n style = props.style,\n _props$preview = props.preview,\n preview = _props$preview === void 0 ? true : _props$preview,\n className = props.className,\n onClick = props.onClick,\n onError = props.onError,\n wrapperClassName = props.wrapperClassName,\n wrapperStyle = props.wrapperStyle,\n rootClassName = props.rootClassName,\n otherProps = _objectWithoutProperties(props, _excluded);\n var isCustomPlaceholder = placeholder && placeholder !== true;\n var _ref = _typeof(preview) === 'object' ? preview : {},\n previewSrc = _ref.src,\n _ref$visible = _ref.visible,\n previewVisible = _ref$visible === void 0 ? undefined : _ref$visible,\n _ref$onVisibleChange = _ref.onVisibleChange,\n onPreviewVisibleChange = _ref$onVisibleChange === void 0 ? onInitialPreviewClose : _ref$onVisibleChange,\n _ref$getContainer = _ref.getContainer,\n getPreviewContainer = _ref$getContainer === void 0 ? undefined : _ref$getContainer,\n previewMask = _ref.mask,\n maskClassName = _ref.maskClassName,\n movable = _ref.movable,\n icons = _ref.icons,\n scaleStep = _ref.scaleStep,\n minScale = _ref.minScale,\n maxScale = _ref.maxScale,\n imageRender = _ref.imageRender,\n toolbarRender = _ref.toolbarRender,\n dialogProps = _objectWithoutProperties(_ref, _excluded2);\n var src = previewSrc !== null && previewSrc !== void 0 ? previewSrc : imgSrc;\n var _useMergedState = useMergedState(!!previewVisible, {\n value: previewVisible,\n onChange: onPreviewVisibleChange\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n isShowPreview = _useMergedState2[0],\n setShowPreview = _useMergedState2[1];\n var _useStatus = useStatus({\n src: imgSrc,\n isCustomPlaceholder: isCustomPlaceholder,\n fallback: fallback\n }),\n _useStatus2 = _slicedToArray(_useStatus, 3),\n getImgRef = _useStatus2[0],\n srcAndOnload = _useStatus2[1],\n status = _useStatus2[2];\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n