import { defineComponent, useCssVars, unref, toRefs, watch, computed, openBlock, createElementBlock, createElementVNode, toDisplayString } from "vue";
import "./index.vue_vue_type_style_index_0_scoped_true_lang.mjs";
import _export_sfc from "../../../../_virtual/plugin-vue_export-helper.mjs";
const _hoisted_1 = { class: "go-text-box" };
const _hoisted_2 = { class: "content" };
const __default__ = defineComponent({ name: "ETextBarrage" });
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    useCssVars((_ctx) => ({
      "44394f72": unref(fontColor),
      "72d61d70": unref(fontSize) + "px",
      "697640fd": unref(letterSpacing) + "px",
      "001a3614": unref(fontWeight),
      "6782eabe": unref(boxShadow),
      "b27fc1dc": unref(transitionDuration) + "s",
      "c6b30000": unref(animationTime) + "s"
    }));
    const { w } = toRefs(props.chartConfig.attr);
    const { fontColor, fontSize, letterSpacing, fontWeight, animationTime, animationSpeed, boxShadow, dataset } = toRefs(
      props.chartConfig.option
    );
    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
      }
    );
    const transitionDuration = computed(() => {
      return Math.floor(w.value / animationSpeed.value);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createElementVNode("span", null, toDisplayString(unref(dataset)), 1)
        ])
      ]);
    };
  }
});
var _ETextBarrage = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-54c27ceb"]]);
export { _ETextBarrage as default };
