import { getAreasDictionary as r, AREAS_DICCTIONARY as c } from "../areas/dictionary.js";
import { ICONS as f } from "../areas/icons.js";
function C(l, s) {
  let i = [];
  return l || (i = i.concat(s.filter((e) => e.visibility === "main"))), i = i.concat(s.filter((e) => e.visibility === "allways")), i.map((e) => ({
    ...e,
    place: "left"
  }));
}
function y(l) {
  const {
    windowId: s,
    isMobile: i,
    moduleActions: e,
    urlPrefix: n,
    saveModuleCookies: d,
    resetModuleCookies: m,
    windowOptions: b = { allowPersistCookies: !1 },
    getLabel: a
  } = l;
  let t = [...e.filter((o) => o.visibility !== "allways")];
  if (i !== void 0 && !i && (t = t.filter((o) => o.visibility === "normal")), b.allowPersistCookies) {
    const o = {
      iconUrl: `${n}/frontend/components/areas/assets/icons/${f.SAVE_COOKIES}`,
      onClick: () => d(s),
      disabled: !1,
      visibility: "normal",
      label: a(r(c.label_persist_module_cookies)),
      key: "save_cookies"
    };
    t.push(o);
    const k = {
      iconUrl: `${n}/frontend/components/areas/assets/icons/${f.RESET_COOKIES}`,
      onClick: () => m(s),
      disabled: !1,
      visibility: "normal",
      label: a(r(c.label_reset_module_cookies)),
      key: "reset_cookes"
    };
    t.push(k);
  }
  return t.map((o) => ({
    ...o,
    place: "inside"
  }));
}
export {
  y as getInsideMenuActions,
  C as getLeftActions
};
