/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import { defineComponent } from '@vue/composition-api';
import { MirrorIcon, RotationIcon, ZoomOutIcon, ZoomInIcon, ImageIcon, DownloadIcon } from '@ldesign/icons-vue';
import { Tooltip } from '../../tooltip/index.js';
import { usePrefixClass } from '../../../hooks/use-config.js';
import { downloadFile } from '../utils.js';
import TImageViewerIcon from './ImageModalIcon.js';
import '../../../utils/map-props.js';
import 'vue';
import '../../../utils/with-install.js';
import 'lodash';
import '../../../config.js';
import '../../tooltip/tooltip.js';
import '../../../chunks/helper.js';
import '../../../chunks/_commonjsHelpers.js';
import 'lodash/isFunction';
import '../../popup/props.js';
import '../../popup/popup.js';
import '@popperjs/core';
import '../../../chunks/set-style.js';
import '../../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../../chunks/index.js';
import '../../../chunks/log.js';
import '../../../chunks/_commonjsHelpers-2e6815bd.js';
import '../../../utils/easing.js';
import '../../../utils/render-node.js';
import '../../../utils/helper.js';
import 'lodash/camelCase';
import '../../config-provider/config-receiver.js';
import 'lodash/mergeWith';
import '../../config-provider/context.js';
import '../../../chunks/zh_CN.js';
import '../../config-provider/type.js';
import '../../../utils/mixins.js';
import '../../popup/container.js';
import '../../tooltip/props.js';
import '../../tooltip/style';
import '../../tooltip/type.js';
import '../../config-provider/useConfig.js';
import '../../../hooks/lnode.js';
import 'lodash/isEmpty';
import 'lodash/kebabCase';
import '../../../hooks/render-lnode.js';

const currentImage = {
  type: Object,
  default() {
    return {};
  }
};
var TImageViewerUtils = defineComponent({
  name: "LImageViewerUtils",
  props: {
    scale: Number,
    rotateHandler: Function,
    zoomInHandler: Function,
    zoomOutHandler: Function,
    mirrorHandler: Function,
    resetHandler: Function,
    currentImage
  },
  setup() {
    const classPrefix = usePrefixClass();
    return {
      classPrefix
    };
  },
  render() {
    const h = arguments[0];
    return h("div", {
      "class": `${this.classPrefix}-image-viewer__utils`
    }, [h("div", {
      "class": `${this.classPrefix}-image-viewer__utils-content`
    }, [h(Tooltip, {
      "attrs": {
        "overlayClassName": `${this.classPrefix}-image-viewer__utils--tip`,
        "content": "\u955C\u50CF",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h(TImageViewerIcon, {
      "attrs": {
        "clickHandler": this.mirrorHandler,
        "icon": () => h(MirrorIcon, {
          "attrs": {
            "size": "medium"
          }
        })
      }
    })]), h(Tooltip, {
      "attrs": {
        "overlayClassName": `${this.classPrefix}-image-viewer__utils--tip`,
        "content": "\u65CB\u8F6C",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h(TImageViewerIcon, {
      "attrs": {
        "clickHandler": this.rotateHandler,
        "icon": () => h(RotationIcon, {
          "attrs": {
            "size": "medium"
          }
        })
      }
    })]), h(TImageViewerIcon, {
      "attrs": {
        "icon": () => h(ZoomOutIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": this.zoomOutHandler
      }
    }), h(TImageViewerIcon, {
      "class": `${this.classPrefix}-image-viewer__utils-scale`,
      "attrs": {
        "size": "medium",
        "label": `${this.scale * 100}%`
      }
    }), h(TImageViewerIcon, {
      "attrs": {
        "icon": () => h(ZoomInIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": this.zoomInHandler
      }
    }), h(Tooltip, {
      "attrs": {
        "overlayClassName": `${this.classPrefix}-image-viewer__utils--tip`,
        "content": "\u539F\u59CB\u5927\u5C0F",
        "destroyOnClose": true,
        "placement": "top",
        "showArrow": true,
        "theme": "default"
      }
    }, [h("div", {
      "class": `${this.classPrefix}-image-viewer__modal-icon`
    }, [h(TImageViewerIcon, {
      "attrs": {
        "icon": () => h(ImageIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": this.resetHandler
      }
    })])]), this.currentImage.download && h(TImageViewerIcon, {
      "attrs": {
        "icon": () => h(DownloadIcon, {
          "attrs": {
            "size": "medium"
          }
        }),
        "clickHandler": () => {
          downloadFile(this.currentImage.mainImage);
        }
      }
    })])]);
  }
});

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