"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const rem = require("../../core/utils/units-converters/rem.cjs");
require("react");
require("clsx");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const factory = require("../../core/factory/factory.cjs");
const ModalBaseContent = require("../ModalBase/ModalBaseContent.cjs");
const NativeScrollArea = require("../ModalBase/NativeScrollArea.cjs");
const Modal_context = require("./Modal.context.cjs");
const Modal_module_css = require("./Modal.module.css.cjs");
const defaultProps = {};
const ModalContent = factory.factory((_props, ref) => {
  const props = useProps.useProps("ModalContent", defaultProps, _props);
  const { classNames, className, style, styles, vars, children, __hidden, ...others } = props;
  const ctx = Modal_context.useModalContext();
  const Scroll = ctx.scrollAreaComponent || NativeScrollArea.NativeScrollArea;
  return /* @__PURE__ */ jsxRuntime.jsx(
    ModalBaseContent.ModalBaseContent,
    {
      ...ctx.getStyles("content", { className, style, styles, classNames }),
      innerProps: ctx.getStyles("inner", { className, style, styles, classNames }),
      "data-full-screen": ctx.fullScreen || void 0,
      "data-modal-content": true,
      "data-hidden": __hidden || void 0,
      ref,
      ...others,
      children: /* @__PURE__ */ jsxRuntime.jsx(
        Scroll,
        {
          style: {
            maxHeight: ctx.fullScreen ? "100dvh" : `calc(100dvh - (${rem.rem(ctx.yOffset)} * 2))`
          },
          children
        }
      )
    }
  );
});
ModalContent.classes = Modal_module_css.default;
ModalContent.displayName = "@mantine/core/ModalContent";
exports.ModalContent = ModalContent;
