import { asc } from "./asc.jsx";

/**
 * Returns a new array with `array[index]` replaced by `newValue` and the
 * result sorted ascending. Used by range-slider logic to normalize thumb
 * positions after a single-thumb move — crossing a neighbour reorders the
 * array so thumb-to-index mapping stays stable.
 */
export function replaceArrayItemAtIndex(array, index, newValue) {
  const output = array.slice();
  output[index] = newValue;
  return output.sort(asc);
}
//# sourceMappingURL=replace-array-item-at-index.jsx.map
