import { useSlots as ct, computed as w, ref as d, onMounted as dt, onBeforeUnmount as ht, watch as je, createElementBlock as u, openBlock as o, unref as n, normalizeStyle as z, normalizeClass as de, createBlock as R, createCommentVNode as i, renderSlot as g, createElementVNode as p, createVNode as he, createSlots as We, withCtx as x, normalizeProps as H, guardReactiveProps as E, Fragment as b, renderList as F, mergeProps as He, toDisplayString as C, createTextVNode as Ee, nextTick as yt } from "vue";
import { u as ft, o as pt, e as qe, g as gt, c as bt, b as mt, d as Je, p as U, m as wt, H as kt, f as O, X as _t, s as Z, w as xt, j as $t, I as L, i as A, k as ee, n as k, t as Ct, a as Pt, q as St, r as Ft, x as Lt } from "./index-gC66Se26.js";
import { t as Tt, u as zt } from "./useResponsive-Cw4oZ8sQ.js";
import { _ as Ot } from "./Title-Co3F59jq.js";
import { u as Yt, U as At } from "./usePrinter-KMFl0n0s.js";
import { D as Nt } from "./DataTable-C_28ZqiP.js";
import { _ as Xt } from "./Tooltip-Cr89wMKa.js";
import { L as It } from "./Legend-CmKaL7xe.js";
import Dt from "./vue-ui-skeleton-7Zfds6H1.js";
import Mt from "./vue-ui-accordion-j2beIma_.js";
import { u as Ke } from "./useNestedProp-BusTOV-6.js";
import { _ as Bt } from "./PackageVersion-39l3KkzC.js";
import { P as Vt } from "./PenAndPaper-CmcfpltX.js";
import { u as Gt } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as Rt } from "./Shape-iIO-95sh.js";
import { u as Ut } from "./useChartAccessibility-BWojgys7.js";
import { _ as jt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Wt = ["id"], Ht = ["xmlns", "viewBox"], Et = ["width", "height"], qt = { key: 1 }, Jt = ["id"], Kt = ["stop-color"], Qt = ["offset", "stop-color"], Zt = ["offset", "stop-color"], el = ["stop-color"], tl = { key: 2 }, ll = ["id", "cx", "cy"], al = ["stop-color", "stop-opacity"], ol = ["stop-color"], ul = ["id"], sl = ["id"], nl = ["id"], rl = ["flood-color"], il = ["id"], vl = ["flood-color"], cl = ["d", "stroke", "filter"], dl = ["x1", "y1", "x2", "y2", "stroke", "filter"], hl = ["cx", "cy", "r", "fill", "filter"], yl = { key: 6 }, fl = ["stroke", "d"], pl = { key: 0 }, gl = ["d", "fill", "stroke", "stroke-width", "filter"], bl = ["d", "fill", "stroke", "stroke-width", "filter"], ml = { key: 0 }, wl = ["stroke", "d"], kl = { key: 0 }, _l = ["d", "stroke", "stroke-width", "filter"], xl = { key: 1 }, $l = ["d", "fill", "stroke", "stroke-width", "filter"], Cl = ["d", "fill", "stroke", "stroke-width", "filter"], Pl = { key: 1 }, Sl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Fl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ll = ["cx", "cy", "r", "stroke"], Tl = ["cx", "cy", "r", "fill"], zl = { key: 0 }, Ol = ["d", "fill", "onMouseenter", "onClick"], Yl = { key: 1 }, Al = ["cx", "cy", "r", "fill"], Nl = ["x", "y", "fill", "font-size"], Xl = ["x", "y", "fill", "font-size"], Il = ["x", "y", "fill", "font-size"], Dl = ["x", "y", "fill", "font-size"], Ml = ["filter"], Bl = { key: 0 }, Vl = ["x", "y"], Gl = { key: 1 }, Rl = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Ul = ["cx", "cy", "fill", "stroke", "filter", "onClick"], jl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Wl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], Hl = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], El = ["text-anchor", "x", "y", "fill", "font-size", "onClick"], ql = { key: 2 }, Jl = ["x", "y", "width"], Kl = ["x", "y", "width"], Ql = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Zl = ["onClick"], ea = {
  key: 0,
  style: { "font-variant-numeric": "tabular-nums" }
}, ta = { key: 1 }, la = ["innerHTML"], aa = {
  __name: "vue-ui-donut",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint"],
  setup(Qe, { expose: Ze, emit: et }) {
    const { vue_ui_donut: tt } = ft(), lt = ct(), N = Qe, q = w({
      get() {
        return !!N.dataset && N.dataset.length;
      },
      set(l) {
        return l;
      }
    }), J = d(null), ye = d(null), fe = d(null), te = d(null), pe = d(null), ge = d(null), be = d(0), me = d(0), we = d(0);
    dt(() => {
      ke();
    }), ht(() => {
      te.value && te.value.disconnect();
    });
    function ke() {
      if (pt(N.dataset) ? qe({
        componentName: "VueUiDonut",
        type: "dataset"
      }) : N.dataset.forEach((l, r) => {
        gt({
          datasetObject: l,
          requiredAttributes: ["name", "values"]
        }).forEach((t) => {
          q.value = !1, qe({
            componentName: "VueUiDonut",
            type: "datasetSerieAttribute",
            property: t,
            index: r
          });
        });
      }), e.value.responsive) {
        const l = Tt(() => {
          const { width: r, height: t } = zt({
            chart: J.value,
            title: e.value.style.chart.title.text ? ye.value : null,
            legend: e.value.style.chart.legend.show ? fe.value : null,
            source: pe.value,
            noTitle: ge.value,
            padding: Pe.value
          });
          requestAnimationFrame(() => {
            s.value.width = r, s.value.height = t;
          });
        });
        te.value = new ResizeObserver(l), te.value.observe(J.value.parentNode);
      }
    }
    const y = d(bt()), at = d(null), le = d(!1), ue = d(""), P = d(null), _e = d(0);
    function xe() {
      const l = Ke({
        userConfig: N.config,
        defaultConfig: tt
      });
      return l.theme ? {
        ...Ke({
          userConfig: Pt.vue_ui_donut[l.theme] || N.config,
          defaultConfig: l
        }),
        customPalette: Ct[l.theme] || U
      } : l;
    }
    const e = w({
      get: () => xe(),
      set: (l) => l
    }), { userOptionsVisible: se, setUserOptionsVisibility: $e, keepUserOptionState: Ce } = Gt({ config: e.value }), { svgRef: ne } = Ut({ config: e.value.style.chart.title });
    je(() => N.config, (l) => {
      e.value = xe(), se.value = !e.value.userOptions.showOnChartHover, ke(), be.value += 1, me.value += 1, we.value += 1, f.value.dataLabels.show = e.value.style.chart.layout.labels.dataLabels.show, f.value.showTable = e.value.table.show, f.value.showTooltip = e.value.style.chart.tooltip.show;
    }, { deep: !0 });
    const Pe = w(() => {
      const { top: l, right: r, bottom: t, left: a } = e.value.style.chart.padding;
      return {
        css: `padding:${l}px ${r}px ${t}px ${a}px`,
        top: l,
        right: r,
        bottom: t,
        left: a
      };
    }), { isPrinting: Se, isImaging: Fe, generatePdf: Le, generateImage: Te } = Yt({
      elementId: `donut__${y.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-donut",
      options: e.value.userOptions.print
    }), ot = w(() => e.value.userOptions.show && !e.value.style.chart.title.text), ze = w(() => mt(e.value.customPalette)), f = d({
      dataLabels: {
        show: e.value.style.chart.layout.labels.dataLabels.show
      },
      showTable: e.value.table.show,
      showTooltip: e.value.style.chart.tooltip.show
    }), s = d({
      height: 360,
      width: 512
    }), K = w(() => {
      const l = e.value.style.chart.layout.donut.strokeWidth / 512, r = Math.min(s.value.width, s.value.height) * l, t = r > $.value ? $.value : r;
      return Math.max(t, 3);
    }), Oe = et, B = w(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: Je(l.color) || ze.value[r] || U[r] || U[r % U.length],
      value: l.values.reduce((t, a) => t + a, 0),
      absoluteValues: l.values,
      comment: l.comment || "",
      patternIndex: r
    }))), T = d(B.value);
    je(() => B.value, (l) => T.value = l);
    function ut() {
      return B.value.map((l) => ({
        name: l.name,
        color: l.color,
        value: l.value
      }));
    }
    const X = d([]), Ye = d(null), Ae = d(null), V = d(!1);
    function Ne(l) {
      const r = B.value.find((v, m) => m === l), t = T.value.find((v, m) => m === l);
      let a = t.value;
      if (X.value.includes(l)) {
        let m = function() {
          a > v ? (cancelAnimationFrame(Ye.value), T.value = T.value.map((_, ce) => l === ce ? {
            ..._,
            value: v
          } : _), V.value = !1) : (V.value = !0, a += v * 0.025, T.value = T.value.map((_, ce) => l === ce ? {
            ..._,
            value: a
          } : _), Ye.value = requestAnimationFrame(m));
        };
        X.value = X.value.filter((_) => _ !== l);
        const v = r.value;
        m();
      } else if (X.value.length < B.value.length - 1) {
        let v = function() {
          a < t.value / 100 ? (cancelAnimationFrame(Ae.value), X.value.push(l), T.value = T.value.map((m, _) => l === _ ? {
            ...m,
            value: 0
          } : m), V.value = !1) : (V.value = !0, a /= 1.1, T.value = T.value.map((m, _) => l === _ ? {
            ...m,
            value: a
          } : m), Ae.value = requestAnimationFrame(v));
        };
        v();
      }
      Oe("selectLegend", I.value.map((v) => ({
        name: v.name,
        color: v.color,
        value: v.value
      })));
    }
    const I = w(() => (T.value.forEach((l, r) => {
      if ([null, void 0].includes(l.values))
        return {
          ...l,
          values: []
        };
    }), T.value.map((l, r) => ({
      ...l,
      seriesIndex: r
    })).filter((l, r) => !X.value.includes(r)))), Xe = w(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: Je(l.color) || ze.value[r] || U[r] || U[r % U.length],
      value: (l.values || []).reduce((t, a) => t + a, 0),
      shape: "circle",
      patternIndex: r
    })).map((l, r) => ({
      ...l,
      proportion: l.value / N.dataset.map((t) => (t.values || []).reduce((a, v) => a + v, 0)).reduce((t, a) => t + a, 0),
      opacity: X.value.includes(r) ? 0.5 : 1,
      segregate: () => !V.value && Ne(r),
      isSegregated: X.value.includes(r)
    }))), st = w(() => ({
      cy: "donut-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" : ""
    })), $ = w(() => {
      const l = Math.min(s.value.width / 3, s.value.height / 3);
      return l < 55 ? 55 : l;
    }), h = w(() => wt({ series: I.value }, s.value.width / 2, s.value.height / 2, $.value, $.value, 1.99999, 2, 1, 360, 105.25, K.value)), c = w(() => {
      const l = Math.max(...I.value.map((t) => t.value)), r = I.value.map((t) => t.value / l);
      return kt({
        series: r,
        center: {
          x: s.value.width / 2,
          y: s.value.height / 2
        },
        maxRadius: Math.min(s.value.width, s.value.height) / 3
      });
    });
    function j(l) {
      return l.x > s.value.width / 2 + 6 ? "start" : l.x < s.value.width / 2 - 6 ? "end" : "middle";
    }
    function nt(l) {
      return l.middlePoint.y > s.value.height / 2 ? L({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 100, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y : L({ initX: l.middlePoint.x, initY: l.middlePoint.y, offset: 0, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y - 100;
    }
    function Y(l) {
      return l.proportion * 100 > e.value.style.chart.layout.labels.dataLabels.hideUnderValue;
    }
    function re(l, r) {
      const t = l.value / rt(r);
      return isNaN(t) ? 0 : A(
        e.value.style.chart.layout.labels.percentage.formatter,
        t * 100,
        O({
          v: t * 100,
          s: "%",
          r: e.value.style.chart.layout.labels.percentage.rounding
        }),
        { datapoint: l }
      );
    }
    function rt(l) {
      return [...l].map((r) => r.value).reduce((r, t) => r + t, 0);
    }
    const S = w(() => I.value.map((l) => l.value).reduce((l, r) => l + r, 0)), Ie = w(() => S.value / I.value.length), De = w(() => (l) => V.value ? l.proportion * 100 : l.value / S.value * 100), ie = d(null), Q = d(!1);
    function Me({ datapoint: l, relativeIndex: r, seriesIndex: t, show: a = !1 }) {
      ie.value = { datapoint: l, seriesIndex: t, config: e.value, series: B.value }, le.value = a, P.value = r;
      let v = "";
      const m = e.value.style.chart.tooltip.customFormat;
      if (Q.value = !1, Lt(m))
        try {
          const _ = m({
            seriesIndex: t,
            datapoint: l,
            series: B.value,
            config: e.value
          });
          typeof _ == "string" && (ue.value = _, Q.value = !0);
        } catch {
          console.warn("Custom format cannot be applied."), Q.value = !1;
        }
      if (!Q.value) {
        if (v += `<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>`, v += `<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${l.color}"/>${lt.pattern ? `<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${y.value}_${t})"/>` : ""}</svg>`, e.value.style.chart.tooltip.showValue && (v += `<b>${A(
          e.value.style.chart.layout.labels.value.formatter,
          l.value,
          O({
            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: l,
            relativeIndex: r,
            seriesIndex: t
          }
        )}</b>`), e.value.style.chart.tooltip.showPercentage) {
          const _ = A(
            e.value.style.chart.layout.labels.percentage.formatter,
            l.proportion * 100,
            O({
              v: l.proportion * 100,
              s: "%",
              r: e.value.style.chart.tooltip.roundingPercentage
            }),
            {
              datapoint: l,
              relativeIndex: r,
              seriesIndex: t
            }
          );
          e.value.style.chart.tooltip.showValue ? v += `<span>(${_})</span></div>` : v += `<b>${_}</b></div>`;
        }
        e.value.style.chart.comments.showInTooltip && l.comment && (v += `<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${l.color}">${l.comment}</div>`), ue.value = `<div>${v}</div>`;
      }
    }
    function G(l) {
      return e.value.useBlurOnHover && ![null, void 0].includes(P.value) && P.value !== l ? `url(#blur_${y.value})` : "";
    }
    const D = w(() => {
      const l = I.value.map((t) => ({
        name: t.name,
        color: t.color
      })), r = I.value.map((t) => t.value);
      return { head: l, body: r };
    });
    function Be() {
      yt(() => {
        const l = D.value.head.map((a, v) => [[
          a.name
        ], [D.value.body[v]], [isNaN(D.value.body[v] / S.value) ? "-" : D.value.body[v] / S.value * 100]]), r = [[e.value.style.chart.title.text], [e.value.style.chart.title.subtitle.text], [[""], ["val"], ["%"]]].concat(l), t = St(r);
        Ft({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-donut" });
      });
    }
    const ae = w(() => {
      const l = [
        ' <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>',
        O({ p: e.value.style.chart.layout.labels.dataLabels.prefix, v: S.value, s: e.value.style.chart.layout.labels.dataLabels.suffix, r: e.value.table.td.roundingValue }),
        "100%"
      ], r = D.value.head.map((v, m) => [
        {
          color: v.color,
          name: v.name
        },
        D.value.body[m],
        isNaN(D.value.body[m] / S.value) ? "-" : (D.value.body[m] / S.value * 100).toFixed(e.value.table.td.roundingPercentage) + "%"
      ]), t = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return {
        colNames: [
          e.value.table.columnNames.series,
          e.value.table.columnNames.value,
          e.value.table.columnNames.percentage
        ],
        head: l,
        body: r,
        config: t
      };
    }), W = d(!1);
    function it(l) {
      W.value = l, _e.value += 1;
    }
    const Ve = w(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent));
    function vt(l) {
      return l.toFixed(e.value.style.chart.legend.roundingPercentage).split("").map((r) => "-").join("");
    }
    function M(l, r) {
      Oe("selectDatapoint", { datapoint: l, index: r });
    }
    function Ge() {
      f.value.showTable = !f.value.showTable;
    }
    function Re() {
      f.value.dataLabels.show = !f.value.dataLabels.show;
    }
    function Ue() {
      f.value.showTooltip = !f.value.showTooltip;
    }
    const oe = d(!1);
    function ve() {
      oe.value = !oe.value;
    }
    return Ze({
      getData: ut,
      generatePdf: Le,
      generateCsv: Be,
      generateImage: Te,
      toggleTable: Ge,
      toggleLabels: Re,
      toggleTooltip: Ue,
      toggleAnnotator: ve
    }), (l, r) => (o(), u("div", {
      ref_key: "donutChart",
      ref: J,
      class: de(`vue-ui-donut ${W.value ? "vue-data-ui-wrapper-fullscreen" : ""} ${e.value.useCssAnimation ? "" : "vue-ui-dna"}`),
      style: z(`font-family:${e.value.style.fontFamily};width:100%; ${e.value.responsive ? "height:100%;" : ""} text-align:center;background:${e.value.style.chart.backgroundColor}`),
      id: `donut__${y.value}`,
      onMouseenter: r[6] || (r[6] = () => n($e)(!0)),
      onMouseleave: r[7] || (r[7] = () => n($e)(!1))
    }, [
      e.value.userOptions.buttons.annotator && n(ne) ? (o(), R(Vt, {
        key: 0,
        color: e.value.style.chart.color,
        backgroundColor: e.value.style.chart.backgroundColor,
        active: oe.value,
        svgRef: n(ne),
        onClose: ve
      }, null, 8, ["color", "backgroundColor", "active", "svgRef"])) : i("", !0),
      g(l.$slots, "userConfig", {}, void 0, !0),
      ot.value ? (o(), u("div", {
        key: 1,
        ref_key: "noTitle",
        ref: ge,
        class: "vue-data-ui-no-title-space",
        style: "height:36px; width: 100%;background:transparent"
      }, null, 512)) : i("", !0),
      e.value.style.chart.title.text ? (o(), u("div", {
        key: 2,
        ref_key: "chartTitle",
        ref: ye,
        style: "width:100%;background:transparent;padding-bottom:24px"
      }, [
        (o(), R(Ot, {
          key: `title_${be.value}`,
          config: {
            title: {
              cy: "donut-div-title",
              ...e.value.style.chart.title
            },
            subtitle: {
              cy: "donut-div-subtitle",
              ...e.value.style.chart.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : i("", !0),
      e.value.userOptions.show && q.value && (n(Ce) || n(se)) ? (o(), R(At, {
        ref_key: "details",
        ref: at,
        key: `user_option_${_e.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: n(Se),
        isImaging: n(Fe),
        uid: y.value,
        hasTooltip: e.value.style.chart.tooltip.show && e.value.userOptions.buttons.tooltip,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasImg: e.value.userOptions.buttons.img,
        hasXls: e.value.userOptions.buttons.csv,
        hasTable: e.value.userOptions.buttons.table,
        hasLabel: e.value.userOptions.buttons.labels,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: W.value,
        chartElement: J.value,
        position: e.value.userOptions.position,
        isTooltip: f.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        hasAnnotator: e.value.userOptions.buttons.annotator,
        isAnnotation: oe.value,
        onToggleFullscreen: it,
        onGeneratePdf: n(Le),
        onGenerateCsv: Be,
        onGenerateImage: n(Te),
        onToggleTable: Ge,
        onToggleLabels: Re,
        onToggleTooltip: Ue,
        onToggleAnnotator: ve,
        style: z({
          visibility: n(Ce) ? n(se) ? "visible" : "hidden" : "visible"
        })
      }, We({ _: 2 }, [
        l.$slots.menuIcon ? {
          name: "menuIcon",
          fn: x(({ isOpen: t, color: a }) => [
            g(l.$slots, "menuIcon", H(E({ isOpen: t, color: a })), void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: x(() => [
            g(l.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: x(() => [
            g(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: x(() => [
            g(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: x(() => [
            g(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: x(() => [
            g(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        l.$slots.optionLabels ? {
          name: "optionLabels",
          fn: x(() => [
            g(l.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "6"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: x(({ toggleFullscreen: t, isFullscreen: a }) => [
            g(l.$slots, "optionFullscreen", H(E({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
          ]),
          key: "7"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: x(({ toggleAnnotator: t, isAnnotator: a }) => [
            g(l.$slots, "optionAnnotator", H(E({ toggleAnnotator: t, isAnnotator: a })), void 0, !0)
          ]),
          key: "8"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : i("", !0),
      q.value ? (o(), u("svg", {
        key: 4,
        ref_key: "svgRef",
        ref: ne,
        xmlns: n(_t),
        class: de({ "vue-data-ui-fullscreen--on": W.value, "vue-data-ui-fulscreen--off": !W.value }),
        viewBox: `0 0 ${s.value.width <= 0 ? 10 : s.value.width} ${s.value.height <= 0 ? 10 : s.value.height}`,
        style: z(`max-width:100%; overflow: visible; background:transparent;color:${e.value.style.chart.color};${Pe.value.css}`)
      }, [
        he(Bt),
        l.$slots["chart-background"] ? (o(), u("foreignObject", {
          key: 0,
          x: 0,
          y: 0,
          width: s.value.width <= 0 ? 10 : s.value.width,
          height: s.value.height <= 0 ? 10 : s.value.height,
          style: {
            pointerEvents: "none"
          }
        }, [
          g(l.$slots, "chart-background", {}, void 0, !0)
        ], 8, Et)) : i("", !0),
        e.value.type === "classic" ? (o(), u("defs", qt, [
          e.value.style.chart.useGradient ? (o(), u("radialGradient", {
            key: 0,
            id: `gradient_${y.value}`
          }, [
            p("stop", {
              offset: "0%",
              "stop-color": n(Z)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Kt),
            p("stop", {
              offset: `${(1 - K.value / $.value) * 100}%`,
              "stop-color": n(Z)("#FFFFFF", 0),
              "stop-opacity": "0"
            }, null, 8, Qt),
            p("stop", {
              offset: `${(1 - K.value / $.value / 2) * 100}%`,
              "stop-color": n(Z)("#FFFFFF", e.value.style.chart.gradientIntensity)
            }, null, 8, Zt),
            p("stop", {
              offset: "100%",
              "stop-color": n(Z)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, el)
          ], 8, Jt)) : i("", !0)
        ])) : i("", !0),
        e.value.type === "polar" ? (o(), u("defs", tl, [
          (o(!0), u(b, null, F(c.value, (t, a) => (o(), u("radialGradient", {
            id: `polar_gradient_${a}_${y.value}`,
            cx: t.middlePoint.x / s.value.width * 100 + "%",
            cy: t.middlePoint.y / s.value.height * 100 + "%",
            r: "62%"
          }, [
            p("stop", {
              offset: "0%",
              "stop-color": n(xt)(h.value[a].color, 0.05),
              "stop-opacity": e.value.style.chart.gradientIntensity / 100
            }, null, 8, al),
            p("stop", {
              offset: "100%",
              "stop-color": h.value[a].color
            }, null, 8, ol)
          ], 8, ll))), 256))
        ])) : i("", !0),
        p("defs", null, [
          p("filter", {
            id: `blur_${y.value}`,
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            p("feGaussianBlur", {
              in: "SourceGraphic",
              stdDeviation: 2,
              id: `blur_std_${y.value}`
            }, null, 8, sl),
            r[8] || (r[8] = p("feColorMatrix", {
              type: "saturate",
              values: "0"
            }, null, -1))
          ], 8, ul),
          p("filter", {
            id: `shadow_${y.value}`,
            "color-interpolation-filters": "sRGB"
          }, [
            p("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "10",
              "flood-opacity": "0.5",
              "flood-color": e.value.style.chart.layout.donut.shadowColor
            }, null, 8, rl)
          ], 8, nl),
          p("filter", {
            id: `drop_shadow_${y.value}`,
            "color-interpolation-filters": "sRGB",
            x: "-50%",
            y: "-50%",
            width: "200%",
            height: "200%"
          }, [
            p("feDropShadow", {
              dx: "0",
              dy: "0",
              stdDeviation: "3",
              "flood-opacity": "1",
              "flood-color": e.value.style.chart.layout.donut.shadowColor
            }, null, 8, vl)
          ], 8, il)
        ]),
        e.value.type === "classic" ? (o(!0), u(b, { key: 3 }, F(h.value, (t, a) => (o(), u("g", null, [
          Y(t) && f.value.dataLabels.show ? (o(), u("path", {
            key: 0,
            d: n($t)(t, { x: s.value.width / 2, y: s.value.height / 2 }, 16, 16, !1, !1, K.value, 12, e.value.style.chart.layout.curvedMarkers),
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: G(a)
          }, null, 8, cl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "polar" ? (o(!0), u(b, { key: 4 }, F(h.value, (t, a) => (o(), u("g", null, [
          Y(t) && f.value.dataLabels.show ? (o(), u("line", {
            key: 0,
            x1: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
            y1: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y,
            x2: c.value[a].middlePoint.x,
            y2: c.value[a].middlePoint.y,
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: G(a)
          }, null, 8, dl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "classic" && e.value.style.chart.layout.donut.useShadow ? (o(), u("circle", {
          key: 5,
          cx: s.value.width / 2,
          cy: s.value.height / 2,
          r: $.value <= 0 ? 10 : $.value,
          fill: e.value.style.chart.backgroundColor,
          filter: `url(#shadow_${y.value})`
        }, null, 8, hl)) : i("", !0),
        l.$slots.pattern ? (o(), u("g", yl, [
          (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("defs", null, [
            g(l.$slots, "pattern", He({ ref_for: !0 }, { ...t, patternId: `pattern_${y.value}_${t.patternIndex}` }), void 0, !0)
          ]))), 256))
        ])) : i("", !0),
        S.value && e.value.type === "classic" ? (o(), u(b, { key: 7 }, [
          (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
            stroke: e.value.style.chart.backgroundColor,
            d: t.arcSlice,
            fill: "#FFFFFF"
          }, null, 8, fl))), 256)),
          l.$slots.pattern ? (o(), u("g", pl, [
            (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
              class: "vue-ui-donut-arc-path",
              d: t.arcSlice,
              fill: `url(#pattern_${y.value}_${t.patternIndex})`,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth,
              filter: G(a)
            }, null, 8, gl))), 256))
          ])) : i("", !0),
          (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
            class: "vue-ui-donut-arc-path",
            d: t.arcSlice,
            fill: n(Z)(t.color, 80),
            stroke: e.value.style.chart.backgroundColor,
            "stroke-width": e.value.style.chart.layout.donut.borderWidth,
            filter: G(a)
          }, null, 8, bl))), 256))
        ], 64)) : i("", !0),
        S.value && e.value.type === "polar" ? (o(), u(b, { key: 8 }, [
          h.value.length > 1 ? (o(), u("g", ml, [
            (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
              stroke: e.value.style.chart.backgroundColor,
              d: c.value[a].path,
              fill: "#FFFFFF"
            }, null, 8, wl))), 256)),
            e.value.style.chart.layout.donut.useShadow ? (o(), u("g", kl, [
              (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
                class: "vue-ui-donut-arc-path",
                d: c.value[a].path,
                fill: "transparent",
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": e.value.style.chart.layout.donut.borderWidth,
                filter: `url(#drop_shadow_${y.value})`
              }, null, 8, _l))), 256))
            ])) : i("", !0),
            l.$slots.pattern ? (o(), u("g", xl, [
              (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
                class: "vue-ui-donut-arc-path",
                d: c.value[a].path,
                fill: `url(#pattern_${y.value}_${t.patternIndex})`,
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": e.value.style.chart.layout.donut.borderWidth,
                filter: G(a)
              }, null, 8, $l))), 256))
            ])) : i("", !0),
            (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
              class: "vue-ui-donut-arc-path",
              d: c.value[a].path,
              fill: e.value.style.chart.useGradient ? `url(#polar_gradient_${a}_${y.value})` : t.color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth,
              filter: G(a)
            }, null, 8, Cl))), 256))
          ])) : (o(), u("g", Pl, [
            l.$slots.pattern ? (o(), u("circle", {
              key: 0,
              cx: s.value.width / 2,
              cy: s.value.height / 2,
              r: $.value,
              fill: `url(#pattern_${y.value}_${h.value[0].patternIndex})`,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth
            }, null, 8, Sl)) : i("", !0),
            p("circle", {
              cx: s.value.width / 2,
              cy: s.value.height / 2,
              r: $.value,
              fill: e.value.style.chart.useGradient ? `url(#polar_gradient_0_${y.value})` : h.value[0].color,
              stroke: e.value.style.chart.backgroundColor,
              "stroke-width": e.value.style.chart.layout.donut.borderWidth
            }, null, 8, Fl)
          ]))
        ], 64)) : (o(), u("circle", {
          key: 9,
          cx: s.value.width / 2,
          cy: s.value.height / 2,
          r: $.value <= 0 ? 10 : $.value,
          fill: "transparent",
          stroke: e.value.style.chart.backgroundColor
        }, null, 8, Ll)),
        e.value.style.chart.useGradient && e.value.type === "classic" ? (o(), u("circle", {
          key: 10,
          cx: s.value.width / 2,
          cy: s.value.height / 2,
          r: (
            /* This might require adjustments */
            $.value <= 0 ? 10 : $.value
          ),
          fill: `url(#gradient_${y.value})`
        }, null, 8, Tl)) : i("", !0),
        S.value ? (o(), u(b, { key: 11 }, [
          h.value.length > 1 || e.value.type === "classic" ? (o(), u("g", zl, [
            (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("path", {
              d: e.value.type === "classic" ? t.arcSlice : c.value[a].path,
              fill: P.value === a ? "rgba(0,0,0,0.1)" : "transparent",
              onMouseenter: (v) => Me({
                datapoint: t,
                relativeIndex: a,
                seriesIndex: t.seriesIndex,
                show: !0
              }),
              onMouseleave: r[0] || (r[0] = (v) => {
                le.value = !1, P.value = null;
              }),
              onClick: (v) => M(t, a)
            }, null, 40, Ol))), 256))
          ])) : (o(), u("g", Yl, [
            p("circle", {
              cx: s.value.width / 2,
              cy: s.value.height / 2,
              r: $.value,
              fill: P.value === l.i ? "rgba(0,0,0,0.1)" : "transparent",
              onMouseenter: r[1] || (r[1] = (t) => Me({
                datapoint: h.value[0],
                relativeIndex: 0,
                seriesIndex: h.value[0].seriesIndex,
                show: !0
              })),
              onMouseleave: r[2] || (r[2] = (t) => {
                le.value = !1, P.value = null;
              }),
              onClick: r[3] || (r[3] = (t) => M(h.value[0], l.i))
            }, null, 40, Al)
          ]))
        ], 64)) : i("", !0),
        e.value.type === "classic" ? (o(), u(b, { key: 12 }, [
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), u("text", {
            key: 0,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.value.height / 2 - (e.value.style.chart.layout.labels.hollow.average.show ? e.value.style.chart.layout.labels.hollow.total.fontSize : 0) + e.value.style.chart.layout.labels.hollow.total.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.total.color,
            "font-size": e.value.style.chart.layout.labels.hollow.total.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.total.bold ? "bold" : ""}`)
          }, C(e.value.style.chart.layout.labels.hollow.total.text), 13, Nl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.total.show ? (o(), u("text", {
            key: 1,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.value.height / 2 + e.value.style.chart.layout.labels.hollow.total.fontSize - (e.value.style.chart.layout.labels.hollow.average.show ? e.value.style.chart.layout.labels.hollow.total.fontSize : 0) + e.value.style.chart.layout.labels.hollow.total.value.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.total.value.color,
            "font-size": e.value.style.chart.layout.labels.hollow.total.value.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.total.value.bold ? "bold" : ""}`)
          }, C(n(A)(
            e.value.style.chart.layout.labels.hollow.total.value.formatter,
            S.value,
            n(O)({
              p: e.value.style.chart.layout.labels.hollow.total.value.prefix,
              v: S.value,
              s: e.value.style.chart.layout.labels.hollow.total.value.suffix
            })
          )), 13, Xl)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), u("text", {
            key: 2,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.value.height / 2 + (e.value.style.chart.layout.labels.hollow.total.show ? e.value.style.chart.layout.labels.hollow.average.fontSize : 0) + e.value.style.chart.layout.labels.hollow.average.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.average.color,
            "font-size": e.value.style.chart.layout.labels.hollow.average.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.average.bold ? "bold" : ""}`)
          }, C(e.value.style.chart.layout.labels.hollow.average.text), 13, Il)) : i("", !0),
          e.value.style.chart.layout.labels.hollow.average.show ? (o(), u("text", {
            key: 3,
            "text-anchor": "middle",
            x: s.value.width / 2,
            y: s.value.height / 2 + (e.value.style.chart.layout.labels.hollow.total.show ? e.value.style.chart.layout.labels.hollow.average.fontSize : 0) + e.value.style.chart.layout.labels.hollow.average.fontSize + e.value.style.chart.layout.labels.hollow.average.value.offsetY,
            fill: e.value.style.chart.layout.labels.hollow.average.value.color,
            "font-size": e.value.style.chart.layout.labels.hollow.average.value.fontSize,
            style: z(`font-weight:${e.value.style.chart.layout.labels.hollow.average.value.bold ? "bold" : ""}`)
          }, C(V.value ? "--" : n(A)(
            e.value.style.chart.layout.labels.hollow.average.value.formatter,
            Ie.value,
            n(O)({
              p: e.value.style.chart.layout.labels.hollow.average.value.prefix,
              v: Ie.value,
              s: e.value.style.chart.layout.labels.hollow.average.value.suffix,
              r: e.value.style.chart.layout.labels.hollow.average.value.rounding
            })
          )), 13, Dl)) : i("", !0)
        ], 64)) : i("", !0),
        (o(!0), u(b, null, F(h.value, (t, a) => (o(), u("g", {
          filter: G(a),
          class: de({ animated: e.value.useCssAnimation })
        }, [
          e.value.style.chart.layout.labels.dataLabels.useLabelSlots ? (o(), u("g", Bl, [
            (o(), u("foreignObject", {
              x: n(k)(t, !0).anchor === "end" ? n(k)(t).x - 120 : n(k)(t, !0).anchor === "middle" ? n(k)(t).x - 60 : n(k)(t).x,
              y: n(ee)(t) - (Ve.value ? 20 : 0),
              width: "120",
              height: "60",
              style: { overflow: "visible" }
            }, [
              p("div", null, [
                g(l.$slots, "dataLabel", He({ ref_for: !0 }, {
                  datapoint: t,
                  isBlur: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a,
                  isSafari: Ve.value,
                  isVisible: Y(t) && f.value.dataLabels.show,
                  textAlign: n(k)(t, !0, 16, !0).anchor,
                  flexAlign: n(k)(t, !0, 16).anchor,
                  percentage: re(t, h.value)
                }), void 0, !0)
              ])
            ], 8, Vl))
          ])) : (o(), u("g", Gl, [
            e.value.type === "classic" ? (o(), u(b, { key: 0 }, [
              Y(t) && f.value.dataLabels.show ? (o(), u("circle", {
                key: 0,
                cx: n(k)(t).x,
                cy: n(ee)(t) - 3.5,
                fill: t.color,
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a ? "" : `url(#blur_${y.value})`,
                onClick: (v) => M(t, a)
              }, null, 8, Rl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), u(b, { key: 1 }, [
              Y(t) && f.value.dataLabels.show ? (o(), u("circle", {
                key: 0,
                cx: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
                cy: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 24, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y,
                fill: t.color,
                stroke: e.value.style.chart.backgroundColor,
                "stroke-width": 1,
                r: 3,
                filter: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a ? "" : `url(#blur_${y.value})`,
                onClick: (v) => M(t, a)
              }, null, 8, Ul)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "classic" ? (o(), u(b, { key: 2 }, [
              Y(t) && f.value.dataLabels.show ? (o(), u("text", {
                key: 0,
                "text-anchor": n(k)(t, !0, 12).anchor,
                x: n(k)(t, !0, 12).x,
                y: n(ee)(t),
                fill: e.value.style.chart.layout.labels.percentage.color,
                "font-size": e.value.style.chart.layout.labels.percentage.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.percentage.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, C(re(t, h.value)) + " " + C(e.value.style.chart.layout.labels.value.show ? `(${n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                n(O)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                }),
                { datapoint: t }
              )})` : ""), 13, jl)) : i("", !0),
              Y(t) && f.value.dataLabels.show ? (o(), u("text", {
                key: 1,
                "text-anchor": n(k)(t).anchor,
                x: n(k)(t, !0, 12).x,
                y: n(ee)(t) + e.value.style.chart.layout.labels.percentage.fontSize,
                fill: e.value.style.chart.layout.labels.name.color,
                "font-size": e.value.style.chart.layout.labels.name.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.name.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, C(t.name), 13, Wl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), u(b, { key: 3 }, [
              Y(t) && f.value.dataLabels.show ? (o(), u("text", {
                key: 0,
                "text-anchor": j(c.value[a].middlePoint),
                x: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
                y: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y,
                fill: e.value.style.chart.layout.labels.percentage.color,
                "font-size": e.value.style.chart.layout.labels.percentage.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.percentage.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, C(re(t, h.value)) + " " + C(e.value.style.chart.layout.labels.value.show ? `(${n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                n(O)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                }),
                { datapoint: t }
              )})` : ""), 13, Hl)) : i("", !0),
              Y(t) && f.value.dataLabels.show ? (o(), u("text", {
                key: 1,
                "text-anchor": j(c.value[a].middlePoint),
                x: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x,
                y: n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).y + e.value.style.chart.layout.labels.percentage.fontSize,
                fill: e.value.style.chart.layout.labels.name.color,
                "font-size": e.value.style.chart.layout.labels.name.fontSize,
                style: z(`font-weight:${e.value.style.chart.layout.labels.name.bold ? "bold" : ""}`),
                onClick: (v) => M(t, a)
              }, C(t.name), 13, El)) : i("", !0)
            ], 64)) : i("", !0)
          ])),
          f.value.dataLabels.show && e.value.style.chart.comments.show && t.comment ? (o(), u("g", ql, [
            Y(t) && e.value.type === "classic" ? (o(), u("foreignObject", {
              key: 0,
              x: e.value.style.chart.comments.offsetX + (n(k)(t, !0).anchor === "end" ? n(k)(t).x - e.value.style.chart.comments.width : n(k)(t, !0).anchor === "middle" ? n(k)(t).x - e.value.style.chart.comments.width / 2 : n(k)(t).x),
              y: n(ee)(t) + 24 + e.value.style.chart.comments.offsetY,
              width: e.value.style.chart.comments.width,
              height: "200",
              style: { overflow: "visible", "pointer-events": "none" }
            }, [
              p("div", null, [
                g(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: n(k)(t, !0, 16, !0).anchor, flexAlign: n(k)(t, !0, 16).anchor }
                }, void 0, !0)
              ])
            ], 8, Jl)) : i("", !0),
            Y(t) && e.value.type === "polar" ? (o(), u("foreignObject", {
              key: 1,
              x: e.value.style.chart.comments.offsetX + (j(c.value[a].middlePoint) === "end" ? n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x - e.value.style.chart.comments.width : j(c.value[a].middlePoint) === "middle" ? n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x - e.value.style.chart.comments.width / 2 : n(L)({ initX: c.value[a].middlePoint.x, initY: c.value[a].middlePoint.y, offset: 42, centerX: s.value.width / 2, centerY: s.value.height / 2 }).x),
              y: nt(c.value[a]) + e.value.style.chart.comments.offsetY,
              width: e.value.style.chart.comments.width,
              height: "200",
              style: { overflow: "visible", "pointer-events": "none" }
            }, [
              p("div", null, [
                g(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: j(c.value[a].middlePoint), flexAlign: j(c.value[a].middlePoint) }
                }, void 0, !0)
              ])
            ], 8, Kl)) : i("", !0)
          ])) : i("", !0)
        ], 10, Ml))), 256)),
        g(l.$slots, "svg", { svg: s.value }, void 0, !0)
      ], 14, Ht)) : i("", !0),
      l.$slots.watermark ? (o(), u("div", Ql, [
        g(l.$slots, "watermark", H(E({ isPrinting: n(Se) || n(Fe) })), void 0, !0)
      ])) : i("", !0),
      q.value ? i("", !0) : (o(), R(Dt, {
        key: 6,
        config: {
          type: "donut",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            donut: {
              color: "#CCCCCC",
              strokeWidth: K.value * 0.8
            }
          }
        }
      }, null, 8, ["config"])),
      p("div", {
        ref_key: "chartLegend",
        ref: fe
      }, [
        e.value.style.chart.legend.show ? (o(), R(It, {
          key: `legend_${we.value}`,
          legendSet: Xe.value,
          config: st.value,
          onClickMarker: r[4] || (r[4] = ({ i: t }) => Ne(t))
        }, We({
          item: x(({ legend: t, index: a }) => [
            p("div", {
              style: z(`opacity:${X.value.includes(a) ? 0.5 : 1}`),
              onClick: (v) => t.segregate()
            }, [
              Ee(C(t.name) + ": " + C(n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t.value,
                n(O)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t.value,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.legend.roundingValue
                }),
                {
                  datapoint: t,
                  index: a
                }
              )) + " ", 1),
              X.value.includes(a) ? (o(), u("span", ta, " ( " + C(vt(t.proportion * 100)) + " % ) ", 1)) : (o(), u("span", ea, " (" + C(isNaN(t.value / S.value) ? "-" : n(A)(
                e.value.style.chart.layout.labels.percentage.formatter,
                De.value(t),
                n(O)({
                  v: De.value(t),
                  s: "%",
                  r: e.value.style.chart.legend.roundingPercentage
                })
              )) + ") ", 1))
            ], 12, Zl)
          ]),
          _: 2
        }, [
          l.$slots.pattern ? {
            name: "legend-pattern",
            fn: x(({ legend: t, index: a }) => [
              he(Rt, {
                shape: t.shape,
                radius: 30,
                stroke: "none",
                plot: { x: 30, y: 30 },
                fill: `url(#pattern_${y.value}_${a})`
              }, null, 8, ["shape", "fill"])
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["legendSet", "config"])) : i("", !0),
        g(l.$slots, "legend", { legend: Xe.value }, void 0, !0)
      ], 512),
      l.$slots.source ? (o(), u("div", {
        key: 7,
        ref_key: "source",
        ref: pe,
        dir: "auto"
      }, [
        g(l.$slots, "source", {}, void 0, !0)
      ], 512)) : i("", !0),
      he(Xt, {
        show: f.value.showTooltip && le.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: J.value,
        content: ue.value,
        isCustom: Q.value,
        isFullscreen: W.value
      }, {
        "tooltip-before": x(() => [
          g(l.$slots, "tooltip-before", H(E({ ...ie.value })), void 0, !0)
        ]),
        "tooltip-after": x(() => [
          g(l.$slots, "tooltip-after", H(E({ ...ie.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom", "isFullscreen"]),
      q.value ? (o(), R(Mt, {
        key: 8,
        hideDetails: "",
        config: {
          open: f.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: x(() => [
          (o(), R(Nt, {
            key: `table_${me.value}`,
            colNames: ae.value.colNames,
            head: ae.value.head,
            body: ae.value.body,
            config: ae.value.config,
            title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
            onClose: r[5] || (r[5] = (t) => f.value.showTable = !1)
          }, {
            th: x(({ th: t }) => [
              p("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, la)
            ]),
            td: x(({ td: t }) => [
              Ee(C(t.name ? t.name : isNaN(Number(t)) ? t.includes("%") ? t : n(A)(
                e.value.style.chart.layout.labels.percentage.formatter,
                t,
                n(O)({
                  v: t,
                  s: "%",
                  r: e.value.style.chart.layout.labels.percentage.rounding
                })
              ) : n(A)(
                e.value.style.chart.layout.labels.value.formatter,
                t,
                n(O)({
                  p: e.value.style.chart.layout.labels.dataLabels.prefix,
                  v: t,
                  s: e.value.style.chart.layout.labels.dataLabels.suffix,
                  r: e.value.style.chart.layout.labels.value.rounding
                })
              )), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : i("", !0)
    ], 46, Wt));
  }
}, ka = /* @__PURE__ */ jt(aa, [["__scopeId", "data-v-f24dec2a"]]);
export {
  ka as default
};
