import { defineComponent as f, computed as r, openBlock as p, createElementBlock as c, createVNode as l, unref as n, normalizeStyle as u, withCtx as g } from "vue";
import { NGradientText as h, NNumberAnimation as d } from "naive-ui";
const w = /* @__PURE__ */ f({
  name: "refConfig_number",
  props: {
    config: {
      type: Object,
      required: !0
    },
    showImg: {
      type: Boolean,
      default: () => !0
    }
  },
  setup(t) {
    const i = t, a = r(() => {
      let e = i.config.text;
      if (typeof e == "number") {
        let o = e.toString().split(".");
        if (o.length > 1)
          return o[1].length;
      }
      return 0;
    });
    let s = r(() => {
      let e = i.config;
      return {
        color: e.showshade ? null : e.color,
        fontSize: e.fontSize + "px",
        fontWeight: e.fontWeight,
        position: "relative",
        left: e.positionLeft ? e.positionLeft + "px" : null,
        top: e.positionTop ? e.positionTop + "px" : null
      };
    });
    return (e, o) => (p(), c("div", null, [
      l(n(h), {
        gradient: t.config.gradient || {},
        style: u({ ...n(s) })
      }, {
        default: g(() => [
          l(n(d), {
            to: t.config.text,
            precision: n(a),
            showSeparator: t.config.showSeparator || !1
          }, null, 8, ["to", "precision", "showSeparator"])
        ]),
        _: 1
      }, 8, ["gradient", "style"])
    ]));
  }
});
export {
  w as default
};
