'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var iconsVue = require('@ant-design/icons-vue');
require('../../../utils/index.cjs');
require('../../../locale/index.cjs');
require('../../../vue-components/index.cjs');
var useConfigInject = require('../../config-provider/src/hooks/useConfigInject.cjs');
var index = require('../style/index.cjs');
var PreviewGroup = require('./PreviewGroup.cjs');
var Image = require('../../../vue-components/vc-image/src/Image.cjs');
var transition = require('../../../vue-components/transition/src/transition.cjs');
var en_US = require('../../../locale/lang/en_US.cjs');
var _class = require('../../../utils/dom/class.cjs');

var AImage = /* @__PURE__ */ vue.defineComponent({
  name: "AImage",
  inheritAttrs: false,
  props: Image.imageProps(),
  setup(props, {
    slots,
    attrs
  }) {
    const {
      prefixCls,
      rootPrefixCls,
      configProvider
    } = useConfigInject.default("image", props);
    const [wrapSSR, hashId] = index.default(prefixCls);
    const mergedPreview = vue.computed(() => {
      const {
        preview
      } = props;
      if (preview === false)
        return preview;
      const _preview = typeof preview === "object" ? preview : {};
      return {
        icons: PreviewGroup.icons,
        ..._preview,
        transitionName: transition.getTransitionName(rootPrefixCls.value, "zoom", _preview.transitionName),
        maskTransitionName: transition.getTransitionName(rootPrefixCls.value, "fade", _preview.maskTransitionName)
      };
    });
    return () => {
      var _a, _b;
      const imageLocale = ((_b = (_a = configProvider.locale) == null ? void 0 : _a.value) == null ? void 0 : _b.Image) || en_US.default.Image;
      const defaultPreviewMask = () => vue.createVNode("div", {
        "class": `${prefixCls.value}-mask-info`
      }, [vue.createVNode(iconsVue.EyeOutlined, null, null), imageLocale == null ? void 0 : imageLocale.preview]);
      const {
        previewMask = slots.previewMask || defaultPreviewMask
      } = props;
      return wrapSSR(vue.createVNode(Image.default, {
        ...attrs,
        ...props,
        prefixCls: prefixCls.value,
        "preview": mergedPreview.value,
        "rootClassName": _class.classNames(props.rootClassName, hashId.value)
      }, {
        ...slots,
        previewMask: typeof previewMask === "function" ? previewMask : null
      }));
    };
  }
});

exports.default = AImage;
//# sourceMappingURL=Image.cjs.map
