if (out[kk] == null && trailingOffset >= offsets[kk]) {
        out[kk] = ii;
        outLength++;
        if (kk === offsets.length - 1) {
          invariant(
            outLength === offsets.length,
            'bad offsets input, should be in increasing order: %s',
            JSON.stringify(offsets),
          );
          return out;
        }
      }
Used to find the indices of the frames that overlap the given offsets. Useful for finding the
items that bound different windows of content, such as the visible area or the buffered overscan
area.