// src/components/range/utils.ts
var numericSort = (a, b) => a - b;
var arraysDiffer = (a, b) => {
  if (a.length !== b.length) return true;
  const sortedA = a.slice().sort(numericSort);
  const sortedB = b.slice().sort(numericSort);
  for (let i = 0; i < sortedA.length; i += 1) {
    if (sortedA[i] !== sortedB[i]) return true;
  }
  return false;
};
var getNormalizedValueFromClientX = (baseDiv, x) => {
  const bounds = baseDiv.getBoundingClientRect();
  const size = bounds.width;
  if (size <= 0) return 0;
  let nextX = x;
  nextX -= bounds.left;
  if (nextX <= 0) return 0;
  if (nextX >= size) return 1;
  nextX /= size;
  return nextX;
};

export {
  numericSort,
  arraysDiffer,
  getNormalizedValueFromClientX
};
