var m = Object.defineProperty;
var l = (r, t, e) => t in r ? m(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
var i = (r, t, e) => l(r, typeof t != "symbol" ? t + "" : t, e);
import { createPluginFactory as s } from "@udecode/plate-core";
import { createLinkPlugin as a } from "@udecode/plate-link";
import { defaultStyles as u } from "../../utils/defaultStyles.es.js";
import { isValidUrl as p } from "../../utils/isValidUrl.es.js";
import { Plugin as k } from "../Plugin.es.js";
import { CustomFloatingLink as c } from "./FloatingLink/CustomFloatingLink.es.js";
import { LinkButton as f } from "./LinkButton.es.js";
import { LinkMarkupElement as g } from "./LinkMarkupElement/index.es.js";
import { LINK_PLUGIN as n } from "./id.es.js";
const L = s({
  ...a(),
  renderAfterEditable: c,
  options: {
    isUrl: p,
    rangeBeforeOptions: {
      matchString: " ",
      skipInvalid: !0,
      afterMatch: !0
    },
    triggerFloatingLinkHotkeys: "meta+k, ctrl+k",
    keepSelectedTextOnPaste: !0
  }
});
class b extends k {
  constructor({ styles: e = u[n], ...o } = {}) {
    super(n, {
      button: f,
      markupElement: new g(),
      ...o
    });
    i(this, "styles", {});
    this.styles = e;
  }
  plugins() {
    return [L()];
  }
}
export {
  b as LinkPlugin
};
//# sourceMappingURL=index.es.js.map
