import { DEFAULT_ROW_HEIGHT as m, DEFAULT_RESPONSIVE_BREAKPOINTS as I, DEFAULT_CONTAINER_PADDING as y, DEFAULT_MARGIN as D, DEFAULT_RESPONSIVE_COLS as F, DEFAULT_COLAPSED_HEIGHT as E } from "../../constants.js";
import { isEqualLayout as H } from "../../utils.js";
import { getBreakpointFromWidth as S, getColsFromBreakpoint as h, findOrGenerateResponsiveLayout as C, getIndentationValue as u } from "./responsiveUtils.js";
function O(n) {
  const {
    containerWidth: o,
    breakpoint: L,
    breakpoints: a = I,
    containerPadding: g = y,
    containerMargin: d = D,
    layouts: e = {},
    cols: f = F,
    compactType: A = null,
    colapsedHeight: T = E,
    rowHeight: _ = m
  } = n, t = L || S(a, o), i = h(t, f);
  let r = !0;
  const s = c(T, t), l = c(_, t), p = C(
    e,
    a,
    t,
    t,
    i,
    A,
    { [t]: i },
    s,
    l
  );
  return e[t] && H(e[t], p) && (r = !1), {
    breakpointLayout: p,
    breakpoint: t,
    cols: i,
    contaierMargin: u(d, t),
    contaierPadding: u(g, t),
    fireOnLoadLayoutChange: r,
    colapsedHeight: s,
    rowHeight: l
  };
}
const c = (n, o) => typeof n == "number" ? n : n[o] ? n[o] : E;
export {
  O as generateInitialState,
  c as getHeight
};
