import { defineComponent as k, computed as w, resolveComponent as $, createBlock as n, openBlock as t, withCtx as y, createVNode as d, createElementVNode as h, unref as e, normalizeStyle as C, normalizeClass as u, createElementBlock as _, Fragment as b, renderList as B } from "vue";
import { _ as F } from "./FilterSelector.vue_vue_type_script_setup_true_lang-CIh5MO0J.js";
import { _ as L } from "./Default.vue_vue_type_script_setup_true_lang-CNXchelN.js";
import { a as P } from "./BaseDialog.vue_vue_type_script_setup_true_lang-Dmpc24i4.js";
import { storeToRefs as R } from "pinia";
import { _ as S } from "./NoData.vue_vue_type_script_setup_true_lang-BwIUTmvY.js";
import { useBreakpoints as V } from "@feedmepos/ui-library";
import { _ as z } from "./MenuTab.vue_vue_type_script_setup_true_lang-Dr7w9A6f.js";
import { useI18n as D } from "@feedmepos/mf-common";
import { r as E } from "./i18n-CI_sQ5d_.js";
const M = /* @__PURE__ */ k({
  __name: "OverviewView",
  setup(H) {
    const { t: l, te: f } = D(), v = P(), { breakpoints: o } = V(), { isOpenDownloadDialog: x, overviewReport: r } = R(v), s = w(() => {
      var a;
      return ((a = r.value) == null ? void 0 : a.tiles) || [];
    });
    return (a, m) => {
      const g = $("FmPageHead");
      return t(), n(L, null, {
        default: y(() => {
          var i;
          return [
            d(g, {
              title: e(E)(e(l), e(f), (i = e(r)) == null ? void 0 : i.name, "other"),
              class: "h-[68px]",
              actions: [
                {
                  label: e(l)("report.common.download"),
                  value: "download",
                  isPrimary: !0,
                  prependIcon: "download"
                }
              ],
              "onClick:action": m[0] || (m[0] = (p) => x.value = !0)
            }, null, 8, ["title", "actions"]),
            h("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), _(b, null, B(s.value, (p, c) => (t(), n(F, {
                  key: `widget_${e(r).id}_${c}`,
                  "model-value": p,
                  index: c
                }, null, 8, ["model-value", "index"]))), 128))
              ], 2)) : (t(), n(S, { key: 1 }))
            ], 6)
          ];
        }),
        _: 1
      });
    };
  }
});
export {
  M as default
};
