import { CELL_MANUAL_MIN_WIDTH } from "./consts.js";
const TABLE_VERTICAL_PADDING = 16;
const TABLE_DEFAULTS = {
  cellPadding: [10, 10, 10, 10],
  cellSpacing: 0
};
const getDefaultCellPadding = () => TABLE_DEFAULTS.cellPadding[0];
const normalizePadding = (padding, defaults) => {
  if (!padding || padding.length === 0) {
    return defaults;
  }
  if (padding.length === 1) {
    return [padding[0], padding[0], padding[0], padding[0]];
  }
  if (padding.length === 2) {
    return [padding[0], padding[1], padding[0], padding[1]];
  }
  if (padding.length === 3) {
    return [padding[0], padding[1], padding[2], padding[1]];
  }
  return padding;
};
const getMinColumnWidthForPadding = (cellPadding) => {
  const padding = normalizePadding(cellPadding, [...TABLE_DEFAULTS.cellPadding]);
  const paddingLeft = padding[3] ?? padding[1] ?? padding[0] ?? 10;
  const paddingRight = padding[1] ?? padding[0] ?? 10;
  const horizontalPadding = paddingLeft + paddingRight;
  const defaultHorizontalPadding = TABLE_DEFAULTS.cellPadding[1] + TABLE_DEFAULTS.cellPadding[3];
  return CELL_MANUAL_MIN_WIDTH + (horizontalPadding - defaultHorizontalPadding);
};
export {
  TABLE_DEFAULTS,
  TABLE_VERTICAL_PADDING,
  getDefaultCellPadding,
  getMinColumnWidthForPadding,
  normalizePadding
};
//# sourceMappingURL=defaults.js.map
