import { defineComponent, toRefs, openBlock, createElementBlock, normalizeStyle, unref, createVNode } from "vue";
import { NImage } from "naive-ui";
const __default__ = defineComponent({ name: "EImage" });
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { w, h } = toRefs(props.chartConfig.attr);
    const { imgSrc, fit, borderRadius } = toRefs(props.chartConfig.option);
    const getStyle = (radius) => {
      return {
        borderRadius: `${radius}px`,
        overflow: "hidden"
      };
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        style: normalizeStyle(getStyle(unref(borderRadius)))
      }, [
        createVNode(unref(NImage), {
          "object-fit": unref(fit),
          "preview-disabled": "",
          src: unref(imgSrc),
          width: unref(w),
          height: unref(h)
        }, null, 8, ["object-fit", "src", "width", "height"])
      ], 4);
    };
  }
});
export { _sfc_main as default };
