import { jsxs as f, jsx as o } from "@emotion/react/jsx-runtime";
import { useIsMobile as E } from "@m4l/graphics";
import { useEnvironment as T, useModuleDictionary as h } from "@m4l/core";
import { TEST_PROP_ID as i } from "../../test/constants_no_mock.js";
import { getNameDataTestId as a } from "./tests/utils.js";
import { AppBarRootStyled as B, MenuIconButtonStyled as c, ContentStyled as R } from "./slots/AppBarSlots.js";
import { getComponentSlotRoot as v } from "../../utils/getComponentSlotRoot.js";
import { PATH_IMG_HAMBURGUER as l, APP_BAR_KEY as I } from "./constants.js";
const x = (p) => {
  const { onToggleVisible: m, onToggleAnchored: d, sidebarAnchored: u, children: _, dataTestid: b, size: t } = p, e = E(), { host_static_assets: n, environment_assets: r } = T(), { getLabel: g } = h(), A = v(I), s = g("appbar.tooltip_toogle_menu") || "Open navigation menu", M = {
    isMobile: e,
    size: t
  };
  return /* @__PURE__ */ f(
    B,
    {
      className: A,
      ...process.env.NODE_ENV !== "production" ? { [i]: a(b) } : {},
      children: [
        e ? /* @__PURE__ */ o(
          c,
          {
            size: t,
            tooltip: s,
            "aria-label": s,
            dataTestId: "AppBarMobileMenuButton",
            src: `${n}/${r}/${l}`,
            onClick: m
          }
        ) : /* @__PURE__ */ o(
          c,
          {
            src: `${n}/${r}/${l}`,
            onClick: d,
            rotationAngle: u ? 0 : 180,
            variant: "contained",
            role: "anchored-button"
          }
        ),
        /* @__PURE__ */ o(
          R,
          {
            ownerState: M,
            ...process.env.NODE_ENV !== "production" ? { [i]: a("containerChilds") } : {},
            children: _
          }
        )
      ]
    }
  );
};
export {
  x as AppBar
};
