import { defineComponent, toRefs, shallowReactive, watch, openBlock, createBlock, unref, withCtx, createVNode, normalizeStyle, createTextVNode, toDisplayString } from "vue";
import { NProgress, NText } from "naive-ui";
const __default__ = defineComponent({ name: "EProcess" });
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 {
      type,
      unit,
      color,
      processing,
      railColor,
      indicatorTextColor,
      indicatorPlacement,
      indicatorTextSize,
      offsetDegree,
      dataset
    } = toRefs(props.chartConfig.option);
    const option = shallowReactive({
      dataset: 36
    });
    watch(
      () => props.chartConfig.option.dataset,
      (newData) => {
        option.dataset = newData;
      },
      {
        deep: false
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(NProgress), {
        type: unref(type),
        height: unref(h),
        processing: unref(processing),
        percentage: unref(option).dataset,
        "indicator-placement": unref(indicatorPlacement),
        color: unref(color),
        "rail-color": unref(railColor),
        "offset-degree": unref(offsetDegree)
      }, {
        default: withCtx(() => [
          createVNode(unref(NText), {
            style: normalizeStyle({
              color: unref(indicatorTextColor),
              fontSize: `${unref(indicatorTextSize)}px`
            })
          }, {
            default: withCtx(() => [
              createTextVNode(toDisplayString(unref(option).dataset) + " " + toDisplayString(unref(unit)), 1)
            ]),
            _: 1
          }, 8, ["style"])
        ]),
        _: 1
      }, 8, ["type", "height", "processing", "percentage", "indicator-placement", "color", "rail-color", "offset-degree"]);
    };
  }
});
export { _sfc_main as default };
