import { E as compilerRuntimeExports, j as jsxRuntimeExports, r as reactExports, V as Outlet } from "./vendor-react-DYNCg6N5.js";
import { R as ROUTES, a1 as ActivityIcon, a2 as DriveIcon, a3 as FileIcon, E as ErrorBoundary, L as Layout } from "./index-DfebxkL9.js";
import { S as SidebarMenu, a as SimpleNavbar } from "./index-B7nmdYVM.js";
import { u as useTranslation } from "./vendor-i18n-wisIXUFi.js";
import { u as useStyles } from "./styles-BS0QIA50.js";
import { b as Box, o as Burger } from "./vendor-mantine-h0WlM2Mj.js";
import "./vendor-icons-xWhXK_Ui.js";
const useGetNavMenuItems = () => {
  const $ = compilerRuntimeExports.c(16);
  const {
    t
  } = useTranslation();
  let t0;
  if ($[0] !== t) {
    t0 = t("statistics.activity");
    $[0] = t;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  let t1;
  if ($[2] !== t0) {
    t1 = {
      label: t0,
      icon: ActivityIcon,
      value: ROUTES.statistics.links.activity
    };
    $[2] = t0;
    $[3] = t1;
  } else {
    t1 = $[3];
  }
  let t2;
  if ($[4] !== t) {
    t2 = t("statistics.disk_space");
    $[4] = t;
    $[5] = t2;
  } else {
    t2 = $[5];
  }
  let t3;
  if ($[6] !== t2) {
    t3 = {
      label: t2,
      icon: DriveIcon,
      value: ROUTES.statistics.links.diskSpace
    };
    $[6] = t2;
    $[7] = t3;
  } else {
    t3 = $[7];
  }
  let t4;
  if ($[8] !== t) {
    t4 = t("statistics.audit");
    $[8] = t;
    $[9] = t4;
  } else {
    t4 = $[9];
  }
  let t5;
  if ($[10] !== t4) {
    t5 = {
      label: t4,
      icon: FileIcon,
      value: ROUTES.statistics.links.audit
    };
    $[10] = t4;
    $[11] = t5;
  } else {
    t5 = $[11];
  }
  let t6;
  if ($[12] !== t1 || $[13] !== t3 || $[14] !== t5) {
    const statisticsMenuItems = [t1, t3, t5];
    t6 = {
      statisticsMenuItems
    };
    $[12] = t1;
    $[13] = t3;
    $[14] = t5;
    $[15] = t6;
  } else {
    t6 = $[15];
  }
  return t6;
};
const getStatisticsRoutes = () => {
  const {
    fullPath,
    links
  } = ROUTES.statistics;
  return Object.values(links).map((value) => {
    const path = `${fullPath}/${value ? `${value}` : ""}`;
    return {
      path,
      chunk: value
    };
  });
};
const NavMenu = (t0) => {
  const $ = compilerRuntimeExports.c(9);
  const {
    setIsOpen
  } = t0;
  const {
    t
  } = useTranslation();
  const {
    statisticsMenuItems
  } = useGetNavMenuItems();
  let t1;
  if ($[0] !== t) {
    t1 = t("navigation.statistics");
    $[0] = t;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  let t2;
  if ($[2] !== statisticsMenuItems || $[3] !== t1) {
    t2 = [{
      label: t1,
      pages: statisticsMenuItems
    }];
    $[2] = statisticsMenuItems;
    $[3] = t1;
    $[4] = t2;
  } else {
    t2 = $[4];
  }
  const linksBlocks = t2;
  let t3;
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
    t3 = getStatisticsRoutes();
    $[5] = t3;
  } else {
    t3 = $[5];
  }
  let t4;
  if ($[6] !== linksBlocks || $[7] !== setIsOpen) {
    t4 = /* @__PURE__ */ jsxRuntimeExports.jsx(SidebarMenu, { routes: t3, setIsOpen, linksBlocks });
    $[6] = linksBlocks;
    $[7] = setIsOpen;
    $[8] = t4;
  } else {
    t4 = $[8];
  }
  return t4;
};
const Statistics = (t0) => {
  const $ = compilerRuntimeExports.c(22);
  const {
    children
  } = t0;
  const [isOpen, setIsOpen] = reactExports.useState(false);
  const {
    classes
  } = useStyles();
  let t1;
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
    t1 = {
      flexShrink: 0,
      borderRight: "none"
    };
    $[0] = t1;
  } else {
    t1 = $[0];
  }
  let t2;
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
    t2 = /* @__PURE__ */ jsxRuntimeExports.jsx(NavMenu, { setIsOpen });
    $[1] = t2;
  } else {
    t2 = $[1];
  }
  let t3;
  if ($[2] !== classes.simpleNavbar || $[3] !== isOpen) {
    t3 = /* @__PURE__ */ jsxRuntimeExports.jsx(SimpleNavbar, { "data-cy": "statisticsMenu", widthNav: 290, style: t1, className: classes.simpleNavbar, isOpen, setIsOpen, children: t2 });
    $[2] = classes.simpleNavbar;
    $[3] = isOpen;
    $[4] = t3;
  } else {
    t3 = $[4];
  }
  let t4;
  if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
    t4 = () => setIsOpen(true);
    $[5] = t4;
  } else {
    t4 = $[5];
  }
  let t5;
  if ($[6] !== isOpen) {
    t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(Burger, { opened: isOpen, onClick: t4, size: "sm" });
    $[6] = isOpen;
    $[7] = t5;
  } else {
    t5 = $[7];
  }
  let t6;
  if ($[8] !== classes.headerMenuBurger || $[9] !== t5) {
    t6 = /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: classes.headerMenuBurger, children: t5 });
    $[8] = classes.headerMenuBurger;
    $[9] = t5;
    $[10] = t6;
  } else {
    t6 = $[10];
  }
  let t7;
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
    t7 = /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {});
    $[11] = t7;
  } else {
    t7 = $[11];
  }
  let t8;
  if ($[12] !== classes.headerMenu || $[13] !== t6) {
    t8 = /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: classes.headerMenu, children: [
      t6,
      t7
    ] });
    $[12] = classes.headerMenu;
    $[13] = t6;
    $[14] = t8;
  } else {
    t8 = $[14];
  }
  let t9;
  if ($[15] !== children || $[16] !== classes.section) {
    t9 = /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { className: classes.section, children });
    $[15] = children;
    $[16] = classes.section;
    $[17] = t9;
  } else {
    t9 = $[17];
  }
  let t10;
  if ($[18] !== t3 || $[19] !== t8 || $[20] !== t9) {
    t10 = /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { componentTitle: "Statistics page", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Layout, { leftNavbarContent: t3, children: [
      t8,
      t9
    ] }) });
    $[18] = t3;
    $[19] = t8;
    $[20] = t9;
    $[21] = t10;
  } else {
    t10 = $[21];
  }
  return t10;
};
export {
  Statistics
};
//# sourceMappingURL=index--1rmaIap.js.map
