"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
require("clsx");
const Box = require("../../../core/Box/Box.cjs");
const ScrollArea_context = require("../ScrollArea.context.cjs");
const useMergedRef = require("../../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-merged-ref/use-merged-ref.cjs");
const ScrollAreaViewport = React.forwardRef(
  ({ children, style, ...others }, ref) => {
    const ctx = ScrollArea_context.useScrollAreaContext();
    const rootRef = useMergedRef.useMergedRef(ref, ctx.onViewportChange);
    return /* @__PURE__ */ jsxRuntime.jsx(
      Box.Box,
      {
        ...others,
        ref: rootRef,
        style: {
          overflowX: ctx.scrollbarXEnabled ? "scroll" : "hidden",
          overflowY: ctx.scrollbarYEnabled ? "scroll" : "hidden",
          ...style
        },
        children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { minWidth: "100%", display: "table" }, ref: ctx.onContentChange, children })
      }
    );
  }
);
ScrollAreaViewport.displayName = "@mantine/core/ScrollAreaViewport";
exports.ScrollAreaViewport = ScrollAreaViewport;
