@vindral/web-sdk 4.2.0-20-g831ed815 → 4.2.0-21-g1844a05e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6359,71 +6359,114 @@ function zp() {
6359
6359
  }
6360
6360
  //#endregion
6361
6361
  //#region ../../libs/voq/src/tracks/Cmaf.ts
6362
- var Bp, Vp, Hp, Up, Wp, Gp, Kp = /* @__PURE__ */ new WeakMap(), qp = /* @__PURE__ */ new WeakMap(), Jp = /* @__PURE__ */ new WeakMap(), Yp = /* @__PURE__ */ new WeakMap(), Xp = /* @__PURE__ */ new WeakSet();
6363
- Bp = Symbol.asyncIterator, Vp = Vt(), Hp = Symbol.asyncDispose;
6364
- var Zp = class {
6365
- constructor(t, n, r, i) {
6366
- S(this, Xp), v(this, Kp, void 0), v(this, qp, void 0), v(this, Jp, void 0), e(this, "track", void 0), v(this, Yp, O.get().createContext("CmafGroup")), this.track = i, x(Kp, this, r), x(qp, this, t), x(Jp, this, n);
6362
+ var Bp, Vp, Hp, Up, Wp, Gp, Kp, qp, Jp = /* @__PURE__ */ new WeakMap(), Yp = /* @__PURE__ */ new WeakMap(), Xp = /* @__PURE__ */ new WeakMap(), Zp = /* @__PURE__ */ new WeakMap(), Qp = /* @__PURE__ */ new WeakMap(), $p = /* @__PURE__ */ new WeakMap(), em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakSet();
6363
+ Bp = Ht(), Vp = Symbol.dispose;
6364
+ var rm = class {
6365
+ constructor(e, t) {
6366
+ S(this, nm), v(this, Jp, void 0), v(this, Yp, void 0), v(this, Xp, void 0), v(this, Zp, void 0), v(this, Qp, void 0), v(this, $p, void 0), v(this, em, void 0), v(this, tm, 0), x(Jp, this, e), x(Yp, this, t);
6367
+ }
6368
+ onFragment(e, t, n, r, i) {
6369
+ var a;
6370
+ b(Xp, this) === void 0 && (x(Xp, this, e), x(Zp, this, t), x(Qp, this, n), x($p, this, r), b(Jp, this).info("group start", {
6371
+ name: b(Yp, this).name,
6372
+ groupId: e,
6373
+ startTimeMs: r,
6374
+ endTimeMs: i,
6375
+ subscribeId: t,
6376
+ mediaType: n,
6377
+ namespace: b(Yp, this).namespace
6378
+ })), x(tm, this, (a = b(tm, this), a++, a)), x(em, this, i);
6367
6379
  }
6368
6380
  [Bp]() {
6381
+ y(nm, this, im).call(this);
6382
+ }
6383
+ [Vp]() {
6384
+ y(nm, this, im).call(this);
6385
+ }
6386
+ };
6387
+ function im() {
6388
+ b(Xp, this) !== void 0 && b($p, this) !== void 0 && b(em, this) !== void 0 && b(Jp, this).info("group end", {
6389
+ name: b(Yp, this).name,
6390
+ groupId: b(Xp, this),
6391
+ startTimeMs: b($p, this),
6392
+ endTimeMs: b(em, this),
6393
+ durationMs: b(em, this) - b($p, this),
6394
+ fragmentCount: b(tm, this),
6395
+ subscribeId: b(Zp, this),
6396
+ mediaType: b(Qp, this),
6397
+ namespace: b(Yp, this).namespace
6398
+ });
6399
+ }
6400
+ var am = /* @__PURE__ */ new WeakMap(), om = /* @__PURE__ */ new WeakMap(), sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakMap(), lm = /* @__PURE__ */ new WeakSet();
6401
+ Hp = Symbol.asyncIterator, Up = Vt(), Wp = Symbol.asyncDispose;
6402
+ var um = class {
6403
+ constructor(t, n, r, i) {
6404
+ S(this, lm), v(this, am, void 0), v(this, om, void 0), v(this, sm, void 0), e(this, "track", void 0), v(this, cm, O.get().createContext("CmafGroup")), this.track = i, x(am, this, r), x(om, this, t), x(sm, this, n);
6405
+ }
6406
+ [Hp]() {
6369
6407
  var e = this;
6370
6408
  return Qt(function* () {
6371
- let t = {
6372
- name: e.track.trackObject.name,
6373
- namespace: e.track.namespace
6374
- };
6375
- b(Yp, e).debug("start", C({}, t));
6376
- var n = !1, r = !1, i;
6377
6409
  try {
6378
- for (var a = U(b(qp, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
6379
- let n = o.value;
6380
- {
6381
- if (n.objectStatus === H.EndOfTrackAndGroup && (yield k(e.track.endOfTrack(n.groupId))), n.objectStatus !== H.Normal) continue;
6382
- let r = b(Jp, e).createFragment(n.payload), i = r.timescale(), a = r.baseMediaDecodeTime() / i * 1e3, o = a + r.duration() / i * 1e3, s = b(Kp, e) / 1e3 * i;
6383
- r.updateBaseMediaDecodeTime(r.baseMediaDecodeTime() - s);
6384
- let c = e.track.timestampRange();
6385
- if (c && a >= c[1]) break;
6386
- b(Yp, e).debug("fragment", C(C({}, t), {}, {
6387
- startTime: a,
6388
- endTime: o,
6389
- subscribeId: n.subscribeId,
6390
- groupId: n.groupId,
6391
- objectId: n.objectId,
6392
- streamId: n.streamId
6393
- })), yield [n.groupId, r];
6410
+ var t = td();
6411
+ let s = {
6412
+ name: e.track.trackObject.name,
6413
+ namespace: e.track.namespace
6414
+ }, c = t.u(new rm(b(cm, e), s));
6415
+ var n = !1, r = !1, i;
6416
+ try {
6417
+ for (var a = U(b(om, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
6418
+ let t = o.value;
6419
+ {
6420
+ if (t.objectStatus === H.EndOfTrackAndGroup && (yield k(e.track.endOfTrack(t.groupId))), t.objectStatus !== H.Normal) continue;
6421
+ let n = b(sm, e).createFragment(t.payload), r = n.timescale(), i = n.baseMediaDecodeTime() / r * 1e3, a = i + n.duration() / r * 1e3, o = b(am, e) / 1e3 * r;
6422
+ n.updateBaseMediaDecodeTime(n.baseMediaDecodeTime() - o);
6423
+ let l = e.track.timestampRange();
6424
+ if (l && i >= l[1]) break;
6425
+ b(cm, e).debug("fragment", C(C({}, s), {}, {
6426
+ startTime: i,
6427
+ endTime: a,
6428
+ subscribeId: t.subscribeId,
6429
+ groupId: t.groupId,
6430
+ objectId: t.objectId,
6431
+ streamId: t.streamId
6432
+ })), c.onFragment(t.groupId, t.subscribeId, n.mediaType(), i, a), yield [t.groupId, n];
6433
+ }
6434
+ }
6435
+ } catch (e) {
6436
+ r = !0, i = e;
6437
+ } finally {
6438
+ try {
6439
+ n && a.return != null && (yield k(a.return()));
6440
+ } finally {
6441
+ if (r) throw i;
6394
6442
  }
6395
6443
  }
6396
6444
  } catch (e) {
6397
- r = !0, i = e;
6445
+ t.e = e;
6398
6446
  } finally {
6399
- try {
6400
- n && a.return != null && (yield k(a.return()));
6401
- } finally {
6402
- if (r) throw i;
6403
- }
6447
+ t.d();
6404
6448
  }
6405
- b(Yp, e).debug("end", C({}, t));
6406
6449
  })();
6407
6450
  }
6408
- [Vp]() {
6409
- return y(Xp, this, Qp).call(this);
6451
+ [Up]() {
6452
+ return y(lm, this, dm).call(this);
6410
6453
  }
6411
- [Hp]() {
6412
- return y(Xp, this, Qp).call(this);
6454
+ [Wp]() {
6455
+ return y(lm, this, dm).call(this);
6413
6456
  }
6414
6457
  };
6415
- function Qp() {
6458
+ function dm() {
6416
6459
  var e = this;
6417
6460
  return t(function* () {
6418
6461
  var t, n;
6419
- return yield (t = (n = b(qp, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
6462
+ return yield (t = (n = b(om, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
6420
6463
  })();
6421
6464
  }
6422
- var $p = /* @__PURE__ */ new WeakMap(), em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakMap();
6423
- Up = Symbol.asyncIterator, Wp = Vt(), Gp = Symbol.asyncDispose;
6424
- var rm = class n {
6465
+ var fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap(), mm = /* @__PURE__ */ new WeakMap(), hm = /* @__PURE__ */ new WeakMap();
6466
+ Gp = Symbol.asyncIterator, Kp = Vt(), qp = Symbol.asyncDispose;
6467
+ var gm = class n {
6425
6468
  constructor(t, n, r, i, a) {
6426
- v(this, $p, void 0), v(this, em, void 0), v(this, tm, void 0), v(this, nm, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = n, x(em, this, r), x($p, this, i), x(tm, this, a);
6469
+ v(this, fm, void 0), v(this, pm, void 0), v(this, mm, void 0), v(this, hm, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = n, x(pm, this, r), x(fm, this, i), x(mm, this, a);
6427
6470
  }
6428
6471
  static subscribe(e, r, { timestampOffsetMs: i, startGroup: a, params: o }) {
6429
6472
  return t(function* () {
@@ -6432,7 +6475,7 @@ var rm = class n {
6432
6475
  a && t.startGroup(a);
6433
6476
  let s = t.build();
6434
6477
  if (r.initTrack) {
6435
- let t = new rp().name(r.initTrack).build(), [c, l] = yield Promise.all([im.call(n, e, t), kp.subscribe(e, s, {
6478
+ let t = new rp().name(r.initTrack).build(), [c, l] = yield Promise.all([_m.call(n, e, t), kp.subscribe(e, s, {
6436
6479
  params: o,
6437
6480
  largestGroupId: a ? a - T(1) : void 0
6438
6481
  })]), u = new oa(c);
@@ -6447,59 +6490,59 @@ var rm = class n {
6447
6490
  })();
6448
6491
  }
6449
6492
  largestGroupId() {
6450
- return b(em, this).largestGroupId();
6493
+ return b(pm, this).largestGroupId();
6451
6494
  }
6452
6495
  stopAfterTimestampReached(e) {
6453
- x(nm, this, [0, e]);
6496
+ x(hm, this, [0, e]);
6454
6497
  }
6455
6498
  timestampRange() {
6456
- return b(nm, this);
6499
+ return b(hm, this);
6457
6500
  }
6458
6501
  endOfTrack(e) {
6459
- return b(em, this).endOfTrack(e);
6502
+ return b(pm, this).endOfTrack(e);
6460
6503
  }
6461
6504
  update(e, t) {
6462
- return b(em, this).update(e, t);
6505
+ return b(pm, this).update(e, t);
6463
6506
  }
6464
6507
  unsubscribe() {
6465
6508
  var e = this;
6466
6509
  return t(function* () {
6467
- return b(em, e).unsubscribe();
6510
+ return b(pm, e).unsubscribe();
6468
6511
  })();
6469
6512
  }
6470
6513
  next() {
6471
6514
  var e = this;
6472
6515
  return t(function* () {
6473
- let t = yield b(em, e).next();
6516
+ let t = yield b(pm, e).next();
6474
6517
  return t.done ? t : {
6475
6518
  done: !1,
6476
- value: new Zp(t.value, b($p, e), b(tm, e), e)
6519
+ value: new um(t.value, b(fm, e), b(mm, e), e)
6477
6520
  };
6478
6521
  })();
6479
6522
  }
6480
6523
  return() {
6481
6524
  var e = this;
6482
6525
  return t(function* () {
6483
- return yield b(em, e).return(), {
6526
+ return yield b(pm, e).return(), {
6484
6527
  done: !0,
6485
6528
  value: void 0
6486
6529
  };
6487
6530
  })();
6488
6531
  }
6489
- [Up]() {
6532
+ [Gp]() {
6490
6533
  return this;
6491
6534
  }
6492
- [Wp]() {
6535
+ [Kp]() {
6493
6536
  return this.unsubscribe();
6494
6537
  }
6495
- [Gp]() {
6538
+ [qp]() {
6496
6539
  var e = this;
6497
6540
  return t(function* () {
6498
6541
  return e.unsubscribe();
6499
6542
  })();
6500
6543
  }
6501
6544
  };
6502
- function im(e, n) {
6545
+ function _m(e, n) {
6503
6546
  return t(function* () {
6504
6547
  try {
6505
6548
  var t = td();
@@ -6515,21 +6558,21 @@ function im(e, n) {
6515
6558
  }
6516
6559
  //#endregion
6517
6560
  //#region ../../libs/voq/src/tracks/Timeline.ts
6518
- var am = 1e4, om = 3e4, sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakMap(), lm = /* @__PURE__ */ new WeakMap(), um = /* @__PURE__ */ new WeakMap(), dm = /* @__PURE__ */ new WeakMap(), fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakSet(), mm = class e {
6561
+ var vm = 1e4, ym = 3e4, bm = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakMap(), Sm = /* @__PURE__ */ new WeakMap(), Cm = /* @__PURE__ */ new WeakMap(), wm = /* @__PURE__ */ new WeakMap(), Tm = /* @__PURE__ */ new WeakMap(), Em = /* @__PURE__ */ new WeakSet(), Dm = class e {
6519
6562
  constructor(e, t, n) {
6520
- S(this, pm), v(this, sm, O.get().createContext("Timeline")), v(this, cm, new A([])), v(this, lm, void 0), v(this, um, void 0), v(this, dm, void 0), v(this, fm, void 0), x(um, this, e), x(dm, this, n), x(lm, this, t), x(fm, this, y(pm, this, hm).call(this, b(lm, this))), this.closed().finally(() => b(cm, this).close()).catch(o);
6563
+ S(this, Em), v(this, bm, O.get().createContext("Timeline")), v(this, xm, new A([])), v(this, Sm, void 0), v(this, Cm, void 0), v(this, wm, void 0), v(this, Tm, void 0), x(Cm, this, e), x(wm, this, n), x(Sm, this, t), x(Tm, this, y(Em, this, Om).call(this, b(Sm, this))), this.closed().finally(() => b(xm, this).close()).catch(o);
6521
6564
  }
6522
6565
  closed() {
6523
- return b(fm, this);
6566
+ return b(Tm, this);
6524
6567
  }
6525
6568
  close() {
6526
6569
  var e = this;
6527
6570
  return t(function* () {
6528
- return (yield b(lm, e).promise).unsubscribe();
6571
+ return (yield b(Sm, e).promise).unsubscribe();
6529
6572
  })();
6530
6573
  }
6531
6574
  timeline() {
6532
- let [e, t] = b(cm, this).value();
6575
+ let [e, t] = b(xm, this).value();
6533
6576
  return e;
6534
6577
  }
6535
6578
  timestampWallclockOffset() {
@@ -6541,20 +6584,20 @@ var am = 1e4, om = 3e4, sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */
6541
6584
  waitForWallclockTime(e) {
6542
6585
  var n = this;
6543
6586
  return t(function* () {
6544
- return yield b(cm, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
6587
+ return yield b(xm, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
6545
6588
  })();
6546
6589
  }
6547
6590
  waitForTimelineToHaveMinDuration() {
6548
6591
  var e = this;
6549
6592
  return t(function* () {
6550
- return yield b(cm, e).waitFor((e) => {
6593
+ return yield b(xm, e).waitFor((e) => {
6551
6594
  let t = e[0], n = e[e.length - 1];
6552
- return !t || !n ? !1 : n.wallclock - t.wallclock > am;
6595
+ return !t || !n ? !1 : n.wallclock - t.wallclock > vm;
6553
6596
  }), e.timeline();
6554
6597
  })();
6555
6598
  }
6556
6599
  };
6557
- function hm(e) {
6600
+ function Om(e) {
6558
6601
  var n = this;
6559
6602
  return t(function* () {
6560
6603
  let t = yield e.promise;
@@ -6569,13 +6612,13 @@ function hm(e) {
6569
6612
  let e = p.value;
6570
6613
  {
6571
6614
  if (e.objectStatus !== H.Normal) continue;
6572
- let r = _m(e.payload);
6573
- b(cm, n).update((e) => {
6615
+ let r = Am(e.payload);
6616
+ b(xm, n).update((e) => {
6574
6617
  var t, n;
6575
- for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > om;) e.shift();
6618
+ for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > ym;) e.shift();
6576
6619
  return e;
6577
- }), t === b(lm, n).resolved && e.groupId > T(0) && e.objectId == T(0) && y(pm, n, gm).call(n, e.groupId).catch((e) => {
6578
- b(sm, n).warn("backfill failed", e);
6620
+ }), t === b(Sm, n).resolved && e.groupId > T(0) && e.objectId == T(0) && y(Em, n, km).call(n, e.groupId).catch((e) => {
6621
+ b(bm, n).warn("backfill failed", e);
6579
6622
  });
6580
6623
  }
6581
6624
  }
@@ -6604,16 +6647,16 @@ function hm(e) {
6604
6647
  }
6605
6648
  })();
6606
6649
  }
6607
- function gm(e) {
6650
+ function km(e) {
6608
6651
  var n = this;
6609
6652
  return t(function* () {
6610
6653
  let t = e - T(1), r = n.timeline(), i = r[0], a = r[r.length - 1];
6611
- if (!i || !a || a.wallclock - i.wallclock > am) return;
6612
- let o = w.fromPromise(kp.subscribe(b(um, n), new rp().name(b(dm, n)).groupOrder("ascending").range(t, t).build()));
6613
- return y(pm, n, hm).call(n, o);
6654
+ if (!i || !a || a.wallclock - i.wallclock > vm) return;
6655
+ let o = w.fromPromise(kp.subscribe(b(Cm, n), new rp().name(b(wm, n)).groupOrder("ascending").range(t, t).build()));
6656
+ return y(Em, n, Om).call(n, o);
6614
6657
  })();
6615
6658
  }
6616
- function _m(e) {
6659
+ function Am(e) {
6617
6660
  var t;
6618
6661
  let n = new TextDecoder("utf-8").decode(e).split("\n");
6619
6662
  return (t = n[0]) != null && t.startsWith("MEDIA_PTS") && n.shift(), n.filter((e) => e.length > 0).map((e) => {
@@ -6630,40 +6673,40 @@ function _m(e) {
6630
6673
  }
6631
6674
  //#endregion
6632
6675
  //#region ../../libs/voq/src/tracks/WebVTT.ts
6633
- var vm, ym, bm;
6634
- function xm(e) {
6676
+ var jm, Mm, Nm;
6677
+ function Pm(e) {
6635
6678
  return typeof e.language == "string";
6636
6679
  }
6637
- var Sm = /* @__PURE__ */ new WeakMap(), Cm = /* @__PURE__ */ new WeakMap(), wm = /* @__PURE__ */ new WeakMap(), Tm = /* @__PURE__ */ new WeakMap();
6638
- vm = Symbol.asyncIterator, ym = Vt(), bm = Symbol.asyncDispose;
6639
- var Em = class n {
6680
+ var Fm = /* @__PURE__ */ new WeakMap(), Im = /* @__PURE__ */ new WeakMap(), Lm = /* @__PURE__ */ new WeakMap(), Rm = /* @__PURE__ */ new WeakMap();
6681
+ jm = Symbol.asyncIterator, Mm = Vt(), Nm = Symbol.asyncDispose;
6682
+ var zm = class n {
6640
6683
  constructor(t, n, r, i, a) {
6641
- v(this, Sm, new Zo()), v(this, Cm, void 0), v(this, wm, void 0), v(this, Tm, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), x(wm, this, t), x(Cm, this, n), this.trackObject = r, this.namespace = i, x(Tm, this, a);
6684
+ v(this, Fm, new Zo()), v(this, Im, void 0), v(this, Lm, void 0), v(this, Rm, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), x(Lm, this, t), x(Im, this, n), this.trackObject = r, this.namespace = i, x(Rm, this, a);
6642
6685
  }
6643
6686
  static subscribe(e, r, i) {
6644
6687
  return t(function* () {
6645
- if (!xm(r)) throw Error("track object language is required");
6688
+ if (!Pm(r)) throw Error("track object language is required");
6646
6689
  let t = new rp().name(r.name).build(), a = yield kp.subscribe(e, t);
6647
6690
  return new n(a, a.objects(), r, e.namespace(), i);
6648
6691
  })();
6649
6692
  }
6650
6693
  largestGroupId() {
6651
- return b(wm, this).largestGroupId();
6694
+ return b(Lm, this).largestGroupId();
6652
6695
  }
6653
6696
  update(e, t) {
6654
- return b(wm, this).update(e, t);
6697
+ return b(Lm, this).update(e, t);
6655
6698
  }
6656
6699
  unsubscribe() {
6657
- return b(wm, this).unsubscribe();
6700
+ return b(Lm, this).unsubscribe();
6658
6701
  }
6659
6702
  next() {
6660
6703
  var e = this;
6661
6704
  return t(function* () {
6662
6705
  for (;;) {
6663
- let t = yield b(Cm, e).next();
6706
+ let t = yield b(Im, e).next();
6664
6707
  if (t.done) return t;
6665
6708
  if (t.value.objectStatus !== H.Normal) continue;
6666
- let n = new TextDecoder().decode(t.value.payload), r = b(Sm, e).parse(n).map((t) => (t.startTime -= b(Tm, e) / 1e3, t.endTime -= b(Tm, e) / 1e3, t));
6709
+ let n = new TextDecoder().decode(t.value.payload), r = b(Fm, e).parse(n).map((t) => (t.startTime -= b(Rm, e) / 1e3, t.endTime -= b(Rm, e) / 1e3, t));
6667
6710
  return {
6668
6711
  done: !1,
6669
6712
  value: {
@@ -6677,29 +6720,29 @@ var Em = class n {
6677
6720
  return() {
6678
6721
  var e = this;
6679
6722
  return t(function* () {
6680
- return yield b(wm, e).return(), {
6723
+ return yield b(Lm, e).return(), {
6681
6724
  done: !0,
6682
6725
  value: void 0
6683
6726
  };
6684
6727
  })();
6685
6728
  }
6686
- [vm]() {
6729
+ [jm]() {
6687
6730
  return this;
6688
6731
  }
6689
- [ym]() {
6732
+ [Mm]() {
6690
6733
  return this.unsubscribe();
6691
6734
  }
6692
- [bm]() {
6735
+ [Nm]() {
6693
6736
  return this.unsubscribe();
6694
6737
  }
6695
- }, Dm = /* @__PURE__ */ new WeakMap(), Om = /* @__PURE__ */ new WeakMap(), km = /* @__PURE__ */ new WeakMap(), Am = /* @__PURE__ */ new WeakMap(), jm = /* @__PURE__ */ new WeakSet(), Mm = class n {
6738
+ }, Bm = /* @__PURE__ */ new WeakMap(), Vm = /* @__PURE__ */ new WeakMap(), Hm = /* @__PURE__ */ new WeakMap(), Um = /* @__PURE__ */ new WeakMap(), Wm = /* @__PURE__ */ new WeakSet(), Gm = class n {
6696
6739
  constructor(t, n, r, i, a) {
6697
- S(this, jm), e(this, "namespace", void 0), v(this, Dm, void 0), v(this, Om, void 0), v(this, km, void 0), v(this, Am, void 0), this.namespace = i, x(Dm, this, t), x(Om, this, n), x(km, this, r), x(Am, this, a);
6740
+ S(this, Wm), e(this, "namespace", void 0), v(this, Bm, void 0), v(this, Vm, void 0), v(this, Hm, void 0), v(this, Um, void 0), this.namespace = i, x(Bm, this, t), x(Vm, this, n), x(Hm, this, r), x(Um, this, a);
6698
6741
  }
6699
6742
  static start(e, r) {
6700
6743
  return t(function* () {
6701
- Pm._.info("Enter 'start'", { config: r });
6702
- let t = new op(e, { namespace: r.namespace }), [i, a] = yield Promise.all([mm.start(t, "timeline"), Rp.start(t, {
6744
+ qm._.info("Enter 'start'", { config: r });
6745
+ let t = new op(e, { namespace: r.namespace }), [i, a] = yield Promise.all([Dm.start(t, "timeline"), Rp.start(t, {
6703
6746
  catalog: r.catalog,
6704
6747
  namespace: r.namespace
6705
6748
  })]);
@@ -6707,42 +6750,42 @@ var Em = class n {
6707
6750
  })();
6708
6751
  }
6709
6752
  closed() {
6710
- return b(km, this).closed();
6753
+ return b(Hm, this).closed();
6711
6754
  }
6712
6755
  catalog() {
6713
- return b(km, this).catalog();
6756
+ return b(Hm, this).catalog();
6714
6757
  }
6715
6758
  timestampWallclockOffset() {
6716
- return b(Om, this).timestampWallclockOffset();
6759
+ return b(Vm, this).timestampWallclockOffset();
6717
6760
  }
6718
6761
  timestampOffsetMs() {
6719
- return b(Am, this);
6762
+ return b(Um, this);
6720
6763
  }
6721
6764
  setTimestampOffsetMs(e) {
6722
- x(Am, this, e);
6765
+ x(Um, this, e);
6723
6766
  }
6724
6767
  waitForWallclockTime(e) {
6725
- return b(Om, this).waitForWallclockTime(e);
6768
+ return b(Vm, this).waitForWallclockTime(e);
6726
6769
  }
6727
6770
  subscribeCmafTrack(e, t) {
6728
6771
  let n = t == null ? void 0 : t.startGroup, r = t == null ? void 0 : t.params, i = this.catalog().current().tracks, a = e["com.vindral.variant_uid"] === void 0 ? void 0 : i.find((t) => t["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]);
6729
- return y(jm, this, Nm).call(this, () => rm.subscribe(b(Dm, this), a == null ? e : a, {
6730
- timestampOffsetMs: b(Am, this),
6772
+ return y(Wm, this, Km).call(this, () => gm.subscribe(b(Bm, this), a == null ? e : a, {
6773
+ timestampOffsetMs: b(Um, this),
6731
6774
  startGroup: n,
6732
6775
  params: r
6733
6776
  }));
6734
6777
  }
6735
6778
  subscribeWebVttTrack(e) {
6736
- return y(jm, this, Nm).call(this, () => Em.subscribe(b(Dm, this), e, b(Am, this)));
6779
+ return y(Wm, this, Km).call(this, () => zm.subscribe(b(Bm, this), e, b(Um, this)));
6737
6780
  }
6738
6781
  subscribeTrack(e) {
6739
- return y(jm, this, Nm).call(this, () => b(Dm, this).subscribe(e));
6782
+ return y(Wm, this, Km).call(this, () => b(Bm, this).subscribe(e));
6740
6783
  }
6741
6784
  close() {
6742
- return Promise.all([b(km, this).close(), b(Om, this).close()]);
6785
+ return Promise.all([b(Hm, this).close(), b(Vm, this).close()]);
6743
6786
  }
6744
6787
  };
6745
- function Nm(e) {
6788
+ function Km(e) {
6746
6789
  var n = this;
6747
6790
  return t(function* () {
6748
6791
  let [t, r] = n.catalog().value();
@@ -6754,45 +6797,45 @@ function Nm(e) {
6754
6797
  }
6755
6798
  })();
6756
6799
  }
6757
- var Pm = { _: O.get().createContext("Channel") }, Fm = T(8);
6758
- function Im(e) {
6800
+ var qm = { _: O.get().createContext("Channel") }, Jm = T(8);
6801
+ function Ym(e) {
6759
6802
  if (e < 0 || e > 65535) throw RangeError("burstMs must be between 0 and 65535 inclusive");
6760
6803
  return {
6761
- type: Fm,
6804
+ type: Jm,
6762
6805
  payload: new Uint8Array([e >> 8 & 255, e & 255])
6763
6806
  };
6764
6807
  }
6765
6808
  //#endregion
6766
6809
  //#region ../../libs/voq/src/ProducerReferenceClock.ts
6767
- var Lm = /* @__PURE__ */ new WeakMap(), Rm = /* @__PURE__ */ new WeakMap(), zm = /* @__PURE__ */ new WeakSet(), Bm = class e {
6810
+ var Xm = /* @__PURE__ */ new WeakMap(), Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakSet(), $m = class e {
6768
6811
  constructor(e) {
6769
- S(this, zm), v(this, Lm, void 0), v(this, Rm, void 0);
6812
+ S(this, Qm), v(this, Xm, void 0), v(this, Zm, void 0);
6770
6813
  let [t, n] = e.value.value();
6771
- x(Lm, this, {
6814
+ x(Xm, this, {
6772
6815
  createdAt: /* @__PURE__ */ new Date(),
6773
6816
  wallclock: new Date(t.ntpTimestamp),
6774
6817
  rtt: t.rtt
6775
- }), x(Rm, this, y(zm, this, Vm).call(this, e));
6818
+ }), x(Zm, this, y(Qm, this, eh).call(this, e));
6776
6819
  }
6777
6820
  wallclock() {
6778
- let e = Date.now() - b(Lm, this).createdAt.getTime();
6779
- return b(Lm, this).wallclock.getTime() + e;
6821
+ let e = Date.now() - b(Xm, this).createdAt.getTime();
6822
+ return b(Xm, this).wallclock.getTime() + e;
6780
6823
  }
6781
6824
  closed() {
6782
- return b(Rm, this);
6825
+ return b(Zm, this);
6783
6826
  }
6784
6827
  static start(t) {
6785
6828
  return new e(t);
6786
6829
  }
6787
6830
  };
6788
- function Vm(e) {
6831
+ function eh(e) {
6789
6832
  var n = this;
6790
6833
  return t(function* () {
6791
6834
  var t = !1, r = !1, i;
6792
6835
  try {
6793
6836
  for (var a = U(e.value), o; t = !(o = yield a.next()).done; t = !1) {
6794
6837
  let e = o.value;
6795
- x(Lm, n, {
6838
+ x(Xm, n, {
6796
6839
  createdAt: /* @__PURE__ */ new Date(),
6797
6840
  wallclock: new Date(e.ntpTimestamp),
6798
6841
  rtt: e.rtt
@@ -6811,7 +6854,7 @@ function Vm(e) {
6811
6854
  }
6812
6855
  //#endregion
6813
6856
  //#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutPropertiesLoose.js
6814
- function Hm(e, t) {
6857
+ function th(e, t) {
6815
6858
  if (e == null) return {};
6816
6859
  var n = {};
6817
6860
  for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -6822,9 +6865,9 @@ function Hm(e, t) {
6822
6865
  }
6823
6866
  //#endregion
6824
6867
  //#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutProperties.js
6825
- function Um(e, t) {
6868
+ function nh(e, t) {
6826
6869
  if (e == null) return {};
6827
- var n, r, i = Hm(e, t);
6870
+ var n, r, i = th(e, t);
6828
6871
  if (Object.getOwnPropertySymbols) {
6829
6872
  var a = Object.getOwnPropertySymbols(e);
6830
6873
  for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
@@ -6833,27 +6876,27 @@ function Um(e, t) {
6833
6876
  }
6834
6877
  //#endregion
6835
6878
  //#region ../../libs/voq/src/tracks/Drm.ts
6836
- var Wm = ["fairplayCertificate"];
6837
- function Gm(e) {
6879
+ var rh = ["fairplayCertificate"];
6880
+ function ih(e) {
6838
6881
  return typeof e == "string" || e == null;
6839
6882
  }
6840
- function Km(e) {
6841
- return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || Gm(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || Gm(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || Gm(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || Gm(e.fairplayCertificate));
6883
+ function ah(e) {
6884
+ return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || ih(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || ih(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || ih(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || ih(e.fairplayCertificate));
6842
6885
  }
6843
- function qm(e) {
6886
+ function oh(e) {
6844
6887
  try {
6845
6888
  return Be(e);
6846
6889
  } catch (e) {
6847
6890
  throw Error("Failed to convert fairplayCertificate");
6848
6891
  }
6849
6892
  }
6850
- function Jm(e) {
6893
+ function sh(e) {
6851
6894
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
6852
- if (!Km(n)) throw Error("Invalid drm object");
6895
+ if (!ah(n)) throw Error("Invalid drm object");
6853
6896
  let { fairplayCertificate: r } = n;
6854
- return C(C({}, Um(n, Wm)), {}, { fairplayCertificate: r ? qm(r) : void 0 });
6897
+ return C(C({}, nh(n, rh)), {}, { fairplayCertificate: r ? oh(r) : void 0 });
6855
6898
  }
6856
- var Ym = class n {
6899
+ var ch = class n {
6857
6900
  constructor(t) {
6858
6901
  e(this, "value", void 0), this.value = t;
6859
6902
  }
@@ -6863,7 +6906,7 @@ var Ym = class n {
6863
6906
  var t = td();
6864
6907
  let a = yield t.a(yield e.subscribeTrack(new rp().name("drm").build())).objects().next();
6865
6908
  if (a.done) throw Error("No drm object received");
6866
- return new n(C(C({}, Jm(a.value.payload)), {}, {
6909
+ return new n(C(C({}, sh(a.value.payload)), {}, {
6867
6910
  videoCodec: r,
6868
6911
  audioCodec: i
6869
6912
  }));
@@ -6877,20 +6920,20 @@ var Ym = class n {
6877
6920
  };
6878
6921
  //#endregion
6879
6922
  //#region ../../libs/voq/src/tracks/Stats.ts
6880
- function Xm(e) {
6923
+ function lh(e) {
6881
6924
  return "rtt" in e && typeof e.rtt == "number" && "ntpTimestamp" in e && typeof e.ntpTimestamp == "number" && "estimatedBandwidth" in e && typeof e.estimatedBandwidth == "number";
6882
6925
  }
6883
- function Zm(e) {
6926
+ function uh(e) {
6884
6927
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
6885
- if (!Xm(n)) throw Error("Invalid stats object");
6928
+ if (!lh(n)) throw Error("Invalid stats object");
6886
6929
  return n;
6887
6930
  }
6888
- var Qm = 1e4, $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakSet(), th = class n {
6931
+ var dh = 1e4, fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakSet(), mh = class n {
6889
6932
  constructor(t, n, r) {
6890
- S(this, eh), e(this, "ip", void 0), e(this, "value", void 0), v(this, $m, void 0), this.ip = r, this.value = new A(n), x($m, this, y(eh, this, nh).call(this, t));
6933
+ S(this, ph), e(this, "ip", void 0), e(this, "value", void 0), v(this, fh, void 0), this.ip = r, this.value = new A(n), x(fh, this, y(ph, this, hh).call(this, t));
6891
6934
  }
6892
6935
  closed() {
6893
- return b($m, this);
6936
+ return b(fh, this);
6894
6937
  }
6895
6938
  idleTimeout() {
6896
6939
  var e = this;
@@ -6898,7 +6941,7 @@ var Qm = 1e4, $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakS
6898
6941
  for (;;) {
6899
6942
  let [t, n] = e.value.value();
6900
6943
  try {
6901
- yield Promise.race([mn(Qm, /* @__PURE__ */ Error("Idle timeout")), n]);
6944
+ yield Promise.race([mn(dh, /* @__PURE__ */ Error("Idle timeout")), n]);
6902
6945
  } catch (e) {
6903
6946
  return e;
6904
6947
  }
@@ -6909,13 +6952,13 @@ var Qm = 1e4, $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakS
6909
6952
  return t(function* () {
6910
6953
  let t = (yield e.subscribe(new rp().name("stats").groupOrder("ascending").build())).objects(), r = yield t.next();
6911
6954
  if (r.done) throw Error("No stats object received");
6912
- let i = Zm(r.value.payload);
6955
+ let i = uh(r.value.payload);
6913
6956
  if (!i.ip) throw Error("Expected IP in initial stats object");
6914
6957
  return new n(t, i, i.ip);
6915
6958
  })();
6916
6959
  }
6917
6960
  };
6918
- function nh(e) {
6961
+ function hh(e) {
6919
6962
  var n = this;
6920
6963
  return t(function* () {
6921
6964
  var t = !1, r = !1, i;
@@ -6924,7 +6967,7 @@ function nh(e) {
6924
6967
  let e = o.value;
6925
6968
  {
6926
6969
  if (e.objectStatus !== H.Normal) continue;
6927
- let t = Zm(e.payload);
6970
+ let t = uh(e.payload);
6928
6971
  n.value.update(t);
6929
6972
  }
6930
6973
  }
@@ -6941,21 +6984,21 @@ function nh(e) {
6941
6984
  }
6942
6985
  //#endregion
6943
6986
  //#region ../../libs/voq/src/UpstreamWatcher.ts
6944
- var rh = /* @__PURE__ */ new WeakMap(), ih = /* @__PURE__ */ new WeakMap(), ah = class {
6987
+ var gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = class {
6945
6988
  constructor(e) {
6946
- v(this, rh, O.get().createContext("UpstreamWatcher")), v(this, ih, void 0), x(ih, this, new A(w.fromPromise(e.closed())));
6989
+ v(this, gh, O.get().createContext("UpstreamWatcher")), v(this, _h, void 0), x(_h, this, new A(w.fromPromise(e.closed())));
6947
6990
  }
6948
6991
  update(e) {
6949
- b(ih, this).update(w.fromPromise(e.closed()));
6992
+ b(_h, this).update(w.fromPromise(e.closed()));
6950
6993
  }
6951
6994
  closed() {
6952
6995
  var e = this;
6953
6996
  return t(function* () {
6954
6997
  try {
6955
6998
  for (;;) {
6956
- let [t, n] = b(ih, e).value(), r = !1;
6999
+ let [t, n] = b(_h, e).value(), r = !1;
6957
7000
  yield Promise.race([n == null ? void 0 : n.then(() => r = !0), t.promise.then(() => {
6958
- if (!r) throw b(rh, e).warn("Upstream closed"), Error("Upstream closed");
7001
+ if (!r) throw b(gh, e).warn("Upstream closed"), Error("Upstream closed");
6959
7002
  })]);
6960
7003
  }
6961
7004
  } catch (e) {
@@ -6963,19 +7006,19 @@ var rh = /* @__PURE__ */ new WeakMap(), ih = /* @__PURE__ */ new WeakMap(), ah =
6963
7006
  }
6964
7007
  })();
6965
7008
  }
6966
- }, oh, sh = /* @__PURE__ */ new WeakMap(), ch = /* @__PURE__ */ new WeakMap(), lh = /* @__PURE__ */ new WeakMap();
6967
- oh = Symbol.asyncIterator;
6968
- var uh = class {
7009
+ }, yh, bh = /* @__PURE__ */ new WeakMap(), xh = /* @__PURE__ */ new WeakMap(), Sh = /* @__PURE__ */ new WeakMap();
7010
+ yh = Symbol.asyncIterator;
7011
+ var Ch = class {
6969
7012
  constructor(e, t) {
6970
- v(this, sh, O.get().createContext("TracksIterator")), v(this, ch, void 0), v(this, lh, void 0), x(ch, this, e), x(lh, this, t);
7013
+ v(this, bh, O.get().createContext("TracksIterator")), v(this, xh, void 0), v(this, Sh, void 0), x(xh, this, e), x(Sh, this, t);
6971
7014
  }
6972
- [oh]() {
7015
+ [yh]() {
6973
7016
  var e = this;
6974
7017
  return Qt(function* () {
6975
- let t = b(lh, e);
7018
+ let t = b(Sh, e);
6976
7019
  var n = !1, r = !1, i;
6977
7020
  try {
6978
- for (var a = U(b(ch, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
7021
+ for (var a = U(b(xh, e)), o; n = !(o = yield k(a.next())).done; n = !1) {
6979
7022
  let n = o.value;
6980
7023
  {
6981
7024
  if (!n) continue;
@@ -6983,7 +7026,7 @@ var uh = class {
6983
7026
  name: n.trackObject.name,
6984
7027
  namespace: n.namespace
6985
7028
  };
6986
- b(sh, e).debug("track start", C({ mediaType: t }, r)), yield* xp(U(n)), b(sh, e).debug("track end", C({ mediaType: t }, r));
7029
+ b(bh, e).debug("track start", C({ mediaType: t }, r)), yield* xp(U(n)), b(bh, e).debug("track end", C({ mediaType: t }, r));
6987
7030
  }
6988
7031
  }
6989
7032
  } catch (e) {
@@ -6995,45 +7038,45 @@ var uh = class {
6995
7038
  if (r) throw i;
6996
7039
  }
6997
7040
  }
6998
- b(sh, e).debug("tracks ended", { mediaType: t });
7041
+ b(bh, e).debug("tracks ended", { mediaType: t });
6999
7042
  })();
7000
7043
  }
7001
- }, dh = /* @__PURE__ */ new WeakMap(), fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakMap(), mh = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = /* @__PURE__ */ new WeakMap(), bh = /* @__PURE__ */ new WeakSet(), xh = class n {
7044
+ }, wh = /* @__PURE__ */ new WeakMap(), Th = /* @__PURE__ */ new WeakMap(), Eh = /* @__PURE__ */ new WeakMap(), Dh = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakMap(), Ah = /* @__PURE__ */ new WeakMap(), jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakMap(), Nh = /* @__PURE__ */ new WeakSet(), Ph = class n {
7002
7045
  constructor(t, n, r) {
7003
- S(this, bh), v(this, dh, void 0), v(this, fh, void 0), v(this, ph, void 0), v(this, mh, O.get().createContext("Player")), v(this, Z, void 0), v(this, hh, new A(void 0)), v(this, gh, new A(void 0)), v(this, _h, new A(void 0)), v(this, vh, void 0), v(this, yh, void 0), e(this, "subtitles", new uh(b(_h, this), "subtitles")), e(this, "video", new uh(b(gh, this), "video")), e(this, "audio", new uh(b(hh, this), "audio")), x(dh, this, t), x(fh, this, Bm.start(r)), x(ph, this, r), x(Z, this, new A(n)), x(vh, this, new ah(n)), x(yh, this, Promise.race([
7046
+ S(this, Nh), v(this, wh, void 0), v(this, Th, void 0), v(this, Eh, void 0), v(this, Dh, O.get().createContext("Player")), v(this, Z, void 0), v(this, Oh, new A(void 0)), v(this, kh, new A(void 0)), v(this, Ah, new A(void 0)), v(this, jh, void 0), v(this, Mh, void 0), e(this, "subtitles", new Ch(b(Ah, this), "subtitles")), e(this, "video", new Ch(b(kh, this), "video")), e(this, "audio", new Ch(b(Oh, this), "audio")), x(wh, this, t), x(Th, this, $m.start(r)), x(Eh, this, r), x(Z, this, new A(n)), x(jh, this, new vh(n)), x(Mh, this, Promise.race([
7004
7047
  r.idleTimeout(),
7005
- y(bh, this, wh).call(this),
7006
- b(vh, this).closed()
7007
- ])), b(dh, this).closed().then(() => this.close()).catch(o);
7048
+ y(Nh, this, Lh).call(this),
7049
+ b(jh, this).closed()
7050
+ ])), b(wh, this).closed().then(() => this.close()).catch(o);
7008
7051
  }
7009
7052
  closed() {
7010
- return b(yh, this);
7053
+ return b(Mh, this);
7011
7054
  }
7012
7055
  static start(e, r) {
7013
7056
  return t(function* () {
7014
7057
  let t = /* @__PURE__ */ new Map();
7015
7058
  if (r.burstMs !== void 0) {
7016
- let e = Im(r.burstMs);
7059
+ let e = Ym(r.burstMs);
7017
7060
  t.set(e.type, e);
7018
7061
  }
7019
- let i = new op(e, { namespace: sp("auxiliary") }), [[a, o, s], c] = yield Promise.all([Mm.start(e, r).then((e) => Promise.all([
7062
+ let i = new op(e, { namespace: sp("auxiliary") }), [[a, o, s], c] = yield Promise.all([Gm.start(e, r).then((e) => Promise.all([
7020
7063
  Promise.resolve(e),
7021
7064
  r.videoTrack ? e.subscribeCmafTrack(r.videoTrack, { params: t }) : void 0,
7022
7065
  r.audioTrack ? e.subscribeCmafTrack(r.audioTrack, { params: t }) : void 0
7023
- ])), th.start(i)]), l = new n(e, a, c);
7024
- return s && b(hh, l).update(s), o && b(gh, l).update(o), l;
7066
+ ])), mh.start(i)]), l = new n(e, a, c);
7067
+ return s && b(Oh, l).update(s), o && b(kh, l).update(o), l;
7025
7068
  })();
7026
7069
  }
7027
7070
  connectionInfo() {
7028
- let e = b(ph, this).value.current();
7071
+ let e = b(Eh, this).value.current();
7029
7072
  return {
7030
- ip: b(ph, this).ip,
7073
+ ip: b(Eh, this).ip,
7031
7074
  rtt: e.rtt,
7032
7075
  estimatedBandwidth: e.estimatedBandwidth
7033
7076
  };
7034
7077
  }
7035
7078
  stats() {
7036
- return b(ph, this).value;
7079
+ return b(Eh, this).value;
7037
7080
  }
7038
7081
  catalog() {
7039
7082
  return b(Z, this).current().catalog();
@@ -7043,48 +7086,48 @@ var uh = class {
7043
7086
  }
7044
7087
  videoTrack() {
7045
7088
  var e;
7046
- return (e = b(gh, this).current()) == null ? void 0 : e.trackObject;
7089
+ return (e = b(kh, this).current()) == null ? void 0 : e.trackObject;
7047
7090
  }
7048
7091
  audioTrack() {
7049
7092
  var e;
7050
- return (e = b(hh, this).current()) == null ? void 0 : e.trackObject;
7093
+ return (e = b(Oh, this).current()) == null ? void 0 : e.trackObject;
7051
7094
  }
7052
7095
  referenceClock() {
7053
- return b(fh, this);
7096
+ return b(Th, this);
7054
7097
  }
7055
7098
  drm() {
7056
7099
  var e = this;
7057
7100
  return t(function* () {
7058
7101
  var t, n;
7059
- if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return Ym.create(b(Z, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
7102
+ if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return ch.create(b(Z, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
7060
7103
  })();
7061
7104
  }
7062
7105
  close() {
7063
- return b(mh, this).info("Enter 'close'"), Promise.all([
7106
+ return b(Dh, this).info("Enter 'close'"), Promise.all([
7064
7107
  b(Z, this).current().close(),
7065
7108
  b(Z, this).close(),
7066
- y(bh, this, Sh).call(this, b(hh, this)),
7067
- y(bh, this, Sh).call(this, b(gh, this)),
7068
- y(bh, this, Sh).call(this, b(_h, this))
7109
+ y(Nh, this, Fh).call(this, b(Oh, this)),
7110
+ y(Nh, this, Fh).call(this, b(kh, this)),
7111
+ y(Nh, this, Fh).call(this, b(Ah, this))
7069
7112
  ]);
7070
7113
  }
7071
7114
  zap(e, n) {
7072
7115
  var r = this;
7073
7116
  return t(function* () {
7074
- b(mh, r).info("Enter 'zap'", {
7117
+ b(Dh, r).info("Enter 'zap'", {
7075
7118
  config: e,
7076
7119
  zapOffsetMs: n
7077
7120
  });
7078
- let t = yield Mm.start(b(dh, r), e), i = b(fh, r).wallclock() - n, a = b(Z, r).current(), o = a.timestampWallclockOffset(), s = yield t.waitForWallclockTime(i);
7079
- b(vh, r).update(t), yield b(Z, r).current().close();
7121
+ let t = yield Gm.start(b(wh, r), e), i = b(Th, r).wallclock() - n, a = b(Z, r).current(), o = a.timestampWallclockOffset(), s = yield t.waitForWallclockTime(i);
7122
+ b(jh, r).update(t), yield b(Z, r).current().close();
7080
7123
  let c = s.toReversed().find((e) => e.wallclock <= i), l = c != null && c.mediaPts ? c.mediaPts - a.timestampOffsetMs() : void 0, u = t.timestampWallclockOffset() - o + a.timestampOffsetMs();
7081
7124
  t.setTimestampOffsetMs(u);
7082
7125
  let d = c != null && c.groupId ? T(c.groupId) : void 0;
7083
7126
  if (l) {
7084
7127
  var f, p;
7085
- (f = b(gh, r).current()) == null || f.stopAfterTimestampReached(l), (p = b(hh, r).current()) == null || p.stopAfterTimestampReached(l);
7128
+ (f = b(kh, r).current()) == null || f.stopAfterTimestampReached(l), (p = b(Oh, r).current()) == null || p.stopAfterTimestampReached(l);
7086
7129
  }
7087
- b(Z, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, d) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, d) : void 0]), b(mh, r).info("Return 'zap'");
7130
+ b(Z, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, d) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, d) : void 0]), b(Dh, r).info("Return 'zap'");
7088
7131
  })();
7089
7132
  }
7090
7133
  setSubtitleTrack(e) {
@@ -7093,36 +7136,36 @@ var uh = class {
7093
7136
  var t;
7094
7137
  if (!e) {
7095
7138
  var r;
7096
- yield (r = b(_h, n).current()) == null ? void 0 : r.unsubscribe();
7139
+ yield (r = b(Ah, n).current()) == null ? void 0 : r.unsubscribe();
7097
7140
  return;
7098
7141
  }
7099
- let [i] = yield Promise.all([b(Z, n).current().subscribeWebVttTrack(e), (t = b(_h, n).current()) == null ? void 0 : t.unsubscribe()]);
7100
- b(_h, n).update(i);
7142
+ let [i] = yield Promise.all([b(Z, n).current().subscribeWebVttTrack(e), (t = b(Ah, n).current()) == null ? void 0 : t.unsubscribe()]);
7143
+ b(Ah, n).update(i);
7101
7144
  })();
7102
7145
  }
7103
7146
  setVideoTrack(e, n) {
7104
7147
  var r = this;
7105
7148
  return t(function* () {
7106
- let t = yield y(bh, r, Ch).call(r, b(Z, r).current(), e, b(gh, r).current(), n);
7107
- b(gh, r).update(t);
7149
+ let t = yield y(Nh, r, Ih).call(r, b(Z, r).current(), e, b(kh, r).current(), n);
7150
+ b(kh, r).update(t);
7108
7151
  })();
7109
7152
  }
7110
7153
  setAudioTrack(e, n) {
7111
7154
  var r = this;
7112
7155
  return t(function* () {
7113
- let t = yield y(bh, r, Ch).call(r, b(Z, r).current(), e, b(hh, r).current(), n);
7114
- b(hh, r).update(t);
7156
+ let t = yield y(Nh, r, Ih).call(r, b(Z, r).current(), e, b(Oh, r).current(), n);
7157
+ b(Oh, r).update(t);
7115
7158
  })();
7116
7159
  }
7117
7160
  };
7118
- function Sh(e) {
7161
+ function Fh(e) {
7119
7162
  let t = e.current(), n = t == null ? void 0 : t.largestGroupId();
7120
7163
  return e.isClosed() || e.update(void 0), e.close(), n ? t == null ? void 0 : t.update(n, n) : t == null ? void 0 : t.unsubscribe();
7121
7164
  }
7122
- function Ch(e, n, r, i) {
7165
+ function Ih(e, n, r, i) {
7123
7166
  var a = this;
7124
7167
  return t(function* () {
7125
- b(mh, a).info("Enter '#replaceTrack'", {
7168
+ b(Dh, a).info("Enter '#replaceTrack'", {
7126
7169
  trackObject: n,
7127
7170
  startGroupId: i
7128
7171
  });
@@ -7130,7 +7173,7 @@ function Ch(e, n, r, i) {
7130
7173
  return o;
7131
7174
  })();
7132
7175
  }
7133
- function wh() {
7176
+ function Lh() {
7134
7177
  var e = this;
7135
7178
  return t(function* () {
7136
7179
  var t = !1, n = !1, r;
@@ -7141,7 +7184,7 @@ function wh() {
7141
7184
  try {
7142
7185
  for (var l = U(t.catalog()), u; o = !(u = yield l.next()).done; o = !1) {
7143
7186
  let t = u.value;
7144
- yield Promise.all([y(bh, e, Th).call(e, t, b(gh, e)), y(bh, e, Th).call(e, t, b(hh, e))]);
7187
+ yield Promise.all([y(Nh, e, Rh).call(e, t, b(kh, e)), y(Nh, e, Rh).call(e, t, b(Oh, e))]);
7145
7188
  }
7146
7189
  } catch (e) {
7147
7190
  s = !0, c = e;
@@ -7164,7 +7207,7 @@ function wh() {
7164
7207
  }
7165
7208
  })();
7166
7209
  }
7167
- function Th(e, n) {
7210
+ function Rh(e, n) {
7168
7211
  var r = this;
7169
7212
  return t(function* () {
7170
7213
  let t = n.current();
@@ -7181,73 +7224,73 @@ function Th(e, n) {
7181
7224
  }
7182
7225
  //#endregion
7183
7226
  //#region ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
7184
- function Eh(e, t, n) {
7227
+ function zh(e, t, n) {
7185
7228
  let r = new URL("/voq/subscribe", e);
7186
7229
  return r.searchParams.set("sessionId", t.sessionId), r.searchParams.set("clientId", t.clientId), r.searchParams.set("channelId", t.channelId), n && r.searchParams.set("authToken", n), r;
7187
7230
  }
7188
- var Dh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakMap(), Ah = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakMap(), Nh = /* @__PURE__ */ new WeakMap(), Ph = /* @__PURE__ */ new WeakMap(), Fh = /* @__PURE__ */ new WeakMap(), Ih = /* @__PURE__ */ new WeakSet(), Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), zh = /* @__PURE__ */ new WeakMap(), Bh = class n {
7231
+ var Bh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMap(), Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), Gh = /* @__PURE__ */ new WeakMap(), Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakSet(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = class n {
7189
7232
  get estimatedBandwidth() {
7190
- return b(Ph, this);
7233
+ return b(qh, this);
7191
7234
  }
7192
7235
  unload() {
7193
- b(Q, this).off("send signal", b(Rh, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(Lh, this)), this.disconnect();
7236
+ b(Q, this).off("send signal", b(Zh, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(Xh, this)), this.disconnect();
7194
7237
  }
7195
7238
  suspend() {}
7196
7239
  unsuspend() {}
7197
7240
  getStatistics() {
7198
- let e = b(kh, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7241
+ let e = b(Hh, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7199
7242
  return {
7200
- edgeUrl: b(kh, this).url(),
7243
+ edgeUrl: b(Hh, this).url(),
7201
7244
  connectionProtocol: e
7202
7245
  };
7203
7246
  }
7204
7247
  constructor(t, n, r, i, a, s, c) {
7205
- S(this, Ih), v(this, Q, void 0), v(this, Oh, void 0), v(this, kh, void 0), v(this, Ah, "disconnected"), v(this, $, void 0), v(this, jh, /* @__PURE__ */ new Map()), v(this, Mh, void 0), v(this, Nh, void 0), v(this, Ph, void 0), v(this, Fh, /* @__PURE__ */ new Map()), v(this, Lh, (e) => {
7248
+ S(this, Yh), v(this, Q, void 0), v(this, Vh, void 0), v(this, Hh, void 0), v(this, Uh, "disconnected"), v(this, $, void 0), v(this, Wh, /* @__PURE__ */ new Map()), v(this, Gh, void 0), v(this, Kh, void 0), v(this, qh, void 0), v(this, Jh, /* @__PURE__ */ new Map()), v(this, Xh, (e) => {
7206
7249
  if (!e) {
7207
7250
  b($, this).setSubtitleTrack(void 0).catch(o);
7208
7251
  return;
7209
7252
  }
7210
- let t = b(jh, this).get(cp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7253
+ let t = b(Wh, this).get(cp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7211
7254
  n && b($, this).setSubtitleTrack(n).catch(o);
7212
- }), v(this, Rh, (e) => {
7255
+ }), v(this, Zh, (e) => {
7213
7256
  switch (e.type) {
7214
7257
  case "subscribe":
7215
- if (b(zh, this)) {
7216
- b(Oh, this).info("Ignoring - we are already switching");
7258
+ if (b(Qh, this)) {
7259
+ b(Vh, this).info("Ignoring - we are already switching");
7217
7260
  return;
7218
7261
  }
7219
- x(zh, this, !0), y(Ih, this, Uh).call(this, e.subscription).catch((t) => {
7220
- b(Oh, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7262
+ x(Qh, this, !0), y(Yh, this, ng).call(this, e.subscription).catch((t) => {
7263
+ b(Vh, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7221
7264
  type: "subscription changed",
7222
7265
  subscription: e.subscription,
7223
7266
  reset: !0
7224
7267
  });
7225
- }).finally(() => x(zh, this, !1));
7268
+ }).finally(() => x(Qh, this, !1));
7226
7269
  break;
7227
7270
  case "telemetry":
7228
- me(new URL("/api/telemetry", b(kh, this).url().replace("wss://", "https://")), {
7271
+ me(new URL("/api/telemetry", b(Hh, this).url().replace("wss://", "https://")), {
7229
7272
  body: e.body,
7230
7273
  headers: { "Content-Type": "text/plain" }
7231
7274
  }).catch(o);
7232
7275
  break;
7233
7276
  case "refresh auth":
7234
- b(kh, this).updateAuthToken(e.token);
7277
+ b(Hh, this).updateAuthToken(e.token);
7235
7278
  break;
7236
7279
  }
7237
- }), v(this, zh, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7238
- b(Oh, this).info("Disconnecting", e), b(kh, this).close(), b($, this).close().catch(o), x(Fh, this, /* @__PURE__ */ new Map()), y(Ih, this, Wh).call(this, "disconnected");
7239
- }), x(Q, this, t), x(Oh, this, n), x(kh, this, r), x($, this, i), x(jh, this, a), x(Mh, this, s), x(Nh, this, c), b(Q, this).on("send signal", b(Rh, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(Lh, this)), y(Ih, this, Vh).call(this).catch(o), y(Ih, this, Gh).call(this).catch(o);
7280
+ }), v(this, Qh, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7281
+ b(Vh, this).info("Disconnecting", e), b(Hh, this).close(), b($, this).close().catch(o), x(Jh, this, /* @__PURE__ */ new Map()), y(Yh, this, rg).call(this, "disconnected");
7282
+ }), x(Q, this, t), x(Vh, this, n), x(Hh, this, r), x($, this, i), x(Wh, this, a), x(Gh, this, s), x(Kh, this, c), b(Q, this).on("send signal", b(Zh, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(Xh, this)), y(Yh, this, eg).call(this).catch(o), y(Yh, this, ig).call(this).catch(o);
7240
7283
  }
7241
7284
  static start(e, r, i, a, o) {
7242
7285
  return t(function* () {
7243
7286
  var t, s, c;
7244
- let l = new Map(a.connectInfo.channels.map((e) => [cp(e.catalog.namespace), new Qh(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7287
+ let l = new Map(a.connectInfo.channels.map((e) => [cp(e.catalog.namespace), new dg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7245
7288
  switch (typeof a.edgeUrl) {
7246
7289
  case "string":
7247
- f = Eh(a.edgeUrl, u, d);
7290
+ f = zh(a.edgeUrl, u, d);
7248
7291
  break;
7249
7292
  default:
7250
- f = Eh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, u, d), p = Eh(a.edgeUrl.moqWsUrl, u, d);
7293
+ f = zh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, u, d), p = zh(a.edgeUrl.moqWsUrl, u, d);
7251
7294
  break;
7252
7295
  }
7253
7296
  let m = (t = a.connectInfo.channels.find((e) => e.channelId === u.channelId)) == null ? void 0 : t.catalog;
@@ -7266,16 +7309,16 @@ var Dh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMa
7266
7309
  }), ne = te.closed().then((e) => {
7267
7310
  throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
7268
7311
  }), re = yield Promise.race([
7269
- xh.start(te.subscriber, {
7312
+ Ph.start(te.subscriber, {
7270
7313
  namespace: m.namespace,
7271
7314
  catalog: m,
7272
7315
  videoTrack: h == null ? void 0 : h.track,
7273
7316
  audioTrack: ee == null ? void 0 : ee.track,
7274
7317
  burstMs: u.burstMs || 0
7275
7318
  }),
7276
- mn(Dh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7319
+ mn(Bh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7277
7320
  ne
7278
- ]), g = new Qh(re.catalog());
7321
+ ]), g = new dg(re.catalog());
7279
7322
  l.set(cp(m.namespace), g), e.emit("received signal", {
7280
7323
  type: "client ip",
7281
7324
  ip: re.connectionInfo().ip
@@ -7285,28 +7328,28 @@ var Dh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMa
7285
7328
  r.error("Error getting DRM data", e);
7286
7329
  });
7287
7330
  let ie = new n(e, r, te, re, l, i, o);
7288
- return u.textTrack && b(Lh, ie).call(ie, u.textTrack), ie;
7331
+ return u.textTrack && b(Xh, ie).call(ie, u.textTrack), ie;
7289
7332
  })();
7290
7333
  }
7291
7334
  getState() {
7292
- return b(Ah, this);
7335
+ return b(Uh, this);
7293
7336
  }
7294
7337
  close() {
7295
- b(kh, this).close();
7338
+ b(Hh, this).close();
7296
7339
  }
7297
7340
  closed() {
7298
- return Promise.race([b(kh, this).closed(), b($, this).closed()]);
7341
+ return Promise.race([b(Hh, this).closed(), b($, this).closed()]);
7299
7342
  }
7300
7343
  };
7301
- function Vh() {
7344
+ function eg() {
7302
7345
  var e = this;
7303
7346
  return t(function* () {
7304
- b(kh, e).transportType() === "websocket" && (yield pn(5e3));
7347
+ b(Hh, e).transportType() === "websocket" && (yield pn(5e3));
7305
7348
  var t = !1, n = !1, r;
7306
7349
  try {
7307
7350
  for (var i = U(b($, e).stats()), a; t = !(a = yield i.next()).done; t = !1) {
7308
7351
  let { rtt: t, estimatedBandwidth: n } = a.value;
7309
- x(Ph, e, n), b(Nh, e).push(t), b(Q, e).emit("rtt", Ot(b(Nh, e).items()));
7352
+ x(qh, e, n), b(Kh, e).push(t), b(Q, e).emit("rtt", Ot(b(Kh, e).items()));
7310
7353
  }
7311
7354
  } catch (e) {
7312
7355
  n = !0, r = e;
@@ -7319,26 +7362,26 @@ function Vh() {
7319
7362
  }
7320
7363
  })();
7321
7364
  }
7322
- function Hh(e) {
7365
+ function tg(e) {
7323
7366
  var n = this;
7324
7367
  return t(function* () {
7325
7368
  var t;
7326
- let r = yield b(Mh, n).connect({ channelId: e });
7369
+ let r = yield b(Gh, n).connect({ channelId: e });
7327
7370
  if (!ce(r)) throw Error("no moq connect info found");
7328
7371
  let i = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
7329
7372
  if (!i) throw Error("no catalog found");
7330
7373
  return i;
7331
7374
  })();
7332
7375
  }
7333
- function Uh(e) {
7376
+ function ng(e) {
7334
7377
  var n = this;
7335
7378
  return t(function* () {
7336
7379
  var t, r;
7337
- b(Oh, n).info("handle subscription", e);
7338
- let i = b($, n), a = b(jh, n).get(e.channelId);
7339
- if (a || (a = new Qh(new A(yield y(Ih, n, Hh).call(n, e.channelId))), b(jh, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7380
+ b(Vh, n).info("handle subscription", e);
7381
+ let i = b($, n), a = b(Wh, n).get(e.channelId);
7382
+ if (a || (a = new dg(new A(yield y(Yh, n, tg).call(n, e.channelId))), b(Wh, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7340
7383
  var o;
7341
- b(Oh, n).info("changing channel", e.channelId);
7384
+ b(Vh, n).info("changing channel", e.channelId);
7342
7385
  let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
7343
7386
  yield i.zap({
7344
7387
  namespace: a.namespace(),
@@ -7348,8 +7391,8 @@ function Uh(e) {
7348
7391
  }, 500), i.drm().then((e) => {
7349
7392
  e && b(Q, n).emit("received drm data", e.value);
7350
7393
  }).catch((e) => {
7351
- b(Oh, n).error("Error getting DRM data", e);
7352
- }), b(Oh, n).info("switched channel", e.channelId), (o = b(jh, n).get(cp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7394
+ b(Vh, n).error("Error getting DRM data", e);
7395
+ }), b(Vh, n).info("switched channel", e.channelId), (o = b(Wh, n).get(cp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7353
7396
  type: "subscription changed",
7354
7397
  subscription: e
7355
7398
  });
@@ -7362,26 +7405,26 @@ function Uh(e) {
7362
7405
  });
7363
7406
  })();
7364
7407
  }
7365
- function Wh(e) {
7366
- x(Ah, this, e), b(Q, this).emit("connection state", e);
7408
+ function rg(e) {
7409
+ x(Uh, this, e), b(Q, this).emit("connection state", e);
7367
7410
  }
7368
- function Gh() {
7411
+ function ig() {
7369
7412
  var e = this;
7370
7413
  return t(function* () {
7371
7414
  try {
7372
- y(Ih, e, Wh).call(e, "connecting"), b(Oh, e).info("Connecting..."), y(Ih, e, Wh).call(e, "connected"), yield Promise.all([
7373
- y(Ih, e, qh).call(e, b($, e).referenceClock(), b($, e).audio),
7374
- y(Ih, e, qh).call(e, b($, e).referenceClock(), b($, e).video),
7375
- y(Ih, e, Kh).call(e, b($, e).subtitles)
7376
- ]), yield b($, e).closed(), b(kh, e).close(), b(Oh, e).info("Session closed");
7415
+ y(Yh, e, rg).call(e, "connecting"), b(Vh, e).info("Connecting..."), y(Yh, e, rg).call(e, "connected"), yield Promise.all([
7416
+ y(Yh, e, og).call(e, b($, e).referenceClock(), b($, e).audio),
7417
+ y(Yh, e, og).call(e, b($, e).referenceClock(), b($, e).video),
7418
+ y(Yh, e, ag).call(e, b($, e).subtitles)
7419
+ ]), yield b($, e).closed(), b(Hh, e).close(), b(Vh, e).info("Session closed");
7377
7420
  } catch (t) {
7378
- b(Oh, e).warn("Session error", t);
7421
+ b(Vh, e).warn("Session error", t);
7379
7422
  } finally {
7380
- y(Ih, e, Wh).call(e, "disconnected");
7423
+ y(Yh, e, rg).call(e, "disconnected");
7381
7424
  }
7382
7425
  })();
7383
7426
  }
7384
- function Kh(e) {
7427
+ function ag(e) {
7385
7428
  var n = this;
7386
7429
  return t(function* () {
7387
7430
  var t = !1, r = !1, i;
@@ -7401,7 +7444,7 @@ function Kh(e) {
7401
7444
  }
7402
7445
  })();
7403
7446
  }
7404
- function qh(e, n) {
7447
+ function og(e, n) {
7405
7448
  var r = this;
7406
7449
  return t(function* () {
7407
7450
  let t = "", i = "", a, o = b($, r).videoTrack() === void 0;
@@ -7426,11 +7469,11 @@ function qh(e, n) {
7426
7469
  drmTransition: a !== void 0 && a !== ne
7427
7470
  };
7428
7471
  t = s, i = c, a = ne;
7429
- let m = f.producerReferenceTime(), h = b(Fh, r).get(n.track.namespace) || 0;
7472
+ let m = f.producerReferenceTime(), h = b(Jh, r).get(n.track.namespace) || 0;
7430
7473
  if (m && Date.now() - h > 1e3) {
7431
- b(Fh, r).set(n.track.namespace, Date.now());
7474
+ b(Jh, r).set(n.track.namespace, Date.now());
7432
7475
  let t = e.wallclock() - m.getTime();
7433
- b(Oh, r).debug("timing-info", {
7476
+ b(Vh, r).debug("timing-info", {
7434
7477
  mediaType: f.mediaType(),
7435
7478
  referenceClock: e,
7436
7479
  delta: t,
@@ -7453,7 +7496,7 @@ function qh(e, n) {
7453
7496
  mimeType: d,
7454
7497
  codec: l,
7455
7498
  switchInfo: p,
7456
- renditionId: Jh(n.track.trackObject.name)
7499
+ renditionId: sg(n.track.trackObject.name)
7457
7500
  });
7458
7501
  }
7459
7502
  }
@@ -7479,51 +7522,51 @@ function qh(e, n) {
7479
7522
  }
7480
7523
  })();
7481
7524
  }
7482
- function Jh(e) {
7525
+ function sg(e) {
7483
7526
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
7484
7527
  }
7485
- var Yh = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakSet(), Qh = class {
7528
+ var cg = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakSet(), dg = class {
7486
7529
  constructor(e) {
7487
- S(this, Zh), v(this, Yh, void 0), v(this, Xh, void 0), x(Yh, this, e), x(Xh, this, y(Zh, this, $h).call(this));
7530
+ S(this, ug), v(this, cg, void 0), v(this, lg, void 0), x(cg, this, e), x(lg, this, y(ug, this, fg).call(this));
7488
7531
  }
7489
7532
  catalog() {
7490
- return b(Yh, this).current();
7533
+ return b(cg, this).current();
7491
7534
  }
7492
7535
  namespace() {
7493
- return b(Yh, this).current().namespace;
7536
+ return b(cg, this).current().namespace;
7494
7537
  }
7495
7538
  updateCatalog(e) {
7496
- x(Yh, this, e);
7539
+ x(cg, this, e);
7497
7540
  }
7498
7541
  getTextTrack(e) {
7499
- return b(Yh, this).current().tracks.find((t) => t.label === e);
7542
+ return b(cg, this).current().tracks.find((t) => t.label === e);
7500
7543
  }
7501
7544
  getAudioTrack(e) {
7502
7545
  if (!e.codec) return;
7503
- let t = b(Xh, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7546
+ let t = b(lg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7504
7547
  return t[t.length - 1];
7505
7548
  }
7506
7549
  getVideoTrack(e) {
7507
7550
  if (!e.codec) return;
7508
- let t = b(Xh, this).filter((t) => !(!hn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7551
+ let t = b(lg, this).filter((t) => !(!hn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7509
7552
  return t[t.length - 1];
7510
7553
  }
7511
7554
  renditions() {
7512
- return b(Xh, this);
7555
+ return b(lg, this);
7513
7556
  }
7514
7557
  };
7515
- function $h() {
7516
- let [e, t] = b(Yh, this).value();
7558
+ function fg() {
7559
+ let [e, t] = b(cg, this).value();
7517
7560
  return ue(e);
7518
7561
  }
7519
7562
  //#endregion
7520
7563
  //#region ../../libs/web-sdk/src/resolveEdgeUrl.ts
7521
- var eg = (e, t) => {
7564
+ var pg = (e, t) => {
7522
7565
  let n = new URL("/subscribe", e);
7523
7566
  return n.searchParams.append("channelId", t.channelId), n.searchParams.append("sessionId", t.sessionId), n.searchParams.append("clientId", t.clientId), t.audio && t.audio.codec && (n.searchParams.append("audio.bitRate", Math.round(t.audio.bitRate).toString()), n.searchParams.append("audio.codec", t.audio.codec), t.audio.language && n.searchParams.append("audio.language", t.audio.language)), t.video && t.video.codec && (n.searchParams.append("video.width", t.video.width.toString()), n.searchParams.append("video.height", t.video.height.toString()), n.searchParams.append("video.bitRate", Math.round(t.video.bitRate).toString()), n.searchParams.append("video.codec", t.video.codec)), t.expectAdditionalConnection && n.searchParams.append("expectAdditionalConnection", t.expectAdditionalConnection.toString()), t.burstMs && n.searchParams.append("burstMs", t.burstMs.toString()), t.channelGroupId && n.searchParams.append("channelGroupId", t.channelGroupId), t.authToken && (n.searchParams.append("auth.token", t.authToken), n.searchParams.append("auth.type", "jwt")), n.toString();
7524
- }, tg = /* @__PURE__ */ function(e) {
7567
+ }, mg = /* @__PURE__ */ function(e) {
7525
7568
  return e[e.AuthenticationFailed = 4e3] = "AuthenticationFailed", e[e.AuthenticationRefreshFailed = 4001] = "AuthenticationRefreshFailed", e[e.AuthenticationExpired = 4002] = "AuthenticationExpired", e[e.ChannelNotFound = 4003] = "ChannelNotFound", e[e.Inactivity = 4010] = "Inactivity", e;
7526
- }({}), ng = class extends _e {
7569
+ }({}), hg = class extends _e {
7527
7570
  constructor(n, r) {
7528
7571
  var i;
7529
7572
  super(), i = this, e(this, "options", void 0), e(this, "websockets", []), e(this, "logger", void 0), e(this, "reconnectState", { reconnectRetries: 0 }), e(this, "isSuspended", !1), e(this, "_connectionAttemptCount", 0), e(this, "connectStartTime", 0), e(this, "_connectTime", void 0), e(this, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
@@ -7565,19 +7608,19 @@ var eg = (e, t) => {
7565
7608
  code: e.code,
7566
7609
  isSuspended: this.isSuspended
7567
7610
  })), this.close("one websocket was closed"), e.code) {
7568
- case tg.AuthenticationFailed:
7611
+ case mg.AuthenticationFailed:
7569
7612
  this.emit("error", ne(se()));
7570
7613
  break;
7571
- case tg.AuthenticationRefreshFailed:
7614
+ case mg.AuthenticationRefreshFailed:
7572
7615
  this.emit("error", ne(se()));
7573
7616
  break;
7574
- case tg.AuthenticationExpired:
7617
+ case mg.AuthenticationExpired:
7575
7618
  this.emit("error", h(se()));
7576
7619
  break;
7577
- case tg.ChannelNotFound:
7620
+ case mg.ChannelNotFound:
7578
7621
  this.emit("error", m("internal", se()));
7579
7622
  break;
7580
- case tg.Inactivity:
7623
+ case mg.Inactivity:
7581
7624
  this.emit("error", oe("internal", se()));
7582
7625
  break;
7583
7626
  default:
@@ -7626,10 +7669,10 @@ var eg = (e, t) => {
7626
7669
  get connectTime() {
7627
7670
  return this._connectTime;
7628
7671
  }
7629
- }, rg, ig = 65536 * 8, ag = .9, og = 40, sg = (e) => {
7630
- let t = e || og;
7631
- return ig * ag * 1e3 / t;
7632
- }, cg = class n {
7672
+ }, gg, _g = 65536 * 8, vg = .9, yg = 40, bg = (e) => {
7673
+ let t = e || yg;
7674
+ return _g * vg * 1e3 / t;
7675
+ }, xg = class n {
7633
7676
  constructor(r, i, a, s) {
7634
7677
  var c = this;
7635
7678
  e(this, "emitter", void 0), e(this, "transport", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "rtts", void 0), e(this, "lastPingSentTime", Date.now()), e(this, "isPingInFlight", !1), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "contextSwitchesInProgress", /* @__PURE__ */ new Set()), e(this, "contextSwitchesCompleted", /* @__PURE__ */ new Set()), e(this, "buffer", []), e(this, "disconnected", new w()), e(this, "unload", () => {
@@ -7678,7 +7721,7 @@ var eg = (e, t) => {
7678
7721
  }), e(this, "resolveEdgeUrl", t(function* () {
7679
7722
  let e = c.config.connectInfo, t = yield c.config.onConnectInfo(e), n = c.config.options.getOverride("separateVideoSocketEnabled", t.channelId), r = c.config.options.get("media") === "audio+video", i = 1;
7680
7723
  r && (i = n === !1 ? 1 : 2);
7681
- let a = eg(c.config.edgeUrl, {
7724
+ let a = pg(c.config.edgeUrl, {
7682
7725
  video: t.video,
7683
7726
  audio: t.audio,
7684
7727
  burstMs: t.burstMs,
@@ -7711,7 +7754,7 @@ var eg = (e, t) => {
7711
7754
  }
7712
7755
  }
7713
7756
  }), e(this, "connectWebSocketTransport", () => {
7714
- let e = new ng({
7757
+ let e = new hg({
7715
7758
  reconnectDelay: 1e3,
7716
7759
  onMessage: this.onMessage,
7717
7760
  reconnectHandler: this.config.reconnectHandler,
@@ -7752,47 +7795,47 @@ var eg = (e, t) => {
7752
7795
  return this.disconnected.promise;
7753
7796
  }
7754
7797
  };
7755
- rg = cg, e(cg, "PING_INTERVAL", 5e3), e(cg, "MAX_MISSED_PINGS", 4), e(cg, "TLS_ROUNDTRIPS", 3), e(cg, "start", (e, t, n, r) => new Promise((i, a) => {
7756
- let o = new rg(e, t, n, r);
7798
+ gg = xg, e(xg, "PING_INTERVAL", 5e3), e(xg, "MAX_MISSED_PINGS", 4), e(xg, "TLS_ROUNDTRIPS", 3), e(xg, "start", (e, t, n, r) => new Promise((i, a) => {
7799
+ let o = new gg(e, t, n, r);
7757
7800
  o.transport.once("error", (e) => a(e)), o.transport.once("open", () => i(o));
7758
7801
  }));
7759
7802
  //#endregion
7760
7803
  //#region ../../libs/web-sdk/src/EdgeSelector.ts
7761
- var lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg = /* @__PURE__ */ new WeakMap(), fg = class {
7804
+ var Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = class {
7762
7805
  constructor(e) {
7763
- v(this, lg, void 0), v(this, ug, []), v(this, dg, void 0), x(lg, this, e);
7806
+ v(this, Sg, void 0), v(this, Cg, []), v(this, wg, void 0), x(Sg, this, e);
7764
7807
  }
7765
7808
  select(e) {
7766
- if (b(lg, this).edgeUrl) return b(lg, this).edgeUrl;
7767
- b(ug, this).length === 0 && x(ug, this, b(ug, this).concat(e));
7768
- let t = b(ug, this).shift();
7769
- if (x(dg, this, t), t) return t;
7809
+ if (b(Sg, this).edgeUrl) return b(Sg, this).edgeUrl;
7810
+ b(Cg, this).length === 0 && x(Cg, this, b(Cg, this).concat(e));
7811
+ let t = b(Cg, this).shift();
7812
+ if (x(wg, this, t), t) return t;
7770
7813
  }
7771
7814
  shiftedEdge() {
7772
- return b(dg, this);
7815
+ return b(wg, this);
7773
7816
  }
7774
7817
  reset() {
7775
- x(dg, this, void 0), x(ug, this, []);
7818
+ x(wg, this, void 0), x(Cg, this, []);
7776
7819
  }
7777
- }, pg, mg = /* @__PURE__ */ new WeakMap(), hg = /* @__PURE__ */ new WeakMap(), gg = /* @__PURE__ */ new WeakMap(), _g = /* @__PURE__ */ new WeakMap(), vg = /* @__PURE__ */ new WeakMap(), yg = /* @__PURE__ */ new WeakMap(), bg = /* @__PURE__ */ new WeakMap(), xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakSet(), Tg = class n {
7820
+ }, Eg, Dg = /* @__PURE__ */ new WeakMap(), Og = /* @__PURE__ */ new WeakMap(), kg = /* @__PURE__ */ new WeakMap(), Ag = /* @__PURE__ */ new WeakMap(), jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakSet(), Rg = class n {
7778
7821
  constructor(r, i, a) {
7779
7822
  var s = this;
7780
- S(this, wg), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), v(this, mg, new _(10)), v(this, hg, !0), v(this, gg, void 0), v(this, _g, 0), v(this, vg, 0), v(this, yg, 0), v(this, bg, void 0), v(this, xg, void 0), e(this, "unload", () => {
7823
+ S(this, Lg), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), v(this, Dg, new _(10)), v(this, Og, !0), v(this, kg, void 0), v(this, Ag, 0), v(this, jg, 0), v(this, Mg, 0), v(this, Ng, void 0), v(this, Pg, void 0), e(this, "unload", () => {
7781
7824
  var e;
7782
7825
  this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), this.logger.debug("Unloaded module");
7783
7826
  }), e(this, "suspend", () => {
7784
7827
  var e;
7785
- x(hg, this, !1), (e = this.connectionImpl) == null || e.suspend();
7828
+ x(Og, this, !1), (e = this.connectionImpl) == null || e.suspend();
7786
7829
  }), e(this, "unsuspend", () => {
7787
7830
  var e;
7788
- x(hg, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7831
+ x(Og, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7789
7832
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
7790
- let e = b(vg, this) > 0 ? b(yg, this) / b(vg, this) : 0;
7833
+ let e = b(jg, this) > 0 ? b(Mg, this) / b(jg, this) : 0;
7791
7834
  return this.connectionImpl ? C(C({}, this.connectionImpl.getStatistics()), {}, {
7792
- rtt: At(b(mg, this).items()),
7835
+ rtt: At(b(Dg, this).items()),
7793
7836
  estimatedBandwidth: this.estimatedBandwidth,
7794
- connectCount: b(yg, this),
7795
- connectionAttemptCount: b(vg, this),
7837
+ connectCount: b(Mg, this),
7838
+ connectionAttemptCount: b(jg, this),
7796
7839
  connectionSuccessRatio: e
7797
7840
  }) : {
7798
7841
  rtt: {
@@ -7802,19 +7845,19 @@ var lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg =
7802
7845
  last: 0
7803
7846
  },
7804
7847
  estimatedBandwidth: 0,
7805
- connectCount: b(yg, this),
7806
- connectionAttemptCount: b(vg, this),
7848
+ connectCount: b(Mg, this),
7849
+ connectionAttemptCount: b(jg, this),
7807
7850
  connectionSuccessRatio: e,
7808
7851
  connectionProtocol: void 0
7809
7852
  };
7810
7853
  }), e(this, "connect", () => {
7811
- x(hg, this, !0), !b(gg, this) && x(gg, this, y(wg, this, Eg).call(this));
7854
+ x(Og, this, !0), !b(kg, this) && x(kg, this, y(Lg, this, zg).call(this));
7812
7855
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
7813
7856
  var t;
7814
- x(hg, this, !1), (t = this.connectionImpl) == null || t.close(e);
7857
+ x(Og, this, !1), (t = this.connectionImpl) == null || t.close(e);
7815
7858
  }), e(this, "reconnect", (e) => {
7816
7859
  this.disconnect(e), this.connect();
7817
- }), v(this, Sg, t(function* () {
7860
+ }), v(this, Fg, t(function* () {
7818
7861
  try {
7819
7862
  return yield s.apiClient.connect(s.config.options.getOptions());
7820
7863
  } catch (e) {
@@ -7825,7 +7868,7 @@ var lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg =
7825
7868
  }
7826
7869
  throw s.emitter.emit("error", te(e instanceof Error ? e : void 0)), e;
7827
7870
  }
7828
- })), v(this, Cg, t(function* () {
7871
+ })), v(this, Ig, t(function* () {
7829
7872
  let e = Date.now(), t = () => Date.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = fetch(new URL("/api/v4/connect/ping", s.config.options.get("url")).toString(), {
7830
7873
  method: "HEAD",
7831
7874
  signal: r == null ? void 0 : r.signal
@@ -7837,43 +7880,43 @@ var lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg =
7837
7880
  });
7838
7881
  }
7839
7882
  get rtt() {
7840
- return b(mg, this).items().length > 0 ? Ot(b(mg, this).items()) : 0;
7883
+ return b(Dg, this).items().length > 0 ? Ot(b(Dg, this).items()) : 0;
7841
7884
  }
7842
7885
  get estimatedBandwidth() {
7843
- return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : sg(this.rtt);
7886
+ return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : bg(this.rtt);
7844
7887
  }
7845
7888
  get firstConnectionTime() {
7846
- return b(bg, this);
7889
+ return b(Ng, this);
7847
7890
  }
7848
7891
  get lastConnectionTime() {
7849
- return b(xg, this);
7892
+ return b(Pg, this);
7850
7893
  }
7851
7894
  };
7852
- pg = Tg;
7853
- function Eg() {
7895
+ Eg = Rg;
7896
+ function zg() {
7854
7897
  var e = this;
7855
7898
  return t(function* () {
7856
- let t = new fg({ edgeUrl: e.config.options.get("edgeUrl") });
7857
- for (x(_g, e, 0);;) {
7899
+ let t = new Tg({ edgeUrl: e.config.options.get("edgeUrl") });
7900
+ for (x(Ag, e, 0);;) {
7858
7901
  var n, r, i;
7859
- x(_g, e, (n = b(_g, e), n++, n)), x(vg, e, (r = b(vg, e), r++, r));
7902
+ x(Ag, e, (n = b(Ag, e), n++, n)), x(jg, e, (r = b(jg, e), r++, r));
7860
7903
  let o = !1;
7861
7904
  try {
7862
7905
  var a;
7863
- let [n, r] = yield Promise.all([b(Sg, e).call(e), b(Cg, e).call(e)]), i = r / 2;
7864
- if (b(mg, e).clear(), b(mg, e).push(i), !b(hg, e)) break;
7906
+ let [n, r] = yield Promise.all([b(Fg, e).call(e), b(Ig, e).call(e)]), i = r / 2;
7907
+ if (b(Dg, e).clear(), b(Dg, e).push(i), !b(Og, e)) break;
7865
7908
  let o = t.select(n.edges);
7866
7909
  if (!o) throw new g("Failed to resolve edge url", {
7867
7910
  isFatal: !0,
7868
7911
  code: "failed_to_resolve_edge_url"
7869
7912
  });
7870
- ce(n) ? e.connectionImpl = yield Bh.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
7913
+ ce(n) ? e.connectionImpl = yield $h.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
7871
7914
  connectInfo: n,
7872
7915
  edgeUrl: o
7873
- }), b(mg, e)) : (de(typeof o == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield cg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
7916
+ }), b(Dg, e)) : (de(typeof o == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield xg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
7874
7917
  connectInfo: n,
7875
7918
  edgeUrl: o
7876
- }), b(mg, e))), t.reset(), x(yg, e, (a = b(yg, e), a++, a)), x(_g, e, 0), x(xg, e, Date.now()), b(bg, e) || x(bg, e, b(xg, e)), yield e.connectionImpl.closed();
7919
+ }), b(Dg, e))), t.reset(), x(Mg, e, (a = b(Mg, e), a++, a)), x(Ag, e, 0), x(Pg, e, Date.now()), b(Ng, e) || x(Ng, e, b(Pg, e)), yield e.connectionImpl.closed();
7877
7920
  } catch (n) {
7878
7921
  e.logger.info("Failed to connect", n);
7879
7922
  let r = t.shiftedEdge();
@@ -7886,30 +7929,30 @@ function Eg() {
7886
7929
  }));
7887
7930
  }
7888
7931
  if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, o) {
7889
- x(hg, e, !1);
7932
+ x(Og, e, !1);
7890
7933
  break;
7891
7934
  }
7892
- if (!b(hg, e)) break;
7893
- if (!(yield e.config.reconnectHandler({ reconnectRetries: b(_g, e) }))) {
7935
+ if (!b(Og, e)) break;
7936
+ if (!(yield e.config.reconnectHandler({ reconnectRetries: b(Ag, e) }))) {
7894
7937
  e.emitter.emit("error", s());
7895
7938
  break;
7896
7939
  }
7897
- if (yield pn(1e3), !b(hg, e)) break;
7940
+ if (yield pn(1e3), !b(Og, e)) break;
7898
7941
  }
7899
- x(gg, e, void 0);
7942
+ x(kg, e, void 0);
7900
7943
  })();
7901
7944
  }
7902
- e(Tg, "PING_TIMEOUT", 1e3), e(Tg, "create", (e, t, n) => new pg(e, t, n));
7945
+ e(Rg, "PING_TIMEOUT", 1e3), e(Rg, "create", (e, t, n) => new Eg(e, t, n));
7903
7946
  //#endregion
7904
7947
  //#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
7905
- var Dg, Og = () => ({
7948
+ var Bg, Vg = () => ({
7906
7949
  video: C(C({}, yn()), {}, { bitRate: vn() }),
7907
7950
  audio: { bitRate: vn() }
7908
- }), kg = () => ({
7951
+ }), Hg = () => ({
7909
7952
  width: window.innerWidth,
7910
7953
  height: window.innerHeight,
7911
7954
  bitRate: vn()
7912
- }), Ag = class t {
7955
+ }), Ug = class t {
7913
7956
  constructor(n, r, i, a) {
7914
7957
  e(this, "emitter", void 0), e(this, "timers", new j()), e(this, "pictureInPictureSource", void 0), e(this, "element", void 0), e(this, "currentCap", void 0), e(this, "userSpecifiedCap", void 0), e(this, "renditionLevelSource", void 0), e(this, "resizeObserver", void 0), e(this, "elementSize", void 0), e(this, "_sizeBasedResolutionCapEnabled", void 0), e(this, "unload", () => {
7915
7958
  var e;
@@ -7931,7 +7974,7 @@ var Dg, Og = () => ({
7931
7974
  this.timers.unload();
7932
7975
  }), e(this, "setUserSpecifiedCap", (e) => {
7933
7976
  var t;
7934
- let n = (t = this.getUserSpecifiedCap()) == null ? Og() : t;
7977
+ let n = (t = this.getUserSpecifiedCap()) == null ? Vg() : t;
7935
7978
  this.userSpecifiedCap = C(C({}, n), {}, {
7936
7979
  video: C(C({}, n.video), e.video),
7937
7980
  audio: C(C({}, n.audio), e.audio)
@@ -7955,7 +7998,7 @@ var Dg, Og = () => ({
7955
7998
  });
7956
7999
  }), e(this, "evaluateConstraintCap", () => {
7957
8000
  var e, t, n, r;
7958
- let i = this.sizeBasedResolutionCapEnabled ? C(C({}, Og()), {}, { video: kg() }) : Og();
8001
+ let i = this.sizeBasedResolutionCapEnabled ? C(C({}, Vg()), {}, { video: Hg() }) : Vg();
7959
8002
  if (!this.resizeObserver) {
7960
8003
  let e = this.element.getBoundingClientRect();
7961
8004
  this.elementSize = {
@@ -7992,14 +8035,14 @@ var Dg, Og = () => ({
7992
8035
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
7993
8036
  }
7994
8037
  };
7995
- Dg = Ag, e(Ag, "CHECK_SIZE_INTERVAL", 1e3), e(Ag, "create", (e, t, n, r) => new Dg(e, t, n, r));
8038
+ Bg = Ug, e(Ug, "CHECK_SIZE_INTERVAL", 1e3), e(Ug, "create", (e, t, n, r) => new Bg(e, t, n, r));
7996
8039
  //#endregion
7997
8040
  //#region ../../libs/web-sdk/src/modules/DecoderModule.ts
7998
- var jg = 5, Mg = 100, Ng = 1e3, Pg = class r {
8041
+ var Wg = 5, Gg = 100, Kg = 1e3, qg = class r {
7999
8042
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
8000
8043
  e(this, "timers", j.create()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), e(this, "isSuspended", !1), e(this, "_webCodecsInUse", void 0), e(this, "_audioWebCodecsInUse", void 0), e(this, "_offscreenCanvasInUse", void 0), e(this, "decodedVideoSamplesInCurrentInterval", 0), e(this, "currentVideoDecodeRate", 2 ** 53 - 1), e(this, "isAudioEmitRetryScheduled", !1), e(this, "videoKeyframeTimestamps", []), e(this, "load", () => {
8001
- let e = this._audioWebCodecsInUse ? 20 : Mg;
8002
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, Ng), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8044
+ let e = this._audioWebCodecsInUse ? 20 : Gg;
8045
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, Kg), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8003
8046
  }), e(this, "unload", () => {
8004
8047
  this.trackContexts.forEach(({ decoderContext: e }) => e.unload()), this.timers.unload(), this.isAudioEmitRetryScheduled = !1, this.videoKeyframeTimestamps = [], this.emitter.off("init segment", this.onInitSegment), this.emitter.off("coded sample", this.decode);
8005
8048
  }), e(this, "suspend", () => {
@@ -8016,7 +8059,7 @@ var jg = 5, Mg = 100, Ng = 1e3, Pg = class r {
8016
8059
  if (!t) return 2 ** 53 - 1;
8017
8060
  let n = (e = t.sampleDuration) == null ? 40 : e;
8018
8061
  if (!Number.isFinite(n) || n <= 0) return 0;
8019
- let r = 1e3 / n, i = this.decodedVideoSamplesInCurrentInterval * 1e3 / Ng / r;
8062
+ let r = 1e3 / n, i = this.decodedVideoSamplesInCurrentInterval * 1e3 / Kg / r;
8020
8063
  return !Number.isFinite(i) || i < 0 ? 0 : i;
8021
8064
  }), e(this, "getStatistics", () => {
8022
8065
  var e, t, n, r, i;
@@ -8058,7 +8101,7 @@ var jg = 5, Mg = 100, Ng = 1e3, Pg = class r {
8058
8101
  if (this.isSuspended) return;
8059
8102
  t.sampleDuration = e.duration / e.timescale * 1e3;
8060
8103
  let n = e.compositionTimeOffset || 0, { decoderContext: r, buffer: i } = t, a = (e.timestamp + n) / e.timescale * 1e3, o = e.duration / e.timescale * 1e3, s = i[i.length - 1];
8061
- if (!s || a - jg > s.end ? i.push({
8104
+ if (!s || a - Wg > s.end ? i.push({
8062
8105
  start: a,
8063
8106
  end: a + o
8064
8107
  }) : a + o * 5 < s.end ? (t.buffer = [{
@@ -8174,7 +8217,7 @@ var jg = 5, Mg = 100, Ng = 1e3, Pg = class r {
8174
8217
  return new r(e, i, t, s, p, m, h);
8175
8218
  })();
8176
8219
  }
8177
- }, Fg, Ig = class {
8220
+ }, Jg, Yg = class {
8178
8221
  constructor(t) {
8179
8222
  e(this, "emitter", void 0), e(this, "isVisibleCount", 0), e(this, "isHiddenCount", 0), e(this, "isOnlineCount", 0), e(this, "isOfflineCount", 0), e(this, "isActive", document.visibilityState === "visible"), e(this, "unload", () => {
8180
8223
  document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -8208,12 +8251,12 @@ var jg = 5, Mg = 100, Ng = 1e3, Pg = class r {
8208
8251
  return document.visibilityState === "visible";
8209
8252
  }
8210
8253
  };
8211
- Fg = Ig, e(Ig, "create", (e) => new Fg(e));
8254
+ Jg = Yg, e(Yg, "create", (e) => new Jg(e));
8212
8255
  //#endregion
8213
8256
  //#region ../../libs/web-sdk/src/modules/EventModule.ts
8214
- var Lg, Rg = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, zg = class t {
8257
+ var Xg, Zg = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, Qg = class t {
8215
8258
  constructor(n, r, i) {
8216
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", Rg(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8259
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", Zg(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8217
8260
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8218
8261
  }), e(this, "unload", () => {
8219
8262
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -8240,10 +8283,10 @@ var Lg, Rg = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
8240
8283
  }), this.logger = r, this.emitter = n, this.timeSource = i;
8241
8284
  }
8242
8285
  };
8243
- Lg = zg, e(zg, "EVENT_TIMEOUT", 5e3), e(zg, "EVENT_CHECK_INTERVAL", 20), e(zg, "create", (e, t, n) => new Lg(e, t, n));
8286
+ Xg = Qg, e(Qg, "EVENT_TIMEOUT", 5e3), e(Qg, "EVENT_CHECK_INTERVAL", 20), e(Qg, "create", (e, t, n) => new Xg(e, t, n));
8244
8287
  //#endregion
8245
8288
  //#region ../../libs/web-sdk/src/modules/IncomingDataModule.ts
8246
- var Bg, Vg = class t {
8289
+ var $g, e_ = class t {
8247
8290
  constructor(n) {
8248
8291
  e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "bytesReceived", /* @__PURE__ */ new Map()), e(this, "timeoutInterval", void 0), e(this, "lastBytesUpdated", Date.now()), e(this, "load", () => {
8249
8292
  this.emitter.on("connection state", this.onConnectionState), this.timers.setInterval(() => this.bytesReceived.forEach((e) => e.tick()), 100);
@@ -8278,10 +8321,10 @@ var Bg, Vg = class t {
8278
8321
  }), this.emitter = n;
8279
8322
  }
8280
8323
  };
8281
- Bg = Vg, e(Vg, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(Vg, "NO_DATA_TIMEOUT", 5 * 1e3), e(Vg, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(Vg, "create", (e) => new Bg(e));
8324
+ $g = e_, e(e_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(e_, "NO_DATA_TIMEOUT", 5 * 1e3), e(e_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(e_, "create", (e) => new $g(e));
8282
8325
  //#endregion
8283
8326
  //#region ../../libs/web-sdk/src/modules/JitterModule.ts
8284
- var Hg = 1e3, Ug = 50, Wg = class t {
8327
+ var t_ = 1e3, n_ = 50, r_ = class t {
8285
8328
  constructor(t) {
8286
8329
  e(this, "logger", void 0), e(this, "trackingState", /* @__PURE__ */ new Map()), e(this, "runningJitter", /* @__PURE__ */ new Map()), e(this, "recentJitterSamples", /* @__PURE__ */ new Map()), e(this, "load", () => {
8287
8330
  this.logger.debug("JitterModule loaded");
@@ -8302,9 +8345,9 @@ var Hg = 1e3, Ug = 50, Wg = class t {
8302
8345
  this.trackingState.set(a, {
8303
8346
  lastArrivalTime: o,
8304
8347
  lastTimestampMs: s,
8305
- jitterSamples: new _(Hg),
8306
- interArrivalTimes: new _(Hg)
8307
- }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(Ug));
8348
+ jitterSamples: new _(t_),
8349
+ interArrivalTimes: new _(t_)
8350
+ }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(n_));
8308
8351
  return;
8309
8352
  }
8310
8353
  let l = s - c.lastTimestampMs;
@@ -8317,7 +8360,7 @@ var Hg = 1e3, Ug = 50, Wg = class t {
8317
8360
  let f = (i = this.runningJitter.get(a)) == null ? 0 : i, p = f + (d - f) / 16;
8318
8361
  this.runningJitter.set(a, p);
8319
8362
  let m = this.recentJitterSamples.get(a);
8320
- m || (m = new _(Ug), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8363
+ m || (m = new _(n_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8321
8364
  }
8322
8365
  getJitterForType(e) {
8323
8366
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -8348,10 +8391,10 @@ var Hg = 1e3, Ug = 50, Wg = class t {
8348
8391
  videoJitter: this.getJitterForType("video")
8349
8392
  };
8350
8393
  }
8351
- }, Gg = () => window.AudioContext || window.webkitAudioContext, Kg = class n extends _e {
8394
+ }, i_ = () => window.AudioContext || window.webkitAudioContext, a_ = class n extends _e {
8352
8395
  constructor() {
8353
8396
  var r;
8354
- super(), r = this, e(this, "context", new (Gg())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
8397
+ super(), r = this, e(this, "context", new (i_())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
8355
8398
  try {
8356
8399
  return yield Promise.race([r.context.resume(), mn(1e3, p())]);
8357
8400
  } catch (e) {
@@ -8380,10 +8423,10 @@ var Hg = 1e3, Ug = 50, Wg = class t {
8380
8423
  return this.context.state;
8381
8424
  }
8382
8425
  };
8383
- e(Kg, "CHECK_INTERVAL", 1e3);
8426
+ e(a_, "CHECK_INTERVAL", 1e3);
8384
8427
  //#endregion
8385
8428
  //#region ../../libs/web-audio-player/src/AudioPlayer.ts
8386
- var qg, Jg = 400, Yg = class extends _e {
8429
+ var o_, s_ = 400, c_ = class extends _e {
8387
8430
  get isContextRunning() {
8388
8431
  var e;
8389
8432
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -8507,14 +8550,14 @@ var qg, Jg = 400, Yg = class extends _e {
8507
8550
  }
8508
8551
  })), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
8509
8552
  var e, t, n;
8510
- return (e = this.audio) == null || e.unload(), this.audio = new Kg(), this.audio.on("state", (e) => {
8553
+ return (e = this.audio) == null || e.unload(), this.audio = new a_(), this.audio.on("state", (e) => {
8511
8554
  this.logger.info("AudioContext state change", { state: e }), e === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), !this.ignoreSuspendCalls && this.emit("state change", e);
8512
8555
  }), this.audio.on("stuck", () => {
8513
8556
  this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(o), this.emit("stuck"));
8514
8557
  }), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (n = this.splitter) == null || n.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
8515
8558
  }), e(this, "setGain", (e) => {
8516
8559
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
8517
- }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this.audioBufferMultiplier = s !== void 0 && s < Jg ? 2 : 5;
8560
+ }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this.audioBufferMultiplier = s !== void 0 && s < s_ ? 2 : 5;
8518
8561
  }
8519
8562
  useMediaStreamDestination() {
8520
8563
  var e;
@@ -8527,10 +8570,10 @@ var qg, Jg = 400, Yg = class extends _e {
8527
8570
  return (e = this.gainNode) == null || e.connect(t), t;
8528
8571
  }
8529
8572
  };
8530
- qg = Yg, e(Yg, "create", (e, t, n) => new qg(e, t, n));
8573
+ o_ = c_, e(c_, "create", (e, t, n) => new o_(e, t, n));
8531
8574
  //#endregion
8532
8575
  //#region ../../libs/web-sdk/src/players/VideoPlayer.ts
8533
- var Xg, Zg = class {
8576
+ var l_, u_ = class {
8534
8577
  constructor(t, n, r, i, a, o) {
8535
8578
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new rr()), e(this, "videoFrameCanvas2DRenderer", null), e(this, "renderQueue", []), e(this, "clockSource", void 0), e(this, "isFirstFrame", !0), e(this, "usingWebCodecs", !1), e(this, "onCanvasChangeCallback", void 0), e(this, "onRendererErrorCallback", void 0), e(this, "animationFrameRequest", void 0), e(this, "firstFrameAnimationFrameRequest", void 0), e(this, "pendingFirstFrameSample", void 0), e(this, "renderedFrameCount", 0), e(this, "rendererDroppedFrameCount", 0), e(this, "renderTargetSize", void 0), e(this, "load", () => {
8536
8579
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -8620,12 +8663,12 @@ var Xg, Zg = class {
8620
8663
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
8621
8664
  }
8622
8665
  };
8623
- Xg = Zg, e(Zg, "create", (e, t, n, r, i, a) => new Xg(e, t, n, r, i, a));
8666
+ l_ = u_, e(u_, "create", (e, t, n, r, i, a) => new l_(e, t, n, r, i, a));
8624
8667
  //#endregion
8625
8668
  //#region ../../libs/web-sdk/src/TextTracks.ts
8626
- var Qg = /* @__PURE__ */ new WeakMap(), $g = class {
8669
+ var d_ = /* @__PURE__ */ new WeakMap(), f_ = class {
8627
8670
  constructor() {
8628
- v(this, Qg, []), x(Qg, this, []);
8671
+ v(this, d_, []), x(d_, this, []);
8629
8672
  }
8630
8673
  addTextTrack(e, t, n) {
8631
8674
  let r = [], i = {
@@ -8642,37 +8685,37 @@ var Qg = /* @__PURE__ */ new WeakMap(), $g = class {
8642
8685
  t !== -1 && r.splice(t, 1);
8643
8686
  }
8644
8687
  };
8645
- return b(Qg, this).push(i), i;
8688
+ return b(d_, this).push(i), i;
8646
8689
  }
8647
8690
  set language(e) {
8648
- b(Qg, this).forEach((t) => {
8691
+ b(d_, this).forEach((t) => {
8649
8692
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
8650
8693
  });
8651
8694
  }
8652
8695
  get language() {
8653
8696
  var e;
8654
- return (e = b(Qg, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8697
+ return (e = b(d_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8655
8698
  }
8656
8699
  getActiveCues(e) {
8657
- let t = b(Qg, this).find((e) => e.mode === "showing");
8700
+ let t = b(d_, this).find((e) => e.mode === "showing");
8658
8701
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e <= n) : [];
8659
8702
  }
8660
- }, e_ = (e, t) => {
8703
+ }, p_ = (e, t) => {
8661
8704
  let n;
8662
8705
  for (n = t; e > 1; e--) n += t;
8663
8706
  return n;
8664
- }, t_ = class {
8707
+ }, m_ = class {
8665
8708
  constructor() {
8666
8709
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(o));
8667
8710
  let t = document.createElement("div");
8668
8711
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8669
8712
  let n = t.children.item(0);
8670
- if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + e_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + e_(16, "gICA") + e_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + e_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + e_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + e_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + e_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8713
+ if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + p_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + p_(16, "gICA") + p_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + p_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + p_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + p_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + p_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8671
8714
  else throw Error("Failed to create audio tag");
8672
8715
  }
8673
- }, n_, r_ = class {
8716
+ }, h_, g_ = class {
8674
8717
  constructor(t, n, r, i, a, o, s, c) {
8675
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new t_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new $g()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8718
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new m_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new f_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8676
8719
  this.audioPlayer.useDefaultDestination(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.isLoaded = !0, this.isVideoRenderingEnabled && (this.videoPlayer.load(), this.isVideoPlayerLoaded = !0, this.startTextTrackInterval());
8677
8720
  }), e(this, "unload", () => {
8678
8721
  this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.audioPlayer.unload(), this.isVideoPlayerLoaded && (this.videoPlayer.unload(), this.isVideoPlayerLoaded = !1), this.timers.unload(), this.isLoaded = !1;
@@ -8706,7 +8749,7 @@ var Qg = /* @__PURE__ */ new WeakMap(), $g = class {
8706
8749
  e instanceof Error && this.emitter.emit("error", re(!1, e));
8707
8750
  }
8708
8751
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
8709
- }), this.logger = n, this.emitter = t, this.pool = r, this.audioPlayer = Yg.create(this.logger.createContext("AudioPlayerModule"), i, {
8752
+ }), this.logger = n, this.emitter = t, this.pool = r, this.audioPlayer = c_.create(this.logger.createContext("AudioPlayerModule"), i, {
8710
8753
  muted: a,
8711
8754
  reInitWhenStuck: !0,
8712
8755
  bufferTime: c
@@ -8717,7 +8760,7 @@ var Qg = /* @__PURE__ */ new WeakMap(), $g = class {
8717
8760
  volume: this.volume,
8718
8761
  isMuted: this.muted
8719
8762
  });
8720
- }), this.videoPlayer = Zg.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8763
+ }), this.videoPlayer = u_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8721
8764
  }
8722
8765
  get volume() {
8723
8766
  return this.audioPlayer.volume;
@@ -8773,12 +8816,12 @@ var Qg = /* @__PURE__ */ new WeakMap(), $g = class {
8773
8816
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
8774
8817
  }
8775
8818
  };
8776
- n_ = r_, e(r_, "create", (e, t, n, r, i, a, o, s) => new n_(e, t, n, r, i, a, o, s));
8819
+ h_ = g_, e(g_, "create", (e, t, n, r, i, a, o, s) => new h_(e, t, n, r, i, a, o, s));
8777
8820
  //#endregion
8778
8821
  //#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
8779
- var i_, a_ = class {
8822
+ var __, v_ = class {
8780
8823
  constructor(t, n, r, i, { muted: a, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d }) {
8781
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new $g()), e(this, "reset", () => {}), e(this, "load", () => {
8824
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new f_()), e(this, "reset", () => {}), e(this, "load", () => {
8782
8825
  this.mediaElement.load(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("ios-hack: reset size", this.resetCanvasSize), this.emitter.on("enter picture in picture", this.onEnterIOSHack), this.emitter.on("exit picture in picture", this.onExitIOSHack), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.nativeTextTrack = this.mediaElement.element.addTextTrack("subtitles", "", ""), this.nativeTextTrack.mode = "showing", this.timers.setInterval(() => {
8783
8826
  if (!this.textTracks.language) {
8784
8827
  this.clearNativeTrackCues();
@@ -8863,7 +8906,7 @@ var i_, a_ = class {
8863
8906
  this.updateVolumeState(), !e.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(o), e.isMuted || (this._userProvidedMuted = !1);
8864
8907
  }), this.mediaElement.on("media element state", (e) => {
8865
8908
  e === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", e);
8866
- }), this.audioPlayer = Yg.create(this.logger.createContext("AudioPlayerModule"), i, {
8909
+ }), this.audioPlayer = c_.create(this.logger.createContext("AudioPlayerModule"), i, {
8867
8910
  muted: !1,
8868
8911
  reInitWhenStuck: !1,
8869
8912
  bufferTime: d
@@ -8871,7 +8914,7 @@ var i_, a_ = class {
8871
8914
  this.isDisconnected = !0;
8872
8915
  }), this.audioPlayer.on("state change", (e) => {
8873
8916
  e === "suspended" || e === "interrupted" ? this.mediaElement.muted = !0 : e === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
8874
- }), this.videoPlayer = Zg.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
8917
+ }), this.videoPlayer = u_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
8875
8918
  volume: this.volume,
8876
8919
  isMuted: this.muted
8877
8920
  };
@@ -8929,10 +8972,10 @@ var i_, a_ = class {
8929
8972
  this.mediaElement.pause();
8930
8973
  }
8931
8974
  };
8932
- i_ = a_, e(a_, "create", (e, t, n, r, i) => new i_(e, t, n, r, i));
8975
+ __ = v_, e(v_, "create", (e, t, n, r, i) => new __(e, t, n, r, i));
8933
8976
  //#endregion
8934
8977
  //#region ../../libs/mse/src/AsyncSourceBuffer.ts
8935
- var o_ = () => (e) => s_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), s_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), c_ = (e) => (t) => t.appendBuffer(e), l_ = (e) => (t) => t.changeType(e), u_ = (e) => (t) => e(t), d_ = class {
8978
+ var y_ = () => (e) => b_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), b_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), x_ = (e) => (t) => t.appendBuffer(e), S_ = (e) => (t) => t.changeType(e), C_ = (e) => (t) => e(t), w_ = class {
8936
8979
  constructor(t) {
8937
8980
  e(this, "commandQueue", []), e(this, "sourceBuffer", void 0), e(this, "currentInit", void 0), e(this, "handleQueue", () => {
8938
8981
  if (!this.sourceBuffer.updating) {
@@ -8941,28 +8984,28 @@ var o_ = () => (e) => s_(e.buffered.start(0), e.buffered.end(e.buffered.length -
8941
8984
  }
8942
8985
  }), e(this, "appendBuffer", (e, t) => new Promise((n, r) => {
8943
8986
  if (t && this.currentInit !== t) {
8944
- let e = new Dt(c_(t), n, r);
8987
+ let e = new Dt(x_(t), n, r);
8945
8988
  this.commandQueue.push(e), this.currentInit = t;
8946
8989
  }
8947
- let i = new Dt(c_(e), n, r);
8990
+ let i = new Dt(x_(e), n, r);
8948
8991
  this.commandQueue.push(i), this.handleQueue();
8949
8992
  })), e(this, "execute", (e) => new Promise((t, n) => {
8950
- let r = new Dt(u_(e), t, n);
8993
+ let r = new Dt(C_(e), t, n);
8951
8994
  this.commandQueue.push(r), this.handleQueue();
8952
8995
  })), e(this, "buffered", () => this.sourceBuffer.buffered), e(this, "removeFromMediaSource", (e) => {
8953
8996
  e.removeSourceBuffer(this.sourceBuffer);
8954
8997
  }), e(this, "changeType", (e) => new Promise((t, n) => {
8955
- let r = new Dt(l_(e), t, n);
8998
+ let r = new Dt(S_(e), t, n);
8956
8999
  this.commandQueue.push(r), this.handleQueue();
8957
9000
  })), e(this, "removeBuffer", (e, t) => new Promise((n, r) => {
8958
- let i = new Dt(s_(e, t), n, r);
9001
+ let i = new Dt(b_(e, t), n, r);
8959
9002
  this.commandQueue.push(i), this.handleQueue();
8960
9003
  })), e(this, "flush", () => new Promise((e, t) => {
8961
- let n = new Dt(o_, e, t);
9004
+ let n = new Dt(y_, e, t);
8962
9005
  this.commandQueue.push(n), this.handleQueue();
8963
9006
  })), this.sourceBuffer = t, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
8964
9007
  }
8965
- }, f_ = class extends _e {
9008
+ }, T_ = class extends _e {
8966
9009
  constructor() {
8967
9010
  super(), e(this, "MediaSource", Ve()), e(this, "mediaSource", new this.MediaSource()), e(this, "isOpen", () => this.mediaSource.readyState === "open"), e(this, "isClosed", () => this.mediaSource.readyState === "closed"), e(this, "isEnded", () => this.mediaSource.readyState === "ended"), e(this, "createObjectURL", () => URL.createObjectURL(this.mediaSource)), e(this, "attach", (e) => {
8968
9011
  let t = e;
@@ -8978,7 +9021,7 @@ var o_ = () => (e) => s_(e.buffered.start(0), e.buffered.end(e.buffered.length -
8978
9021
  this.mediaSource.endOfStream();
8979
9022
  } catch (e) {}
8980
9023
  e.srcObject && (e.srcObject = null), e.src !== "" && (URL.revokeObjectURL(e.src), e.removeAttribute("src")), e.load();
8981
- }), e(this, "addSourceBuffer", (e) => new d_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9024
+ }), e(this, "addSourceBuffer", (e) => new w_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
8982
9025
  e.removeFromMediaSource(this.mediaSource);
8983
9026
  }), e(this, "endOfStream", (e) => {
8984
9027
  this.mediaSource.endOfStream(e);
@@ -8995,13 +9038,13 @@ var o_ = () => (e) => s_(e.buffered.start(0), e.buffered.end(e.buffered.length -
8995
9038
  }), this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
8996
9039
  }
8997
9040
  };
8998
- e(f_, "isTypeSupported", (e) => {
9041
+ e(T_, "isTypeSupported", (e) => {
8999
9042
  var t, n;
9000
9043
  return (t = (n = Ve()) == null ? void 0 : n.isTypeSupported(e)) == null ? !1 : t;
9001
9044
  });
9002
9045
  //#endregion
9003
9046
  //#region ../../libs/web-sdk/src/modules/MseModule.ts
9004
- var p_, m_ = class {
9047
+ var E_, D_ = class {
9005
9048
  constructor() {
9006
9049
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
9007
9050
  var r;
@@ -9013,7 +9056,7 @@ var p_, m_ = class {
9013
9056
  });
9014
9057
  }
9015
9058
  };
9016
- function h_(e, { mediaSource: t, mimeType: n, codec: r }) {
9059
+ function O_(e, { mediaSource: t, mimeType: n, codec: r }) {
9017
9060
  return C(C({}, e), {}, {
9018
9061
  state: "initialized",
9019
9062
  mimeType: n,
@@ -9025,10 +9068,10 @@ function h_(e, { mediaSource: t, mimeType: n, codec: r }) {
9025
9068
  lastBufferCleanupTime: Date.now()
9026
9069
  });
9027
9070
  }
9028
- function g_({ initSegments: e, pendingSamples: t }) {
9071
+ function k_({ initSegments: e, pendingSamples: t }) {
9029
9072
  return {
9030
9073
  state: "uninitialized",
9031
- initSegments: e == null ? new m_() : e,
9074
+ initSegments: e == null ? new D_() : e,
9032
9075
  sequenceNumber: 0,
9033
9076
  isWorkingOnPendingSamples: !1,
9034
9077
  hasFirstSync: !!t,
@@ -9038,10 +9081,10 @@ function g_({ initSegments: e, pendingSamples: t }) {
9038
9081
  successfulAppendCalls: 0
9039
9082
  };
9040
9083
  }
9041
- var __ = class {
9084
+ var A_ = class {
9042
9085
  constructor(n, a, s) {
9043
9086
  var u = this;
9044
- e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new f_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "load", () => {
9087
+ e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new T_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "load", () => {
9045
9088
  this.emitter.on("init segment", this.init), this.emitter.on("coded sample", this.onCodedSample), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("fragment", this.onFragment);
9046
9089
  }), e(this, "unload", () => {
9047
9090
  this.logger.debug("Unloading module..."), this.emitter.off("init segment", this.init), this.emitter.off("coded sample", this.onCodedSample), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("fragment", this.onFragment), this.mediaSource.off("source ended", this.onSourceEnded), this.mediaSource.off("source open", this.onSourceOpen), this.mediaElement.removeEventListener("error", this.onMediaElementError), this.mediaSource.detach(this.mediaElement), this.trackContexts.forEach((e) => {
@@ -9077,7 +9120,7 @@ var __ = class {
9077
9120
  var n, r, i;
9078
9121
  let a = e.get(t), o = (n = a == null ? void 0 : a.pendingSamples) == null ? [] : n, s = a == null ? void 0 : a.initSegments, c = (r = a == null ? void 0 : a.pendingSamplesOffset) == null ? 0 : r;
9079
9122
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
9080
- let l = g_({
9123
+ let l = k_({
9081
9124
  pendingSamples: o,
9082
9125
  initSegments: s
9083
9126
  });
@@ -9103,10 +9146,10 @@ var __ = class {
9103
9146
  }
9104
9147
  for (let t of e) {
9105
9148
  let e = u.trackContexts.get(t.type);
9106
- e || (e = g_({
9149
+ e || (e = k_({
9107
9150
  pendingSamples: [],
9108
- initSegments: new m_()
9109
- }), u.trackContexts.set(t.type, e)), e.state === "initialized" ? t.mimeType !== e.sourceBufferMimeType && (yield e.sourceBuffer.changeType(t.mimeType), e.sourceBufferMimeType = t.mimeType) : u.trackContexts.set(t.type, h_(e, {
9151
+ initSegments: new D_()
9152
+ }), u.trackContexts.set(t.type, e)), e.state === "initialized" ? t.mimeType !== e.sourceBufferMimeType && (yield e.sourceBuffer.changeType(t.mimeType), e.sourceBufferMimeType = t.mimeType) : u.trackContexts.set(t.type, O_(e, {
9110
9153
  mimeType: t.mimeType,
9111
9154
  mediaSource: u.mediaSource,
9112
9155
  codec: t.codec
@@ -9230,7 +9273,7 @@ var __ = class {
9230
9273
  let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
9231
9274
  r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
9232
9275
  }
9233
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || x_(t, this.append, this.maxChunkSize).catch((n) => {
9276
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || P_(t, this.append, this.maxChunkSize).catch((n) => {
9234
9277
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening && n instanceof Error) {
9235
9278
  if (this.logger.error("append failed", {
9236
9279
  message: n.message,
@@ -9273,24 +9316,24 @@ var __ = class {
9273
9316
  }), this.logger = n, this.mediaElement = s, this.emitter = a;
9274
9317
  }
9275
9318
  };
9276
- p_ = __, e(__, "create", (e, t, n) => {
9277
- let r = new p_(e, t, n);
9319
+ E_ = A_, e(A_, "create", (e, t, n) => {
9320
+ let r = new E_(e, t, n);
9278
9321
  return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), r.mediaSource.attach(n), r;
9279
9322
  });
9280
- var v_ = (e, t) => {
9323
+ var j_ = (e, t) => {
9281
9324
  var n;
9282
9325
  let r = e.renditionId !== t.renditionId, i = e.channelId !== t.channelId, a = ((n = e.timestamp) == null ? 0 : n) > t.timestamp, o = e.type === "video" && t.type === "video" && "levelIdc" in e && "levelIdc" in t && e.levelIdc !== t.levelIdc, s = !1;
9283
9326
  return e.type === "video" && t.type === "video" && "width" in e && "width" in t && (s = t.width !== e.width || t.height !== e.height), i || r || a || s || o;
9284
- }, y_ = 32, b_ = (e) => {
9327
+ }, M_ = 32, N_ = (e) => {
9285
9328
  let t = e.pendingSamplesOffset;
9286
9329
  if (t !== 0) {
9287
9330
  if (t >= e.pendingSamples.length) {
9288
9331
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
9289
9332
  return;
9290
9333
  }
9291
- t < y_ || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9334
+ t < M_ || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9292
9335
  }
9293
- }, x_ = function() {
9336
+ }, P_ = function() {
9294
9337
  var e = t(function* (e, t, n) {
9295
9338
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
9296
9339
  let r = [], i = e.pendingSamplesOffset;
@@ -9298,7 +9341,7 @@ var v_ = (e, t) => {
9298
9341
  i = t;
9299
9342
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
9300
9343
  if (a && (r.push(a), o)) {
9301
- if (v_(a, o)) break;
9344
+ if (j_(a, o)) break;
9302
9345
  let e = (a.timestamp + a.duration) / a.timescale;
9303
9346
  if (o.timestamp / o.timescale - e > .1) break;
9304
9347
  }
@@ -9306,14 +9349,14 @@ var v_ = (e, t) => {
9306
9349
  }
9307
9350
  let a = r[0];
9308
9351
  if (!a) break;
9309
- yield t(r, e.previousSample ? v_(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], b_(e);
9352
+ yield t(r, e.previousSample ? j_(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], N_(e);
9310
9353
  }
9311
9354
  e.isWorkingOnPendingSamples = !1;
9312
9355
  });
9313
9356
  return function(t, n, r) {
9314
9357
  return e.apply(this, arguments);
9315
9358
  };
9316
- }(), S_, C_ = class {
9359
+ }(), F_, I_ = class {
9317
9360
  constructor(n, r) {
9318
9361
  var i = this;
9319
9362
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -9345,10 +9388,10 @@ var v_ = (e, t) => {
9345
9388
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && xt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
9346
9389
  }
9347
9390
  };
9348
- S_ = C_, e(C_, "create", (e, t) => new S_(e, t));
9391
+ F_ = I_, e(I_, "create", (e, t) => new F_(e, t));
9349
9392
  //#endregion
9350
9393
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
9351
- var w_, T_ = class {
9394
+ var L_, R_ = class {
9352
9395
  constructor(t, n, r, i) {
9353
9396
  e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "clockSource", void 0), e(this, "state", "buffering"), e(this, "bufferFullness", 0), e(this, "targetBufferTime", void 0), e(this, "lastBufferStateEvent", "drained"), e(this, "firstFrameTime", void 0), e(this, "currentTimeIsInRange", !1), e(this, "needsInputForAudioCount", 0), e(this, "needsInputForVideoCount", 0), e(this, "unload", () => {
9354
9397
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -9366,24 +9409,24 @@ var w_, T_ = class {
9366
9409
  }), this.emitter = t, this.logger = n, this.clockSource = r, this.targetBufferTime = i, this.emitter.on("buffer state", this.onBufferedStateChanged), this.emitter.on("needs user input", this.onNeedsUserInput), this.emitter.emit("target buffer time", i);
9367
9410
  }
9368
9411
  };
9369
- w_ = T_, e(T_, "create", (e, t, n, r) => new w_(e, t, n, r));
9412
+ L_ = R_, e(R_, "create", (e, t, n, r) => new L_(e, t, n, r));
9370
9413
  //#endregion
9371
9414
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
9372
- var E_, D_ = () => ({
9415
+ var z_, B_ = () => ({
9373
9416
  upgradesFromLevel: [],
9374
9417
  downgradesFromLevel: [],
9375
9418
  bufferingRanges: [],
9376
9419
  activeRanges: [],
9377
9420
  decodeRate: 2 ** 53 - 1
9378
- }), O_ = () => ({
9421
+ }), V_ = () => ({
9379
9422
  levels: {},
9380
9423
  levelDowngrades: [],
9381
9424
  levelUpgrades: [],
9382
9425
  bufferFullness: 0,
9383
- general: D_()
9384
- }), k_ = class {
9426
+ general: B_()
9427
+ }), H_ = class {
9385
9428
  constructor(t, n, r) {
9386
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", O_()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
9429
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", V_()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
9387
9430
  this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("target buffer time", this.onTargetBufferTime);
9388
9431
  }), e(this, "unload", () => {
9389
9432
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("target buffer time", this.onTargetBufferTime), this.suspend();
@@ -9451,14 +9494,14 @@ var E_, D_ = () => ({
9451
9494
  let d = !1;
9452
9495
  if (e.from) {
9453
9496
  var f;
9454
- let e = (f = this.metrics.levels[l]) == null ? D_() : f;
9497
+ let e = (f = this.metrics.levels[l]) == null ? B_() : f;
9455
9498
  l < u ? e.upgradesFromLevel.push(Date.now()) : e.downgradesFromLevel.push(Date.now()), on(e.activeRanges);
9456
9499
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
9457
9500
  d = !!t && !t.end, on(e.bufferingRanges), this.metrics.levels[l] = e;
9458
9501
  }
9459
9502
  if (e.to) {
9460
9503
  var p;
9461
- let e = (p = this.metrics.levels[u]) == null ? D_() : p;
9504
+ let e = (p = this.metrics.levels[u]) == null ? B_() : p;
9462
9505
  sn(e.activeRanges), d && sn(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
9463
9506
  }
9464
9507
  }), e(this, "onBufferFullness", (e) => {
@@ -9527,10 +9570,10 @@ var E_, D_ = () => ({
9527
9570
  sn(this.metrics.general.activeRanges);
9528
9571
  }
9529
9572
  };
9530
- E_ = k_, e(k_, "create", (e, t, n) => new E_(e, t, n));
9573
+ z_ = H_, e(H_, "create", (e, t, n) => new z_(e, t, n));
9531
9574
  //#endregion
9532
9575
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
9533
- var A_, j_ = class {
9576
+ var U_, W_ = class {
9534
9577
  constructor(t, n) {
9535
9578
  e(this, "renditions", /* @__PURE__ */ new Map()), e(this, "renditionLevels", []), e(this, "languages", []), e(this, "emitter", void 0), e(this, "subscriptionSource", void 0), e(this, "renditionLevelChangeCount", 0), e(this, "unload", () => {
9536
9579
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -9605,10 +9648,10 @@ var A_, j_ = class {
9605
9648
  }), e(this, "getCurrentSubscription", () => this.subscriptionSource.getCurrentSubscription()), this.subscriptionSource = n, this.emitter = t, this.emitter.on("renditions", this.onRenditions), this.emitter.on("subscription changed", this.onSubscriptionChanged);
9606
9649
  }
9607
9650
  };
9608
- A_ = j_, e(j_, "create", (e, t) => new A_(e, t));
9651
+ U_ = W_, e(W_, "create", (e, t) => new U_(e, t));
9609
9652
  //#endregion
9610
9653
  //#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
9611
- var M_, N_ = (e) => JSON.parse(JSON.stringify(e)), P_ = 1e4, F_ = class {
9654
+ var G_, K_ = (e) => JSON.parse(JSON.stringify(e)), q_ = 1e4, J_ = class {
9612
9655
  constructor(t, n, r) {
9613
9656
  e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "targetSubscription", void 0), e(this, "currentSubscription", void 0), e(this, "_isSwitchingSubscription", !1), e(this, "pendingSubscriptionTimeoutId", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
9614
9657
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -9646,23 +9689,23 @@ var M_, N_ = (e) => JSON.parse(JSON.stringify(e)), P_ = 1e4, F_ = class {
9646
9689
  this.logger.debug("onSubscriptionChanged", {
9647
9690
  to: e,
9648
9691
  reset: t
9649
- }), t ? this.targetSubscription = N_(this.currentSubscription) : this.currentSubscription = N_(e), this._isSwitchingSubscription = this.isNewSubscription();
9692
+ }), t ? this.targetSubscription = K_(this.currentSubscription) : this.currentSubscription = K_(e), this._isSwitchingSubscription = this.isNewSubscription();
9650
9693
  }), e(this, "scheduleSubscriptionChange", () => {
9651
- this.targetSubscription = N_(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9694
+ this.targetSubscription = K_(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9652
9695
  let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
9653
9696
  this._isSwitchingSubscription && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), n && this.timers.setTimeout(() => {
9654
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = N_(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9655
- }, P_), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9697
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = K_(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9698
+ }, q_), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9656
9699
  type: "subscribe",
9657
9700
  subscription: this.getTargetSubscription()
9658
9701
  }), 0));
9659
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = N_(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9702
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = K_(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9660
9703
  }
9661
9704
  };
9662
- M_ = F_, e(F_, "create", (e, t, n) => new M_(e, n, t));
9705
+ G_ = J_, e(J_, "create", (e, t, n) => new G_(e, n, t));
9663
9706
  //#endregion
9664
9707
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
9665
- var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) => (t) => t > e, V_ = {
9708
+ var Y_, X_ = 5e3, Z_ = () => Ye() || Ke(), Q_ = () => Z_() ? 100 : 0, $_ = (e) => (t) => t > e, ev = {
9666
9709
  seek: {
9667
9710
  toleranceMs: 200,
9668
9711
  toleranceMaxMs: 2500,
@@ -9694,7 +9737,7 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9694
9737
  decayCooldownMultiplier: 3,
9695
9738
  decayCheckInterval: 15e3
9696
9739
  }
9697
- }, H_ = class {
9740
+ }, tv = class {
9698
9741
  get driftSamplesToAverage() {
9699
9742
  return this._driftSamplesToAverage;
9700
9743
  }
@@ -9702,7 +9745,7 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9702
9745
  this._driftSamplesToAverage = e, this.driftSamples = new _(e);
9703
9746
  }
9704
9747
  constructor(t, n, r, i, a) {
9705
- e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new _(10)), e(this, "lastSeekTime", Date.now()), e(this, "lastAdjustmentTime", Date.now()), e(this, "lastDecayCheckTime", Date.now()), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", z_()), e(this, "timers", j.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToAverage", 5), e(this, "driftSamples", new _(this._driftSamplesToAverage)), e(this, "timestampOffset", void 0), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "load", () => {
9748
+ e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new _(10)), e(this, "lastSeekTime", Date.now()), e(this, "lastAdjustmentTime", Date.now()), e(this, "lastDecayCheckTime", Date.now()), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", Q_()), e(this, "timers", j.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToAverage", 5), e(this, "driftSamples", new _(this._driftSamplesToAverage)), e(this, "timestampOffset", void 0), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "load", () => {
9706
9749
  this.timers.setInterval(this.onSync, 100);
9707
9750
  }), e(this, "unload", () => {
9708
9751
  this.logger.debug("Unloading module..."), this.emitter.off("rtt", this.updateRtt), this.timers.unload(), this.logger.debug("Unloaded module");
@@ -9740,7 +9783,7 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9740
9783
  }), e(this, "processSample", (e) => {
9741
9784
  var t;
9742
9785
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
9743
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - L_);
9786
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - X_);
9744
9787
  let n = e.type === "video" && e.isSync;
9745
9788
  if (this.currentChannelId !== e.channelId) {
9746
9789
  let t = 2 ** 53 - 1;
@@ -9757,7 +9800,7 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9757
9800
  this.currentChannelId || (this.currentChannelId = e);
9758
9801
  let r = t.mediaType();
9759
9802
  if (!r) throw Error("Fragment must have a media type");
9760
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - L_);
9803
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - X_);
9761
9804
  let i = t.mediaType() === "video" && t.startsWithKeyframe();
9762
9805
  if (this.currentChannelId !== e) {
9763
9806
  let t = 2 ** 53 - 1;
@@ -9865,7 +9908,7 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9865
9908
  return;
9866
9909
  }
9867
9910
  if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
9868
- let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(B_(r)).length;
9911
+ let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter($_(r)).length;
9869
9912
  if (i && this.state.timeshiftToleranceMultiplier > 2) {
9870
9913
  this.logger.info("Too many timeshifts within sliding window", {
9871
9914
  timeshiftCooldownThreshold: r,
@@ -9912,7 +9955,7 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9912
9955
  if (this.driftSamples.push(t), this.driftSamples.items().length < this.driftSamplesToAverage && Math.abs(t) < 2e3) return;
9913
9956
  let n = Ot(this.driftSamples.items());
9914
9957
  if (this.tryPlaybackRateSync(n) || n < 0 && -n < this.currentAheadToleranceMs() || n > 0 && n < this.currentSeekToleranceMs() || Math.abs(n) < 1 || !this.isSeekCooldownExpired()) return;
9915
- let r = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, i = this.seekAdjustmentTimestamps.filter(B_(r)).length;
9958
+ let r = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, i = this.seekAdjustmentTimestamps.filter($_(r)).length;
9916
9959
  if (i && this.state.seekToleranceMultiplier > 2) {
9917
9960
  this.logger.info("Too many seek adjustments within sliding window", {
9918
9961
  seekCooldownThreshold: r,
@@ -9928,10 +9971,10 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9928
9971
  if (t && r) return n;
9929
9972
  }
9930
9973
  }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.config = {
9931
- seek: C({}, V_.seek),
9932
- timeshift: C({}, V_.timeshift),
9933
- playbackRate: C({}, V_.playbackRate),
9934
- backoff: C({}, V_.backoff)
9974
+ seek: C({}, ev.seek),
9975
+ timeshift: C({}, ev.timeshift),
9976
+ playbackRate: C({}, ev.playbackRate),
9977
+ backoff: C({}, ev.backoff)
9935
9978
  }, this.config.timeshift.enabled = a, this.state = {
9936
9979
  seekToleranceMultiplier: 1,
9937
9980
  timeshiftToleranceMultiplier: 1
@@ -9987,10 +10030,10 @@ var I_, L_ = 5e3, R_ = () => Ye() || Ke(), z_ = () => R_() ? 100 : 0, B_ = (e) =
9987
10030
  return this.serverCurrentTime - this.playbackSource.currentTime;
9988
10031
  }
9989
10032
  };
9990
- I_ = H_, e(H_, "create", (e, t, n, r, i) => new I_(e, t, n, r, i));
10033
+ Y_ = tv, e(tv, "create", (e, t, n, r, i) => new Y_(e, t, n, r, i));
9991
10034
  //#endregion
9992
10035
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
9993
- var U_, W_ = {
10036
+ var nv, rv = {
9994
10037
  enabled: !0,
9995
10038
  interval: 3e4,
9996
10039
  includeErrors: !0,
@@ -9999,11 +10042,11 @@ var U_, W_ = {
9999
10042
  maxRetries: 10,
10000
10043
  maxErrorReports: 50,
10001
10044
  maxEvents: 50
10002
- }, G_ = (e, t) => C(C({}, t), {}, {
10045
+ }, iv = (e, t) => C(C({}, t), {}, {
10003
10046
  type: e,
10004
10047
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10005
10048
  discriminator: "web"
10006
- }), K_ = class {
10049
+ }), av = class {
10007
10050
  constructor(n, r, i, a) {
10008
10051
  var o = this;
10009
10052
  e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new _(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
@@ -10020,7 +10063,7 @@ var U_, W_ = {
10020
10063
  initiator: "interval"
10021
10064
  }, n = {}) => {
10022
10065
  if (!this.options.includeStats) return;
10023
- let r = this.parentContext.getStatistics(), i = G_("stats", C(C(C({}, n), r), {}, {
10066
+ let r = this.parentContext.getStatistics(), i = iv("stats", C(C(C({}, n), r), {}, {
10024
10067
  isFinal: e,
10025
10068
  initiator: t,
10026
10069
  count: this.statsCount++
@@ -10028,7 +10071,7 @@ var U_, W_ = {
10028
10071
  this.unsentLines.push(i);
10029
10072
  }), e(this, "addEvent", (e) => {
10030
10073
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
10031
- let t = G_("event", C(C({}, this.parentContext.getStatistics()), e));
10074
+ let t = iv("event", C(C({}, this.parentContext.getStatistics()), e));
10032
10075
  this.eventCount++, this.unsentLines.push(t);
10033
10076
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
10034
10077
  var e = t(function* (e) {
@@ -10074,15 +10117,15 @@ var U_, W_ = {
10074
10117
  if (t && e instanceof g) {
10075
10118
  if (this.errorCount++, this.errorCount > n) return;
10076
10119
  let t = this.parentContext.getStatistics();
10077
- this.unsentLines.push(G_("error", C(C({}, t), e.toStringifiable())));
10120
+ this.unsentLines.push(iv("error", C(C({}, t), e.toStringifiable())));
10078
10121
  }
10079
- }), this.logger = n, this.emitter = r, this.options = C(C({}, W_), i), this.parentContext = a;
10122
+ }), this.logger = n, this.emitter = r, this.options = C(C({}, rv), i), this.parentContext = a;
10080
10123
  }
10081
10124
  };
10082
- U_ = K_, e(K_, "create", (e, t, n, r) => new U_(e, t, n, r));
10125
+ nv = av, e(av, "create", (e, t, n, r) => new nv(e, t, n, r));
10083
10126
  //#endregion
10084
10127
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
10085
- var q_, J_ = class {
10128
+ var ov, sv = class {
10086
10129
  constructor(t, n, r) {
10087
10130
  e(this, "logger", void 0), e(this, "element", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
10088
10131
  this.timers.unload();
@@ -10091,10 +10134,10 @@ var q_, J_ = class {
10091
10134
  }), this.logger = t, this.element = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
10092
10135
  }
10093
10136
  };
10094
- q_ = J_, e(J_, "create", (e, t, n) => new q_(e, t, n));
10137
+ ov = sv, e(sv, "create", (e, t, n) => new ov(e, t, n));
10095
10138
  //#endregion
10096
10139
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
10097
- var Y_ = [
10140
+ var cv = [
10098
10141
  "minBufferTime",
10099
10142
  "maxBufferTime",
10100
10143
  "burstEnabled",
@@ -10104,10 +10147,10 @@ var Y_ = [
10104
10147
  "offscreenCanvasEnabled",
10105
10148
  "videoCodecs"
10106
10149
  ];
10107
- function X_(e) {
10108
- return Y_.includes(e);
10150
+ function lv(e) {
10151
+ return cv.includes(e);
10109
10152
  }
10110
- var Z_ = class {
10153
+ var uv = class {
10111
10154
  constructor(t) {
10112
10155
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
10113
10156
  }
@@ -10121,7 +10164,7 @@ var Z_ = class {
10121
10164
  this.options[e] = t;
10122
10165
  }
10123
10166
  get(e, t) {
10124
- if (t && X_(e)) {
10167
+ if (t && lv(e)) {
10125
10168
  var n;
10126
10169
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
10127
10170
  if (r !== void 0) return r;
@@ -10132,13 +10175,13 @@ var Z_ = class {
10132
10175
  var n;
10133
10176
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
10134
10177
  }
10135
- }, Q_ = ["mse", "wasm"], $_ = (e) => e == null ? Q_ : e, ev = (e) => {
10178
+ }, dv = ["mse", "wasm"], fv = (e) => e == null ? dv : e, pv = (e) => {
10136
10179
  if (!e) return !1;
10137
10180
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
10138
10181
  return !!(t || n);
10139
- }, tv = (e, t, n) => {
10140
- if (ev(n)) return "mse";
10141
- let r = $_(e);
10182
+ }, mv = (e, t, n) => {
10183
+ if (pv(n)) return "mse";
10184
+ let r = fv(e);
10142
10185
  for (let e of r) switch (e) {
10143
10186
  case "mse":
10144
10187
  if (t) return "mse";
@@ -10149,7 +10192,7 @@ var Z_ = class {
10149
10192
  case "wasm": return "wasm";
10150
10193
  }
10151
10194
  return "wasm";
10152
- }, nv = 6, rv = (e) => {
10195
+ }, hv = 6, gv = (e) => {
10153
10196
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
10154
10197
  var i, a;
10155
10198
  if (e.flags && Lo(e.flags)) {
@@ -10161,7 +10204,7 @@ var Z_ = class {
10161
10204
  return u > 0 && (r = u), C(C({}, e), {}, { duration: u > 0 ? u : r });
10162
10205
  };
10163
10206
  return (e, n = !1) => {
10164
- if (e.flags && Lo(e.flags) && n && (i = !i), !(n && t.length < nv && i) && t.length > 0) {
10207
+ if (e.flags && Lo(e.flags) && n && (i = !i), !(n && t.length < hv && i) && t.length > 0) {
10165
10208
  i = !1;
10166
10209
  let n = e;
10167
10210
  for (let e = t.length - 1; e > 0; e--) {
@@ -10174,7 +10217,7 @@ var Z_ = class {
10174
10217
  }
10175
10218
  return t.push(e), [];
10176
10219
  };
10177
- }, iv = (e, t, n) => {
10220
+ }, _v = (e, t, n) => {
10178
10221
  if (hn(t)) return C(C({}, e), {}, {
10179
10222
  type: "video",
10180
10223
  codec: t.codec,
@@ -10195,8 +10238,8 @@ var Z_ = class {
10195
10238
  data: e.payload,
10196
10239
  duration: 0
10197
10240
  });
10198
- }, av = (e, t) => e && typeof e == "object" && t in e, ov = (e) => !(typeof e != "object" || !av(e, "channelId") || typeof e.channelId != "string" || !av(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), sv = (e) => {
10199
- if (!ov(e)) throw new g("Invalid options", {
10241
+ }, vv = (e, t) => e && typeof e == "object" && t in e, yv = (e) => !(typeof e != "object" || !vv(e, "channelId") || typeof e.channelId != "string" || !vv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), bv = (e) => {
10242
+ if (!yv(e)) throw new g("Invalid options", {
10200
10243
  isFatal: !0,
10201
10244
  code: "invalid_options"
10202
10245
  });
@@ -10205,13 +10248,13 @@ var Z_ = class {
10205
10248
  let n = t;
10206
10249
  n[e] === void 0 && delete n[e];
10207
10250
  }), t;
10208
- }, cv = (e) => {
10251
+ }, xv = (e) => {
10209
10252
  if (typeof e != "object" || !e) throw Error("not an object");
10210
10253
  if (!("video" in e)) throw Error("missing video in subscription");
10211
10254
  if (!("audio" in e)) throw Error("missing audio in subscription");
10212
10255
  if (!("channelId" in e)) throw Error("missing channelId");
10213
10256
  return !0;
10214
- }, lv = class {
10257
+ }, Sv = class {
10215
10258
  constructor(n) {
10216
10259
  var r = this;
10217
10260
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -10271,10 +10314,10 @@ var Z_ = class {
10271
10314
  return this.inFlight.set(e, o), o;
10272
10315
  }), this.logger = n;
10273
10316
  }
10274
- }, uv = /* @__PURE__ */ new WeakMap(), dv = /* @__PURE__ */ new WeakMap(), fv = /* @__PURE__ */ new WeakMap(), pv = class n extends _e {
10317
+ }, Cv = /* @__PURE__ */ new WeakMap(), wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = class n extends _e {
10275
10318
  constructor(r) {
10276
10319
  var i, a;
10277
- super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", fn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new dn()), e(this, "encryptedMediaExtensions", void 0), v(this, uv, 0), v(this, dv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, fv, void 0), e(this, "attach", (e) => {
10320
+ super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", fn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new dn()), e(this, "encryptedMediaExtensions", void 0), v(this, Cv, 0), v(this, wv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, Tv, void 0), e(this, "attach", (e) => {
10278
10321
  var t;
10279
10322
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
10280
10323
  }), e(this, "setElement", (e) => {
@@ -10357,20 +10400,20 @@ var Z_ = class {
10357
10400
  }), e(this, "updateTextTracks", (e) => {
10358
10401
  let t = e.filter((e) => e.codec === "webvtt");
10359
10402
  t.forEach((e) => {
10360
- if (!b(dv, this).find((t) => t.language === e.language)) {
10403
+ if (!b(wv, this).find((t) => t.language === e.language)) {
10361
10404
  if (this.modules.canvasModule) {
10362
10405
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
10363
- b(dv, this).push(t);
10406
+ b(wv, this).push(t);
10364
10407
  } else if (this.mediaElement instanceof HTMLVideoElement) {
10365
10408
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
10366
- b(dv, this).push(t);
10409
+ b(wv, this).push(t);
10367
10410
  }
10368
10411
  }
10369
10412
  });
10370
- for (let e of b(dv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10413
+ for (let e of b(wv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10371
10414
  this.emit("text tracks", this.textTracks);
10372
10415
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
10373
- b(dv, this).forEach((t) => {
10416
+ b(wv, this).forEach((t) => {
10374
10417
  if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
10375
10418
  });
10376
10419
  }), e(this, "filterRenditions", function() {
@@ -10470,8 +10513,8 @@ var Z_ = class {
10470
10513
  u = void 0, d = void 0, i.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
10471
10514
  }
10472
10515
  else s && i.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
10473
- let f = yield Pg.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
10474
- if (m instanceof r_) if (p === "OffscreenCanvas" && d) {
10516
+ let f = yield qg.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
10517
+ if (m instanceof g_) if (p === "OffscreenCanvas" && d) {
10475
10518
  m.setVideoRenderingEnabled(!1);
10476
10519
  let e = i.element;
10477
10520
  e.parentElement ? e.parentElement.replaceChild(d, e) : i.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), i.offscreenCanvasElement = d, i.setElement(d);
@@ -10483,10 +10526,10 @@ var Z_ = class {
10483
10526
  t.parentElement && t.parentElement.replaceChild(e, t), i.setElement(e);
10484
10527
  }
10485
10528
  }
10486
- else m instanceof a_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10529
+ else m instanceof v_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10487
10530
  (e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
10488
10531
  })), e(this, "setupOffscreenSubtitleRouting", () => {
10489
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof a_) return;
10532
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof v_) return;
10490
10533
  let e = this.modules.decoder, t = this.modules.canvasModule;
10491
10534
  if (!t) return;
10492
10535
  let n = !1;
@@ -10525,10 +10568,10 @@ var Z_ = class {
10525
10568
  e && "reset" in e && e.reset();
10526
10569
  }), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
10527
10570
  }), e(this, "getRuntimeInfo", () => {
10528
- let e = this.modules.canvasModule instanceof a_ ? !0 : void 0;
10571
+ let e = this.modules.canvasModule instanceof v_ ? !0 : void 0;
10529
10572
  return C({
10530
10573
  uptime: Date.now() - this.createdAt,
10531
- version: "4.2.0-20-g831ed815",
10574
+ version: "4.2.0-21-g1844a05e",
10532
10575
  clientId: this.clientId,
10533
10576
  sessionId: this.sessionId,
10534
10577
  channelId: this.channelId,
@@ -10552,7 +10595,7 @@ var Z_ = class {
10552
10595
  }), e(this, "timeToFirstFrame", () => {
10553
10596
  let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectionTime;
10554
10597
  if (t && e) return e - t;
10555
- }), this.options = new Z_(C(C({}, xn), sv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10598
+ }), this.options = new uv(C(C({}, xn), bv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10556
10599
  let o = {
10557
10600
  channelId: this.options.get("channelId"),
10558
10601
  audio: {
@@ -10565,16 +10608,16 @@ var Z_ = class {
10565
10608
  height: this.options.get("maxSize").height
10566
10609
  }
10567
10610
  }, s = O.get();
10568
- s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new lv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
10611
+ s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Sv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
10569
10612
  let c = (a = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : a;
10570
10613
  c !== void 0 && (this.options.set("streamToMediaElementEnabled", c), this.options.set("iosMediaElementEnabled", c));
10571
10614
  let l = r.mseEnabled !== void 0, f = r.decoders !== void 0;
10572
10615
  l && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), l && !f && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
10573
- let p = C_.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = Tg.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10616
+ let p = I_.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = Rg.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10574
10617
  reconnectHandler: this.options.get("reconnectHandler"),
10575
10618
  options: this.options,
10576
10619
  onConnectInfo: this.onConnectInfo
10577
- }), te = F_.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = j_.create(this.emitter, te), re = k_.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = T_.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
10620
+ }), te = J_.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = W_.create(this.emitter, te), re = H_.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = R_.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
10578
10621
  this.encryptedMediaExtensions = new Rr(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
10579
10622
  setHeaders: (e) => {
10580
10623
  this.encryptedMediaExtensions.headers = e;
@@ -10583,7 +10626,7 @@ var Z_ = class {
10583
10626
  this.encryptedMediaExtensions.queryParams = e;
10584
10627
  }
10585
10628
  };
10586
- let ae = Ig.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
10629
+ let ae = Yg.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
10587
10630
  if (this.willUseMediaSource()) {
10588
10631
  let e = new ts({
10589
10632
  type: this.options.get("media") == "audio" ? "audio" : "video",
@@ -10593,9 +10636,9 @@ var Z_ = class {
10593
10636
  logger: this.logger.createContext("MediaElement"),
10594
10637
  poster: se
10595
10638
  });
10596
- e.on("buffer state", (e) => this.emitter.emit("buffer state", e)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Rr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = __.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = J_.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
10639
+ e.on("buffer state", (e) => this.emitter.emit("buffer state", e)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Rr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = A_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = sv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
10597
10640
  } else if (this.options.get("streamToMediaElementEnabled") && Et(this.browser)) {
10598
- let e = a_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
10641
+ let e = v_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
10599
10642
  type: this.options.get("media") == "audio" ? "audio" : "video",
10600
10643
  muted: this.options.get("muted") || this.options.get("media") === "video",
10601
10644
  volume: this.options.get("volume"),
@@ -10605,10 +10648,10 @@ var Z_ = class {
10605
10648
  }), t = e.element();
10606
10649
  this.element = t.element, this.playbackSource = e, S = e;
10607
10650
  let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
10608
- this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = J_.create(this.logger.createContext("UnpauseModule"), t, ae));
10651
+ this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = sv.create(this.logger.createContext("UnpauseModule"), t, ae));
10609
10652
  } else {
10610
10653
  let e;
10611
- e = r_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
10654
+ e = g_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
10612
10655
  this.setElement(e.element());
10613
10656
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, S = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Go());
10614
10657
  }
@@ -10622,9 +10665,9 @@ var Z_ = class {
10622
10665
  }, this.emitter.on("error", (e) => {
10623
10666
  if (e.type() === "external" && this.emit("error", e), e.isFatal()) return () => void this.unload();
10624
10667
  });
10625
- let ce = this.browser.platform.isWebKit, ue = H_.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, ie, this.willUseMediaSource() && !ce), de = Wg.create(this.logger.createContext("JitterModule")), fe = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), pe = new URL("/telemetry", fe).toString();
10668
+ let ce = this.browser.platform.isWebKit, ue = tv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, ie, this.willUseMediaSource() && !ce), de = r_.create(this.logger.createContext("JitterModule")), fe = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), pe = new URL("/telemetry", fe).toString();
10626
10669
  this.modules = {
10627
- telemetry: K_.create(this.logger.createContext("TelemetryModule"), this.emitter, {
10670
+ telemetry: av.create(this.logger.createContext("TelemetryModule"), this.emitter, {
10628
10671
  url: pe,
10629
10672
  enabled: this.options.get("telemetryEnabled"),
10630
10673
  includeStats: !1,
@@ -10634,10 +10677,10 @@ var Z_ = class {
10634
10677
  maxBufferTime: this.options.get("maxBufferTime"),
10635
10678
  minBufferTime: this.options.get("minBufferTime")
10636
10679
  }),
10637
- incomingData: Vg.create(this.emitter),
10680
+ incomingData: e_.create(this.emitter),
10638
10681
  adaptivity: fs.create(this.emitter, this.logger.createContext("AdaptivityModule"), re, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
10639
- constraintCap: Ag.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
10640
- event: zg.create(this.emitter, this.logger.createContext("EventModule"), ue),
10682
+ constraintCap: Ug.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
10683
+ event: Qg.create(this.emitter, this.logger.createContext("EventModule"), ue),
10641
10684
  sync: ue,
10642
10685
  jitter: de,
10643
10686
  documentState: ae,
@@ -10690,7 +10733,7 @@ var Z_ = class {
10690
10733
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
10691
10734
  if (e.telemetry) {
10692
10735
  var i;
10693
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = K_.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
10736
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = av.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
10694
10737
  }
10695
10738
  }), this.emitter.on("adapt level", (e) => {
10696
10739
  this.logger.debug("adapt level", { direction: e });
@@ -10722,8 +10765,8 @@ var Z_ = class {
10722
10765
  audio: C(C({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
10723
10766
  })), this.emitter.emit("adapted level");
10724
10767
  }), this.emitter.on("text track data", (e) => {
10725
- let t = b(dv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(uv, this);
10726
- if (x(uv, this, n), t) {
10768
+ let t = b(wv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Cv, this);
10769
+ if (x(Cv, this, n), t) {
10727
10770
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
10728
10771
  for (let r of e.cues) {
10729
10772
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -10737,19 +10780,19 @@ var Z_ = class {
10737
10780
  this.clientIp = t.ip;
10738
10781
  break;
10739
10782
  case "renditions":
10740
- this.updateTextTracks(t.renditions), x(fv, this, this.filterRenditions(t.renditions).then((e) => {
10783
+ this.updateTextTracks(t.renditions), x(Tv, this, this.filterRenditions(t.renditions).then((e) => {
10741
10784
  this.emitter.emit("renditions", {
10742
10785
  renditions: e,
10743
10786
  channelId: this.currentSubscription.channelId
10744
10787
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
10745
10788
  }).finally(() => {
10746
- x(fv, this, void 0);
10789
+ x(Tv, this, void 0);
10747
10790
  }));
10748
10791
  break;
10749
10792
  case "subscription changed":
10750
10793
  var r;
10751
10794
  try {
10752
- cv(t.subscription);
10795
+ xv(t.subscription);
10753
10796
  } catch (e) {
10754
10797
  this.emitter.emit("error", new g("Subscription failed validation", {
10755
10798
  source: e instanceof Error ? e : void 0,
@@ -10859,7 +10902,7 @@ var Z_ = class {
10859
10902
  let ve = function() {
10860
10903
  var e = t(function* (e) {
10861
10904
  let t = e.channelId;
10862
- b(fv, i) && (yield b(fv, i));
10905
+ b(Tv, i) && (yield b(Tv, i));
10863
10906
  let n = i.modules.renditions.getRendition(e.renditionId, t);
10864
10907
  if (!zo(e.flags)) {
10865
10908
  if (Bo(e.flags)) {
@@ -10867,8 +10910,8 @@ var Z_ = class {
10867
10910
  if (e.renditionId !== 0) {
10868
10911
  let e = le(t);
10869
10912
  if (e && e.language !== void 0) {
10870
- let t = new Zo().parse(e.content || ""), r = n / 1e3, a = b(dv, i).find((t) => t.language === e.language), o = r - b(uv, i);
10871
- if (x(uv, i, r), a) {
10913
+ let t = new Zo().parse(e.content || ""), r = n / 1e3, a = b(wv, i).find((t) => t.language === e.language), o = r - b(Cv, i);
10914
+ if (x(Cv, i, r), a) {
10872
10915
  if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
10873
10916
  for (let e of t) {
10874
10917
  let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
@@ -10900,10 +10943,10 @@ var Z_ = class {
10900
10943
  mimeType: s
10901
10944
  }), i.emit("initialized media");
10902
10945
  } else {
10903
- let t = iv(e, n, i.sizes.get(e.renditionId));
10946
+ let t = _v(e, n, i.sizes.get(e.renditionId));
10904
10947
  i.modules.jitter.recordSample(t);
10905
10948
  let a = i.sampleProcessingSesssions.get(r);
10906
- if (!a) a = rv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
10949
+ if (!a) a = gv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
10907
10950
  else {
10908
10951
  let e = i.willUseMediaSource() && i.isSwitchingRenditionLevel && t.type === "video", n = a(i.modules.sync.processSample(t), e), r = t;
10909
10952
  n.forEach((e) => {
@@ -11011,7 +11054,7 @@ var Z_ = class {
11011
11054
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
11012
11055
  }
11013
11056
  set textTrack(e) {
11014
- e !== this.textTrack && (b(dv, this).forEach((t) => {
11057
+ e !== this.textTrack && (b(wv, this).forEach((t) => {
11015
11058
  if (t.label === e) t.mode = "showing";
11016
11059
  else {
11017
11060
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -11020,11 +11063,11 @@ var Z_ = class {
11020
11063
  }), this.emitter.emit("text track", e));
11021
11064
  }
11022
11065
  get textTracks() {
11023
- return b(dv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11066
+ return b(wv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11024
11067
  }
11025
11068
  get textTrack() {
11026
11069
  var e;
11027
- return (e = b(dv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11070
+ return (e = b(wv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11028
11071
  }
11029
11072
  get channelId() {
11030
11073
  var e, t;
@@ -11158,7 +11201,7 @@ var Z_ = class {
11158
11201
  return this.modules.subscription.getTargetSubscription();
11159
11202
  }
11160
11203
  resolvedDecoder(e) {
11161
- return tv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11204
+ return mv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11162
11205
  }
11163
11206
  willUseMediaSource() {
11164
11207
  return this.resolvedDecoder() === "mse";
@@ -11177,6 +11220,6 @@ var Z_ = class {
11177
11220
  return t === void 0 ? this.shouldUseWebCodecs(e) : t;
11178
11221
  }
11179
11222
  };
11180
- e(pv, "MAX_POOL_SIZE", 10), e(pv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(pv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11223
+ e(Ev, "MAX_POOL_SIZE", 10), e(Ev, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Ev, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11181
11224
  //#endregion
11182
- export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, pv as t, gt as u, Qe as v };
11225
+ export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, Ev as t, gt as u, Qe as v };