"use client";
import { jsx as a, jsxs as c } from "react/jsx-runtime";
import { $createHeadingNode as s } from "../../../../../node_modules/@lexical/rich-text/LexicalRichText.prod.js";
import { $setBlocksType as p } from "../../../../../node_modules/@lexical/selection/LexicalSelection.prod.js";
import { $getSelection as f } from "../../../../../node_modules/lexical/Lexical.prod.js";
import { useToolbarContext as l } from "../../../context/toolbar-context.js";
import { blockTypeToBlockName as t } from "./block-format-data.js";
import { SelectItem as d } from "../../../../ui/select.js";
function y({ levels: r = [] }) {
  const { activeEditor: e, blockType: m } = l(), i = (o) => {
    m !== o && e.update(() => {
      const n = f();
      p(n, () => s(o));
    });
  };
  return r.map((o) => /* @__PURE__ */ a(
    d,
    {
      value: o,
      onPointerDown: () => i(o),
      children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1 font-normal", children: [
        t[o].icon,
        t[o].label
      ] })
    },
    o
  ));
}
export {
  y as FormatHeading
};
