import { useCssVars as Oe, computed as oe, ref as f, watch as me, onMounted as Ne, onBeforeUnmount as Ae, createElementBlock as X, openBlock as w, unref as h, normalizeStyle as re, createBlock as ae, createCommentVNode as B, createVNode as fe, createSlots as Ie, withCtx as P, renderSlot as F, normalizeProps as J, guardReactiveProps as K, normalizeClass as we, createElementVNode as pe, Fragment as Xe, renderList as Re, toDisplayString as Ce, createTextVNode as We, nextTick as ke } from "vue";
import { u as Ve, c as xe, ai as Be, v as Ye, t as De, p as ue, a as Ue, o as Ee, e as $e, g as Ge, f as Le, X as He, q as je, r as qe, x as Ze } from "./index-BI6O7K58.js";
import { _ as Je } from "./Title-CDYBDpu3.js";
import { u as Ke, U as Qe } from "./usePrinter-Jr3eyr8H.js";
import { t as et, u as tt, d as ot } from "./useResponsive-Cw4oZ8sQ.js";
import at from "./vue-ui-accordion-ldF7KsjV.js";
import { D as lt } from "./DataTable-Dk-94kK2.js";
import { u as Te } from "./useNestedProp-Cvz4MkSy.js";
import { _ as nt } from "./PackageVersion-BdNfnIm2.js";
import { _ as st } from "./Tooltip-BzsAOdBd.js";
import { _ as it } from "./PenAndPaper-wrVNMaG8.js";
import { u as rt } from "./useUserOptionState-BIvW1Kz7.js";
import { u as ut } from "./useChartAccessibility-BWojgys7.js";
import { u as ct } from "./usePanZoom-CUkkqW81.js";
import dt from "./BaseIcon-Br5G8Cdk.js";
import { _ as vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
function ht(b, p) {
  const { width: c, height: n } = b, d = p.getImageData(0, 0, c, n).data;
  let l = c, a = n, s = 0, g = 0, k = !1;
  for (let m = 0; m < n; m += 1)
    for (let y = 0; y < c; y += 1)
      d[(m * c + y) * 4 + 3] > 1 && (k = !0, y < l && (l = y), y > s && (s = y), m < a && (a = m), m > g && (g = m));
  return k ? [l, a, s, g] : [0, 0, 0, 0];
}
function Se({
  word: b,
  fontSize: p,
  pad: c,
  canvas: n,
  ctx: r,
  svg: d
}) {
  r.save(), r.font = `${d.style && d.style.bold ? "bold " : ""}${p}px Arial`;
  const l = r.measureText(b.name), a = Math.ceil(l.width) + 2 + (c ? c * 2 : 0), s = Math.ceil(p) + 2 + (c ? c * 2 : 0);
  n.width = a, n.height = s, r.clearRect(0, 0, a, s), r.font = `${d.style && d.style.bold ? "bold " : ""}${p}px Arial`, r.textAlign = "center", r.textBaseline = "middle", r.fillStyle = "black", r.fillText(b.name, a / 2, s / 2);
  const k = r.getImageData(0, 0, a, s).data, m = [];
  for (let _ = 0; _ < s; _ += 1)
    for (let Y = 0; Y < a; Y += 1)
      k[(_ * a + Y) * 4 + 3] > 1 && m.push([Y, _]);
  const [y, e, z, R] = ht(n, r);
  return r.restore(), { w: a, h: s, wordMask: m, minX: y, minY: e, maxX: z, maxY: R };
}
function Fe({ mask: b, maskW: p, maskH: c, wx: n, wy: r, wordMask: d }) {
  for (let l = 0; l < d.length; l += 1) {
    const a = n + d[l][0], s = r + d[l][1];
    if (a < 0 || s < 0 || a >= p || s >= c || b[s * p + a]) return !1;
  }
  return !0;
}
function Me({ mask: b, maskW: p, maskH: c, wx: n, wy: r, wordMask: d }) {
  for (let l = 0; l < d.length; l += 1) {
    const a = n + d[l][0], s = r + d[l][1];
    a >= 0 && s >= 0 && a < p && s < c && (b[s * p + a] = 1);
  }
}
function mt({ wordMask: b, w: p, h: c, dilation: n }) {
  const r = new Set(b.map(([l, a]) => `${l},${a}`)), d = new Set(r);
  for (let [l, a] of b)
    for (let s = -n; s <= n; s += 1)
      for (let g = -n; g <= n; g += 1) {
        if (s === 0 && g === 0) continue;
        const k = l + s, m = a + g;
        k >= 0 && k < p && m >= 0 && m < c && d.add(`${k},${m}`);
      }
  return Array.from(d).map((l) => l.split(",").map(Number));
}
function ft({
  words: b,
  proximity: p = 0,
  svg: c,
  strictPixelPadding: n
}) {
  const { width: r, height: d } = c, l = Math.round(r), a = Math.round(d), s = 1, g = c.minFontSize, k = Math.min(c.maxFontSize, 100), m = b.map((x) => x.value), y = Math.min(...m), e = Math.max(...m), z = new Uint8Array(l * a), R = document.createElement("canvas"), _ = R.getContext("2d", { willReadFrequently: !0 });
  R.width = l, R.height = a;
  const Y = 6, le = 2, Q = 2, ne = 1, u = Math.floor(l / 2), se = Math.floor(a / 2), ce = [...b].sort((x, O) => O.value - x.value), E = [];
  for (const x of ce) {
    let O = g;
    e !== y && (O = (x.value - y) / (e - y) * (k - g) + g), O = Math.max(g, Math.min(k, O));
    let W = !1, N = O;
    for (; !W && N >= s; ) {
      let { w: A, h: v, wordMask: D, minX: U, minY: L, maxX: G, maxY: q } = Se({
        word: x,
        fontSize: N,
        pad: p,
        canvas: R,
        ctx: _,
        svg: c
      });
      n && (D = mt({ wordMask: D, w: A, h: v, dilation: 1 }));
      let $ = 0, V = 0;
      for (; $ < Math.max(l, a) && !W && V < 1e4; ) {
        for (let I = 0; I < 360; I += Y) {
          V += 1;
          const M = Math.round(u + $ * Math.cos(I * Math.PI / 180) - A / 2), T = Math.round(se + $ * Math.sin(I * Math.PI / 180) - v / 2);
          if (!(M < 0 || T < 0 || M + A > l || T + v > a) && Fe({ mask: z, maskW: l, maskH: a, wx: M, wy: T, wordMask: D })) {
            E.push({ ...x, x: M - l / 2, y: T - a / 2, fontSize: N, width: A, height: v, angle: 0, minX: U, minY: L, maxX: G, maxY: q }), Me({ mask: z, maskW: l, maskH: a, wx: M, wy: T, wordMask: D }), W = !0;
            break;
          }
        }
        $ += le;
      }
      W || (N -= 1);
    }
    if (!W && N < s) {
      N = s;
      const { w: A, h: v, wordMask: D, minX: U, minY: L, maxX: G, maxY: q } = Se({
        word: x,
        fontSize: N,
        pad: p,
        canvas: R,
        ctx: _,
        svg: c
      });
      let $ = 0, V = 0;
      for (; $ < Math.max(l, a) && !W && V < 25e3; ) {
        for (let I = 0; I < 360; I += Q) {
          V += 1;
          const M = Math.round(u + $ * Math.cos(I * Math.PI / 180) - A / 2), T = Math.round(se + $ * Math.sin(I * Math.PI / 180) - v / 2);
          if (!(M < 0 || T < 0 || M + A > l || T + v > a) && Fe({ mask: z, maskW: l, maskH: a, wx: M, wy: T, wordMask: D })) {
            E.push({ ...x, x: M - l / 2, y: T - a / 2, fontSize: N, width: A, height: v, angle: 0, minX: U, minY: L, maxX: G, maxY: q }), Me({ mask: z, maskW: l, maskH: a, wx: M, wy: T, wordMask: D }), W = !0;
            break;
          }
        }
        $ += ne;
      }
    }
  }
  return E.sort((x, O) => O.fontSize - x.fontSize);
}
const pt = ["id"], gt = ["xmlns", "viewBox"], yt = ["width", "height"], bt = ["transform"], wt = ["x", "y", "width", "height", "onMouseover"], Ct = ["fill", "font-weight", "x", "y", "font-size", "transform"], kt = {
  key: 4,
  class: "vue-data-ui-watermark"
}, xt = {
  key: 5,
  "data-dom-to-png-ignore": "",
  class: "reset-wrapper"
}, $t = ["innerHTML"], Tt = {
  __name: "vue-ui-word-cloud",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: [Array, String],
      default() {
        return [];
      }
    }
  },
  setup(b, { expose: p }) {
    Oe((t) => ({
      "7200478e": t.slicerColor
    }));
    const { vue_ui_word_cloud: c } = Ve(), n = b, r = oe({
      get() {
        return !!n.dataset && n.dataset.length;
      },
      set(t) {
        return t;
      }
    }), d = f(xe()), l = f(0), a = f(null), s = f(null), g = f(null), k = f(0), m = f(0), y = f(!1), e = oe({
      get: () => ne(),
      set: (t) => t
    }), z = f(R());
    function R() {
      return typeof n.dataset == "string" ? Be(n.dataset) : n.dataset.map((t, i) => ({
        ...t,
        value: Ye(t.value)
      }));
    }
    me(() => n.dataset, () => {
      z.value = R(), L();
    });
    const { userOptionsVisible: _, setUserOptionsVisibility: Y, keepUserOptionState: le } = rt({ config: e.value }), { svgRef: Q } = ut({ config: e.value.style.chart.title });
    function ne() {
      const t = Te({
        userConfig: n.config,
        defaultConfig: c
      });
      return t.theme ? {
        ...Te({
          userConfig: Ue.vue_ui_word_cloud[t.theme] || n.config,
          defaultConfig: t
        }),
        customPalette: De[t.theme] || ue
      } : t;
    }
    me(() => n.config, (t) => {
      e.value = ne(), _.value = !e.value.userOptions.showOnChartHover, x(), k.value += 1, m.value += 1, v.value.showTable = e.value.table.show, v.value.showTooltip = e.value.style.chart.tooltip.show;
    }, { deep: !0 });
    const u = f({
      width: e.value.style.chart.width,
      height: e.value.style.chart.height,
      maxFontSize: e.value.style.chart.words.maxFontSize,
      minFontSize: e.value.style.chart.words.minFontSize,
      bold: e.value.style.chart.words.bold
    }), se = ot(() => {
      L();
    }, 10), ce = et(() => {
      const { width: t, height: i } = tt({
        chart: a.value,
        title: e.value.style.chart.title.text ? s.value : null,
        source: g.value
      });
      requestAnimationFrame(() => {
        u.value.width = t, u.value.height = i, ke(se);
      });
    }), E = f(null);
    Ne(x);
    function x() {
      Ee(n.dataset) ? $e({
        componentName: "VueUiWordCloud",
        type: "dataset"
      }) : z.value.forEach((t, i) => {
        Ge({
          datasetObject: t,
          requiredAttributes: ["name", "value"]
        }).forEach((o) => {
          r.value = !1, $e({
            componentName: "VueUiWordCloud",
            type: "datasetSerieAttribute",
            property: o,
            index: i
          });
        });
      }), e.value.responsive && (E.value = new ResizeObserver(ce), E.value.observe(a.value.parentNode));
    }
    Ae(() => {
      E.value && E.value.disconnect();
    });
    const { isPrinting: O, isImaging: W, generatePdf: N, generateImage: A } = Ke({
      elementId: `wordCloud_${d.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-word-cloud",
      options: e.value.userOptions.print
    }), v = f({
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    });
    function D(t, i, o = "Arial") {
      const C = document.createElement("canvas").getContext("2d");
      return C.font = `${i}px ${e.value.style.chart.words.bold ? "bold" : "normal"} ${o}`, {
        width: C.measureText(t).width + e.value.style.chart.words.proximity,
        height: i
      };
    }
    const U = f([]);
    me(() => n.dataset, L, { immediate: !0 });
    function L() {
      const t = [...z.value].map((C) => C.value), i = Math.max(...t), o = Math.min(...t), S = [...z.value].map((C, H) => {
        let j = (C.value - o) / (i - o) * (u.value.maxFontSize - u.value.minFontSize) + u.value.minFontSize;
        j = isNaN(j) ? u.value.minFontSize : j;
        const be = D(C.name, j);
        return {
          ...C,
          id: xe(),
          fontSize: j,
          width: be.width,
          height: be.height,
          color: e.value.style.chart.words.usePalette ? e.value.customPalette[H] || e.value.customPalette[H % e.value.customPalette.length] || ue[H] || ue[H % ue.length] : e.value.style.chart.words.color
        };
      });
      U.value = ft({
        words: S,
        svg: u.value,
        proximity: e.value.style.chart.words.proximity,
        strictPixelPadding: e.value.strictPixelPadding
      });
    }
    const G = oe(() => {
      const t = U.value.map((o) => ({
        name: o.name,
        color: o.color
      })), i = U.value.map((o) => o.value);
      return { head: t, body: i };
    });
    function q() {
      ke(() => {
        const t = G.value.head.map((S, C) => [[
          S.name
        ], [G.value.body[C]]]), i = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], [e.value.table.columnNames.value]]].concat(t), o = je(i);
        qe({ csvContent: o, title: e.value.style.chart.title.text || "vue-ui-word-cloud" });
      });
    }
    const $ = oe(() => {
      const t = [
        e.value.table.columnNames.series,
        e.value.table.columnNames.value
      ], i = G.value.head.map((C, H) => {
        const j = Le({ p: e.value.table.td.prefix, v: G.value.body[H], s: e.value.table.td.suffix, r: e.value.table.td.roundingValue });
        return [
          {
            color: C.color,
            name: C.name
          },
          j
        ];
      }), o = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return {
        colNames: [
          e.value.table.columnNames.series,
          e.value.table.columnNames.value
        ],
        head: t,
        body: i,
        config: o
      };
    }), V = f(!1);
    function I(t) {
      V.value = t, l.value += 1;
    }
    function M() {
      return U.value;
    }
    function T() {
      v.value.showTable = !v.value.showTable;
    }
    function ge() {
      v.value.showTooltip = !v.value.showTooltip;
    }
    const ee = f(!1);
    function de() {
      ee.value = !ee.value;
    }
    const Pe = oe(() => !ee.value && e.value.style.chart.zoom.show), { viewBox: ie, resetZoom: ye, isZoom: ze } = ct(Q, {
      x: 0,
      y: 0,
      width: u.value.width <= 0 ? 10 : u.value.width,
      height: u.value.height <= 0 ? 10 : u.value.height
    }, 1, Pe);
    p({
      getData: M,
      generateCsv: q,
      generatePdf: N,
      generateImage: A,
      toggleTable: T,
      toggleTooltip: ge,
      toggleAnnotator: de
    });
    const Z = f(null), te = f(!1), ve = f(""), he = f(null);
    function _e(t) {
      if (!v.value.showTooltip) return;
      Z.value = t.id, he.value = { datapoint: t, config: e.value };
      const i = e.value.style.chart.tooltip.customFormat;
      if (te.value = !1, Ze(i))
        try {
          const o = i({
            datapoint: t,
            config: e.value
          });
          typeof o == "string" && (ve.value = o, te.value = !0);
        } catch {
          console.warn("Custom format cannot be applied."), te.value = !1;
        }
      if (!te.value) {
        let o = `<svg viewBox="0 0 10 10" height="${e.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${t.color}"/></svg><span>${t.name}:</span><b>${(t.value || 0).toFixed(e.value.style.chart.tooltip.roundingValue)}</b>`;
        ve.value = `<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${o}</div>`;
      }
      y.value = !0;
    }
    return (t, i) => (w(), X("div", {
      class: "vue-ui-word-cloud",
      ref_key: "wordCloudChart",
      ref: a,
      id: `wordCloud_${d.value}`,
      style: re(`width: 100%; font-family:${e.value.style.fontFamily};background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height:100%" : ""}`),
      onMouseenter: i[3] || (i[3] = () => h(Y)(!0)),
      onMouseleave: i[4] || (i[4] = () => h(Y)(!1))
    }, [
      e.value.userOptions.buttons.annotator ? (w(), ae(it, {
        key: 0,
        svgRef: h(Q),
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: ee.value,
        onClose: de
      }, null, 8, ["svgRef", "backgroundColor", "color", "active"])) : B("", !0),
      e.value.style.chart.title.text ? (w(), X("div", {
        key: 1,
        ref_key: "chartTitle",
        ref: s,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (w(), ae(Je, {
          key: `title_${k.value}`,
          config: {
            title: {
              ...e.value.style.chart.title
            },
            subtitle: {
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : B("", !0),
      e.value.userOptions.show && r.value && (h(le) || h(_)) ? (w(), ae(Qe, {
        ref: "details",
        key: `user_option_${l.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: h(O),
        isImaging: h(W),
        uid: d.value,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasXls: e.value.userOptions.buttons.csv,
        hasImg: e.value.userOptions.buttons.img,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: V.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: a.value,
        position: e.value.userOptions.position,
        hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
        isTooltip: v.value.showTooltip,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: ee.value,
        onToggleFullscreen: I,
        onGeneratePdf: h(N),
        onGenerateCsv: q,
        onGenerateImage: h(A),
        onToggleTable: T,
        onToggleTooltip: ge,
        onToggleAnnotator: de,
        style: re({
          visibility: h(le) ? h(_) ? "visible" : "hidden" : "visible"
        })
      }, Ie({ _: 2 }, [
        t.$slots.menuIcon ? {
          name: "menuIcon",
          fn: P(({ isOpen: o, color: S }) => [
            F(t.$slots, "menuIcon", J(K({ isOpen: o, color: S })), void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: P(() => [
            F(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: P(() => [
            F(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: P(() => [
            F(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: P(() => [
            F(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: P(({ toggleFullscreen: o, isFullscreen: S }) => [
            F(t.$slots, "optionFullscreen", J(K({ toggleFullscreen: o, isFullscreen: S })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: P(({ toggleAnnotator: o, isAnnotator: S }) => [
            F(t.$slots, "optionAnnotator", J(K({ toggleAnnotator: o, isAnnotator: S })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "hasTooltip", "isTooltip", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : B("", !0),
      r.value ? (w(), X("svg", {
        key: 3,
        ref_key: "svgRef",
        ref: Q,
        class: we({ "vue-data-ui-fullscreen--on": V.value, "vue-data-ui-fulscreen--off": !V.value }),
        xmlns: h(He),
        viewBox: `${h(ie).x} ${h(ie).y} ${h(ie).width} ${h(ie).height}`,
        style: "overflow:hidden;background:transparent;"
      }, [
        fe(nt),
        t.$slots["chart-background"] ? (w(), X("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: u.value.width <= 0 ? 10 : u.value.width,
          height: u.value.height <= 0 ? 10 : u.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          F(t.$slots, "chart-background", {}, void 0, !0)
        ], 8, yt)) : B("", !0),
        pe("g", {
          transform: `translate(${(u.value.width <= 0 ? 10 : u.value.width) / 2}, ${(u.value.height <= 0 ? 10 : u.value.height) / 2})`
        }, [
          (w(!0), X(Xe, null, Re(U.value, (o, S) => (w(), X("g", null, [
            o.minX !== void 0 ? (w(), X("rect", {
              key: 0,
              x: o.x + o.minX,
              y: o.y + o.minY * 1.25,
              width: o.maxX - o.minX,
              height: o.maxY - o.minY,
              fill: "transparent",
              "pointer-events": "visiblePainted",
              onMouseover: (C) => _e(o),
              onMouseleave: i[0] || (i[0] = (C) => {
                Z.value = null, y.value = !1;
              })
            }, null, 40, wt)) : B("", !0),
            (w(), X("text", {
              fill: o.color,
              "font-weight": e.value.style.chart.words.bold ? "bold" : "normal",
              key: S,
              x: o.x,
              y: o.y,
              "font-size": o.fontSize,
              transform: `translate(${o.width / 2}, ${o.height / 2})`,
              class: we({ animated: e.value.useCssAnimation, "word-selected": Z.value && Z.value === o.id && v.value.showTooltip, "word-not-selected": Z.value && Z.value !== o.id && v.value.showTooltip }),
              "text-anchor": "middle",
              "dominant-baseline": "central",
              style: re(`animation-delay:${S * e.value.animationDelayMs}ms !important; pointer-events:none;`)
            }, Ce(o.name), 15, Ct))
          ]))), 256))
        ], 8, bt),
        F(t.$slots, "svg", {
          svg: { height: u.value.height, width: u.value.width }
        }, void 0, !0)
      ], 10, gt)) : B("", !0),
      t.$slots.watermark ? (w(), X("div", kt, [
        F(t.$slots, "watermark", J(K({ isPrinting: h(O) || h(W) })), void 0, !0)
      ])) : B("", !0),
      h(ze) ? (w(), X("div", xt, [
        F(t.$slots, "reset-action", { reset: h(ye) }, () => [
          pe("button", {
            "data-cy-reset": "",
            tabindex: "0",
            role: "button",
            class: "vue-data-ui-refresh-button",
            style: re({
              background: e.value.style.chart.backgroundColor
            }),
            onClick: i[1] || (i[1] = (o) => h(ye)(!0))
          }, [
            fe(dt, {
              name: "refresh",
              stroke: e.value.style.chart.color
            }, null, 8, ["stroke"])
          ], 4)
        ], !0)
      ])) : B("", !0),
      fe(st, {
        show: v.value.showTooltip && y.value,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        fontSize: e.value.style.chart.tooltip.fontSize,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: a.value,
        content: ve.value,
        isCustom: te.value
      }, {
        "tooltip-before": P(() => [
          F(t.$slots, "tooltip-before", J(K({ ...he.value })), void 0, !0)
        ]),
        "tooltip-after": P(() => [
          F(t.$slots, "tooltip-after", J(K({ ...he.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
      t.$slots.source ? (w(), X("div", {
        key: 6,
        ref_key: "source",
        ref: g,
        dir: "auto"
      }, [
        F(t.$slots, "source", {}, void 0, !0)
      ], 512)) : B("", !0),
      r.value ? (w(), ae(at, {
        key: 7,
        hideDetails: "",
        config: {
          open: v.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          },
          head: {
            backgroundColor: e.value.style.chart.backgroundColor,
            color: e.value.style.chart.color
          }
        }
      }, {
        content: P(() => [
          (w(), ae(lt, {
            key: `table_${m.value}`,
            colNames: $.value.colNames,
            head: $.value.head,
            body: $.value.body,
            config: $.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: i[2] || (i[2] = (o) => v.value.showTable = !1)
          }, {
            th: P(({ th: o }) => [
              pe("div", {
                innerHTML: o,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, $t)
            ]),
            td: P(({ td: o }) => [
              We(Ce(o.name || o), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : B("", !0)
    ], 44, pt));
  }
}, Dt = /* @__PURE__ */ vt(Tt, [["__scopeId", "data-v-cda211d1"]]);
export {
  Dt as default
};
