import { randomId } from "../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/utils/random-id/random-id.mjs";
import { createUseExternalEvents } from "../../../../../@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/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
};
