// packages/block-editor/src/utils/get-editor-region.ts
function getEditorRegion(editor) {
  if (!editor) {
    return null;
  }
  const editorCanvas = Array.from(
    document.querySelectorAll(
      'iframe[name="editor-canvas"]'
    ).values()
  ).find((iframe) => {
    const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
    return iframeDocument === editor.ownerDocument;
  }) ?? editor;
  return editorCanvas?.closest('[role="region"]') ?? editorCanvas;
}
export {
  getEditorRegion as default
};
//# sourceMappingURL=get-editor-region.mjs.map
