import { ref as z, computed as M, watch as Ne, onMounted as bt, onBeforeUnmount as wt, nextTick as $e, openBlock as a, createElementBlock as l, normalizeClass as re, normalizeStyle as R, createBlock as Ie, createCommentVNode as f, unref as g, createSlots as At, withCtx as Q, renderSlot as U, normalizeProps as H, guardReactiveProps as se, toDisplayString as O, createVNode as ve, createElementVNode as A, Fragment as p, renderList as L, mergeProps as Fe, pushScopeId as _t, popScopeId as zt } from "vue";
import { u as Lt, c as Ct, t as $t, a as It, p as V, C as lt, b as Et, J as Pt, e as Tt, d as Me, m as Ot, D as ot, X as Rt, j as Nt, k as xe, n as Ue, i as X, f as B, R as it, v as Z, x as Ee, y as Be } from "./index-BbPeL8Gp.js";
import { t as Ft, u as Mt } from "./useResponsive-CoxXLe23.js";
import Pe from "./BaseIcon-CmiukQBl.js";
import { _ as Ut } from "./Tooltip-smutPF--.js";
import { u as Bt, U as Dt } from "./usePrinter-DaybDVqP.js";
import { S as Vt } from "./Slicer-Cxdl3cDt.js";
import qt from "./vue-ui-skeleton-Bniq21d9.js";
import { u as ut } from "./useNestedProp-BN8claGG.js";
import { _ as Wt } from "./PackageVersion-CxJghxYD.js";
import { P as jt } from "./PenAndPaper-ZdZEumki.js";
import { _ as Gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const _ = {
  LINE: "LINE",
  BAR: "BAR",
  DONUT: "DONUT"
}, Ht = ["SERIE", "SERIES", "DATA", "VALUE", "VALUES", "NUM"];
function Xt({ dataset: v, barLineSwitch: I = 6 }) {
  let m = null, C = null, q = 0;
  if ((typeof v == "number" || typeof v == "string") && console.warn(`The provided dataset (${v}) is not sufficient to build a chart`), ye(v) && (Y(v) && (v.length < I ? m = _.BAR : m = _.LINE, C = v, q = v.length), Te(v))) {
    if (!Yt(v))
      return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."), !1;
    const oe = Object.keys(v[0]), de = Object.values(v[0]);
    if (!oe.some((P) => Jt(P)))
      return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."), !1;
    nt(de, (P) => typeof P == "number") && (m = _.DONUT, C = v), nt(de, (P) => Array.isArray(P) && Y(P)) && (rt(v) > I ? m = _.LINE : m = _.BAR, q = rt(v), C = v.map((P) => ({
      ...P,
      data: Qt(P, (G) => Y(G))
    }))), v = v.map((P) => st(P)), C = C.map((P) => st(P));
  }
  return ye(v) && [...new Set(v.flatMap((oe) => Array.isArray(oe)))][0], {
    dataset: v,
    type: m,
    usableDataset: C,
    maxSeriesLength: q
  };
}
function vt(v) {
  return !v || ye(v) && !v.length;
}
function ye(v) {
  return Array.isArray(v);
}
function Y(v) {
  if (!ye(v) || vt(v)) return !1;
  const I = v.map((m) => Number(m));
  return ![...new Set(I.flatMap((m) => typeof m == "number" && !isNaN(m)))].includes(!1);
}
function Te(v) {
  return !ye(v) || vt(v) || !![...new Set(v.flatMap((m) => typeof m == "object" && !Array.isArray(m)))].includes(!1) ? !1 : !v.map((m) => Object.keys(m).length > 0).includes(!1);
}
function Zt(v, I) {
  const m = Object.keys(v).sort(), C = Object.keys(I).sort();
  if (m.length !== C.length)
    return !1;
  for (let q = 0; q < m.length; q += 1) {
    const W = m[q], le = C[q];
    if (W !== le || typeof v[W] != typeof I[le])
      return !1;
  }
  return !0;
}
function Yt(v) {
  if (v.length <= 1) return !0;
  for (let I = 0; I < v.length; I += 1)
    for (let m = I + 1; m < v.length; m += 1)
      if (!Zt(v[I], v[m]))
        return !1;
  return !0;
}
function Jt(v) {
  return Ht.includes(v.toUpperCase());
}
function nt(v, I) {
  let m = [];
  for (let C = 0; C < v.length; C += 1)
    m.push(I(v[C]));
  return m.includes(!0);
}
function rt(v) {
  return Math.max(...[...v].flatMap((I) => Object.values(I).filter((m) => Y(m)).map((m) => m.length)));
}
function Qt(v, I) {
  return Object.values(v).filter((m) => I(m))[0];
}
function st(v) {
  const I = {};
  for (let m in v)
    v.hasOwnProperty(m) && (I[m.toUpperCase()] = v[m]);
  return I;
}
const dt = (v) => (_t("data-v-c31c33da"), v = v(), zt(), v), Kt = ["id"], ea = ["xmlns", "viewBox"], ta = ["id"], aa = ["id"], la = /* @__PURE__ */ dt(() => /* @__PURE__ */ A("feColorMatrix", {
  type: "saturate",
  values: "0"
}, null, -1)), oa = ["id"], ia = ["flood-color"], ua = {
  key: 0,
  class: "donut-label-connectors"
}, na = ["d", "stroke", "stroke-width", "filter"], ra = ["cx", "cy", "r", "fill", "filter"], sa = { class: "donut" }, va = ["d", "fill", "stroke", "stroke-width", "filter"], da = ["d", "onMouseenter", "onClick"], ca = {
  key: 1,
  class: "donut-labels quick-animation"
}, ha = ["cx", "cy", "fill", "stroke", "filter"], fa = ["text-anchor", "x", "y", "fill", "font-size", "filter"], ga = ["text-anchor", "x", "y", "fill", "font-size", "filter"], ma = {
  key: 2,
  class: "donut-hollow quick-animation"
}, pa = ["x", "y", "font-size", "fill"], xa = ["x", "y", "font-size", "fill"], ya = {
  key: 0,
  class: "line-grid"
}, ka = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Sa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ba = {
  key: 1,
  class: "line-axis"
}, wa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Aa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _a = {
  key: 2,
  class: "yLabels"
}, za = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], La = ["x", "y", "font-size", "fill"], Ca = {
  key: 3,
  class: "periodLabels"
}, $a = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ia = ["font-size", "text-anchor", "fill", "transform"], Ea = { class: "plots" }, Pa = { class: "line-plot-series" }, Ta = ["d", "stroke", "stroke-width"], Oa = ["d", "stroke", "stroke-width"], Ra = ["d", "stroke", "stroke-width"], Na = ["d", "stroke", "stroke-width"], Fa = ["cx", "cy", "fill", "stroke"], Ma = {
  key: 4,
  class: "dataLabels"
}, Ua = ["font-size", "fill", "x", "y"], Ba = { class: "tooltip-traps" }, Da = ["x", "y", "height", "width", "fill", "onMouseenter", "onClick"], Va = {
  key: 0,
  class: "line-grid"
}, qa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Wa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ja = {
  key: 1,
  class: "line-axis"
}, Ga = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ha = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Xa = {
  key: 2,
  class: "yLabels"
}, Za = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ya = ["x", "y", "font-size", "fill"], Ja = {
  key: 3,
  class: "periodLabels"
}, Qa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ka = ["font-size", "text-anchor", "transform", "fill"], el = { class: "plots" }, tl = ["x", "width", "height", "y", "fill", "stroke", "stroke-width"], al = ["to"], ll = ["from", "to"], ol = {
  key: 4,
  class: "dataLabels"
}, il = ["x", "y", "font-size", "fill"], ul = { class: "tooltip-traps" }, nl = ["x", "y", "height", "width", "fill", "onMouseenter", "onClick"], rl = {
  key: 3,
  class: "axis-labels"
}, sl = { key: 0 }, vl = ["font-size", "fill", "x", "y"], dl = { key: 1 }, cl = ["font-size", "fill", "x", "y"], hl = { key: 2 }, fl = ["font-size", "fill", "transform"], gl = { key: 3 }, ml = ["font-size", "fill", "transform"], pl = {
  key: 6,
  class: "vue-data-ui-watermark"
}, xl = ["onClick"], yl = ["onClick"], kl = ["onClick"], Sl = {
  key: 1,
  class: "vue-ui-quick-chart-not-processable"
}, bl = /* @__PURE__ */ dt(() => /* @__PURE__ */ A("span", null, "Dataset is not processable", -1)), wl = {
  __name: "vue-ui-quick-chart",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: [Array, Object, String, Number],
      default() {
        return null;
      }
    }
  },
  emits: ["selectDatapoint", "selectLegend"],
  setup(v, { expose: I, emit: m }) {
    const C = v, { vue_ui_quick_chart: q } = Lt(), W = z(null), le = z(null), oe = z(null), de = z(null), P = z(Ct()), G = z(!1), ce = z(null), K = z(""), j = z(null), De = z(null), Ve = z(null), w = z([]), qe = z(0), ke = z(0), e = M({
      get: () => Ge(),
      set: (u) => u
    }), ct = M(() => e.value.showUserOptionsOnChartHover), We = M(() => e.value.keepUserOptionsStateOnChartLeave), Se = z(!e.value.showUserOptionsOnChartHover);
    function je(u = !1) {
      ct.value && (Se.value = u);
    }
    function Ge() {
      const u = ut({
        userConfig: C.config,
        defaultConfig: q
      });
      let s = {};
      return u.theme ? s = {
        ...ut({
          userConfig: $t.vue_ui_quick_chart[u.theme] || C.config,
          defaultConfig: u
        }),
        customPalette: It[u.theme] || V
      } : s = u, C.config && lt(C.config, "zoomStartIndex") ? s.zoomStartIndex = C.config.zoomStartIndex : s.zoomStartIndex = null, C.config && lt(C.config, "zoomEndIndex") ? s.zoomEndIndex = C.config.zoomEndIndex : s.zoomEndIndex = null, s;
    }
    Ne(() => C.config, (u) => {
      e.value = Ge(), b.value.width = e.value.width, b.value.height = e.value.height, Se.value = !e.value.showUserOptionsOnChartHover, Ze();
    }, { deep: !0 }), Ne(() => C.dataset, (u) => {
      x.value = fe.value, k.value.start = 0, k.value.end = x.value.maxSeriesLength, ke.value += 1;
    }, { deep: !0 });
    const he = M(() => Et(e.value.customPalette)), fe = M(() => {
      const u = Xt({ dataset: Pt(C.dataset, [
        "serie",
        "series",
        "data",
        "value",
        "values",
        "num"
      ]), barLineSwitch: e.value.chartIsBarUnderDatasetLength });
      return u || console.error("VueUiQuickChart : Dataset is not processable"), u;
    }), x = z(fe.value), ht = M(() => !!x.value), $ = M(() => x.value ? x.value.type : null);
    Ne(() => $.value, (u) => {
      u || Tt({
        componentName: "VueUiQuickChart",
        type: "dataset"
      });
    }, { immediate: !0 });
    const { isPrinting: be, isImaging: we, generatePdf: He, generateImage: Xe } = Bt({
      elementId: `${$.value}_${P.value}`,
      fileName: e.value.title || $.value
    }), ft = M(() => e.value.showUserOptions && !e.value.title), b = z({
      width: e.value.width,
      height: e.value.height
    }), Ae = z({
      showTooltip: e.value.showTooltip
    }), _e = z(null);
    bt(() => {
      Ze();
    });
    function Ze() {
      if (e.value.responsive) {
        const u = Ft(() => {
          const { width: s, height: t } = Mt({
            chart: W.value,
            title: e.value.title ? le.value : null,
            legend: e.value.showLegend ? oe.value : null,
            slicer: [_.BAR, _.LINE].includes($.value) && e.value.zoomXy && x.value.maxSeriesLength > 1 ? de.value : null,
            source: De.value,
            noTitle: Ve.value
          });
          b.value.width = s, b.value.height = t;
        });
        _e.value = new ResizeObserver(u), _e.value.observe(W.value.parentNode);
      }
      tt();
    }
    wt(() => {
      _e.value && _e.value.disconnect();
    });
    const gt = M(() => {
      switch ($.value) {
        case _.LINE:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
        case _.BAR:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
        case _.DONUT:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
        default:
          return `0 0 ${b.value.width <= 0 ? 10 : b.value.width} ${b.value.height <= 0 ? 10 : b.value.height}`;
      }
    });
    function Ye(u) {
      return [...u].map((s) => s.value).reduce((s, t) => s + t, 0);
    }
    function ge(u) {
      return e.value.blurOnHover && ![null, void 0].includes(j.value) && j.value !== u ? `url(#blur_${P.value})` : "";
    }
    function Je(u, s) {
      w.value.includes(u) ? w.value = w.value.filter((t) => t !== u) : w.value.length < s && w.value.push(u);
    }
    const Qe = z(null), Ke = z(null), ze = z(!1);
    function mt(u, s) {
      ze.value = !0;
      let t = u.value;
      if (w.value.includes(u.id)) {
        let r = function() {
          t > n ? (ze.value = !1, cancelAnimationFrame(Ke.value), x.value = {
            ...x.value,
            dataset: x.value.dataset.map((h, N) => u.id === `donut_${N}` ? {
              ...h,
              value: n,
              VALUE: n
            } : h)
          }) : (t += n * 0.025, x.value = {
            ...x.value,
            dataset: x.value.dataset.map((h, N) => u.id === `donut_${N}` ? {
              ...h,
              value: t,
              VALUE: t
            } : h)
          }, Ke.value = requestAnimationFrame(r));
        };
        w.value = w.value.filter((h) => h !== u.id);
        const n = fe.value.dataset.find((h, N) => u.id === `donut_${N}`).VALUE;
        r();
      } else if (s.length > 1) {
        let n = function() {
          t < 0.1 ? (ze.value = !1, cancelAnimationFrame(Qe.value), w.value.push(u.id), x.value = {
            ...x.value,
            dataset: x.value.dataset.map((r, h) => u.id === `donut_${h}` ? {
              ...r,
              value: 0,
              VALUE: 0
            } : r)
          }) : (t /= 1.1, x.value = {
            ...x.value,
            dataset: x.value.dataset.map((r, h) => u.id === `donut_${h}` ? {
              ...r,
              value: t,
              VALUE: t
            } : r)
          }, Qe.value = requestAnimationFrame(n));
        };
        n();
      }
    }
    const J = z(null);
    function pt(u) {
      J.value = u;
    }
    const et = M(() => e.value.donutThicknessRatio < 0.15 ? 0.15 : e.value.donutThicknessRatio > 0.4 ? 0.4 : e.value.donutThicknessRatio), E = M(() => {
      if ($.value !== _.DONUT) return null;
      const u = x.value.dataset.map((o, i) => ({
        ...o,
        value: o.VALUE || o.DATA || o.SERIE || o.VALUES || o.NUM || 0,
        name: o.NAME || o.DESCRIPTION || o.TITLE || o.LABEL || `Serie ${i}`,
        id: `donut_${i}`
      })).map((o, i) => ({
        ...o,
        color: o.COLOR ? Me(o.COLOR) : he.value[i + e.value.paletteStartIndex] || V[i + e.value.paletteStartIndex] || V[(i + e.value.paletteStartIndex) % V.length],
        immutableValue: o.value
      }));
      function s(o, i) {
        return B({
          v: isNaN(o.value / Ye(i)) ? 0 : o.value / Ye(i) * 100,
          s: "%",
          r: e.value.dataLabelRoundingPercentage
        });
      }
      function t(o) {
        return o.proportion * 100 > e.value.donutHideLabelUnderPercentage;
      }
      function n(o, i) {
        const S = fe.value.dataset.find((T, F) => `donut_${F}` === o).VALUE;
        return Math.abs(String(Number(S.toFixed(0))).length - String(Number(i.toFixed(0))).length);
      }
      function r({ datapoint: o, seriesIndex: i }) {
        ce.value = { datapoint: o, seriesIndex: i, config: e.value, dataset: u }, j.value = o.id;
        const S = e.value.tooltipCustomFormat;
        if (Ee(S) && Be(() => S({
          datapoint: o,
          seriesIndex: i,
          series: u,
          config: e.value
        })))
          K.value = S({
            datapoint: o,
            seriesIndex: i,
            series: u,
            config: e.value
          });
        else {
          let y = "";
          y += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`, y += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${o.color}"/></svg>`, y += `<b>${X(
            e.value.formatter,
            o.value,
            B({
              p: e.value.valuePrefix,
              v: o.value,
              s: e.value.valueSuffix,
              r: e.value.dataLabelRoundingValue
            }),
            { datapoint: o, seriesIndex: i }
          )}</b>`, y += `<span>(${B({ v: o.proportion * 100, s: "%", r: e.value.dataLabelRoundingPercentage })})</span></div>`, K.value = `<div>${y}</div>`;
        }
        G.value = !0;
      }
      function h() {
        G.value = !1, j.value = null, J.value = null;
      }
      const N = {
        centerX: b.value.width / 2,
        centerY: b.value.height / 2
      }, D = u.filter((o) => !w.value.includes(o.id)).map((o) => o.value || 0).reduce((o, i) => o + i, 0), ue = u.map((o, i) => ({
        ...o,
        proportion: (o.value || 0) / D,
        value: o.value || 0,
        absoluteValue: fe.value.dataset.find((S, y) => `donut_${y}` === o.id).VALUE
      })), ee = b.value.width / 2, ne = b.value.height / 2, te = b.value.height * e.value.donutRadiusRatio;
      return {
        dataset: ue.filter((o) => !w.value.includes(o.id)),
        legend: ue,
        drawingArea: N,
        displayArcPercentage: s,
        isArcBigEnough: t,
        useTooltip: r,
        killTooltip: h,
        getSpaces: n,
        total: D,
        cx: ee,
        cy: ne,
        radius: te,
        chart: Ot(
          { series: u.filter((o) => !w.value.includes(o.id)) },
          ee,
          ne,
          te,
          te,
          1.99999,
          2,
          1,
          360,
          105.25,
          b.value.height * et.value
        )
      };
    }), k = z({
      start: 0,
      end: x.value.maxSeriesLength
    });
    function xt() {
      tt();
    }
    const ie = z(null);
    async function tt() {
      (e.value.zoomStartIndex !== null || e.value.zoomEndIndex !== null) && ie.value ? (e.value.zoomStartIndex !== null && (await $e(), await $e(), ie.value && ie.value.setStartValue(e.value.zoomStartIndex)), e.value.zoomEndIndex !== null && (await $e(), await $e(), ie.value && ie.value.setEndValue(yt(e.value.zoomEndIndex + 1)))) : (k.value = {
        start: 0,
        end: x.value.maxSeriesLength
      }, ke.value += 1);
    }
    function yt(u) {
      const s = x.value.maxSeriesLength;
      return u > s ? s : u < 0 || e.value.zoomStartIndex !== null && u < e.value.zoomStartIndex ? e.value.zoomStartIndex !== null ? e.value.zoomStartIndex + 1 : 1 : u;
    }
    const kt = M(() => {
      if (!e.value.zoomMinimap.show || $.value === _.DONUT) return [];
      let u = [];
      Y(x.value.dataset) && (u = x.value.dataset), Te(x.value.dataset) && (u = x.value.dataset.map((r, h) => ({
        values: r.VALUE || r.DATA || r.SERIE || r.SERIES || r.VALUES || r.NUM || 0,
        id: $.value === _.LINE ? `line_${h}` : `bar_${h}`
      })).filter((r) => !w.value.includes(r.id)));
      const s = Y(u) ? u.length : Math.max(...u.map((r) => r.values.length));
      let t = [];
      if (Y(u))
        t = u;
      else
        for (let r = 0; r < s; r += 1)
          t.push(u.map((h) => h.values[r] || 0).reduce((h, N) => (h || 0) + (N || 0), 0));
      const n = Math.min(...t);
      return t.map((r) => r + (n < 0 ? Math.abs(n) : 0));
    }), c = M(() => {
      if ($.value !== _.LINE) return null;
      const u = {
        height: b.value.height,
        width: b.value.width
      }, s = {
        left: e.value.xyPaddingLeft,
        top: e.value.xyPaddingTop,
        right: u.width - e.value.xyPaddingRight,
        bottom: u.height - e.value.xyPaddingBottom,
        width: u.width - e.value.xyPaddingLeft - e.value.xyPaddingRight,
        height: u.height - e.value.xyPaddingTop - e.value.xyPaddingBottom
      };
      let t = [];
      Y(x.value.dataset) && (t = [
        {
          values: x.value.dataset.slice(k.value.start, k.value.end),
          absoluteIndices: x.value.dataset.map((o, i) => i).slice(k.value.start, k.value.end),
          name: e.value.title,
          color: he.value[e.value.paletteStartIndex] || V[e.value.paletteStartIndex],
          id: "line_0"
        }
      ]), Te(x.value.dataset) && (t = x.value.dataset.map((o, i) => ({
        ...o,
        values: o.VALUE || o.DATA || o.SERIE || o.SERIES || o.VALUES || o.NUM || 0,
        name: o.NAME || o.DESCRIPTION || o.TITLE || o.LABEL || `Serie ${i}`,
        id: `line_${i}`
      })).map((o, i) => ({
        ...o,
        color: o.COLOR ? Me(o.COLOR) : he.value[i + e.value.paletteStartIndex] || V[i + e.value.paletteStartIndex] || V[(i + e.value.paletteStartIndex) % V.length],
        values: o.values.slice(k.value.start, k.value.end),
        absoluteIndices: o.values.map((S, y) => y).slice(k.value.start, k.value.end)
      })));
      const n = {
        max: Math.max(...t.filter((o) => !w.value.includes(o.id)).flatMap((o) => o.values)),
        min: Math.min(...t.filter((o) => !w.value.includes(o.id)).flatMap((o) => o.values)),
        maxSeries: Math.max(...t.map((o) => o.values.length))
      }, r = ot(n.min < 0 ? n.min : 0, n.max < 0 ? 0 : n.max, e.value.xyScaleSegments), h = n.min < 0 ? Math.abs(n.min) : 0, N = n.max < 0 ? s.top : s.bottom - h / (r.max + h) * s.height, D = s.width / n.maxSeries, ue = r.ticks.map((o) => ({
        y: s.bottom - s.height * ((o + h) / (r.max + h)),
        x: s.left - 8,
        value: o
      })), ee = t.map((o, i) => ({
        ...o,
        coordinates: o.values.map((S, y) => ({
          x: s.left + D * (y + 1) - D / 2,
          y: s.bottom - (S + h) / (r.max + h) * s.height,
          value: S
        }))
      })).map((o) => {
        let i = [];
        return o.coordinates.forEach((S) => {
          i.push(`${S.x},${S.y} `);
        }), {
          ...o,
          linePath: i.join(" ")
        };
      });
      function ne(o) {
        j.value = o, J.value = o;
        const i = t.map((y) => ({
          ...y,
          value: y.values[o],
          absoluteIndex: y.absoluteIndices[o]
        })).filter((y) => !w.value.includes(y.id));
        ce.value = { datapoint: i, seriesIndex: o, config: e.value, dataset: t };
        const S = e.value.tooltipCustomFormat;
        if (Ee(S) && Be(() => S({
          datapoint: i,
          seriesIndex: o,
          series: t,
          config: e.value
        })))
          K.value = S({
            datapoint: i,
            seriesIndex: o,
            series: t,
            config: e.value
          });
        else {
          let y = "";
          e.value.xyPeriods[i[0].absoluteIndex] && (y += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${e.value.xyPeriods[i[0].absoluteIndex]}</div>`), i.forEach((T, F) => {
            y += `
                    <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
                        <svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${T.color}"/></svg>
                        <span>${T.name}:</span>
                        <b>${X(
              e.value.formatter,
              T.value,
              B({
                p: e.value.valuePrefix,
                v: T.value,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: T, seriesIndex: F }
            )}
                        </b>
                    </div>
                `;
          }), K.value = y;
        }
        G.value = !0;
      }
      function te() {
        j.value = null, G.value = !1;
      }
      return {
        absoluteZero: N,
        dataset: ee.filter((o) => !w.value.includes(o.id)),
        legend: ee,
        drawingArea: s,
        extremes: n,
        slotSize: D,
        yLabels: ue,
        useTooltip: ne,
        killTooltip: te
      };
    }), d = M(() => {
      if ($.value !== _.BAR) return null;
      const u = {
        height: b.value.height,
        width: b.value.width
      }, s = {
        left: e.value.xyPaddingLeft,
        top: e.value.xyPaddingTop,
        right: u.width - e.value.xyPaddingRight,
        bottom: u.height - e.value.xyPaddingBottom,
        width: u.width - e.value.xyPaddingLeft - e.value.xyPaddingRight,
        height: u.height - e.value.xyPaddingTop - e.value.xyPaddingBottom
      };
      let t = [];
      Y(x.value.dataset) && (t = [
        {
          values: x.value.dataset.slice(k.value.start, k.value.end),
          absoluteIndices: x.value.dataset.map((i, S) => S).slice(k.value.start, k.value.end),
          name: e.value.title,
          color: he.value[e.value.paletteStartIndex] || V[e.value.paletteStartIndex],
          id: "bar_0"
        }
      ]), Te(x.value.dataset) && (t = x.value.dataset.map((i, S) => ({
        ...i,
        values: i.VALUE || i.DATA || i.SERIE || i.SERIES || i.VALUES || i.NUM || 0,
        name: i.NAME || i.DESCRIPTION || i.TITLE || i.LABEL || `Serie ${S}`,
        id: `bar_${S}`
      })).map((i, S) => ({
        ...i,
        color: i.COLOR ? Me(i.COLOR) : he.value[S + e.value.paletteStartIndex] || V[S + e.value.paletteStartIndex] || V[(S + e.value.paletteStartIndex) % V.length],
        values: i.values.slice(k.value.start, k.value.end),
        absoluteIndices: i.values.map((y, T) => T).slice(k.value.start, k.value.end)
      })));
      const n = {
        max: Math.max(...t.filter((i) => !w.value.includes(i.id)).flatMap((i) => i.values)) < 0 ? 0 : Math.max(...t.filter((i) => !w.value.includes(i.id)).flatMap((i) => i.values)),
        min: Math.min(...t.filter((i) => !w.value.includes(i.id)).flatMap((i) => i.values)),
        maxSeries: Math.max(...t.filter((i) => !w.value.includes(i.id)).map((i) => i.values.length))
      }, r = ot(n.min < 0 ? n.min : 0, n.max, e.value.xyScaleSegments), h = r.min < 0 ? Math.abs(r.min) : 0, N = s.bottom - h / (r.max + h) * s.height, D = s.width / n.maxSeries, ue = r.ticks.map((i) => ({
        y: s.bottom - s.height * ((i + h) / (r.max + h)),
        x: s.left - 8,
        value: i
      })), ee = t.map((i, S) => ({
        ...i,
        coordinates: i.values.map((y, T) => {
          const F = (y + h) / (n.max + h) * s.height, me = Math.abs(y) / Math.abs(n.min) * (s.height - N), Re = h / (n.max + h) * s.height, pe = D / t.filter((ae) => !w.value.includes(ae.id)).length - e.value.barGap / t.filter((ae) => !w.value.includes(ae.id)).length;
          return {
            x: s.left + D * T + pe * S + e.value.barGap / 2,
            y: y > 0 ? s.bottom - F : N,
            height: y > 0 ? F - Re : me,
            value: y,
            width: pe
          };
        })
      })), ne = t.filter((i) => !w.value.includes(i.id)).map((i, S) => ({
        ...i,
        coordinates: i.values.map((y, T) => {
          const F = (y + h) / (n.max + h) * s.height, me = Math.abs(y) / (n.max + h) * s.height, Re = h / (n.max + h) * s.height, pe = D / t.filter((ae) => !w.value.includes(ae.id)).length - e.value.barGap / t.filter((ae) => !w.value.includes(ae.id)).length;
          return {
            x: s.left + D * T + pe * S + e.value.barGap / 2,
            y: y > 0 ? s.bottom - F : N,
            height: y > 0 ? F - Re : me,
            value: y,
            width: pe
          };
        })
      }));
      function te(i) {
        j.value = i, J.value = i;
        const S = t.map((T) => ({
          ...T,
          value: T.values[i],
          absoluteIndex: T.absoluteIndices[i]
        })).filter((T) => !w.value.includes(T.id));
        ce.value = { datapoint: S, seriesIndex: i, config: e.value, dataset: t };
        const y = e.value.tooltipCustomFormat;
        if (Ee(y) && Be(() => y({
          datapoint: S,
          seriesIndex: i,
          series: t,
          config: e.value
        })))
          K.value = y({
            point: S,
            seriesIndex: i,
            series: t,
            config: e.value
          });
        else {
          let T = "";
          e.value.xyPeriods[S[0].absoluteIndex] && (T += `<div style="border-bottom:1px solid ${e.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${e.value.xyPeriods[S[0].absoluteIndex]}</div>`), S.forEach((F, me) => {
            T += `
                    <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
                        <svg viewBox="0 0 12 12" height="14" width="12"><rect x=0 y="0" width="12" height="12" rx="1" stroke="none" fill="${F.color}"/></svg>
                        <span>${F.name}:</span>
                        <b>${X(
              e.value.formatter,
              F.value,
              B({
                p: e.value.valuePrefix,
                v: F.value,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: F, seriesIndex: me }
            )}
                        </b>
                    </div>
                `;
          }), K.value = T;
        }
        G.value = !0;
      }
      function o() {
        G.value = !1, j.value = null, J.value = null;
      }
      return {
        absoluteZero: N,
        dataset: ne.filter((i) => !w.value.includes(i.id)),
        legend: ee,
        drawingArea: s,
        extremes: n,
        slotSize: D,
        yLabels: ue,
        useTooltip: te,
        killTooltip: o
      };
    }), Le = z(!1);
    function St(u) {
      Le.value = u, qe.value += 1;
    }
    function at() {
      Ae.value.showTooltip = !Ae.value.showTooltip;
    }
    const Ce = z(!1);
    function Oe() {
      Ce.value = !Ce.value;
    }
    return I({
      generatePdf: He,
      generateImage: Xe,
      toggleTooltip: at,
      toggleAnnotator: Oe
    }), (u, s) => ht.value ? (a(), l("div", {
      key: 0,
      id: `${$.value}_${P.value}`,
      ref_key: "quickChart",
      ref: W,
      class: re({ "vue-ui-quick-chart": !0, "vue-data-ui-wrapper-fullscreen": Le.value }),
      style: R(`background:${e.value.backgroundColor};color:${e.value.color};font-family:${e.value.fontFamily}; position: relative; ${e.value.responsive ? "height: 100%" : ""}`),
      onMouseenter: s[5] || (s[5] = () => je(!0)),
      onMouseleave: s[6] || (s[6] = () => je(!1))
    }, [
      e.value.userOptionsButtons.annotator ? (a(), Ie(jt, {
        key: 0,
        parent: W.value,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        active: Ce.value,
        onClose: Oe
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : f("", !0),
      ft.value ? (a(), l("div", {
        key: 1,
        ref_key: "noTitle",
        ref: Ve,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : f("", !0),
      e.value.showUserOptions && (We.value || Se.value) ? (a(), Ie(Dt, {
        ref: "details",
        key: `user_option_${qe.value}`,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        isPrinting: g(be),
        isImaging: g(we),
        uid: P.value,
        hasTooltip: e.value.userOptionsButtons.tooltip && e.value.showTooltip,
        hasPdf: e.value.userOptionsButtons.pdf,
        hasImg: e.value.userOptionsButtons.img,
        hasFullscreen: e.value.userOptionsButtons.fullscreen,
        hasXls: !1,
        isTooltip: Ae.value.showTooltip,
        isFullscreen: Le.value,
        titles: { ...e.value.userOptionsButtonTitles },
        chartElement: W.value,
        position: e.value.userOptionsPosition,
        hasAnnotator: e.value.userOptionsButtons.annotator,
        isAnnotation: Ce.value,
        onToggleFullscreen: St,
        onGeneratePdf: g(He),
        onGenerateImage: g(Xe),
        onToggleTooltip: at,
        onToggleAnnotator: Oe,
        style: R({
          visibility: We.value ? Se.value ? "visible" : "hidden" : "visible"
        })
      }, At({ _: 2 }, [
        u.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: Q(() => [
            U(u.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        u.$slots.optionPdf ? {
          name: "optionPdf",
          fn: Q(() => [
            U(u.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        u.$slots.optionImg ? {
          name: "optionImg",
          fn: Q(() => [
            U(u.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        u.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: Q(({ toggleFullscreen: t, isFullscreen: n }) => [
            U(u.$slots, "optionFullscreen", H(se({ toggleFullscreen: t, isFullscreen: n })), void 0, !0)
          ]),
          key: "3"
        } : void 0,
        u.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: Q(({ toggleAnnotator: t, isAnnotator: n }) => [
            U(u.$slots, "optionAnnotator", H(se({ toggleAnnotator: t, isAnnotator: n })), void 0, !0)
          ]),
          key: "4"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : f("", !0),
      e.value.title ? (a(), l("div", {
        key: 3,
        ref_key: "quickChartTitle",
        ref: le,
        class: "vue-ui-quick-chart-title",
        style: R(`background:transparent;color:${e.value.color};font-size:${e.value.titleFontSize}px;font-weight:${e.value.titleBold ? "bold" : "normal"};text-align:${e.value.titleTextAlign}`)
      }, O(e.value.title), 5)) : f("", !0),
      $.value ? (a(), l("svg", {
        key: 4,
        xmlns: g(Rt),
        viewBox: gt.value,
        style: R(`max-width:100%;overflow:visible;background:transparent;color:${e.value.color}`)
      }, [
        ve(Wt),
        A("defs", null, [
          A("filter", {
            id: `blur_${P.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            A("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 2,
              id: `blur_std_${P.value}`
            }, null, 8, aa),
            la
          ], 8, ta),
          A("filter", {
            id: `shadow_${P.value}`,
            "color-interpolation-filters": "sRGB"
          }, [
            A("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "10",
              "flood-opacity": "0.5",
              "flood-color": e.value.donutShadowColor
            }, null, 8, ia)
          ], 8, oa)
        ]),
        $.value === _.DONUT ? (a(), l(p, { key: 0 }, [
          e.value.showDataLabels ? (a(), l("g", ua, [
            (a(!0), l(p, null, L(E.value.chart, (t, n) => (a(), l(p, null, [
              E.value.isArcBigEnough(t) ? (a(), l("path", {
                key: 0,
                d: g(Nt)(t, { x: b.value.width / 2, y: b.value.height / 2 }, 16, 16, !1, !1, b.value.height * et.value),
                stroke: t.color,
                "stroke-width": e.value.donutLabelMarkerStrokeWidth,
                "stroke-linecap": "round",
                "stroke-linejoin": "round",
                fill: "none",
                filter: ge(t.id)
              }, null, 8, na)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          A("circle", {
            cx: E.value.cx,
            cy: E.value.cy,
            r: E.value.radius,
            fill: e.value.backgroundColor,
            filter: e.value.donutUseShadow ? `url(#shadow_${P.value})` : ""
          }, null, 8, ra),
          A("g", sa, [
            (a(!0), l(p, null, L(E.value.chart, (t, n) => (a(), l("path", {
              d: t.arcSlice,
              fill: t.color,
              stroke: e.value.backgroundColor,
              "stroke-width": e.value.donutStrokeWidth,
              filter: ge(t.id)
            }, null, 8, va))), 256)),
            (a(!0), l(p, null, L(E.value.chart, (t, n) => (a(), l("path", {
              d: t.arcSlice,
              fill: "transparent",
              onMouseenter: (r) => E.value.useTooltip({ datapoint: t, seriesIndex: n }),
              onMouseout: s[0] || (s[0] = (r) => E.value.killTooltip()),
              onClick: (r) => m("selectDatapoint", t)
            }, null, 40, da))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", ca, [
            (a(!0), l(p, null, L(E.value.chart, (t, n) => (a(), l(p, null, [
              E.value.isArcBigEnough(t) ? (a(), l("circle", {
                key: 0,
                cx: g(xe)(t).x,
                cy: g(Ue)(t) - 3.7,
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: ge(t.id)
              }, null, 8, ha)) : f("", !0),
              E.value.isArcBigEnough(t) ? (a(), l("text", {
                key: 1,
                "text-anchor": g(xe)(t, !0, 20).anchor,
                x: g(xe)(t, !0).x,
                y: g(Ue)(t),
                fill: e.value.color,
                "font-size": e.value.dataLabelFontSize,
                filter: ge(t.id)
              }, O(E.value.displayArcPercentage(t, E.value.chart)) + " (" + O(g(X)(
                e.value.formatter,
                t.value,
                g(B)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )) + ") ", 9, fa)) : f("", !0),
              E.value.isArcBigEnough(t, !0, 20) ? (a(), l("text", {
                key: 2,
                "text-anchor": g(xe)(t).anchor,
                x: g(xe)(t, !0).x,
                y: g(Ue)(t) + e.value.dataLabelFontSize,
                fill: e.value.color,
                "font-size": e.value.dataLabelFontSize,
                filter: ge(t.id)
              }, O(t.name), 9, ga)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          e.value.donutShowTotal ? (a(), l("g", ma, [
            A("text", {
              "text-anchor": "middle",
              x: E.value.drawingArea.centerX,
              y: E.value.drawingArea.centerY - e.value.donutTotalLabelFontSize / 2,
              "font-size": e.value.donutTotalLabelFontSize,
              fill: e.value.color
            }, O(e.value.donutTotalLabelText), 9, pa),
            A("text", {
              "text-anchor": "middle",
              x: E.value.drawingArea.centerX,
              y: E.value.drawingArea.centerY + e.value.donutTotalLabelFontSize,
              "font-size": e.value.donutTotalLabelFontSize,
              fill: e.value.color
            }, O(g(B)({
              p: e.value.valuePrefix,
              v: E.value.total,
              s: e.value.valueSuffix,
              r: e.value.dataLabelRoundingValue
            })), 9, xa)
          ])) : f("", !0)
        ], 64)) : f("", !0),
        $.value === _.LINE ? (a(), l(p, { key: 1 }, [
          e.value.xyShowGrid ? (a(), l("g", ya, [
            (a(!0), l(p, null, L(c.value.yLabels, (t) => (a(), l(p, null, [
              t.y <= c.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: c.value.drawingArea.left,
                x2: c.value.drawingArea.right,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyGridStroke,
                "stroke-width": e.value.xyGridStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, ka)) : f("", !0)
            ], 64))), 256)),
            (a(!0), l(p, null, L(c.value.extremes.maxSeries + 1, (t, n) => (a(), l("line", {
              x1: c.value.drawingArea.left + c.value.slotSize * n,
              x2: c.value.drawingArea.left + c.value.slotSize * n,
              y1: c.value.drawingArea.top,
              y2: c.value.drawingArea.bottom,
              stroke: e.value.xyGridStroke,
              "stroke-width": e.value.xyGridStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Sa))), 256))
          ])) : f("", !0),
          e.value.xyShowAxis ? (a(), l("g", ba, [
            A("line", {
              x1: c.value.drawingArea.left,
              x2: c.value.drawingArea.left,
              y1: c.value.drawingArea.top,
              y2: c.value.drawingArea.bottom,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, wa),
            A("line", {
              x1: c.value.drawingArea.left,
              x2: c.value.drawingArea.right,
              y1: isNaN(c.value.absoluteZero) ? c.value.drawingArea.bottom : c.value.absoluteZero,
              y2: isNaN(c.value.absoluteZero) ? c.value.drawingArea.bottom : c.value.absoluteZero,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Aa)
          ])) : f("", !0),
          e.value.xyShowScale ? (a(), l("g", _a, [
            (a(!0), l(p, null, L(c.value.yLabels, (t, n) => (a(), l(p, null, [
              t.y <= c.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: t.x + 4,
                x2: c.value.drawingArea.left,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyAxisStroke,
                "stroke-width": e.value.xyAxisStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, za)) : f("", !0),
              t.y <= c.value.drawingArea.bottom ? (a(), l("text", {
                key: 1,
                x: t.x,
                y: t.y + e.value.xyLabelsYFontSize / 3,
                "text-anchor": "end",
                "font-size": e.value.xyLabelsYFontSize,
                fill: e.value.color
              }, O(g(X)(
                e.value.formatter,
                t.value,
                g(B)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )), 9, La)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          e.value.xyShowScale && e.value.xyPeriods.length ? (a(), l("g", Ca, [
            (a(!0), l(p, null, L(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("line", {
              x1: c.value.drawingArea.left + c.value.slotSize * (n + 1) - c.value.slotSize / 2,
              x2: c.value.drawingArea.left + c.value.slotSize * (n + 1) - c.value.slotSize / 2,
              y1: c.value.drawingArea.bottom,
              y2: c.value.drawingArea.bottom + 4,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, $a))), 256)),
            (a(!0), l(p, null, L(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("text", {
              "font-size": e.value.xyLabelsXFontSize,
              "text-anchor": e.value.xyPeriodLabelsRotation > 0 ? "start" : e.value.xyPeriodLabelsRotation < 0 ? "end" : "middle",
              fill: e.value.color,
              transform: `translate(${c.value.drawingArea.left + c.value.slotSize * (n + 1) - c.value.slotSize / 2}, ${c.value.drawingArea.bottom + e.value.xyLabelsXFontSize + 6}), rotate(${e.value.xyPeriodLabelsRotation})`
            }, O(t), 9, Ia))), 256))
          ])) : f("", !0),
          A("g", Ea, [
            (a(!0), l(p, null, L(c.value.dataset, (t, n) => (a(), l("g", Pa, [
              e.value.lineSmooth ? (a(), l(p, { key: 0 }, [
                A("path", {
                  d: `M ${g(it)(t.coordinates)}`,
                  stroke: e.value.backgroundColor,
                  "stroke-width": e.value.lineStrokeWidth + 1,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Ta),
                A("path", {
                  d: `M ${g(it)(t.coordinates)}`,
                  stroke: t.color,
                  "stroke-width": e.value.lineStrokeWidth,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Oa)
              ], 64)) : (a(), l(p, { key: 1 }, [
                A("path", {
                  d: `M ${t.linePath}`,
                  stroke: e.value.backgroundColor,
                  "stroke-width": e.value.lineStrokeWidth + 1,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Ra),
                A("path", {
                  d: `M ${t.linePath}`,
                  stroke: t.color,
                  "stroke-width": e.value.lineStrokeWidth,
                  "stroke-linecap": "round",
                  fill: "none",
                  class: re({ "quick-animation": !0, "vue-data-ui-line-animated": e.value.lineAnimated }),
                  style: { transition: "all 0.3s ease-in-out" }
                }, null, 10, Na)
              ], 64)),
              (a(!0), l(p, null, L(t.coordinates, (r, h) => (a(), l("circle", {
                cx: r.x,
                cy: g(Z)(r.y),
                r: 3,
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": "0.5",
                class: "quick-animation",
                style: { transition: "all 0.3s ease-in-out" }
              }, null, 8, Fa))), 256))
            ]))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", Ma, [
            (a(!0), l(p, null, L(c.value.dataset, (t, n) => (a(), l(p, null, [
              (a(!0), l(p, null, L(t.coordinates, (r, h) => (a(), l("text", {
                "text-anchor": "middle",
                "font-size": e.value.dataLabelFontSize,
                fill: t.color,
                x: r.x,
                y: g(Z)(r.y) - e.value.dataLabelFontSize / 2,
                class: "quick-animation",
                style: { transition: "all 0.3s ease-in-out" }
              }, O(g(X)(
                e.value.formatter,
                g(Z)(r.value),
                g(B)({
                  p: e.value.valuePrefix,
                  v: g(Z)(r.value),
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: r, seriesIndex: h }
              )), 9, Ua))), 256))
            ], 64))), 256))
          ])) : f("", !0),
          A("g", Ba, [
            (a(!0), l(p, null, L(c.value.extremes.maxSeries, (t, n) => (a(), l("rect", {
              x: c.value.drawingArea.left + n * c.value.slotSize,
              y: c.value.drawingArea.top,
              height: c.value.drawingArea.height <= 0 ? 1e-5 : c.value.drawingArea.height,
              width: c.value.slotSize <= 0 ? 1e-5 : c.value.slotSize,
              fill: [j.value, J.value].includes(n) ? e.value.xyHighlighterColor : "transparent",
              style: R(`opacity:${e.value.xyHighlighterOpacity}`),
              onMouseenter: (r) => c.value.useTooltip(n),
              onMouseleave: s[1] || (s[1] = (r) => c.value.killTooltip()),
              onClick: (r) => m("selectDatapoint", c.value.dataset.map((h) => ({
                ...h,
                value: h.values[n]
              })))
            }, null, 44, Da))), 256))
          ])
        ], 64)) : f("", !0),
        $.value === _.BAR ? (a(), l(p, { key: 2 }, [
          e.value.xyShowGrid ? (a(), l("g", Va, [
            (a(!0), l(p, null, L(d.value.yLabels, (t) => (a(), l(p, null, [
              t.y <= d.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: d.value.drawingArea.left,
                x2: d.value.drawingArea.right,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyGridStroke,
                "stroke-width": e.value.xyGridStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, qa)) : f("", !0)
            ], 64))), 256)),
            (a(!0), l(p, null, L(d.value.extremes.maxSeries + 1, (t, n) => (a(), l("line", {
              x1: d.value.drawingArea.left + d.value.slotSize * n,
              x2: d.value.drawingArea.left + d.value.slotSize * n,
              y1: d.value.drawingArea.top,
              y2: d.value.drawingArea.bottom,
              stroke: e.value.xyGridStroke,
              "stroke-width": e.value.xyGridStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Wa))), 256))
          ])) : f("", !0),
          e.value.xyShowAxis ? (a(), l("g", ja, [
            A("line", {
              x1: d.value.drawingArea.left,
              x2: d.value.drawingArea.left,
              y1: d.value.drawingArea.top,
              y2: d.value.drawingArea.bottom,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Ga),
            A("line", {
              x1: d.value.drawingArea.left,
              x2: d.value.drawingArea.right,
              y1: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero,
              y2: isNaN(d.value.absoluteZero) ? d.value.drawingArea.bottom : d.value.absoluteZero,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Ha)
          ])) : f("", !0),
          e.value.xyShowScale ? (a(), l("g", Xa, [
            (a(!0), l(p, null, L(d.value.yLabels, (t, n) => (a(), l(p, null, [
              t.y <= d.value.drawingArea.bottom ? (a(), l("line", {
                key: 0,
                x1: t.x + 4,
                x2: d.value.drawingArea.left,
                y1: t.y,
                y2: t.y,
                stroke: e.value.xyAxisStroke,
                "stroke-width": e.value.xyAxisStrokeWidth,
                "stroke-linecap": "round"
              }, null, 8, Za)) : f("", !0),
              t.y <= d.value.drawingArea.bottom ? (a(), l("text", {
                key: 1,
                x: t.x,
                y: t.y + e.value.xyLabelsYFontSize / 3,
                "text-anchor": "end",
                "font-size": e.value.xyLabelsYFontSize,
                fill: e.value.color
              }, O(g(X)(
                e.value.formatter,
                t.value,
                g(B)({
                  p: e.value.valuePrefix,
                  v: t.value,
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: t, seriesIndex: n }
              )), 9, Ya)) : f("", !0)
            ], 64))), 256))
          ])) : f("", !0),
          e.value.xyShowScale && e.value.xyPeriods.length ? (a(), l("g", Ja, [
            (a(!0), l(p, null, L(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("line", {
              x1: d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2,
              x2: d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2,
              y1: d.value.drawingArea.bottom,
              y2: d.value.drawingArea.bottom + 4,
              stroke: e.value.xyAxisStroke,
              "stroke-width": e.value.xyAxisStrokeWidth,
              "stroke-linecap": "round"
            }, null, 8, Qa))), 256)),
            (a(!0), l(p, null, L(e.value.xyPeriods.slice(k.value.start, k.value.end), (t, n) => (a(), l("text", {
              "font-size": e.value.xyLabelsXFontSize,
              "text-anchor": e.value.xyPeriodLabelsRotation > 0 ? "start" : e.value.xyPeriodLabelsRotation < 0 ? "end" : "middle",
              transform: `translate(${d.value.drawingArea.left + d.value.slotSize * (n + 1) - d.value.slotSize / 2}, ${d.value.drawingArea.bottom + e.value.xyLabelsXFontSize + 6}) rotate(${e.value.xyPeriodLabelsRotation})`,
              fill: e.value.color
            }, O(t), 9, Ka))), 256))
          ])) : f("", !0),
          A("g", el, [
            (a(!0), l(p, null, L(d.value.dataset, (t, n) => (a(), l(p, null, [
              (a(!0), l(p, null, L(t.coordinates, (r, h) => (a(), l("rect", {
                x: r.x,
                width: r.width <= 0 ? 1e-5 : r.width,
                height: g(Z)(r.height <= 0 ? 1e-5 : r.height),
                y: g(Z)(r.y),
                fill: t.color,
                stroke: e.value.backgroundColor,
                "stroke-width": e.value.barStrokeWidth,
                "stroke-linecap": "round",
                class: re({ "vue-data-ui-bar-animated": e.value.barAnimated && r.value < 0 })
              }, [
                e.value.barAnimated && r.value > 0 && !g(be) && !g(we) ? (a(), l("animate", {
                  key: 0,
                  attributeName: "height",
                  from: 0,
                  to: r.height,
                  dur: "0.5s"
                }, null, 8, al)) : f("", !0),
                e.value.barAnimated && r.value > 0 && !g(be) && !g(we) ? (a(), l("animate", {
                  key: 1,
                  attributeName: "y",
                  from: d.value.absoluteZero,
                  to: d.value.absoluteZero - r.height,
                  dur: "0.5s"
                }, null, 8, ll)) : f("", !0)
              ], 10, tl))), 256))
            ], 64))), 256))
          ]),
          e.value.showDataLabels ? (a(), l("g", ol, [
            (a(!0), l(p, null, L(d.value.dataset, (t, n) => (a(), l(p, null, [
              (a(!0), l(p, null, L(t.coordinates, (r, h) => (a(), l("text", {
                x: r.x + r.width / 2,
                y: g(Z)(r.y) - e.value.dataLabelFontSize / 2,
                "text-anchor": "middle",
                "font-size": e.value.dataLabelFontSize,
                fill: t.color,
                class: "quick-animation"
              }, O(g(X)(
                e.value.formatter,
                g(Z)(r.value),
                g(B)({
                  p: e.value.valuePrefix,
                  v: g(Z)(r.value),
                  s: e.value.valueSuffix,
                  r: e.value.dataLabelRoundingValue
                }),
                { datapoint: r, seriesIndex: h }
              )), 9, il))), 256))
            ], 64))), 256))
          ])) : f("", !0),
          A("g", ul, [
            (a(!0), l(p, null, L(d.value.extremes.maxSeries, (t, n) => (a(), l("rect", {
              x: d.value.drawingArea.left + n * d.value.slotSize,
              y: d.value.drawingArea.top,
              height: d.value.drawingArea.height <= 0 ? 1e-5 : d.value.drawingArea.height,
              width: d.value.slotSize <= 0 ? 1e-5 : d.value.slotSize,
              fill: [j.value, J.value].includes(n) ? e.value.xyHighlighterColor : "transparent",
              style: R(`opacity:${e.value.xyHighlighterOpacity}`),
              onMouseenter: (r) => d.value.useTooltip(n),
              onMouseleave: s[2] || (s[2] = (r) => d.value.killTooltip()),
              onClick: (r) => m("selectDatapoint", d.value.dataset.map((h) => ({
                ...h,
                value: h.values[n]
              })))
            }, null, 44, nl))), 256))
          ])
        ], 64)) : f("", !0),
        [_.LINE, _.BAR].includes($.value) ? (a(), l("g", rl, [
          e.value.xAxisLabel && $.value === _.LINE ? (a(), l("g", sl, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              "text-anchor": "middle",
              x: c.value.drawingArea.left + c.value.drawingArea.width / 2,
              y: b.value.height - e.value.axisLabelsFontSize / 3
            }, O(e.value.xAxisLabel), 9, vl)
          ])) : f("", !0),
          e.value.xAxisLabel && $.value === _.BAR ? (a(), l("g", dl, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              "text-anchor": "middle",
              x: d.value.drawingArea.left + d.value.drawingArea.width / 2,
              y: b.value.height - e.value.axisLabelsFontSize / 3
            }, O(e.value.xAxisLabel), 9, cl)
          ])) : f("", !0),
          e.value.yAxisLabel && $.value === _.LINE ? (a(), l("g", hl, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              transform: `translate(${e.value.axisLabelsFontSize}, ${c.value.drawingArea.top + c.value.drawingArea.height / 2}) rotate(-90)`,
              "text-anchor": "middle"
            }, O(e.value.yAxisLabel), 9, fl)
          ])) : f("", !0),
          e.value.yAxisLabel && $.value === _.BAR ? (a(), l("g", gl, [
            A("text", {
              "font-size": e.value.axisLabelsFontSize,
              fill: e.value.color,
              transform: `translate(${e.value.axisLabelsFontSize}, ${d.value.drawingArea.top + d.value.drawingArea.height / 2}) rotate(-90)`,
              "text-anchor": "middle"
            }, O(e.value.yAxisLabel), 9, ml)
          ])) : f("", !0)
        ])) : f("", !0)
      ], 12, ea)) : f("", !0),
      $.value ? f("", !0) : (a(), Ie(qt, {
        key: 5,
        config: {
          type: "line",
          style: {
            backgroundColor: e.value.backgroundColor,
            line: {
              axis: {
                color: e.value.xyAxisStroke
              },
              path: {
                color: e.value.xyAxisStroke,
                strokeWidth: 0.5
              }
            }
          }
        }
      }, null, 8, ["config"])),
      u.$slots.watermark ? (a(), l("div", pl, [
        U(u.$slots, "watermark", H(se({ isPrinting: g(be) || g(we) })), void 0, !0)
      ])) : f("", !0),
      [_.BAR, _.LINE].includes($.value) && e.value.zoomXy && x.value.maxSeriesLength > 1 ? (a(), l("div", {
        key: `slicer_${ke.value}`,
        ref_key: "quickChartSlicer",
        ref: de
      }, [
        (a(), Ie(Vt, {
          ref_key: "slicerComponent",
          ref: ie,
          key: `slicer_${ke.value}`,
          background: e.value.zoomColor,
          borderColor: e.value.backgroundColor,
          fontSize: e.value.zoomFontSize,
          useResetSlot: e.value.zoomUseResetSlot,
          labelLeft: e.value.xyPeriods[k.value.start] ? e.value.xyPeriods[k.value.start] : "",
          labelRight: e.value.xyPeriods[k.value.end - 1] ? e.value.xyPeriods[k.value.end - 1] : "",
          textColor: e.value.color,
          inputColor: e.value.zoomColor,
          selectColor: e.value.zoomHighlightColor,
          max: x.value.maxSeriesLength,
          min: 0,
          valueStart: k.value.start,
          valueEnd: k.value.end,
          smoothMinimap: e.value.zoomMinimap.smooth,
          minimapSelectedColor: e.value.zoomMinimap.selectedColor,
          minimapSelectedColorOpacity: e.value.zoomMinimap.selectedColorOpacity,
          minimapSelectionRadius: e.value.zoomMinimap.selectionRadius,
          minimapLineColor: e.value.zoomMinimap.lineColor,
          minimap: kt.value,
          minimapIndicatorColor: e.value.zoomMinimap.indicatorColor,
          minimapSelectedIndex: J.value,
          start: k.value.start,
          "onUpdate:start": s[3] || (s[3] = (t) => k.value.start = t),
          end: k.value.end,
          "onUpdate:end": s[4] || (s[4] = (t) => k.value.end = t),
          refreshStartPoint: e.value.zoomStartIndex !== null ? e.value.zoomStartIndex : 0,
          refreshEndPoint: e.value.zoomEndIndex !== null ? e.value.zoomEndIndex + 1 : x.value.maxSeriesLength,
          onReset: xt,
          onTrapMouse: pt
        }, {
          "reset-action": Q(({ reset: t }) => [
            U(u.$slots, "reset-action", H(se({ reset: t })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "smoothMinimap", "minimapSelectedColor", "minimapSelectedColorOpacity", "minimapSelectionRadius", "minimapLineColor", "minimap", "minimapIndicatorColor", "minimapSelectedIndex", "start", "end", "refreshStartPoint", "refreshEndPoint"]))
      ])) : f("", !0),
      e.value.showLegend ? (a(), l("div", {
        key: 8,
        ref_key: "quickChartLegend",
        ref: oe,
        class: "vue-ui-quick-chart-legend",
        style: R(`background:transparent;color:${e.value.color}`)
      }, [
        $.value === _.DONUT ? (a(!0), l(p, { key: 0 }, L(E.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            mt(t, E.value.dataset), m("selectLegend", t);
          },
          style: R(`cursor: ${E.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? U(u.$slots, "legend", H(Fe({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(p, { key: 1 }, [
            ve(Pe, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            A("span", {
              style: R(`font-size:${e.value.legendFontSize}px`)
            }, O(t.name), 5),
            A("span", {
              style: R(`font-size:${e.value.legendFontSize}px;font-variant-numeric:tabular-nums`)
            }, O(w.value.includes(t.id) ? "-" : g(X)(
              e.value.formatter,
              t.absoluteValue,
              g(B)({
                p: e.value.valuePrefix,
                v: t.absoluteValue,
                s: e.value.valueSuffix,
                r: e.value.dataLabelRoundingValue
              }),
              { datapoint: t, seriesIndex: n }
            )), 5),
            w.value.includes(t.id) ? (a(), l("span", {
              key: 0,
              style: R(`font-size:${e.value.legendFontSize}px`)
            }, " ( - % ) ", 4)) : ze.value ? (a(), l("span", {
              key: 1,
              style: R(`font-size:${e.value.legendFontSize}px; font-variant-numeric: tabular-nums;`)
            }, " ( - % ) ", 4)) : (a(), l("span", {
              key: 2,
              style: R(`font-size:${e.value.legendFontSize}px; font-variant-numeric: tabular-nums;`)
            }, " (" + O(g(B)({
              v: t.value / E.value.total * 100,
              s: "%",
              r: e.value.dataLabelRoundingPercentage
            })) + ") ", 5))
          ], 64))
        ], 12, xl))), 256)) : f("", !0),
        $.value === _.LINE ? (a(!0), l(p, { key: 1 }, L(c.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            Je(t.id, c.value.legend.length - 1), m("selectLegend", t);
          },
          style: R(`cursor: ${c.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? U(u.$slots, "legend", H(Fe({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(p, { key: 1 }, [
            ve(Pe, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            A("span", {
              style: R(`font-size:${e.value.legendFontSize}px`)
            }, O(t.name), 5)
          ], 64))
        ], 12, yl))), 256)) : f("", !0),
        $.value === _.BAR ? (a(!0), l(p, { key: 2 }, L(d.value.legend, (t, n) => (a(), l("div", {
          class: "vue-ui-quick-chart-legend-item",
          onClick: (r) => {
            Je(t.id, d.value.legend.length - 1), m("selectLegend", t);
          },
          style: R(`cursor: ${d.value.legend.length > 1 ? "pointer" : "default"}; opacity:${w.value.includes(t.id) ? "0.5" : "1"}`)
        }, [
          e.value.useCustomLegend ? U(u.$slots, "legend", H(Fe({ key: 0 }, { legend: t })), void 0, !0) : (a(), l(p, { key: 1 }, [
            ve(Pe, {
              name: e.value.legendIcon,
              stroke: t.color,
              size: e.value.legendIconSize
            }, null, 8, ["name", "stroke", "size"]),
            A("span", {
              style: R(`font-size:${e.value.legendFontSize}px`)
            }, O(t.name), 5)
          ], 64))
        ], 12, kl))), 256)) : f("", !0)
      ], 4)) : f("", !0),
      u.$slots.source ? (a(), l("div", {
        key: 9,
        ref_key: "source",
        ref: De,
        dir: "auto"
      }, [
        U(u.$slots, "source", {}, void 0, !0)
      ], 512)) : f("", !0),
      ve(Ut, {
        show: Ae.value.showTooltip && G.value,
        backgroundColor: e.value.backgroundColor,
        color: e.value.color,
        borderRadius: e.value.tooltipBorderRadius,
        borderColor: e.value.tooltipBorderColor,
        borderWidth: e.value.tooltipBorderWidth,
        fontSize: e.value.tooltipFontSize,
        backgroundOpacity: e.value.tooltipBackgroundOpacity,
        position: e.value.tooltipPosition,
        offsetY: e.value.tooltipOffsetY,
        parent: W.value,
        content: K.value,
        isFullscreen: Le.value,
        isCustom: g(Ee)(e.value.tooltipCustomFormat)
      }, {
        "tooltip-before": Q(() => [
          U(u.$slots, "tooltip-before", H(se({ ...ce.value })), void 0, !0)
        ]),
        "tooltip-after": Q(() => [
          U(u.$slots, "tooltip-after", H(se({ ...ce.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"])
    ], 46, Kt)) : (a(), l("div", Sl, [
      ve(Pe, {
        name: "circleCancel",
        stroke: "red"
      }),
      bl
    ]));
  }
}, Nl = /* @__PURE__ */ Gt(wl, [["__scopeId", "data-v-c31c33da"]]);
export {
  Nl as default
};
