import { jsx as c } from "@emotion/react/jsx-runtime";
import { RootStyled as h } from "./slots/ResizableBoxSlots.js";
import { useResizable as x } from "../hooks/useResizable.js";
import { RESIZING_CLASS_NAME as f } from "../Resizable/constants.js";
function w(i) {
  const {
    children: t,
    width: s = 600,
    height: a = 400,
    maxHeight: e,
    onResize: r,
    onResizeStart: n,
    onResizeStop: l,
    maxWidth: o,
    resizeHandles: R = ["se", "nw"],
    disabled: m = !1,
    ...z
  } = i, { isResizing: S, localHandleResizeStart: d, localHandleResizeStop: p } = x(n, l);
  return /* @__PURE__ */ c(
    h,
    {
      role: "region",
      "aria-label": "Resizable Box",
      width: s,
      height: a,
      onResize: r,
      maxConstraints: e && o ? [o, e] : void 0,
      resizeHandles: R,
      ownerState: { disabled: m },
      onResizeStart: d,
      onResizeStop: p,
      className: S ? f : "",
      ...z,
      children: t
    }
  );
}
export {
  w as ResizableBox
};
