"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.js");
const utils = require("../../../../../utils/utils.js");
require("../../../../../../node_modules/.pnpm/crypto-js@4.1.1/node_modules/crypto-js/index.js");
require("../../../../../enums/pageEnum.js");
require("../../../../../router/index.js");
require("../../../../../store/modules/designStore/designStore.js");
require("../../../../../../node_modules/.pnpm/vue3-lazyload@0.2.5-beta_a6dezdz3je235ci4e3tu4rayna/node_modules/vue3-lazyload/dist/vue3-lazyload.esm.js");
require("../../../../../components/GoSkeleton/index.vue.js");
require("../../../../../components/GoLoading/index.js");
require("../../../../../settings/designSetting.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js");
const useChartDataFetch_hook = require("../../../../../hooks/useChartDataFetch.hook.js");
require("../../../../../api/axios.js");
require("../../../../../../node_modules/.pnpm/echarts@5.4.3/node_modules/echarts/index.js");
require("../../../../../store/modules/langStore/langStore.js");
const chartEditStore = require("../../../../../store/modules/chartEditStore/chartEditStore.js");
const runtimeCore_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js");
const reactivity_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js");
const shared_esmBundler = require("../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.js");
const _sfc_main = /* @__PURE__ */ runtimeCore_esmBundler.defineComponent({
  __name: "index",
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { w, h } = reactivity_esmBundler.toRefs(props.chartConfig.attr);
    const { dataset, fit, borderRadius } = reactivity_esmBundler.toRefs(props.chartConfig.option);
    const option = reactivity_esmBundler.shallowReactive({
      dataset: ""
    });
    const getStyle = (radius) => {
      return {
        borderRadius: `${radius}px`,
        overflow: "hidden"
      };
    };
    runtimeCore_esmBundler.watch(
      () => props.chartConfig.option.dataset,
      (newData) => {
        option.dataset = newData;
      },
      {
        immediate: true
      }
    );
    useChartDataFetch_hook.useChartDataFetch(props.chartConfig, chartEditStore.useChartEditStore, (newData) => {
      option.dataset = newData;
    });
    return (_ctx, _cache) => {
      const _component_n_image = runtimeCore_esmBundler.resolveComponent("n-image");
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
        style: shared_esmBundler.normalizeStyle(getStyle(reactivity_esmBundler.unref(borderRadius)))
      }, [
        runtimeCore_esmBundler.createVNode(_component_n_image, {
          "object-fit": reactivity_esmBundler.unref(fit),
          "preview-disabled": "",
          src: reactivity_esmBundler.unref(option).dataset,
          "fallback-src": reactivity_esmBundler.unref(utils.requireErrorImg)(),
          width: reactivity_esmBundler.unref(w),
          height: reactivity_esmBundler.unref(h),
          lazy: ""
        }, null, 8, ["object-fit", "src", "fallback-src", "width", "height"])
      ], 4);
    };
  }
});
exports.default = _sfc_main;
