import { computed as y, ref as d, watch as me, onMounted as Ae, onBeforeUnmount as Re, openBlock as o, createElementBlock as u, normalizeClass as ge, normalizeStyle as L, unref as i, createBlock as R, createCommentVNode as h, withCtx as X, toDisplayString as C, createSlots as Ge, renderSlot as w, normalizeProps as D, guardReactiveProps as B, createVNode as Ee, createElementVNode as g, Fragment as x, renderList as S, mergeProps as G } from "vue";
import { u as Ue, c as We, t as je, a as Te, p as pe, b as Le, o as ke, d as De, e as E, g as be, m as V, I as $, X as Be, s as q, k as Ve, i as H, f as Z, F as J } from "./index-Z_vzxZTo.js";
import { t as qe, u as He } from "./useResponsive-CoxXLe23.js";
import { u as Ze, U as Je } from "./usePrinter-Ck0oiMlt.js";
import Ke from "./vue-ui-skeleton-BMRe3SzB.js";
import { _ as Qe } from "./Title-obqvTiXP.js";
import { u as xe } from "./useNestedProp-Buhi5uyL.js";
import { _ as et } from "./PackageVersion-dR8EUy_P.js";
import { P as tt } from "./PenAndPaper-CrXlqi9I.js";
import { u as at } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const st = ["id"], rt = { key: 0 }, ot = ["xmlns", "viewBox"], ut = ["width", "height"], nt = ["id"], it = ["stop-color"], ct = ["stop-color"], vt = ["stop-color"], ht = ["id"], dt = ["stdDeviation"], yt = ["d", "fill", "stroke"], ft = ["id", "d"], mt = ["fill", "font-size", "font-weight"], gt = ["href", "startOffset"], pt = ["x", "y", "text-anchor", "fill", "font-size", "font-weight"], kt = ["d", "filter"], bt = ["stroke", "stroke-width"], xt = ["stroke", "stroke-width"], _t = ["stroke", "stroke-width"], wt = ["stroke", "stroke-width"], St = { key: 5 }, $t = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], zt = ["x", "y", "font-size", "font-weight", "fill"], Ft = { key: 7 }, Ct = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Ot = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Mt = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], Pt = { key: 8 }, Nt = ["d", "fill", "stroke", "stroke-width"], Xt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], Yt = ["x", "y", "font-size", "fill"], It = {
  key: 5,
  class: "vue-data-ui-watermark"
}, At = {
  __name: "vue-ui-gauge",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  setup(U, { expose: _e }) {
    const v = U, { vue_ui_gauge: we } = Ue(), Y = y(() => !!v.dataset && Object.keys(v.dataset).length > 0 && v.dataset.series && v.dataset.series.length), _ = d(We()), Se = d(null), K = d(0), O = d(null), Q = d(null), ee = d(null), te = d(null), ae = d(null), le = d(0), e = y({
      get: () => oe(),
      set: (t) => t
    }), { userOptionsVisible: W, setUserOptionsVisibility: se, keepUserOptionState: re } = at({ config: e.value });
    me(() => v.config, (t) => {
      e.value = oe(), W.value = !e.value.showOnChartHover, he(), le.value += 1;
    }, { deep: !0 });
    function oe() {
      const t = xe({
        userConfig: v.config,
        defaultConfig: we
      });
      return t.theme ? {
        ...xe({
          userConfig: je.vue_ui_gauge[t.theme] || v.config,
          defaultConfig: t
        }),
        customPalette: Te[t.theme] || pe
      } : t;
    }
    const { isPrinting: ue, isImaging: ne, generatePdf: ie, generateImage: ce } = Ze({
      elementId: `vue-ui-gauge_${_.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-gauge"
    }), $e = y(() => e.value.userOptions.show && !e.value.style.chart.title.text), ze = y(() => Le(e.value.customPalette)), z = y(() => {
      if (!Y.value || ke(v.dataset.series || {}))
        return {
          value: 0,
          series: [
            {
              from: 0,
              to: 0
            }
          ]
        };
      const t = [];
      (v.dataset.series || []).forEach((a) => {
        t.push(a.from || 1e-7), t.push(a.to || 1e-7);
      });
      const s = Math.max(...t);
      return {
        ...v.dataset,
        series: (v.dataset.series || []).map((a, r) => ({
          ...a,
          color: De(a.color) || ze.value[r] || pe[r],
          value: ((a.to || 0) - (a.from || 0)) / s * 100
        }))
      };
    }), p = d(512), l = d({
      height: 358.4,
      width: p.value,
      top: 0,
      bottom: 358.4,
      centerX: 179.2,
      centerY: p.value / 2,
      labelFontSize: 18,
      legendFontSize: e.value.style.chart.legend.fontSize,
      pointerRadius: e.value.style.chart.layout.pointer.circle.radius,
      trackSize: e.value.style.chart.layout.track.size,
      pointerSize: e.value.style.chart.layout.pointer.size,
      pointerStrokeWidth: e.value.style.chart.layout.pointer.strokeWidth,
      markerOffset: e.value.style.chart.layout.markers.offsetY + 3,
      segmentFontSize: e.value.style.chart.layout.segmentNames.fontSize
    }), M = d(0), P = d(0), f = d(
      e.value.style.chart.animation.use ? Math.min(...v.dataset.series.map((t) => t.from)) : v.dataset.value
    );
    me(() => v.dataset.value, () => {
      de(v.dataset.value);
    });
    const n = y(() => {
      const t = l.value.width / 2, s = c.value.base, a = Math.PI * ((f.value + 0 - P.value) / (M.value - P.value)) + Math.PI;
      return {
        x1: t,
        y1: s,
        x2: t + c.value.pointerSize * l.value.pointerSize * 0.9 * Math.cos(a),
        y2: s + c.value.pointerSize * l.value.pointerSize * 0.9 * Math.sin(a)
      };
    }), ve = y(() => {
      const t = l.value.width / 2, s = c.value.base, a = Math.PI * ((f.value + 0 - P.value) / (M.value - P.value)) + Math.PI, r = t + c.value.pointerSize * l.value.pointerSize * 0.9 * Math.cos(a), k = s + c.value.pointerSize * l.value.pointerSize * 0.9 * Math.sin(a), b = l.value.pointerRadius, Ne = t + b * Math.cos(a + Math.PI / 2), Xe = s + b * Math.sin(a + Math.PI / 2), Ye = t + b * Math.cos(a - Math.PI / 2), Ie = s + b * Math.sin(a - Math.PI / 2);
      return isNaN(r) ? null : `M ${r},${k} ${Ne},${Xe} ${Ye},${Ie} Z`;
    }), j = y(() => {
      for (let t = 0; t < z.value.series.length; t += 1) {
        const { color: s, from: a, to: r } = z.value.series[t];
        if (f.value >= a && f.value <= r)
          return s;
      }
      return "#2D353C";
    }), I = d(null);
    function he() {
      if (ke(v.dataset) ? E({
        componentName: "VueUiGauge",
        type: "dataset"
      }) : (be({
        datasetObject: v.dataset,
        requiredAttributes: ["value", "series"]
      }).forEach((t) => {
        E({
          componentName: "VueUiGauge",
          type: "datasetAttribute",
          property: t
        });
      }), Object.hasOwn(v.dataset, "series") && (v.dataset.series.length ? v.dataset.series.forEach((t, s) => {
        be({
          datasetObject: t,
          requiredAttributes: ["from", "to"]
        }).forEach((a) => {
          E({
            componentName: "VueUiGauge",
            type: "datasetSerieAttribute",
            property: a,
            index: s
          });
        });
      }) : E({
        componentName: "VueUiGauge",
        type: "datasetAttributeEmpty",
        property: "series"
      }))), de(v.dataset.value || 0), e.value.responsive) {
        const t = qe(() => {
          const { width: s, height: a } = He({
            chart: O.value,
            title: e.value.style.chart.title.text ? Q.value : null,
            legend: ee.value,
            source: te.value,
            noTitle: ae.value
          });
          l.value.width = s, l.value.height = a, l.value.centerX = s / 2, l.value.centerY = p.value / 2 / 358.4 * a, l.value.bottom = a, l.value.labelFontSize = 18 / p.value * Math.min(a, s) < 10 ? 10 : 18 / p.value * Math.min(a, s), l.value.legendFontSize = e.value.style.chart.legend.fontSize / p.value * Math.min(a, s) < 14 ? 14 : e.value.style.chart.legend.fontSize / p.value * Math.min(a, s), l.value.pointerRadius = e.value.style.chart.layout.pointer.circle.radius / p.value * Math.min(a, s), l.value.trackSize = e.value.style.chart.layout.track.size / p.value * Math.min(a, s), l.value.pointerStrokeWidth = J({
            relator: Math.min(s, a),
            adjuster: p.value,
            source: e.value.style.chart.layout.pointer.strokeWidth,
            threshold: 2,
            fallback: 2
          }), l.value.markerOffset = J({
            relator: Math.max(s, a),
            adjuster: p.value,
            source: e.value.style.chart.layout.markers.offsetY + 3,
            threshold: 2,
            fallback: 2
          }), l.value.segmentFontSize = J({
            relator: Math.min(s, a),
            adjuster: p.value,
            source: e.value.style.chart.layout.segmentNames.fontSize,
            threshold: 8,
            fallback: 8
          });
        });
        I.value = new ResizeObserver(t), I.value.observe(O.value.parentNode);
      }
    }
    Ae(() => {
      he();
    }), Re(() => {
      I.value && I.value.disconnect();
    });
    function de(t) {
      const s = [];
      (z.value.series || []).forEach((b) => {
        s.push(b.from || 0), s.push(b.to || 0);
      }), M.value = Math.max(...s), P.value = Math.min(...s);
      let a = e.value.style.chart.animation.speed;
      const r = Math.abs(t - f.value) / (a * 60);
      function k() {
        f.value < t ? f.value = Math.min(f.value + r, t) : f.value > t && (f.value = Math.max(f.value - r, t)), f.value !== t && requestAnimationFrame(k);
      }
      k();
    }
    const c = y(() => {
      const t = e.value.responsive ? Math.min(l.value.width, l.value.height) : l.value.width, s = 2.5 / e.value.style.chart.layout.radiusRatio;
      return {
        arcs: t / s,
        gradients: t / (s * 1.1),
        base: e.value.responsive ? l.value.height / 2 : l.value.height * 0.7,
        ratingBase: e.value.responsive ? l.value.height / 2 + l.value.height / 4 : l.value.height * 0.9,
        pointerSize: e.value.responsive ? Math.min(l.value.width, l.value.height) / 3 : l.value.width / 3.2
      };
    }), m = y(() => V(
      { series: z.value.series },
      l.value.width / 2,
      c.value.base,
      c.value.arcs,
      c.value.arcs,
      1,
      1,
      1,
      180,
      109.9495,
      40 * l.value.trackSize
    )), Fe = y(() => V(
      { series: z.value.series },
      l.value.width / 2,
      c.value.base,
      c.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio,
      c.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio,
      1,
      1,
      1,
      180,
      109.9495,
      40 * l.value.trackSize
    )), F = y(() => m.value.map((t) => c.value.arcs * e.value.style.chart.layout.segmentNames.offsetRatio * (t.nameOffsetRatio || 1))), ye = y(() => {
      const { x: t, y: s } = $({
        initX: m.value[0].firstSeparator.x,
        initY: m.value[0].firstSeparator.y,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: -e.value.style.chart.layout.segmentSeparators.offsetIn
      }), { x: a, y: r } = $({
        initX: m.value[0].startX,
        initY: m.value[0].startY,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: e.value.style.chart.layout.segmentSeparators.offsetOut
      });
      return { x1: t, y1: s, x2: a, y2: r };
    }), fe = y(() => m.value.map((t) => {
      const { x: s, y: a } = $({
        initX: t.separator.x,
        initY: t.separator.y,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: -e.value.style.chart.layout.segmentSeparators.offsetIn
      }), { x: r, y: k } = $({
        initX: t.endX,
        initY: t.endY,
        centerX: n.value.x1,
        centerY: n.value.y1,
        offset: e.value.style.chart.layout.segmentSeparators.offsetOut
      });
      return { x1: s, y1: a, x2: r, y2: k };
    }));
    function Ce(t) {
      if (t.reduce((k, b) => k + b, 0) > 100)
        throw new Error("Total % must not exceed 100");
      const a = 50;
      let r = 0;
      return t.map((k) => (r += k, `${r / 100 * a - k / 4}%`));
    }
    const Oe = y(() => Ce(m.value.map((t) => t.proportion * 100))), Me = y(() => V(
      { series: z.value.series },
      l.value.width / 2,
      c.value.base,
      c.value.gradients,
      c.value.gradients,
      0.95,
      1,
      1,
      180,
      110.02,
      2 * l.value.trackSize
    )), N = d(!1);
    function Pe(t) {
      N.value = t, K.value += 1;
    }
    const A = d(!1);
    function T() {
      A.value = !A.value;
    }
    return _e({
      generatePdf: ie,
      generateImage: ce,
      toggleAnnotator: T
    }), (t, s) => (o(), u("div", {
      class: ge(`vue-ui-gauge ${N.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      ref_key: "gaugeChart",
      ref: O,
      id: `vue-ui-gauge_${_.value}`,
      style: L(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height: 100%" : ""}`),
      onMouseenter: s[0] || (s[0] = () => i(se)(!0)),
      onMouseleave: s[1] || (s[1] = () => i(se)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (o(), R(tt, {
        key: 0,
        parent: O.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: A.value,
        onClose: T
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : h("", !0),
      $e.value ? (o(), u("div", {
        key: 1,
        ref_key: "noTitle",
        ref: ae,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : h("", !0),
      e.value.style.chart.title.text ? (o(), u("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: Q,
        style: "width:100%;background:transparent;padding-bottom:12px"
      }, [
        (o(), R(Qe, {
          key: `title_${le.value}`,
          config: {
            title: {
              cy: "gauge-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "gauge-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, {
          default: X(() => [
            e.value.translations.base && U.dataset.base ? (o(), u("span", rt, C(e.value.translations.base) + ": " + C(U.dataset.base), 1)) : h("", !0)
          ]),
          _: 1
        }, 8, ["config"]))
      ], 512)) : h("", !0),
      e.value.userOptions.show && Y.value && (i(re) || i(W)) ? (o(), R(Je, {
        ref_key: "details",
        ref: Se,
        key: `user_options_${K.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isImaging: i(ne),
        isPrinting: i(ue),
        uid: _.value,
        hasXls: !1,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: N.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: O.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: A.value,
        onToggleFullscreen: Pe,
        onGeneratePdf: i(ie),
        onGenerateImage: i(ce),
        onToggleAnnotator: T,
        style: L({
          visibility: i(re) ? i(W) ? "visible" : "hidden" : "visible"
        })
      }, Ge({ _: 2 }, [
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: X(() => [
            w(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: X(() => [
            w(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: X(({ toggleFullscreen: a, isFullscreen: r }) => [
            w(t.$slots, "optionFullscreen", D(B({ toggleFullscreen: a, isFullscreen: r })), void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: X(({ toggleAnnotator: a, isAnnotator: r }) => [
            w(t.$slots, "optionAnnotator", D(B({ toggleAnnotator: a, isAnnotator: r })), void 0, !0)
          ]),
          key: "3"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasPdf", "hasImg", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : h("", !0),
      Y.value ? (o(), u("svg", {
        key: 4,
        xmlns: i(Be),
        class: ge({ "vue-data-ui-fullscreen--on": N.value, "vue-data-ui-fulscreen--off": !N.value }),
        viewBox: `0 0 ${l.value.width <= 0 ? 10 : l.value.width} ${l.value.height <= 0 ? 10 : l.value.height}`,
        style: L(`max-width:100%;overflow:hidden !important;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        Ee(et),
        t.$slots["chart-background"] ? (o(), u("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: l.value.width <= 0 ? 10 : l.value.width,
          height: l.value.height <= 0 ? 10 : l.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          w(t.$slots, "chart-background", {}, void 0, !0)
        ], 8, ut)) : h("", !0),
        g("defs", null, [
          g("radialGradient", {
            id: `gradient_${_.value}`,
            cx: "50%",
            cy: "50%",
            r: "50%",
            fx: "50%",
            fy: "50%"
          }, [
            g("stop", {
              offset: "0%",
              "stop-color": i(q)("#FFFFFF", 1)
            }, null, 8, it),
            g("stop", {
              offset: "80%",
              "stop-color": i(q)("#FFFFFF", e.value.style.chart.layout.track.gradientIntensity)
            }, null, 8, ct),
            g("stop", {
              offset: "100%",
              "stop-color": i(q)("#FFFFFF", 1)
            }, null, 8, vt)
          ], 8, nt)
        ]),
        g("defs", null, [
          g("filter", {
            id: `blur_${_.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            g("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 100 / e.value.style.chart.layout.track.gradientIntensity
            }, null, 8, dt)
          ], 8, ht)
        ]),
        (o(!0), u(x, null, S(m.value, (a, r) => (o(), u("path", {
          key: `arc_${r}`,
          d: a.arcSlice,
          fill: a.color,
          stroke: e.value.style.chart.backgroundColor,
          "stroke-linecap": "round"
        }, null, 8, yt))), 128)),
        e.value.style.chart.layout.segmentNames.show && e.value.style.chart.layout.segmentNames.curved ? (o(), u(x, { key: 1 }, [
          (o(!0), u(x, null, S(m.value, (a, r) => (o(), u("path", {
            id: `curve_${_.value}_${r}`,
            d: `M ${n.value.x1},${n.value.y1} m -${F.value[r]},0 a ${F.value[r]},${F.value[r]} 0 1,1 ${2 * F.value[r]},0 a ${F.value[r]},${F.value[r]} 0 1,1 -${2 * F.value[r]},0`,
            fill: "transparent"
          }, null, 8, ft))), 256)),
          (o(!0), u(x, null, S(m.value, (a, r) => (o(), u("text", {
            fill: e.value.style.chart.layout.segmentNames.useSerieColor ? a.color : e.value.style.chart.layout.segmentNames.color,
            "font-size": l.value.segmentFontSize,
            "font-weight": e.value.style.chart.layout.segmentNames.bold ? "bold" : "normal",
            "text-anchor": "middle"
          }, [
            g("textPath", {
              href: `#curve_${_.value}_${r}`,
              startOffset: Oe.value[r]
            }, C(a.name || ""), 9, gt)
          ], 8, mt))), 256))
        ], 64)) : h("", !0),
        e.value.style.chart.layout.segmentNames.show && !e.value.style.chart.layout.segmentNames.curved ? (o(!0), u(x, { key: 2 }, S(Fe.value, (a, r) => (o(), u("text", {
          x: a.center.endX,
          y: a.center.endY,
          "text-anchor": i(Ve)(a, !1, 12).anchor,
          fill: e.value.style.chart.layout.segmentNames.useSerieColor ? a.color : e.value.style.chart.layout.segmentNames.color,
          "font-size": l.value.segmentFontSize,
          "font-weight": e.value.style.chart.layout.segmentNames.bold ? "bold" : "normal"
        }, C(a.name || ""), 9, pt))), 256)) : h("", !0),
        e.value.style.chart.layout.track.useGradient ? (o(!0), u(x, { key: 3 }, S(Me.value, (a, r) => (o(), u("path", {
          key: `arc_${r}`,
          d: a.arcSlice,
          fill: "#FFFFFF",
          stroke: "none",
          "stroke-linecap": "round",
          filter: `url(#blur_${_.value})`
        }, null, 8, kt))), 128)) : h("", !0),
        e.value.style.chart.layout.segmentSeparators.show ? (o(), u(x, { key: 4 }, [
          g("line", G(ye.value, {
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2,
            "stroke-linecap": "round"
          }), null, 16, bt),
          g("line", G(ye.value, {
            stroke: e.value.style.chart.layout.segmentSeparators.stroke,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth,
            "stroke-linecap": "round"
          }), null, 16, xt),
          (o(!0), u(x, null, S(fe.value, (a) => (o(), u("line", G(a, {
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth + 2,
            "stroke-linecap": "round"
          }), null, 16, _t))), 256)),
          (o(!0), u(x, null, S(fe.value, (a) => (o(), u("line", G(a, {
            stroke: e.value.style.chart.layout.segmentSeparators.stroke,
            "stroke-width": e.value.style.chart.layout.segmentSeparators.strokeWidth,
            "stroke-linecap": "round"
          }), null, 16, wt))), 256))
        ], 64)) : h("", !0),
        e.value.style.chart.layout.markers.show ? (o(), u("g", St, [
          (o(!0), u(x, null, S(m.value, (a, r) => (o(), u("text", {
            x: i($)({
              centerX: n.value.x1,
              centerY: c.value.base,
              initX: a.center.startX,
              initY: a.center.startY,
              offset: l.value.markerOffset
            }).x,
            y: i($)({
              centerX: n.value.x1,
              centerY: c.value.base,
              initX: a.center.startX,
              initY: a.center.startY,
              offset: l.value.markerOffset
            }).y,
            "text-anchor": a.center.startX < n.value.x1 - 5 ? "end" : a.center.startX > n.value.x1 + 5 ? "start" : "middle",
            "font-size": l.value.labelFontSize * e.value.style.chart.layout.markers.fontSizeRatio,
            "font-weight": `${e.value.style.chart.layout.markers.bold ? "bold" : "normal"}`,
            fill: e.value.style.chart.layout.markers.color
          }, C(i(H)(
            e.value.style.chart.layout.markers.formatter,
            a.from,
            i(Z)({
              p: e.value.style.chart.layout.markers.prefix,
              v: a.from,
              s: e.value.style.chart.layout.markers.suffix,
              r: e.value.style.chart.layout.markers.roundingValue
            })
          )), 9, $t))), 256))
        ])) : h("", !0),
        e.value.style.chart.layout.markers.show ? (o(), u("text", {
          key: 6,
          x: i($)({
            centerX: l.value.width / 2,
            centerY: c.value.base,
            initX: m.value.at(-1).endX,
            initY: m.value.at(-1).endY,
            offset: l.value.markerOffset
          }).x,
          y: i($)({
            centerX: l.value.width / 2,
            centerY: c.value.base,
            initX: m.value.at(-1).endX,
            initY: m.value.at(-1).endY,
            offset: l.value.markerOffset
          }).y,
          "text-anchor": "start",
          "font-size": l.value.labelFontSize * e.value.style.chart.layout.markers.fontSizeRatio,
          "font-weight": `${e.value.style.chart.layout.markers.bold ? "bold" : "normal"}`,
          fill: e.value.style.chart.layout.markers.color
        }, C(i(H)(
          e.value.style.chart.layout.markers.formatter,
          M.value,
          i(Z)({
            p: e.value.style.chart.layout.markers.prefix,
            v: M.value,
            s: e.value.style.chart.layout.markers.suffix,
            r: e.value.style.chart.layout.markers.roundingValue
          })
        )), 9, zt)) : h("", !0),
        e.value.style.chart.layout.pointer.type === "rounded" ? (o(), u("g", Ft, [
          isNaN(n.value.x2) ? h("", !0) : (o(), u("line", {
            key: 0,
            x1: n.value.x1,
            y1: n.value.y1,
            x2: n.value.x2,
            y2: n.value.y2,
            stroke: e.value.style.chart.layout.pointer.stroke,
            "stroke-width": l.value.pointerStrokeWidth,
            "stroke-linecap": "round"
          }, null, 8, Ct)),
          isNaN(n.value.x2) ? h("", !0) : (o(), u("line", {
            key: 1,
            x1: n.value.x1,
            y1: n.value.y1,
            x2: n.value.x2,
            y2: n.value.y2,
            stroke: e.value.style.chart.layout.pointer.useRatingColor ? j.value : e.value.style.chart.layout.pointer.color,
            "stroke-linecap": "round",
            "stroke-width": l.value.pointerStrokeWidth * 0.7
          }, null, 8, Ot)),
          !isNaN(n.value.x2) && e.value.style.chart.layout.track.useGradient ? (o(), u("line", {
            key: 2,
            x1: n.value.x1,
            y1: n.value.y1,
            x2: n.value.x2,
            y2: n.value.y2,
            stroke: "white",
            "stroke-linecap": "round",
            "stroke-width": l.value.pointerStrokeWidth * 0.3,
            filter: `url(#blur_${_.value})`
          }, null, 8, Mt)) : h("", !0)
        ])) : (o(), u("g", Pt, [
          ve.value ? (o(), u("path", {
            key: 0,
            d: ve.value,
            fill: e.value.style.chart.layout.pointer.useRatingColor ? j.value : e.value.style.chart.layout.pointer.color,
            stroke: e.value.style.chart.layout.pointer.stroke,
            "stroke-width": e.value.style.chart.layout.pointer.circle.strokeWidth,
            "stroke-linejoin": "round"
          }, null, 8, Nt)) : h("", !0)
        ])),
        g("circle", {
          cx: l.value.width / 2,
          cy: c.value.base,
          fill: e.value.style.chart.layout.pointer.circle.color,
          r: l.value.pointerRadius <= 0 ? 1e-4 : l.value.pointerRadius,
          "stroke-width": e.value.style.chart.layout.pointer.circle.strokeWidth,
          stroke: e.value.style.chart.layout.pointer.circle.stroke
        }, null, 8, Xt),
        e.value.style.chart.legend.show ? (o(), u("text", {
          key: 9,
          x: l.value.width / 2,
          y: c.value.ratingBase,
          "text-anchor": "middle",
          "font-size": l.value.legendFontSize,
          "font-weight": "bold",
          fill: e.value.style.chart.legend.useRatingColor ? j.value : e.value.style.chart.legend.color
        }, C(i(H)(
          e.value.style.chart.legend.formatter,
          f.value,
          i(Z)({
            p: e.value.style.chart.legend.prefix + (e.value.style.chart.legend.showPlusSymbol && f.value > 0 ? "+" : ""),
            v: f.value,
            s: e.value.style.chart.legend.suffix,
            r: e.value.style.chart.legend.roundingValue
          })
        )), 9, Yt)) : h("", !0),
        w(t.$slots, "svg", { svg: l.value }, void 0, !0)
      ], 14, ot)) : h("", !0),
      t.$slots.watermark ? (o(), u("div", It, [
        w(t.$slots, "watermark", D(B({ isPrinting: i(ue) || i(ne) })), void 0, !0)
      ])) : h("", !0),
      Y.value ? h("", !0) : (o(), R(Ke, {
        key: 6,
        config: {
          type: "gauge",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            gauge: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      g("div", {
        ref_key: "chartLegend",
        ref: ee
      }, [
        w(t.$slots, "legend", { legend: z.value }, void 0, !0)
      ], 512),
      t.$slots.source ? (o(), u("div", {
        key: 7,
        ref_key: "source",
        ref: te,
        dir: "auto"
      }, [
        w(t.$slots, "source", {}, void 0, !0)
      ], 512)) : h("", !0)
    ], 46, st));
  }
}, qt = /* @__PURE__ */ lt(At, [["__scopeId", "data-v-2c21fd75"]]);
export {
  qt as default
};
