import { computed as p, ref as y, watch as oe, onMounted as re, onBeforeUnmount as Le, openBlock as o, createElementBlock as r, normalizeClass as ne, normalizeStyle as V, createBlock as S, createCommentVNode as g, unref as d, createSlots as ze, withCtx as _, renderSlot as C, normalizeProps as ue, guardReactiveProps as ie, createVNode as Xe, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as L, createTextVNode as ce, nextTick as Se } from "vue";
import { u as Ne, c as de, t as Ae, o as Te, e as ve, g as Pe, v as he, C as Ge, f as z, X as ye, i as E, l as be, h as fe, q as De, r as Ie } from "./index-DK7qqHGP.js";
import { t as Me, u as Fe } from "./useResponsive-NZB-WLRF.js";
import { _ as Oe } from "./Title-Cxlu3Etv.js";
import { u as Ve, U as Ee } from "./usePrinter-Cza87yNE.js";
import { D as He } from "./DataTable-B9SSwFM2.js";
import We from "./vue-ui-skeleton-CQnYuosp.js";
import { L as Re } from "./Legend-D4PxDNTf.js";
import Be from "./vue-ui-accordion-5C4CP3gA.js";
import { u as ge } from "./useNestedProp-0nRX_rTi.js";
import { _ as Ue } from "./PackageVersion-I1_4jcn_.js";
import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const qe = ["id"], Ye = ["xmlns", "viewBox"], Ze = { key: 0 }, Je = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ke = { key: 1 }, Qe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], tt = { key: 2 }, lt = ["x", "y", "font-size", "fill", "font-weight"], at = ["x", "y", "font-size", "fill"], st = { key: 3 }, ot = ["x", "y", "font-size", "fill", "font-weight"], rt = ["id"], nt = ["stop-color"], ut = ["stop-color"], it = ["stop-color"], ct = ["id"], dt = ["stop-color"], vt = ["stop-color"], ht = ["stop-color"], yt = ["id"], bt = ["stop-color"], ft = ["stop-color"], gt = ["id"], mt = ["stop-color"], pt = ["stop-color"], _t = { key: 0 }, xt = ["d", "fill"], kt = { key: 1 }, Ct = ["x", "y", "height", "width", "fill"], wt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], $t = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Lt = { key: 2 }, zt = ["x", "y", "fill", "font-size"], Xt = { key: 3 }, St = ["x", "y", "fill", "font-size"], Nt = {
  key: 3,
  class: "vue-data-ui-watermark"
}, At = ["xmlns", "height", "width"], Tt = ["fill"], Pt = ["innerHTML"], Gt = {
  __name: "vue-ui-dumbbell",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectDatapoint"],
  setup(me, { expose: pe, emit: Dt }) {
    const m = me, { vue_ui_dumbbell: _e } = Ne(), X = p({
      get() {
        return !!m.dataset && m.dataset.length;
      },
      set(l) {
        return l;
      }
    }), h = y(de()), H = y(0), T = y(null), W = y(null), R = y(null), B = y(0), U = y(0), j = y(0), e = p({
      get: () => q(),
      set: (l) => l
    });
    function q() {
      const l = ge({
        userConfig: m.config,
        defaultConfig: _e
      });
      return l.theme ? {
        ...ge({
          userConfig: Ae.vue_ui_dumbbell[l.theme] || m.config,
          defaultConfig: l
        })
      } : l;
    }
    oe(() => m.config, (l) => {
      e.value = q(), Y(), B.value += 1, U.value += 1, j.value += 1, v.value = e.value.style.chart.rowHeight, N.value = e.value.style.chart.width;
    }, { deep: !0 }), oe(() => m.dataset, (l) => {
      te();
    }, { deep: !0 });
    const P = y(null);
    re(() => {
      Y();
    });
    function Y() {
      if (Te(m.dataset) ? ve({
        componentName: "VueUiDumbbell",
        type: "dataset"
      }) : m.dataset.forEach((l, u) => {
        Pe({
          datasetObject: l,
          requiredAttributes: ["name", "start", "end"]
        }).forEach((t) => {
          X.value = !1, ve({
            componentName: "VueUiDumbbell",
            type: "datasetSerieAttribute",
            property: t,
            index: u
          });
        });
      }), e.value.responsive) {
        const l = Me(() => {
          const { width: u, height: t } = Fe({
            chart: T.value,
            title: e.value.style.chart.title.text ? W.value : null,
            legend: e.value.style.chart.legend.show ? R.value : null
          });
          N.value = u, v.value = t / m.dataset.length, b.value = D();
        });
        P.value = new ResizeObserver(l), P.value.observe(T.value.parentNode);
      }
    }
    Le(() => {
      P.value && P.value.disconnect();
    });
    const { isPrinting: Z, isImaging: J, generatePdf: K, generateImage: Q } = Ve({
      elementId: `dumbbell_${h.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-dumbbell"
    }), G = y({
      showTable: e.value.table.show
    }), x = p(() => m.dataset.map((l, u) => ({
      ...l,
      start: he(l.start),
      end: he(l.end),
      id: de()
    }))), F = p(() => ({
      max: Math.max(...x.value.flatMap((l) => [l.start, l.end])),
      min: Math.min(...x.value.flatMap((l) => [l.start, l.end]))
    })), c = p(() => Ge(F.value.min < 0 ? F.value.min : 0, F.value.max, e.value.style.chart.grid.scaleSteps)), v = y(e.value.style.chart.rowHeight), N = y(e.value.style.chart.width), a = p(() => {
      const l = v.value, u = e.value.style.chart.padding.left + e.value.style.chart.padding.right + N.value, t = e.value.style.chart.padding.top + e.value.style.chart.padding.bottom + l * m.dataset.length, s = c.value.ticks.length * (N.value / c.value.ticks.length);
      return {
        left: e.value.style.chart.padding.left,
        right: u - e.value.style.chart.padding.right,
        top: e.value.style.chart.padding.top,
        bottom: t - e.value.style.chart.padding.bottom,
        width: N.value,
        height: l * m.dataset.length,
        rowHeight: l,
        absoluteHeight: t,
        absoluteWidth: u,
        widthPlotReference: s
      };
    });
    function D() {
      return x.value.map((l, u) => {
        const t = a.value.left + (l.start + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, s = a.value.left + (l.end + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, i = t + (s - t) / 2;
        return {
          ...l,
          startX: t,
          endX: s,
          centerX: i,
          y: a.value.top + u * v.value + v.value / 2,
          endVal: l.start
        };
      });
    }
    const b = y([]), ee = y(null), xe = p(() => x.value.map((l) => l.end).reduce((l, u) => l + u, 0));
    re(() => {
      te();
    });
    function te() {
      b.value = D();
      let l = b.value.map((t) => t.start).reduce((t, s) => t + s, 0);
      function u() {
        const t = x.value.map((s) => s.end - s.start);
        l >= xe.value ? (cancelAnimationFrame(ee.value), b.value = D()) : (b.value = b.value.map((s, i) => {
          s.endVal += t[i] * (e.value.animationSpeed / 100);
          const f = a.value.left + (s.start + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, M = a.value.left + (s.endVal + Math.abs(c.value.min)) / (c.value.max + Math.abs(c.value.min)) * a.value.widthPlotReference, O = f + (M - f) / 2;
          return {
            ...s,
            startX: f,
            endX: M,
            centerX: O,
            y: a.value.top + i * v.value + v.value / 2,
            endVal: s.endVal
          };
        }), l = b.value.map((s) => s.endVal).reduce((s, i) => s + i, 0), ee.value = requestAnimationFrame(u));
      }
      e.value.useAnimation ? u() : b.value = D();
    }
    const le = p(() => [
      { name: e.value.style.chart.legend.labelStart, color: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${h.value})` : e.value.style.chart.plots.startColor },
      { name: e.value.style.chart.legend.labelEnd, color: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${h.value})` : e.value.style.chart.plots.endColor }
    ]), ke = p(() => ({
      cy: "donut-div-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      paddingTop: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), k = p(() => {
      const l = b.value.map((t) => ({
        name: t.name
      })), u = b.value.map((t) => ({
        start: t.start,
        end: t.end
      }));
      return { head: l, body: u };
    }), I = p(() => {
      const l = [
        e.value.table.columnNames.series,
        e.value.table.columnNames.start,
        e.value.table.columnNames.end,
        e.value.table.columnNames.progression
      ], u = k.value.head.map((i, f) => {
        const M = z({
          p: e.value.style.chart.labels.prefix,
          v: k.value.body[f].start,
          s: e.value.style.chart.labels.suffix,
          r: e.value.table.td.roundingValue
        }), O = z({
          p: e.value.style.chart.labels.prefix,
          v: k.value.body[f].end,
          s: e.value.style.chart.labels.suffix,
          r: e.value.table.td.roundingValue
        }), $e = z({
          v: 100 * (k.value.body[f].end / k.value.body[f].start - 1),
          s: "%",
          r: e.value.table.td.roundingPercentage
        });
        return [
          { name: i.name },
          M,
          O,
          $e
        ];
      }), t = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return {
        colNames: [
          e.value.table.columnNames.series,
          e.value.table.columnNames.start,
          e.value.table.columnNames.end,
          e.value.table.columnNames.progression
        ],
        head: l,
        body: u,
        config: t
      };
    });
    function ae() {
      Se(() => {
        const l = k.value.head.map((s, i) => [[
          s.name
        ], [k.value.body[i].start], [k.value.body[i].end]]), u = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[e.value.table.columnNames.series], [e.value.table.columnNames.start], [e.value.table.columnNames.end]]].concat(l), t = De(u);
        Ie({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-dumbbell" });
      });
    }
    const A = y(!1);
    function Ce(l) {
      A.value = l, H.value += 1;
    }
    function we() {
      return b.value;
    }
    function se() {
      G.value.showTable = !G.value.showTable;
    }
    return pe({
      getData: we,
      generatePdf: K,
      generateCsv: ae,
      generateImage: Q,
      toggleTable: se
    }), (l, u) => (o(), r("div", {
      ref_key: "dumbbellChart",
      ref: T,
      class: ne(`vue-ui-dumbbell ${A.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      style: V(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
      id: `dumbbell_${h.value}`
    }, [
      e.value.style.chart.title.text ? (o(), r("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: W,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (o(), S(Oe, {
          key: `title_${B.value}`,
          config: {
            title: {
              cy: "donut-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "donut-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : g("", !0),
      e.value.userOptions.show && X.value ? (o(), S(Ee, {
        ref: "details",
        key: `user_option_${H.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: d(Z),
        isImaging: d(J),
        uid: h.value,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasXls: e.value.userOptions.buttons.csv,
        hasImg: e.value.userOptions.buttons.img,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: A.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: T.value,
        position: e.value.userOptions.position,
        onToggleFullscreen: Ce,
        onGeneratePdf: d(K),
        onGenerateCsv: ae,
        onGenerateImage: d(Q),
        onToggleTable: se
      }, ze({ _: 2 }, [
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: _(() => [
            C(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: _(() => [
            C(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: _(() => [
            C(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: _(() => [
            C(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: _(({ toggleFullscreen: t, isFullscreen: s }) => [
            C(l.$slots, "optionFullscreen", ue(ie({ toggleFullscreen: t, isFullscreen: s })), void 0, !0)
          ]),
          key: "4"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : g("", !0),
      X.value ? (o(), r("svg", {
        key: 2,
        xmlns: d(ye),
        class: ne({ "vue-data-ui-fullscreen--on": A.value, "vue-data-ui-fulscreen--off": !A.value }),
        viewBox: `0 0 ${a.value.absoluteWidth <= 0 ? 10 : a.value.absoluteWidth} ${a.value.absoluteHeight <= 0 ? 10 : a.value.absoluteHeight}`,
        style: V(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color}`)
      }, [
        Xe(Ue),
        e.value.style.chart.grid.verticalGrid.show ? (o(), r("g", Ze, [
          (o(!0), r(w, null, $(c.value.ticks, (t, s) => (o(), r("line", {
            x1: a.value.left + s * a.value.width / (c.value.ticks.length - 1),
            x2: a.value.left + s * a.value.width / (c.value.ticks.length - 1),
            y1: a.value.top,
            y2: a.value.bottom,
            stroke: e.value.style.chart.grid.verticalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.verticalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.verticalGrid.strokeDasharray
          }, null, 8, Je))), 256))
        ])) : g("", !0),
        e.value.style.chart.grid.horizontalGrid.show ? (o(), r("g", Ke, [
          (o(!0), r(w, null, $(x.value, (t, s) => (o(), r("line", {
            x1: a.value.left,
            x2: a.value.right,
            y1: a.value.top + s * v.value,
            y2: a.value.top + s * v.value,
            stroke: e.value.style.chart.grid.horizontalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.horizontalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.horizontalGrid.strokeDasharray
          }, null, 8, Qe))), 256)),
          n("line", {
            x1: a.value.left,
            x2: a.value.right,
            y1: a.value.bottom,
            y2: a.value.bottom,
            stroke: e.value.style.chart.grid.horizontalGrid.stroke,
            "stroke-width": e.value.style.chart.grid.horizontalGrid.strokeWidth,
            "stroke-dasharray": e.value.style.chart.grid.horizontalGrid.strokeDasharray
          }, null, 8, et)
        ])) : g("", !0),
        e.value.style.chart.labels.yAxisLabels.show ? (o(), r("g", tt, [
          (o(!0), r(w, null, $(x.value, (t, s) => (o(), r("text", {
            x: a.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
            y: a.value.top + s * v.value + (e.value.style.chart.labels.yAxisLabels.showProgression ? v.value / 3 : v.value / 2) + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
            "font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
            fill: e.value.style.chart.labels.yAxisLabels.color,
            "font-weight": e.value.style.chart.labels.yAxisLabels.bold ? "bold" : "normal",
            "text-anchor": "end"
          }, L(t.name), 9, lt))), 256)),
          e.value.style.chart.labels.yAxisLabels.showProgression ? (o(!0), r(w, { key: 0 }, $(x.value, (t, s) => (o(), r("text", {
            x: a.value.left - 6 + e.value.style.chart.labels.yAxisLabels.offsetX,
            y: a.value.top + s * v.value + v.value / 1.3 + e.value.style.chart.labels.yAxisLabels.fontSize / 3,
            "font-size": e.value.style.chart.labels.yAxisLabels.fontSize,
            fill: e.value.style.chart.labels.yAxisLabels.color,
            "text-anchor": "end"
          }, L(d(z)({
            v: 100 * (t.end / t.start - 1),
            s: "%",
            r: e.value.style.chart.labels.yAxisLabels.rounding
          })), 9, at))), 256)) : g("", !0)
        ])) : g("", !0),
        e.value.style.chart.labels.xAxisLabels.show ? (o(), r("g", st, [
          (o(!0), r(w, null, $(c.value.ticks, (t, s) => (o(), r("text", {
            x: a.value.left + s * (a.value.width / (c.value.ticks.length - 1)),
            y: a.value.bottom + e.value.style.chart.labels.xAxisLabels.fontSize + e.value.style.chart.labels.xAxisLabels.offsetY,
            "font-size": e.value.style.chart.labels.xAxisLabels.fontSize,
            fill: e.value.style.chart.labels.xAxisLabels.color,
            "font-weight": e.value.style.chart.labels.xAxisLabels.bold ? "bold" : "normal",
            "text-anchor": "middle"
          }, L(d(E)(
            e.value.style.chart.labels.formatter,
            t,
            d(z)({
              p: e.value.style.chart.labels.prefix,
              v: t,
              s: e.value.style.chart.labels.suffix,
              r: e.value.style.chart.labels.xAxisLabels.rounding
            }),
            { datapoint: t, seriesIndex: s }
          )), 9, ot))), 256))
        ])) : g("", !0),
        n("defs", null, [
          n("radialGradient", {
            id: `start_grad_${h.value}`,
            fy: "30%"
          }, [
            n("stop", {
              offset: "10%",
              "stop-color": d(be)(e.value.style.chart.plots.startColor, e.value.style.chart.plots.gradient.intensity / 100)
            }, null, 8, nt),
            n("stop", {
              offset: "90%",
              "stop-color": d(fe)(e.value.style.chart.plots.startColor, 0.1)
            }, null, 8, ut),
            n("stop", {
              offset: "100%",
              "stop-color": e.value.style.chart.plots.startColor
            }, null, 8, it)
          ], 8, rt),
          n("radialGradient", {
            id: `end_grad_${h.value}`,
            fy: "30%"
          }, [
            n("stop", {
              offset: "10%",
              "stop-color": d(be)(e.value.style.chart.plots.endColor, e.value.style.chart.plots.gradient.intensity / 100)
            }, null, 8, dt),
            n("stop", {
              offset: "90%",
              "stop-color": d(fe)(e.value.style.chart.plots.endColor, 0.1)
            }, null, 8, vt),
            n("stop", {
              offset: "100%",
              "stop-color": e.value.style.chart.plots.endColor
            }, null, 8, ht)
          ], 8, ct)
        ]),
        (o(!0), r(w, null, $(b.value, (t, s) => (o(), r("g", null, [
          n("defs", null, [
            n("linearGradient", {
              id: `grad_positive_${h.value}`,
              x1: "0%",
              x2: "100%",
              y1: "0%",
              y2: "0%"
            }, [
              n("stop", {
                offset: "0%",
                "stop-color": e.value.style.chart.plots.startColor
              }, null, 8, bt),
              n("stop", {
                offset: "100%",
                "stop-color": e.value.style.chart.plots.endColor
              }, null, 8, ft)
            ], 8, yt),
            n("linearGradient", {
              id: `grad_negative_${h.value}`,
              x1: "0%",
              x2: "100%",
              y1: "0%",
              y2: "0%"
            }, [
              n("stop", {
                offset: "0%",
                "stop-color": e.value.style.chart.plots.endColor
              }, null, 8, mt),
              n("stop", {
                offset: "100%",
                "stop-color": e.value.style.chart.plots.startColor
              }, null, 8, pt)
            ], 8, gt)
          ]),
          e.value.style.chart.plots.link.type === "curved" ? (o(), r("g", _t, [
            n("path", {
              d: `M 
                            ${t.startX},${t.y + e.value.style.chart.plots.radius / 2} 
                            C ${t.centerX},${t.y} ${t.centerX},${t.y} 
                            ${t.endX},${t.y + e.value.style.chart.plots.radius / 2}
                            L ${t.endX},${t.y - e.value.style.chart.plots.radius / 2}
                            C ${t.centerX},${t.y} ${t.centerX},${t.y}
                            ${t.startX},${t.y - e.value.style.chart.plots.radius / 2}
                            Z
                        `,
              fill: t.endX > t.startX ? `url(#grad_positive_${h.value})` : `url(#grad_negative_${h.value})`
            }, null, 8, xt)
          ])) : (o(), r("g", kt, [
            n("rect", {
              x: t.endX > t.startX ? t.startX : t.endX,
              y: t.y - e.value.style.chart.plots.link.strokeWidth / 2,
              height: e.value.style.chart.plots.link.strokeWidth,
              width: Math.abs(t.endX - t.startX),
              fill: t.endX > t.startX ? `url(#grad_positive_${h.value})` : `url(#grad_negative_${h.value})`
            }, null, 8, Ct)
          ])),
          n("circle", {
            cx: t.startX,
            cy: t.y,
            r: e.value.style.chart.plots.radius,
            fill: e.value.style.chart.plots.gradient.show ? `url(#start_grad_${h.value})` : e.value.style.chart.plots.startColor,
            stroke: e.value.style.chart.plots.stroke,
            "stroke-width": e.value.style.chart.plots.strokeWidth
          }, null, 8, wt),
          n("circle", {
            cx: t.endX,
            cy: t.y,
            r: e.value.style.chart.plots.radius,
            fill: e.value.style.chart.plots.gradient.show ? `url(#end_grad_${h.value})` : e.value.style.chart.plots.endColor,
            stroke: e.value.style.chart.plots.stroke,
            "stroke-width": e.value.style.chart.plots.strokeWidth
          }, null, 8, $t),
          e.value.style.chart.labels.startLabels.show ? (o(), r("g", Lt, [
            (o(!0), r(w, null, $(b.value, (i, f) => (o(), r("text", {
              x: i.startX,
              y: a.value.top + (f + 1) * v.value - e.value.style.chart.labels.startLabels.fontSize / 3 + e.value.style.chart.labels.startLabels.offsetY,
              fill: e.value.style.chart.labels.startLabels.useStartColor ? e.value.style.chart.plots.startColor : e.value.style.chart.labels.startLabels.color,
              "font-size": e.value.style.chart.labels.startLabels.fontSize,
              "text-anchor": "middle"
            }, L(d(E)(
              e.value.style.chart.labels.formatter,
              i.start,
              d(z)({
                p: e.value.style.chart.labels.prefix,
                v: i.start,
                s: e.value.style.chart.labels.suffix,
                r: e.value.style.chart.labels.startLabels.rounding
              }),
              { datapoint: i, seriesIndex: f }
            )), 9, zt))), 256))
          ])) : g("", !0),
          e.value.style.chart.labels.endLabels.show ? (o(), r("g", Xt, [
            (o(!0), r(w, null, $(b.value, (i, f) => (o(), r("text", {
              x: i.endX,
              y: a.value.top + f * v.value + e.value.style.chart.labels.endLabels.fontSize + e.value.style.chart.labels.endLabels.offsetY,
              fill: e.value.style.chart.labels.endLabels.useEndColor ? e.value.style.chart.plots.endColor : e.value.style.chart.labels.endLabels.color,
              "font-size": e.value.style.chart.labels.endLabels.fontSize,
              "text-anchor": "middle"
            }, L(d(E)(
              e.value.style.chart.labels.formatter,
              i.end,
              d(z)({
                p: e.value.style.chart.labels.prefix,
                v: i.end,
                s: e.value.style.chart.labels.suffix,
                r: e.value.style.chart.labels.endLabels.rounding
              }),
              { datapoint: i, seriesIndex: f }
            )), 9, St))), 256))
          ])) : g("", !0)
        ]))), 256)),
        C(l.$slots, "svg", { svg: a.value }, void 0, !0)
      ], 14, Ye)) : g("", !0),
      l.$slots.watermark ? (o(), r("div", Nt, [
        C(l.$slots, "watermark", ue(ie({ isPrinting: d(Z) || d(J) })), void 0, !0)
      ])) : g("", !0),
      X.value ? g("", !0) : (o(), S(We, {
        key: 4,
        config: {
          type: "dumbbell",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            dumbbell: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      n("div", {
        ref_key: "chartLegend",
        ref: R
      }, [
        e.value.style.chart.legend.show && X.value ? (o(), S(Re, {
          key: `legend_${j.value}`,
          legendSet: le.value,
          config: ke.value
        }, {
          item: _(({ legend: t }) => [
            n("div", {
              style: V(`display:flex;align-items:center;gap:4px;font-size:${e.value.style.chart.legend.fontSize}px`)
            }, [
              (o(), r("svg", {
                xmlns: d(ye),
                viewBox: "0 0 20 20",
                height: e.value.style.chart.legend.fontSize,
                width: e.value.style.chart.legend.fontSize
              }, [
                n("circle", {
                  cx: 10,
                  cy: 10,
                  r: 9,
                  fill: t.color
                }, null, 8, Tt)
              ], 8, At)),
              ce(" " + L(t.name), 1)
            ], 4)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : C(l.$slots, "legend", {
          key: 1,
          legend: le.value
        }, void 0, !0)
      ], 512),
      X.value ? (o(), S(Be, {
        key: 5,
        hideDetails: "",
        config: {
          open: G.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          },
          head: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          }
        }
      }, {
        content: _(() => [
          (o(), S(He, {
            key: `table_${U.value}`,
            colNames: I.value.colNames,
            head: I.value.head,
            body: I.value.body,
            config: I.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: u[0] || (u[0] = (t) => G.value.showTable = !1)
          }, {
            th: _(({ th: t }) => [
              n("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, Pt)
            ]),
            td: _(({ td: t }) => [
              ce(L(t.name || t), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : g("", !0)
    ], 14, qe));
  }
}, qt = /* @__PURE__ */ je(Gt, [["__scopeId", "data-v-2df541ce"]]);
export {
  qt as default
};
