import { getFakeReferenceElement } from "./../_shared/pos-to-dom-rect.js";
import { AiModalNg, INLINE_AI_MODAL_ID } from "./modal.js";
const openInlineAIModal = ({
  editor,
  modalService,
  positioning = {},
  interceptInlinePrompt,
  generatingLabel
}) => {
  if (modalService.isModalOpen(INLINE_AI_MODAL_ID)) {
    return modalService.getModal(INLINE_AI_MODAL_ID);
  }
  return modalService.openModal({
    id: INLINE_AI_MODAL_ID,
    Component: AiModalNg,
    componentProps: {
      interceptInlinePrompt,
      generatingLabel
    },
    layout: "manual",
    type: "exclusive",
    positioning: {
      referenceElement: getFakeReferenceElement(editor),
      placement: "bottom",
      ...positioning
    },
    returnFocusToEditor: false
  });
};
export {
  openInlineAIModal
};
//# sourceMappingURL=open-inline-ai-modal.js.map
