@vindral/web-sdk 4.3.0-3-g6f983fb9 → 4.3.0-5-ga57504ef

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.
@@ -6894,7 +6894,7 @@ var Xm = class n {
6894
6894
  })();
6895
6895
  }
6896
6896
  closed() {
6897
- return b($m, this).closed();
6897
+ return Promise.race([b($m, this).closed(), b(Qm, this).closed()]);
6898
6898
  }
6899
6899
  catalog() {
6900
6900
  return b($m, this).catalog();
@@ -7074,7 +7074,7 @@ function xh(e) {
7074
7074
  }
7075
7075
  var Sh = 1e4, Ch = /* @__PURE__ */ new WeakMap(), wh = /* @__PURE__ */ new WeakSet(), Th = class n {
7076
7076
  constructor(t, n, r) {
7077
- S(this, wh), e(this, "ip", void 0), e(this, "value", void 0), v(this, Ch, void 0), this.ip = r, this.value = new A(n), x(Ch, this, y(wh, this, Eh).call(this, t));
7077
+ S(this, wh), e(this, "ip", void 0), e(this, "value", void 0), v(this, Ch, void 0), this.ip = r, this.value = new A(n), x(Ch, this, y(wh, this, Eh).call(this, t)), this.closed().catch(o);
7078
7078
  }
7079
7079
  closed() {
7080
7080
  return b(Ch, this);
@@ -7188,6 +7188,7 @@ var Ph = class {
7188
7188
  }, Fh = /* @__PURE__ */ new WeakMap(), Ih = /* @__PURE__ */ new WeakMap(), Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), zh = /* @__PURE__ */ new WeakMap(), Bh = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMap(), Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakSet(), Gh = class n {
7189
7189
  constructor(t, n, r) {
7190
7190
  S(this, Wh), v(this, Fh, void 0), v(this, Ih, void 0), v(this, Lh, void 0), v(this, Rh, O.get().createContext("Player")), v(this, Z, void 0), v(this, zh, new A(void 0)), v(this, Bh, new A(void 0)), v(this, Vh, new A(void 0)), v(this, Hh, void 0), v(this, Uh, void 0), e(this, "subtitles", new Ph(b(Vh, this), "subtitles")), e(this, "video", new Ph(b(Bh, this), "video")), e(this, "audio", new Ph(b(zh, this), "audio")), x(Fh, this, t), x(Ih, this, uh.start(r)), x(Lh, this, r), x(Z, this, new A(n)), x(Hh, this, new kh(n)), x(Uh, this, Promise.race([
7191
+ y(Wh, this, Yh).call(this),
7191
7192
  r.idleTimeout(),
7192
7193
  y(Wh, this, Jh).call(this),
7193
7194
  b(Hh, this).closed()
@@ -7328,7 +7329,7 @@ function Jh() {
7328
7329
  try {
7329
7330
  for (var l = U(t.catalog()), u; o = !(u = yield l.next()).done; o = !1) {
7330
7331
  let t = u.value;
7331
- yield Promise.all([y(Wh, e, Yh).call(e, t, b(Bh, e)), y(Wh, e, Yh).call(e, t, b(zh, e))]);
7332
+ yield Promise.all([y(Wh, e, Xh).call(e, t, b(Bh, e)), y(Wh, e, Xh).call(e, t, b(zh, e))]);
7332
7333
  }
7333
7334
  } catch (e) {
7334
7335
  s = !0, c = e;
@@ -7351,7 +7352,17 @@ function Jh() {
7351
7352
  }
7352
7353
  })();
7353
7354
  }
7354
- function Yh(e, n) {
7355
+ function Yh() {
7356
+ var e = this;
7357
+ return t(function* () {
7358
+ try {
7359
+ return yield b(Lh, e).closed(), /* @__PURE__ */ Error("Stats closed");
7360
+ } catch (e) {
7361
+ return e;
7362
+ }
7363
+ })();
7364
+ }
7365
+ function Xh(e, n) {
7355
7366
  var r = this;
7356
7367
  return t(function* () {
7357
7368
  let t = n.current();
@@ -7368,133 +7379,135 @@ function Yh(e, n) {
7368
7379
  }
7369
7380
  //#endregion
7370
7381
  //#region ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
7371
- function Xh(e, t, n) {
7382
+ function Zh(e, t, n) {
7372
7383
  let r = new URL("/voq/subscribe", e);
7373
7384
  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;
7374
7385
  }
7375
- var Zh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakMap(), rg = /* @__PURE__ */ new WeakMap(), ig = /* @__PURE__ */ new WeakMap(), ag = /* @__PURE__ */ new WeakMap(), og = /* @__PURE__ */ new WeakMap(), sg = /* @__PURE__ */ new WeakSet(), cg = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg = class n {
7386
+ var Qh = 1e4, Q = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakMap(), rg = /* @__PURE__ */ new WeakMap(), ig = /* @__PURE__ */ new WeakMap(), ag = /* @__PURE__ */ new WeakMap(), og = /* @__PURE__ */ new WeakMap(), sg = /* @__PURE__ */ new WeakMap(), cg = /* @__PURE__ */ new WeakSet(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg = /* @__PURE__ */ new WeakMap(), fg = class n {
7376
7387
  get estimatedBandwidth() {
7377
- return b(ig, this);
7388
+ return b(ag, this);
7378
7389
  }
7379
7390
  unload() {
7380
- b(Q, this).off("send signal", b(lg, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(cg, this)), this.disconnect();
7391
+ b(Q, this).off("send signal", b(ug, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(lg, this)), this.disconnect();
7381
7392
  }
7382
7393
  suspend() {}
7383
7394
  unsuspend() {}
7384
7395
  getStatistics() {
7385
- let e = b($h, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7396
+ let e = b(eg, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7386
7397
  return {
7387
- edgeUrl: b($h, this).url(),
7398
+ edgeUrl: b(eg, this).url(),
7388
7399
  connectionProtocol: e,
7389
- transportSelectionReason: b(ag, this)
7400
+ transportSelectionReason: b(og, this)
7390
7401
  };
7391
7402
  }
7392
7403
  constructor(t, n, r, i, a, s, c, l) {
7393
- S(this, sg), v(this, Q, void 0), v(this, Qh, void 0), v(this, $h, void 0), v(this, eg, "disconnected"), v(this, $, void 0), v(this, tg, /* @__PURE__ */ new Map()), v(this, ng, void 0), v(this, rg, void 0), v(this, ig, void 0), v(this, ag, void 0), v(this, og, /* @__PURE__ */ new Map()), v(this, cg, (e) => {
7404
+ S(this, cg), v(this, Q, void 0), v(this, $h, void 0), v(this, eg, void 0), v(this, tg, "disconnected"), v(this, $, void 0), v(this, ng, /* @__PURE__ */ new Map()), v(this, rg, void 0), v(this, ig, void 0), v(this, ag, void 0), v(this, og, void 0), v(this, sg, /* @__PURE__ */ new Map()), v(this, lg, (e) => {
7394
7405
  if (!e) {
7395
7406
  b($, this).setSubtitleTrack(void 0).catch(o);
7396
7407
  return;
7397
7408
  }
7398
- let t = b(tg, this).get(yp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7409
+ let t = b(ng, this).get(yp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7399
7410
  n && b($, this).setSubtitleTrack(n).catch(o);
7400
- }), v(this, lg, (e) => {
7411
+ }), v(this, ug, (e) => {
7401
7412
  switch (e.type) {
7402
7413
  case "subscribe":
7403
- if (b(ug, this)) {
7404
- b(Qh, this).info("Ignoring - we are already switching");
7414
+ if (b(dg, this)) {
7415
+ b($h, this).info("Ignoring - we are already switching");
7405
7416
  return;
7406
7417
  }
7407
- x(ug, this, !0), y(sg, this, mg).call(this, e.subscription).catch((t) => {
7408
- b(Qh, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7418
+ x(dg, this, !0), y(cg, this, hg).call(this, e.subscription).catch((t) => {
7419
+ b($h, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7409
7420
  type: "subscription changed",
7410
7421
  subscription: e.subscription,
7411
7422
  reset: !0
7412
7423
  });
7413
- }).finally(() => x(ug, this, !1));
7424
+ }).finally(() => x(dg, this, !1));
7414
7425
  break;
7415
7426
  case "telemetry":
7416
- me(new URL("/api/telemetry", b($h, this).url().replace("wss://", "https://")), {
7427
+ me(new URL("/api/telemetry", b(eg, this).url().replace("wss://", "https://")), {
7417
7428
  body: e.body,
7418
7429
  headers: { "Content-Type": "text/plain" }
7419
7430
  }).catch(o);
7420
7431
  break;
7421
7432
  case "refresh auth":
7422
- b($h, this).updateAuthToken(e.token);
7433
+ b(eg, this).updateAuthToken(e.token);
7423
7434
  break;
7424
7435
  }
7425
- }), v(this, ug, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7426
- b(Qh, this).info("Disconnecting", e), b($h, this).close(), b($, this).close().catch(o), x(og, this, /* @__PURE__ */ new Map()), y(sg, this, hg).call(this, "disconnected");
7427
- }), x(Q, this, t), x(Qh, this, n), x($h, this, r), x($, this, i), x(tg, this, a), x(ng, this, s), x(rg, this, c), x(ag, this, l), b(Q, this).on("send signal", b(lg, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(cg, this)), y(sg, this, fg).call(this).catch(o), y(sg, this, gg).call(this).catch(o);
7436
+ }), v(this, dg, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7437
+ b($h, this).info("Disconnecting", e), b(eg, this).close(), b($, this).close().catch(o), x(sg, this, /* @__PURE__ */ new Map()), y(cg, this, gg).call(this, "disconnected");
7438
+ }), x(Q, this, t), x($h, this, n), x(eg, this, r), x($, this, i), x(ng, this, a), x(rg, this, s), x(ig, this, c), x(og, this, l), b(Q, this).on("send signal", b(ug, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(lg, this)), y(cg, this, pg).call(this).catch(o), y(cg, this, _g).call(this).catch(o);
7428
7439
  }
7429
7440
  static start(e, r, i, a, o) {
7430
7441
  return t(function* () {
7431
- var t, s, c;
7432
- let l = new Map(a.connectInfo.channels.map((e) => [yp(e.catalog.namespace), new Cg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7442
+ var t, s, c, l;
7443
+ let u = new Map(a.connectInfo.channels.map((e) => [yp(e.catalog.namespace), new wg(new A(e.catalog))])), d = yield a.onConnectInfo(a.connectInfo), f = a.options.get("authenticationToken"), p, m;
7433
7444
  switch (typeof a.edgeUrl) {
7434
7445
  case "string":
7435
- f = Xh(a.edgeUrl, u, d);
7446
+ p = Zh(a.edgeUrl, d, f);
7436
7447
  break;
7437
7448
  default:
7438
- f = Xh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, u, d), p = Xh(a.edgeUrl.moqWsUrl, u, d);
7449
+ p = Zh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, d, f), m = Zh(a.edgeUrl.moqWsUrl, d, f);
7439
7450
  break;
7440
7451
  }
7441
- let m = (t = a.connectInfo.channels.find((e) => e.channelId === u.channelId)) == null ? void 0 : t.catalog;
7452
+ let h = (t = a.connectInfo.channels.find((e) => e.channelId === d.channelId)) == null ? void 0 : t.catalog;
7442
7453
  r.debug("Resolved edge url", {
7443
- edgeUrl: f,
7444
- edgeWsUrl: p
7445
- }), de(m, "no catalog found");
7446
- let h = (s = l.get(yp(m.namespace))) == null ? void 0 : s.getVideoTrack(u.video), ee = (c = l.get(yp(m.namespace))) == null ? void 0 : c.getAudioTrack(u.audio), { session: te, transportSelectionReason: ne } = yield dp({
7447
- url: f,
7448
- wsUrl: p,
7454
+ edgeUrl: p,
7455
+ edgeWsUrl: m
7456
+ }), de(h, "no catalog found");
7457
+ let ee = (s = u.get(yp(h.namespace))) == null ? void 0 : s.getVideoTrack(d.video), te = (c = u.get(yp(h.namespace))) == null ? void 0 : c.getAudioTrack(d.audio), { session: ne, transportSelectionReason: re } = yield dp({
7458
+ url: p,
7459
+ wsUrl: m,
7449
7460
  handshakePipelining: !0,
7450
7461
  authToken: a.options.get("authenticationToken"),
7451
7462
  preferredTransport: a.options.get("webtransportEnabled") ? "webtransport" : "websocket",
7452
7463
  role: eu.Subscriber,
7453
7464
  websocketFallbackTimeoutMs: 2e3
7454
- }), re = te.closed().then((e) => {
7465
+ });
7466
+ (l = a.onTransportConnected) == null || l.call(a);
7467
+ let g = ne.closed().then((e) => {
7455
7468
  throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
7456
- }), g = yield Promise.race([
7457
- Gh.start(te.subscriber, {
7458
- namespace: m.namespace,
7459
- catalog: m,
7460
- videoTrack: h == null ? void 0 : h.track,
7461
- audioTrack: ee == null ? void 0 : ee.track,
7462
- burstMs: u.burstMs || 0
7469
+ }), ie = yield Promise.race([
7470
+ Gh.start(ne.subscriber, {
7471
+ namespace: h.namespace,
7472
+ catalog: h,
7473
+ videoTrack: ee == null ? void 0 : ee.track,
7474
+ audioTrack: te == null ? void 0 : te.track,
7475
+ burstMs: d.burstMs || 0
7463
7476
  }),
7464
- hn(Zh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7465
- re
7466
- ]), ie = new Cg(g.catalog());
7467
- l.set(yp(m.namespace), ie), e.emit("received signal", {
7477
+ hn(Qh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7478
+ g
7479
+ ]), ae = new wg(ie.catalog());
7480
+ u.set(yp(h.namespace), ae), e.emit("received signal", {
7468
7481
  type: "client ip",
7469
- ip: g.connectionInfo().ip
7470
- }), g.drm().then((t) => {
7482
+ ip: ie.connectionInfo().ip
7483
+ }), ie.drm().then((t) => {
7471
7484
  t && e.emit("received drm data", t.value);
7472
7485
  }).catch((e) => {
7473
7486
  r.error("Error getting DRM data", e);
7474
7487
  });
7475
- let ae = new n(e, r, te, g, l, i, o, ne);
7476
- return u.textTrack && b(cg, ae).call(ae, u.textTrack), ae;
7488
+ let oe = new n(e, r, ne, ie, u, i, o, re);
7489
+ return d.textTrack && b(lg, oe).call(oe, d.textTrack), oe;
7477
7490
  })();
7478
7491
  }
7479
7492
  getState() {
7480
- return b(eg, this);
7493
+ return b(tg, this);
7481
7494
  }
7482
7495
  close() {
7483
- b($h, this).close();
7496
+ b(eg, this).close();
7484
7497
  }
7485
7498
  closed() {
7486
- return Promise.race([b($h, this).closed(), b($, this).closed()]);
7499
+ return Promise.race([b(eg, this).closed(), b($, this).closed()]);
7487
7500
  }
7488
7501
  };
7489
- function fg() {
7502
+ function pg() {
7490
7503
  var e = this;
7491
7504
  return t(function* () {
7492
- b($h, e).transportType() === "websocket" && (yield mn(5e3));
7505
+ b(eg, e).transportType() === "websocket" && (yield mn(5e3));
7493
7506
  var t = !1, n = !1, r;
7494
7507
  try {
7495
7508
  for (var i = U(b($, e).stats()), a; t = !(a = yield i.next()).done; t = !1) {
7496
7509
  let { rtt: t, estimatedBandwidth: n } = a.value;
7497
- x(ig, e, n), b(rg, e).push(t), b(Q, e).emit("rtt", Ot(b(rg, e).items()));
7510
+ x(ag, e, n), b(ig, e).push(t), b(Q, e).emit("rtt", Ot(b(ig, e).items()));
7498
7511
  }
7499
7512
  } catch (e) {
7500
7513
  n = !0, r = e;
@@ -7507,26 +7520,26 @@ function fg() {
7507
7520
  }
7508
7521
  })();
7509
7522
  }
7510
- function pg(e) {
7523
+ function mg(e) {
7511
7524
  var n = this;
7512
7525
  return t(function* () {
7513
7526
  var t;
7514
- let r = yield b(ng, n).connect({ channelId: e });
7527
+ let r = yield b(rg, n).connect({ channelId: e });
7515
7528
  if (!ce(r)) throw Error("no moq connect info found");
7516
7529
  let i = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
7517
7530
  if (!i) throw Error("no catalog found");
7518
7531
  return i;
7519
7532
  })();
7520
7533
  }
7521
- function mg(e) {
7534
+ function hg(e) {
7522
7535
  var n = this;
7523
7536
  return t(function* () {
7524
7537
  var t, r;
7525
- b(Qh, n).info("handle subscription", e);
7526
- let i = b($, n), a = b(tg, n).get(e.channelId);
7527
- if (a || (a = new Cg(new A(yield y(sg, n, pg).call(n, e.channelId))), b(tg, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7538
+ b($h, n).info("handle subscription", e);
7539
+ let i = b($, n), a = b(ng, n).get(e.channelId);
7540
+ if (a || (a = new wg(new A(yield y(cg, n, mg).call(n, e.channelId))), b(ng, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7528
7541
  var o;
7529
- b(Qh, n).info("changing channel", e.channelId);
7542
+ b($h, n).info("changing channel", e.channelId);
7530
7543
  let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
7531
7544
  yield i.zap({
7532
7545
  namespace: a.namespace(),
@@ -7536,8 +7549,8 @@ function mg(e) {
7536
7549
  }, 500), i.drm().then((e) => {
7537
7550
  e && b(Q, n).emit("received drm data", e.value);
7538
7551
  }).catch((e) => {
7539
- b(Qh, n).error("Error getting DRM data", e);
7540
- }), b(Qh, n).info("switched channel", e.channelId), (o = b(tg, n).get(yp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7552
+ b($h, n).error("Error getting DRM data", e);
7553
+ }), b($h, n).info("switched channel", e.channelId), (o = b(ng, n).get(yp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7541
7554
  type: "subscription changed",
7542
7555
  subscription: e
7543
7556
  });
@@ -7550,26 +7563,26 @@ function mg(e) {
7550
7563
  });
7551
7564
  })();
7552
7565
  }
7553
- function hg(e) {
7554
- x(eg, this, e), b(Q, this).emit("connection state", e);
7566
+ function gg(e) {
7567
+ x(tg, this, e), b(Q, this).emit("connection state", e);
7555
7568
  }
7556
- function gg() {
7569
+ function _g() {
7557
7570
  var e = this;
7558
7571
  return t(function* () {
7559
7572
  try {
7560
- y(sg, e, hg).call(e, "connecting"), b(Qh, e).info("Connecting..."), y(sg, e, hg).call(e, "connected"), yield Promise.all([
7561
- y(sg, e, vg).call(e, b($, e).referenceClock(), b($, e).audio),
7562
- y(sg, e, vg).call(e, b($, e).referenceClock(), b($, e).video),
7563
- y(sg, e, _g).call(e, b($, e).subtitles)
7564
- ]), yield b($, e).closed(), b($h, e).close(), b(Qh, e).info("Session closed");
7573
+ y(cg, e, gg).call(e, "connecting"), b($h, e).info("Connecting..."), y(cg, e, gg).call(e, "connected"), yield Promise.all([
7574
+ y(cg, e, yg).call(e, b($, e).referenceClock(), b($, e).audio),
7575
+ y(cg, e, yg).call(e, b($, e).referenceClock(), b($, e).video),
7576
+ y(cg, e, vg).call(e, b($, e).subtitles)
7577
+ ]), yield b($, e).closed(), b(eg, e).close(), b($h, e).info("Session closed");
7565
7578
  } catch (t) {
7566
- b(Qh, e).warn("Session error", t);
7579
+ b($h, e).warn("Session error", t);
7567
7580
  } finally {
7568
- y(sg, e, hg).call(e, "disconnected");
7581
+ y(cg, e, gg).call(e, "disconnected");
7569
7582
  }
7570
7583
  })();
7571
7584
  }
7572
- function _g(e) {
7585
+ function vg(e) {
7573
7586
  var n = this;
7574
7587
  return t(function* () {
7575
7588
  var t = !1, r = !1, i;
@@ -7589,7 +7602,7 @@ function _g(e) {
7589
7602
  }
7590
7603
  })();
7591
7604
  }
7592
- function vg(e, n) {
7605
+ function yg(e, n) {
7593
7606
  var r = this;
7594
7607
  return t(function* () {
7595
7608
  let t = "", i = "", a, o = b($, r).videoTrack() === void 0;
@@ -7614,11 +7627,11 @@ function vg(e, n) {
7614
7627
  drmTransition: a !== void 0 && a !== ne
7615
7628
  };
7616
7629
  t = s, i = c, a = ne;
7617
- let h = p.producerReferenceTime(), ee = b(og, r).get(n.track.namespace) || 0;
7630
+ let h = p.producerReferenceTime(), ee = b(sg, r).get(n.track.namespace) || 0;
7618
7631
  if (h && Date.now() - ee > 1e3) {
7619
- b(og, r).set(n.track.namespace, Date.now());
7632
+ b(sg, r).set(n.track.namespace, Date.now());
7620
7633
  let t = e.wallclock() - h.getTime();
7621
- b(Qh, r).debug("timing-info", {
7634
+ b($h, r).debug("timing-info", {
7622
7635
  mediaType: p.mediaType(),
7623
7636
  referenceClock: e,
7624
7637
  delta: t,
@@ -7642,7 +7655,7 @@ function vg(e, n) {
7642
7655
  codec: l,
7643
7656
  codecString: u,
7644
7657
  switchInfo: m,
7645
- renditionId: yg(n.track.trackObject.name)
7658
+ renditionId: bg(n.track.trackObject.name)
7646
7659
  });
7647
7660
  }
7648
7661
  }
@@ -7668,52 +7681,52 @@ function vg(e, n) {
7668
7681
  }
7669
7682
  })();
7670
7683
  }
7671
- function yg(e) {
7684
+ function bg(e) {
7672
7685
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
7673
7686
  }
7674
- var bg = /* @__PURE__ */ new WeakMap(), xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakSet(), Cg = class {
7687
+ var xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakSet(), wg = class {
7675
7688
  constructor(e) {
7676
- S(this, Sg), v(this, bg, void 0), v(this, xg, void 0), x(bg, this, e), x(xg, this, y(Sg, this, wg).call(this));
7689
+ S(this, Cg), v(this, xg, void 0), v(this, Sg, void 0), x(xg, this, e), x(Sg, this, y(Cg, this, Tg).call(this));
7677
7690
  }
7678
7691
  catalog() {
7679
- return b(bg, this).current();
7692
+ return b(xg, this).current();
7680
7693
  }
7681
7694
  namespace() {
7682
- return b(bg, this).current().namespace;
7695
+ return b(xg, this).current().namespace;
7683
7696
  }
7684
7697
  updateCatalog(e) {
7685
- x(bg, this, e);
7698
+ x(xg, this, e);
7686
7699
  }
7687
7700
  getTextTrack(e) {
7688
- return b(bg, this).current().tracks.find((t) => t.label === e);
7701
+ return b(xg, this).current().tracks.find((t) => t.label === e);
7689
7702
  }
7690
7703
  getAudioTrack(e) {
7691
7704
  if (!e.codec) return;
7692
- let t = b(xg, this).filter((t) => !(!_n(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7705
+ let t = b(Sg, this).filter((t) => !(!_n(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7693
7706
  return t[t.length - 1];
7694
7707
  }
7695
7708
  getVideoTrack(e) {
7696
7709
  if (!e.codec) return;
7697
- let t = b(xg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7710
+ let t = b(Sg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7698
7711
  return t[t.length - 1];
7699
7712
  }
7700
7713
  renditions() {
7701
- return b(xg, this);
7714
+ return b(Sg, this);
7702
7715
  }
7703
7716
  };
7704
- function wg() {
7705
- let [e, t] = b(bg, this).value();
7717
+ function Tg() {
7718
+ let [e, t] = b(xg, this).value();
7706
7719
  return ue(e);
7707
7720
  }
7708
7721
  //#endregion
7709
7722
  //#region ../../libs/web-sdk/src/resolveEdgeUrl.ts
7710
- var Tg = (e, t) => {
7723
+ var Eg = (e, t) => {
7711
7724
  var n, r;
7712
7725
  let i = new URL("/subscribe", e);
7713
7726
  return i.searchParams.append("channelId", t.channelId), i.searchParams.append("sessionId", t.sessionId), i.searchParams.append("clientId", t.clientId), (n = t.audio) != null && n.codec && (i.searchParams.append("audio.bitRate", Math.round(t.audio.bitRate).toString()), i.searchParams.append("audio.codec", t.audio.codec), t.audio.language && i.searchParams.append("audio.language", t.audio.language)), (r = t.video) != null && r.codec && (i.searchParams.append("video.width", t.video.width.toString()), i.searchParams.append("video.height", t.video.height.toString()), i.searchParams.append("video.bitRate", Math.round(t.video.bitRate).toString()), i.searchParams.append("video.codec", t.video.codec)), t.expectAdditionalConnection && i.searchParams.append("expectAdditionalConnection", t.expectAdditionalConnection.toString()), t.burstMs && i.searchParams.append("burstMs", t.burstMs.toString()), t.channelGroupId && i.searchParams.append("channelGroupId", t.channelGroupId), t.authToken && (i.searchParams.append("auth.token", t.authToken), i.searchParams.append("auth.type", "jwt")), i.toString();
7714
- }, Eg = /* @__PURE__ */ function(e) {
7727
+ }, Dg = /* @__PURE__ */ function(e) {
7715
7728
  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;
7716
- }({}), Dg = class extends _e {
7729
+ }({}), Og = class extends _e {
7717
7730
  constructor(n, r) {
7718
7731
  var i;
7719
7732
  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", () => {
@@ -7755,19 +7768,19 @@ var Tg = (e, t) => {
7755
7768
  code: e.code,
7756
7769
  isSuspended: this.isSuspended
7757
7770
  })), this.close("one websocket was closed"), e.code) {
7758
- case Eg.AuthenticationFailed:
7771
+ case Dg.AuthenticationFailed:
7759
7772
  this.emit("error", ne(se()));
7760
7773
  break;
7761
- case Eg.AuthenticationRefreshFailed:
7774
+ case Dg.AuthenticationRefreshFailed:
7762
7775
  this.emit("error", ne(se()));
7763
7776
  break;
7764
- case Eg.AuthenticationExpired:
7777
+ case Dg.AuthenticationExpired:
7765
7778
  this.emit("error", h(se()));
7766
7779
  break;
7767
- case Eg.ChannelNotFound:
7780
+ case Dg.ChannelNotFound:
7768
7781
  this.emit("error", m("internal", se()));
7769
7782
  break;
7770
- case Eg.Inactivity:
7783
+ case Dg.Inactivity:
7771
7784
  this.emit("error", oe("internal", se()));
7772
7785
  break;
7773
7786
  default:
@@ -7816,10 +7829,10 @@ var Tg = (e, t) => {
7816
7829
  get connectTime() {
7817
7830
  return this._connectTime;
7818
7831
  }
7819
- }, Og, kg = 65536 * 8, Ag = .9, jg = 40, Mg = (e) => {
7820
- let t = e || jg;
7821
- return kg * Ag * 1e3 / t;
7822
- }, Ng = class n {
7832
+ }, kg, Ag = 65536 * 8, jg = .9, Mg = 40, Ng = (e) => {
7833
+ let t = e || Mg;
7834
+ return Ag * jg * 1e3 / t;
7835
+ }, Pg = class n {
7823
7836
  constructor(r, i, a, s) {
7824
7837
  var c = this;
7825
7838
  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", () => {
@@ -7869,7 +7882,7 @@ var Tg = (e, t) => {
7869
7882
  }), e(this, "resolveEdgeUrl", t(function* () {
7870
7883
  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;
7871
7884
  r && (i = n === !1 ? 1 : 2);
7872
- let a = Tg(c.config.edgeUrl, {
7885
+ let a = Eg(c.config.edgeUrl, {
7873
7886
  video: t.video,
7874
7887
  audio: t.audio,
7875
7888
  burstMs: t.burstMs,
@@ -7902,7 +7915,7 @@ var Tg = (e, t) => {
7902
7915
  }
7903
7916
  }
7904
7917
  }), e(this, "connectWebSocketTransport", () => {
7905
- let e = new Dg({
7918
+ let e = new Og({
7906
7919
  reconnectDelay: 1e3,
7907
7920
  onMessage: this.onMessage,
7908
7921
  reconnectHandler: this.config.reconnectHandler,
@@ -7943,58 +7956,62 @@ var Tg = (e, t) => {
7943
7956
  return this.disconnected.promise;
7944
7957
  }
7945
7958
  };
7946
- Og = Ng, e(Ng, "PING_INTERVAL", 5e3), e(Ng, "MAX_MISSED_PINGS", 4), e(Ng, "TLS_ROUNDTRIPS", 3), e(Ng, "start", (e, t, n, r) => new Promise((i, a) => {
7947
- let o = new Og(e, t, n, r);
7948
- o.transport.once("error", (e) => a(e)), o.transport.once("open", () => i(o));
7959
+ kg = Pg, e(Pg, "PING_INTERVAL", 5e3), e(Pg, "MAX_MISSED_PINGS", 4), e(Pg, "TLS_ROUNDTRIPS", 3), e(Pg, "start", (e, t, n, r) => new Promise((i, a) => {
7960
+ let o = new kg(e, t, n, r);
7961
+ o.transport.once("error", (e) => a(e)), o.transport.once("open", () => {
7962
+ var e;
7963
+ (e = n.onTransportConnected) == null || e.call(n), i(o);
7964
+ });
7949
7965
  }));
7950
7966
  //#endregion
7951
7967
  //#region ../../libs/web-sdk/src/EdgeSelector.ts
7952
- var Pg = (e) => {
7968
+ var Fg = (e) => {
7953
7969
  var t;
7954
7970
  return typeof e == "string" ? e : `${e.moqWsUrl}|${(t = e.moqUrl) == null ? "" : t}`;
7955
- }, Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = class {
7971
+ }, Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = /* @__PURE__ */ new WeakMap(), Bg = class {
7956
7972
  constructor(e) {
7957
- v(this, Fg, void 0), v(this, Ig, []), v(this, Lg, /* @__PURE__ */ new Set()), v(this, Rg, void 0), x(Fg, this, e);
7973
+ v(this, Ig, void 0), v(this, Lg, []), v(this, Rg, /* @__PURE__ */ new Set()), v(this, zg, void 0), x(Ig, this, e);
7958
7974
  }
7959
7975
  select(e) {
7960
- if (b(Fg, this).edgeUrl) return b(Fg, this).edgeUrl;
7976
+ if (b(Ig, this).edgeUrl) return b(Ig, this).edgeUrl;
7961
7977
  if (e.length > 0) {
7962
- x(Ig, this, [...e]);
7963
- let t = new Set(b(Ig, this).map((e) => Pg(e)));
7964
- for (let e of b(Lg, this)) t.has(e) || b(Lg, this).delete(e);
7978
+ x(Lg, this, [...e]);
7979
+ let t = new Set(b(Lg, this).map((e) => Fg(e)));
7980
+ for (let e of b(Rg, this)) t.has(e) || b(Rg, this).delete(e);
7965
7981
  }
7966
- if (b(Ig, this).length === 0) return;
7967
- let t = b(Ig, this).filter((e) => !b(Lg, this).has(Pg(e)));
7968
- t.length === 0 && (b(Lg, this).clear(), t = b(Ig, this));
7982
+ if (b(Lg, this).length === 0) return;
7983
+ let t = b(Lg, this).filter((e) => !b(Rg, this).has(Fg(e)));
7984
+ t.length === 0 && (b(Rg, this).clear(), t = b(Lg, this));
7969
7985
  let n = t[0];
7970
- if (n) return b(Lg, this).add(Pg(n)), x(Rg, this, n), n;
7986
+ if (n) return b(Rg, this).add(Fg(n)), x(zg, this, n), n;
7971
7987
  }
7972
7988
  shiftedEdge() {
7973
- return b(Rg, this);
7989
+ return b(zg, this);
7974
7990
  }
7975
7991
  reset() {
7976
- x(Rg, this, void 0), x(Ig, this, []), b(Lg, this).clear();
7992
+ x(zg, this, void 0), x(Lg, this, []), b(Rg, this).clear();
7977
7993
  }
7978
- }, Bg, Vg = /* @__PURE__ */ new WeakMap(), Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakSet(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = class n {
7994
+ }, Vg, Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = /* @__PURE__ */ new WeakMap(), r_ = /* @__PURE__ */ new WeakSet(), i_ = /* @__PURE__ */ new WeakMap(), a_ = /* @__PURE__ */ new WeakMap(), o_ = class n {
7979
7995
  constructor(r, i, a) {
7980
7996
  var o = this;
7981
- S(this, $g), 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, Vg, new _(10)), v(this, Hg, !0), v(this, Ug, void 0), v(this, Wg, 0), v(this, Gg, 0), v(this, Kg, 0), v(this, qg, void 0), v(this, Jg, void 0), v(this, Yg, void 0), v(this, Xg, void 0), e(this, "unload", () => {
7997
+ S(this, r_), 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, Hg, new _(10)), v(this, Ug, !0), v(this, Wg, void 0), v(this, Gg, 0), v(this, Kg, 0), v(this, qg, 0), v(this, Jg, void 0), v(this, Yg, void 0), v(this, Xg, void 0), v(this, Zg, void 0), v(this, Qg, void 0), v(this, $g, void 0), e(this, "unload", () => {
7982
7998
  var e;
7983
- this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), x(Yg, this, void 0), this.logger.debug("Unloaded module");
7999
+ this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), x(Qg, this, void 0), this.logger.debug("Unloaded module");
7984
8000
  }), e(this, "suspend", () => {
7985
8001
  var e;
7986
- x(Hg, this, !1), (e = this.connectionImpl) == null || e.suspend();
8002
+ x(Ug, this, !1), (e = this.connectionImpl) == null || e.suspend();
7987
8003
  }), e(this, "unsuspend", () => {
7988
8004
  var e;
7989
- x(Hg, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
8005
+ x(Ug, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7990
8006
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
7991
- let e = b(Gg, this) > 0 ? b(Kg, this) / b(Gg, this) : 0;
8007
+ let e = b(Kg, this) > 0 ? b(qg, this) / b(Kg, this) : 0;
7992
8008
  return this.connectionImpl ? C(C({}, this.connectionImpl.getStatistics()), {}, {
7993
- rtt: jt(b(Vg, this).items()),
8009
+ rtt: jt(b(Hg, this).items()),
7994
8010
  estimatedBandwidth: this.estimatedBandwidth,
7995
- connectCount: b(Kg, this),
7996
- connectionAttemptCount: b(Gg, this),
7997
- connectionSuccessRatio: e
8011
+ connectCount: b(qg, this),
8012
+ connectionAttemptCount: b(Kg, this),
8013
+ connectionSuccessRatio: e,
8014
+ timeToConnected: b(Zg, this)
7998
8015
  }) : {
7999
8016
  rtt: {
8000
8017
  min: 0,
@@ -8003,20 +8020,23 @@ var Pg = (e) => {
8003
8020
  last: 0
8004
8021
  },
8005
8022
  estimatedBandwidth: 0,
8006
- connectCount: b(Kg, this),
8007
- connectionAttemptCount: b(Gg, this),
8023
+ connectCount: b(qg, this),
8024
+ connectionAttemptCount: b(Kg, this),
8008
8025
  connectionSuccessRatio: e,
8026
+ timeToConnected: b(Zg, this),
8009
8027
  connectionProtocol: void 0,
8010
8028
  transportSelectionReason: void 0
8011
8029
  };
8012
8030
  }), e(this, "connect", () => {
8013
- x(Hg, this, !0), !b(Ug, this) && x(Ug, this, y($g, this, r_).call(this));
8031
+ x(Ug, this, !0), !b(Wg, this) && (b(Zg, this) === void 0 && x(Jg, this, performance.now()), x(Wg, this, y(r_, this, s_).call(this)));
8032
+ }), v(this, e_, () => {
8033
+ b(Zg, this) !== void 0 || b(Jg, this) === void 0 || !b(Ug, this) || (x(Zg, this, performance.now() - b(Jg, this)), x(Jg, this, void 0));
8014
8034
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
8015
8035
  var t;
8016
- x(Hg, this, !1), b(t_, this).call(this), (t = this.connectionImpl) == null || t.close(e);
8036
+ x(Ug, this, !1), b(a_, this).call(this), (t = this.connectionImpl) == null || t.close(e);
8017
8037
  }), e(this, "reconnect", (e) => {
8018
8038
  this.disconnect(e), this.connect();
8019
- }), v(this, Zg, t(function* () {
8039
+ }), v(this, t_, t(function* () {
8020
8040
  try {
8021
8041
  return yield o.apiClient.connect(o.config.options.getOptions());
8022
8042
  } catch (e) {
@@ -8027,7 +8047,7 @@ var Pg = (e) => {
8027
8047
  }
8028
8048
  throw o.emitter.emit("error", te(e instanceof Error ? e : void 0)), e;
8029
8049
  }
8030
- })), v(this, Qg, t(function* () {
8050
+ })), v(this, n_, t(function* () {
8031
8051
  let e = Date.now(), t = () => Date.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = setTimeout(() => r == null ? void 0 : r.abort(), n.PING_TIMEOUT);
8032
8052
  try {
8033
8053
  return yield fetch(new URL("/api/v4/connect/ping", o.config.options.get("url")).toString(), {
@@ -8039,56 +8059,58 @@ var Pg = (e) => {
8039
8059
  } finally {
8040
8060
  clearTimeout(i);
8041
8061
  }
8042
- })), v(this, e_, () => {
8043
- b(t_, this).call(this), x(Xg, this, setTimeout(() => {
8062
+ })), v(this, i_, () => {
8063
+ b(a_, this).call(this), x($g, this, setTimeout(() => {
8044
8064
  var e;
8045
- !b(Yg, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), b(Yg, this).reset(), x(Xg, this, void 0));
8065
+ !b(Qg, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), b(Qg, this).reset(), x($g, this, void 0));
8046
8066
  }, n.EDGE_SELECTOR_RESET_TIMEOUT));
8047
- }), v(this, t_, () => {
8048
- b(Xg, this) !== void 0 && (clearTimeout(b(Xg, this)), x(Xg, this, void 0));
8067
+ }), v(this, a_, () => {
8068
+ b($g, this) !== void 0 && (clearTimeout(b($g, this)), x($g, this, void 0));
8049
8069
  }), this.logger = i, this.emitter = r, this.config = a, this.apiClient = new ge({
8050
8070
  publicEndpoint: this.config.options.get("url").toString(),
8051
8071
  tokenFactory: () => this.config.options.get("authenticationToken")
8052
8072
  });
8053
8073
  }
8054
8074
  get rtt() {
8055
- return b(Vg, this).items().length > 0 ? Ot(b(Vg, this).items()) : 0;
8075
+ return b(Hg, this).items().length > 0 ? Ot(b(Hg, this).items()) : 0;
8056
8076
  }
8057
8077
  get estimatedBandwidth() {
8058
- return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : Mg(this.rtt);
8078
+ return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : Ng(this.rtt);
8059
8079
  }
8060
8080
  get firstConnectionTime() {
8061
- return b(qg, this);
8081
+ return b(Yg, this);
8062
8082
  }
8063
8083
  get lastConnectionTime() {
8064
- return b(Jg, this);
8084
+ return b(Xg, this);
8065
8085
  }
8066
8086
  };
8067
- Bg = n_;
8068
- function r_() {
8087
+ Vg = o_;
8088
+ function s_() {
8069
8089
  var e = this;
8070
8090
  return t(function* () {
8071
- let t = new zg({ edgeUrl: e.config.options.get("edgeUrl") });
8072
- for (x(Yg, e, t), b(t_, e).call(e), x(Wg, e, 0);;) {
8091
+ let t = new Bg({ edgeUrl: e.config.options.get("edgeUrl") });
8092
+ for (x(Qg, e, t), b(a_, e).call(e), x(Gg, e, 0);;) {
8073
8093
  var n, r, i;
8074
- x(Wg, e, (n = b(Wg, e), n++, n)), x(Gg, e, (r = b(Gg, e), r++, r));
8094
+ x(Gg, e, (n = b(Gg, e), n++, n)), x(Kg, e, (r = b(Kg, e), r++, r));
8075
8095
  let o = !1;
8076
8096
  try {
8077
8097
  var a;
8078
- let [n, r] = yield Promise.all([b(Zg, e).call(e), b(Qg, e).call(e)]);
8079
- if (b(Vg, e).clear(), r !== void 0 && b(Vg, e).push(r / 2), !b(Hg, e)) break;
8098
+ let [n, r] = yield Promise.all([b(t_, e).call(e), b(n_, e).call(e)]);
8099
+ if (b(Hg, e).clear(), r !== void 0 && b(Hg, e).push(r / 2), !b(Ug, e)) break;
8080
8100
  let i = t.select(n.edges);
8081
8101
  if (!i) throw new g("Failed to resolve edge url", {
8082
8102
  isFatal: !0,
8083
8103
  code: "failed_to_resolve_edge_url"
8084
8104
  });
8085
- ce(n) ? e.connectionImpl = yield dg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
8105
+ ce(n) ? e.connectionImpl = yield fg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
8086
8106
  connectInfo: n,
8087
- edgeUrl: i
8088
- }), b(Vg, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Ng.start(e.emitter, e.logger, C(C({}, e.config), {}, {
8107
+ edgeUrl: i,
8108
+ onTransportConnected: b(e_, e)
8109
+ }), b(Hg, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Pg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
8089
8110
  connectInfo: n,
8090
- edgeUrl: i
8091
- }), b(Vg, e))), b(e_, e).call(e), x(Kg, e, (a = b(Kg, e), a++, a)), x(Wg, e, 0), x(Jg, e, Date.now()), b(qg, e) || x(qg, e, b(Jg, e)), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
8111
+ edgeUrl: i,
8112
+ onTransportConnected: b(e_, e)
8113
+ }), b(Hg, e))), b(i_, e).call(e), x(qg, e, (a = b(qg, e), a++, a)), x(Gg, e, 0), x(Xg, e, Date.now()), b(Yg, e) || x(Yg, e, b(Xg, e)), b(e_, e).call(e), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
8092
8114
  } catch (n) {
8093
8115
  e.logger.warn("Failed to connect", n);
8094
8116
  let r = t.shiftedEdge();
@@ -8100,31 +8122,31 @@ function r_() {
8100
8122
  isFatal: !1
8101
8123
  }));
8102
8124
  }
8103
- if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, b(t_, e).call(e), o) {
8104
- x(Hg, e, !1);
8125
+ if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, b(a_, e).call(e), o) {
8126
+ x(Ug, e, !1);
8105
8127
  break;
8106
8128
  }
8107
- if (!b(Hg, e)) break;
8108
- if (!(yield e.config.reconnectHandler({ reconnectRetries: b(Wg, e) }))) {
8129
+ if (!b(Ug, e)) break;
8130
+ if (!(yield e.config.reconnectHandler({ reconnectRetries: b(Gg, e) }))) {
8109
8131
  e.emitter.emit("error", s());
8110
8132
  break;
8111
8133
  }
8112
- if (yield mn(1e3), !b(Hg, e)) break;
8134
+ if (yield mn(1e3), !b(Ug, e)) break;
8113
8135
  }
8114
- x(Yg, e, void 0), b(t_, e).call(e), x(Ug, e, void 0);
8136
+ x(Qg, e, void 0), b(a_, e).call(e), x(Wg, e, void 0);
8115
8137
  })();
8116
8138
  }
8117
- e(n_, "PING_TIMEOUT", 1e3), e(n_, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(n_, "create", (e, t, n) => new Bg(e, t, n));
8139
+ e(o_, "PING_TIMEOUT", 1e3), e(o_, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(o_, "create", (e, t, n) => new Vg(e, t, n));
8118
8140
  //#endregion
8119
8141
  //#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
8120
- var i_, a_ = () => ({
8142
+ var c_, l_ = () => ({
8121
8143
  video: C(C({}, bn()), {}, { bitRate: yn() }),
8122
8144
  audio: { bitRate: yn() }
8123
- }), o_ = () => ({
8145
+ }), u_ = () => ({
8124
8146
  width: window.innerWidth,
8125
8147
  height: window.innerHeight,
8126
8148
  bitRate: yn()
8127
- }), s_ = class t {
8149
+ }), d_ = class t {
8128
8150
  constructor(n, r, i, a) {
8129
8151
  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", () => {
8130
8152
  var e;
@@ -8146,7 +8168,7 @@ var i_, a_ = () => ({
8146
8168
  this.timers.unload();
8147
8169
  }), e(this, "setUserSpecifiedCap", (e) => {
8148
8170
  var t;
8149
- let n = (t = this.getUserSpecifiedCap()) == null ? a_() : t;
8171
+ let n = (t = this.getUserSpecifiedCap()) == null ? l_() : t;
8150
8172
  this.userSpecifiedCap = C(C({}, n), {}, {
8151
8173
  video: C(C({}, n.video), e.video),
8152
8174
  audio: C(C({}, n.audio), e.audio)
@@ -8170,7 +8192,7 @@ var i_, a_ = () => ({
8170
8192
  });
8171
8193
  }), e(this, "evaluateConstraintCap", () => {
8172
8194
  var e, t, n, r;
8173
- let i = this.sizeBasedResolutionCapEnabled ? C(C({}, a_()), {}, { video: o_() }) : a_();
8195
+ let i = this.sizeBasedResolutionCapEnabled ? C(C({}, l_()), {}, { video: u_() }) : l_();
8174
8196
  if (!this.resizeObserver) {
8175
8197
  let e = this.element.getBoundingClientRect();
8176
8198
  this.elementSize = {
@@ -8207,14 +8229,14 @@ var i_, a_ = () => ({
8207
8229
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
8208
8230
  }
8209
8231
  };
8210
- i_ = s_, e(s_, "CHECK_SIZE_INTERVAL", 1e3), e(s_, "create", (e, t, n, r) => new i_(e, t, n, r));
8232
+ c_ = d_, e(d_, "CHECK_SIZE_INTERVAL", 1e3), e(d_, "create", (e, t, n, r) => new c_(e, t, n, r));
8211
8233
  //#endregion
8212
8234
  //#region ../../libs/web-sdk/src/modules/DecoderModule.ts
8213
- var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8235
+ var f_ = 5, p_ = 100, m_ = 1e3, h_ = class r {
8214
8236
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
8215
8237
  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, "currentVideoDecodeRate", 2), e(this, "decodeRateGraceIntervals", 3), e(this, "isAudioEmitRetryScheduled", !1), e(this, "videoKeyframeTimestamps", []), e(this, "load", () => {
8216
- let e = this._audioWebCodecsInUse ? 20 : l_;
8217
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, u_), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8238
+ let e = this._audioWebCodecsInUse ? 20 : p_;
8239
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, m_), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8218
8240
  }), e(this, "unload", () => {
8219
8241
  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);
8220
8242
  }), e(this, "suspend", () => {
@@ -8271,7 +8293,7 @@ var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8271
8293
  if (this.isSuspended) return;
8272
8294
  t.sampleDuration = e.duration / e.timescale * 1e3;
8273
8295
  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];
8274
- if (!s || a - c_ > s.end ? i.push({
8296
+ if (!s || a - f_ > s.end ? i.push({
8275
8297
  start: a,
8276
8298
  end: a + o
8277
8299
  }) : a + o * 5 < s.end ? (t.buffer = [{
@@ -8391,7 +8413,7 @@ var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8391
8413
  return new r(e, i, t, s, p, m, h);
8392
8414
  })();
8393
8415
  }
8394
- }, f_, p_ = class {
8416
+ }, g_, __ = class {
8395
8417
  constructor(t) {
8396
8418
  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", () => {
8397
8419
  document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -8425,12 +8447,12 @@ var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8425
8447
  return document.visibilityState === "visible";
8426
8448
  }
8427
8449
  };
8428
- f_ = p_, e(p_, "create", (e) => new f_(e));
8450
+ g_ = __, e(__, "create", (e) => new g_(e));
8429
8451
  //#endregion
8430
8452
  //#region ../../libs/web-sdk/src/modules/EventModule.ts
8431
- var m_, h_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, g_ = class t {
8453
+ var v_, y_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, b_ = class t {
8432
8454
  constructor(n, r, i) {
8433
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", h_(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8455
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", y_(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8434
8456
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8435
8457
  }), e(this, "unload", () => {
8436
8458
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -8457,10 +8479,10 @@ var m_, h_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
8457
8479
  }), this.logger = r, this.emitter = n, this.timeSource = i;
8458
8480
  }
8459
8481
  };
8460
- m_ = g_, e(g_, "EVENT_TIMEOUT", 5e3), e(g_, "EVENT_CHECK_INTERVAL", 20), e(g_, "create", (e, t, n) => new m_(e, t, n));
8482
+ v_ = b_, e(b_, "EVENT_TIMEOUT", 5e3), e(b_, "EVENT_CHECK_INTERVAL", 20), e(b_, "create", (e, t, n) => new v_(e, t, n));
8461
8483
  //#endregion
8462
8484
  //#region ../../libs/web-sdk/src/modules/IncomingDataModule.ts
8463
- var __, v_ = class t {
8485
+ var x_, S_ = class t {
8464
8486
  constructor(n) {
8465
8487
  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", () => {
8466
8488
  this.emitter.on("connection state", this.onConnectionState), this.timers.setInterval(() => this.bytesReceived.forEach((e) => e.tick()), 100);
@@ -8495,10 +8517,10 @@ var __, v_ = class t {
8495
8517
  }), this.emitter = n;
8496
8518
  }
8497
8519
  };
8498
- __ = v_, e(v_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(v_, "NO_DATA_TIMEOUT", 5 * 1e3), e(v_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(v_, "create", (e) => new __(e));
8520
+ x_ = S_, e(S_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(S_, "NO_DATA_TIMEOUT", 5 * 1e3), e(S_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(S_, "create", (e) => new x_(e));
8499
8521
  //#endregion
8500
8522
  //#region ../../libs/web-sdk/src/modules/JitterModule.ts
8501
- var y_ = 1e3, b_ = 50, x_ = class t {
8523
+ var C_ = 1e3, w_ = 50, T_ = class t {
8502
8524
  constructor(t) {
8503
8525
  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", () => {
8504
8526
  this.logger.debug("JitterModule loaded");
@@ -8519,9 +8541,9 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8519
8541
  this.trackingState.set(a, {
8520
8542
  lastArrivalTime: o,
8521
8543
  lastTimestampMs: s,
8522
- jitterSamples: new _(y_),
8523
- interArrivalTimes: new _(y_)
8524
- }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(b_));
8544
+ jitterSamples: new _(C_),
8545
+ interArrivalTimes: new _(C_)
8546
+ }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(w_));
8525
8547
  return;
8526
8548
  }
8527
8549
  let l = s - c.lastTimestampMs;
@@ -8534,7 +8556,7 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8534
8556
  let f = (i = this.runningJitter.get(a)) == null ? 0 : i, p = f + (d - f) / 16;
8535
8557
  this.runningJitter.set(a, p);
8536
8558
  let m = this.recentJitterSamples.get(a);
8537
- m || (m = new _(b_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8559
+ m || (m = new _(w_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8538
8560
  }
8539
8561
  getJitterForType(e) {
8540
8562
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -8565,10 +8587,10 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8565
8587
  videoJitter: this.getJitterForType("video")
8566
8588
  };
8567
8589
  }
8568
- }, S_ = () => window.AudioContext || window.webkitAudioContext, C_ = class n extends _e {
8590
+ }, E_ = () => window.AudioContext || window.webkitAudioContext, D_ = class n extends _e {
8569
8591
  constructor() {
8570
8592
  var r;
8571
- super(), r = this, e(this, "context", new (S_())()), 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* () {
8593
+ super(), r = this, e(this, "context", new (E_())()), 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* () {
8572
8594
  try {
8573
8595
  return yield Promise.race([r.context.resume(), hn(1e3, p())]);
8574
8596
  } catch (e) {
@@ -8597,10 +8619,10 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8597
8619
  return this.context.state;
8598
8620
  }
8599
8621
  };
8600
- e(C_, "CHECK_INTERVAL", 1e3);
8622
+ e(D_, "CHECK_INTERVAL", 1e3);
8601
8623
  //#endregion
8602
8624
  //#region ../../libs/web-audio-player/src/AudioPlayer.ts
8603
- var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_ ? 2 : 5, O_ = class extends _e {
8625
+ var O_, k_ = 150, A_ = 400, j_ = (e) => e === void 0 ? 5 : e <= k_ ? 1 : e <= A_ ? 2 : 5, M_ = class extends _e {
8604
8626
  get isContextRunning() {
8605
8627
  var e;
8606
8628
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -8641,7 +8663,7 @@ var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_
8641
8663
  return this._bufferTime;
8642
8664
  }
8643
8665
  set bufferTime(e) {
8644
- this._bufferTime = e, this.audioBufferMultiplier = D_(e);
8666
+ this._bufferTime = e, this.audioBufferMultiplier = j_(e);
8645
8667
  }
8646
8668
  get audioNode() {
8647
8669
  return this.splitter;
@@ -8731,14 +8753,14 @@ var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_
8731
8753
  }
8732
8754
  })), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
8733
8755
  var e, t, n;
8734
- return (e = this.audio) == null || e.unload(), this.audio = new C_(), this.audio.on("state", (e) => {
8756
+ return (e = this.audio) == null || e.unload(), this.audio = new D_(), this.audio.on("state", (e) => {
8735
8757
  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);
8736
8758
  }), this.audio.on("stuck", () => {
8737
8759
  this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(o), this.emit("stuck"));
8738
8760
  }), (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;
8739
8761
  }), e(this, "setGain", (e) => {
8740
8762
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
8741
- }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = D_(s);
8763
+ }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = j_(s);
8742
8764
  }
8743
8765
  useMediaStreamDestination() {
8744
8766
  var e;
@@ -8751,10 +8773,10 @@ var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_
8751
8773
  return (e = this.gainNode) == null || e.connect(t), t;
8752
8774
  }
8753
8775
  };
8754
- w_ = O_, e(O_, "create", (e, t, n) => new w_(e, t, n));
8776
+ O_ = M_, e(M_, "create", (e, t, n) => new O_(e, t, n));
8755
8777
  //#endregion
8756
8778
  //#region ../../libs/web-sdk/src/players/VideoPlayer.ts
8757
- var k_, A_ = class {
8779
+ var N_, P_ = class {
8758
8780
  constructor(t, n, r, i, a, o) {
8759
8781
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new or()), 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", () => {
8760
8782
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -8844,12 +8866,12 @@ var k_, A_ = class {
8844
8866
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
8845
8867
  }
8846
8868
  };
8847
- k_ = A_, e(A_, "create", (e, t, n, r, i, a) => new k_(e, t, n, r, i, a));
8869
+ N_ = P_, e(P_, "create", (e, t, n, r, i, a) => new N_(e, t, n, r, i, a));
8848
8870
  //#endregion
8849
8871
  //#region ../../libs/web-sdk/src/TextTracks.ts
8850
- var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8872
+ var F_ = /* @__PURE__ */ new WeakMap(), I_ = class {
8851
8873
  constructor() {
8852
- v(this, j_, []), x(j_, this, []);
8874
+ v(this, F_, []), x(F_, this, []);
8853
8875
  }
8854
8876
  addTextTrack(e, t, n) {
8855
8877
  let r = [], i = {
@@ -8866,37 +8888,37 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8866
8888
  t !== -1 && r.splice(t, 1);
8867
8889
  }
8868
8890
  };
8869
- return b(j_, this).push(i), i;
8891
+ return b(F_, this).push(i), i;
8870
8892
  }
8871
8893
  set language(e) {
8872
- b(j_, this).forEach((t) => {
8894
+ b(F_, this).forEach((t) => {
8873
8895
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
8874
8896
  });
8875
8897
  }
8876
8898
  get language() {
8877
8899
  var e;
8878
- return (e = b(j_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8900
+ return (e = b(F_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8879
8901
  }
8880
8902
  getActiveCues(e) {
8881
- let t = b(j_, this).find((e) => e.mode === "showing");
8903
+ let t = b(F_, this).find((e) => e.mode === "showing");
8882
8904
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e <= n) : [];
8883
8905
  }
8884
- }, N_ = (e, t) => {
8906
+ }, L_ = (e, t) => {
8885
8907
  let n;
8886
8908
  for (n = t; e > 1; e--) n += t;
8887
8909
  return n;
8888
- }, P_ = class {
8910
+ }, R_ = class {
8889
8911
  constructor() {
8890
8912
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(o));
8891
8913
  let t = document.createElement("div");
8892
8914
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8893
8915
  let n = t.children.item(0);
8894
- 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" + N_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + N_(16, "gICA") + N_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + N_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + N_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + N_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + N_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8916
+ 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" + L_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + L_(16, "gICA") + L_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + L_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + L_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + L_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + L_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8895
8917
  else throw Error("Failed to create audio tag");
8896
8918
  }
8897
- }, F_, I_ = class {
8919
+ }, z_, B_ = class {
8898
8920
  constructor(t, n, r, i, a, o, s, c) {
8899
- 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 P_()), 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 M_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8921
+ 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 R_()), 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 I_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8900
8922
  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());
8901
8923
  }), e(this, "unload", () => {
8902
8924
  this.emitter.off("target buffer time", this.onTargetBufferTime), 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;
@@ -8932,7 +8954,7 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8932
8954
  e instanceof Error && this.emitter.emit("error", re(!1, e));
8933
8955
  }
8934
8956
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
8935
- }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = O_.create(this.logger.createContext("AudioPlayerModule"), i, {
8957
+ }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = M_.create(this.logger.createContext("AudioPlayerModule"), i, {
8936
8958
  muted: a,
8937
8959
  reInitWhenStuck: !0,
8938
8960
  bufferTime: c
@@ -8943,7 +8965,7 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8943
8965
  volume: this.volume,
8944
8966
  isMuted: this.muted
8945
8967
  });
8946
- }), this.videoPlayer = A_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8968
+ }), this.videoPlayer = P_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8947
8969
  }
8948
8970
  get volume() {
8949
8971
  return this.audioPlayer.volume;
@@ -8999,12 +9021,12 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8999
9021
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
9000
9022
  }
9001
9023
  };
9002
- F_ = I_, e(I_, "create", (e, t, n, r, i, a, o, s) => new F_(e, t, n, r, i, a, o, s));
9024
+ z_ = B_, e(B_, "create", (e, t, n, r, i, a, o, s) => new z_(e, t, n, r, i, a, o, s));
9003
9025
  //#endregion
9004
9026
  //#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
9005
- var L_, R_ = class {
9027
+ var V_, H_ = class {
9006
9028
  constructor(t, n, r, i, { muted: a, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d }) {
9007
- 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 M_()), e(this, "reset", () => {}), e(this, "load", () => {
9029
+ 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 I_()), e(this, "reset", () => {}), e(this, "load", () => {
9008
9030
  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(() => {
9009
9031
  if (!this.textTracks.language) {
9010
9032
  this.clearNativeTrackCues();
@@ -9091,7 +9113,7 @@ var L_, R_ = class {
9091
9113
  this.updateVolumeState(), !e.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(o), e.isMuted || (this._userProvidedMuted = !1);
9092
9114
  }), this.mediaElement.on("media element state", (e) => {
9093
9115
  e === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", e);
9094
- }), this.audioPlayer = O_.create(this.logger.createContext("AudioPlayerModule"), i, {
9116
+ }), this.audioPlayer = M_.create(this.logger.createContext("AudioPlayerModule"), i, {
9095
9117
  muted: !1,
9096
9118
  reInitWhenStuck: !1,
9097
9119
  bufferTime: d
@@ -9099,7 +9121,7 @@ var L_, R_ = class {
9099
9121
  this.isDisconnected = !0;
9100
9122
  }), this.audioPlayer.on("state change", (e) => {
9101
9123
  e === "suspended" || e === "interrupted" ? this.mediaElement.muted = !0 : e === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
9102
- }), this.videoPlayer = A_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
9124
+ }), this.videoPlayer = P_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
9103
9125
  volume: this.volume,
9104
9126
  isMuted: this.muted
9105
9127
  };
@@ -9157,10 +9179,10 @@ var L_, R_ = class {
9157
9179
  this.mediaElement.pause();
9158
9180
  }
9159
9181
  };
9160
- L_ = R_, e(R_, "create", (e, t, n, r, i) => new L_(e, t, n, r, i));
9182
+ V_ = H_, e(H_, "create", (e, t, n, r, i) => new V_(e, t, n, r, i));
9161
9183
  //#endregion
9162
9184
  //#region ../../libs/mse/src/AsyncSourceBuffer.ts
9163
- var z_ = () => (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)), V_ = (e) => (t) => t.appendBuffer(e), H_ = (e) => (t) => t.changeType(e), U_ = (e) => (t) => e(t), W_ = class {
9185
+ var U_ = () => (e) => W_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), W_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), G_ = (e) => (t) => t.appendBuffer(e), K_ = (e) => (t) => t.changeType(e), q_ = (e) => (t) => e(t), J_ = class {
9164
9186
  constructor(t) {
9165
9187
  e(this, "commandQueue", []), e(this, "sourceBuffer", void 0), e(this, "errorCallback", void 0), e(this, "currentInit", void 0), e(this, "setErrorCallback", (e) => {
9166
9188
  this.errorCallback = e;
@@ -9174,30 +9196,30 @@ var z_ = () => (e) => B_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9174
9196
  }
9175
9197
  }), e(this, "appendBuffer", (e, t) => new Promise((n, r) => {
9176
9198
  if (t && this.currentInit !== t) {
9177
- let e = new Dt(V_(t), n, r);
9199
+ let e = new Dt(G_(t), n, r);
9178
9200
  this.commandQueue.push(e), this.currentInit = t;
9179
9201
  }
9180
- let i = new Dt(V_(e), n, r);
9202
+ let i = new Dt(G_(e), n, r);
9181
9203
  this.commandQueue.push(i), this.handleQueue();
9182
9204
  })), e(this, "execute", (e) => new Promise((t, n) => {
9183
- let r = new Dt(U_(e), t, n);
9205
+ let r = new Dt(q_(e), t, n);
9184
9206
  this.commandQueue.push(r), this.handleQueue();
9185
9207
  })), e(this, "buffered", () => this.sourceBuffer.buffered), e(this, "removeFromMediaSource", (e) => {
9186
9208
  this.dispose(), e.removeSourceBuffer(this.sourceBuffer);
9187
9209
  }), e(this, "dispose", () => {
9188
9210
  this.sourceBuffer.removeEventListener("updateend", this.handleQueue), this.sourceBuffer.removeEventListener("error", this.onError), this.commandQueue = [], this.errorCallback = void 0;
9189
9211
  }), e(this, "changeType", (e) => new Promise((t, n) => {
9190
- let r = new Dt(H_(e), t, n);
9212
+ let r = new Dt(K_(e), t, n);
9191
9213
  this.commandQueue.push(r), this.handleQueue();
9192
9214
  })), e(this, "removeBuffer", (e, t) => new Promise((n, r) => {
9193
- let i = new Dt(B_(e, t), n, r);
9215
+ let i = new Dt(W_(e, t), n, r);
9194
9216
  this.commandQueue.push(i), this.handleQueue();
9195
9217
  })), e(this, "flush", () => new Promise((e, t) => {
9196
- let n = new Dt(z_, e, t);
9218
+ let n = new Dt(U_, e, t);
9197
9219
  this.commandQueue.push(n), this.handleQueue();
9198
9220
  })), this.sourceBuffer = t, this.sourceBuffer.addEventListener("updateend", this.handleQueue), this.sourceBuffer.addEventListener("error", this.onError);
9199
9221
  }
9200
- }, G_ = class extends _e {
9222
+ }, Y_ = class extends _e {
9201
9223
  constructor() {
9202
9224
  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) => {
9203
9225
  let t = e;
@@ -9213,7 +9235,7 @@ var z_ = () => (e) => B_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9213
9235
  this.mediaSource.endOfStream();
9214
9236
  } catch (e) {}
9215
9237
  e.srcObject && (e.srcObject = null), e.src !== "" && (URL.revokeObjectURL(e.src), e.removeAttribute("src")), e.load();
9216
- }), e(this, "addSourceBuffer", (e) => new W_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9238
+ }), e(this, "addSourceBuffer", (e) => new J_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9217
9239
  e.removeFromMediaSource(this.mediaSource);
9218
9240
  }), e(this, "endOfStream", (e) => {
9219
9241
  this.mediaSource.endOfStream(e);
@@ -9230,13 +9252,13 @@ var z_ = () => (e) => B_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9230
9252
  }), this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
9231
9253
  }
9232
9254
  };
9233
- e(G_, "isTypeSupported", (e) => {
9255
+ e(Y_, "isTypeSupported", (e) => {
9234
9256
  var t, n;
9235
9257
  return (t = (n = Ve()) == null ? void 0 : n.isTypeSupported(e)) == null ? !1 : t;
9236
9258
  });
9237
9259
  //#endregion
9238
9260
  //#region ../../libs/web-sdk/src/modules/MseModule.ts
9239
- var K_, q_ = class {
9261
+ var X_, Z_ = class {
9240
9262
  constructor() {
9241
9263
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
9242
9264
  var r;
@@ -9248,7 +9270,7 @@ var K_, q_ = class {
9248
9270
  });
9249
9271
  }
9250
9272
  };
9251
- function J_(e, { mediaSource: t, mimeType: n, codec: r }) {
9273
+ function Q_(e, { mediaSource: t, mimeType: n, codec: r }) {
9252
9274
  return C(C({}, e), {}, {
9253
9275
  state: "initialized",
9254
9276
  mimeType: n,
@@ -9260,10 +9282,10 @@ function J_(e, { mediaSource: t, mimeType: n, codec: r }) {
9260
9282
  lastBufferCleanupTime: Date.now()
9261
9283
  });
9262
9284
  }
9263
- function Y_({ initSegments: e, pendingSamples: t }) {
9285
+ function $_({ initSegments: e, pendingSamples: t }) {
9264
9286
  return {
9265
9287
  state: "uninitialized",
9266
- initSegments: e == null ? new q_() : e,
9288
+ initSegments: e == null ? new Z_() : e,
9267
9289
  sequenceNumber: 0,
9268
9290
  isWorkingOnPendingSamples: !1,
9269
9291
  hasFirstSync: t.some((e) => e.isSync),
@@ -9273,10 +9295,10 @@ function Y_({ initSegments: e, pendingSamples: t }) {
9273
9295
  successfulAppendCalls: 0
9274
9296
  };
9275
9297
  }
9276
- var X_ = class {
9298
+ var ev = class {
9277
9299
  constructor(n, a, s) {
9278
9300
  var u = this;
9279
- 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 G_()), 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, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
9301
+ 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 Y_()), 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, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
9280
9302
  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);
9281
9303
  }), e(this, "unload", () => {
9282
9304
  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.mediaElement.removeEventListener("waiting", this.onPlaybackStall), this.mediaElement.removeEventListener("stalled", this.onPlaybackStall), this.mediaElement.removeEventListener("playing", this.onPlaybackProgress), this.mediaElement.removeEventListener("pause", this.onPlaybackPauseOrSeek), this.mediaElement.removeEventListener("seeking", this.onPlaybackPauseOrSeek), this.mediaSource.detach(this.mediaElement), this.trackContexts.forEach((e) => {
@@ -9313,7 +9335,7 @@ var X_ = class {
9313
9335
  var n, r, i;
9314
9336
  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;
9315
9337
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
9316
- let l = Y_({
9338
+ let l = $_({
9317
9339
  pendingSamples: o,
9318
9340
  initSegments: s
9319
9341
  });
@@ -9324,14 +9346,14 @@ var X_ = class {
9324
9346
  this.trackContexts.forEach((e, n) => {
9325
9347
  if (t.has(n)) return;
9326
9348
  e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
9327
- let r = Y_({
9349
+ let r = $_({
9328
9350
  pendingSamples: [],
9329
9351
  initSegments: e.initSegments
9330
9352
  });
9331
9353
  this.trackContexts.set(n, r);
9332
9354
  });
9333
9355
  }), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
9334
- let n = J_(e, {
9356
+ let n = Q_(e, {
9335
9357
  mimeType: t.mimeType,
9336
9358
  mediaSource: this.mediaSource,
9337
9359
  codec: t.codec
@@ -9358,9 +9380,9 @@ var X_ = class {
9358
9380
  }
9359
9381
  for (let t of e) {
9360
9382
  let n = u.trackContexts.get(t.type);
9361
- if (n || (n = Y_({
9383
+ if (n || (n = $_({
9362
9384
  pendingSamples: [],
9363
- initSegments: new q_()
9385
+ initSegments: new Z_()
9364
9386
  }), u.trackContexts.set(t.type, n)), n.state === "initialized") {
9365
9387
  if (t.mimeType !== n.sourceBufferMimeType) try {
9366
9388
  yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
@@ -9376,7 +9398,7 @@ var X_ = class {
9376
9398
  u.logger.warn("removeSourceBuffer failed", { removeError: t }), u.reopenMediaSource("changeType recovery failed"), u.pendingTracksToAddSourceBuffers = e;
9377
9399
  return;
9378
9400
  }
9379
- let i = Y_({
9401
+ let i = $_({
9380
9402
  pendingSamples: n.pendingSamples,
9381
9403
  initSegments: n.initSegments
9382
9404
  });
@@ -9400,7 +9422,7 @@ var X_ = class {
9400
9422
  };
9401
9423
  }), e(this, "getNextBufferedRangeStart", (e) => {
9402
9424
  let t = this.getCommonBufferedRangesForCurrentTracks();
9403
- if (t) return Q_(e, t);
9425
+ if (t) return nv(e, t);
9404
9426
  }), e(this, "getVideoKeyframeTimestamps", () => this.videoKeyframeTimestamps), e(this, "init", ({ initSegment: e, mimeType: t }) => {
9405
9427
  this.logger.debug("Added init segment", {
9406
9428
  channel: e.channelId,
@@ -9499,7 +9521,7 @@ var X_ = class {
9499
9521
  let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
9500
9522
  r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
9501
9523
  }
9502
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || rv(t, this.append, this.maxChunkSize).catch((n) => {
9524
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || sv(t, this.append, this.maxChunkSize).catch((n) => {
9503
9525
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
9504
9526
  if (!this.isCurrentTrackContext(e.type, t)) {
9505
9527
  this.logger.debug("Suppressing append error from stale track context", { type: e.type });
@@ -9583,14 +9605,14 @@ var X_ = class {
9583
9605
  if (this.mediaSource.isClosed()) return;
9584
9606
  let e = this.getInitializedTrackBuffers();
9585
9607
  if (e.length !== 0) return this.getCommonBufferedRanges(e);
9586
- }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => $_(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => Z_(e, t) ? "playing" : "buffering"), this.logger = n, this.mediaElement = s, this.emitter = a;
9608
+ }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => rv(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => tv(e, t) ? "playing" : "buffering"), this.logger = n, this.mediaElement = s, this.emitter = a;
9587
9609
  }
9588
9610
  };
9589
- K_ = X_, e(X_, "create", (e, t, n) => {
9590
- let r = new K_(e, t, n);
9611
+ X_ = ev, e(ev, "create", (e, t, n) => {
9612
+ let r = new X_(e, t, n);
9591
9613
  return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), n.addEventListener("waiting", r.onPlaybackStall), n.addEventListener("stalled", r.onPlaybackStall), n.addEventListener("playing", r.onPlaybackProgress), n.addEventListener("pause", r.onPlaybackPauseOrSeek), n.addEventListener("seeking", r.onPlaybackPauseOrSeek), r.mediaSource.attach(n), r;
9592
9614
  });
9593
- var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9615
+ var tv = (e, t) => t.some((t) => t.start <= e && e < t.end), nv = (e, t) => {
9594
9616
  for (let r = 0; r < t.length; r++) {
9595
9617
  let i = t[r];
9596
9618
  if (i) {
@@ -9601,7 +9623,7 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9601
9623
  }
9602
9624
  }
9603
9625
  }
9604
- }, $_ = (e, t) => {
9626
+ }, rv = (e, t) => {
9605
9627
  let n = [], r = 0, i = 0;
9606
9628
  for (; r < e.length && i < t.length;) {
9607
9629
  let a = e[r], o = t[i];
@@ -9613,20 +9635,20 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9613
9635
  }), a.end <= o.end ? r++ : i++;
9614
9636
  }
9615
9637
  return n;
9616
- }, ev = (e, t) => {
9638
+ }, iv = (e, t) => {
9617
9639
  var n;
9618
9640
  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;
9619
9641
  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;
9620
- }, tv = 32, nv = (e) => {
9642
+ }, av = 32, ov = (e) => {
9621
9643
  let t = e.pendingSamplesOffset;
9622
9644
  if (t !== 0) {
9623
9645
  if (t >= e.pendingSamples.length) {
9624
9646
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
9625
9647
  return;
9626
9648
  }
9627
- t < tv || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9649
+ t < av || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9628
9650
  }
9629
- }, rv = function() {
9651
+ }, sv = function() {
9630
9652
  var e = t(function* (e, t, n) {
9631
9653
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
9632
9654
  let r = [], i = e.pendingSamplesOffset;
@@ -9634,7 +9656,7 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9634
9656
  i = t;
9635
9657
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
9636
9658
  if (a && (r.push(a), o)) {
9637
- if (ev(a, o)) break;
9659
+ if (iv(a, o)) break;
9638
9660
  let e = (a.timestamp + a.duration) / a.timescale;
9639
9661
  if (o.timestamp / o.timescale - e > .1) break;
9640
9662
  }
@@ -9642,14 +9664,14 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9642
9664
  }
9643
9665
  let a = r[0];
9644
9666
  if (!a) break;
9645
- yield t(r, e.previousSample ? ev(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], nv(e);
9667
+ yield t(r, e.previousSample ? iv(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], ov(e);
9646
9668
  }
9647
9669
  e.isWorkingOnPendingSamples = !1;
9648
9670
  });
9649
9671
  return function(t, n, r) {
9650
9672
  return e.apply(this, arguments);
9651
9673
  };
9652
- }(), iv, av = class {
9674
+ }(), cv, lv = class {
9653
9675
  constructor(n, r) {
9654
9676
  var i = this;
9655
9677
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -9681,10 +9703,10 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9681
9703
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && xt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
9682
9704
  }
9683
9705
  };
9684
- iv = av, e(av, "create", (e, t) => new iv(e, t));
9706
+ cv = lv, e(lv, "create", (e, t) => new cv(e, t));
9685
9707
  //#endregion
9686
9708
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
9687
- var ov, sv = class {
9709
+ var uv, dv = class {
9688
9710
  constructor(t, n, r, i) {
9689
9711
  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", () => {
9690
9712
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -9702,24 +9724,24 @@ var ov, sv = class {
9702
9724
  }), 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);
9703
9725
  }
9704
9726
  };
9705
- ov = sv, e(sv, "create", (e, t, n, r) => new ov(e, t, n, r));
9727
+ uv = dv, e(dv, "create", (e, t, n, r) => new uv(e, t, n, r));
9706
9728
  //#endregion
9707
9729
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
9708
- var cv, lv = () => ({
9730
+ var fv, pv = () => ({
9709
9731
  upgradesFromLevel: [],
9710
9732
  downgradesFromLevel: [],
9711
9733
  bufferingRanges: [],
9712
9734
  activeRanges: [],
9713
9735
  decodeRate: 2 ** 53 - 1
9714
- }), uv = () => ({
9736
+ }), mv = () => ({
9715
9737
  levels: {},
9716
9738
  levelDowngrades: [],
9717
9739
  levelUpgrades: [],
9718
9740
  bufferFullness: 0,
9719
- general: lv()
9720
- }), dv = class {
9741
+ general: pv()
9742
+ }), hv = class {
9721
9743
  constructor(t, n, r) {
9722
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", uv()), 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", () => {
9744
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", mv()), 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", () => {
9723
9745
  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);
9724
9746
  }), e(this, "unload", () => {
9725
9747
  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();
@@ -9787,14 +9809,14 @@ var cv, lv = () => ({
9787
9809
  let d = !1;
9788
9810
  if (e.from) {
9789
9811
  var f;
9790
- let e = (f = this.metrics.levels[l]) == null ? lv() : f;
9812
+ let e = (f = this.metrics.levels[l]) == null ? pv() : f;
9791
9813
  l < u ? e.upgradesFromLevel.push(Date.now()) : e.downgradesFromLevel.push(Date.now()), sn(e.activeRanges);
9792
9814
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
9793
9815
  d = !!t && !t.end, sn(e.bufferingRanges), this.metrics.levels[l] = e;
9794
9816
  }
9795
9817
  if (e.to) {
9796
9818
  var p;
9797
- let e = (p = this.metrics.levels[u]) == null ? lv() : p;
9819
+ let e = (p = this.metrics.levels[u]) == null ? pv() : p;
9798
9820
  cn(e.activeRanges), d && cn(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
9799
9821
  }
9800
9822
  }), e(this, "onBufferFullness", (e) => {
@@ -9863,10 +9885,10 @@ var cv, lv = () => ({
9863
9885
  cn(this.metrics.general.activeRanges);
9864
9886
  }
9865
9887
  };
9866
- cv = dv, e(dv, "create", (e, t, n) => new cv(e, t, n));
9888
+ fv = hv, e(hv, "create", (e, t, n) => new fv(e, t, n));
9867
9889
  //#endregion
9868
9890
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
9869
- var fv, pv = class {
9891
+ var gv, _v = class {
9870
9892
  constructor(t, n) {
9871
9893
  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", () => {
9872
9894
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -9941,10 +9963,10 @@ var fv, pv = class {
9941
9963
  }), 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);
9942
9964
  }
9943
9965
  };
9944
- fv = pv, e(pv, "create", (e, t) => new fv(e, t));
9966
+ gv = _v, e(_v, "create", (e, t) => new gv(e, t));
9945
9967
  //#endregion
9946
9968
  //#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
9947
- var mv, hv = (e) => JSON.parse(JSON.stringify(e)), gv = 1e4, _v = class {
9969
+ var vv, yv = (e) => JSON.parse(JSON.stringify(e)), bv = 1e4, xv = class {
9948
9970
  constructor(t, n, r) {
9949
9971
  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", () => {
9950
9972
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -9982,23 +10004,23 @@ var mv, hv = (e) => JSON.parse(JSON.stringify(e)), gv = 1e4, _v = class {
9982
10004
  this.logger.debug("onSubscriptionChanged", {
9983
10005
  to: e,
9984
10006
  reset: t
9985
- }), t ? this.targetSubscription = hv(this.currentSubscription) : this.currentSubscription = hv(e), this._isSwitchingSubscription = this.isNewSubscription();
10007
+ }), t ? this.targetSubscription = yv(this.currentSubscription) : this.currentSubscription = yv(e), this._isSwitchingSubscription = this.isNewSubscription();
9986
10008
  }), e(this, "scheduleSubscriptionChange", () => {
9987
- this.targetSubscription = hv(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
10009
+ this.targetSubscription = yv(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9988
10010
  let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
9989
10011
  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(() => {
9990
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = hv(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9991
- }, gv), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
10012
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = yv(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10013
+ }, bv), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9992
10014
  type: "subscribe",
9993
10015
  subscription: this.getTargetSubscription()
9994
10016
  }), 0));
9995
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = hv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
10017
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = yv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9996
10018
  }
9997
10019
  };
9998
- mv = _v, e(_v, "create", (e, t, n) => new mv(e, n, t));
10020
+ vv = xv, e(xv, "create", (e, t, n) => new vv(e, n, t));
9999
10021
  //#endregion
10000
10022
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
10001
- var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv = (e) => (t) => t > e, Cv = {
10023
+ var Sv, Cv = 5e3, wv = () => Ye() || Ke(), Tv = (e) => e && wv() ? 100 : 0, Ev = (e) => (t) => t > e, Dv = {
10002
10024
  seek: {
10003
10025
  toleranceMs: 200,
10004
10026
  toleranceMaxMs: 2500,
@@ -10030,7 +10052,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10030
10052
  decayCooldownMultiplier: 3,
10031
10053
  decayCheckInterval: 15e3
10032
10054
  }
10033
- }, wv = class {
10055
+ }, Ov = class {
10034
10056
  get driftSamplesToCollect() {
10035
10057
  return this._driftSamplesToCollect;
10036
10058
  }
@@ -10076,7 +10098,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10076
10098
  }), e(this, "processSample", (e) => {
10077
10099
  var t;
10078
10100
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
10079
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - yv);
10101
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - Cv);
10080
10102
  let n = e.type === "video" && e.isSync;
10081
10103
  if (this.currentChannelId !== e.channelId) {
10082
10104
  let t = 2 ** 53 - 1;
@@ -10093,7 +10115,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10093
10115
  this.currentChannelId || (this.currentChannelId = e);
10094
10116
  let r = t.mediaType();
10095
10117
  if (!r) throw Error("Fragment must have a media type");
10096
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - yv);
10118
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - Cv);
10097
10119
  let i = t.mediaType() === "video" && t.startsWithKeyframe();
10098
10120
  if (this.currentChannelId !== e) {
10099
10121
  let t = 2 ** 53 - 1;
@@ -10201,7 +10223,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10201
10223
  return;
10202
10224
  }
10203
10225
  if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
10204
- let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(Sv(r)).length;
10226
+ let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(Ev(r)).length;
10205
10227
  if (i && this.state.timeshiftToleranceMultiplier > 2) {
10206
10228
  this.logger.debug("Too many timeshifts within sliding window", {
10207
10229
  timeshiftCooldownThreshold: r,
@@ -10281,7 +10303,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10281
10303
  if (!r && !this.isAllowedToSyncIgnoringCooldown() || r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
10282
10304
  let i = r ? t : At(this.driftSamples.items());
10283
10305
  if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
10284
- let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(Sv(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
10306
+ let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(Ev(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
10285
10307
  if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
10286
10308
  this.logger.debug("Too many seek adjustments within sliding window", {
10287
10309
  seekCooldownThreshold: a,
@@ -10312,11 +10334,11 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10312
10334
  let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
10313
10335
  if (t && r) return n;
10314
10336
  }
10315
- }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = xv(o), this.config = {
10316
- seek: C({}, Cv.seek),
10317
- timeshift: C({}, Cv.timeshift),
10318
- playbackRate: C({}, Cv.playbackRate),
10319
- backoff: C({}, Cv.backoff)
10337
+ }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = Tv(o), this.config = {
10338
+ seek: C({}, Dv.seek),
10339
+ timeshift: C({}, Dv.timeshift),
10340
+ playbackRate: C({}, Dv.playbackRate),
10341
+ backoff: C({}, Dv.backoff)
10320
10342
  }, this.config.timeshift.enabled = a, o || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
10321
10343
  seekToleranceMultiplier: 1,
10322
10344
  timeshiftToleranceMultiplier: 1
@@ -10378,10 +10400,10 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10378
10400
  return this.serverCurrentTime - this.playbackSource.currentTime;
10379
10401
  }
10380
10402
  };
10381
- vv = wv, e(wv, "create", (e, t, n, r, i, a = !0) => new vv(e, t, n, r, i, a));
10403
+ Sv = Ov, e(Ov, "create", (e, t, n, r, i, a = !0) => new Sv(e, t, n, r, i, a));
10382
10404
  //#endregion
10383
10405
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
10384
- var Tv, Ev = {
10406
+ var kv, Av = {
10385
10407
  enabled: !0,
10386
10408
  interval: 3e4,
10387
10409
  includeErrors: !0,
@@ -10390,11 +10412,11 @@ var Tv, Ev = {
10390
10412
  maxRetries: 10,
10391
10413
  maxErrorReports: 50,
10392
10414
  maxEvents: 50
10393
- }, Dv = (e, t) => C(C({}, t), {}, {
10415
+ }, jv = (e, t) => C(C({}, t), {}, {
10394
10416
  type: e,
10395
10417
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10396
10418
  discriminator: "web"
10397
- }), Ov = class {
10419
+ }), Mv = class {
10398
10420
  constructor(n, r, i, a) {
10399
10421
  var o = this;
10400
10422
  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", () => {
@@ -10411,7 +10433,7 @@ var Tv, Ev = {
10411
10433
  initiator: "interval"
10412
10434
  }, n = {}) => {
10413
10435
  if (!this.options.includeStats) return;
10414
- let r = this.parentContext.getStatistics(), i = Dv("stats", C(C(C({}, n), r), {}, {
10436
+ let r = this.parentContext.getStatistics(), i = jv("stats", C(C(C({}, n), r), {}, {
10415
10437
  isFinal: e,
10416
10438
  initiator: t,
10417
10439
  count: this.statsCount++
@@ -10419,7 +10441,7 @@ var Tv, Ev = {
10419
10441
  this.unsentLines.push(i);
10420
10442
  }), e(this, "addEvent", (e) => {
10421
10443
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
10422
- let t = Dv("event", C(C({}, this.parentContext.getStatistics()), e));
10444
+ let t = jv("event", C(C({}, this.parentContext.getStatistics()), e));
10423
10445
  this.eventCount++, this.unsentLines.push(t);
10424
10446
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
10425
10447
  var e = t(function* (e) {
@@ -10465,15 +10487,15 @@ var Tv, Ev = {
10465
10487
  if (t && e instanceof g) {
10466
10488
  if (this.errorCount++, this.errorCount > n) return;
10467
10489
  let t = this.parentContext.getStatistics();
10468
- this.unsentLines.push(Dv("error", C(C({}, t), e.toStringifiable())));
10490
+ this.unsentLines.push(jv("error", C(C({}, t), e.toStringifiable())));
10469
10491
  }
10470
- }), this.logger = n, this.emitter = r, this.options = C(C({}, Ev), i), this.parentContext = a;
10492
+ }), this.logger = n, this.emitter = r, this.options = C(C({}, Av), i), this.parentContext = a;
10471
10493
  }
10472
10494
  };
10473
- Tv = Ov, e(Ov, "create", (e, t, n, r) => new Tv(e, t, n, r));
10495
+ kv = Mv, e(Mv, "create", (e, t, n, r) => new kv(e, t, n, r));
10474
10496
  //#endregion
10475
10497
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
10476
- var kv, Av = class {
10498
+ var Nv, Pv = class {
10477
10499
  constructor(t, n, r) {
10478
10500
  e(this, "logger", void 0), e(this, "element", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
10479
10501
  this.timers.unload();
@@ -10482,10 +10504,10 @@ var kv, Av = class {
10482
10504
  }), this.logger = t, this.element = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
10483
10505
  }
10484
10506
  };
10485
- kv = Av, e(Av, "create", (e, t, n) => new kv(e, t, n));
10507
+ Nv = Pv, e(Pv, "create", (e, t, n) => new Nv(e, t, n));
10486
10508
  //#endregion
10487
10509
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
10488
- var jv = [
10510
+ var Fv = [
10489
10511
  "minBufferTime",
10490
10512
  "maxBufferTime",
10491
10513
  "burstEnabled",
@@ -10495,10 +10517,10 @@ var jv = [
10495
10517
  "offscreenCanvasEnabled",
10496
10518
  "videoCodecs"
10497
10519
  ];
10498
- function Mv(e) {
10499
- return jv.includes(e);
10520
+ function Iv(e) {
10521
+ return Fv.includes(e);
10500
10522
  }
10501
- var Nv = class {
10523
+ var Lv = class {
10502
10524
  constructor(t) {
10503
10525
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
10504
10526
  }
@@ -10512,7 +10534,7 @@ var Nv = class {
10512
10534
  this.options[e] = t;
10513
10535
  }
10514
10536
  get(e, t) {
10515
- if (t && Mv(e)) {
10537
+ if (t && Iv(e)) {
10516
10538
  var n;
10517
10539
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
10518
10540
  if (r !== void 0) return r;
@@ -10523,7 +10545,7 @@ var Nv = class {
10523
10545
  var n;
10524
10546
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
10525
10547
  }
10526
- }, Pv = 6, Fv = (e) => {
10548
+ }, Rv = 6, zv = (e) => {
10527
10549
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
10528
10550
  var i, a;
10529
10551
  if (e.flags && qo(e.flags)) {
@@ -10535,7 +10557,7 @@ var Nv = class {
10535
10557
  return u > 0 && (r = u), C(C({}, e), {}, { duration: u > 0 ? u : r });
10536
10558
  };
10537
10559
  return (e, n = !1) => {
10538
- if (e.flags && qo(e.flags) && n && (i = !i), !(n && t.length < Pv && i) && t.length > 0) {
10560
+ if (e.flags && qo(e.flags) && n && (i = !i), !(n && t.length < Rv && i) && t.length > 0) {
10539
10561
  i = !1;
10540
10562
  let n = e;
10541
10563
  for (let e = t.length - 1; e > 0; e--) {
@@ -10548,13 +10570,13 @@ var Nv = class {
10548
10570
  }
10549
10571
  return t.push(e), [];
10550
10572
  };
10551
- }, Iv = ["mse", "wasm"], Lv = (e) => e == null ? Iv : e, Rv = (e) => {
10573
+ }, Bv = ["mse", "wasm"], Vv = (e) => e == null ? Bv : e, Hv = (e) => {
10552
10574
  if (!e) return !1;
10553
10575
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
10554
10576
  return !!(t || n);
10555
- }, zv = (e, t, n) => {
10556
- if (Rv(n)) return "mse";
10557
- let r = Lv(e);
10577
+ }, Uv = (e, t, n) => {
10578
+ if (Hv(n)) return "mse";
10579
+ let r = Vv(e);
10558
10580
  for (let e of r) switch (e) {
10559
10581
  case "mse":
10560
10582
  if (t) return "mse";
@@ -10565,7 +10587,7 @@ var Nv = class {
10565
10587
  case "wasm": return "wasm";
10566
10588
  }
10567
10589
  return "wasm";
10568
- }, Bv = (e, t, n) => {
10590
+ }, Wv = (e, t, n) => {
10569
10591
  if (gn(t)) return C(C({}, e), {}, {
10570
10592
  type: "video",
10571
10593
  codec: t.codec,
@@ -10586,8 +10608,8 @@ var Nv = class {
10586
10608
  data: e.payload,
10587
10609
  duration: 0
10588
10610
  });
10589
- }, Vv = (e, t) => e && typeof e == "object" && t in e, Hv = (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), Uv = (e) => {
10590
- if (!Hv(e)) throw new g("Invalid options", {
10611
+ }, Gv = (e, t) => e && typeof e == "object" && t in e, Kv = (e) => !(typeof e != "object" || !Gv(e, "channelId") || typeof e.channelId != "string" || !Gv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), qv = (e) => {
10612
+ if (!Kv(e)) throw new g("Invalid options", {
10591
10613
  isFatal: !0,
10592
10614
  code: "invalid_options"
10593
10615
  });
@@ -10596,13 +10618,13 @@ var Nv = class {
10596
10618
  let n = t;
10597
10619
  n[e] === void 0 && delete n[e];
10598
10620
  }), t;
10599
- }, Wv = (e) => {
10621
+ }, Jv = (e) => {
10600
10622
  if (typeof e != "object" || !e) throw Error("not an object");
10601
10623
  if (!("video" in e)) throw Error("missing video in subscription");
10602
10624
  if (!("audio" in e)) throw Error("missing audio in subscription");
10603
10625
  if (!("channelId" in e)) throw Error("missing channelId");
10604
10626
  return !0;
10605
- }, Gv = class {
10627
+ }, Yv = class {
10606
10628
  constructor(n) {
10607
10629
  var r = this;
10608
10630
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -10663,10 +10685,10 @@ var Nv = class {
10663
10685
  return this.inFlight.set(e, o), o;
10664
10686
  }), this.logger = n;
10665
10687
  }
10666
- }, Kv = /* @__PURE__ */ new WeakMap(), qv = /* @__PURE__ */ new WeakMap(), Jv = /* @__PURE__ */ new WeakMap(), Yv = class n extends _e {
10688
+ }, Xv = /* @__PURE__ */ new WeakMap(), Zv = /* @__PURE__ */ new WeakMap(), Qv = /* @__PURE__ */ new WeakMap(), $v = class n extends _e {
10667
10689
  constructor(r) {
10668
10690
  var i, a;
10669
- 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", pn()), 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 fn()), e(this, "encryptedMediaExtensions", void 0), v(this, Kv, 0), v(this, qv, []), 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, Jv, void 0), e(this, "attach", (e) => {
10691
+ 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", pn()), 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 fn()), e(this, "encryptedMediaExtensions", void 0), v(this, Xv, 0), v(this, Zv, []), 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, Qv, void 0), e(this, "attach", (e) => {
10670
10692
  var t;
10671
10693
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
10672
10694
  }), e(this, "setElement", (e) => {
@@ -10749,20 +10771,20 @@ var Nv = class {
10749
10771
  }), e(this, "updateTextTracks", (e) => {
10750
10772
  let t = e.filter((e) => e.codec === "webvtt");
10751
10773
  t.forEach((e) => {
10752
- if (!b(qv, this).find((t) => t.language === e.language)) {
10774
+ if (!b(Zv, this).find((t) => t.language === e.language)) {
10753
10775
  if (this.modules.canvasModule) {
10754
10776
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
10755
- b(qv, this).push(t);
10777
+ b(Zv, this).push(t);
10756
10778
  } else if (this.mediaElement instanceof HTMLVideoElement) {
10757
10779
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
10758
- b(qv, this).push(t);
10780
+ b(Zv, this).push(t);
10759
10781
  }
10760
10782
  }
10761
10783
  });
10762
- for (let e of b(qv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10784
+ for (let e of b(Zv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10763
10785
  this.emit("text tracks", this.textTracks);
10764
10786
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
10765
- b(qv, this).forEach((t) => {
10787
+ b(Zv, this).forEach((t) => {
10766
10788
  if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
10767
10789
  });
10768
10790
  }), e(this, "filterRenditions", function() {
@@ -10896,8 +10918,8 @@ var Nv = class {
10896
10918
  u = void 0, d = void 0, i.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
10897
10919
  }
10898
10920
  else s && i.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
10899
- let f = yield d_.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;
10900
- if (m instanceof I_) if (p === "OffscreenCanvas" && d) {
10921
+ let f = yield h_.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;
10922
+ if (m instanceof B_) if (p === "OffscreenCanvas" && d) {
10901
10923
  m.setVideoRenderingEnabled(!1);
10902
10924
  let e = i.element;
10903
10925
  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);
@@ -10909,10 +10931,10 @@ var Nv = class {
10909
10931
  t.parentElement && t.parentElement.replaceChild(e, t), i.setElement(e);
10910
10932
  }
10911
10933
  }
10912
- else m instanceof R_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10934
+ else m instanceof H_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10913
10935
  (e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
10914
10936
  })), e(this, "setupOffscreenSubtitleRouting", () => {
10915
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof R_) return;
10937
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof H_) return;
10916
10938
  let e = this.modules.decoder, t = this.modules.canvasModule;
10917
10939
  if (!t) return;
10918
10940
  let n = !1;
@@ -10951,10 +10973,10 @@ var Nv = class {
10951
10973
  e && "reset" in e && e.reset();
10952
10974
  }), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
10953
10975
  }), e(this, "getRuntimeInfo", () => {
10954
- let e = this.modules.canvasModule instanceof R_ ? !0 : void 0;
10976
+ let e = this.modules.canvasModule instanceof H_ ? !0 : void 0;
10955
10977
  return C({
10956
10978
  uptime: Date.now() - this.createdAt,
10957
- version: "4.3.0-3-g6f983fb9",
10979
+ version: "4.3.0-5-ga57504ef",
10958
10980
  clientId: this.clientId,
10959
10981
  sessionId: this.sessionId,
10960
10982
  channelId: this.channelId,
@@ -10988,7 +11010,7 @@ var Nv = class {
10988
11010
  }), e(this, "timeToFirstFrame", () => {
10989
11011
  let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectionTime;
10990
11012
  if (t && e) return e - t;
10991
- }), this.options = new Nv(C(C({}, Sn), Uv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
11013
+ }), this.options = new Lv(C(C({}, Sn), qv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10992
11014
  let o = {
10993
11015
  channelId: this.options.get("channelId"),
10994
11016
  audio: {
@@ -11001,16 +11023,16 @@ var Nv = class {
11001
11023
  height: this.options.get("maxSize").height
11002
11024
  }
11003
11025
  }, s = O.get();
11004
- s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Gv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
11026
+ s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Yv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
11005
11027
  let c = (a = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : a;
11006
11028
  c !== void 0 && (this.options.set("streamToMediaElementEnabled", c), this.options.set("iosMediaElementEnabled", c));
11007
11029
  let l = r.mseEnabled !== void 0, f = r.decoders !== void 0;
11008
11030
  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"]);
11009
- let p = av.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = n_.create(this.emitter, this.logger.createContext("ConnectionModule"), {
11031
+ let p = lv.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = o_.create(this.emitter, this.logger.createContext("ConnectionModule"), {
11010
11032
  reconnectHandler: this.options.get("reconnectHandler"),
11011
11033
  options: this.options,
11012
11034
  onConnectInfo: this.onConnectInfo
11013
- }), te = _v.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = pv.create(this.emitter, te), re = dv.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = sv.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
11035
+ }), te = xv.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = _v.create(this.emitter, te), re = hv.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = dv.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
11014
11036
  this.encryptedMediaExtensions = new Vr(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
11015
11037
  setHeaders: (e) => {
11016
11038
  this.encryptedMediaExtensions.headers = e;
@@ -11019,7 +11041,7 @@ var Nv = class {
11019
11041
  this.encryptedMediaExtensions.queryParams = e;
11020
11042
  }
11021
11043
  };
11022
- let ae = p_.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
11044
+ let ae = __.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
11023
11045
  if (this.willUseMediaSource()) {
11024
11046
  let e = new ds({
11025
11047
  type: this.options.get("media") === "audio" ? "audio" : "video",
@@ -11029,9 +11051,9 @@ var Nv = class {
11029
11051
  logger: this.logger.createContext("MediaElement"),
11030
11052
  poster: se
11031
11053
  });
11032
- e.on("buffer state", (e) => this.onMediaElementBufferState(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, Vr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = X_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = Av.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
11054
+ e.on("buffer state", (e) => this.onMediaElementBufferState(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, Vr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = ev.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = Pv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
11033
11055
  } else if (this.options.get("streamToMediaElementEnabled") && Et(this.browser)) {
11034
- let e = R_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
11056
+ let e = H_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
11035
11057
  type: this.options.get("media") === "audio" ? "audio" : "video",
11036
11058
  muted: this.options.get("muted") || this.options.get("media") === "video",
11037
11059
  volume: this.options.get("volume"),
@@ -11041,10 +11063,10 @@ var Nv = class {
11041
11063
  }), t = e.element();
11042
11064
  this.element = t.element, this.playbackSource = e, S = e;
11043
11065
  let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
11044
- this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = Av.create(this.logger.createContext("UnpauseModule"), t, ae));
11066
+ this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = Pv.create(this.logger.createContext("UnpauseModule"), t, ae));
11045
11067
  } else {
11046
11068
  let e;
11047
- e = I_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
11069
+ e = B_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
11048
11070
  this.setElement(e.element());
11049
11071
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, S = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new ts());
11050
11072
  }
@@ -11061,9 +11083,9 @@ var Nv = class {
11061
11083
  let ce = this.willUseMediaSource(), ue = ce ? !this.browser.platform.isWebKit : !0, de = {
11062
11084
  getTargetBufferTime: () => ie.getTargetBufferTime(),
11063
11085
  getNextBufferedRangeStart: _ ? (e) => _.getNextBufferedRangeStart(e) : void 0
11064
- }, fe = wv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, de, ue, ce), pe = x_.create(this.logger.createContext("JitterModule")), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), ge = new URL("/telemetry", me).toString();
11086
+ }, fe = Ov.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, de, ue, ce), pe = T_.create(this.logger.createContext("JitterModule")), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), ge = new URL("/telemetry", me).toString();
11065
11087
  this.modules = {
11066
- telemetry: Ov.create(this.logger.createContext("TelemetryModule"), this.emitter, {
11088
+ telemetry: Mv.create(this.logger.createContext("TelemetryModule"), this.emitter, {
11067
11089
  url: ge,
11068
11090
  enabled: this.options.get("telemetryEnabled"),
11069
11091
  includeStats: !1,
@@ -11073,10 +11095,10 @@ var Nv = class {
11073
11095
  maxBufferTime: this.options.get("maxBufferTime"),
11074
11096
  minBufferTime: this.options.get("minBufferTime")
11075
11097
  }),
11076
- incomingData: v_.create(this.emitter),
11098
+ incomingData: S_.create(this.emitter),
11077
11099
  adaptivity: Ss.create(this.emitter, this.logger.createContext("AdaptivityModule"), re, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
11078
- constraintCap: s_.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
11079
- event: g_.create(this.emitter, this.logger.createContext("EventModule"), fe),
11100
+ constraintCap: d_.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
11101
+ event: b_.create(this.emitter, this.logger.createContext("EventModule"), fe),
11080
11102
  sync: fe,
11081
11103
  jitter: pe,
11082
11104
  documentState: ae,
@@ -11129,7 +11151,7 @@ var Nv = class {
11129
11151
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
11130
11152
  if (e.telemetry) {
11131
11153
  var i;
11132
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Ov.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
11154
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Mv.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
11133
11155
  }
11134
11156
  }), this.emitter.on("adapt level", (e) => {
11135
11157
  this.logger.debug("adapt level", { direction: e });
@@ -11161,8 +11183,8 @@ var Nv = class {
11161
11183
  audio: C(C({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
11162
11184
  })), this.emitter.emit("adapted level");
11163
11185
  }), this.emitter.on("text track data", (e) => {
11164
- let t = b(qv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Kv, this);
11165
- if (x(Kv, this, n), t) {
11186
+ let t = b(Zv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Xv, this);
11187
+ if (x(Xv, this, n), t) {
11166
11188
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
11167
11189
  for (let r of e.cues) {
11168
11190
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -11176,19 +11198,19 @@ var Nv = class {
11176
11198
  this.clientIp = t.ip;
11177
11199
  break;
11178
11200
  case "renditions":
11179
- this.updateTextTracks(t.renditions), x(Jv, this, this.filterRenditions(t.renditions).then((e) => {
11201
+ this.updateTextTracks(t.renditions), x(Qv, this, this.filterRenditions(t.renditions).then((e) => {
11180
11202
  this.emitter.emit("renditions", {
11181
11203
  renditions: e,
11182
11204
  channelId: this.currentSubscription.channelId
11183
11205
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
11184
11206
  }).finally(() => {
11185
- x(Jv, this, void 0);
11207
+ x(Qv, this, void 0);
11186
11208
  }));
11187
11209
  break;
11188
11210
  case "subscription changed":
11189
11211
  var r;
11190
11212
  try {
11191
- Wv(t.subscription);
11213
+ Jv(t.subscription);
11192
11214
  } catch (e) {
11193
11215
  this.emitter.emit("error", new g("Subscription failed validation", {
11194
11216
  source: e instanceof Error ? e : void 0,
@@ -11303,7 +11325,7 @@ var Nv = class {
11303
11325
  let xe = function() {
11304
11326
  var e = t(function* (e) {
11305
11327
  let t = e.channelId;
11306
- b(Jv, i) && (yield b(Jv, i));
11328
+ b(Qv, i) && (yield b(Qv, i));
11307
11329
  let n = i.modules.renditions.getRendition(e.renditionId, t);
11308
11330
  if (!Yo(e.flags)) {
11309
11331
  if (Xo(e.flags)) {
@@ -11311,8 +11333,8 @@ var Nv = class {
11311
11333
  if (e.renditionId !== 0) {
11312
11334
  let e = le(t);
11313
11335
  if (e && e.language !== void 0) {
11314
- let t = new ss().parse(e.content || ""), r = n / 1e3, a = b(qv, i).find((t) => t.language === e.language), o = r - b(Kv, i);
11315
- if (x(Kv, i, r), a) {
11336
+ let t = new ss().parse(e.content || ""), r = n / 1e3, a = b(Zv, i).find((t) => t.language === e.language), o = r - b(Xv, i);
11337
+ if (x(Xv, i, r), a) {
11316
11338
  if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
11317
11339
  for (let e of t) {
11318
11340
  let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
@@ -11344,10 +11366,10 @@ var Nv = class {
11344
11366
  mimeType: s
11345
11367
  }), i.emit("initialized media");
11346
11368
  } else {
11347
- let t = Bv(e, n, i.sizes.get(e.renditionId));
11369
+ let t = Wv(e, n, i.sizes.get(e.renditionId));
11348
11370
  i.modules.jitter.recordSample(t);
11349
11371
  let a = i.sampleProcessingSesssions.get(r);
11350
- if (!a) a = Fv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11372
+ if (!a) a = zv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11351
11373
  else {
11352
11374
  let e = i.willUseMediaSource() && i.isSwitchingRenditionLevel && t.type === "video", n = a(i.modules.sync.processSample(t), e), r = t;
11353
11375
  n.forEach((e) => {
@@ -11455,7 +11477,7 @@ var Nv = class {
11455
11477
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
11456
11478
  }
11457
11479
  set textTrack(e) {
11458
- e !== this.textTrack && (b(qv, this).forEach((t) => {
11480
+ e !== this.textTrack && (b(Zv, this).forEach((t) => {
11459
11481
  if (t.label === e) t.mode = "showing";
11460
11482
  else {
11461
11483
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -11464,11 +11486,11 @@ var Nv = class {
11464
11486
  }), this.emitter.emit("text track", e));
11465
11487
  }
11466
11488
  get textTracks() {
11467
- return b(qv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11489
+ return b(Zv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11468
11490
  }
11469
11491
  get textTrack() {
11470
11492
  var e;
11471
- return (e = b(qv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11493
+ return (e = b(Zv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11472
11494
  }
11473
11495
  get channelId() {
11474
11496
  var e, t;
@@ -11602,7 +11624,7 @@ var Nv = class {
11602
11624
  return this.modules.subscription.getTargetSubscription();
11603
11625
  }
11604
11626
  resolvedDecoder(e) {
11605
- return zv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11627
+ return Uv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11606
11628
  }
11607
11629
  willUseMediaSource() {
11608
11630
  return this.resolvedDecoder() === "mse";
@@ -11621,6 +11643,6 @@ var Nv = class {
11621
11643
  return t === void 0 ? this.shouldUseWebCodecs(e) : t;
11622
11644
  }
11623
11645
  };
11624
- e(Yv, "MAX_POOL_SIZE", 10), e(Yv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Yv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11646
+ e($v, "MAX_POOL_SIZE", 10), e($v, "DISCONNECT_TIMEOUT", 15 * 1e3), e($v, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11625
11647
  //#endregion
11626
- 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, Yv as t, gt as u, Qe as v };
11648
+ 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, $v as t, gt as u, Qe as v };