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-ZChy8GeS.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-C7dVjCP4.js")),
      VueUiAgePyramid: t(() => import("./vue-ui-age-pyramid-mLYneMWu.js")),
      VueUiAnnotator: t(() => import("./vue-ui-annotator-BB0EN1X8.js")),
      VueUiCandlestick: t(() => import("./vue-ui-candlestick-91SHWtIZ.js")),
      VueUiChestnut: t(() => import("./vue-ui-chestnut-C8-hqYVj.js")),
      VueUiDashboard: t(() => import("./vue-ui-dashboard-XROIeMZs.js")),
      VueUiDigits: t(() => import("./vue-ui-digits-Dao_RHVG.js")),
      VueUiDonut: t(() => import("./vue-ui-donut-D5q_f9RX.js")),
      VueUiDonutEvolution: t(() => import("./vue-ui-donut-evolution-ciU7PKzb.js")),
      VueUiGalaxy: t(() => import("./vue-ui-galaxy-Ts-pIaqK.js")),
      VueUiGauge: t(() => import("./vue-ui-gauge-CokjkUw7.js")),
      VueUiHeatmap: t(() => import("./vue-ui-heatmap-BBVeSW2b.js")),
      VueUiKpi: t(() => import("./vue-ui-kpi-CPMnrH0b.js")),
      VueUiMiniLoader: t(() => import("./vue-ui-mini-loader-Dpn4tXn2.js")),
      VueUiMolecule: t(() => import("./vue-ui-molecule-C98VGiyq.js")),
      VueUiMoodRadar: t(() => import("./vue-ui-mood-radar-CD3cjrDN.js")),
      VueUiNestedDonuts: t(() => import("./vue-ui-nested-donuts-B__WecmQ.js")),
      VueUiOnion: t(() => import("./vue-ui-onion-U8VRuYjQ.js")),
      VueUiQuadrant: t(() => import("./vue-ui-quadrant-DMto8r-E.js")),
      VueUiRadar: t(() => import("./vue-ui-radar-lg4R0yio.js")),
      VueUiRating: t(() => import("./vue-ui-rating-BxV1W8_t.js")),
      VueUiRelationCircle: t(() => import("./vue-ui-relation-circle-BviKM7qW.js")),
      VueUiRings: t(() => import("./vue-ui-rings-Bn-nQaV1.js")),
      VueUiScatter: t(() => import("./vue-ui-scatter-BdTMgLFD.js")),
      VueUiScreenshot: t(() => import("./vue-ui-screenshot-beg_Jx2O.js")),
      VueUiSkeleton: t(() => import("./vue-ui-skeleton-CQnYuosp.js")),
      VueUiSmiley: t(() => import("./vue-ui-smiley-3x3w-9Zh.js")),
      VueUiSparkbar: t(() => import("./vue-ui-sparkbar-45yFHmFN.js")),
      VueUiSparkgauge: t(() => import("./vue-ui-sparkgauge-D-hauinY.js")),
      VueUiSparkHistogram: t(() => import("./vue-ui-sparkhistogram-DaeMxgM8.js")),
      VueUiSparkline: t(() => import("./vue-ui-sparkline-Ddi4Jz8I.js")),
      VueUiSparkStackbar: t(() => import("./vue-ui-sparkstackbar-1_EPRHfC.js")),
      VueUiTable: t(() => import("./vue-ui-table-BTdufdp5.js")),
      VueUiTableSparkline: t(() => import("./vue-ui-table-sparkline-CbhcBl__.js")),
      VueUiThermometer: t(() => import("./vue-ui-thermometer-BTb0KKkD.js")),
      VueUiTiremarks: t(() => import("./vue-ui-tiremarks-C2FsHymJ.js")),
      VueUiTreemap: t(() => import("./vue-ui-treemap-COGNksGL.js")),
      VueUiVerticalBar: t(() => import("./vue-ui-vertical-bar-CSk11lJL.js")),
      VueUiWaffle: t(() => import("./vue-ui-waffle-nhWigJK4.js")),
      VueUiWheel: t(() => import("./vue-ui-wheel-DjPcnznT.js")),
      VueUiXy: t(() => import("./vue-ui-xy-BT3XcRoD.js")),
      VueUiTableHeatmap: t(() => import("./vue-ui-table-heatmap-UKF0bVRc.js")),
      VueUiAccordion: t(() => import("./vue-ui-accordion-5C4CP3gA.js")),
      VueUiQuickChart: t(() => import("./vue-ui-quick-chart-YlkEojCz.js")),
      VueUiCursor: t(() => import("./vue-ui-cursor-fOFRnGWg.js")),
      VueUiSparkTrend: t(() => import("./vue-ui-spark-trend-LsojHGxX.js")),
      VueUiStripPlot: t(() => import("./vue-ui-strip-plot-D_7VbcMM.js")),
      VueUiDumbbell: t(() => import("./vue-ui-dumbbell-nLr7lvcv.js")),
      VueUiWordCloud: t(() => import("./vue-ui-word-cloud-DFGYfQfb.js")),
      VueUiXyCanvas: t(() => import("./vue-ui-xy-canvas-AgaDG8-s.js")),
      VueUiFlow: t(() => import("./vue-ui-flow-B6HJtYfr.js")),
      VueUiParallelCoordinatePlot: t(() => import("./vue-ui-parallel-coordinate-plot-9WvsfJtY.js")),
      VueUiTimer: t(() => import("./vue-ui-timer-DsXON-oQ.js")),
      VueUiCarouselTable: t(() => import("./vue-ui-carousel-table-Dvr8K0wL.js")),
      VueUiGizmo: t(() => import("./vue-ui-gizmo-DcGemMpp.js")),
      VueUiStackbar: t(() => import("./vue-ui-stackbar-0cKpezVg.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
};
