import m, { useRef as Z, useState as k, useDebugValue as Y, useEffect as J, forwardRef as ee, useLayoutEffect as te, createContext as Q, useContext as re } from "react";
import ne from "react-dom";
import { Editor as oe } from "../../../../../@tiptap_core@2.23.0_@tiptap_pm@2.23.0/node_modules/@tiptap/core/dist/index.js";
import { CommandManager as Ne, Extension as Ie, InputRule as Me, Mark as Ve, Node as Be, NodePos as je, PasteRule as Pe, callOrReturn as Fe, canInsertNode as Ue, combineTransactionSteps as We, createChainableState as ze, createDocument as Ge, createNodeFromContent as He, createStyleTag as Ke, defaultBlockAt as qe, deleteProps as $e, elementFromString as ke, findChildrenInRange as Ye, findDuplicates as Je, findParentNode as Qe, findParentNodeClosestToPos as Xe, fromString as Ze, getAttributes as et, getAttributesFromExtensions as tt, getChangedRanges as rt, getExtensionField as nt, getHTMLFromFragment as ot, getMarkAttributes as it, getMarkRange as st, getMarkType as ut, getMarksBetween as at, getNodeAttributes as ct, getNodeType as lt, getRenderedAttributes as dt, getSchemaByResolvedExtensions as ft, getSchemaTypeByName as ht, getSchemaTypeNameByName as pt, getSplittedAttributes as vt, getText as St, getTextBetween as mt, getTextContentFromNodes as Et, getTextSerializersFromSchema as _t, injectExtensionAttributesToParseRule as gt, inputRulesPlugin as yt, isActive as Ot, isEmptyObject as bt, isExtensionRulesEnabled as Rt, isFunction as Ct, isList as wt, isMacOS as Tt, isMarkActive as Dt, isNodeActive as xt, isNodeEmpty as At, isNodeSelection as Lt, isNumber as Nt, isPlainObject as It, isRegExp as Mt, isTextSelection as Vt, isiOS as Bt, markInputRule as jt, markPasteRule as Pt, mergeAttributes as Ft, mergeDeep as Ut, minMax as Wt, nodeInputRule as zt, objectIncludes as Gt, pasteRulesPlugin as Ht, removeDuplicates as Kt, resolveFocusPosition as qt, selectionToInsertionEnd as $t, splitExtensions as kt, textblockTypeInputRule as Yt, wrappingInputRule as Jt } from "../../../../../@tiptap_core@2.23.0_@tiptap_pm@2.23.0/node_modules/@tiptap/core/dist/index.js";
function ie(o) {
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
}
var F = { exports: {} }, V = {};
/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var G;
function se() {
  if (G) return V;
  G = 1;
  var o = m;
  function e(u, c) {
    return u === c && (u !== 0 || 1 / u === 1 / c) || u !== u && c !== c;
  }
  var t = typeof Object.is == "function" ? Object.is : e, n = o.useState, r = o.useEffect, i = o.useLayoutEffect, _ = o.useDebugValue;
  function R(u, c) {
    var d = c(), p = n({ inst: { value: d, getSnapshot: c } }), f = p[0].inst, v = p[1];
    return i(function() {
      f.value = d, f.getSnapshot = c, b(f) && v({ inst: f });
    }, [u, d, c]), r(function() {
      return b(f) && v({ inst: f }), u(function() {
        b(f) && v({ inst: f });
      });
    }, [u]), _(d), d;
  }
  function b(u) {
    var c = u.getSnapshot;
    u = u.value;
    try {
      var d = c();
      return !t(u, d);
    } catch {
      return !0;
    }
  }
  function g(u, c) {
    return c();
  }
  var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? g : R;
  return V.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : h, V;
}
var B = {};
/**
 * @license React
 * use-sync-external-store-shim.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var H;
function ue() {
  return H || (H = 1, process.env.NODE_ENV !== "production" && function() {
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
    var o = m, e = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function t(l) {
      {
        for (var s = arguments.length, E = new Array(s > 1 ? s - 1 : 0), a = 1; a < s; a++)
          E[a - 1] = arguments[a];
        n("error", l, E);
      }
    }
    function n(l, s, E) {
      {
        var a = e.ReactDebugCurrentFrame, S = a.getStackAddendum();
        S !== "" && (s += "%s", E = E.concat([S]));
        var O = E.map(function(y) {
          return String(y);
        });
        O.unshift("Warning: " + s), Function.prototype.apply.call(console[l], console, O);
      }
    }
    function r(l, s) {
      return l === s && (l !== 0 || 1 / l === 1 / s) || l !== l && s !== s;
    }
    var i = typeof Object.is == "function" ? Object.is : r, _ = o.useState, R = o.useEffect, b = o.useLayoutEffect, g = o.useDebugValue, h = !1, u = !1;
    function c(l, s, E) {
      h || o.startTransition !== void 0 && (h = !0, t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
      var a = s();
      if (!u) {
        var S = s();
        i(a, S) || (t("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0);
      }
      var O = _({
        inst: {
          value: a,
          getSnapshot: s
        }
      }), y = O[0].inst, T = O[1];
      return b(function() {
        y.value = a, y.getSnapshot = s, d(y) && T({
          inst: y
        });
      }, [l, a, s]), R(function() {
        d(y) && T({
          inst: y
        });
        var A = function() {
          d(y) && T({
            inst: y
          });
        };
        return l(A);
      }, [l]), g(a), a;
    }
    function d(l) {
      var s = l.getSnapshot, E = l.value;
      try {
        var a = s();
        return !i(E, a);
      } catch {
        return !0;
      }
    }
    function p(l, s, E) {
      return s();
    }
    var f = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", v = !f, C = v ? p : c, w = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : C;
    B.useSyncExternalStore = w, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
  }()), B;
}
process.env.NODE_ENV === "production" ? F.exports = se() : F.exports = ue();
var x = F.exports;
const ae = (...o) => (e) => {
  o.forEach((t) => {
    typeof t == "function" ? t(e) : t && (t.current = e);
  });
}, ce = ({ contentComponent: o }) => {
  const e = x.useSyncExternalStore(o.subscribe, o.getSnapshot, o.getServerSnapshot);
  return m.createElement(m.Fragment, null, Object.values(e));
};
function le() {
  const o = /* @__PURE__ */ new Set();
  let e = {};
  return {
    /**
     * Subscribe to the editor instance's changes.
     */
    subscribe(t) {
      return o.add(t), () => {
        o.delete(t);
      };
    },
    getSnapshot() {
      return e;
    },
    getServerSnapshot() {
      return e;
    },
    /**
     * Adds a new NodeView Renderer to the editor.
     */
    setRenderer(t, n) {
      e = {
        ...e,
        [t]: ne.createPortal(n.reactElement, n.element, t)
      }, o.forEach((r) => r());
    },
    /**
     * Removes a NodeView Renderer from the editor.
     */
    removeRenderer(t) {
      const n = { ...e };
      delete n[t], e = n, o.forEach((r) => r());
    }
  };
}
class de extends m.Component {
  constructor(e) {
    var t;
    super(e), this.editorContentRef = m.createRef(), this.initialized = !1, this.state = {
      hasContentComponentInitialized: !!(!((t = e.editor) === null || t === void 0) && t.contentComponent)
    };
  }
  componentDidMount() {
    this.init();
  }
  componentDidUpdate() {
    this.init();
  }
  init() {
    const e = this.props.editor;
    if (e && !e.isDestroyed && e.options.element) {
      if (e.contentComponent)
        return;
      const t = this.editorContentRef.current;
      t.append(...e.options.element.childNodes), e.setOptions({
        element: t
      }), e.contentComponent = le(), this.state.hasContentComponentInitialized || (this.unsubscribeToContentComponent = e.contentComponent.subscribe(() => {
        this.setState((n) => n.hasContentComponentInitialized ? n : {
          hasContentComponentInitialized: !0
        }), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent();
      })), e.createNodeViews(), this.initialized = !0;
    }
  }
  componentWillUnmount() {
    const e = this.props.editor;
    if (!e || (this.initialized = !1, e.isDestroyed || e.view.setProps({
      nodeViews: {}
    }), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent(), e.contentComponent = null, !e.options.element.firstChild))
      return;
    const t = document.createElement("div");
    t.append(...e.options.element.childNodes), e.setOptions({
      element: t
    });
  }
  render() {
    const { editor: e, innerRef: t, ...n } = this.props;
    return m.createElement(
      m.Fragment,
      null,
      m.createElement("div", { ref: ae(t, this.editorContentRef), ...n }),
      (e == null ? void 0 : e.contentComponent) && m.createElement(ce, { contentComponent: e.contentComponent })
    );
  }
}
const fe = ee((o, e) => {
  const t = m.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [o.editor]);
  return m.createElement(de, {
    key: t,
    innerRef: e,
    ...o
  });
}), De = m.memo(fe);
var he = function o(e, t) {
  if (e === t) return !0;
  if (e && t && typeof e == "object" && typeof t == "object") {
    if (e.constructor !== t.constructor) return !1;
    var n, r, i;
    if (Array.isArray(e)) {
      if (n = e.length, n != t.length) return !1;
      for (r = n; r-- !== 0; )
        if (!o(e[r], t[r])) return !1;
      return !0;
    }
    if (e instanceof Map && t instanceof Map) {
      if (e.size !== t.size) return !1;
      for (r of e.entries())
        if (!t.has(r[0])) return !1;
      for (r of e.entries())
        if (!o(r[1], t.get(r[0]))) return !1;
      return !0;
    }
    if (e instanceof Set && t instanceof Set) {
      if (e.size !== t.size) return !1;
      for (r of e.entries())
        if (!t.has(r[0])) return !1;
      return !0;
    }
    if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
      if (n = e.length, n != t.length) return !1;
      for (r = n; r-- !== 0; )
        if (e[r] !== t[r]) return !1;
      return !0;
    }
    if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
    if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
    if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
    if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
    for (r = n; r-- !== 0; )
      if (!Object.prototype.hasOwnProperty.call(t, i[r])) return !1;
    for (r = n; r-- !== 0; ) {
      var _ = i[r];
      if (!(_ === "_owner" && e.$$typeof) && !o(e[_], t[_]))
        return !1;
    }
    return !0;
  }
  return e !== e && t !== t;
}, pe = /* @__PURE__ */ ie(he), U = { exports: {} }, j = {};
/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var K;
function ve() {
  if (K) return j;
  K = 1;
  var o = m, e = x;
  function t(g, h) {
    return g === h && (g !== 0 || 1 / g === 1 / h) || g !== g && h !== h;
  }
  var n = typeof Object.is == "function" ? Object.is : t, r = e.useSyncExternalStore, i = o.useRef, _ = o.useEffect, R = o.useMemo, b = o.useDebugValue;
  return j.useSyncExternalStoreWithSelector = function(g, h, u, c, d) {
    var p = i(null);
    if (p.current === null) {
      var f = { hasValue: !1, value: null };
      p.current = f;
    } else f = p.current;
    p = R(function() {
      function C(a) {
        if (!w) {
          if (w = !0, l = a, a = c(a), d !== void 0 && f.hasValue) {
            var S = f.value;
            if (d(S, a)) return s = S;
          }
          return s = a;
        }
        if (S = s, n(l, a)) return S;
        var O = c(a);
        return d !== void 0 && d(S, O) ? S : (l = a, s = O);
      }
      var w = !1, l, s, E = u === void 0 ? null : u;
      return [function() {
        return C(h());
      }, E === null ? void 0 : function() {
        return C(E());
      }];
    }, [h, u, c, d]);
    var v = r(g, p[0], p[1]);
    return _(function() {
      f.hasValue = !0, f.value = v;
    }, [v]), b(v), v;
  }, j;
}
var P = {};
/**
 * @license React
 * use-sync-external-store-shim/with-selector.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var q;
function Se() {
  return q || (q = 1, process.env.NODE_ENV !== "production" && function() {
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
    var o = m, e = x;
    function t(h, u) {
      return h === u && (h !== 0 || 1 / h === 1 / u) || h !== h && u !== u;
    }
    var n = typeof Object.is == "function" ? Object.is : t, r = e.useSyncExternalStore, i = o.useRef, _ = o.useEffect, R = o.useMemo, b = o.useDebugValue;
    function g(h, u, c, d, p) {
      var f = i(null), v;
      f.current === null ? (v = {
        hasValue: !1,
        value: null
      }, f.current = v) : v = f.current;
      var C = R(function() {
        var E = !1, a, S, O = function(D) {
          if (!E) {
            E = !0, a = D;
            var L = d(D);
            if (p !== void 0 && v.hasValue) {
              var N = v.value;
              if (p(N, L))
                return S = N, N;
            }
            return S = L, L;
          }
          var X = a, I = S;
          if (n(X, D))
            return I;
          var M = d(D);
          return p !== void 0 && p(I, M) ? I : (a = D, S = M, M);
        }, y = c === void 0 ? null : c, T = function() {
          return O(u());
        }, A = y === null ? void 0 : function() {
          return O(y());
        };
        return [T, A];
      }, [u, c, d, p]), w = C[0], l = C[1], s = r(h, w, l);
      return _(function() {
        v.hasValue = !0, v.value = s;
      }, [s]), b(s), s;
    }
    P.useSyncExternalStoreWithSelector = g, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
  }()), P;
}
process.env.NODE_ENV === "production" ? U.exports = ve() : U.exports = Se();
var me = U.exports;
const Ee = typeof window < "u" ? te : J;
class _e {
  constructor(e) {
    this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = { editor: e, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
  }
  /**
   * Get the current editor instance.
   */
  getSnapshot() {
    return this.transactionNumber === this.lastTransactionNumber ? this.lastSnapshot : (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber }, this.lastSnapshot);
  }
  /**
   * Always disable the editor on the server-side.
   */
  getServerSnapshot() {
    return { editor: null, transactionNumber: 0 };
  }
  /**
   * Subscribe to the editor instance's changes.
   */
  subscribe(e) {
    return this.subscribers.add(e), () => {
      this.subscribers.delete(e);
    };
  }
  /**
   * Watch the editor instance for changes.
   */
  watch(e) {
    if (this.editor = e, this.editor) {
      const t = () => {
        this.transactionNumber += 1, this.subscribers.forEach((r) => r());
      }, n = this.editor;
      return n.on("transaction", t), () => {
        n.off("transaction", t);
      };
    }
  }
}
function ge(o) {
  var e;
  const [t] = k(() => new _e(o.editor)), n = me.useSyncExternalStoreWithSelector(t.subscribe, t.getSnapshot, t.getServerSnapshot, o.selector, (e = o.equalityFn) !== null && e !== void 0 ? e : pe);
  return Ee(() => t.watch(o.editor), [o.editor, t]), Y(n), n;
}
const $ = process.env.NODE_ENV !== "production", W = typeof window > "u", ye = W || !!(typeof window < "u" && window.next);
class z {
  constructor(e) {
    this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
  }
  setEditor(e) {
    this.editor = e, this.instanceId = Math.random().toString(36).slice(2, 9), this.subscriptions.forEach((t) => t());
  }
  getInitialEditor() {
    if (this.options.current.immediatelyRender === void 0)
      return W || ye ? ($ && console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."), null) : this.createEditor();
    if (this.options.current.immediatelyRender && W && $)
      throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");
    return this.options.current.immediatelyRender ? this.createEditor() : null;
  }
  /**
   * Create a new editor instance. And attach event listeners.
   */
  createEditor() {
    const e = {
      ...this.options.current,
      // Always call the most recent version of the callback function by default
      onBeforeCreate: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onBeforeCreate) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onBlur: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onBlur) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onCreate: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onCreate) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onDestroy: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onDestroy) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onFocus: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onFocus) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onSelectionUpdate: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onSelectionUpdate) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onTransaction: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onTransaction) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onUpdate: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onUpdate) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onContentError: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onContentError) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onDrop: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onDrop) === null || i === void 0 ? void 0 : i.call(r, ...n);
      },
      onPaste: (...n) => {
        var r, i;
        return (i = (r = this.options.current).onPaste) === null || i === void 0 ? void 0 : i.call(r, ...n);
      }
    };
    return new oe(e);
  }
  /**
   * Get the current editor instance.
   */
  getEditor() {
    return this.editor;
  }
  /**
   * Always disable the editor on the server-side.
   */
  getServerSnapshot() {
    return null;
  }
  /**
   * Subscribe to the editor instance's changes.
   */
  subscribe(e) {
    return this.subscriptions.add(e), () => {
      this.subscriptions.delete(e);
    };
  }
  static compareOptions(e, t) {
    return Object.keys(e).every((n) => ["onCreate", "onBeforeCreate", "onDestroy", "onUpdate", "onTransaction", "onFocus", "onBlur", "onSelectionUpdate", "onContentError", "onDrop", "onPaste"].includes(n) ? !0 : n === "extensions" && e.extensions && t.extensions ? e.extensions.length !== t.extensions.length ? !1 : e.extensions.every((r, i) => {
      var _;
      return r === ((_ = t.extensions) === null || _ === void 0 ? void 0 : _[i]);
    }) : e[n] === t[n]);
  }
  /**
   * On each render, we will create, update, or destroy the editor instance.
   * @param deps The dependencies to watch for changes
   * @returns A cleanup function
   */
  onRender(e) {
    return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && e.length === 0 ? z.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
      ...this.options.current,
      editable: this.editor.isEditable
    }) : this.refreshEditorInstance(e), () => {
      this.isComponentMounted = !1, this.scheduleDestroy();
    });
  }
  /**
   * Recreate the editor instance if the dependencies have changed.
   */
  refreshEditorInstance(e) {
    if (this.editor && !this.editor.isDestroyed) {
      if (this.previousDeps === null) {
        this.previousDeps = e;
        return;
      }
      if (this.previousDeps.length === e.length && this.previousDeps.every((n, r) => n === e[r]))
        return;
    }
    this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = e;
  }
  /**
   * Schedule the destruction of the editor instance.
   * This will only destroy the editor if it was not mounted on the next tick.
   * This is to avoid destroying the editor instance when it's actually still mounted.
   */
  scheduleDestroy() {
    const e = this.instanceId, t = this.editor;
    this.scheduledDestructionTimeout = setTimeout(() => {
      if (this.isComponentMounted && this.instanceId === e) {
        t && t.setOptions(this.options.current);
        return;
      }
      t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
    }, 1);
  }
}
function xe(o = {}, e = []) {
  const t = Z(o);
  t.current = o;
  const [n] = k(() => new z(t)), r = x.useSyncExternalStore(n.subscribe, n.getEditor, n.getServerSnapshot);
  return Y(r), J(n.onRender(e)), ge({
    editor: r,
    selector: ({ transactionNumber: i }) => o.shouldRerenderOnTransaction === !1 ? null : o.immediatelyRender && i === 0 ? 0 : i + 1
  }), r;
}
const Oe = Q({
  editor: null
});
Oe.Consumer;
const be = Q({
  onDragStart: void 0
}), Re = () => re(be);
m.forwardRef((o, e) => {
  const { onDragStart: t } = Re(), n = o.as || "div";
  return (
    // @ts-ignore
    m.createElement(n, { ...o, ref: e, "data-node-view-wrapper": "", onDragStart: t, style: {
      whiteSpace: "normal",
      ...o.style
    } })
  );
});
export {
  Ne as CommandManager,
  oe as Editor,
  De as EditorContent,
  Oe as EditorContext,
  Ie as Extension,
  Me as InputRule,
  Ve as Mark,
  Be as Node,
  je as NodePos,
  Pe as PasteRule,
  de as PureEditorContent,
  be as ReactNodeViewContext,
  Fe as callOrReturn,
  Ue as canInsertNode,
  We as combineTransactionSteps,
  ze as createChainableState,
  Ge as createDocument,
  He as createNodeFromContent,
  Ke as createStyleTag,
  qe as defaultBlockAt,
  $e as deleteProps,
  ke as elementFromString,
  Ye as findChildrenInRange,
  Je as findDuplicates,
  Qe as findParentNode,
  Xe as findParentNodeClosestToPos,
  Ze as fromString,
  et as getAttributes,
  tt as getAttributesFromExtensions,
  rt as getChangedRanges,
  nt as getExtensionField,
  ot as getHTMLFromFragment,
  it as getMarkAttributes,
  st as getMarkRange,
  ut as getMarkType,
  at as getMarksBetween,
  ct as getNodeAttributes,
  lt as getNodeType,
  dt as getRenderedAttributes,
  ft as getSchemaByResolvedExtensions,
  ht as getSchemaTypeByName,
  pt as getSchemaTypeNameByName,
  vt as getSplittedAttributes,
  St as getText,
  mt as getTextBetween,
  Et as getTextContentFromNodes,
  _t as getTextSerializersFromSchema,
  gt as injectExtensionAttributesToParseRule,
  yt as inputRulesPlugin,
  Ot as isActive,
  bt as isEmptyObject,
  Rt as isExtensionRulesEnabled,
  Ct as isFunction,
  wt as isList,
  Tt as isMacOS,
  Dt as isMarkActive,
  xt as isNodeActive,
  At as isNodeEmpty,
  Lt as isNodeSelection,
  Nt as isNumber,
  It as isPlainObject,
  Mt as isRegExp,
  Vt as isTextSelection,
  Bt as isiOS,
  jt as markInputRule,
  Pt as markPasteRule,
  Ft as mergeAttributes,
  Ut as mergeDeep,
  Wt as minMax,
  zt as nodeInputRule,
  Gt as objectIncludes,
  Ht as pasteRulesPlugin,
  Kt as removeDuplicates,
  qt as resolveFocusPosition,
  $t as selectionToInsertionEnd,
  kt as splitExtensions,
  Yt as textblockTypeInputRule,
  xe as useEditor,
  ge as useEditorState,
  Re as useReactNodeView,
  Jt as wrappingInputRule
};
//# sourceMappingURL=index.js.map
