import { defineComponent as g, computed as w, resolveComponent as k, createBlock as a, openBlock as t, withCtx as $, createVNode as d, createElementVNode as y, unref as e, normalizeStyle as C, normalizeClass as u, createElementBlock as _, Fragment as h, renderList as B } from "vue";
import { _ as b } from "./DynamicWidget.vue_vue_type_script_setup_true_lang-CEyrg6sv.js";
import { _ as F } from "./Default.vue_vue_type_script_setup_true_lang-C25HSYeu.js";
import { a as P } from "./v4-C5fRBp_c.js";
import { storeToRefs as R } from "pinia";
import { _ as S } from "./NoData.vue_vue_type_script_setup_true_lang-CdFXBqlX.js";
import { useBreakpoints as V } from "@feedmepos/ui-library";
import { _ as z } from "./MenuTab.vue_vue_type_script_setup_true_lang-C-cKu5vV.js";
import { useI18n as D } from "@feedmepos/mf-common";
const G = /* @__PURE__ */ g({
  __name: "OverviewView",
  setup(E) {
    const { t: l } = D(), f = P(), { breakpoints: o } = V(), { isOpenDownloadDialog: v, overviewReport: r } = R(f), s = w(() => {
      var n;
      return ((n = r.value) == null ? void 0 : n.tiles) || [];
    });
    return (n, i) => {
      const x = k("FmPageHead");
      return t(), a(F, null, {
        default: $(() => {
          var m;
          return [
            d(x, {
              title: e(l)("report.view.overview.title", { name: (m = e(r)) == null ? void 0 : m.name }),
              class: "h-[68px]",
              actions: [
                {
                  label: e(l)("report.common.download"),
                  value: "download",
                  isPrimary: !0,
                  prependIcon: "download"
                }
              ],
              "onClick:action": i[0] || (i[0] = (p) => v.value = !0)
            }, null, 8, ["title", "actions"]),
            y("div", {
              class: u(`flex flex-col gap-2 ${e(o).sm || e(o).xs ? "mb-20" : ""}`),
              style: C({ height: `calc(100% - ${e(o).lg || e(o).md ? 72 : 64}px)` })
            }, [
              d(z),
              s.value.length > 0 && e(r) ? (t(), _("div", {
                key: 0,
                class: u(["grid grid-cols-12", e(o).sm || e(o).xs ? "px-3 gap-[16px]" : "px-24 gap-[24px]"])
              }, [
                (t(!0), _(h, null, B(s.value, (p, c) => (t(), a(b, {
                  key: `widget_${e(r).id}_${c}`,
                  "model-value": p,
                  index: c
                }, null, 8, ["model-value", "index"]))), 128))
              ], 2)) : (t(), a(S, { key: 1 }))
            ], 6)
          ];
        }),
        _: 1
      });
    };
  }
});
export {
  G as default
};
