import c, { useId as i } from "react";
import { createRoot as m } from "react-dom/client";
import u from "../components/alert-dialog/AlertDialog.js";
function g() {
  const r = i();
  return { alertDialog: (n) => {
    const e = document.createElement("div");
    return e.id = r, document.body.appendChild(e), new Promise((a) => {
      const t = m(e), o = (l) => {
        a(l), setTimeout(() => {
          t.unmount(), e.remove();
        }, 0);
      };
      t.render(
        c.createElement(u, {
          ...n,
          isOpen: !0,
          onAccept: () => o(!0),
          onCancel: () => o(!1)
        })
      );
    });
  } };
}
export {
  g as default
};
//# sourceMappingURL=useAlertDialog.js.map
