import { useMemo as a } from "react";
import { useEnvironment as g, useModuleDictionary as b } from "@m4l/core";
import { useAreasStore as n } from "../../../../../../../hooks/useAreas/index.js";
import { shallow as i } from "zustand/shallow";
import { useIsMobile as k } from "@m4l/graphics";
import { getLeftActions as v, getInsideMenuActions as C } from "../../../../../../../../WindowBase/helpers.js";
import { useRightActions as O } from "./useRightActions.js";
const E = ({
  windowId: o,
  areaId: f,
  emergeType: p
}) => {
  const { host_static_assets: A, environment_assets: d } = g(), { getLabel: r } = b(), t = k(), c = `${A}/${d}`, e = n(
    (s) => s.hashWindows[o]?.moduleActions || [],
    i
  ), h = a(() => v(t, e), [!t, e]), m = n(
    (s) => s.hashWindows[o]?.windowOptions,
    i
  ), { saveModuleCookies: u, resetModuleCookies: l } = n(
    (s) => s.windowActions,
    i
  ), w = a(() => C({
    windowId: o,
    isMobile: t,
    moduleActions: e,
    urlPrefix: c,
    saveModuleCookies: u,
    resetModuleCookies: l,
    windowOptions: m || { allowPersistCookies: !1 },
    getLabel: r
  }), [o, t, e, c, u, l, m, r]), M = O({
    windowId: o,
    areaId: f,
    emergeType: p
  });
  return {
    leftActions: h,
    insideActions: w,
    rightActions: M
  };
};
export {
  E as useHeaderActions
};
