import { randomId } from "../../../../../@mantine_hooks@7.17.8_react@18.3.1/node_modules/@mantine/hooks/esm/utils/random-id/random-id.mjs";
import { createUseExternalEvents } from "../../../../../@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/core/utils/create-use-external-events/create-use-external-events.mjs";
const [useModalsEvents, createEvent] = createUseExternalEvents("mantine-modals");
const openModal = (payload) => {
  const id = payload.modalId || randomId();
  createEvent("openModal")({ ...payload, modalId: id });
  return id;
};
const openConfirmModal = (payload) => {
  const id = payload.modalId || randomId();
  createEvent("openConfirmModal")({ ...payload, modalId: id });
  return id;
};
const openContextModal = (payload) => {
  const id = payload.modalId || randomId();
  createEvent("openContextModal")({ ...payload, modalId: id });
  return id;
};
const closeModal = createEvent("closeModal");
const closeAllModals = createEvent("closeAllModals");
export {
  closeAllModals,
  closeModal,
  createEvent,
  openConfirmModal,
  openContextModal,
  openModal,
  useModalsEvents
};
