import { computed as b, ref as v, watch as be, onMounted as xe, openBlock as i, createElementBlock as r, normalizeClass as oe, normalizeStyle as se, createBlock as I, createCommentVNode as h, unref as d, createSlots as me, withCtx as g, renderSlot as p, normalizeProps as N, guardReactiveProps as R, createVNode as ie, createElementVNode as n, Fragment as L, renderList as O, toDisplayString as w, createTextVNode as ue, nextTick as we } from "vue";
import { u as _e, c as ke, t as Ce, o as $e, e as Te, v as y, X as Le, s as E, w as re, i as _, f as k, x as Ae, y as Se, q as ze, r as Ie } from "./index-DK7qqHGP.js";
import { t as Oe, u as Fe } from "./useResponsive-NZB-WLRF.js";
import { _ as Me } from "./Title-Cxlu3Etv.js";
import { u as Pe, U as Ne } from "./usePrinter-Cza87yNE.js";
import { _ as Re } from "./Tooltip-Bt9pHzBM.js";
import { D as De } from "./DataTable-B9SSwFM2.js";
import Ge from "./vue-ui-skeleton-CQnYuosp.js";
import Be from "./vue-ui-accordion-5C4CP3gA.js";
import { u as ne } from "./useNestedProp-0nRX_rTi.js";
import { _ as Ee } from "./PackageVersion-I1_4jcn_.js";
import { _ as We } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const Xe = ["id"], Ue = ["xmlns", "viewBox"], Ve = ["id"], Ye = ["stop-color"], je = ["stop-color"], He = ["id"], qe = ["stop-color"], Je = ["stop-color"], Ke = ["x", "y", "width", "height", "fill", "rx"], Qe = ["x", "y", "width", "height", "fill", "rx"], Ze = ["x", "y", "width", "height", "fill", "rx"], et = ["x", "y", "width", "height", "fill", "rx"], tt = { key: 0 }, lt = ["x", "y", "fill", "font-size", "font-weight"], at = ["x", "y", "fill", "font-size", "font-weight"], ot = { key: 1 }, st = ["x", "y", "font-size", "fill", "font-weight"], it = { key: 2 }, ut = { key: 0 }, rt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], nt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], dt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], vt = ["x", "y", "font-size", "fill", "font-weight"], yt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ht = ["x", "y", "font-size", "fill", "font-weight"], ft = ["x", "y", "font-size", "fill", "font-weight"], ct = ["x", "y", "width", "height", "fill", "onMouseover"], gt = {
  key: 3,
  class: "vue-data-ui-watermark"
}, pt = {
  __name: "vue-ui-age-pyramid",
  props: {
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    dataset: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  setup(W, { expose: de }) {
    const f = W, { vue_ui_age_pyramid: ve } = _e(), F = b(() => !!f.dataset && f.dataset.length), x = v(ke()), ye = v(null), D = v(!1), G = v(""), M = v(null), X = v(0), A = v(null), U = v(null), V = v(0), Y = v(0), e = b({
      get: () => j(),
      set: (t) => t
    });
    function j() {
      const t = ne({
        userConfig: f.config,
        defaultConfig: ve
      });
      return t.theme ? {
        ...ne({
          userConfig: Ce.vue_ui_age_pyramid[t.theme] || f.config,
          defaultConfig: t
        })
      } : t;
    }
    be(() => f.config, (t) => {
      e.value = j(), q(), V.value += 1, Y.value += 1;
    }, { deep: !0 });
    const H = v(null);
    xe(() => {
      q();
    });
    function q() {
      if ($e(f.dataset) && Te({
        componentName: "VueUiAgePyramid",
        type: "dataset"
      }), e.value.responsive) {
        const t = Oe(() => {
          const { width: s, height: l } = Fe({
            chart: A.value,
            title: e.value.style.title.text ? U.value : null
          });
          c.value.width = s, c.value.height = l;
        });
        H.value = new ResizeObserver(t), H.value.observe(A.value.parentNode);
      }
    }
    const { isPrinting: J, isImaging: K, generatePdf: Q, generateImage: Z } = Pe({
      elementId: `vue-ui-age-pyramid_${x.value}`,
      fileName: e.value.style.title.text || "vue-ui-age-pyramid"
    }), m = v({
      showTable: e.value.table.show,
      showTooltip: e.value.style.tooltip.show
    }), c = v({
      height: e.value.style.height,
      width: e.value.style.width
    }), o = b(() => {
      const t = c.value.width - e.value.style.layout.padding.right - e.value.style.layout.padding.left, s = e.value.style.layout.padding.left, l = c.value.width - e.value.style.layout.padding.right;
      return {
        top: e.value.style.layout.padding.top,
        left: s,
        right: l,
        bottom: c.value.height - e.value.style.layout.padding.bottom,
        width: t,
        height: c.value.height - e.value.style.layout.padding.top - e.value.style.layout.padding.bottom,
        centerX: e.value.style.layout.padding.left + t / 2,
        leftChart: {
          width: t / 2 - e.value.style.layout.centerSlit.width,
          right: s + t / 2 - e.value.style.layout.centerSlit.width
        },
        rightChart: {
          width: t / 2 - e.value.style.layout.centerSlit.width,
          left: s + t / 2 + e.value.style.layout.centerSlit.width
        }
      };
    }), he = b(() => f.dataset.map((t) => e.value.style.layout.dataLabels.yAxis.display === "age" ? t[1] : t[0])), C = b(() => {
      const t = fe(S.value / 5), s = [], l = [];
      for (let a = 0; a <= 5; a += 1) {
        const u = t * a, ae = t * (a - 5);
        s.push({
          value: u,
          x: o.value.left + o.value.width / 2 + e.value.style.layout.centerSlit.width + u / S.value * o.value.leftChart.width
        }), l.push({
          value: Math.abs(ae),
          x: o.value.left + o.value.width / 2 + ae / S.value * o.value.leftChart.width - e.value.style.layout.centerSlit.width
        });
      }
      return {
        right: s,
        left: l
      };
    });
    function fe(t) {
      if (t === 0) return 0;
      const l = 10 ** Math.floor(Math.log10(Math.abs(t)));
      let a;
      return t < 0, a = Math.round(t / l) * l, a;
    }
    const S = b(() => Math.max(...f.dataset.flatMap((t) => t.slice(-2).map((s) => y(s))))), $ = b(() => f.dataset.length), ce = b(() => f.dataset.map((t) => ({
      segment: t[0],
      age: t[1],
      left: {
        value: t[2],
        proportionToMax: t[2] / S.value
      },
      right: {
        value: t[3],
        proportionToMax: t[3] / S.value
      }
    }))), T = b(() => ce.value.map((t, s) => {
      const l = o.value.top + o.value.height / $.value * s, a = o.value.height / $.value - e.value.style.layout.bars.gap;
      return {
        segment: t.segment,
        age: t.age,
        left: {
          ...t.left,
          y: l,
          color: e.value.style.layout.bars.left.color,
          x: o.value.leftChart.right - t.left.proportionToMax * o.value.leftChart.width,
          width: y(t.left.proportionToMax * o.value.leftChart.width),
          height: a
        },
        right: {
          ...t.right,
          y: l,
          color: e.value.style.layout.bars.right.color,
          x: o.value.rightChart.left,
          width: y(t.right.proportionToMax * o.value.rightChart.width),
          height: a
        }
      };
    })), B = v(null);
    function ge(t, s) {
      M.value = t, B.value = {
        datapoint: s,
        seriesIndex: t,
        series: T.value,
        config: e.value
      };
      const l = e.value.style.tooltip.customFormat;
      if (Ae(l) && Se(() => l({
        seriesIndex: t,
        datapoint: {
          segment: s[0],
          index: s[1],
          left: s[2],
          right: s[3]
        },
        series: T.value,
        config: e.value
      })))
        G.value = l({
          seriesIndex: t,
          datapoint: {
            segment: s[0],
            index: s[1],
            left: s[2],
            right: s[3]
          },
          series: T.value,
          config: e.value
        });
      else {
        let a = "";
        const u = T.value[t];
        a += `<div><b>${u.segment}</b></div>`, a += `<div>${e.value.translations.age}: ${_(
          e.value.style.layout.dataLabels.yAxis.formatter,
          y(u.age),
          k({ v: y(u.age) }),
          { datapoint: s, seriesIndex: t }
        )}</div>`, a += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}">`, a += '<div style="display:flex; flex-direction:row;gap:12px">', a += `<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_left_${x.value})` : e.value.style.layout.bars.left.color}"/></svg><div>${e.value.translations.female}</div><div><b>${_(
          e.value.style.layout.dataLabels.xAxis.formatter,
          y(u.left.value),
          k({ v: y(u.left.value) }),
          { datapoint: s, seriesIndex: t }
        )}</b></div></div>`, a += `<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_right_${x.value})` : e.value.style.layout.bars.right.color}"/></svg><div>${e.value.translations.male}</div><div><b>${_(
          e.value.style.layout.dataLabels.xAxis.formatter,
          y(u.right.value),
          k({ v: y(u.right.value) }),
          { datapoint: s, seriesIndex: t }
        )}</b></div></div>`, a += "</div>", a += `<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${e.value.style.tooltip.borderColor}"><div>${e.value.translations.total}</div><div><b>${_(
          e.value.style.layout.dataLabels.xAxis.formatter,
          y(u.right.value) + y(u.left.value),
          k({ v: y(u.right.value) + y(u.left.value) }),
          { datapoint: s, seriesIndex: t }
        )}</b></div></div>`, a += "</div>", G.value = `<div>${a}</div>`;
      }
      D.value = !0;
    }
    function ee() {
      we(() => {
        const t = [e.value.translations.year, e.value.translations.age, e.value.translations.female, e.value.translations.male, e.value.translations.total], s = f.dataset.map((u) => [
          u[0],
          u[1],
          u[2],
          u[3],
          u[2] + u[3]
        ]), l = [[e.value.style.title.text], [e.value.style.title.subtitle.text], [[""], [""], [""]]].concat([t]).concat(s), a = ze(l);
        Ie({ csvContent: a, title: e.value.style.title.text || "vue-ui-heatmap" });
      });
    }
    const P = b(() => {
      const t = [
        e.value.translations.year,
        e.value.translations.age,
        e.value.translations.female,
        e.value.translations.male,
        e.value.translations.total
      ], s = f.dataset.map((a) => [
        a[0],
        a[1],
        a[2].toLocaleString(),
        a[3].toLocaleString(),
        (a[2] + a[3]).toLocaleString()
      ]), l = {
        th: {
          backgroundColor: e.value.table.th.backgroundColor,
          color: e.value.table.th.color,
          outline: e.value.table.th.outline
        },
        td: {
          backgroundColor: e.value.table.td.backgroundColor,
          color: e.value.table.td.color,
          outline: e.value.table.td.outline
        },
        breakpoint: e.value.table.responsiveBreakpoint
      };
      return { head: t, body: s, config: l, colNames: t };
    }), z = v(!1);
    function pe(t) {
      z.value = t, X.value += 1;
    }
    function te() {
      m.value.showTable = !m.value.showTable;
    }
    function le() {
      m.value.showTooltip = !m.value.showTooltip;
    }
    return de({
      generatePdf: Q,
      generateCsv: ee,
      generateImage: Z,
      toggleTable: te,
      toggleTooltip: le
    }), (t, s) => (i(), r("div", {
      class: oe(`vue-ui-age-pyramid ${z.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
      ref_key: "agePyramid",
      ref: A,
      id: `vue-ui-age-pyramid_${x.value}`,
      style: se(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.title.text ? "" : "padding-top:36px"};background:${e.value.style.backgroundColor};${e.value.responsive ? "height:100%" : ""}`)
    }, [
      e.value.style.title.text ? (i(), r("div", {
        key: 0,
        ref_key: "chartTitle",
        ref: U,
        style: "width:100%;background:transparent"
      }, [
        (i(), I(Me, {
          key: `title_${V.value}`,
          config: {
            title: {
              cy: "pyramid-div-title",
              ...e.value.style.title
            },
            subtitle: {
              cy: "pyramid-div-subtitle",
              ...e.value.style.title.subtitle
            }
          }
        }, null, 8, ["config"]))
      ], 512)) : h("", !0),
      e.value.userOptions.show && F.value ? (i(), I(Ne, {
        ref_key: "details",
        ref: ye,
        key: `user_options_${X.value}`,
        backgroundColor: e.value.style.backgroundColor,
        color: e.value.style.color,
        isImaging: d(K),
        isPrinting: d(J),
        uid: x.value,
        hasTooltip: e.value.userOptions.buttons.tooltip && e.value.style.tooltip.show,
        hasPdf: e.value.userOptions.buttons.pdf,
        hasXls: e.value.userOptions.buttons.csv,
        hasImg: e.value.userOptions.buttons.img,
        hasTable: e.value.userOptions.buttons.table,
        hasFullscreen: e.value.userOptions.buttons.fullscreen,
        isFullscreen: z.value,
        isTooltip: m.value.showTooltip,
        titles: { ...e.value.userOptions.buttonTitles },
        chartElement: A.value,
        position: e.value.userOptions.position,
        onToggleFullscreen: pe,
        onGeneratePdf: d(Q),
        onGenerateCsv: ee,
        onGenerateImage: d(Z),
        onToggleTable: te,
        onToggleTooltip: le
      }, me({ _: 2 }, [
        t.$slots.optionTooltip ? {
          name: "optionTooltip",
          fn: g(() => [
            p(t.$slots, "optionTooltip", {}, void 0, !0)
          ]),
          key: "0"
        } : void 0,
        t.$slots.optionPdf ? {
          name: "optionPdf",
          fn: g(() => [
            p(t.$slots, "optionPdf", {}, void 0, !0)
          ]),
          key: "1"
        } : void 0,
        t.$slots.optionCsv ? {
          name: "optionCsv",
          fn: g(() => [
            p(t.$slots, "optionCsv", {}, void 0, !0)
          ]),
          key: "2"
        } : void 0,
        t.$slots.optionImg ? {
          name: "optionImg",
          fn: g(() => [
            p(t.$slots, "optionImg", {}, void 0, !0)
          ]),
          key: "3"
        } : void 0,
        t.$slots.optionTable ? {
          name: "optionTable",
          fn: g(() => [
            p(t.$slots, "optionTable", {}, void 0, !0)
          ]),
          key: "4"
        } : void 0,
        t.$slots.optionFullscreen ? {
          name: "optionFullscreen",
          fn: g(({ toggleFullscreen: l, isFullscreen: a }) => [
            p(t.$slots, "optionFullscreen", N(R({ toggleFullscreen: l, isFullscreen: a })), void 0, !0)
          ]),
          key: "5"
        } : void 0
      ]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : h("", !0),
      F.value ? (i(), r("svg", {
        key: 2,
        xmlns: d(Le),
        class: oe({ "vue-data-ui-fullscreen--on": z.value, "vue-data-ui-fulscreen--off": !z.value }),
        viewBox: `0 0 ${c.value.width <= 0 ? 10 : c.value.width} ${c.value.height <= 0 ? 10 : c.value.height}`,
        style: se(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.color}`)
      }, [
        ie(Ee),
        n("defs", null, [
          n("linearGradient", {
            id: `age_pyramid_left_${x.value}`,
            x1: "0%",
            y1: "0%",
            x2: "100%",
            y2: "0%"
          }, [
            n("stop", {
              offset: "0%",
              "stop-color": e.value.style.layout.bars.left.color
            }, null, 8, Ye),
            n("stop", {
              offset: "100%",
              "stop-color": d(E)(d(re)(e.value.style.layout.bars.left.color, e.value.style.layout.bars.gradient.shiftHue), 100 - e.value.style.layout.bars.gradient.intensity)
            }, null, 8, je)
          ], 8, Ve),
          n("linearGradient", {
            id: `age_pyramid_right_${x.value}`,
            x1: "0%",
            y1: "0%",
            x2: "100%",
            y2: "0%"
          }, [
            n("stop", {
              offset: "0%",
              "stop-color": d(E)(d(re)(e.value.style.layout.bars.right.color, e.value.style.layout.bars.gradient.shiftHue), 100 - e.value.style.layout.bars.gradient.intensity)
            }, null, 8, qe),
            n("stop", {
              offset: "100%",
              "stop-color": e.value.style.layout.bars.right.color
            }, null, 8, Je)
          ], 8, He)
        ]),
        (i(!0), r(L, null, O(T.value, (l, a) => (i(), r("g", null, [
          n("rect", {
            x: l.left.x,
            y: l.left.y,
            width: d(y)(l.left.width <= 0 ? 1e-4 : l.left.width),
            height: l.left.height <= 0 ? 1e-4 : l.left.height,
            fill: e.value.style.layout.bars.gradient.underlayer,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, Ke),
          n("rect", {
            x: l.left.x,
            y: l.left.y,
            width: l.left.width <= 0 ? 1e-4 : l.left.width,
            height: l.left.height <= 0 ? 1e-4 : l.left.height,
            fill: e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_left_${x.value})` : l.left.color,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, Qe),
          n("rect", {
            x: l.right.x,
            y: l.right.y,
            width: l.right.width <= 0 ? 1e-4 : l.right.width,
            height: l.right.height <= 0 ? 1e-4 : l.right.height,
            fill: e.value.style.layout.bars.gradient.underlayer,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, Ze),
          n("rect", {
            x: l.right.x,
            y: l.right.y,
            width: l.right.width <= 0 ? 1e-4 : l.right.width,
            height: l.right.height <= 0 ? 1e-4 : l.right.height,
            fill: e.value.style.layout.bars.gradient.show ? `url(#age_pyramid_right_${x.value})` : l.right.color,
            rx: e.value.style.layout.bars.borderRadius
          }, null, 8, et)
        ]))), 256)),
        n("g", null, [
          e.value.style.layout.dataLabels.sideTitles.show ? (i(), r("g", tt, [
            n("text", {
              x: o.value.left,
              y: o.value.top + e.value.style.layout.dataLabels.sideTitles.offsetY,
              fill: e.value.style.layout.dataLabels.sideTitles.useSideColor ? e.value.style.layout.bars.left.color : e.value.style.layout.dataLabels.sideTitles.color,
              "font-size": e.value.style.layout.dataLabels.sideTitles.fontSize,
              "text-anchor": "start",
              "font-weight": e.value.style.layout.dataLabels.sideTitles.bold ? "bold" : "normal"
            }, w(e.value.translations.female), 9, lt),
            n("text", {
              x: o.value.right,
              y: o.value.top + e.value.style.layout.dataLabels.sideTitles.offsetY,
              fill: e.value.style.layout.dataLabels.sideTitles.useSideColor ? e.value.style.layout.bars.right.color : e.value.style.layout.dataLabels.sideTitles.color,
              "font-size": e.value.style.layout.dataLabels.sideTitles.fontSize,
              "text-anchor": "end",
              "font-weight": e.value.style.layout.dataLabels.sideTitles.bold ? "bold" : "normal"
            }, w(e.value.translations.male), 9, at)
          ])) : h("", !0),
          e.value.style.layout.dataLabels.yAxis.show ? (i(), r("g", ot, [
            (i(!0), r(L, null, O(he.value, (l, a) => (i(), r(L, null, [
              a % e.value.style.layout.dataLabels.yAxis.showEvery === 0 ? (i(), r("text", {
                key: 0,
                x: o.value.centerX,
                y: o.value.top + o.value.height / $.value * a + e.value.style.layout.dataLabels.yAxis.fontSize / 3,
                "text-anchor": "middle",
                "font-size": e.value.style.layout.dataLabels.yAxis.fontSize,
                fill: e.value.style.layout.dataLabels.yAxis.color,
                "font-weight": e.value.style.layout.dataLabels.yAxis.bold ? "bold" : "normal"
              }, w(d(_)(
                e.value.style.layout.dataLabels.yAxis.formatter,
                l,
                d(k)({ v: l }),
                { datapoint: l, seriesIndex: a }
              )), 9, st)) : h("", !0)
            ], 64))), 256))
          ])) : h("", !0),
          e.value.style.layout.dataLabels.xAxis.show ? (i(), r("g", it, [
            e.value.style.layout.grid.show ? (i(), r("g", ut, [
              n("line", {
                x1: C.value.right[0].x,
                x2: C.value.right.at(-1).x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, rt),
              n("line", {
                x1: C.value.left[0].x,
                x2: C.value.left.at(-1).x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, nt)
            ])) : h("", !0),
            (i(!0), r(L, null, O(C.value.right, (l, a) => (i(), r("g", null, [
              e.value.style.layout.grid.show ? (i(), r("line", {
                key: 0,
                x1: l.x,
                x2: l.x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 4,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, dt)) : h("", !0),
              n("text", {
                x: l.x,
                y: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize * 2,
                "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
                fill: e.value.style.layout.dataLabels.xAxis.color,
                "text-anchor": "middle",
                "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
              }, w(d(_)(
                e.value.style.layout.dataLabels.xAxis.formatter,
                l.value / e.value.style.layout.dataLabels.xAxis.scale,
                d(k)({
                  v: l.value / e.value.style.layout.dataLabels.xAxis.scale
                }),
                { datapoint: l, seriesIndex: a }
              )), 9, vt)
            ]))), 256)),
            (i(!0), r(L, null, O(C.value.left, (l, a) => (i(), r("g", null, [
              e.value.style.layout.grid.show ? (i(), r("line", {
                key: 0,
                x1: l.x,
                x2: l.x,
                y1: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 2,
                y2: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize / 4,
                stroke: e.value.style.layout.grid.stroke,
                "stroke-width": e.value.style.layout.grid.strokeWidth,
                "stroke-linecap": "round"
              }, null, 8, yt)) : h("", !0),
              n("text", {
                x: l.x,
                y: o.value.bottom + e.value.style.layout.dataLabels.xAxis.fontSize * 2,
                "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
                fill: e.value.style.layout.dataLabels.xAxis.color,
                "text-anchor": "middle",
                "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
              }, w(d(_)(
                e.value.style.layout.dataLabels.xAxis.formatter,
                l.value / e.value.style.layout.dataLabels.xAxis.scale,
                d(k)({
                  v: l.value / e.value.style.layout.dataLabels.xAxis.scale
                }),
                { datapoint: l, seriesIndex: a }
              )), 9, ht)
            ]))), 256)),
            n("text", {
              x: o.value.right,
              y: c.value.height,
              "text-anchor": "end",
              "font-size": e.value.style.layout.dataLabels.xAxis.fontSize,
              fill: e.value.style.layout.dataLabels.xAxis.color,
              "font-weight": e.value.style.layout.dataLabels.xAxis.bold ? "bold" : "normal"
            }, w(e.value.style.layout.dataLabels.xAxis.translation), 9, ft)
          ])) : h("", !0)
        ]),
        (i(!0), r(L, null, O(W.dataset, (l, a) => (i(), r("g", null, [
          n("rect", {
            x: o.value.left,
            y: o.value.top + o.value.height / $.value * a - e.value.style.layout.bars.gap / 2,
            width: o.value.width <= 0 ? 1e-4 : o.value.width,
            height: o.value.height / $.value <= 0 ? 1e-4 : o.value.height / $.value,
            fill: M.value !== null && M.value === a ? d(E)(e.value.style.highlighter.color, e.value.style.highlighter.opacity) : "transparent",
            onMouseover: (u) => ge(a, l),
            onMouseleave: s[0] || (s[0] = (u) => {
              M.value = null, D.value = !1;
            })
          }, null, 40, ct)
        ]))), 256)),
        p(t.$slots, "svg", { svg: c.value }, void 0, !0)
      ], 14, Ue)) : h("", !0),
      t.$slots.watermark ? (i(), r("div", gt, [
        p(t.$slots, "watermark", N(R({ isPrinting: d(J) || d(K) })), void 0, !0)
      ])) : h("", !0),
      F.value ? h("", !0) : (i(), I(Ge, {
        key: 4,
        config: {
          type: "pyramid",
          style: {
            backgroundColor: e.value.style.backgroundColor,
            pyramid: {
              color: "#CCCCCC"
            }
          }
        }
      }, null, 8, ["config"])),
      p(t.$slots, "legend", { legend: T.value }, void 0, !0),
      ie(Re, {
        show: m.value.showTooltip && D.value,
        backgroundColor: e.value.style.tooltip.backgroundColor,
        color: e.value.style.tooltip.color,
        borderRadius: e.value.style.tooltip.borderRadius,
        borderColor: e.value.style.tooltip.borderColor,
        borderWidth: e.value.style.tooltip.borderWidth,
        fontSize: e.value.style.tooltip.fontSize,
        backgroundOpacity: e.value.style.tooltip.backgroundOpacity,
        position: e.value.style.tooltip.position,
        offsetY: e.value.style.tooltip.offsetY,
        parent: A.value,
        content: G.value,
        isCustom: e.value.style.tooltip.customFormat && typeof e.value.style.tooltip.customFormat == "function"
      }, {
        "tooltip-before": g(() => [
          p(t.$slots, "tooltip-before", N(R({ ...B.value })), void 0, !0)
        ]),
        "tooltip-after": g(() => [
          p(t.$slots, "tooltip-after", N(R({ ...B.value })), void 0, !0)
        ]),
        _: 3
      }, 8, ["show", "backgroundColor", "color", "borderRadius", "borderColor", "borderWidth", "fontSize", "backgroundOpacity", "position", "offsetY", "parent", "content", "isCustom"]),
      F.value ? (i(), I(Be, {
        key: 5,
        hideDetails: "",
        config: {
          open: m.value.showTable,
          maxHeight: 1e4,
          body: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          },
          head: {
            backgroundColor: e.value.style.backgroundColor,
            color: e.value.style.color
          }
        }
      }, {
        content: g(() => [
          (i(), I(De, {
            key: `table_${Y.value}`,
            colNames: P.value.colNames,
            head: P.value.head,
            body: P.value.body,
            config: P.value.config,
            title: `${e.value.style.title.text}${e.value.style.title.subtitle.text ? ` : ${e.value.style.title.subtitle.text}` : ""}`,
            onClose: s[1] || (s[1] = (l) => m.value.showTable = !1)
          }, {
            th: g(({ th: l }) => [
              ue(w(l), 1)
            ]),
            td: g(({ td: l }) => [
              ue(w(l), 1)
            ]),
            _: 1
          }, 8, ["colNames", "head", "body", "config", "title"]))
        ]),
        _: 1
      }, 8, ["config"])) : h("", !0)
    ], 14, Xe));
  }
}, zt = /* @__PURE__ */ We(pt, [["__scopeId", "data-v-c8be6835"]]);
export {
  zt as default
};
