import { j as r } from "../../../../../_virtual/jsx-runtime.js";
import { a as d } from "../../../../sdk/dist/shared/chunk-7DMUDZ4H.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-UU2MSQXY.js";
import "../../../../sdk/dist/shared/chunk-T3LIA4YB.js";
import "../../../../sdk/dist/shared/chunk-UMHXXXVP.js";
import { useBrickStyle as f } from "../hooks/use-brick-style.js";
import u from "../components/TextContent.js";
import { RxHamburgerMenu as x } from "../../../../../node_modules/.pnpm/react-icons@5.3.0_react@18.3.0-canary-3d9b20132-20240124/node_modules/react-icons/rx/index.js";
import { tx as a } from "../../../../style-system/dist/twind.js";
import g from "../components/BrickRoot.js";
import { useSitemap as h } from "../../../../../use-page-data.js";
import b from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/intersection.js";
function A({ brick: s, editable: o }) {
  const l = f(s), t = s.props, n = h(), m = [...n.filter((e) => b(e.tags, t.linksTagsFilter ?? []).length > 0).map((e) => ({
    urlOrPageId: e.id,
    label: e.label
  })) ?? [], ...t.staticNavItems ?? []].map((e) => ({
    href: n.find((p) => p.id === e.urlOrPageId)?.path ?? e.urlOrPageId,
    label: e.label
  })), c = (e) => {
    o && e.preventDefault();
  };
  return /* @__PURE__ */ r.jsx(
    g,
    {
      brick: s,
      editable: o,
      manifest: d,
      as: "header",
      "data-brick-group": "container",
      "data-no-section-padding": !0,
      className: a("flex px-4 brick basis-full h-[60px]", Object.values(l)),
      children: /* @__PURE__ */ r.jsxs(
        "div",
        {
          className: a(
            "flex flex-1 items-center justify-between @lg:justify-start",
            t.linksPosition !== "center" && "@lg:gap-4"
          ),
          children: [
            /* @__PURE__ */ r.jsxs("div", { className: a("flex items-center gap-3"), "data-brick-group": "brand", "data-brick-menu-offset": "70", children: [
              t.logo?.src && /* @__PURE__ */ r.jsx(
                "img",
                {
                  src: t.logo.src,
                  alt: t.logo.alt ?? "Logo",
                  className: "h-full max-h-[60px] w-auto flex-1"
                }
              ),
              t.brand && !t.hideBrand && /* @__PURE__ */ r.jsx(
                u,
                {
                  as: "h1",
                  propPath: "brand.name",
                  className: a("text-2xl font-bold flex-1"),
                  brickId: s.id,
                  content: t.brand,
                  rawContent: t.brand,
                  editable: o,
                  noTextAlign: !0,
                  noTextType: !0,
                  noTextStrike: !0,
                  inline: !0
                }
              )
            ] }),
            /* @__PURE__ */ r.jsx(
              "nav",
              {
                "data-brick-group": "navigation",
                className: a(
                  "hidden @desktop:flex items-center gap-2",
                  t.linksPosition === "right" && "ml-auto",
                  t.linksPosition === "center" && "mx-auto"
                ),
                children: m.map((e, i) => /* @__PURE__ */ r.jsx(
                  "a",
                  {
                    onClick: c,
                    href: e.href,
                    className: a("font-semibold py-2 px-4 self-stretch rounded-md", "hover:brightness-125"),
                    children: e.label
                  },
                  i
                ))
              }
            ),
            /* @__PURE__ */ r.jsx("div", { role: "menu", className: "ml-auto @desktop:hidden items-center gap-4", "data-brick-group": "actions", children: /* @__PURE__ */ r.jsx(x, { className: "w-6 h-6" }) })
          ]
        }
      )
    }
  );
}
export {
  A as default
};
//# sourceMappingURL=navbar.js.map
