import { ref as r, computed as v, watch as Be, onMounted as De, onBeforeUnmount as Ee, openBlock as i, createElementBlock as h, normalizeClass as E, normalizeStyle as S, unref as u, createBlock as _, createCommentVNode as b, createSlots as We, withCtx as g, renderSlot as c, normalizeProps as I, guardReactiveProps as M, createVNode as be, createElementVNode as C, Fragment as ke, renderList as Ce, createTextVNode as we, toDisplayString as W, nextTick as Ge } from "vue";
import { u as He, c as $e, t as je, a as Xe, p as x, o as Ye, e as q, g as qe, b as Je, J as Ke, d as Te, f as N, X as Qe, s as Ze, w as et, v as J, i as _e, x as tt, y as lt, q as ot, r as at } from "./index-Z_vzxZTo.js";
import { t as st, u as nt } from "./useResponsive-CoxXLe23.js";
import { _ as rt } from "./Title-obqvTiXP.js";
import { u as ut, U as it } from "./usePrinter-Ck0oiMlt.js";
import { _ as vt } from "./Tooltip-BK-ACGDE.js";
import { D as ct } from "./DataTable-BBh7_ttv.js";
import { L as dt } from "./Legend-WOejx9sp.js";
import pt from "./vue-ui-skeleton-BMRe3SzB.js";
import ht from "./vue-ui-accordion-CV2-8b1O.js";
import { u as xe } from "./useNestedProp-Buhi5uyL.js";
import { _ as gt } from "./PackageVersion-dR8EUy_P.js";
import { P as ft } from "./PenAndPaper-CrXlqi9I.js";
import { u as yt } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const bt = ["id"], kt = ["xmlns", "viewBox"], Ct = ["width", "height"], wt = ["id"], $t = ["stop-color"], Tt = ["stop-color"], _t = ["stroke", "cx", "cy", "r", "fill"], xt = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], Nt = ["cx", "cy", "r", "onMouseenter"], Ot = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Pt = ["onClick"], St = { key: 0 }, Lt = { key: 1 }, At = ["innerHTML"], Ft = {
  __name: "vue-ui-rings",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend"],
  setup(Ne, { expose: Oe, emit: Pe }) {
    const y = Ne, { vue_ui_rings: Se } = He(), L = r(!1), V = v(() => !!y.dataset && y.dataset.length), A = r($e()), Le = r(null), z = r(!1), G = r(""), T = r(null), K = r(0), O = r(null), Q = r(null), Z = r(null), ee = r(null), te = r(null), le = r(0), oe = r(0), ae = r(0), e = v({
      get: () => re(),
      set: (t) => t
    }), { userOptionsVisible: H, setUserOptionsVisibility: se, keepUserOptionState: ne } = yt({ config: e.value });
    function re() {
      const t = xe({
        userConfig: y.config,
        defaultConfig: Se
      });
      return t.theme ? {
        ...xe({
          userConfig: je.vue_ui_rings[t.theme] || y.config,
          defaultConfig: t
        }),
        customPalette: Xe[t.theme] || x
      } : t;
    }
    Be(() => y.config, (t) => {
      e.value = re(), H.value = !e.value.showOnChartHover, ue(), le.value += 1, oe.value += 1, ae.value += 1;
    }, { deep: !0 });
    const R = r(null);
    De(() => {
      ue();
    });
    function ue() {
      if (Ye(y.dataset) ? q({
        componentName: "VueUiRings",
        type: "dataset"
      }) : y.dataset.forEach((t, o) => {
        t.values.length || q({
          componentName: "VueUiRings",
          type: "dataset"
        }), qe({
          datasetObject: t,
          requiredAttributes: ["name", "values"]
        }).forEach((l) => {
          q({
            componentName: "VueUiRings",
            type: "datasetSerieAttribute",
            property: l,
            index: o
          });
        });
      }), e.value.responsive) {
        const t = st(() => {
          const { width: o, height: l } = nt({
            chart: O.value,
            title: e.value.style.chart.title.text ? Q.value : null,
            legend: e.value.style.chart.legend.show ? Z.value : null,
            source: ee.value,
            noTitle: te.value
          });
          n.value.width = o, n.value.height = l;
        });
        R.value = new ResizeObserver(t), R.value.observe(O.value.parentNode);
      }
      setTimeout(() => {
        L.value = !0;
      }, 600);
    }
    Ee(() => {
      R.value && R.value.disconnect();
    });
    const { isPrinting: ie, isImaging: ve, generatePdf: ce, generateImage: de } = ut({
      elementId: `rings_${A.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-rings"
    }), Ae = v(() => e.value.userOptions.show && !e.value.style.chart.title.text), pe = v(() => Je(e.value.customPalette)), w = r({
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), n = r({
      height: 360,
      width: 360
    }), Fe = v(() => Math.min(n.value.height, n.value.width)), d = r([]);
    function j(t) {
      d.value.includes(t) ? d.value = d.value.filter((o) => o !== t) : d.value.push(t), Pe("selectLegend", p.value.map((o) => ({
        name: o.name,
        color: o.color,
        value: o.value
      })));
    }
    const Ie = v(() => Math.max(
      ...U.value.filter((t) => !d.value.includes(t.uid)).map(({ value: t }) => t)
    ));
    function he(t) {
      return t / Ie.value;
    }
    const U = v(() => y.dataset.map(({ values: t, name: o, color: l = null }, a) => {
      const s = Ke(t).reduce((k, F) => k + F, 0);
      return {
        name: o,
        color: l || Te(l) || pe.value[a] || x[a] || x[a % x.length],
        value: s,
        proportion: s / y.dataset.map((k) => (k.values || []).reduce((F, Ue) => F + Ue, 0)).reduce((k, F) => k + F, 0),
        uid: $e()
      };
    })), ge = v(() => U.value.map((t) => ({
      ...t,
      shape: "circle",
      opacity: d.value.includes(t.uid) ? 0.5 : 1,
      segregate: () => j(t.uid),
      isSegregated: d.value.includes(t.uid)
    })).toSorted((t, o) => o.value - t.value)), Me = v(() => ({
      cy: "rings-div-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" : ""
    })), m = v(() => U.value.filter((t) => !d.value.includes(t.uid)).map(({ value: t }) => t).reduce((t, o) => t + o, 0)), p = v(() => U.value.filter((t) => !d.value.includes(t.uid)).map(({ name: t, value: o, color: l = null, uid: a }, s) => ({
      uid: a,
      name: t,
      color: l || Te(l) || pe.value[s] || x[s] || x[s % x.length],
      value: o,
      proportion: he(o),
      percentage: o / m.value * 100,
      strokeWidth: e.value.style.chart.layout.rings.strokeWidth * he(o)
    })).toSorted((t, o) => o.value - t.value));
    function Ve() {
      return p.value.map(
        ({ name: t, color: o, value: l, absoluteValues: a, percentage: s }) => ({
          name: t,
          color: o,
          value: l,
          absoluteValues: a,
          percentage: s
        })
      );
    }
    const f = v(() => Fe.value - e.value.style.chart.layout.rings.strokeWidth * 2), X = r(null);
    function ze(t, o) {
      if (d.value.length === y.dataset.length) return;
      X.value = {
        datapoint: o,
        seriesIndex: t,
        series: p.value,
        config: e.value
      }, T.value = t;
      const l = p.value[t], a = e.value.style.chart.tooltip.customFormat;
      if (tt(a) && lt(() => a({
        seriesIndex: t,
        datapoint: o,
        series: p.value,
        config: e.value
      })))
        G.value = a({
          seriesIndex: t,
          datapoint: o,
          series: p.value,
          config: e.value
        });
      else {
        let s = "";
        s += `<div style="width:100%;text-align:center;border-bottom:1px solid ${e.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`, s += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}" /></svg>`, e.value.style.chart.tooltip.showValue && (s += `<b>${_e(
          e.value.style.chart.layout.labels.dataLabels.formatter,
          l.value,
          N({
            p: e.value.style.chart.layout.labels.dataLabels.prefix,
            v: l.value,
            s: e.value.style.chart.layout.labels.dataLabels.suffix,
            r: e.value.style.chart.tooltip.roundingValue
          }),
          { datapoint: o, seriesIndex: t }
        )}
      </b>`), e.value.style.chart.tooltip.showPercentage && (e.value.style.chart.tooltip.showValue ? s += `<span>(${N({
          v: l.value / m.value * 100,
          s: "%",
          r: e.value.style.chart.tooltip.roundingPercentage
        })})</span></div>` : s += `<b>${N({
          v: l.value / m.value * 100,
          s: "%",
          r: e.value.style.chart.tooltip.roundingPercentage
        })}</b></div>`), G.value = s;
      }
      z.value = !0;
    }
    const $ = v(() => {
      const t = p.value.map((l) => ({
        name: l.name,
        color: l.color
      })), o = p.value.map((l) => l.value);
      return { head: t, body: o };
    }), B = v(() => {
      const t = [
        ' <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>',
        N({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: m.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
        "100%"
      ], o = $.value.head.map((s, k) => [
        {
          color: s.color,
          name: s.name
        },
        N({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: $.value.body[k], s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
        isNaN($.value.body[k] / m.value) ? "-" : ($.value.body[k] / m.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
      ]), l = {
        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
      }, a = [
        e.value.table.columnNames.series,
        e.value.table.columnNames.value,
        e.value.table.columnNames.percentage
      ];
      return {
        head: t,
        body: o,
        config: l,
        colNames: a
      };
    });
    function fe() {
      Ge(() => {
        const t = $.value.head.map((a, s) => [[
          a.name
        ], [$.value.body[s]], [isNaN($.value.body[s] / m.value) ? "-" : $.value.body[s] / m.value * 100]]), o = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(t), l = ot(o);
        at({ csvContent: l, title: e.value.style.chart.title.text || "vue-ui-rings" });
      });
    }
    const P = r(!1);
    function Re(t) {
      P.value = t, K.value += 1;
    }
    function ye() {
      w.value.showTable = !w.value.showTable;
    }
    function me() {
      w.value.showTooltip = !w.value.showTooltip;
    }
    const D = r(!1);
    function Y() {
      D.value = !D.value;
    }
    return Oe({
      getData: Ve,
      generatePdf: ce,
      generateCsv: fe,
      generateImage: de,
      toggleTable: ye,
      toggleTooltip: me,
      toggleAnnotator: Y
    }), (t, o) => (i(), h("div", {
      ref_key: "ringsChart",
      ref: O,
      class: E(`vue-ui-rings ${P.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: S(`font-family:${e.value.style.fontFamily};text-align:center;width:100%;background:${e.value.style.chart.backgroundColor};${e.value.responsive ? "height: 100%" : ""}`),
      id: `rings_${A.value}`,
      onMouseleave: o[3] || (o[3] = (l) => {
        T.value = null, z.value = !1, u(se)(!1);
      }),
      onMouseenter: o[4] || (o[4] = () => u(se)(!0))
    }, [
      e.value.userOptions.buttons.annotator ? (i(), _(ft, {
        key: 0,
        parent: O.value,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        active: D.value,
        onClose: Y
      }, null, 8, ["parent", "backgroundColor", "color", "active"])) : b("", !0),
      Ae.value ? (i(), h("div", {
        key: 1,
        ref_key: "noTitle",
        ref: te,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : b("", !0),
      e.value.style.chart.title.text ? (i(), h("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: Q,
        style: "width:100%;background:transparent"
      }, [
        (i(), _(rt, {
          key: `title_${le.value}`,
          config: {
            title: {
              cy: "rings-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "rings-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : b("", !0),
      e.value.userOptions.show && V.value && (u(ne) || u(H)) ? (i(), _(it, {
        ref_key: "details",
        ref: Le,
        key: `user_options_${K.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: u(ie),
        isImaging: u(ve),
        uid: A.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.chart.tooltip.show,
        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,
        isTooltip: w.value.showTooltip,
        isFullscreen: P.value,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: O.value,
        position: e.value.userOptions.position,
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: D.value,
        onToggleFullscreen: Re,
        onGeneratePdf: u(ce),
        onGenerateCsv: fe,
        onGenerateImage: u(de),
        onToggleTable: ye,
        onToggleTooltip: me,
        onToggleAnnotator: Y,
        style: S({
          visibility: u(ne) ? u(H) ? "visible" : "hidden" : "visible"
        })
      }, We({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: g(() => [
            c(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: g(() => [
            c(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: g(() => [
            c(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: g(() => [
            c(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: g(() => [
            c(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: g(({ toggleFullscreen: l, isFullscreen: a }) => [
            c(t.$slots, "optionFullscreen", I(M({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
          ]),
          key: "5"
        } : void 0,
        t.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: g(({ toggleAnnotator: l, isAnnotator: a }) => [
            c(t.$slots, "optionAnnotator", I(M({ toggleAnnotator: l, isAnnotator: a })), void 0, !0)
          ]),
          key: "6"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isTooltip", "isFullscreen", "titles", "chartElement", "position", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : b("", !0),
      V.value ? (i(), h("svg", {
        key: 4,
        xmlns: u(Qe),
        class: E({ "vue-data-ui-fullscreen--on": P.value, "vue-data-ui-fulscreen--off": !P.value }),
        viewBox: `0 0 ${n.value.width <= 0 ? 10 : n.value.width} ${n.value.height <= 0 ? 10 : n.value.height}`,
        style: S(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
      }, [
        be(gt),
        t.$slots["chart-background"] ? (i(), h("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: n.value.width <= 0 ? 10 : n.value.width,
          height: n.value.height <= 0 ? 10 : n.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          c(t.$slots, "chart-background", {}, void 0, !0)
        ], 8, Ct)) : b("", !0),
        C("defs", null, [
          (i(!0), h(ke, null, Ce(p.value, (l, a) => (i(), h("radialGradient", {
            cx: "50%",
            cy: "30%",
            r: "50%",
            fx: "50%",
            fy: "50%",
            id: `gradient_${A.value}_${a}`
          }, [
            C("stop", {
              offset: "0%",
              "stop-color": u(Ze)(u(et)(l.color, 0.05), 100 - e.value.style.chart.layout.rings.gradient.intensity)
            }, null, 8, $t),
            C("stop", {
              offset: "100%",
              "stop-color": l.color
            }, null, 8, Tt)
          ], 8, wt))), 256))
        ]),
        (i(!0), h(ke, null, Ce(p.value, (l, a) => (i(), h("g", null, [
          C("circle", {
            class: E({
              "vue-ui-rings-item": L.value && e.value.useCssAnimation,
              "vue-rings-item-onload": !L.value && e.value.useCssAnimation,
              "vue-ui-rings-opacity": T.value !== null && T.value !== a
            }),
            style: S(`animation-delay:${a * 100}ms`),
            stroke: e.value.style.chart.layout.rings.stroke,
            cx: n.value.width / 2,
            cy: a === 0 ? n.value.height / 2 : n.value.height / 2 + f.value * p.value[0].proportion / 2 - f.value * l.proportion / 2 - 2 * (a + 1),
            r: u(J)(f.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : f.value * l.proportion / 2 * 0.9),
            fill: e.value.style.chart.layout.rings.gradient.underlayerColor
          }, null, 14, _t),
          C("circle", {
            class: E({
              "vue-ui-rings-item": L.value && e.value.useCssAnimation,
              "vue-rings-item-onload": !L.value && e.value.useCssAnimation,
              "vue-ui-rings-shadow": e.value.style.chart.layout.rings.useShadow,
              "vue-ui-rings-blur": T.value !== null && T.value !== a
            }),
            style: S(`animation-delay:${a * 100}ms`),
            stroke: e.value.style.chart.layout.rings.stroke,
            "stroke-width": l.strokeWidth < 0.5 ? 0.5 : l.strokeWidth,
            cx: n.value.width / 2,
            cy: a === 0 ? n.value.height / 2 : n.value.height / 2 + f.value * p.value[0].proportion / 2 - f.value * l.proportion / 2 - 2 * (a + 1),
            r: u(J)(f.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : f.value * l.proportion / 2 * 0.9),
            fill: e.value.style.chart.layout.rings.gradient.show ? `url(#gradient_${A.value}_${a})` : l.color
          }, null, 14, xt),
          C("circle", {
            "data-cy-trap": "",
            stroke: "none",
            cx: n.value.width / 2,
            cy: a === 0 ? n.value.height / 2 : n.value.height / 2 + f.value * p.value[0].proportion / 2 - f.value * l.proportion / 2 - 2 * (a + 1),
            r: u(J)(f.value * l.proportion / 2 * 0.9 <= 0 ? 1e-4 : f.value * l.proportion / 2 * 0.9),
            fill: "transparent",
            onMouseenter: (s) => ze(a, l),
            onMouseleave: o[0] || (o[0] = (s) => {
              T.value = null, z.value = !1;
            })
          }, null, 40, Nt)
        ]))), 256)),
        c(t.$slots, "svg", { svg: n.value }, void 0, !0)
      ], 14, kt)) : b("", !0),
      t.$slots.watermark ? (i(), h("div", Ot, [
        c(t.$slots, "watermark", I(M({ isPrinting: u(ie) || u(ve) })), void 0, !0)
      ])) : b("", !0),
      V.value ? b("", !0) : (i(), _(pt, {
        key: 6,
        config: {
          type: "rings",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            rings: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      C("div", {
        ref_key: "chartLegend",
        ref: Z
      }, [
        e.value.style.chart.legend.show ? (i(), _(dt, {
          key: `legend_${ae.value}`,
          legendSet: ge.value,
          config: Me.value,
          onClickMarker: o[1] || (o[1] = ({ legend: l }) => j(l.uid))
        }, {
          item: g(({ legend: l, index: a }) => [
            C("div", {
              "data-cy-legend-item": "",
              onClick: (s) => j(l.uid),
              style: S(`opacity:${d.value.includes(l.uid) ? 0.5 : 1}`)
            }, [
              we(W(l.name) + ": " + W(u(_e)(
                e.value.style.chart.layout.labels.dataLabels.formatter,
                l.value,
                u(N)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: l.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.legend.roundingValue
                }),
                { datapoint: l, seriesIndex: a }
              )) + " ", 1),
              d.value.includes(l.uid) ? (i(), h("span", Lt, " ( - % ) ")) : (i(), h("span", St, " (" + W(isNaN(l.value / m.value) ? "-" : u(N)({
                v: l.value / m.value * 100,
                s: "%",
                r: e.value.style.chart.legend.roundingPercentage
              })) + ") ", 1))
            ], 12, Pt)
          ]),
          _: 1
        }, 8, ["legendSet", "config"])) : c(t.$slots, "legend", {
          key: 1,
          legend: ge.value
        }, void 0, !0)
      ], 512),
      t.$slots.source ? (i(), h("div", {
        key: 7,
        ref_key: "source",
        ref: ee,
        dir: "auto"
      }, [
        c(t.$slots, "source", {}, void 0, !0)
      ], 512)) : b("", !0),
      be(vt, {
        show: w.value.showTooltip && z.value && d.value.length < y.dataset.length,
        backgroundColor: e.value.style.chart.tooltip.backgroundColor,
        color: e.value.style.chart.tooltip.color,
        borderRadius: e.value.style.chart.tooltip.borderRadius,
        borderColor: e.value.style.chart.tooltip.borderColor,
        borderWidth: e.value.style.chart.tooltip.borderWidth,
        fontSize: e.value.style.chart.tooltip.fontSize,
        backgroundOpacity: e.value.style.chart.tooltip.backgroundOpacity,
        position: e.value.style.chart.tooltip.position,
        offsetY: e.value.style.chart.tooltip.offsetY,
        parent: O.value,
        content: G.value,
        isFullscreen: P.value,
        isCustom: e.value.style.chart.tooltip.customFormat && typeof e.value.style.chart.tooltip.customFormat == "function"
      }, {
        "tooltip-before": g(() => [
          c(t.$slots, "tooltip-before", I(M({ ...X.value })), void 0, !0)
        ]),
        "tooltip-after": g(() => [
          c(t.$slots, "tooltip-after", I(M({ ...X.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isFullscreen", "isCustom"]),
      V.value ? (i(), _(ht, {
        key: 8,
        hideDetails: "",
        config: {
          open: w.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: g(() => [
          (i(), _(ct, {
            key: `table_${oe.value}`,
            colNames: B.value.colNames,
            head: B.value.head,
            body: B.value.body,
            config: B.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: o[2] || (o[2] = (l) => w.value.showTable = !1)
          }, {
            th: g(({ th: l }) => [
              C("div", {
                innerHTML: l,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, At)
            ]),
            td: g(({ td: l }) => [
              we(W(l.name || l), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : b("", !0)
    ], 46, bt));
  }
}, qt = /* @__PURE__ */ mt(Ft, [["__scopeId", "data-v-b8e475ba"]]);
export {
  qt as default
};
