import { useSlots as vt, computed as _, ref as d, onMounted as ct, onBeforeUnmount as dt, watch as Ue, createElementBlock as u, openBlock as o, unref as n, normalizeStyle as z, normalizeClass as de, createBlock as R, createCommentVNode as i, renderSlot as b, createElementVNode as p, createVNode as he, createSlots as je, withCtx as $, normalizeProps as K, guardReactiveProps as Q, Fragment as g, renderList as F, mergeProps as We, toDisplayString as C, createTextVNode as He, nextTick as ht } from "vue";
import { u as yt, o as ft, e as Ee, g as pt, c as gt, b as bt, d as qe, p as U, m as mt, H as wt, f as O, X as kt, s as Z, w as _t, j as xt, I as L, i as A, k as ee, n as w, t as $t, a as Ct, q as Pt, r as St, x as Ft } from "./index-CTpA678x.js";
import { t as Lt, u as Tt } from "./useResponsive-BWapHhVH.js";
import { _ as zt } from "./Title-Dp1KpSLT.js";
import { u as Ot, U as Yt } from "./usePrinter-WPNAmU6x.js";
import { D as At } from "./DataTable-fKXm7dWw.js";
import { _ as Nt } from "./Tooltip-DHKMWQdm.js";
import { L as Xt } from "./Legend-DESDMpLk.js";
import It from "./vue-ui-skeleton-CU4p-C4n.js";
import Dt from "./vue-ui-accordion-BSjdTzOb.js";
import { u as Je } from "./useNestedProp-B95uADZw.js";
import { _ as Mt } from "./PackageVersion-DqLLMNcj.js";
import { P as Bt } from "./PenAndPaper-b7rqpk80.js";
import { u as Vt } from "./useUserOptionState-BIvW1Kz7.js";
import { _ as Gt } from "./Shape-CNBTxY72.js";
import { u as Rt } from "./useChartAccessibility-BWojgys7.js";
import { _ as Ut } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const jt = ["id"], Wt = ["xmlns", "viewBox"], Ht = ["width", "height"], Et = { key: 1 }, qt = ["id"], Jt = ["stop-color"], Kt = ["offset", "stop-color"], Qt = ["offset", "stop-color"], Zt = ["stop-color"], el = { key: 2 }, tl = ["id", "cx", "cy"], ll = ["stop-color", "stop-opacity"], al = ["stop-color"], ol = ["id"], ul = ["id"], sl = ["id"], nl = ["flood-color"], rl = ["id"], il = ["flood-color"], vl = ["d", "stroke", "filter"], cl = ["x1", "y1", "x2", "y2", "stroke", "filter"], dl = ["cx", "cy", "r", "fill", "filter"], hl = { key: 6 }, yl = ["stroke", "d"], fl = { key: 0 }, pl = ["d", "fill", "stroke", "stroke-width", "filter"], gl = ["d", "fill", "stroke", "stroke-width", "filter"], bl = { key: 0 }, ml = ["stroke", "d"], wl = { key: 0 }, kl = ["d", "stroke", "stroke-width", "filter"], _l = { key: 1 }, xl = ["d", "fill", "stroke", "stroke-width", "filter"], $l = ["d", "fill", "stroke", "stroke-width", "filter"], Cl = { key: 1 }, Pl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Sl = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Fl = ["cx", "cy", "r", "stroke"], Ll = ["cx", "cy", "r", "fill"], Tl = { key: 0 }, zl = ["d", "fill", "onMouseenter", "onClick"], Ol = { key: 1 }, Yl = ["cx", "cy", "r", "fill"], Al = ["x", "y", "fill", "font-size"], Nl = ["x", "y", "fill", "font-size"], Xl = ["x", "y", "fill", "font-size"], Il = ["x", "y", "fill", "font-size"], Dl = ["filter"], Ml = { key: 0 }, Bl = ["x", "y"], Vl = { key: 1 }, Gl = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Rl = ["cx", "cy", "fill", "stroke", "filter", "onClick"], Ul = ["text-anchor", "x", "y", "fill", "font-size", "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 = { key: 2 }, ql = ["x", "y", "width"], Jl = ["x", "y", "width"], Kl = {
  key: 5,
  class: "vue-data-ui-watermark"
}, Ql = ["onClick"], Zl = {
  key: 0,
  style: { "font-variant-numeric": "tabular-nums" }
}, ea = { key: 1 }, ta = ["innerHTML"], la = {
  __name: "vue-ui-donut",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ["selectLegend", "selectDatapoint"],
  setup(Ke, { expose: Qe, emit: Ze }) {
    const { vue_ui_donut: et } = yt(), tt = vt(), N = Ke, H = _({
      get() {
        return !!N.dataset && N.dataset.length;
      },
      set(l) {
        return l;
      }
    }), E = 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);
    ct(() => {
      ke();
    }), dt(() => {
      te.value && te.value.disconnect();
    });
    function ke() {
      if (ft(N.dataset) ? Ee({
        componentName: "VueUiDonut",
        type: "dataset"
      }) : N.dataset.forEach((l, r) => {
        pt({
          datasetObject: l,
          requiredAttributes: ["name", "values"]
        }).forEach((t) => {
          H.value = !1, Ee({
            componentName: "VueUiDonut",
            type: "datasetSerieAttribute",
            property: t,
            index: r
          });
        });
      }), e.value.responsive) {
        const l = Lt(() => {
          const { width: r, height: t } = Tt({
            chart: E.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
          });
          requestAnimationFrame(() => {
            s.value.width = r, s.value.height = t;
          });
        });
        te.value = new ResizeObserver(l), te.value.observe(E.value.parentNode);
      }
    }
    const y = d(gt()), lt = d(null), le = d(!1), ue = d(""), P = d(null), _e = d(0);
    function xe() {
      const l = Je({
        userConfig: N.config,
        defaultConfig: et
      });
      return l.theme ? {
        ...Je({
          userConfig: Ct.vue_ui_donut[l.theme] || N.config,
          defaultConfig: l
        }),
        customPalette: $t[l.theme] || U
      } : l;
    }
    const e = _({
      get: () => xe(),
      set: (l) => l
    }), { userOptionsVisible: se, setUserOptionsVisibility: $e, keepUserOptionState: Ce } = Vt({ config: e.value }), { svgRef: ne } = Rt({ config: e.value.style.chart.title });
    Ue(() => 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 { isPrinting: Pe, isImaging: Se, generatePdf: Fe, generateImage: Le } = Ot({
      elementId: `donut__${y.value}`,
      fileName: e.value.style.chart.title.text || "vue-ui-donut"
    }), at = _(() => e.value.userOptions.show && !e.value.style.chart.title.text), Te = _(() => bt(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
    }), q = _(() => {
      const l = e.value.style.chart.layout.donut.strokeWidth / 512, r = s.value.width * l, t = r > x.value ? x.value : r;
      return t < 24 ? 24 : t;
    }), ze = Ze, B = _(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: qe(l.color) || Te.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);
    Ue(() => B.value, (l) => T.value = l);
    function ot() {
      return B.value.map((l) => ({
        name: l.name,
        color: l.color,
        value: l.value
      }));
    }
    const X = d([]), Oe = d(null), Ye = d(null), V = d(!1);
    function Ae(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(Oe.value), T.value = T.value.map((k, ce) => l === ce ? {
            ...k,
            value: v
          } : k), V.value = !1) : (V.value = !0, a += v * 0.025, T.value = T.value.map((k, ce) => l === ce ? {
            ...k,
            value: a
          } : k), Oe.value = requestAnimationFrame(m));
        };
        X.value = X.value.filter((k) => k !== l);
        const v = r.value;
        m();
      } else if (X.value.length < B.value.length - 1) {
        let v = function() {
          a < t.value / 100 ? (cancelAnimationFrame(Ye.value), X.value.push(l), T.value = T.value.map((m, k) => l === k ? {
            ...m,
            value: 0
          } : m), V.value = !1) : (V.value = !0, a /= 1.1, T.value = T.value.map((m, k) => l === k ? {
            ...m,
            value: a
          } : m), Ye.value = requestAnimationFrame(v));
        };
        v();
      }
      ze("selectLegend", I.value.map((v) => ({
        name: v.name,
        color: v.color,
        value: v.value
      })));
    }
    const I = _(() => (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)))), Ne = _(() => N.dataset.map((l, r) => ({
      name: l.name,
      color: qe(l.color) || Te.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 && Ae(r),
      isSegregated: X.value.includes(r)
    }))), ut = _(() => ({
      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" : ""
    })), x = _(() => {
      const l = Math.min(s.value.width / 3, s.value.height / 3);
      return l < 55 ? 55 : l;
    }), h = _(() => mt({ series: I.value }, s.value.width / 2, s.value.height / 2, x.value, x.value, 1.99999, 2, 1, 360, 105.25, q.value)), c = _(() => {
      const l = Math.max(...I.value.map((t) => t.value)), r = I.value.map((t) => t.value / l);
      return wt({
        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 st(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 / nt(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 nt(l) {
      return [...l].map((r) => r.value).reduce((r, t) => r + t, 0);
    }
    const S = _(() => I.value.map((l) => l.value).reduce((l, r) => l + r, 0)), Xe = _(() => S.value / I.value.length), Ie = _(() => (l) => V.value ? l.proportion * 100 : l.value / S.value * 100), ie = d(null), J = d(!1);
    function De({ 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 (J.value = !1, Ft(m))
        try {
          const k = m({
            seriesIndex: t,
            datapoint: l,
            series: B.value,
            config: e.value
          });
          typeof k == "string" && (ue.value = k, J.value = !0);
        } catch {
          console.warn("Custom format cannot be applied."), J.value = !1;
        }
      if (!J.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}"/>${tt.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 k = 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>(${k})</span></div>` : v += `<b>${k}</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 = _(() => {
      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 Me() {
      ht(() => {
        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 = Pt(r);
        St({ csvContent: t, title: e.value.style.chart.title.text || "vue-ui-donut" });
      });
    }
    const ae = _(() => {
      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 rt(l) {
      W.value = l, _e.value += 1;
    }
    const Be = _(() => /^((?!chrome|android).)*safari/i.test(navigator.userAgent));
    function it(l) {
      return l.toFixed(e.value.style.chart.legend.roundingPercentage).split("").map((r) => "-").join("");
    }
    function M(l, r) {
      ze("selectDatapoint", { datapoint: l, index: r });
    }
    function Ve() {
      f.value.showTable = !f.value.showTable;
    }
    function Ge() {
      f.value.dataLabels.show = !f.value.dataLabels.show;
    }
    function Re() {
      f.value.showTooltip = !f.value.showTooltip;
    }
    const oe = d(!1);
    function ve() {
      oe.value = !oe.value;
    }
    return Qe({
      getData: ot,
      generatePdf: Fe,
      generateCsv: Me,
      generateImage: Le,
      toggleTable: Ve,
      toggleLabels: Ge,
      toggleTooltip: Re,
      toggleAnnotator: ve
    }), (l, r) => (o(), u("div", {
      ref_key: "donutChart",
      ref: E,
      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(Bt, {
        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),
      b(l.$slots, "userConfig", {}, void 0, !0),
      at.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(zt, {
          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 && H.value && (n(Ce) || n(se)) ? (o(), R(Yt, {
        ref_key: "details",
        ref: lt,
        key: `user_option_${_e.value}`,
        backgroundColor: e.value.style.chart.backgroundColor,
        color: e.value.style.chart.color,
        isPrinting: n(Pe),
        isImaging: n(Se),
        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: E.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: rt,
        onGeneratePdf: n(Fe),
        onGenerateCsv: Me,
        onGenerateImage: n(Le),
        onToggleTable: Ve,
        onToggleLabels: Ge,
        onToggleTooltip: Re,
        onToggleAnnotator: ve,
        style: z({
          visibility: n(Ce) ? n(se) ? "visible" : "hidden" : "visible"
        })
      }, je({ _: 2 }, [
        l.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: $(() => [
            b(l.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        l.$slots.optionPdf ? {
          name: "optionPdf",
          fn: $(() => [
            b(l.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        l.$slots.optionCsv ? {
          name: "optionCsv",
          fn: $(() => [
            b(l.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        l.$slots.optionImg ? {
          name: "optionImg",
          fn: $(() => [
            b(l.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        l.$slots.optionTable ? {
          name: "optionTable",
          fn: $(() => [
            b(l.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        l.$slots.optionLabels ? {
          name: "optionLabels",
          fn: $(() => [
            b(l.$slots, "optionLabels", {}, void 0, !0)
          ]),
          key: "5"
        } : void 0,
        l.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: $(({ toggleFullscreen: t, isFullscreen: a }) => [
            b(l.$slots, "optionFullscreen", K(Q({ toggleFullscreen: t, isFullscreen: a })), void 0, !0)
          ]),
          key: "6"
        } : void 0,
        l.$slots.optionAnnotator ? {
          name: "optionAnnotator",
          fn: $(({ toggleAnnotator: t, isAnnotator: a }) => [
            b(l.$slots, "optionAnnotator", K(Q({ toggleAnnotator: t, isAnnotator: a })), void 0, !0)
          ]),
          key: "7"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasLabel", "hasFullscreen", "isFullscreen", "chartElement", "position", "isTooltip", "titles", "hasAnnotator", "isAnnotation", "onGeneratePdf", "onGenerateImage", "style"])) : i("", !0),
      H.value ? (o(), u("svg", {
        key: 4,
        ref_key: "svgRef",
        ref: ne,
        xmlns: n(kt),
        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}`)
      }, [
        he(Mt),
        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"
          }
        }, [
          b(l.$slots, "chart-background", {}, void 0, !0)
        ], 8, Ht)) : i("", !0),
        e.value.type === "classic" ? (o(), u("defs", Et, [
          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, Jt),
            p("stop", {
              offset: `${(1 - q.value / x.value) * 100}%`,
              "stop-color": n(Z)("#FFFFFF", 0),
              "stop-opacity": "0"
            }, null, 8, Kt),
            p("stop", {
              offset: `${(1 - q.value / x.value / 2) * 100}%`,
              "stop-color": n(Z)("#FFFFFF", e.value.style.chart.gradientIntensity)
            }, null, 8, Qt),
            p("stop", {
              offset: "100%",
              "stop-color": n(Z)(e.value.style.chart.backgroundColor, 0),
              "stop-opacity": "0"
            }, null, 8, Zt)
          ], 8, qt)) : i("", !0)
        ])) : i("", !0),
        e.value.type === "polar" ? (o(), u("defs", el, [
          (o(!0), u(g, 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(_t)(h.value[a].color, 0.05),
              "stop-opacity": e.value.style.chart.gradientIntensity / 100
            }, null, 8, ll),
            p("stop", {
              offset: "100%",
              "stop-color": h.value[a].color
            }, null, 8, al)
          ], 8, tl))), 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, ul),
            r[8] || (r[8] = p("feColorMatrix", {
              type: "saturate",
              values: "0"
            }, null, -1))
          ], 8, ol),
          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, nl)
          ], 8, sl),
          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, il)
          ], 8, rl)
        ]),
        e.value.type === "classic" ? (o(!0), u(g, { key: 3 }, F(h.value, (t, a) => (o(), u("g", null, [
          Y(t) && f.value.dataLabels.show ? (o(), u("path", {
            key: 0,
            d: n(xt)(t, { x: s.value.width / 2, y: s.value.height / 2 }, 16, 16, !1, !1, q.value),
            stroke: t.color,
            "stroke-width": "1",
            "stroke-linecap": "round",
            "stroke-linejoin": "round",
            fill: "none",
            filter: G(a)
          }, null, 8, vl)) : i("", !0)
        ]))), 256)) : i("", !0),
        e.value.type === "polar" ? (o(!0), u(g, { 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, cl)) : 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: x.value <= 0 ? 10 : x.value,
          fill: e.value.style.chart.backgroundColor,
          filter: `url(#shadow_${y.value})`
        }, null, 8, dl)) : i("", !0),
        l.$slots.pattern ? (o(), u("g", hl, [
          (o(!0), u(g, null, F(h.value, (t, a) => (o(), u("defs", null, [
            b(l.$slots, "pattern", We({ ref_for: !0 }, { ...t, patternId: `pattern_${y.value}_${t.patternIndex}` }), void 0, !0)
          ]))), 256))
        ])) : i("", !0),
        S.value && e.value.type === "classic" ? (o(), u(g, { key: 7 }, [
          (o(!0), u(g, null, F(h.value, (t, a) => (o(), u("path", {
            stroke: e.value.style.chart.backgroundColor,
            d: t.arcSlice,
            fill: "#FFFFFF"
          }, null, 8, yl))), 256)),
          l.$slots.pattern ? (o(), u("g", fl, [
            (o(!0), u(g, 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, pl))), 256))
          ])) : i("", !0),
          (o(!0), u(g, 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, gl))), 256))
        ], 64)) : i("", !0),
        S.value && e.value.type === "polar" ? (o(), u(g, { key: 8 }, [
          h.value.length > 1 ? (o(), u("g", bl, [
            (o(!0), u(g, null, F(h.value, (t, a) => (o(), u("path", {
              stroke: e.value.style.chart.backgroundColor,
              d: c.value[a].path,
              fill: "#FFFFFF"
            }, null, 8, ml))), 256)),
            e.value.style.chart.layout.donut.useShadow ? (o(), u("g", wl, [
              (o(!0), u(g, 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, kl))), 256))
            ])) : i("", !0),
            l.$slots.pattern ? (o(), u("g", _l, [
              (o(!0), u(g, 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, xl))), 256))
            ])) : i("", !0),
            (o(!0), u(g, 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, $l))), 256))
          ])) : (o(), u("g", Cl, [
            l.$slots.pattern ? (o(), u("circle", {
              key: 0,
              cx: s.value.width / 2,
              cy: s.value.height / 2,
              r: x.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, Pl)) : i("", !0),
            p("circle", {
              cx: s.value.width / 2,
              cy: s.value.height / 2,
              r: x.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, Sl)
          ]))
        ], 64)) : (o(), u("circle", {
          key: 9,
          cx: s.value.width / 2,
          cy: s.value.height / 2,
          r: x.value <= 0 ? 10 : x.value,
          fill: "transparent",
          stroke: e.value.style.chart.backgroundColor
        }, null, 8, Fl)),
        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 */
            x.value <= 0 ? 10 : x.value
          ),
          fill: `url(#gradient_${y.value})`
        }, null, 8, Ll)) : i("", !0),
        S.value ? (o(), u(g, { key: 11 }, [
          h.value.length > 1 || e.value.type === "classic" ? (o(), u("g", Tl, [
            (o(!0), u(g, 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) => De({
                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, zl))), 256))
          ])) : (o(), u("g", Ol, [
            p("circle", {
              cx: s.value.width / 2,
              cy: s.value.height / 2,
              r: x.value,
              fill: P.value === l.i ? "rgba(0,0,0,0.1)" : "transparent",
              onMouseenter: r[1] || (r[1] = (t) => De({
                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, Yl)
          ]))
        ], 64)) : i("", !0),
        e.value.type === "classic" ? (o(), u(g, { 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, Al)) : 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, Nl)) : 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, Xl)) : 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,
            Xe.value,
            n(O)({
              p: e.value.style.chart.layout.labels.hollow.average.value.prefix,
              v: Xe.value,
              s: e.value.style.chart.layout.labels.hollow.average.value.suffix,
              r: e.value.style.chart.layout.labels.hollow.average.value.rounding
            })
          )), 13, Il)) : i("", !0)
        ], 64)) : i("", !0),
        (o(!0), u(g, 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", Ml, [
            (o(), u("foreignObject", {
              x: n(w)(t, !0).anchor === "end" ? n(w)(t).x - 120 : n(w)(t, !0).anchor === "middle" ? n(w)(t).x - 60 : n(w)(t).x,
              y: n(ee)(t) - (Be.value ? 20 : 0),
              width: "120",
              height: "60",
              style: { overflow: "visible" }
            }, [
              p("div", null, [
                b(l.$slots, "dataLabel", We({ ref_for: !0 }, {
                  datapoint: t,
                  isBlur: !e.value.useBlurOnHover || [null, void 0].includes(P.value) || P.value === a,
                  isSafari: Be.value,
                  isVisible: Y(t) && f.value.dataLabels.show,
                  textAlign: n(w)(t, !0, 16, !0).anchor,
                  flexAlign: n(w)(t, !0, 16).anchor,
                  percentage: re(t, h.value)
                }), void 0, !0)
              ])
            ], 8, Bl))
          ])) : (o(), u("g", Vl, [
            e.value.type === "classic" ? (o(), u(g, { key: 0 }, [
              Y(t) && f.value.dataLabels.show ? (o(), u("circle", {
                key: 0,
                cx: n(w)(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, Gl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), u(g, { 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, Rl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "classic" ? (o(), u(g, { key: 2 }, [
              Y(t) && f.value.dataLabels.show ? (o(), u("text", {
                key: 0,
                "text-anchor": n(w)(t, !0, 12).anchor,
                x: n(w)(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, Ul)) : i("", !0),
              Y(t) && f.value.dataLabels.show ? (o(), u("text", {
                key: 1,
                "text-anchor": n(w)(t).anchor,
                x: n(w)(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, jl)) : i("", !0)
            ], 64)) : i("", !0),
            e.value.type === "polar" ? (o(), u(g, { 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, Wl)) : 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, Hl)) : i("", !0)
            ], 64)) : i("", !0)
          ])),
          f.value.dataLabels.show && e.value.style.chart.comments.show && t.comment ? (o(), u("g", El, [
            Y(t) && e.value.type === "classic" ? (o(), u("foreignObject", {
              key: 0,
              x: e.value.style.chart.comments.offsetX + (n(w)(t, !0).anchor === "end" ? n(w)(t).x - e.value.style.chart.comments.width : n(w)(t, !0).anchor === "middle" ? n(w)(t).x - e.value.style.chart.comments.width / 2 : n(w)(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, [
                b(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: n(w)(t, !0, 16, !0).anchor, flexAlign: n(w)(t, !0, 16).anchor }
                }, void 0, !0)
              ])
            ], 8, ql)) : 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: st(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, [
                b(l.$slots, "plot-comment", {
                  plot: { ...t, textAlign: j(c.value[a].middlePoint), flexAlign: j(c.value[a].middlePoint) }
                }, void 0, !0)
              ])
            ], 8, Jl)) : i("", !0)
          ])) : i("", !0)
        ], 10, Dl))), 256)),
        b(l.$slots, "svg", { svg: s.value }, void 0, !0)
      ], 14, Wt)) : i("", !0),
      l.$slots.watermark ? (o(), u("div", Kl, [
        b(l.$slots, "watermark", K(Q({ isPrinting: n(Pe) || n(Se) })), void 0, !0)
      ])) : i("", !0),
      H.value ? i("", !0) : (o(), R(It, {
        key: 6,
        config: {
          type: "donut",
          style: {
            backgroundColor: e.value.style.chart.backgroundColor,
            donut: {
              color: "#CCCCCC",
              strokeWidth: q.value * 0.8
            }
          }
        }
      }, null, 8, ["config"])),
      p("div", {
        ref_key: "chartLegend",
        ref: fe
      }, [
        e.value.style.chart.legend.show ? (o(), R(Xt, {
          key: `legend_${we.value}`,
          legendSet: Ne.value,
          config: ut.value,
          onClickMarker: r[4] || (r[4] = ({ i: t }) => Ae(t))
        }, je({
          item: $(({ legend: t, index: a }) => [
            p("div", {
              style: z(`opacity:${X.value.includes(a) ? 0.5 : 1}`),
              onClick: (v) => t.segregate()
            }, [
              He(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", ea, " ( " + C(it(t.proportion * 100)) + " % ) ", 1)) : (o(), u("span", Zl, " (" + C(isNaN(t.value / S.value) ? "-" : n(A)(
                e.value.style.chart.layout.labels.percentage.formatter,
                Ie.value(t),
                n(O)({
                  v: Ie.value(t),
                  s: "%",
                  r: e.value.style.chart.legend.roundingPercentage
                })
              )) + ") ", 1))
            ], 12, Ql)
          ]),
          _: 2
        }, [
          l.$slots.pattern ? {
            name: "legend-pattern",
            fn: $(({ legend: t, index: a }) => [
              he(Gt, {
                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),
        b(l.$slots, "legend", { legend: Ne.value }, void 0, !0)
      ], 512),
      l.$slots.source ? (o(), u("div", {
        key: 7,
        ref_key: "source",
        ref: pe,
        dir: "auto"
      }, [
        b(l.$slots, "source", {}, void 0, !0)
      ], 512)) : i("", !0),
      he(Nt, {
        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: E.value,
        content: ue.value,
        isCustom: J.value,
        isFullscreen: W.value
      }, {
        "tooltip-before": $(() => [
          b(l.$slots, "tooltip-before", K(Q({ ...ie.value })), void 0, !0)
        ]),
        "tooltip-after": $(() => [
          b(l.$slots, "tooltip-after", K(Q({ ...ie.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "fontSize", "borderRadius", "borderColor", "borderWidth", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom", "isFullscreen"]),
      H.value ? (o(), R(Dt, {
        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: $(() => [
          (o(), R(At, {
            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: $(({ th: t }) => [
              p("div", {
                innerHTML: t,
                style: { display: "flex", "align-items": "center" }
              }, null, 8, ta)
            ]),
            td: $(({ td: t }) => [
              He(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, jt));
  }
}, wa = /* @__PURE__ */ Ut(la, [["__scopeId", "data-v-068fb79e"]]);
export {
  wa as default
};
