import { computed as k, ref as y, onMounted as Qe, watch as je, nextTick as ne, openBlock as r, createElementBlock as i, normalizeClass as pe, normalizeStyle as B, unref as p, createBlock as J, createCommentVNode as d, renderSlot as w, createVNode as ue, createSlots as $t, withCtx as C, normalizeProps as O, guardReactiveProps as P, Fragment as h, renderList as f, createElementVNode as U, toDisplayString as S, createTextVNode as Mt } from "vue";
import { u as Tt, c as et, t as Nt, a as It, p as ce, C as ve, b as Ot, o as Pt, e as tt, g as At, d as Rt, a7 as he, a3 as at, D as lt, X as Vt, l as Ft, G as ot, f as W, x as rt, i as st, y as Dt, q as Et, r as Ht } from "./index-BbPeL8Gp.js";
import { u as it } from "./useNestedProp-BN8claGG.js";
import { t as Bt, u as Ut } from "./useResponsive-CoxXLe23.js";
import { u as Wt, U as Yt } from "./usePrinter-DaybDVqP.js";
import { S as Xt } from "./Slicer-Cxdl3cDt.js";
import { _ as Gt } from "./Tooltip-smutPF--.js";
import { _ as Jt } from "./Title-aSAft5dl.js";
import { L as qt } from "./Legend-BLaZxMge.js";
import Zt from "./vue-ui-accordion-5d5iVpr7.js";
import { D as Kt } from "./DataTable-DGf6RrOJ.js";
import Qt from "./vue-ui-skeleton-Bniq21d9.js";
import { _ as jt } from "./PackageVersion-CxJghxYD.js";
import { P as ea } from "./PenAndPaper-ZdZEumki.js";
import { u as ta } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as aa } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const la = ["id"], oa = ["xmlns", "viewBox"], ra = { key: 0 }, sa = ["id"], ia = ["stop-color"], na = ["stop-color"], ua = ["stop-color"], ca = ["x1", "x2", "y1", "y2", "stroke"], va = ["x1", "x2", "y1", "y2", "stroke"], ha = ["x1", "x2", "y1", "y2", "stroke"], da = ["x1", "x2", "y1", "y2", "stroke"], ya = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], ga = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ba = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], fa = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ma = ["x", "y", "font-size", "fill", "font-weight"], pa = ["transform", "font-size", "fill", "font-weight"], xa = ["x", "y", "font-size", "fill", "font-weight"], ka = { key: 0 }, wa = ["x", "y", "font-size", "font-weight", "fill"], za = ["x", "y", "font-size", "fill", "font-weight"], Ca = { key: 0 }, La = ["x", "y", "font-size", "font-weight", "fill"], _a = ["x1", "x2", "y1", "y2", "stroke"], Sa = ["x", "y", "font-size", "font-weight", "fill"], $a = ["x1", "x2", "y1", "y2", "stroke"], Ma = ["font-size", "font-weight", "fill", "text-anchor", "transform"], Ta = { key: 0 }, Na = { key: 1 }, Ia = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Oa = { key: 0 }, Pa = { key: 1 }, Aa = ["font-size", "font-weight", "fill", "x", "y", "onClick"], Ra = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Va = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Fa = {
  key: 4,
  class: "vue-data-ui-watermark"
}, Da = ["onClick"], Ea = ["innerHTML"], Ha = {
  __name: "vue-ui-stackbar",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectDatapoint", "selectLegend", "selectTimeLabel"],
  setup(de, { expose: nt, emit: ye }) {
    const g = de, { vue_ui_stackbar: ut } = Tt(), Y = k({
      get() {
        return !!g.dataset && g.dataset.length;
      },
      set(a) {
        return a;
      }
    }), X = y(null), ge = y(et()), ee = y(!1), xe = y(null), be = y(""), _ = y([]), ke = y(0), we = y(null), ze = y(null), Ce = y(null), Le = y(null), _e = y(0), te = y(!1), q = y(null), Z = y(!1), ct = y(0), vt = y(0), ht = y(0), G = y(null);
    Qe(() => {
      fe();
    });
    const e = k({
      get: () => Te(),
      set: (a) => a
    }), { userOptionsVisible: Se, setUserOptionsVisibility: $e, keepUserOptionState: Me } = ta({ config: e.value });
    function Te() {
      const a = it({
        userConfig: g.config,
        defaultConfig: ut
      });
      let l = {};
      return a.theme ? l = {
        ...it({
          userConfig: Nt.vue_ui_stackbar[a.theme] || g.config,
          defaultConfig: a
        }),
        customPalette: It[a.theme] || ce
      } : l = a, g.config && ve(g.config, "style.chart.grid.scale.scaleMin") ? l.style.chart.grid.scale.scaleMin = g.config.style.chart.grid.scale.scaleMin : l.style.chart.grid.scale.scaleMin = null, g.config && ve(g.config, "style.chart.grid.scale.scaleMax") ? l.style.chart.grid.scale.scaleMax = g.config.style.chart.grid.scale.scaleMax : l.style.chart.grid.scale.scaleMax = null, g.config && ve(g.config, "style.chart.zoom.startIndex") ? l.style.chart.zoom.startIndex = g.config.style.chart.zoom.startIndex : l.style.chart.zoom.startIndex = null, g.config && ve(g.config, "style.chart.zoom.endIndex") ? l.style.chart.zoom.endIndex = g.config.style.chart.zoom.endIndex : l.style.chart.zoom.endIndex = null, l;
    }
    je(() => g.config, (a) => {
      e.value = Te(), fe(), ct.value += 1, vt.value += 1, ht.value += 1;
    }, { deep: !0 }), je(() => g.dataset, (a) => {
      Ve();
    }, { deep: !0 });
    const L = y({
      dataLabels: {
        show: e.value.style.chart.bars.dataLabels.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), { isPrinting: Ne, isImaging: Ie, generatePdf: Oe, generateImage: Pe } = Wt({
      elementId: `stackbar_${ge.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-stackbar"
    }), ae = y({
      width: e.value.style.chart.width,
      height: e.value.style.chart.height,
      paddingRatio: {
        top: e.value.style.chart.padding.top / e.value.style.chart.height,
        right: e.value.style.chart.padding.right / e.value.style.chart.width,
        bottom: e.value.style.chart.padding.bottom / e.value.style.chart.height,
        left: e.value.style.chart.padding.left / e.value.style.chart.width
      }
    }), dt = k(() => Ot(e.value.customPalette)), Ae = y(null), Re = y(null);
    Qe(() => {
      fe();
    });
    function fe() {
      if (Pt(g.dataset) ? tt({
        componentName: "VueUiStackbar",
        type: "dataset"
      }) : g.dataset.forEach((a, l) => {
        At({
          datasetObject: a,
          requiredAttributes: ["name", "series"]
        }).forEach((t) => {
          Y.value = !1, tt({
            componentName: "VueUiStackbar",
            type: "datasetSerieAttribute",
            property: t,
            index: l
          });
        });
      }), setTimeout(() => {
        Z.value = !0;
      }, 10), e.value.responsive) {
        const a = Bt(() => {
          Z.value = !1;
          const { width: l, height: t } = Ut({
            chart: X.value,
            title: e.value.style.chart.title.text ? we.value : null,
            legend: e.value.style.chart.legend.show ? ze.value : null,
            slicer: e.value.style.chart.zoom.show && R.value > 1 ? Ce.value : null,
            source: Le.value
          });
          ae.value.width = l, ae.value.height = t, clearTimeout(Re.value), Re.value = setTimeout(() => {
            Z.value = !0;
          }, 10);
        });
        Ae.value = new ResizeObserver(a), Ae.value.observe(X.value.parentNode);
      }
      Fe();
    }
    const s = k(() => {
      const { height: a, width: l } = ae.value, { right: t } = ae.value.paddingRatio, o = e.value.style.chart.padding.top, n = l - l * t, u = a - e.value.style.chart.padding.bottom, z = e.value.style.chart.padding.left, F = l - z - l * t, D = a - o - e.value.style.chart.padding.bottom;
      return {
        chartHeight: a,
        chartWidth: l,
        top: o,
        right: n,
        bottom: u,
        left: z,
        width: F,
        height: D < 0 ? 0 : D
      };
    }), A = k(() => g.dataset.map((a, l) => {
      const t = Rt(a.color) || dt.value[l] || ce[l] || ce[l % ce.length];
      return {
        ...a,
        // In distributed mode, all values are converted to positive
        series: JSON.parse(JSON.stringify(a.series)).map((o) => e.value.style.chart.bars.distributed ? Math.abs(o) : o),
        // Store signs to manage display of neg values in distributed mode
        signedSeries: a.series.map((o) => o >= 0 ? 1 : -1),
        absoluteIndex: l,
        id: et(),
        color: t
      };
    })), R = k(() => Math.max(...A.value.filter((a) => !_.value.includes(a.id)).map((a) => a.series.length))), c = y({
      start: 0,
      end: Math.max(...g.dataset.map((a) => a.series.length))
    });
    function Ve() {
      Fe();
    }
    async function Fe() {
      (e.value.style.chart.zoom.startIndex !== null || e.value.style.chart.zoom.endIndex !== null) && G.value ? (e.value.style.chart.zoom.startIndex !== null && (await ne(), await ne(), G.value && G.value.setStartValue(e.value.style.chart.zoom.startIndex)), e.value.style.chart.zoom.endIndex !== null && (await ne(), await ne(), G.value && G.value.setEndValue(yt(e.value.style.chart.zoom.endIndex + 1)))) : (c.value = {
        start: 0,
        end: Math.max(...g.dataset.map((a) => a.series.length))
      }, _e.value += 1);
    }
    function yt(a) {
      const l = Math.max(...g.dataset.map((t) => t.series.length));
      return a > l ? l : a < 0 || e.value.style.chart.zoom.startIndex !== null && a < e.value.style.chart.zoom.startIndex ? e.value.style.chart.zoom.startIndex !== null ? e.value.style.chart.zoom.startIndex + 1 : 1 : a;
    }
    const v = k(() => {
      let a;
      return e.value.orientation === "vertical" ? a = s.value.width / (c.value.end - c.value.start) : a = s.value.height / (c.value.end - c.value.start), a <= 0 ? 0 : a;
    }), K = k(() => he(A.value.filter((a) => !_.value.includes(a.id))).slice(c.value.start, c.value.end)), gt = k(() => he(A.value.filter((a) => !_.value.includes(a.id)).map((a) => ({
      ...a,
      series: a.series.map((l, t) => a.signedSeries[t] === -1 && l >= 0 ? -l : l)
    }))).slice(c.value.start, c.value.end)), le = k(() => {
      const a = A.value.filter((l) => !_.value.includes(l.id));
      return {
        positive: he(a.map((l) => ({
          ...l,
          series: l.series.slice(c.value.start, c.value.end).map((t) => t >= 0 ? t : 0)
        }))),
        negative: he(a.map((l) => ({
          ...l,
          series: l.series.slice(c.value.start, c.value.end).map((t) => t < 0 ? t : 0)
        })))
      };
    }), N = k(() => {
      const a = e.value.style.chart.grid.scale.scaleMax !== null && !e.value.style.chart.bars.distributed ? e.value.style.chart.grid.scale.scaleMax : Math.max(...le.value.positive), l = Math.min(...le.value.negative), t = e.value.style.chart.grid.scale.scaleMin !== null && !e.value.style.chart.bars.distributed ? e.value.style.chart.grid.scale.scaleMin : [-1 / 0, 1 / 0, NaN, void 0, null].includes(l) ? 0 : l, o = !e.value.style.chart.bars.distributed && (e.value.style.chart.grid.scale.scaleMax !== null || e.value.style.chart.grid.scale.scaleMin !== null) ? at(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks) : lt(t > 0 ? 0 : t, a < 0 ? 0 : a, e.value.style.chart.grid.scale.ticks);
      return o.ticks.map((n) => ({
        zero: s.value.bottom - s.value.height * (Math.abs(o.min) / (o.max + Math.abs(o.min))),
        y: s.value.bottom - s.value.height * ((n + Math.abs(o.min)) / (o.max + Math.abs(o.min))),
        x: s.value.left - 8,
        horizontal_zero: s.value.left + s.value.width * (Math.abs(o.min) / (o.max + Math.abs(o.min))),
        horizontal_x: s.value.left + s.value.width * ((n + Math.abs(o.min)) / (o.max + Math.abs(o.min))),
        horizontal_y: s.value.bottom - 8,
        value: n
      }));
    }), V = k(() => {
      const a = [];
      for (let l = 0; l < R.value; l += 1)
        a.push({
          text: e.value.style.chart.grid.x.timeLabels.values[l] || String(l),
          absoluteIndex: l
        });
      return a.slice(c.value.start, c.value.end);
    }), x = k(() => {
      if (!Y.value) return [];
      let a = Array(R.value).fill(0), l = Array(R.value).fill(0), t = Array(R.value).fill(0), o = Array(R.value).fill(0);
      const n = Math.max(...le.value.positive) || 0, u = Math.min(...le.value.negative), z = [-1 / 0, 1 / 0, NaN, void 0, null].includes(u) ? 0 : u, F = !e.value.style.chart.bars.distributed && (e.value.style.chart.grid.scale.scaleMax !== null || e.value.style.chart.grid.scale.scaleMin !== null) ? at(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : z > 0 ? 0 : z, e.value.style.chart.grid.scale.scaleMax !== null ? e.value.style.chart.grid.scale.scaleMax : n < 0 ? 0 : n, e.value.style.chart.grid.scale.ticks) : lt(e.value.style.chart.grid.scale.scaleMin !== null ? e.value.style.chart.grid.scale.scaleMin : z > 0 ? 0 : z, e.value.style.chart.grid.scale.scaleMax !== null ? e.value.style.chart.grid.scale.scaleMax : n < 0 ? 0 : n, e.value.style.chart.grid.scale.ticks), { min: D, max: Q } = F, E = Q + (D >= 0 ? 0 : Math.abs(D)) || 1, $ = s.value.height, ie = s.value.width, Ze = N.value[0] ? N.value[0].zero : s.value.bottom, Ke = N.value[0] ? N.value[0].horizontal_zero : s.value.left;
      return A.value.filter((j) => !_.value.includes(j.id)).map((j) => {
        const I = j.series.slice(c.value.start, c.value.end), xt = j.signedSeries.slice(c.value.start, c.value.end), kt = I.map((b, m) => s.value.left + v.value * m + v.value * e.value.style.chart.bars.gapRatio / 4), wt = I.map((b, m) => s.value.top + v.value * m + v.value * e.value.style.chart.bars.gapRatio / 4), zt = I.map((b, m) => {
          const M = e.value.style.chart.bars.distributed ? (b || 0) / K.value[m] : (b || 0) / E;
          let H, T;
          return b > 0 ? (T = $ * M, H = Ze - T - a[m], a[m] += T) : (T = $ * M, H = Ze + t[m], t[m] += Math.abs(T)), H;
        }), Ct = I.map((b, m) => {
          const M = e.value.style.chart.bars.distributed ? (b || 0) / K.value[m] : (b || 0) / E;
          let H, T;
          return b > 0 ? (T = ie * M, H = Ke + l[m], l[m] += T) : (T = ie * M, H = Ke - Math.abs(T) - o[m], o[m] += Math.abs(T)), H;
        }), Lt = I.map((b, m) => {
          const M = e.value.style.chart.bars.distributed ? (b || 0) / K.value[m] : (b || 0) / E;
          return b > 0 ? $ * M : $ * Math.abs(M);
        }), _t = I.map((b, m) => {
          const M = e.value.style.chart.bars.distributed ? (b || 0) / K.value[m] : (b || 0) / E;
          return b > 0 ? ie * M : ie * Math.abs(M);
        }), St = I.map((b) => Math.abs(b)).reduce((b, m) => b + m, 0);
        return {
          ...j,
          proportions: I.map((b, m) => e.value.style.chart.bars.distributed ? (b || 0) / K.value[m] : (b || 0) / St),
          series: I,
          signedSeries: xt,
          x: kt,
          y: zt,
          height: Lt,
          horizontal_width: _t,
          horizontal_y: wt,
          horizontal_x: Ct
        };
      });
    }), De = k(() => gt.value.map((a, l) => ({
      value: a,
      sign: a >= 0 ? 1 : -1
    })));
    function oe(a, l, t, o, n) {
      const u = n === -1 && a >= 0 ? -a : a;
      return st(
        e.value.style.chart.bars.dataLabels.formatter,
        u,
        W({
          p: e.value.style.chart.bars.dataLabels.prefix,
          v: u,
          s: e.value.style.chart.bars.dataLabels.suffix,
          r: e.value.style.chart.bars.dataLabels.rounding
        }),
        { datapoint: l, seriesIndex: t, datapointIndex: o }
      );
    }
    function Ee(a, l, t, o) {
      return st(
        e.value.style.chart.bars.dataLabels.formatter,
        a,
        W({
          v: a,
          s: "%",
          r: e.value.style.chart.bars.dataLabels.rounding
        }),
        { datapoint: l, seriesIndex: t, datapointIndex: o }
      );
    }
    function He(a) {
      const l = JSON.parse(JSON.stringify(x.value)).map((t) => ({
        name: t.name,
        value: t.series[a] === 0 ? 0 : t.series[a] || null,
        proportion: t.proportions[a] || null,
        color: t.color,
        id: t.id
      }));
      ye("selectDatapoint", { datapoint: l, period: V.value[a] });
    }
    function Be(a) {
      q.value = a, ee.value = !0;
      const l = e.value.style.chart.tooltip.customFormat, t = JSON.parse(JSON.stringify(x.value)).map((n) => ({
        name: n.name,
        value: n.series[a] === 0 ? 0 : (n.signedSeries[a] === -1 && n.series[a] >= 0 ? -n.series[a] : n.series[a]) || null,
        proportion: n.proportions[a] || null,
        color: n.color,
        id: n.id
      })), o = t.map((n) => Math.abs(n.value)).reduce((n, u) => n + u, 0);
      if (rt(l) && Dt(() => l({
        seriesIndex: a,
        datapoint: t,
        series: x.value,
        config: e.value
      })))
        be.value = l({
          seriesIndex: a,
          datapoint: t,
          series: x.value,
          config: e.value
        });
      else {
        const {
          showValue: n,
          showPercentage: u,
          borderColor: z,
          roundingValue: F,
          roundingPercentage: D
        } = e.value.style.chart.tooltip;
        let Q = "";
        V.value[a] && V.value[a].text && e.value.style.chart.tooltip.showTimeLabel && (Q += `<div style="width:100%;text-align:center;border-bottom:1px solid ${z};padding-bottom:6px;margin-bottom:3px;">${V.value[a].text}</div>`);
        const E = [
          n && u ? "(" : "",
          n && u ? ")" : ""
        ];
        t.reverse().forEach(($) => {
          Q += `
                <div style="display:flex;flex-direction:row;align-items:center;gap:4px">
                    <svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${e.value.style.chart.bars.gradient.show ? `url(#gradient_${$.id})` : $.color}"/></svg>
                    ${$.name}${n || u ? ":" : ""} ${n ? W({
            p: e.value.style.chart.bars.dataLabels.prefix,
            v: $.value,
            s: e.value.style.chart.bars.dataLabels.suffix,
            r: F
          }) : ""} ${E[0]}${u ? W({
            v: isNaN($.value / o) ? 0 : Math.abs($.value) / o * 100,
            // Negs are absed to show relative proportion to absolute total. It's opinionated.
            s: "%",
            r: D
          }) : ""}${E[1]}
                </div>
            `;
        }), be.value = `<div>${Q}</div>`;
      }
    }
    function bt(a) {
      te.value = a, ke.value += 1;
    }
    function Ue() {
      L.value.showTable = !L.value.showTable;
    }
    function We() {
      L.value.dataLabels.show = !L.value.dataLabels.show;
    }
    function Ye() {
      L.value.showTooltip = !L.value.showTooltip;
    }
    function ft() {
      return x.value;
    }
    const Xe = k(() => {
      if (x.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
      const a = x.value.map(({ name: t, color: o }) => ({
        label: t,
        color: o
      })), l = [];
      for (let t = c.value.start; t < c.value.end; t += 1) {
        const o = [e.value.style.chart.grid.x.timeLabels.values[t] || t + 1];
        A.value.forEach((n) => {
          o.push(Number((n.series[t] || 0).toFixed(e.value.table.td.roundingValue)));
        }), l.push(o);
      }
      return { head: a, body: l };
    });
    function Ge() {
      const a = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [""]], l = ["", ...Xe.value.head.map((u) => u.label)], t = Xe.value.body, o = a.concat([l]).concat(t), n = Et(o);
      Ht({ csvContent: n, title: e.value.style.chart.title.text || "vue-ui-stackbar" });
    }
    const re = k(() => {
      const a = [""].concat(x.value.map((n) => n.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');
      let l = [];
      for (let n = 0; n < R.value; n += 1) {
        const u = x.value.map((z) => z.series[n] ?? 0).reduce((z, F) => z + F, 0);
        l.push([e.value.style.chart.grid.x.timeLabels.values.slice(c.value.start, c.value.end)[n] ?? n + 1].concat(x.value.map((z) => (z.series[n] ?? 0).toFixed(e.value.table.td.roundingValue))).concat((u ?? 0).toFixed(e.value.table.td.roundingValue)));
      }
      const 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
      }, o = [e.value.table.columnNames.period].concat(x.value.map((n) => n.name)).concat(e.value.table.columnNames.total);
      return { head: a, body: l.slice(0, c.value.end - c.value.start), config: t, colNames: o };
    });
    function mt(a, l) {
      if (ye("selectLegend", x.value.find((t) => t.absoluteIndex === a)), _.value.includes(l.id))
        _.value = _.value.filter((t) => t !== l.id);
      else {
        if (_.value.length === A.value.length - 1) return;
        _.value.push(l.id);
      }
    }
    const Je = k(() => A.value.map((a, l) => ({
      ...a,
      shape: "square"
    })).map((a) => ({
      ...a,
      opacity: _.value.includes(a.id) ? 0.5 : 1,
      segregate: () => mt(a.absoluteIndex, a),
      isSegregated: _.value.includes(a.id)
    }))), pt = k(() => ({
      cy: "stackbar-legend",
      backgroundColor: e.value.style.chart.legend.backgroundColor,
      color: e.value.style.chart.legend.color,
      fontSize: e.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
    })), se = y(!1);
    function me() {
      se.value = !se.value;
    }
    function qe(a, l) {
      const t = JSON.parse(JSON.stringify(x.value)).map((o) => ({
        name: o.name,
        value: o.series[l] === 0 ? 0 : (o.signedSeries[l] === -1 && o.series[l] >= 0 ? -o.series[l] : o.series[l]) || null,
        proportion: o.proportions[l] || null,
        color: o.color,
        id: o.id
      }));
      ye("selectTimeLabel", {
        datapoint: t,
        absoluteIndex: a.absoluteIndex,
        label: a.text
      });
    }
    return nt({
      getData: ft,
      generatePdf: Oe,
      generateCsv: Ge,
      generateImage: Pe,
      toggleTable: Ue,
      toggleLabels: We,
      toggleTooltip: Ye,
      toggleAnnotator: me
    }), (a, l) => (r(), i("div", {
      id: `stackbar_${ge.value}`,
      ref_key: "stackbarChart",
      ref: X,
      class: pe({ "vue-ui-stackbar": !0, "vue-data-ui-wrapper-fullscreen": te.value }),
      style: B(`background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color};font-family:${e.value.style.fontFamily}; position: relative; ${e.value.responsive ? "height: 100%" : ""}`),
      onMouseenter: l[6] || (l[6] = () => p($e)(!0)),
      onMouseleave: l[7] || (l[7] = () => p($e)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (r(), J(ea, {
        key: 0,
        parent: X.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: se.value,
        onClose: me
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : d("", !0),
      w(a.$slots, "userConfig", {}, void 0, !0),
      e.value.style.chart.title.text ? (r(), i("div", {
        key: 1,
        ref_key: "chartTitle",
        ref: we,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        ue(Jt, {
          config: {
            title: {
              cy: "stackbar-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "stackbar-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"])
      ], 512)) : d("", !0),
      e.value.userOptions.show && Y.value && (p(Me) || p(Se)) ? (r(), J(Yt, {
        ref: "details",
        key: `user_option_${ke.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: p(Ne),
        isImaging: p(Ie),
        uid: ge.value,
        hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasLabel: e.value.userOptions.buttons.labels,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: te.value,
        chartElement: X.value,
        position: e.value.userOptions.position,
        isTooltip: L.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: se.value,
        onToggleFullscreen: bt,
        onGeneratePdf: p(Oe),
        onGenerateCsv: Ge,
        onGenerateImage: p(Pe),
        onToggleTable: Ue,
        onToggleLabels: We,
        onToggleTooltip: Ye,
        onToggleAnnotator: me,
        style: B({
          visibility: p(Me) ? p(Se) ? "visible" : "hidden" : "visible"
        })
      }, $t({ _: 2 }, [
        a.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: C(() => [
            w(a.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        a.$slots.optionPdf ? {
          name: "optionPdf",
          fn: C(() => [
            w(a.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        a.$slots.optionCsv ? {
          name: "optionCsv",
          fn: C(() => [
            w(a.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        a.$slots.optionImg ? {
          name: "optionImg",
          fn: C(() => [
            w(a.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        a.$slots.optionTable ? {
          name: "optionTable",
          fn: C(() => [
            w(a.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        a.$slots.optionLabels ? {
          name: "optionLabels",
          fn: C(() => [
            w(a.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        a.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: C(({ toggleFullscreen: t, isFullscreen: o }) => [
            w(a.$slots, "optionFullscreen", O(P({ toggleFullscreen: t, isFullscreen: o })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        a.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: C(({ toggleAnnotator: t, isAnnotator: o }) => [
            w(a.$slots, "optionAnnotator", O(P({ toggleAnnotator: t, isAnnotator: o })), void 0, !0)
          ]),
          key: "7"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : d("", !0),
      Y.value ? (r(), i("svg", {
        key: 3,
        xmlns: p(Vt),
        viewBox: `0 0 ${s.value.chartWidth <= 0 ? 10 : s.value.chartWidth} ${s.value.chartHeight <= 0 ? 10 : s.value.chartHeight}`,
        style: B(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        ue(jt),
        e.value.style.chart.bars.gradient.show ? (r(), i("defs", ra, [
          (r(!0), i(h, null, f(x.value, (t, o) => (r(), i("linearGradient", {
            id: `gradient_${t.id}`,
            x1: "0%",
            y1: "0%",
            x2: "0%",
            y2: "100%"
          }, [
            U("stop", {
              offset: "0%",
              "stop-color": t.color
            }, null, 8, ia),
            U("stop", {
              offset: "61.8%",
              "stop-color": p(Ft)(t.color, e.value.style.chart.bars.gradient.intensity / 100)
            }, null, 8, na),
            U("stop", {
              offset: "100%",
              "stop-color": t.color
            }, null, 8, ua)
          ], 8, sa))), 256))
        ])) : d("", !0),
        e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "vertical" ? (r(!0), i(h, { key: 1 }, f(N.value, (t, o) => (r(), i("line", {
          x1: s.value.left,
          x2: s.value.right,
          y1: t.y,
          y2: t.y,
          stroke: e.value.style.chart.grid.x.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, ca))), 256)) : d("", !0),
        e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "horizontal" ? (r(!0), i(h, { key: 2 }, f(c.value.end - c.value.start + 1, (t, o) => (r(), i("line", {
          x1: s.value.left,
          x2: s.value.right,
          y1: s.value.top + v.value * o,
          y2: s.value.top + v.value * o,
          stroke: e.value.style.chart.grid.y.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, va))), 256)) : d("", !0),
        e.value.style.chart.grid.y.showVerticalLines && e.value.orientation === "vertical" ? (r(!0), i(h, { key: 3 }, f(c.value.end - c.value.start + 1, (t, o) => (r(), i("line", {
          x1: s.value.left + v.value * o,
          x2: s.value.left + v.value * o,
          y1: s.value.top,
          y2: s.value.bottom,
          stroke: e.value.style.chart.grid.y.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, ha))), 256)) : d("", !0),
        e.value.style.chart.grid.x.showHorizontalLines && e.value.orientation === "horizontal" ? (r(!0), i(h, { key: 4 }, f(N.value, (t, o) => (r(), i("line", {
          x1: t.horizontal_x,
          x2: t.horizontal_x,
          y1: s.value.top,
          y2: s.value.bottom,
          stroke: e.value.style.chart.grid.x.axisColor,
          "stroke-width": 1,
          "stroke-linecap": "round"
        }, null, 8, da))), 256)) : d("", !0),
        (r(!0), i(h, null, f(x.value, (t, o) => (r(), i("g", null, [
          e.value.orientation === "vertical" ? (r(!0), i(h, { key: 0 }, f(t.x, (n, u) => (r(), i("rect", {
            x: n,
            y: t.y[u] < 0 ? 0 : t.y[u],
            height: t.height[u] < 0 ? 1e-4 : t.height[u],
            rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
            width: v.value * (1 - e.value.style.chart.bars.gapRatio / 2),
            fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.bars.strokeWidth,
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            class: pe({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": Z.value })
          }, null, 10, ya))), 256)) : (r(!0), i(h, { key: 1 }, f(t.horizontal_x, (n, u) => (r(), i("rect", {
            x: n,
            y: t.horizontal_y[u] < 0 ? 0 : t.horizontal_y[u],
            width: t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u],
            rx: e.value.style.chart.bars.borderRadius > t.height[u] / 2 ? (t.height[u] < 0 ? 0 : t.height[u]) / 2 : e.value.style.chart.bars.borderRadius,
            height: v.value * (1 - e.value.style.chart.bars.gapRatio / 2),
            fill: e.value.style.chart.bars.gradient.show ? `url(#gradient_${t.id})` : t.color,
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.bars.strokeWidth,
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            class: pe({ "vue-data-ui-bar-animated": e.value.useCssAnimation, "vue-data-ui-bar-transition": Z.value })
          }, null, 10, ga))), 256))
        ]))), 256)),
        e.value.style.chart.grid.x.showAxis ? (r(), i("line", {
          key: 5,
          x1: s.value.left,
          x2: s.value.right,
          y1: s.value.bottom,
          y2: s.value.bottom,
          stroke: e.value.style.chart.grid.x.axisColor,
          "stroke-width": e.value.style.chart.grid.x.axisThickness,
          "stroke-linecap": "round",
          "stroke-linejoin": "round"
        }, null, 8, ba)) : d("", !0),
        e.value.style.chart.grid.y.showAxis && !e.value.style.chart.bars.distributed ? (r(), i("line", {
          key: 6,
          x1: s.value.left,
          x2: s.value.left,
          y1: s.value.top,
          y2: s.value.bottom,
          stroke: e.value.style.chart.grid.y.axisColor,
          "stroke-width": e.value.style.chart.grid.y.axisThickness,
          "stroke-linecap": "round",
          "stroke-linejoin": "round"
        }, null, 8, fa)) : d("", !0),
        e.value.style.chart.grid.x.axisName.show && e.value.style.chart.grid.x.axisName.text ? (r(), i("text", {
          key: 7,
          x: s.value.left + s.value.width / 2,
          y: s.value.chartHeight + e.value.style.chart.grid.x.axisName.offsetY,
          "font-size": e.value.style.chart.grid.x.axisName.fontSize,
          fill: e.value.style.chart.grid.x.axisName.color,
          "font-weight": e.value.style.chart.grid.x.axisName.bold ? "bold" : "normal",
          "text-anchor": "middle"
        }, S(e.value.style.chart.grid.x.axisName.text), 9, ma)) : d("", !0),
        e.value.style.chart.grid.y.axisName.show && e.value.style.chart.grid.y.axisName.text ? (r(), i("text", {
          key: 8,
          transform: `translate(${e.value.style.chart.grid.y.axisName.fontSize + e.value.style.chart.grid.y.axisName.offsetX}, ${s.value.top + s.value.height / 2}) rotate(-90)`,
          "font-size": e.value.style.chart.grid.y.axisName.fontSize,
          fill: e.value.style.chart.grid.y.axisName.color,
          "font-weight": e.value.style.chart.grid.y.axisName.bold ? "bold" : "normal",
          "text-anchor": "middle"
        }, S(e.value.style.chart.grid.y.axisName.text), 9, pa)) : d("", !0),
        L.value.dataLabels.show && e.value.orientation === "vertical" ? (r(), i(h, { key: 9 }, [
          (r(!0), i(h, null, f(x.value, (t, o) => (r(), i("g", null, [
            (r(!0), i(h, null, f(t.x, (n, u) => (r(), i("text", {
              x: n + v.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2,
              y: t.y[u] + t.height[u] / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
              "font-size": e.value.style.chart.bars.dataLabels.fontSize,
              fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? p(ot)(t.color) : e.value.style.chart.bars.dataLabels.color,
              "font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
              "text-anchor": "middle"
            }, S(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? Ee(t.proportions[u] * 100, t, o, u) : oe(t.series[u], t, o, u, t.signedSeries[u])), 9, xa))), 256))
          ]))), 256)),
          e.value.style.chart.bars.totalValues.show && x.value.length > 1 ? (r(), i("g", ka, [
            (r(!0), i(h, null, f(De.value, (t, o) => (r(), i("text", {
              x: s.value.left + v.value * o + v.value / 2,
              y: s.value.top - e.value.style.chart.bars.totalValues.fontSize / 3,
              "text-anchor": "middle",
              "font-size": e.value.style.chart.bars.totalValues.fontSize,
              "font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
              fill: e.value.style.chart.bars.totalValues.color
            }, S(oe(t.value, t, o, t.sign)), 9, wa))), 256))
          ])) : d("", !0)
        ], 64)) : d("", !0),
        L.value.dataLabels.show && e.value.orientation === "horizontal" ? (r(), i(h, { key: 10 }, [
          (r(!0), i(h, null, f(x.value, (t, o) => (r(), i("g", null, [
            (r(!0), i(h, null, f(t.horizontal_x, (n, u) => (r(), i("text", {
              x: n + (t.horizontal_width[u] < 0 ? 1e-4 : t.horizontal_width[u]) / 2,
              y: t.horizontal_y[u] + v.value * (1 - e.value.style.chart.bars.gapRatio / 2) / 2 + e.value.style.chart.bars.dataLabels.fontSize / 3,
              "font-size": e.value.style.chart.bars.dataLabels.fontSize,
              fill: e.value.style.chart.bars.dataLabels.adaptColorToBackground ? p(ot)(t.color) : e.value.style.chart.bars.dataLabels.color,
              "font-weight": e.value.style.chart.bars.dataLabels.bold ? "bold" : "normal",
              "text-anchor": "middle"
            }, S(e.value.style.chart.bars.showDistributedPercentage && e.value.style.chart.bars.distributed ? Ee(t.proportions[u] * 100, t, o, u) : oe(t.series[u], t, o, u, t.signedSeries[u])), 9, za))), 256))
          ]))), 256)),
          e.value.style.chart.bars.totalValues.show && x.value.length > 1 ? (r(), i("g", Ca, [
            (r(!0), i(h, null, f(De.value, (t, o) => (r(), i("text", {
              x: s.value.right + e.value.style.chart.bars.totalValues.fontSize / 3,
              y: s.value.top + v.value * o + v.value / 2,
              "text-anchor": "start",
              "font-size": e.value.style.chart.bars.totalValues.fontSize,
              "font-weight": e.value.style.chart.bars.totalValues.bold ? "bold" : "normal",
              fill: e.value.style.chart.bars.totalValues.color
            }, S(oe(t.value, t, o, t.sign)), 9, La))), 256))
          ])) : d("", !0)
        ], 64)) : d("", !0),
        e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "vertical" ? (r(), i(h, { key: 11 }, [
          (r(!0), i(h, null, f(N.value, (t, o) => (r(), i("line", {
            x1: s.value.left,
            x2: s.value.left - 6,
            y1: t.y,
            y2: t.y,
            stroke: e.value.style.chart.grid.x.axisColor,
            "stroke-width": 1
          }, null, 8, _a))), 256)),
          (r(!0), i(h, null, f(N.value, (t, o) => (r(), i("text", {
            x: t.x,
            y: t.y + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
            "font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
            "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
            fill: e.value.style.chart.grid.y.axisLabels.color,
            "text-anchor": "end"
          }, S(p(W)({
            p: e.value.style.chart.bars.dataLabels.prefix,
            v: t.value,
            s: e.value.style.chart.bars.dataLabels.suffix,
            r: e.value.style.chart.grid.y.axisLabels.rounding
          })), 9, Sa))), 256))
        ], 64)) : d("", !0),
        e.value.style.chart.grid.y.axisLabels.show && !e.value.style.chart.bars.distributed && e.value.orientation === "horizontal" ? (r(), i(h, { key: 12 }, [
          (r(!0), i(h, null, f(N.value, (t, o) => (r(), i("line", {
            x1: t.horizontal_x,
            x2: t.horizontal_x,
            y1: s.value.bottom,
            y2: s.value.bottom + 6,
            stroke: e.value.style.chart.grid.x.axisColor,
            "stroke-width": 1,
            "stroke-linecap": "round"
          }, null, 8, $a))), 256)),
          (r(!0), i(h, null, f(N.value, (t, o) => (r(), i("text", {
            "font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
            "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
            fill: e.value.style.chart.grid.y.axisLabels.color,
            "text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
            transform: `translate(${t.horizontal_x}, ${s.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${e.value.style.chart.grid.x.timeLabels.rotation})`
          }, S(p(W)({
            p: e.value.style.chart.bars.dataLabels.prefix,
            v: t.value,
            s: e.value.style.chart.bars.dataLabels.suffix,
            r: e.value.style.chart.grid.y.axisLabels.rounding
          })), 9, Ma))), 256))
        ], 64)) : d("", !0),
        e.value.style.chart.grid.x.timeLabels.show && e.value.orientation === "vertical" ? (r(), i(h, { key: 13 }, [
          a.$slots["time-label"] ? (r(), i("g", Ta, [
            (r(!0), i(h, null, f(V.value, (t, o) => (r(), i("g", null, [
              w(a.$slots, "time-label", O(P({
                x: s.value.left + v.value * o + v.value / 2,
                y: s.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY,
                fontSize: e.value.style.chart.grid.x.timeLabels.fontSize,
                fill: e.value.style.chart.grid.x.timeLabels.color,
                transform: `translate(${s.value.left + v.value * o + v.value / 2}, ${s.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${e.value.style.chart.grid.x.timeLabels.rotation})`,
                absoluteIndex: t.absoluteIndex,
                content: t.text,
                textAnchor: e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
                show: !0
              })), void 0, !0)
            ]))), 256))
          ])) : (r(), i("g", Na, [
            (r(!0), i(h, null, f(V.value, (t, o) => (r(), i("text", {
              "text-anchor": e.value.style.chart.grid.x.timeLabels.rotation > 0 ? "start" : e.value.style.chart.grid.x.timeLabels.rotation < 0 ? "end" : "middle",
              "font-size": e.value.style.chart.grid.x.timeLabels.fontSize,
              "font-weight": e.value.style.chart.grid.x.timeLabels.bold ? "bold" : "normal",
              fill: e.value.style.chart.grid.x.timeLabels.color,
              transform: `translate(${s.value.left + v.value * o + v.value / 2}, ${s.value.bottom + e.value.style.chart.grid.x.timeLabels.fontSize * 1.3 + e.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${e.value.style.chart.grid.x.timeLabels.rotation})`,
              style: {
                cursor: "pointer"
              },
              onClick: () => qe(t, o)
            }, S(t.text), 9, Ia))), 256))
          ]))
        ], 64)) : d("", !0),
        e.value.style.chart.grid.x.timeLabels.show && e.value.orientation === "horizontal" ? (r(), i(h, { key: 14 }, [
          a.$slots["time-label"] ? (r(), i("g", Oa, [
            (r(!0), i(h, null, f(V.value, (t, o) => (r(), i("g", null, [
              w(a.$slots, "time-label", O(P({
                x: s.value.left - 8,
                y: s.value.top + v.value * o + v.value / 2 + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
                fontSize: e.value.style.chart.grid.x.timeLabels.fontSize,
                fill: e.value.style.chart.grid.x.timeLabels.color,
                transform: null,
                absoluteIndex: t.absoluteIndex,
                content: t.text,
                textAnchor: "end",
                show: !0
              })), void 0, !0)
            ]))), 256))
          ])) : (r(), i("g", Pa, [
            (r(!0), i(h, null, f(V.value, (t, o) => (r(), i("text", {
              "text-anchor": "end",
              "font-size": e.value.style.chart.grid.y.axisLabels.fontSize,
              "font-weight": e.value.style.chart.grid.y.axisLabels.bold ? "bold" : "normal",
              fill: e.value.style.chart.grid.y.axisLabels.color,
              x: s.value.left - 8,
              y: s.value.top + v.value * o + v.value / 2 + e.value.style.chart.grid.y.axisLabels.fontSize / 3,
              style: {
                cursor: "pointer"
              },
              onClick: () => qe(t, o)
            }, S(t.text), 9, Aa))), 256))
          ]))
        ], 64)) : d("", !0),
        L.value.showTooltip && e.value.orientation === "vertical" ? (r(!0), i(h, { key: 15 }, f(c.value.end - c.value.start, (t, o) => (r(), i("rect", {
          x: s.value.left + o * v.value,
          y: s.value.top,
          width: v.value,
          height: s.value.height < 0 ? 0 : s.value.height,
          onClick: (n) => He(o),
          onMouseenter: (n) => Be(o),
          onMouseleave: l[0] || (l[0] = (n) => {
            q.value = null, ee.value = !1;
          }),
          fill: o === q.value ? e.value.style.chart.highlighter.color : "transparent",
          style: B({ opacity: e.value.style.chart.highlighter.opacity / 100 })
        }, null, 44, Ra))), 256)) : d("", !0),
        L.value.showTooltip && e.value.orientation === "horizontal" ? (r(!0), i(h, { key: 16 }, f(c.value.end - c.value.start, (t, o) => (r(), i("rect", {
          x: s.value.left,
          y: s.value.top + o * v.value,
          width: s.value.width < 0 ? 0 : s.value.width,
          height: v.value,
          onClick: (n) => He(o),
          onMouseenter: (n) => Be(o),
          onMouseleave: l[1] || (l[1] = (n) => {
            q.value = null, ee.value = !1;
          }),
          fill: o === q.value ? e.value.style.chart.highlighter.color : "transparent",
          style: B({ opacity: e.value.style.chart.highlighter.opacity / 100 })
        }, null, 44, Va))), 256)) : d("", !0),
        w(a.$slots, "svg", O(P({ ...s.value })), void 0, !0)
      ], 12, oa)) : d("", !0),
      a.$slots.watermark ? (r(), i("div", Fa, [
        w(a.$slots, "watermark", O(P({ isPrinting: p(Ne) || p(Ie) })), void 0, !0)
      ])) : d("", !0),
      Y.value ? d("", !0) : (r(), J(Qt, {
        key: 5,
        config: {
          type: "bar",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            bar: {
              axis: {
                color: "#CCCCCC"
              },
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      U("div", {
        ref_key: "chartSlicer",
        ref: Ce,
        style: B(`width:100%;background:${e.value.style.chart.backgroundColor}`),
        "data-html2canvas-ignore": ""
      }, [
        e.value.style.chart.zoom.show && R.value > 1 ? (r(), J(Xt, {
          ref_key: "slicerComponent",
          ref: G,
          key: `slicer_${_e.value}`,
          background: e.value.style.chart.zoom.color,
          borderColor: e.value.style.chart.backgroundColor,
          fontSize: e.value.style.chart.zoom.fontSize,
          useResetSlot: e.value.style.chart.zoom.useResetSlot,
          labelLeft: e.value.style.chart.grid.x.timeLabels.values[c.value.start] ? e.value.style.chart.grid.x.timeLabels.values[c.value.start] : "",
          labelRight: e.value.style.chart.grid.x.timeLabels.values[c.value.end - 1] ? e.value.style.chart.grid.x.timeLabels.values[c.value.end - 1] : "",
          textColor: e.value.style.chart.color,
          inputColor: e.value.style.chart.zoom.color,
          selectColor: e.value.style.chart.zoom.highlightColor,
          max: Math.max(...de.dataset.map((t) => t.series.length)),
          min: 0,
          valueStart: c.value.start,
          valueEnd: c.value.end,
          start: c.value.start,
          "onUpdate:start": l[2] || (l[2] = (t) => c.value.start = t),
          end: c.value.end,
          "onUpdate:end": l[3] || (l[3] = (t) => c.value.end = t),
          refreshStartPoint: e.value.style.chart.zoom.startIndex !== null ? e.value.style.chart.zoom.startIndex : 0,
          refreshEndPoint: e.value.style.chart.zoom.endIndex !== null ? e.value.style.chart.zoom.endIndex + 1 : Math.max(...de.dataset.map((t) => t.series.length)),
          onReset: Ve
        }, {
          "reset-action": C(({ reset: t }) => [
            w(a.$slots, "reset-action", O(P({ reset: t })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "start", "end", "refreshStartPoint", "refreshEndPoint"])) : d("", !0)
      ], 4),
      ue(Gt, {
        show: L.value.showTooltip && ee.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        fontSize: e.value.style.chart.tooltip.fontSize,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: X.value,
        content: be.value,
        isFullscreen: te.value,
        isCustom: p(rt)(e.value.style.chart.tooltip.customFormat)
      }, {
        "tooltip-before": C(() => [
          w(a.$slots, "tooltip-before", O(P({ ...xe.value })), void 0, !0)
        ]),
        "tooltip-after": C(() => [
          w(a.$slots, "tooltip-after", O(P({ ...xe.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      U("div", {
        ref_key: "chartLegend",
        ref: ze
      }, [
        e.value.style.chart.legend.show && Y.value ? (r(), J(qt, {
          key: 0,
          legendSet: Je.value,
          config: pt.value,
          onClickMarker: l[4] || (l[4] = ({ legend: t }) => t.segregate())
        }, {
          item: C(({ legend: t }) => [
            U("div", {
              onClick: (o) => t.segregate(),
              style: B(`opacity:${_.value.includes(t.id) ? 0.5 : 1}`)
            }, S(t.name), 13, Da)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : w(a.$slots, "legend", {
          key: 1,
          legend: Je.value
        }, void 0, !0)
      ], 512),
      a.$slots.source ? (r(), i("div", {
        key: 6,
        ref_key: "source",
        ref: Le,
        dir: "auto"
      }, [
        w(a.$slots, "source", {}, void 0, !0)
      ], 512)) : d("", !0),
      c.value.end - c.value.start < 200 ? (r(), J(Zt, {
        key: 7,
        hideDetails: "",
        config: {
          open: L.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: C(() => [
          ue(Kt, {
            colNames: re.value.colNames,
            head: re.value.head,
            body: re.value.body,
            config: re.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: l[5] || (l[5] = (t) => L.value.showTable = !1)
          }, {
            th: C(({ th: t }) => [
              U("div", { innerHTML: t }, null, 8, Ea)
            ]),
            td: C(({ td: t }) => [
              Mt(S(isNaN(Number(t)) ? t : p(W)({
                p: e.value.style.chart.bars.dataLabels.prefix,
                v: t,
                s: e.value.style.chart.bars.dataLabels.suffix,
                r: e.value.table.td.roundingValue
              })), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"])
        ]),
        _: 1
      }, 8, ["config"])) : d("", !0)
    ], 46, la));
  }
}, ol = /* @__PURE__ */ aa(Ha, [["__scopeId", "data-v-8c7297e5"]]);
export {
  ol as default
};
