/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { defineComponent, createVNode } from 'vue';
import { MirrorIcon, RotationIcon, ZoomOutIcon, ZoomInIcon, ImageIcon, DownloadIcon } from '@ldesign/icons-vue-next';
import { Tooltip } from '../../tooltip/index.js';
import { usePrefixClass } from '../../hooks/useConfig.js';
import { downloadFile } from '../utils.js';
import TImageViewerIcon from './ImageModalIcon.js';
import '../../utils/withInstall.js';
import '../../tooltip/tooltip.js';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/defineProperty';
import 'lodash/isFunction';
import 'lodash/omit';
import '../../popup/props.js';
import '../../popup/index.js';
import '../../popup/popup.js';
import '@popperjs/core';
import 'lodash/isObject';
import 'lodash/isString';
import '../../hooks/useVModel.js';
import 'lodash/kebabCase';
import '../../utils/dom.js';
import '../../_chunks/dep-c9c789a8.js';
import 'lodash/isArray';
import '../../utils/easing.js';
import '../../_common/js/utils/set-style.js';
import '../../popup/container.js';
import '@babel/runtime/helpers/toConsumableArray';
import '../../hooks/useResizeObserver.js';
import '../../hooks/tnode.js';
import 'lodash/camelCase';
import '../../utils/render-tnode.js';
import 'lodash/isEmpty';
import '../../config-provider/useConfig.js';
import 'lodash/cloneDeep';
import '../../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import 'dayjs';
import '../../tooltip/util.js';
import '../../tooltip/props.js';

var TImageViewerUtils = defineComponent({
  name: "TImageViewerUtils",
  props: {
    scale: Number,
    onRotate: Function,
    onZoomIn: Function,
    onZoomOut: Function,
    onMirror: Function,
    onReset: Function,
    currentImage: {
      type: Object,
      "default": function _default() {
        return {};
      }
    }
  },
  setup: function setup(props) {
    var classPrefix = usePrefixClass();
    return function () {
      return createVNode("div", {
        "class": "".concat(classPrefix.value, "-image-viewer__utils")
      }, [createVNode("div", {
        "class": "".concat(classPrefix.value, "-image-viewer__utils-content")
      }, [createVNode(Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u955C\u50CF",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [createVNode(TImageViewerIcon, {
            "onClick": props.onMirror,
            "icon": function icon() {
              return createVNode(MirrorIcon, {
                "size": "medium"
              }, null);
            }
          }, null)];
        }
      }), createVNode(Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u65CB\u8F6C",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [createVNode(TImageViewerIcon, {
            "onClick": props.onRotate,
            "icon": function icon() {
              return createVNode(RotationIcon, {
                "size": "medium"
              }, null);
            }
          }, null)];
        }
      }), createVNode(TImageViewerIcon, {
        "icon": function icon() {
          return createVNode(ZoomOutIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": props.onZoomOut
      }, null), createVNode(TImageViewerIcon, {
        "class": "".concat(classPrefix.value, "-image-viewer__utils-scale"),
        "size": "medium",
        "label": "".concat(props.scale * 100, "%")
      }, null), createVNode(TImageViewerIcon, {
        "icon": function icon() {
          return createVNode(ZoomInIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": props.onZoomIn
      }, null), createVNode(Tooltip, {
        "overlayClassName": "".concat(classPrefix.value, "-image-viewer__utils--tip"),
        "content": "\u539F\u59CB\u5927\u5C0F",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }, {
        "default": function _default() {
          return [createVNode("div", {
            "class": "".concat(classPrefix.value, "-image-viewer__modal-icon")
          }, [createVNode(TImageViewerIcon, {
            "icon": function icon() {
              return createVNode(ImageIcon, {
                "size": "medium"
              }, null);
            },
            "onClick": props.onReset
          }, null)])];
        }
      }), props.currentImage.download && createVNode(TImageViewerIcon, {
        "icon": function icon() {
          return createVNode(DownloadIcon, {
            "size": "medium"
          }, null);
        },
        "onClick": function onClick() {
          downloadFile(props.currentImage.mainImage);
        }
      }, null)])]);
    };
  }
});

export { TImageViewerUtils as default };
//# sourceMappingURL=ImageViewerUtils.js.map
