import { getMenuItems as p, getKeyItemRecord as f } from "../../ActionMenu/Aria/helper.es.es.js";
import { useListBox as b } from "../../../../../../@react-aria/listbox/dist/module.es.js";
import { merge as w } from "../../../utilities/merge.es.es.js";
import o, { useRef as k } from "react";
import { SelectMenuItem as y } from "./SelectMenuItem.es.es.js";
import { SelectMenuSection as d } from "./SelectMenuSection.es.es.js";
const $ = ({
  menuBlocks: r,
  ariaProps: s,
  state: e,
  ariaLabel: m = "Select Menu",
  scrollable: n = !1
}) => {
  const c = p(r), i = f(c), l = k(null), { listBoxProps: u } = b(
    {
      ...s,
      "aria-label": m
    },
    e,
    l
  );
  return /* @__PURE__ */ o.createElement("ul", {
    ...u,
    ref: l,
    className: w([
      "tw-list-none tw-p-0 tw-m-0 tw-bg-base tw-z-20 focus-visible:tw-outline-none",
      n && "tw-overflow-y-auto"
    ])
  }, [...e.collection].map((t) => /* @__PURE__ */ o.createElement(d, {
    key: t.key,
    ariaLabel: t["aria-label"]
  }, [...t.childNodes].map((a) => /* @__PURE__ */ o.createElement(y, {
    key: a.key,
    state: e,
    node: a,
    menuItem: i[a.key]
  })))));
};
export {
  $ as SelectMenu
};
//# sourceMappingURL=SelectMenu.es.es.js.map
