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