import { __require as requireMaxSafeInteger } from "../../math-intrinsics/constants/maxSafeInteger.js";
import { __require as requireToIntegerOrInfinity } from "./ToIntegerOrInfinity.js";
var ToLength;
var hasRequiredToLength;
function requireToLength() {
  if (hasRequiredToLength) return ToLength;
  hasRequiredToLength = 1;
  var MAX_SAFE_INTEGER = requireMaxSafeInteger();
  var ToIntegerOrInfinity = requireToIntegerOrInfinity();
  ToLength = function ToLength2(argument) {
    var len = ToIntegerOrInfinity(argument);
    if (len <= 0) {
      return 0;
    }
    if (len > MAX_SAFE_INTEGER) {
      return MAX_SAFE_INTEGER;
    }
    return len;
  };
  return ToLength;
}
export {
  requireToLength as __require
};
