var o = Object.defineProperty;
var n = (r, t, e) => t in r ? o(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
var a = (r, t, e) => (n(r, typeof t != "symbol" ? t + "" : t, e), e);
import i from "../blots/embed.mjs";
class s extends i {
  static create(t) {
    if (window.katex == null)
      throw new Error("Formula module requires KaTeX.");
    const e = super.create(t);
    return typeof t == "string" && (window.katex.render(t, e, {
      throwOnError: !1,
      errorColor: "#f00"
    }), e.setAttribute("data-value", t)), e;
  }
  static value(t) {
    return t.getAttribute("data-value");
  }
  html() {
    const {
      formula: t
    } = this.value();
    return `<span>${t}</span>`;
  }
}
a(s, "blotName", "formula"), a(s, "className", "ql-formula"), a(s, "tagName", "SPAN");
export {
  s as default
};
