import { __require as F } from "../utils/numbers.js";
var n, u;
function o() {
  if (u) return n;
  u = 1;
  var s = F().getUint64, a = function(r) {
    var i = new DataView(r.buffer, r.byteOffset, r.byteLength), t = {
      version: r[0],
      flags: new Uint8Array(r.subarray(1, 4)),
      references: [],
      referenceId: i.getUint32(4),
      timescale: i.getUint32(8)
    }, e = 12;
    t.version === 0 ? (t.earliestPresentationTime = i.getUint32(e), t.firstOffset = i.getUint32(e + 4), e += 8) : (t.earliestPresentationTime = s(r.subarray(e)), t.firstOffset = s(r.subarray(e + 8)), e += 16), e += 2;
    var f = i.getUint16(e);
    for (e += 2; f > 0; e += 12, f--)
      t.references.push({
        referenceType: (r[e] & 128) >>> 7,
        referencedSize: i.getUint32(e) & 2147483647,
        subsegmentDuration: i.getUint32(e + 4),
        startsWithSap: !!(r[e + 8] & 128),
        sapType: (r[e + 8] & 112) >>> 4,
        sapDeltaTime: i.getUint32(e + 8) & 268435455
      });
    return t;
  };
  return n = a, n;
}
export {
  o as __require
};
//# sourceMappingURL=parse-sidx.js.map
