import { round } from "../../../../@floating-ui/utils/dist/floating-ui.utils.js";
import { getComputedStyle, isHTMLElement } from "../../../../@floating-ui/utils/dist/floating-ui.utils.dom.js";
function getCssDimensions(element) {
  const css = getComputedStyle(element);
  let width = parseFloat(css.width) || 0;
  let height = parseFloat(css.height) || 0;
  const hasOffset = isHTMLElement(element);
  const offsetWidth = hasOffset ? element.offsetWidth : width;
  const offsetHeight = hasOffset ? element.offsetHeight : height;
  const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
  if (shouldFallback) {
    width = offsetWidth;
    height = offsetHeight;
  }
  return {
    width,
    height
  };
}
export {
  getCssDimensions
};
//# sourceMappingURL=getCssDimensions.js.map
