import { toRefs as q, defineAsyncComponent as t, computed as c, ref as o, onMounted as J, watch as B, shallowReactive as Y, openBlock as O, createElementBlock as Z, createElementVNode as R, createVNode as w, createTextVNode as ee, toDisplayString as te, unref as oe, createBlock as ie, resolveDynamicComponent as ae, mergeProps as ne, toHandlers as re, createSlots as le, renderList as se, withCtx as ue, renderSlot as ce, normalizeProps as ge, guardReactiveProps as pe } from "vue";
import me from "./BaseIcon-BNFf4B_v.js";
const de = {
  key: 0,
  style: { width: "100%", display: "flex", gap: "6px", "align-items": "center", color: "#FF0000" }
}, Ve = { style: { width: "36px" } }, ve = {
  __name: "vue-data-ui",
  props: {
    component: { type: String },
    dataset: { type: [Object, Array, Number, String] },
    config: { type: Object }
  },
  emits: [
    "selectLegend",
    "selectDatapoint",
    "toggleOpenState",
    "saveAnnotations",
    "selectRoot",
    "selectBranch",
    "selectNut",
    "change",
    "selectPlot",
    "selectSide",
    "rate",
    "postImage",
    "hoverIndex",
    "selectX",
    "toggleLock",
    "toggleTooltip",
    "start",
    "play",
    "pause",
    "reset",
    "restart",
    "lap"
  ],
  setup(N, { expose: F, emit: G }) {
    const n = N, { component: M, dataset: W, config: X } = q(n), s = {
      VueUi3dBar: t(() => import("./vue-ui-3d-bar-DFd8LLYs.js")),
      VueUiAgePyramid: t(() => import("./vue-ui-age-pyramid-frmKw0vt.js")),
      VueUiAnnotator: t(() => import("./vue-ui-annotator-BWF8Pe0l.js")),
      VueUiCandlestick: t(() => import("./vue-ui-candlestick-C4VhdwJ6.js")),
      VueUiChestnut: t(() => import("./vue-ui-chestnut-J3y-gLdr.js")),
      VueUiDashboard: t(() => import("./vue-ui-dashboard-B9cXpm-f.js")),
      VueUiDigits: t(() => import("./vue-ui-digits-CGRdypIC.js")),
      VueUiDonut: t(() => import("./vue-ui-donut-Wc9_Wp7Z.js")),
      VueUiDonutEvolution: t(() => import("./vue-ui-donut-evolution-BYYu5GGU.js")),
      VueUiGalaxy: t(() => import("./vue-ui-galaxy-CFlBhbpn.js")),
      VueUiGauge: t(() => import("./vue-ui-gauge-DQyUybt9.js")),
      VueUiHeatmap: t(() => import("./vue-ui-heatmap-Dxet06AN.js")),
      VueUiKpi: t(() => import("./vue-ui-kpi-6Ug3wB5-.js")),
      VueUiMiniLoader: t(() => import("./vue-ui-mini-loader-DO8L0uoR.js")),
      VueUiMolecule: t(() => import("./vue-ui-molecule-DUqT-xxF.js")),
      VueUiMoodRadar: t(() => import("./vue-ui-mood-radar-UMlgOP0N.js")),
      VueUiNestedDonuts: t(() => import("./vue-ui-nested-donuts-DFWDYNRb.js")),
      VueUiOnion: t(() => import("./vue-ui-onion-CXscsP8f.js")),
      VueUiQuadrant: t(() => import("./vue-ui-quadrant-CtaVeR8A.js")),
      VueUiRadar: t(() => import("./vue-ui-radar-CYpFzHVj.js")),
      VueUiRating: t(() => import("./vue-ui-rating-Pbbo9WlF.js")),
      VueUiRelationCircle: t(() => import("./vue-ui-relation-circle-DXN96O8B.js")),
      VueUiRings: t(() => import("./vue-ui-rings-RaL8pTXF.js")),
      VueUiScatter: t(() => import("./vue-ui-scatter-C5-IZPAD.js")),
      VueUiScreenshot: t(() => import("./vue-ui-screenshot-xDbAEPnl.js")),
      VueUiSkeleton: t(() => import("./vue-ui-skeleton-ChHLL5Hw.js")),
      VueUiSmiley: t(() => import("./vue-ui-smiley-CMoVMgzF.js")),
      VueUiSparkbar: t(() => import("./vue-ui-sparkbar-DlHNW471.js")),
      VueUiSparkgauge: t(() => import("./vue-ui-sparkgauge-Bv4PqAAa.js")),
      VueUiSparkHistogram: t(() => import("./vue-ui-sparkhistogram-Caz0-A2v.js")),
      VueUiSparkline: t(() => import("./vue-ui-sparkline-BjBx0Xph.js")),
      VueUiSparkStackbar: t(() => import("./vue-ui-sparkstackbar-D0h3xCgn.js")),
      VueUiTable: t(() => import("./vue-ui-table-DbA-NarQ.js")),
      VueUiTableSparkline: t(() => import("./vue-ui-table-sparkline-CSCRSC9Z.js")),
      VueUiThermometer: t(() => import("./vue-ui-thermometer-C4D5DYLq.js")),
      VueUiTiremarks: t(() => import("./vue-ui-tiremarks-2w8HGpJh.js")),
      VueUiTreemap: t(() => import("./vue-ui-treemap-BratMgOF.js")),
      VueUiVerticalBar: t(() => import("./vue-ui-vertical-bar-BWhOc_BN.js")),
      VueUiWaffle: t(() => import("./vue-ui-waffle-CrunUoiX.js")),
      VueUiWheel: t(() => import("./vue-ui-wheel-8pydvFdd.js")),
      VueUiXy: t(() => import("./vue-ui-xy-BZkuRafq.js")),
      VueUiTableHeatmap: t(() => import("./vue-ui-table-heatmap-Bp2AW6SZ.js")),
      VueUiAccordion: t(() => import("./vue-ui-accordion-w15FGKRN.js")),
      VueUiQuickChart: t(() => import("./vue-ui-quick-chart-BkbnCL9J.js")),
      VueUiCursor: t(() => import("./vue-ui-cursor-uZQJBHDI.js")),
      VueUiSparkTrend: t(() => import("./vue-ui-spark-trend-CwTDE8hW.js")),
      VueUiStripPlot: t(() => import("./vue-ui-strip-plot-hssak3_i.js")),
      VueUiDumbbell: t(() => import("./vue-ui-dumbbell-CYMWl8i6.js")),
      VueUiWordCloud: t(() => import("./vue-ui-word-cloud-D5-ouQkK.js")),
      VueUiXyCanvas: t(() => import("./vue-ui-xy-canvas-DcywpKdf.js")),
      VueUiFlow: t(() => import("./vue-ui-flow-B1HsQT8G.js")),
      VueUiParallelCoordinatePlot: t(() => import("./vue-ui-parallel-coordinate-plot-8fsiFsCK.js")),
      VueUiTimer: t(() => import("./vue-ui-timer-B1gf42-7.js")),
      VueUiCarouselTable: t(() => import("./vue-ui-carousel-table-B8w17Va9.js")),
      VueUiGizmo: t(() => import("./vue-ui-gizmo-Dc8Oh1GS.js")),
      VueUiStackbar: t(() => import("./vue-ui-stackbar-D6Twi4kA.js"))
    }, Q = {
      VueUi3dBar: ["config", "dataset"],
      VueUiAgePyramid: ["config", "dataset"],
      VueUiAnnotator: ["config", "dataset"],
      VueUiCandlestick: ["config", "dataset"],
      VueUiChestnut: ["config", "dataset"],
      VueUiDashboard: ["config", "dataset"],
      VueUiDigits: ["config", "dataset"],
      VueUiDonut: ["config", "dataset"],
      VueUiDonutEvolution: ["config", "dataset"],
      VueUiGalaxy: ["config", "dataset"],
      VueUiGauge: ["config", "dataset"],
      VueUiHeatmap: ["config", "dataset"],
      VueUiKpi: ["config", "dataset"],
      VueUiMiniLoader: ["config"],
      VueUiMolecule: ["config", "dataset"],
      VueUiMoodRadar: ["config", "dataset"],
      VueUiNestedDonuts: ["config", "dataset"],
      VueUiOnion: ["config", "dataset"],
      VueUiQuadrant: ["config", "dataset"],
      VueUiRadar: ["config", "dataset"],
      VueUiRating: ["config", "dataset"],
      VueUiRelationCircle: ["config", "dataset"],
      VueUiRings: ["config", "dataset"],
      VueUiScatter: ["config", "dataset"],
      VueUiScreenshot: ["config"],
      VueUiSkeleton: ["config"],
      VueUiSmiley: ["config", "dataset"],
      VueUiSparkbar: ["config", "dataset"],
      VueUiSparkgauge: ["config", "dataset"],
      VueUiSparkHistogram: ["config", "dataset"],
      VueUiSparkline: ["config", "dataset"],
      VueUiSparkStackbar: ["config", "dataset"],
      VueUiTable: ["config", "dataset"],
      VueUiTableSparkline: ["config", "dataset"],
      VueUiThermometer: ["config", "dataset"],
      VueUiTiremarks: ["config", "dataset"],
      VueUiTreemap: ["config", "dataset"],
      VueUiVerticalBar: ["config", "dataset"],
      VueUiWaffle: ["config", "dataset"],
      VueUiWheel: ["config", "dataset"],
      VueUiXy: ["config", "dataset"],
      VueUiTableHeatmap: ["config", "dataset"],
      VueUiAccordion: ["config"],
      VueUiQuickChart: ["config", "dataset"],
      VueUiCursor: ["config"],
      VueUiSparkTrend: ["config", "dataset"],
      VueUiStripPlot: ["config", "dataset"],
      VueUiDumbbell: ["config", "dataset"],
      VueUiWordCloud: ["config", "dataset"],
      VueUiXyCanvas: ["config", "dataset"],
      VueUiFlow: ["config", "dataset"],
      VueUiParallelCoordinatePlot: ["config", "dataset"],
      VueUiTimer: ["config"],
      VueUiCarouselTable: ["config", "dataset"],
      VueUiGizmo: ["config", "dataset"],
      VueUiStackbar: ["config", "dataset"]
    }, g = c(() => !s[n.component]), $ = c(() => s[n.component] || null), i = o(null), j = c(() => {
      const e = Q[n.component] || [], a = {};
      return e.includes("config") && (a.config = X.value), e.includes("dataset") && (a.dataset = W.value), a;
    }), p = o(() => null), m = o(() => null), d = o(() => null), V = o(() => null), U = o(() => null), f = o(() => null), v = o(() => null), h = o(() => null), k = o(() => null), S = o(() => null), b = o(() => null), y = o(() => null), T = o(() => null), C = o(() => null), A = o(() => null), P = o(() => null), D = o(() => null), x = o(() => null), L = o(() => null), _ = o(() => null), I = o(() => null), E = o(() => null), H = o(() => null);
    J(() => {
      if (g.value)
        throw new Error(`

Vue Data UI exception:
The provided component "${n.component}" does not exist. Check the spelling.

Available components:

${Object.keys(s).map((e) => `. ${e}
`).join("")}`);
    }), B(i, async (e) => {
      e && (e.generatePdf && (p.value = e.generatePdf), e.generateImage && (d.value = e.generateImage), e.generateCsv && (m.value = e.generateCsv), e.getItemsPositions && (V.value = e.getItemsPositions), e.toggleReadonly && (U.value = e.toggleReadonly), e.shoot && (f.value = e.shoot), e.close && (v.value = e.close), e.restoreOrder && (h.value = e.restoreOrder), e.recalculateHeight && (k.value = e.recalculateHeight), e.toggleLock && (S.value = e.toggleLock), e.toggleTable && (b.value = e.toggleTable), e.toggleLabels && (y.value = e.toggleLabels), e.toggleSort && (T.value = e.toggleSort), e.toggleStack && (C.value = e.toggleStack), e.toggleTooltip && (A.value = e.toggleTooltip), e.start && (P.value = e.start), e.pause && (D.value = e.pause), e.reset && (x.value = e.reset), e.restart && (L.value = e.restart), e.lap && (_.value = e.lap), e.toggleAnimation && (I.value = e.toggleAnimation), e.pauseAnimation && (E.value = e.pauseAnimation), e.resumeAnimation && (H.value = e.resumeAnimation));
    });
    const z = () => {
      const e = [
        "selectLegend",
        "selectDatapoint",
        "toggleOpenState",
        "saveAnnotations",
        "selectRoot",
        "selectBranch",
        "selectNut",
        "change",
        "selectPlot",
        "selectSide",
        "rate",
        "postImage",
        "hoverIndex",
        "selectX",
        "toggleLock",
        "toggleTooltip",
        "start",
        "pause",
        "reset",
        "restart",
        "lap",
        "toggleAnimation",
        "pauseAnimation",
        "resumeAnimation"
      ], a = {};
      return e.forEach((u) => {
        a[u] = (...l) => G(u, ...l);
      }), a;
    }, r = Y([]);
    return B([r, i], () => {
      if (i.value)
        for (; r.length; ) {
          const [e, ...a] = r.shift();
          typeof i.value[e] == "function" && i.value[e](...a);
        }
    }), F({
      getData: (...e) => i.value && typeof i.value.getData == "function" ? i.value.getData() : r.push(["getData", ...e]),
      generatePdf: p,
      generateCsv: m,
      generateImage: d,
      getItemsPositions: V,
      toggleReadonly: U,
      shoot: f,
      close: v,
      restoreOrder: h,
      recalculateHeight: k,
      toggleLock: S,
      toggleTable: b,
      toggleLabels: y,
      toggleSort: T,
      toggleStack: C,
      toggleTooltip: A,
      start: P,
      pause: D,
      reset: x,
      restart: L,
      lap: _,
      pauseAnimation: E,
      resumeAnimation: H,
      toggleAnimation: I
    }), (e, a) => g.value ? (O(), Z("div", de, [
      R("div", Ve, [
        w(me, {
          name: "moodFlat",
          stroke: "#FF0000"
        })
      ]),
      ee(' The provided component "' + te(oe(M)) + '" does not exist ', 1)
    ])) : (O(), ie(ae($.value), ne({
      key: 1,
      ref_key: "currentComponentRef",
      ref: i
    }, j.value, re(z())), le({ _: 2 }, [
      se(e.$slots, (u, l) => ({
        name: l,
        fn: ue((K) => [
          ce(e.$slots, l, ge(pe(K)))
        ])
      }))
    ]), 1040));
  }
};
export {
  ve as default
};
