"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 chartEditStore = require("../../../../../store/modules/chartEditStore/chartEditStore.js");
require("../../../../../store/modules/designStore/designStore.js");
require("../../../../../settings/designSetting.js");
require("../../../../../../node_modules/.pnpm/screenfull@6.0.2/node_modules/screenfull/index.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");
require("../../../../../../node_modules/.pnpm/html2canvas@1.4.1/node_modules/html2canvas/dist/html2canvas.esm.js");
require("../../../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseClone.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("../../../../../../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");
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 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;
    let yearMonthDay = reactivity_esmBundler.ref("2021-2-3");
    let nowData = reactivity_esmBundler.ref("08:00:00");
    let newData = reactivity_esmBundler.ref("2021-2-3 08:00:00");
    let boxShadow = reactivity_esmBundler.ref("none");
    let timer = null;
    const { w, h } = reactivity_esmBundler.toRefs(props.chartConfig.attr);
    let {
      timeColor,
      timeSize,
      timeLineHeight,
      timeTextIndent,
      fontWeight,
      showShadow,
      hShadow,
      vShadow,
      blurShadow,
      colorShadow
    } = reactivity_esmBundler.toRefs(props.chartConfig.option);
    runtimeCore_esmBundler.watch(
      props.chartConfig.option,
      () => {
        try {
          if (props.chartConfig.option.showShadow) {
            boxShadow.value = `${props.chartConfig.option.hShadow}px ${props.chartConfig.option.vShadow}px ${props.chartConfig.option.blurShadow}px ${props.chartConfig.option.colorShadow}`;
          } else {
            boxShadow.value = "none";
          }
        } catch (error) {
          console.log(error);
        }
      },
      {
        immediate: true
      }
    );
    runtimeCore_esmBundler.onMounted(() => {
      timer = setInterval(() => {
        var datetime = /* @__PURE__ */ new Date();
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
        var date = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
        var hh = datetime.getHours();
        var mm = datetime.getMinutes();
        var ss = datetime.getSeconds();
        let time = "";
        if (hh < 10)
          time += "0";
        time += hh + ":";
        if (mm < 10)
          time += "0";
        time += mm + ":";
        if (ss < 10)
          time += "0";
        time += ss;
        yearMonthDay.value = `${year}-${month}-${date}`;
        nowData.value = time;
        newData.value = yearMonthDay.value + " " + nowData.value;
      }, 500);
    });
    runtimeCore_esmBundler.onUnmounted(() => {
      clearInterval(timer);
    });
    useChartDataFetch_hook.useChartDataFetch(props.chartConfig, chartEditStore.useChartEditStore);
    return (_ctx, _cache) => {
      return runtimeCore_esmBundler.openBlock(), runtimeCore_esmBundler.createElementBlock("div", {
        class: "go-decorates-number",
        style: shared_esmBundler.normalizeStyle(`width:${reactivity_esmBundler.unref(w)}px;height:${reactivity_esmBundler.unref(h)}px;`)
      }, [
        runtimeCore_esmBundler.createElementVNode("div", {
          style: shared_esmBundler.normalizeStyle(`color:${reactivity_esmBundler.unref(timeColor)};font-size:${reactivity_esmBundler.unref(timeSize)}px;line-height:${reactivity_esmBundler.unref(timeLineHeight)}px;
      letter-spacing:${reactivity_esmBundler.unref(timeTextIndent)}px;font-weight:${reactivity_esmBundler.unref(fontWeight)};
      text-shadow: ${reactivity_esmBundler.unref(boxShadow)}`)
        }, shared_esmBundler.toDisplayString(reactivity_esmBundler.unref(newData)), 5)
      ], 4);
    };
  }
});
exports.default = _sfc_main;
