import { getMarkRange as u } from "@tiptap/react";
function f(t) {
  if (!t.isActive("link"))
    return null;
  const r = t.getAttributes("link").href;
  if (!r)
    return null;
  const { state: n } = t, { selection: l } = n, i = n.schema.marks.link;
  if (!i)
    return null;
  const e = u(l.$from, i);
  if (!e)
    return null;
  const s = n.doc.textBetween(e.from, e.to, "");
  return {
    url: r,
    text: s
  };
}
export {
  f as default
};
//# sourceMappingURL=getActiveLink.js.map
