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