var m = Object.defineProperty;
var g = (t, e, r) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
var i = (t, e, r) => g(t, typeof e != "symbol" ? e + "" : e, r);
import { jsx as l } from "react/jsx-runtime";
import { createPluginFactory as p } from "@udecode/plate-core";
import { defaultStyles as u } from "../../../utils/defaultStyles.es.js";
import { merge as c } from "../../../../../utilities/merge.es.js";
import { MarkupElement as d } from "../../MarkupElement.es.js";
import { Plugin as f } from "../../Plugin.es.js";
import { alignmentClassnames as y } from "../../helper.es.js";
import { TextStyles as a } from "../types.es.js";
import { getColumnBreakClasses as h } from "../../ColumnBreakPlugin/utils/getColumnBreakClasses.es.js";
const H = "textstyle-heading4-plugin";
class z extends f {
  constructor({ styles: r = u.heading4, ...n } = {}) {
    super(a.heading4, {
      label: "Heading 4",
      markupElement: new k(),
      ...n
    });
    i(this, "styles", {});
    this.styles = r;
  }
  plugins() {
    return [x(this.styles)];
  }
}
class k extends d {
  constructor(e = H, r = s) {
    super(e, r);
  }
}
const s = ({ element: t, attributes: e, children: r, styles: n }) => {
  const o = t.align;
  return /* @__PURE__ */ l(
    "h4",
    {
      ...e,
      className: c([o && y[o], h(t)]),
      style: n,
      children: r
    }
  );
}, x = (t) => p({
  key: a.heading4,
  isElement: !0,
  component: s,
  deserializeHtml: {
    rules: [{ validNodeName: ["h4", "H4"] }]
  }
})({
  component: (e) => /* @__PURE__ */ l(s, { ...e, styles: t })
});
export {
  z as Heading4Plugin
};
//# sourceMappingURL=heading4Plugin.es.js.map
