import { ref as i, computed as x, useSlots as Ta, onMounted as aa, watch as A, nextTick as ce, onBeforeUnmount as Oa, openBlock as z, createElementBlock as K, normalizeStyle as B, normalizeClass as Ra, unref as S, createBlock as E, createCommentVNode as H, createSlots as Pa, withCtx as b, renderSlot as L, normalizeProps as Y, guardReactiveProps as V, createElementVNode as Q, createVNode as Fa, toDisplayString as la, createTextVNode as Ea } from "vue";
import { u as Da, c as Na, t as Aa, a as Ha, p as _, C as de, b as _a, D as we, i as ee, f as ae, Z as Ua, J as Wa, d as ta, a4 as Xa, o as Ba, e as Ya, x as oa, y as Va, q as Za, r as Ga, s as le, l as ja } from "./index-BVNcFEqn.js";
import { d as qa, c as Ja, a as ra, t as Ka, l as k, r as ze, b as D, p as ua, u as Qa } from "./useResponsive-CoxXLe23.js";
import { _ as el } from "./Tooltip-B-0uEV3l.js";
import { L as al } from "./Legend-DGUxLqhs.js";
import { _ as ll } from "./Title-DyUTj8GI.js";
import { S as tl } from "./Slicer-CopZgIzh.js";
import { u as ol, U as rl } from "./usePrinter-Bcfs_I6G.js";
import ul from "./vue-ui-accordion-GNblUy42.js";
import { D as sl } from "./DataTable-DX_jYNWG.js";
import nl from "./vue-ui-skeleton-Bgf16k10.js";
import { u as sa } from "./useNestedProp-D79dWdel.js";
import { P as il } from "./PenAndPaper-CzjoEhsO.js";
import { u as vl } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as cl } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const dl = ["id"], hl = ["onClick"], yl = {
  key: 2,
  class: "vue-data-ui-watermark"
}, fl = ["innerHTML"], gl = {
  __name: "vue-ui-xy-canvas",
  props: {
    dataset: {
      type: Array,
      default() {
        return [];
      }
    },
    config: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  emits: ["selectLegend"],
  setup(Se, { expose: na, emit: ia }) {
    const f = Se, { vue_ui_xy_canvas: va } = Da(), he = i(Na()), Z = i(null), M = i(null), G = i(null), s = i(null), y = i(1), R = i(1), te = i(!1), d = i(null), oe = i(""), $e = i(null), $ = i([]), U = i(1), N = i(!0), T = i(!0), ye = i(null), Ie = i(0), Me = i(0), re = i(!1), Te = i(null), Oe = i(null), Re = i(null), Pe = i(null), fe = i(0), ge = i(0), pe = i(0), me = x(() => !!f.dataset && f.dataset.length), ca = Ta();
    aa(() => {
      ca["chart-background"] && console.warn("VueUiXyCanvas does not support the #chart-background slot.");
    });
    const a = x({
      get: () => De(),
      set: (e) => e
    }), { userOptionsVisible: be, setUserOptionsVisibility: Fe, keepUserOptionState: Ee } = vl({ config: a.value });
    function De() {
      const e = sa({
        userConfig: f.config,
        defaultConfig: va
      });
      let l = {};
      return e.theme ? l = {
        ...sa({
          userConfig: Aa.vue_ui_xy_canvas[e.theme] || f.config,
          defaultConfig: e
        }),
        customPalette: Ha[e.theme] || _
      } : l = e, f.config && de(f.config, "style.chart.scale.min") ? l.style.chart.scale.min = f.config.style.chart.scale.min : l.style.chart.scale.min = null, f.config && de(f.config, "style.chart.scale.max") ? l.style.chart.scale.max = f.config.style.chart.scale.max : l.style.chart.scale.max = null, f.config && de(f.config, "style.chart.zoom.startIndex") ? l.style.chart.zoom.startIndex = f.config.style.chart.zoom.startIndex : l.style.chart.zoom.startIndex = null, f.config && de(f.config, "style.chart.zoom.endIndex") ? l.style.chart.zoom.endIndex = f.config.style.chart.zoom.endIndex : l.style.chart.zoom.endIndex = null, l;
    }
    A(() => f.config, (e) => {
      a.value = De(), be.value = !a.value.showOnChartHover, Le(), fe.value += 1, ge.value += 1, pe.value += 1;
    }, { deep: !0 }), A(() => f.dataset, () => {
      Le(), fe.value += 1, ge.value += 1, pe.value += 1;
    }, { deep: !0 });
    const Ne = i(a.value.style.chart.aspectRatio), { isPrinting: Ae, isImaging: He, generatePdf: _e, generateImage: Ue } = ol({
      elementId: `xy_canvas_${he.value}`,
      fileName: a.value.style.chart.title.text || "vue-ui-xy-canvas"
    }), u = i({
      showTable: a.value.table.show,
      showDataLabels: a.value.style.chart.dataLabels.show,
      stacked: a.value.style.chart.stacked,
      showTooltip: a.value.style.chart.tooltip.show
    });
    function da(e) {
      re.value = e, Me.value += 1;
    }
    const We = x(() => _a(a.value.customPalette)), I = x(() => W.value ? Math.max(...W.value.filter((e, l) => !$.value.includes(e.absoluteIndex)).map((e) => e.series.length)) : 0), t = x(() => {
      const e = y.value - y.value * (a.value.style.chart.paddingProportions.left + a.value.style.chart.paddingProportions.right);
      return {
        canvasWidth: y.value,
        canvasHeight: R.value,
        left: y.value * a.value.style.chart.paddingProportions.left,
        top: R.value * a.value.style.chart.paddingProportions.top,
        right: y.value - y.value * a.value.style.chart.paddingProportions.right,
        bottom: R.value - R.value * a.value.style.chart.paddingProportions.bottom,
        width: e,
        height: R.value - R.value * (a.value.style.chart.paddingProportions.top + a.value.style.chart.paddingProportions.bottom),
        slot: e / (r.value.end - r.value.start)
      };
    });
    function Xe(e, l) {
      return e / l;
    }
    function ha({ hasAutoScale: e, series: l, min: o, max: v, scale: c, yOffset: g, individualHeight: n, stackIndex: p = null }) {
      return l.map((w, Ce) => {
        const O = c.min < 0 ? Math.abs(c.min) : 0, P = Xe(w + O, O + c.max);
        let F, j;
        e && (F = Math.abs(c.min), j = Xe(w + F, c.max + F));
        let q = 0;
        return p === null ? q = t.value.bottom - t.value.height * (e ? j : P) : q = t.value.bottom - g - n * (e ? j : P), {
          x: t.value.left + t.value.slot * Ce + t.value.slot / 2,
          y: q,
          value: w
        };
      });
    }
    const m = x(() => {
      const e = a.value.style.chart.scale.min !== null ? a.value.style.chart.scale.min : Math.min(...W.value.filter((n, p) => !$.value.includes(n.absoluteIndex)).flatMap((n) => n.series.slice(r.value.start, r.value.end))), l = a.value.style.chart.scale.max !== null ? a.value.style.chart.scale.max : Math.max(...W.value.filter((n, p) => !$.value.includes(n.absoluteIndex)).flatMap((n) => n.series.slice(r.value.start, r.value.end))), o = we(e < 0 ? e : 0, l === e ? e + 1 < 0 ? 0 : e + 1 : l < 0 ? 0 : l, a.value.style.chart.scale.ticks), v = o.min < 0 ? Math.abs(o.min) : 0, c = t.value.bottom - t.value.height * (v / (o.max + v)), g = o.ticks.map((n) => ({
        y: t.value.bottom - t.value.height * ((n + v) / (o.max + v)),
        x: t.value.left - 8,
        value: n
      }));
      return {
        absoluteMin: v,
        max: l,
        min: e,
        scale: o,
        yLabels: g,
        zero: c
      };
    }), ya = x(() => h.value.map((e) => `
            <div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
                <svg viewBox="0 0 10 10" height="12" width="12">
                    <circle cx="5" cy="5" r="5" fill="${e.color}"/>
                </svg>
                <span>${e.name ? e.name + ": " : ""}</span>
                <span>${ee(
      a.value.style.chart.dataLabels.formatter,
      e.series[d.value],
      ae({
        p: e.prefix || "",
        v: e.series[d.value],
        s: e.suffix || "",
        r: e.rounding || 0
      }),
      { datapoint: e, seriesIndex: d.value }
    )}</span>
            </div>
        `)), W = x(() => f.dataset.map((e, l) => ({
      ...e,
      series: Ua({
        data: Wa(e.series),
        threshold: a.value.downsample.threshold
      }),
      absoluteIndex: l,
      color: ta(e.color || We.value[l] || _[l] || _[l % _.length])
    })));
    A(I, (e) => {
      e && Be();
    });
    const h = x(() => Xa(W.value.filter((e, l) => !$.value.includes(e.absoluteIndex))).map((e, l) => ({
      ...e,
      series: e.series.slice(r.value.start, r.value.end)
    })).map((e, l) => {
      let o = [null, void 0].includes(e.scaleMin) ? Math.min(...e.series) || 0 : e.scaleMin, v = [null, void 0].includes(e.scaleMax) ? Math.max(...e.series) || 1 : e.scaleMax;
      o === v && (o = o >= 0 ? v - 1 : o, v = v >= 0 ? v : o + 1);
      const g = {
        ratios: e.series.filter((J) => ![null, void 0].includes(J)).map((J) => (J - o) / (v - o)),
        valueMin: o,
        valueMax: v
      }, n = e.scaleSteps || a.value.style.chart.scale.ticks;
      let p;
      e.autoScaling ? p = we(g.valueMin, g.valueMax, n) : p = we(g.valueMin < 0 ? g.valueMin : 0, g.valueMax <= 0 ? 0 : g.valueMax, n);
      const w = u.value.stacked ? t.value.height * (1 - e.cumulatedStackRatio) : 0, Ce = u.value.stacked ? t.value.height / a.value.style.chart.stackGap : 0, O = u.value.stacked ? t.value.height * e.stackRatio - Ce : t.value.height, P = p.min < 0 ? Math.abs(p.min) : 0;
      let F;
      e.autoScaling && u.value.stacked && v <= 0 ? F = t.value.bottom - w - O : F = t.value.bottom - w - O * (P / (p.max + P));
      const j = p.ticks.map((J, Ma) => ({
        y: t.value.bottom - w - O * (Ma / (p.ticks.length - 1)),
        x: t.value.left - 8,
        value: J
      })), q = ha({
        hasAutoScale: u.value.stacked && e.autoScaling,
        series: e.series,
        min: u.value.stacked ? o : m.value.min,
        max: u.value.stacked ? v : m.value.max,
        scale: u.value.stacked ? p : m.value.scale,
        yOffset: w,
        individualHeight: O,
        stackIndex: u.value.stacked ? l : null
      });
      return {
        ...e,
        coordinatesLine: q,
        min: o,
        max: v,
        localScale: p,
        localZero: F,
        localMin: P,
        localYLabels: j,
        yOffset: w,
        individualHeight: O
      };
    })), r = i({
      start: 0,
      end: I.value
    });
    function Be() {
      Ye();
    }
    const X = i(null);
    async function Ye() {
      (a.value.style.chart.zoom.startIndex !== null || a.value.style.chart.zoom.endIndex !== null) && X.value ? (a.value.style.chart.zoom.startIndex !== null && (await ce(), await ce(), X.value && X.value.setStartValue(a.value.style.chart.zoom.startIndex)), a.value.style.chart.zoom.endIndex !== null && (await ce(), await ce(), X.value && X.value.setEndValue(fa(a.value.style.chart.zoom.endIndex + 1)))) : (r.value = {
        start: 0,
        end: I.value
      }, Ie.value += 1);
    }
    function fa(e) {
      const l = I.value;
      return e > l ? l : e < 0 || a.value.style.chart.zoom.startIndex !== null && e < a.value.style.chart.zoom.startIndex ? a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex + 1 : 1 : e;
    }
    const ga = x(() => h.value.filter((e) => ["line", "plot", void 0].includes(e.type))), C = x(() => h.value.filter((e) => e.type === "bar"));
    function pa() {
      if (!M.value)
        return;
      const e = G.value.offsetWidth, l = G.value.offsetHeight;
      M.value.width = e * U.value * 2, M.value.height = l * U.value * 2, y.value = e * U.value * 2, R.value = l * U.value * 2, s.value.scale(U.value, U.value), xe();
    }
    function ma() {
      if (s.value.clearRect(0, 0, 1e4, 1e4), s.value.fillStyle = a.value.style.chart.backgroundColor, s.value.fillRect(0, 0, t.value.canvasWidth, t.value.canvasHeight), u.value.stacked)
        a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength ? h.value.forEach((e) => {
          for (let l = 0; l < r.value.end - r.value.start + 1; l += 1)
            k(
              s.value,
              [
                {
                  x: t.value.left + t.value.slot * l,
                  y: t.value.bottom - e.yOffset - e.individualHeight
                },
                {
                  x: t.value.left + t.value.slot * l,
                  y: t.value.bottom - e.yOffset
                }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        }) : a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength && h.value.forEach((e) => {
          for (let l = r.value.start; l < r.value.end; l += 1)
            l % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 && k(
              s.value,
              [
                {
                  x: t.value.left + t.value.slot * (l - r.value.start) + t.value.slot / 2,
                  y: t.value.bottom - e.yOffset - e.individualHeight
                },
                {
                  x: t.value.left + t.value.slot * (l - r.value.start) + t.value.slot / 2,
                  y: t.value.bottom - e.yOffset
                }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        }), a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? h.value.forEach((e) => {
          e.localYLabels.forEach((l, o) => {
            o < e.localYLabels.length - 1 && ze(
              s.value,
              [
                { x: t.value.left, y: l.y },
                { x: t.value.right, y: l.y },
                { x: t.value.right, y: e.localYLabels[o + 1].y },
                { x: t.value.left, y: e.localYLabels[o + 1].y }
              ],
              {
                fillColor: o % 2 === 0 ? "transparent" : le(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
                strokeColor: "transparent"
              }
            );
          });
        }) : h.value.forEach((e) => {
          e.localYLabels.slice(r.value.start, r.value.end).forEach((l) => {
            k(
              s.value,
              [
                { x: t.value.left, y: l.y },
                { x: t.value.right, y: l.y }
              ],
              {
                color: a.value.style.chart.grid.x.horizontalLines.color
              }
            );
          });
        })), a.value.style.chart.grid.zeroLine.show && h.value.forEach((e) => {
          k(
            s.value,
            [
              { x: t.value.left, y: e.localZero },
              { x: t.value.right, y: e.localZero }
            ],
            {
              color: a.value.style.chart.grid.zeroLine.color,
              lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
            }
          );
        }), a.value.style.chart.grid.y.axisLabels.show && h.value.forEach((e) => {
          k(
            s.value,
            [
              { x: t.value.left, y: t.value.bottom - e.yOffset },
              { x: t.value.left, y: t.value.bottom - e.yOffset - e.individualHeight }
            ],
            {
              color: e.color
            }
          ), k(
            s.value,
            [
              { x: t.value.right, y: t.value.bottom - e.yOffset },
              { x: t.value.right, y: t.value.bottom - e.yOffset - e.individualHeight }
            ],
            {
              color: e.color
            }
          ), e.localYLabels.forEach((l, o) => {
            D(
              s.value,
              ee(
                a.value.style.chart.dataLabels.formatter,
                l.value,
                ae({
                  p: e.prefix || a.value.style.chart.grid.y.axisLabels.prefix || "",
                  v: l.value,
                  s: e.suffix || a.value.style.chart.grid.y.axisLabels.suffix || "",
                  r: e.rounding || a.value.style.chart.grid.y.axisLabels.rounding || 0
                }),
                { datapoint: l, seriesIndex: o }
              ),
              l.x + a.value.style.chart.grid.y.axisLabels.offsetX,
              l.y,
              {
                align: "right",
                font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
                color: e.color
              }
            );
          });
        }), h.value.forEach((e) => {
          D(
            s.value,
            e.name,
            y.value / 35,
            t.value.bottom - e.yOffset - e.individualHeight / 2,
            {
              align: "center",
              rotation: -90,
              color: e.color,
              font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`
            }
          );
        });
      else {
        if (a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start < a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
          for (let e = 0; e < r.value.end - r.value.start + 1; e += 1)
            k(
              s.value,
              [
                { x: t.value.left + t.value.slot * e, y: t.value.top },
                { x: t.value.left + t.value.slot * e, y: t.value.bottom }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        else if (a.value.style.chart.grid.y.verticalLines.show && r.value.end - r.value.start >= a.value.style.chart.grid.y.verticalLines.hideUnderXLength)
          for (let e = r.value.start; e < r.value.end; e += 1)
            e % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 && k(
              s.value,
              [
                { x: t.value.left + t.value.slot * (e - r.value.start) + t.value.slot / 2, y: t.value.top },
                { x: t.value.left + t.value.slot * (e - r.value.start) + t.value.slot / 2, y: t.value.bottom }
              ],
              {
                color: a.value.style.chart.grid.y.verticalLines.color
              }
            );
        a.value.style.chart.grid.x.horizontalLines.show && (a.value.style.chart.grid.x.horizontalLines.alternate ? m.value.yLabels.forEach((e, l) => {
          l < m.value.yLabels.length - 1 && ze(
            s.value,
            [
              { x: t.value.left, y: e.y },
              { x: t.value.right, y: e.y },
              { x: t.value.right, y: m.value.yLabels[l + 1].y },
              { x: t.value.left, y: m.value.yLabels[l + 1].y }
            ],
            {
              fillColor: l % 2 === 0 ? "transparent" : le(a.value.style.chart.grid.x.horizontalLines.color, a.value.style.chart.grid.x.horizontalLines.opacity),
              strokeColor: "transparent"
            }
          );
        }) : m.value.yLabels.forEach((e) => {
          k(
            s.value,
            [
              { x: t.value.left, y: e.y },
              { x: t.value.right, y: e.y }
            ],
            {
              color: a.value.style.chart.grid.x.horizontalLines.color
            }
          );
        })), a.value.style.chart.grid.y.showAxis && k(
          s.value,
          [
            { x: t.value.left, y: t.value.top },
            { x: t.value.left, y: t.value.bottom }
          ],
          {
            color: a.value.style.chart.grid.y.axisColor,
            lineWidth: a.value.style.chart.grid.y.axisThickness
          }
        ), a.value.style.chart.grid.x.showAxis && k(
          s.value,
          [
            { x: t.value.left, y: t.value.bottom },
            { x: t.value.right, y: t.value.bottom }
          ],
          {
            color: a.value.style.chart.grid.x.axisColor,
            lineWidth: a.value.style.chart.grid.x.axisThickness
          }
        ), a.value.style.chart.grid.zeroLine.show && k(
          s.value,
          [
            { x: t.value.left, y: m.value.zero },
            { x: t.value.right, y: m.value.zero }
          ],
          {
            color: a.value.style.chart.grid.zeroLine.color,
            lineDash: a.value.style.chart.grid.zeroLine.dashed ? [10, 10] : [0, 0]
          }
        ), a.value.style.chart.grid.y.axisLabels.show && m.value.yLabels.forEach((e, l) => {
          D(
            s.value,
            ee(
              a.value.style.chart.dataLabels.formatter,
              e.value,
              ae({
                p: a.value.style.chart.grid.y.axisLabels.prefix || "",
                v: e.value,
                s: a.value.style.chart.grid.y.axisLabels.suffix || "",
                r: a.value.style.chart.grid.y.axisLabels.rounding || 0
              }),
              { datapoint: e, seriesIndex: l }
            ),
            e.x + a.value.style.chart.grid.y.axisLabels.offsetX,
            e.y,
            {
              align: "right",
              font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
              color: a.value.style.chart.grid.y.axisLabels.color
            }
          );
        });
      }
      a.value.style.chart.grid.y.axisName && D(
        s.value,
        a.value.style.chart.grid.y.axisName,
        y.value - y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio * 1.2,
        t.value.bottom - t.value.height / 2,
        {
          font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
          color: a.value.style.chart.color,
          align: "center",
          rotation: 90
        }
      ), a.value.style.chart.grid.x.axisName && D(
        s.value,
        a.value.style.chart.grid.x.axisName,
        y.value / 2,
        R.value,
        {
          font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.axisLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
          color: a.value.style.chart.color,
          align: "center"
        }
      );
    }
    function ba(e) {
      for (let l = 0; l < e.coordinatesLine.length; l += 1) {
        const o = (d.value === l ? y.value / 150 : a.value.style.chart.line.plots.show ? y.value / 200 : 0) * a.value.style.chart.line.plots.radiusRatio;
        ra(
          s.value,
          { x: e.coordinatesLine[l].x, y: e.coordinatesLine[l].y },
          o,
          {
            color: a.value.style.chart.backgroundColor,
            fillStyle: e.color,
            strokeColor: "transparent"
          }
        );
      }
    }
    function xa(e) {
      for (let l = 0; l < e.coordinatesLine.length; l += 1)
        D(
          s.value,
          ee(
            a.value.style.chart.dataLabels.formatter,
            e.coordinatesLine[l].value,
            ae({
              p: e.prefix || "",
              v: e.coordinatesLine[l].value,
              s: e.suffix || "",
              r: e.rounding || 0
            }),
            { datapoint: e.coordinatesLine[l], seriesIndex: l }
          ),
          e.coordinatesLine[l].x,
          e.coordinatesLine[l].y + a.value.style.chart.dataLabels.offsetY,
          {
            align: "center",
            font: `${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
            color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color,
            strokeColor: a.value.style.chart.backgroundColor,
            lineWidth: 0.8
          }
        );
    }
    function La() {
      for (let e = r.value.start; e < r.value.end; e += 1)
        (r.value.end - r.value.start < a.value.style.chart.grid.y.timeLabels.modulo || r.value.end - r.value.start >= a.value.style.chart.grid.y.timeLabels.modulo && (e % Math.floor((r.value.end - r.value.start) / a.value.style.chart.grid.y.timeLabels.modulo) === 0 || e === d.value + r.value.start)) && D(
          s.value,
          a.value.style.chart.grid.y.timeLabels.values[e] || e + 1,
          t.value.left + t.value.slot * (e - r.value.start) + t.value.slot / 2,
          t.value.bottom + y.value / a.value.style.chart.grid.y.timeLabels.offsetY,
          {
            align: a.value.style.chart.grid.y.timeLabels.rotation === 0 ? "center" : a.value.style.chart.grid.y.timeLabels.rotation > 0 ? "left" : "right",
            font: `${Math.round(y.value / 40 * a.value.style.chart.grid.y.timeLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
            color: le(a.value.style.chart.grid.y.timeLabels.color, d.value !== null ? d.value + r.value.start === e ? 100 : 20 : 100),
            rotation: a.value.style.chart.grid.y.timeLabels.rotation
          }
        );
    }
    function Ve() {
      k(
        s.value,
        [
          { x: t.value.left + t.value.slot * d.value + t.value.slot / 2, y: t.value.top },
          { x: t.value.left + t.value.slot * d.value + t.value.slot / 2, y: t.value.bottom }
        ],
        {
          color: a.value.style.chart.selector.color,
          lineDash: a.value.style.chart.selector.dashed ? [8, 8] : [0, 0],
          lineWidth: 2,
          linceCap: "round"
        }
      );
    }
    function ka() {
      C.value.forEach((e, l) => {
        for (let o = 0; o < e.coordinatesLine.length; o += 1)
          ze(
            s.value,
            [
              {
                x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / C.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * C.value.length) * l)),
                y: u.value.stacked ? e.localZero : m.value.zero
              },
              {
                x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / C.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * C.value.length) * l)) + t.value.slot * 0.8 / (u.value.stacked ? 1 : C.value.length),
                y: u.value.stacked ? e.localZero : m.value.zero
              },
              {
                x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / C.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * C.value.length) * l)) + t.value.slot * 0.8 / (u.value.stacked ? 1 : C.value.length),
                y: e.coordinatesLine[o].y
              },
              {
                x: t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / C.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * C.value.length) * l)),
                y: e.coordinatesLine[o].y
              }
            ],
            {
              strokeColor: a.value.style.chart.backgroundColor,
              gradient: {
                type: "linear",
                start: {
                  x: e.coordinatesLine[o].x,
                  y: e.coordinatesLine[o].y
                },
                end: {
                  x: e.coordinatesLine[o].x,
                  y: u.value.stacked ? e.localZero : m.value.zero
                },
                stops: [
                  { offset: 0, color: e.color },
                  { offset: 1, color: ja(e.color, 0.5) }
                ]
              }
            }
          ), u.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && D(
            s.value,
            ee(
              a.value.style.chart.dataLabels.formatter,
              e.coordinatesLine[o].value,
              ae({
                p: e.prefix || "",
                v: e.coordinatesLine[o].value,
                s: e.suffix || "",
                r: e.rounding || 0
              }),
              { datapoint: e.coordinatesLine[o], seriesIndex: o }
            ),
            t.value.left + t.value.slot * o + t.value.slot / 10 + (u.value.stacked ? 0 : t.value.slot / C.value.length * l - (l === 0 ? 0 : t.value.slot / (5 * C.value.length) * l)) + t.value.slot * 0.4 / (u.value.stacked ? 1 : C.value.length),
            (e.coordinatesLine[o].value < 0 ? u.value.stacked ? e.localZero : m.value.zero : e.coordinatesLine[o].y) + a.value.style.chart.dataLabels.offsetY,
            {
              align: "center",
              font: `${Math.round(y.value / 40 * a.value.style.chart.dataLabels.fontSizeRatio)}px ${a.value.style.fontFamily}`,
              color: a.value.style.chart.dataLabels.useSerieColor ? e.color : a.value.style.chart.dataLabels.color,
              strokeColor: a.value.style.chart.backgroundColor,
              lineWidth: 0.8
            }
          );
      });
    }
    function Ca(e) {
      e.useArea ? u.value.stacked ? ua(
        s.value,
        [{ x: e.coordinatesLine[0].x, y: e.localZero }, ...e.coordinatesLine, { x: e.coordinatesLine.at(-1).x, y: e.localZero }],
        {
          fillColor: le(e.color, a.value.style.chart.area.opacity),
          strokeColor: "transparent"
        }
      ) : ua(
        s.value,
        [{ x: e.coordinatesLine[0].x, y: m.value.zero }, ...e.coordinatesLine, { x: e.coordinatesLine.at(-1).x, y: m.value.zero }],
        {
          fillColor: le(e.color, a.value.style.chart.area.opacity),
          strokeColor: "transparent"
        }
      ) : k(s.value, e.coordinatesLine, {
        color: e.color,
        lineWidth: 3
      });
    }
    function wa() {
      h.value.forEach((e, l) => {
        k(
          s.value,
          [
            { x: t.value.left, y: t.value.bottom - e.yOffset },
            { x: t.value.right, y: t.value.bottom - e.yOffset }
          ],
          {
            color: a.value.style.chart.grid.x.horizontalLines.color,
            lineWidth: 1
          }
        );
      });
    }
    function xe() {
      ma(), N.value ? (T.value && d.value !== null && a.value.style.chart.selector.show && Ve(), ka(), u.value.stacked && a.value.style.chart.grid.x.showAxis && wa(), ga.value.forEach((e) => {
        (e.type === "line" || !e.type) && Ca(e), T.value && (ba(e), u.value.showDataLabels && [!0, void 0].includes(e.dataLabels) && xa(e));
      }), ye.value = Ja(M.value)) : (ye.value && (s.value.clearRect(0, 0, 1e4, 1e4), s.value.drawImage(ye.value, 0, 0)), T.value && d.value !== null && a.value.style.chart.selector.show && Ve(), T.value && d.value !== null && h.value.forEach((e) => {
        if (e.type === "line" || !e.type || e.type === "plot") {
          if (!e.coordinatesLine[d.value]) return;
          e.coordinatesLine[d.value].x !== void 0 && e.coordinatesLine[d.value].y !== void 0 && ra(
            s.value,
            {
              x: e.coordinatesLine[d.value].x,
              y: e.coordinatesLine[d.value].y
            },
            y.value / 150 * a.value.style.chart.line.plots.radiusRatio,
            {
              color: a.value.style.chart.backgroundColor,
              fillStyle: e.color,
              strokeColor: "transparent"
            }
          );
        }
      })), a.value.style.chart.grid.y.timeLabels.show && La(), N.value = !1;
    }
    const ue = qa(() => {
      T.value = !0, pa();
    }, I.value > 200 ? 10 : 1, !T.value);
    function za(e) {
      const { left: l } = M.value.getBoundingClientRect(), o = e.clientX - l;
      if (o * 2 < t.value.left || o * 2 > t.value.right) {
        te.value = !1, d.value = null;
        return;
      }
      const v = o * 2 - t.value.left;
      if (d.value = Math.floor(v / t.value.slot), te.value = !0, !T.value) return;
      let c = "";
      const g = a.value.style.chart.tooltip.customFormat;
      oa(g) && Va(() => g({
        seriesIndex: d.value,
        datapoint: h.value.map((n) => ({
          shape: n.shape || null,
          name: n.name,
          color: n.color,
          type: n.type || "line",
          value: n.series.find((p, w) => w === d.value)
        })),
        series: h.value,
        config: a.value
      })) ? oe.value = g({
        seriesIndex: d.value,
        datapoint: h.value.map((n) => ({
          shape: n.shape || null,
          name: n.name,
          color: n.color,
          type: n.type || "line",
          value: n.series.find((p, w) => w === d.value)
        })),
        series: h.value,
        config: a.value
      }) : (a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[d.value] && (c += `<div style="padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid ${a.value.style.chart.tooltip.borderColor}; width:100%">${a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[d.value]}</div>`), c += ya.value.join(""), oe.value = c), T.value = !1;
    }
    A(() => d.value, (e) => {
      ue();
    }), A(() => r.value, (e) => {
      N.value = !0, xe();
    }, {
      deep: !0
    }), A(() => u.value.showDataLabels, (e) => {
      N.value = !0, xe();
    }), A(() => u.value.stacked, (e) => {
      N.value = !0, T.value = !0, ue();
    });
    function Sa() {
      te.value = !1, d.value = null, oe.value = "";
    }
    const se = i(null), ne = i(null);
    aa(() => {
      Le();
    });
    function Le() {
      if (Ba(f.dataset) ? Ya({
        componentName: "VueUiXyCanvas",
        type: "dataset"
      }) : M.value && (s.value = M.value.getContext("2d", { willReadFrequently: !0 })), a.value.responsive) {
        const e = Ka(() => {
          const { width: l, height: o } = Qa({
            chart: Z.value,
            title: a.value.style.chart.title.text ? Te.value : null,
            legend: a.value.style.chart.legend.show ? Oe.value : null,
            slicer: a.value.style.chart.zoom.show && I.value > 1 ? Re.value : null,
            source: Pe.value
          });
          Ne.value = `${l} / ${o}`;
        });
        se.value = new ResizeObserver(e), se.value.observe(Z.value.parentNode);
      }
      ne.value = new ResizeObserver((e) => {
        for (const l of e)
          l.contentBoxSize && G.value && (N.value = !0, ue());
      }), ne.value.observe(G.value), Ye();
    }
    Oa(() => {
      ne.value && ne.value.disconnect(), se.value && se.value.disconnect();
    });
    function Ze(e) {
      ia("selectLegend", h.value.find((l) => l.absoluteIndex === e)), $.value.includes(e) ? $.value = $.value.filter((l) => l !== e) : $.value.push(e), N.value = !0, ue();
    }
    const Ge = x(() => W.value.map((e, l) => ({
      ...e,
      name: e.name,
      color: ta(e.color) || We.value[l] || _[l] || _[l % _.length],
      shape: e.shape || "circle",
      prefix: e.prefix || "",
      suffix: e.suffix || "",
      rounding: e.rounding || 0
    })).map((e) => ({
      ...e,
      opacity: $.value.includes(e.absoluteIndex) ? 0.5 : 1,
      segregate: () => Ze(e.absoluteIndex),
      isSegregated: $.value.includes(e.absoluteIndex)
    }))), $a = x(() => ({
      cy: "donut-div-legend",
      backgroundColor: a.value.style.chart.legend.backgroundColor,
      color: a.value.style.chart.legend.color,
      fontSize: a.value.style.chart.legend.fontSize,
      paddingBottom: 12,
      fontWeight: a.value.style.chart.legend.bold ? "bold" : ""
    })), ie = x(() => {
      const e = [""].concat(h.value.map((c) => c.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 c = 0; c < I.value; c += 1) {
        const g = h.value.map((n) => n.series[c] ?? 0).reduce((n, p) => n + p, 0);
        l.push([a.value.style.chart.grid.y.timeLabels.values.slice(r.value.start, r.value.end)[c] ?? c + 1].concat(h.value.map((n) => (n.series[c] ?? 0).toFixed(a.value.table.rounding))).concat((g ?? 0).toFixed(a.value.table.rounding)));
      }
      const o = {
        th: {
          backgroundColor: a.value.table.th.backgroundColor,
          color: a.value.table.th.color,
          outline: a.value.table.th.outline
        },
        td: {
          backgroundColor: a.value.table.td.backgroundColor,
          color: a.value.table.td.color,
          outline: a.value.table.td.outline
        },
        breakpoint: a.value.table.responsiveBreakpoint
      }, v = [a.value.table.columnNames.period].concat(h.value.map((c) => c.name)).concat(a.value.table.columnNames.total);
      return { head: e, body: l.slice(0, r.value.end - r.value.start), config: o, colNames: v };
    }), je = x(() => {
      if (h.value.length === 0) return { head: [], body: [], config: {}, columnNames: [] };
      const e = h.value.map((o) => ({
        label: o.name,
        color: o.color,
        type: o.type
      })), l = [];
      for (let o = r.value.start; o < r.value.end; o += 1) {
        const v = [a.value.style.chart.grid.y.timeLabels.values[o] || o + 1];
        h.value.forEach((c) => {
          v.push(Number((c.series[o] || 0).toFixed(a.value.table.rounding)));
        }), l.push(v);
      }
      return { head: e, body: l };
    });
    function qe() {
      const e = [[a.value.style.chart.title.text], [a.value.style.chart.title.subtitle.text], [""]], l = ["", ...je.value.head.map((g) => g.label)], o = je.value.body, v = e.concat([l]).concat(o), c = Za(v);
      Ga({ csvContent: c, title: a.value.style.chart.title.text || "vue-ui-xy-canvas" });
    }
    function Ia() {
      return h.value;
    }
    function Je() {
      u.value.showTable = !u.value.showTable;
    }
    function Ke() {
      u.value.showDataLabels = !u.value.showDataLabels;
    }
    function Qe() {
      u.value.stacked = !u.value.stacked;
    }
    function ea() {
      u.value.showTooltip = !u.value.showTooltip;
    }
    const ve = i(!1);
    function ke() {
      ve.value = !ve.value;
    }
    return na({
      getData: Ia,
      generateCsv: qe,
      generatePdf: _e,
      generateImage: Ue,
      toggleTable: Je,
      toggleLabels: Ke,
      toggleStack: Qe,
      toggleTooltip: ea,
      toggleAnnotator: ke
    }), (e, l) => (z(), K("div", {
      style: B(`width:100%; position:relative; ${a.value.responsive ? "height: 100%" : ""}`),
      ref_key: "xy",
      ref: Z,
      id: `xy_canvas_${he.value}`,
      class: Ra(`vue-ui-donut ${re.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      onMouseenter: l[5] || (l[5] = () => S(Fe)(!0)),
      onMouseleave: l[6] || (l[6] = () => S(Fe)(!1))
    }, [
      a.value.style.chart.title.text ? (z(), K("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: Te,
        style: B(`width:100%;background:${a.value.style.chart.backgroundColor};`)
      }, [
        (z(), E(ll, {
          key: `title_${fe.value}`,
          config: {
            title: {
              cy: "xy-canvas-title",
              ...a.value.style.chart.title
            },
            subtitle: {
              cy: "xy-canvas-subtitle",
              ...a.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 4)) : H("", !0),
      a.value.userOptions.show && me.value && (S(Ee) || S(be)) ? (z(), E(rl, {
        ref: "details",
        key: `user_option_${Me.value}`,
        backgroundColor: a.value.style.chart.backgroundColor,
        color: a.value.style.chart.color,
        isPrinting: S(Ae),
        isImaging: S(He),
        uid: he.value,
        hasTooltip: a.value.userOptions.buttons.tooltip && a.value.style.chart.tooltip.show,
        hasPdf: a.value.userOptions.buttons.pdf,
        hasImg: a.value.userOptions.buttons.img,
        hasXls: a.value.userOptions.buttons.csv,
        hasLabel: a.value.userOptions.buttons.labels,
        hasStack: Se.dataset.length > 1 && a.value.userOptions.buttons.stack,
        hasFullscreen: a.value.userOptions.buttons.fullscreen,
        hasTable: r.value.end - r.value.start < 200 && a.value.userOptions.buttons.table,
        isFullscreen: re.value,
        isTooltip: u.value.showTooltip,
        isStacked: u.value.stacked,
        titles: { ...a.value.userOptions.buttonTitles },
        chartElement: Z.value,
        position: a.value.userOptions.position,
        hasAnnotator: a.value.userOptions.buttons.annotator,
        isAnnotation: ve.value,
        onToggleFullscreen: da,
        onGeneratePdf: S(_e),
        onGenerateCsv: qe,
        onGenerateImage: S(Ue),
        onToggleTable: Je,
        onToggleLabels: Ke,
        onToggleStack: Qe,
        onToggleTooltip: ea,
        onToggleAnnotator: ke,
        style: B({
          visibility: S(Ee) ? S(be) ? "visible" : "hidden" : "visible"
        })
      }, Pa({ _: 2 }, [
        e.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: b(() => [
            L(e.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        e.$slots.optionPdf ? {
          name: "optionPdf",
          fn: b(() => [
            L(e.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        e.$slots.optionCsv ? {
          name: "optionCsv",
          fn: b(() => [
            L(e.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        e.$slots.optionImg ? {
          name: "optionImg",
          fn: b(() => [
            L(e.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        e.$slots.optionTable ? {
          name: "optionTable",
          fn: b(() => [
            L(e.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        e.$slots.optionLabels ? {
          name: "optionLabels",
          fn: b(() => [
            L(e.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        e.$slots.optionStack ? {
          name: "optionStack",
          fn: b(() => [
            L(e.$slots, "optionStack", {}, void 0, !0)
          ]),
          key: "6"
        } : void 0,
        e.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: b(({ toggleFullscreen: o, isFullscreen: v }) => [
            L(e.$slots, "optionFullscreen", Y(V({ toggleFullscreen: o, isFullscreen: v })), void 0, !0)
          ]),
          key: "7"
        } : void 0,
        e.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: b(({ toggleAnnotator: o, isAnnotator: v }) => [
            L(e.$slots, "optionAnnotator", Y(V({ toggleAnnotator: o, isAnnotator: v })), void 0, !0)
          ]),
          key: "8"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasLabel", "hasStack", "hasFullscreen", "hasTable", "isFullscreen", "isTooltip", "isStacked", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : H("", !0),
      Q("div", {
        class: "vue-ui-xy-canvas",
        style: B(`position: relative; aspect-ratio: ${Ne.value}`),
        ref_key: "container",
        ref: G
      }, [
        me.value ? (z(), K("canvas", {
          key: 0,
          ref_key: "canvas",
          ref: M,
          style: { width: "100%", height: "100%" },
          onMousemove: l[0] || (l[0] = (o) => za(o)),
          onMouseleave: Sa
        }, null, 544)) : (z(), E(nl, {
          key: 1,
          config: {
            type: "line",
            style: {
              backgroundColor: a.value.style.chart.backgroundColor,
              line: {
                axis: {
                  color: "#CCCCCC"
                },
                path: {
                  color: "#CCCCCC",
                  strokeWidth: 0.5
                }
              }
            }
          }
        }, null, 8, ["config"])),
        Fa(el, {
          show: u.value.showTooltip && te.value,
          backgroundColor: a.value.style.chart.tooltip.backgroundColor,
          color: a.value.style.chart.tooltip.color,
          fontSize: a.value.style.chart.tooltip.fontSize,
          borderRadius: a.value.style.chart.tooltip.borderRadius,
          borderColor: a.value.style.chart.tooltip.borderColor,
          borderWidth: a.value.style.chart.tooltip.borderWidth,
          position: a.value.style.chart.tooltip.position,
          offsetY: a.value.style.chart.tooltip.offsetY,
          parent: M.value,
          content: oe.value,
          isFullscreen: re.value,
          backgroundOpacity: a.value.style.chart.tooltip.backgroundOpacity,
          isCustom: S(oa)(a.value.style.chart.tooltip.customFormat)
        }, {
          "tooltip-before": b(() => [
            L(e.$slots, "tooltip-before", Y(V({ ...$e.value })), void 0, !0)
          ]),
          "tooltip-after": b(() => [
            L(e.$slots, "tooltip-after", Y(V({ ...$e.value })), void 0, !0)
          ]),
          _: 3
        }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "position", "offsetY", "parent", "content", "isFullscreen", "backgroundOpacity", "isCustom"])
      ], 4),
      Q("div", {
        ref_key: "chartSlicer",
        ref: Re,
        style: B(`width:100%;background:${a.value.style.chart.backgroundColor}`),
        "data-html2canvas-ignore": ""
      }, [
        a.value.style.chart.zoom.show && I.value > 1 ? (z(), E(tl, {
          ref_key: "slicerComponent",
          ref: X,
          key: `slicer_${Ie.value}`,
          background: a.value.style.chart.zoom.color,
          borderColor: a.value.style.chart.backgroundColor,
          fontSize: a.value.style.chart.zoom.fontSize,
          useResetSlot: a.value.style.chart.zoom.useResetSlot,
          labelLeft: a.value.style.chart.grid.y.timeLabels.values[r.value.start] ? a.value.style.chart.grid.y.timeLabels.values[r.value.start] : "",
          labelRight: a.value.style.chart.grid.y.timeLabels.values[r.value.end - 1] ? a.value.style.chart.grid.y.timeLabels.values[r.value.end - 1] : "",
          textColor: a.value.style.chart.color,
          inputColor: a.value.style.chart.zoom.color,
          selectColor: a.value.style.chart.zoom.highlightColor,
          max: I.value,
          min: 0,
          valueStart: r.value.start,
          valueEnd: r.value.end,
          start: r.value.start,
          "onUpdate:start": l[1] || (l[1] = (o) => r.value.start = o),
          end: r.value.end,
          "onUpdate:end": l[2] || (l[2] = (o) => r.value.end = o),
          refreshStartPoint: a.value.style.chart.zoom.startIndex !== null ? a.value.style.chart.zoom.startIndex : 0,
          refreshEndPoint: a.value.style.chart.zoom.endIndex !== null ? a.value.style.chart.zoom.endIndex + 1 : I.value,
          enableRangeHandles: a.value.style.chart.zoom.enableRangeHandles,
          enableSelectionDrag: a.value.style.chart.zoom.enableSelectionDrag,
          onReset: Be
        }, {
          "reset-action": b(({ reset: o }) => [
            L(e.$slots, "reset-action", Y(V({ reset: o })), void 0, !0)
          ]),
          _: 3
        }, 8, ["background", "borderColor", "fontSize", "useResetSlot", "labelLeft", "labelRight", "textColor", "inputColor", "selectColor", "max", "valueStart", "valueEnd", "start", "end", "refreshStartPoint", "refreshEndPoint", "enableRangeHandles", "enableSelectionDrag"])) : H("", !0)
      ], 4),
      Q("div", {
        ref_key: "chartLegend",
        ref: Oe
      }, [
        a.value.style.chart.legend.show && me.value ? (z(), E(al, {
          legendSet: Ge.value,
          config: $a.value,
          key: `legend_${pe.value}`,
          onClickMarker: l[3] || (l[3] = ({ i: o }) => Ze(o))
        }, {
          item: b(({ legend: o, index: v }) => [
            Q("div", {
              onClick: (c) => o.segregate(),
              style: B(`opacity:${$.value.includes(v) ? 0.5 : 1}`)
            }, la(o.name), 13, hl)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : L(e.$slots, "legend", {
          key: 1,
          legend: Ge.value
        }, void 0, !0)
      ], 512),
      e.$slots.watermark ? (z(), K("div", yl, [
        L(e.$slots, "watermark", Y(V({ isPrinting: S(Ae) || S(He) })), void 0, !0)
      ])) : H("", !0),
      e.$slots.source ? (z(), K("div", {
        key: 3,
        ref_key: "source",
        ref: Pe,
        dir: "auto"
      }, [
        L(e.$slots, "source", {}, void 0, !0)
      ], 512)) : H("", !0),
      r.value.end - r.value.start < 200 ? (z(), E(ul, {
        key: 4,
        hideDetails: "",
        config: {
          open: u.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: a.value.style.chart.backgroundColor,
            color: a.value.style.chart.color
          },
          head: {
            backgroundColor: a.value.style.chart.backgroundColor,
            color: a.value.style.chart.color
          }
        }
      }, {
        content: b(() => [
          (z(), E(sl, {
            key: `table_${ge.value}`,
            colNames: ie.value.colNames,
            head: ie.value.head,
            body: ie.value.body,
            config: ie.value.config,
            title: `${a.value.style.chart.title.text}${a.value.style.chart.title.subtitle.text ? ` : ${a.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: l[4] || (l[4] = (o) => u.value.showTable = !1)
          }, {
            th: b(({ th: o }) => [
              Q("div", { innerHTML: o }, null, 8, fl)
            ]),
            td: b(({ td: o }) => [
              Ea(la(o), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : H("", !0),
      a.value.userOptions.buttons.annotator && h.value.length ? (z(), E(il, {
        key: 5,
        parent: Z.value,
        backgroundColor: a.value.style.chart.backgroundColor,
        color: a.value.style.chart.color,
        active: ve.value,
        onClose: ke
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : H("", !0)
    ], 46, dl));
  }
}, Rl = /* @__PURE__ */ cl(gl, [["__scopeId", "data-v-fbe7238f"]]);
export {
  Rl as default
};
