function i() {
  const t = window.getSelection();
  if (!t || !t.rangeCount)
    return null;
  const e = t.getRangeAt(0).startContainer, r = e.nodeType === Node.TEXT_NODE ? e.parentElement : e;
  return o(r);
}
function o(t) {
  if (!t) return null;
  if (t.hasAttribute("data-editora-editor"))
    return t;
  let n = t.parentElement;
  for (; n; ) {
    if (n.hasAttribute("data-editora-editor"))
      return n;
    n = n.parentElement;
  }
  return null;
}
function a(t) {
  return t ? t.querySelector(".rte-content") : (console.warn("[Editora] Editor container not found"), null);
}
export {
  i as f,
  a as g
};
