import { jsx as t, Fragment as y, jsxs as i } from "react/jsx-runtime";
import w from "react";
import u from "react-dom";
import { AnimatePresence as a, motion as r } from "motion/react";
import s from "../../utils/classNames.js";
import { getOrCreatePortalRoot as N } from "../../utils/portalRoot.js";
const b = -1e3, P = (n) => {
  const { show: e = !1, showClose: l = !0, modalClassName: c, className: m, onClose: d = () => {
  }, children: p } = n, h = s(
    "MobileHeaderModal",
    "position-fixed left-0 right-0 bottom-0",
    "z-index-max",
    m
  ), g = s(
    "display-flex flex-column justify-content-center",
    "margin-15",
    "text-center",
    "rounded",
    "bg-white",
    "shadow-hard",
    "overflow-auto",
    c
  ), f = N(), x = window.innerHeight - 30, o = b - window.innerHeight;
  return /* @__PURE__ */ t(y, { children: u.createPortal(
    /* @__PURE__ */ i(w.Fragment, { children: [
      /* @__PURE__ */ t(a, { children: e && /* @__PURE__ */ i(
        r.div,
        {
          className: h,
          initial: { opacity: 0, top: o },
          animate: { opacity: 1, y: 0, top: 0 },
          exit: { opacity: 0, transition: { duration: 0.3 }, top: o },
          children: [
            /* @__PURE__ */ t("div", { className: g, style: { height: `${x}px` }, children: p }),
            l && /* @__PURE__ */ t(
              "div",
              {
                className: "position-absolute top-15 right-15 margin-top-15 margin-right-15 text-size-20 text-color-dark",
                onClick: d,
                children: /* @__PURE__ */ t("span", { className: "rioglyph rioglyph-remove" })
              }
            )
          ]
        }
      ) }),
      /* @__PURE__ */ t(a, { children: e && /* @__PURE__ */ t(
        r.div,
        {
          className: "bottom-sheet-backdrop",
          initial: { opacity: 0 },
          animate: { opacity: 0.5 },
          exit: { opacity: 0 }
        }
      ) })
    ] }),
    f
  ) });
};
export {
  P as default
};
//# sourceMappingURL=MobileHeaderModal.js.map
