import { useCallback as s } from "react";
import { CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT as c, CHECKABLE_LIST_DEFAULT_GROUP_ROW_HEIGHT as I, CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT_WITH_DESCRIPTION as L } from "../constants.js";
const u = ({
  virtualizedItems: _,
  itemHeights: n,
  defaultItemRowHeight: r,
  defaultGroupRowHeight: o
}) => ({
  getItemSize: s(
    (E) => {
      const T = n.get(E);
      if (T)
        return T;
      const t = _[E];
      if (!t)
        return r ?? c;
      if (t.type === "group")
        return o ?? I;
      const e = t.data;
      if (typeof e.rowHeight == "number")
        return e.rowHeight;
      const i = !!e.description;
      return r ?? (i ? L : c);
    },
    [
      _,
      n,
      r,
      o
    ]
  )
});
export {
  u as useCheckableListVirtualization
};
