@cloudflare/realtimekit 2.0.2-staging.1 → 2.0.2-staging.3

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.
package/dist/index.es.js CHANGED
@@ -29,20 +29,20 @@ var a = (s, t, e) => (Bl(s, t, "read from private field"), e ? e.call(s) : t.get
29
29
  }, S = (s, t, e, r) => (Bl(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e);
30
30
  var V = (s, t, e) => (Bl(s, t, "access private method"), e), Hh = (s, t, e) => BS($S(s), e, t);
31
31
  var u = (s, t, e) => new Promise((r, i) => {
32
- var n = (c) => {
32
+ var n = (d) => {
33
33
  try {
34
- d(e.next(c));
34
+ c(e.next(d));
35
35
  } catch (l) {
36
36
  i(l);
37
37
  }
38
- }, o = (c) => {
38
+ }, o = (d) => {
39
39
  try {
40
- d(e.throw(c));
40
+ c(e.throw(d));
41
41
  } catch (l) {
42
42
  i(l);
43
43
  }
44
- }, d = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(n, o);
45
- d((e = e.apply(s, t)).next());
44
+ }, c = (d) => d.done ? r(d.value) : Promise.resolve(d.value).then(n, o);
45
+ c((e = e.apply(s, t)).next());
46
46
  });
47
47
  import { v4 as ga, validate as Dg } from "uuid";
48
48
  import Og from "bowser";
@@ -72,7 +72,7 @@ const jS = (s) => {
72
72
  }), window.addEventListener(
73
73
  "unhandledrejection",
74
74
  (t) => {
75
- var e, r, i, n, o, d, c, l;
75
+ var e, r, i, n, o, c, d, l;
76
76
  s.error(
77
77
  "window::unhandledrejection",
78
78
  {
@@ -85,8 +85,8 @@ const jS = (s) => {
85
85
  networkCall: {
86
86
  url: (r = (e = t == null ? void 0 : t.reason) == null ? void 0 : e.config) == null ? void 0 : r.url,
87
87
  baseURL: (n = (i = t == null ? void 0 : t.reason) == null ? void 0 : i.config) == null ? void 0 : n.baseURL,
88
- method: (d = (o = t == null ? void 0 : t.reason) == null ? void 0 : o.config) == null ? void 0 : d.method,
89
- status: (c = t == null ? void 0 : t.reason) == null ? void 0 : c.status,
88
+ method: (c = (o = t == null ? void 0 : t.reason) == null ? void 0 : o.config) == null ? void 0 : c.method,
89
+ status: (d = t == null ? void 0 : t.reason) == null ? void 0 : d.status,
90
90
  statusText: (l = t == null ? void 0 : t.reason) == null ? void 0 : l.statusText
91
91
  }
92
92
  },
@@ -636,16 +636,16 @@ ce.prototype.emit = function(t) {
636
636
  var o;
637
637
  if (e.length > 0 && (o = e[0]), o instanceof Error)
638
638
  throw o;
639
- var d = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
640
- throw d.context = o, d;
639
+ var c = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
640
+ throw c.context = o, c;
641
641
  }
642
- var c = n[t];
643
- if (c === void 0)
642
+ var d = n[t];
643
+ if (d === void 0)
644
644
  return !1;
645
- if (typeof c == "function")
646
- Fh(c, this, e);
645
+ if (typeof d == "function")
646
+ Fh(d, this, e);
647
647
  else
648
- for (var l = c.length, h = Jg(c, l), r = 0; r < l; ++r)
648
+ for (var l = d.length, h = Jg(d, l), r = 0; r < l; ++r)
649
649
  Fh(h[r], this, e);
650
650
  return !0;
651
651
  };
@@ -659,8 +659,8 @@ function qg(s, t, e, r) {
659
659
  o = n[t] = e, ++s._eventsCount;
660
660
  else if (typeof o == "function" ? o = n[t] = r ? [e, o] : [o, e] : r ? o.unshift(e) : o.push(e), i = Fg(s), i > 0 && o.length > i && !o.warned) {
661
661
  o.warned = !0;
662
- var d = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
663
- d.name = "MaxListenersExceededWarning", d.emitter = s, d.type = t, d.count = o.length, ZS(d);
662
+ var c = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
663
+ c.name = "MaxListenersExceededWarning", c.emitter = s, c.type = t, c.count = o.length, ZS(c);
664
664
  }
665
665
  return s;
666
666
  }
@@ -686,7 +686,7 @@ ce.prototype.prependOnceListener = function(t, e) {
686
686
  return fl(e), this.prependListener(t, jg(this, t, e)), this;
687
687
  };
688
688
  ce.prototype.removeListener = function(t, e) {
689
- var r, i, n, o, d;
689
+ var r, i, n, o, c;
690
690
  if (fl(e), i = this._events, i === void 0)
691
691
  return this;
692
692
  if (r = i[t], r === void 0)
@@ -696,12 +696,12 @@ ce.prototype.removeListener = function(t, e) {
696
696
  else if (typeof r != "function") {
697
697
  for (n = -1, o = r.length - 1; o >= 0; o--)
698
698
  if (r[o] === e || r[o].listener === e) {
699
- d = r[o].listener, n = o;
699
+ c = r[o].listener, n = o;
700
700
  break;
701
701
  }
702
702
  if (n < 0)
703
703
  return this;
704
- n === 0 ? r.shift() : tv(r, n), r.length === 1 && (i[t] = r[0]), i.removeListener !== void 0 && this.emit("removeListener", t, d || e);
704
+ n === 0 ? r.shift() : tv(r, n), r.length === 1 && (i[t] = r[0]), i.removeListener !== void 0 && this.emit("removeListener", t, c || e);
705
705
  }
706
706
  return this;
707
707
  };
@@ -991,7 +991,7 @@ function lv({ framesEncoded: s }) {
991
991
  return s === 0;
992
992
  }
993
993
  function rm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsSent: r, jitter: i, isScreenShare: n, framesEncoded: o }) {
994
- const d = Zs({
994
+ const c = Zs({
995
995
  stat: tm({
996
996
  packetsLost: e,
997
997
  packetsSent: r
@@ -1000,7 +1000,7 @@ function rm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsSent: r,
1000
1000
  rangeMin: 0,
1001
1001
  rangeMax: Sl,
1002
1002
  rangeRankingDirection: "UP"
1003
- }), c = Zs({
1003
+ }), d = Zs({
1004
1004
  stat: i,
1005
1005
  weight: 1,
1006
1006
  rangeMin: vl,
@@ -1020,8 +1020,8 @@ function rm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsSent: r,
1020
1020
  isLowQualityVideo: l,
1021
1021
  isVideoLagging: h,
1022
1022
  isVideoStuck: g,
1023
- jitterQuality: c,
1024
- packetsLostQuality: d
1023
+ jitterQuality: d,
1024
+ packetsLostQuality: c
1025
1025
  });
1026
1026
  }
1027
1027
  function im({ packetsLost: s, packetsReceived: t }) {
@@ -1034,7 +1034,7 @@ function nm({ concealmentEvents: s, packetsLost: t, packetsReceived: e, jitter:
1034
1034
  rangeMin: 0,
1035
1035
  rangeMax: 3,
1036
1036
  rangeRankingDirection: "UP"
1037
- }), o = 0.5, d = Zs({
1037
+ }), o = 0.5, c = Zs({
1038
1038
  stat: im({
1039
1039
  packetsLost: t,
1040
1040
  packetsReceived: e
@@ -1050,7 +1050,7 @@ function nm({ concealmentEvents: s, packetsLost: t, packetsReceived: e, jitter:
1050
1050
  rangeMax: Tl,
1051
1051
  rangeRankingDirection: "UP"
1052
1052
  });
1053
- return n + d + l;
1053
+ return n + c + l;
1054
1054
  }
1055
1055
  function uv({ framesDecoded: s }) {
1056
1056
  return s === 0;
@@ -1062,7 +1062,7 @@ function pv({ frameWidth: s, isScreenShare: t }) {
1062
1062
  return s < (t ? Qg : Yg);
1063
1063
  }
1064
1064
  function am({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsReceived: r, jitter: i, isScreenShare: n, framesDecoded: o }) {
1065
- const d = Zs({
1065
+ const c = Zs({
1066
1066
  stat: im({
1067
1067
  packetsLost: e,
1068
1068
  packetsReceived: r
@@ -1071,7 +1071,7 @@ function am({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsReceived
1071
1071
  rangeMin: 0,
1072
1072
  rangeMax: Sl,
1073
1073
  rangeRankingDirection: "UP"
1074
- }), c = Zs({
1074
+ }), d = Zs({
1075
1075
  stat: i,
1076
1076
  weight: 1,
1077
1077
  rangeMin: vl,
@@ -1091,8 +1091,8 @@ function am({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsReceived
1091
1091
  isLowQualityVideo: l,
1092
1092
  isVideoLagging: h,
1093
1093
  isVideoStuck: g,
1094
- jitterQuality: c,
1095
- packetsLostQuality: d
1094
+ jitterQuality: d,
1095
+ packetsLostQuality: c
1096
1096
  });
1097
1097
  }
1098
1098
  class sr {
@@ -1323,23 +1323,23 @@ class yv {
1323
1323
  }
1324
1324
  getIPDetails(i) {
1325
1325
  return u(this, arguments, function* ({ peerId: t, apiHostnames: e, logger: r }) {
1326
- var n, o, d;
1326
+ var n, o, c;
1327
1327
  if (!this.ipInformation) {
1328
1328
  try {
1329
- const c = `https://${e.location}`, h = yield (yield fetch(c)).json();
1329
+ const d = `https://${e.location}`, h = yield (yield fetch(d)).json();
1330
1330
  if (((n = h.loc) == null ? void 0 : n.length) > 5)
1331
1331
  return this.ipInformation = h, (o = this.ipInformation) != null && o.ip && (this.ipInformation.ip = Hr(this.ipInformation.ip)), h;
1332
1332
  throw Error("Insufficient data");
1333
- } catch (c) {
1334
- r.error("callstats::ipDetails:: failed to fetch ip using location service", { error: c });
1333
+ } catch (d) {
1334
+ r.error("callstats::ipDetails:: failed to fetch ip using location service", { error: d });
1335
1335
  }
1336
1336
  try {
1337
- const c = yield fetch(`https://${e.locationLegacy}/?token=3c493932b0624c&peerId=${t}`, {
1337
+ const d = yield fetch(`https://${e.locationLegacy}/?token=3c493932b0624c&peerId=${t}`, {
1338
1338
  method: "POST"
1339
1339
  });
1340
- this.ipInformation = yield c.json(), (d = this.ipInformation) != null && d.ip && (this.ipInformation.ip = Hr(this.ipInformation.ip));
1341
- } catch (c) {
1342
- r.error("callstats::ipDetails:: failed to fetch ip using legacy location service", { error: c });
1340
+ this.ipInformation = yield d.json(), (c = this.ipInformation) != null && c.ip && (this.ipInformation.ip = Hr(this.ipInformation.ip));
1341
+ } catch (d) {
1342
+ r.error("callstats::ipDetails:: failed to fetch ip using legacy location service", { error: d });
1343
1343
  }
1344
1344
  }
1345
1345
  return this.ipInformation;
@@ -1430,13 +1430,13 @@ class lm extends st {
1430
1430
  this.pausedProducerMap.delete(e);
1431
1431
  }
1432
1432
  processInboundConsumerVideoStats(e, r, i) {
1433
- var o, d;
1434
- const n = ((d = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : d.get(e)) || {};
1433
+ var o, c;
1434
+ const n = ((c = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : c.get(e)) || {};
1435
1435
  r.totalVideoPacketsReceived === i.packetsReceived ? (this.consumerIdsWithFreezedVideo.add(e), this.callStatsInstance && n.video && (this.callStatsInstance.logger.debug("callstats::measurements::consumerVideoFreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_video_status", "pause", e))) : (r.totalVideoPacketsReceived = i.packetsReceived, this.consumerIdsWithFreezedVideo.has(e) && (this.consumerIdsWithFreezedVideo.delete(e), this.callStatsInstance && n.video && (this.callStatsInstance.logger.debug("callstats::measurements::consumerVideoDefreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_video_status", "resume", e))));
1436
1436
  }
1437
1437
  processInboundConsumerAudioStats(e, r, i) {
1438
- var o, d;
1439
- const n = ((d = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : d.get(e)) || {};
1438
+ var o, c;
1439
+ const n = ((c = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : c.get(e)) || {};
1440
1440
  r.totalAudioPacketsReceived === i.packetsReceived ? (this.consumerIdsWithFreezedAudio.add(e), this.callStatsInstance && n.audio && (this.callStatsInstance.logger.debug("callStats::measurements::consumerAudioFreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_audio_status", "pause", e))) : (r.totalAudioPacketsReceived = i.packetsReceived, this.consumerIdsWithFreezedAudio.has(e) && (this.consumerIdsWithFreezedAudio.delete(e), this.callStatsInstance && n.audio && (this.callStatsInstance.logger.debug("callStats::measurements::consumerAudioDefreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_audio_status", "resume", e))));
1441
1441
  }
1442
1442
  processOutboundProducerVideoStats(e, r, i) {
@@ -1451,12 +1451,12 @@ class lm extends st {
1451
1451
  }
1452
1452
  processProducingTransportStats(e, r, i) {
1453
1453
  var h;
1454
- const n = ((h = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : h.currentUserMediaStates) || {}, { audio: o, video: d, screen: c } = n, l = o || d || c;
1454
+ const n = ((h = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : h.currentUserMediaStates) || {}, { audio: o, video: c, screen: d } = n, l = o || c || d;
1455
1455
  r.totalPacketsSent === i.packetsSent ? (this.freezedProducingTransportIds.add(e), this.callStatsInstance && l && (this.callStatsInstance.logger.debug("callStats::measurements::producingTransportFreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("producing_transport_status", "pause", e))) : (r.totalPacketsSent = i.packetsSent, this.freezedProducingTransportIds.has(e) && (this.freezedProducingTransportIds.delete(e), this.callStatsInstance && l && (this.callStatsInstance.logger.debug("callStats::measurements::producingTransportDefreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("producing_transport_status", "resume", e))));
1456
1456
  }
1457
1457
  processConsumingTransportStats(e, r, i) {
1458
- var d, c;
1459
- const o = !!Array.from(((c = (d = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : d.consumerSharedMediaStatesMap) == null ? void 0 : c.values()) || []).reduce((l, h) => l || h.audio || h.video || h.screen, !1);
1458
+ var c, d;
1459
+ const o = !!Array.from(((d = (c = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : c.consumerSharedMediaStatesMap) == null ? void 0 : d.values()) || []).reduce((l, h) => l || h.audio || h.video || h.screen, !1);
1460
1460
  r.totalPacketsReceived === i.packetsSent ? (this.freezedConsumingTransportIds.add(e), this.callStatsInstance && o && (this.callStatsInstance.logger.debug("callStats::measurements::consumingTransportFreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("consuming_transport_status", "pause", e))) : (r.totalPacketsReceived = i.packetsSent, this.freezedConsumingTransportIds.has(e) && (this.freezedConsumingTransportIds.delete(e), this.callStatsInstance && o && (this.callStatsInstance.logger.debug("callStats::measurements::consumingTransportDefreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("consuming_transport_status", "resume", e))));
1461
1461
  }
1462
1462
  registerConsumer(e) {
@@ -1530,14 +1530,14 @@ class lm extends st {
1530
1530
  // eslint-disable-next-line class-methods-use-this
1531
1531
  getWorkingSimulcastVideoStats(e) {
1532
1532
  return e.find((i) => {
1533
- const n = i.framesEncoded > 0, o = i.packetsSent > 0, d = i.frameWidth && i.frameHeight;
1534
- return n && o && !!d;
1533
+ const n = i.framesEncoded > 0, o = i.packetsSent > 0, c = i.frameWidth && i.frameHeight;
1534
+ return n && o && !!c;
1535
1535
  }) || e[e.length - 1];
1536
1536
  }
1537
1537
  parseRTCReport(e, r = [], i = !1, n = void 0, o = void 0) {
1538
1538
  var _, w, R, D, U, B, F, H, X, Le, yt, Qt, Yr;
1539
- const d = e, c = new dm(), l = r.length ? new Set(r) : void 0, h = [], g = [], f = [], v = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
1540
- for (const I of d.values()) {
1539
+ const c = e, d = new dm(), l = r.length ? new Set(r) : void 0, h = [], g = [], f = [], v = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
1540
+ for (const I of c.values()) {
1541
1541
  if (l) {
1542
1542
  if (l.size === 0)
1543
1543
  break;
@@ -1573,7 +1573,7 @@ class lm extends st {
1573
1573
  packetsReceived: $.packetsReceived,
1574
1574
  packetsDiscardedOnSend: $.packetsDiscardedOnSend
1575
1575
  };
1576
- f.push(ve), (I.nominated === !0 || I.selected === !0) && (c.candidatePair = ve);
1576
+ f.push(ve), (I.nominated === !0 || I.selected === !0) && (d.candidatePair = ve);
1577
1577
  break;
1578
1578
  }
1579
1579
  case "transport": {
@@ -1594,7 +1594,7 @@ class lm extends st {
1594
1594
  // @ts-ignore
1595
1595
  iceRole: y.iceRole
1596
1596
  };
1597
- if (c.transport = C, o) {
1597
+ if (d.transport = C, o) {
1598
1598
  if (o.producing) {
1599
1599
  const $ = this.overallProducingTransportsStatsMap[o.id];
1600
1600
  this.processProducingTransportStats(o.id, $, C);
@@ -1615,7 +1615,7 @@ class lm extends st {
1615
1615
  totalRoundTripTime: y.totalRoundTripTime,
1616
1616
  packetsLost: y.packetsLost
1617
1617
  };
1618
- c.remoteInboundRtp.set(y.localId, C);
1618
+ d.remoteInboundRtp.set(y.localId, C);
1619
1619
  break;
1620
1620
  }
1621
1621
  case "outbound-rtp": {
@@ -1636,13 +1636,13 @@ class lm extends st {
1636
1636
  const ve = this.overallProducersStatsMap[C];
1637
1637
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
1638
1638
  if (!this.outboundProducerMap.has(I.id)) {
1639
- c.staleProducerStreamMap = !0;
1639
+ d.staleProducerStreamMap = !0;
1640
1640
  break;
1641
1641
  }
1642
1642
  const Pe = this.callStatsInstance.producers.get(C);
1643
1643
  if (((_ = Pe == null ? void 0 : Pe.track) == null ? void 0 : _.readyState) === "ended")
1644
1644
  break;
1645
- c.producerStreamMap.has(C) || c.producerStreamMap.set(C, {
1645
+ d.producerStreamMap.has(C) || d.producerStreamMap.set(C, {
1646
1646
  outboundVideoRtpId: [],
1647
1647
  outboundAudioRtpId: []
1648
1648
  });
@@ -1683,13 +1683,13 @@ class lm extends st {
1683
1683
  scalabilityMode: A.scalabilityMode,
1684
1684
  powerEfficientEncoder: A.powerEfficientEncoder
1685
1685
  }, L);
1686
- c.outboundVideoRtp.set(I.id, Ae), c.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ve, Ae);
1686
+ d.outboundVideoRtp.set(I.id, Ae), d.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ve, Ae);
1687
1687
  } else if (y.mediaType === "audio" || y.kind === "audio") {
1688
1688
  const A = y, Ae = N({
1689
1689
  retransmittedBytesSent: A.retransmittedBytesSent,
1690
1690
  retransmittedPacketsSent: A.retransmittedPacketsSent
1691
1691
  }, L);
1692
- c.outboundAudioRtp.set(I.id, Ae), c.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ve, Ae);
1692
+ d.outboundAudioRtp.set(I.id, Ae), d.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ve, Ae);
1693
1693
  }
1694
1694
  } else
1695
1695
  this.callStatsInstance.logger.error(`Callstats: Unknown Outbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -1715,10 +1715,10 @@ class lm extends st {
1715
1715
  const ve = this.overallConsumersStatsMap[C];
1716
1716
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
1717
1717
  if (!this.inboundConsumerMap.has(I.id)) {
1718
- c.staleConsumerStreamMap = !0;
1718
+ d.staleConsumerStreamMap = !0;
1719
1719
  break;
1720
1720
  }
1721
- c.consumerStreamMap.has(C) || c.consumerStreamMap.set(C, {
1721
+ d.consumerStreamMap.has(C) || d.consumerStreamMap.set(C, {
1722
1722
  inboundVideoRtpId: [],
1723
1723
  inboundAudioRtpId: []
1724
1724
  });
@@ -1784,7 +1784,7 @@ class lm extends st {
1784
1784
  isScreenShare: this.screenShareConsumers.has(C),
1785
1785
  bitrate: ((A.bytesReceived || 0) - (((F = this.videoConsumerToStatsMap.get(C)) == null ? void 0 : F.bytesReceived) || 0)) * 8 / 7
1786
1786
  // Bytes received in last 7 seconds
1787
- }), this.videoConsumerToStatsMap.set(C, A), c.inboundVideoRtp.set(I.id, A), c.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ve, A);
1787
+ }), this.videoConsumerToStatsMap.set(C, A), d.inboundVideoRtp.set(I.id, A), d.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ve, A);
1788
1788
  } else if (y.mediaType === "audio" || y.kind === "audio") {
1789
1789
  const L = y, A = N({
1790
1790
  audioLevel: L.audioLevel,
@@ -1815,7 +1815,7 @@ class lm extends st {
1815
1815
  isScreenShare: this.screenShareConsumers.has(C),
1816
1816
  bitrate: ((A.bytesReceived || 0) - (((Yr = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : Yr.bytesReceived) || 0)) * 8 / 7
1817
1817
  // Bytes received in last 7 seconds
1818
- }), this.audioConsumerToStatsMap.set(C, A), c.inboundAudioRtp.set(I.id, A), c.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ve, A);
1818
+ }), this.audioConsumerToStatsMap.set(C, A), d.inboundAudioRtp.set(I.id, A), d.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ve, A);
1819
1819
  }
1820
1820
  } else
1821
1821
  this.callStatsInstance.logger.error(`Callstats: Unknown Inbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -1823,12 +1823,12 @@ class lm extends st {
1823
1823
  }
1824
1824
  }
1825
1825
  }
1826
- if (c.producerStreamMap.forEach((I, y) => {
1826
+ if (d.producerStreamMap.forEach((I, y) => {
1827
1827
  var C, $, ve, Pe, L, A, Ae, _a, Ca, wa, Ra, ba, ka, Aa, Ia, Ma, Da, Oa, Na, La, Va, xa, Ua;
1828
1828
  if (I.outboundVideoRtpId.length > 0) {
1829
1829
  const ue = [];
1830
1830
  I.outboundVideoRtpId.forEach((Ul) => {
1831
- ue.push(c.outboundVideoRtp.get(Ul));
1831
+ ue.push(d.outboundVideoRtp.get(Ul));
1832
1832
  });
1833
1833
  const Z = this.getWorkingSimulcastVideoStats(ue);
1834
1834
  Z.score = rm({
@@ -1856,7 +1856,7 @@ class lm extends st {
1856
1856
  bandwidthLimitations: Z.qualityLimitationReason === "bandwidth"
1857
1857
  }), this.videoProducerToStatsMap.set(y, Z);
1858
1858
  } else if (I.outboundAudioRtpId.length > 0) {
1859
- const ue = c.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
1859
+ const ue = d.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
1860
1860
  ue.score = sm({
1861
1861
  packetsSent: (ue.packetsSent || 0) - (((ka = this.audioProducerToStatsMap.get(y)) == null ? void 0 : ka.packetsSent) || 0),
1862
1862
  packetsLost: (((Aa = ue.remoteData) == null ? void 0 : Aa.packetsLost) || 0) - (((Ma = (Ia = this.audioProducerToStatsMap.get(y)) == null ? void 0 : Ia.remoteData) == null ? void 0 : Ma.packetsLost) || 0),
@@ -1876,19 +1876,19 @@ class lm extends st {
1876
1876
  }), f.forEach((I) => {
1877
1877
  const y = h.find(($) => $.id === I.localCandidateId ? (I.localCandidateId = $.id, $) : null), C = g.find(($) => $.id === I.remoteCandidateId ? (I.remoteCandidateId = $.id, $) : null);
1878
1878
  y && (I.localCandidateType = y.type, I.localCandidateAddress = Hr(y.address), I.localCandidatePort = y.port, I.localCandidateProtocol = y.protocol, I.localCandidateUrl = y.url, I.localCandidateNetworkType = y.networkType, I.localCandidateRelatedAddress = Hr(y.relatedAddress), I.localCandidateRelatedPort = y.relatedPort), C && (I.remoteCandidateType = C.type, I.remoteCandidateAddress = Hr(C.address), I.remoteCandidatePort = C.port, I.remoteCandidateProtocol = C.protocol, I.remoteCandidateUrl = C.url);
1879
- }), c.candidatePair && (c.transport ? (c.transport.totalRoundTripTime = c.candidatePair.totalRoundTripTime, c.transport.availableOutgoingBitrate = c.candidatePair.availableOutgoingBitrate, c.transport.availableIncomingBitrate = c.candidatePair.availableIncomingBitrate, c.transport.roundTripTime = c.candidatePair.currentRoundTripTime) : c.transport = {
1879
+ }), d.candidatePair && (d.transport ? (d.transport.totalRoundTripTime = d.candidatePair.totalRoundTripTime, d.transport.availableOutgoingBitrate = d.candidatePair.availableOutgoingBitrate, d.transport.availableIncomingBitrate = d.candidatePair.availableIncomingBitrate, d.transport.roundTripTime = d.candidatePair.currentRoundTripTime) : d.transport = {
1880
1880
  // candidateStats: result.candidatePair,
1881
- bytesReceived: c.candidatePair.bytesReceived,
1882
- bytesSent: c.candidatePair.bytesSent,
1883
- totalRoundTripTime: c.candidatePair.totalRoundTripTime,
1884
- availableOutgoingBitrate: c.candidatePair.availableOutgoingBitrate,
1885
- availableIncomingBitrate: c.candidatePair.availableIncomingBitrate,
1886
- roundTripTime: c.candidatePair.currentRoundTripTime
1887
- }), c.transport && (c.transport.candidatePairs = f), c.transport && !c.transport.roundTripTime) {
1881
+ bytesReceived: d.candidatePair.bytesReceived,
1882
+ bytesSent: d.candidatePair.bytesSent,
1883
+ totalRoundTripTime: d.candidatePair.totalRoundTripTime,
1884
+ availableOutgoingBitrate: d.candidatePair.availableOutgoingBitrate,
1885
+ availableIncomingBitrate: d.candidatePair.availableIncomingBitrate,
1886
+ roundTripTime: d.candidatePair.currentRoundTripTime
1887
+ }), d.transport && (d.transport.candidatePairs = f), d.transport && !d.transport.roundTripTime) {
1888
1888
  let I = 0, y = 0;
1889
- c.remoteInboundRtp.forEach((C, $) => {
1889
+ d.remoteInboundRtp.forEach((C, $) => {
1890
1890
  C.roundTripTime && C.roundTripTime > I && (I = C.roundTripTime, y = C.totalRoundTripTime);
1891
- }), c.transport.roundTripTime = I, c.transport.totalRoundTripTime = y;
1891
+ }), d.transport.roundTripTime = I, d.transport.totalRoundTripTime = y;
1892
1892
  }
1893
1893
  if (E.size > 0)
1894
1894
  try {
@@ -1900,7 +1900,7 @@ class lm extends st {
1900
1900
  this.observer.emit("producer_score", v);
1901
1901
  } catch (I) {
1902
1902
  }
1903
- return c;
1903
+ return d;
1904
1904
  }
1905
1905
  getProducersReport(e) {
1906
1906
  return u(this, null, function* () {
@@ -1922,15 +1922,15 @@ class lm extends st {
1922
1922
  }
1923
1923
  getProcessedStats(e, r, i) {
1924
1924
  return u(this, null, function* () {
1925
- const n = yield this.getTransportReport(e), o = { producing: i, consuming: r, id: e.id }, d = n, c = this.parseRTCReport(d, ["transport", "candidate-pair", "inbound-rtp", "outbound-rtp", "remote-inbound-rtp", "local-candidate", "remote-candidate"], !1, void 0, o);
1926
- if (!c)
1925
+ const n = yield this.getTransportReport(e), o = { producing: i, consuming: r, id: e.id }, c = n, d = this.parseRTCReport(c, ["transport", "candidate-pair", "inbound-rtp", "outbound-rtp", "remote-inbound-rtp", "local-candidate", "remote-candidate"], !1, void 0, o);
1926
+ if (!d)
1927
1927
  return;
1928
1928
  const l = {
1929
- stats: c.transport,
1929
+ stats: d.transport,
1930
1930
  transportId: e.id,
1931
1931
  consuming: r,
1932
1932
  producing: i
1933
- }, h = c.staleProducerStreamMap ? void 0 : this.getProducerStatsFromReport(c), g = c.staleConsumerStreamMap ? void 0 : this.getConsumerStatsFromReport(c);
1933
+ }, h = d.staleProducerStreamMap ? void 0 : this.getProducerStatsFromReport(d), g = d.staleConsumerStreamMap ? void 0 : this.getConsumerStatsFromReport(d);
1934
1934
  return {
1935
1935
  transportReport: l,
1936
1936
  producerReport: h,
@@ -1943,12 +1943,12 @@ class lm extends st {
1943
1943
  const r = [];
1944
1944
  try {
1945
1945
  e.producerStreamMap.forEach((i, n) => {
1946
- var o, d;
1946
+ var o, c;
1947
1947
  r.push({
1948
1948
  producerId: n,
1949
- videoStats: i.outboundVideoRtpId.map((c) => e.outboundVideoRtp.get(c)),
1950
- audioStats: i.outboundAudioRtpId.map((c) => e.outboundAudioRtp.get(c)),
1951
- appData: ((d = (o = this.callStatsInstance.producers) == null ? void 0 : o.get(n)) == null ? void 0 : d.appData) || null
1949
+ videoStats: i.outboundVideoRtpId.map((d) => e.outboundVideoRtp.get(d)),
1950
+ audioStats: i.outboundAudioRtpId.map((d) => e.outboundAudioRtp.get(d)),
1951
+ appData: ((c = (o = this.callStatsInstance.producers) == null ? void 0 : o.get(n)) == null ? void 0 : c.appData) || null
1952
1952
  });
1953
1953
  });
1954
1954
  } catch (i) {
@@ -1962,12 +1962,12 @@ class lm extends st {
1962
1962
  const r = [];
1963
1963
  try {
1964
1964
  e.consumerStreamMap.forEach((i, n) => {
1965
- const { peerId: o, producerId: d, appData: c } = this.consumerPeerIdMap.get(n);
1965
+ const { peerId: o, producerId: c, appData: d } = this.consumerPeerIdMap.get(n);
1966
1966
  r.push({
1967
1967
  consumerId: n,
1968
1968
  peerId: o,
1969
- producerId: d,
1970
- appData: c,
1969
+ producerId: c,
1970
+ appData: d,
1971
1971
  videoStats: i.inboundVideoRtpId.map((l) => e.inboundVideoRtp.get(l)),
1972
1972
  audioStats: i.inboundAudioRtpId.map((l) => e.inboundAudioRtp.get(l))
1973
1973
  });
@@ -2024,10 +2024,10 @@ class lm extends st {
2024
2024
  } catch (f) {
2025
2025
  g(f);
2026
2026
  }
2027
- }), [d, c, l] = yield Promise.all([i, n, o]);
2027
+ }), [c, d, l] = yield Promise.all([i, n, o]);
2028
2028
  return {
2029
- host: d == null ? void 0 : d.connectivity,
2030
- relay: c == null ? void 0 : c.connectivity,
2029
+ host: c == null ? void 0 : c.connectivity,
2030
+ relay: d == null ? void 0 : d.connectivity,
2031
2031
  reflexive: l == null ? void 0 : l.connectivity
2032
2032
  };
2033
2033
  } catch (r) {
@@ -2045,12 +2045,12 @@ class lm extends st {
2045
2045
  try {
2046
2046
  const i = yield new Promise((n, o) => {
2047
2047
  try {
2048
- const d = {
2048
+ const c = {
2049
2049
  iceServers: e || Wh
2050
- }, c = new fv(d);
2051
- c.addListener("done", n), c.addListener("failed", o), c.start(1e4);
2052
- } catch (d) {
2053
- o(d);
2050
+ }, d = new fv(c);
2051
+ d.addListener("done", n), d.addListener("failed", o), d.start(1e4);
2052
+ } catch (c) {
2053
+ o(c);
2054
2054
  }
2055
2055
  });
2056
2056
  return {
@@ -2097,12 +2097,12 @@ class lm extends st {
2097
2097
  }
2098
2098
  getNetworkInfo(e, r = !1) {
2099
2099
  return u(this, null, function* () {
2100
- var d, c;
2100
+ var c, d;
2101
2101
  if (r) {
2102
2102
  const l = yield this.getIPDetails();
2103
2103
  return {
2104
2104
  ipDetails: l,
2105
- effectiveNetworkType: (d = navigator.connection) == null ? void 0 : d.effectiveType,
2105
+ effectiveNetworkType: (c = navigator.connection) == null ? void 0 : c.effectiveType,
2106
2106
  location: l != null && l.loc ? Jh(l == null ? void 0 : l.loc) : void 0
2107
2107
  // userLocation,
2108
2108
  };
@@ -2114,7 +2114,7 @@ class lm extends st {
2114
2114
  ]);
2115
2115
  return {
2116
2116
  ipDetails: o,
2117
- effectiveNetworkType: (c = navigator.connection) == null ? void 0 : c.effectiveType,
2117
+ effectiveNetworkType: (d = navigator.connection) == null ? void 0 : d.effectiveType,
2118
2118
  location: o != null && o.loc ? Jh(o == null ? void 0 : o.loc) : void 0,
2119
2119
  // userLocation,
2120
2120
  turnConnectivity: i ? i.host || i.relay || i.reflexive : !1,
@@ -2152,15 +2152,15 @@ class um extends lm {
2152
2152
  }
2153
2153
  generateConsumerStreamMap(e, r = !1) {
2154
2154
  return u(this, null, function* () {
2155
- const i = yield e.getStats(), n = this.parseRTCReport(i, ["inbound-rtp"], !1, e.id), o = [...n.consumerStreamMap.values()][0], d = r ? this.getConsumerStatsFromParsedConsumerStats(n, o, e.id) : void 0;
2156
- for (const c of i.values())
2157
- switch (c.type) {
2155
+ const i = yield e.getStats(), n = this.parseRTCReport(i, ["inbound-rtp"], !1, e.id), o = [...n.consumerStreamMap.values()][0], c = r ? this.getConsumerStatsFromParsedConsumerStats(n, o, e.id) : void 0;
2156
+ for (const d of i.values())
2157
+ switch (d.type) {
2158
2158
  case "inbound-rtp": {
2159
- this.inboundConsumerMap.set(c.id, e.id);
2159
+ this.inboundConsumerMap.set(d.id, e.id);
2160
2160
  break;
2161
2161
  }
2162
2162
  }
2163
- return d;
2163
+ return c;
2164
2164
  });
2165
2165
  }
2166
2166
  deregisterProducer(e) {
@@ -2190,8 +2190,8 @@ class um extends lm {
2190
2190
  }
2191
2191
  parseRTCReport(e, r = [], i = !1, n = void 0, o = void 0) {
2192
2192
  var _, w, R, D, U, B, F, H, X, Le, yt, Qt, Yr;
2193
- const d = e, c = new dm(), l = r.length ? new Set(r) : void 0, h = [], g = [], f = [], v = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
2194
- for (const I of d.values()) {
2193
+ const c = e, d = new dm(), l = r.length ? new Set(r) : void 0, h = [], g = [], f = [], v = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
2194
+ for (const I of c.values()) {
2195
2195
  if (l) {
2196
2196
  if (l.size === 0)
2197
2197
  break;
@@ -2227,7 +2227,7 @@ class um extends lm {
2227
2227
  packetsReceived: $.packetsReceived,
2228
2228
  packetsDiscardedOnSend: $.packetsDiscardedOnSend
2229
2229
  };
2230
- f.push(ve), (I.nominated === !0 || I.selected === !0) && (c.candidatePair = ve);
2230
+ f.push(ve), (I.nominated === !0 || I.selected === !0) && (d.candidatePair = ve);
2231
2231
  break;
2232
2232
  }
2233
2233
  case "transport": {
@@ -2246,7 +2246,7 @@ class um extends lm {
2246
2246
  dtlsState: y.dtlsState,
2247
2247
  iceRole: y.iceRole
2248
2248
  };
2249
- if (c.transport = C, o) {
2249
+ if (d.transport = C, o) {
2250
2250
  if (o.producing) {
2251
2251
  const $ = this.overallProducingTransportsStatsMap[o.id];
2252
2252
  this.processProducingTransportStats(o.id, $, C);
@@ -2267,7 +2267,7 @@ class um extends lm {
2267
2267
  totalRoundTripTime: y.totalRoundTripTime,
2268
2268
  packetsLost: y.packetsLost
2269
2269
  };
2270
- c.remoteInboundRtp.set(y.localId, C);
2270
+ d.remoteInboundRtp.set(y.localId, C);
2271
2271
  break;
2272
2272
  }
2273
2273
  case "outbound-rtp": {
@@ -2288,13 +2288,13 @@ class um extends lm {
2288
2288
  const ve = this.overallProducersStatsMap[C];
2289
2289
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
2290
2290
  if (!this.outboundProducerMap.has(I.id)) {
2291
- c.staleProducerStreamMap = !0;
2291
+ d.staleProducerStreamMap = !0;
2292
2292
  break;
2293
2293
  }
2294
2294
  const Pe = this.callStatsInstance.producers.get(C);
2295
2295
  if (((_ = Pe == null ? void 0 : Pe.track) == null ? void 0 : _.readyState) === "ended")
2296
2296
  break;
2297
- c.producerStreamMap.has(C) || c.producerStreamMap.set(C, {
2297
+ d.producerStreamMap.has(C) || d.producerStreamMap.set(C, {
2298
2298
  outboundVideoRtpId: [],
2299
2299
  outboundAudioRtpId: []
2300
2300
  });
@@ -2333,13 +2333,13 @@ class um extends lm {
2333
2333
  scalabilityMode: A.scalabilityMode,
2334
2334
  powerEfficientEncoder: A.powerEfficientEncoder
2335
2335
  }, L);
2336
- c.outboundVideoRtp.set(I.id, Ae), c.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ve, Ae);
2336
+ d.outboundVideoRtp.set(I.id, Ae), d.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ve, Ae);
2337
2337
  } else if (y.mediaType === "audio" || y.kind === "audio") {
2338
2338
  const A = y, Ae = N({
2339
2339
  retransmittedBytesSent: A.retransmittedBytesSent,
2340
2340
  retransmittedPacketsSent: A.retransmittedPacketsSent
2341
2341
  }, L);
2342
- c.outboundAudioRtp.set(I.id, Ae), c.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ve, Ae);
2342
+ d.outboundAudioRtp.set(I.id, Ae), d.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ve, Ae);
2343
2343
  }
2344
2344
  } else
2345
2345
  this.callStatsInstance.logger.error(`Callstats: Unknown Outbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -2365,10 +2365,10 @@ class um extends lm {
2365
2365
  const ve = this.overallConsumersStatsMap[C];
2366
2366
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
2367
2367
  if (!this.inboundConsumerMap.has(I.id)) {
2368
- c.staleConsumerStreamMap = !0;
2368
+ d.staleConsumerStreamMap = !0;
2369
2369
  break;
2370
2370
  }
2371
- c.consumerStreamMap.has(C) || c.consumerStreamMap.set(C, {
2371
+ d.consumerStreamMap.has(C) || d.consumerStreamMap.set(C, {
2372
2372
  inboundVideoRtpId: [],
2373
2373
  inboundAudioRtpId: []
2374
2374
  });
@@ -2434,7 +2434,7 @@ class um extends lm {
2434
2434
  isScreenShare: this.screenShareConsumers.has(C),
2435
2435
  bitrate: ((A.bytesReceived || 0) - (((F = this.videoConsumerToStatsMap.get(C)) == null ? void 0 : F.bytesReceived) || 0)) * 8 / 7
2436
2436
  // Bytes received in last 7 seconds
2437
- }), this.videoConsumerToStatsMap.set(C, A), c.inboundVideoRtp.set(I.id, A), c.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ve, A);
2437
+ }), this.videoConsumerToStatsMap.set(C, A), d.inboundVideoRtp.set(I.id, A), d.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ve, A);
2438
2438
  } else if (y.mediaType === "audio" || y.kind === "audio") {
2439
2439
  const L = y, A = N({
2440
2440
  audioLevel: L.audioLevel,
@@ -2465,7 +2465,7 @@ class um extends lm {
2465
2465
  isScreenShare: this.screenShareConsumers.has(C),
2466
2466
  bitrate: ((A.bytesReceived || 0) - (((Yr = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : Yr.bytesReceived) || 0)) * 8 / 7
2467
2467
  // Bytes received in last 7 seconds
2468
- }), this.audioConsumerToStatsMap.set(C, A), c.inboundAudioRtp.set(I.id, A), c.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ve, A);
2468
+ }), this.audioConsumerToStatsMap.set(C, A), d.inboundAudioRtp.set(I.id, A), d.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ve, A);
2469
2469
  }
2470
2470
  } else
2471
2471
  this.callStatsInstance.logger.error(`Callstats: Unknown Inbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -2473,12 +2473,12 @@ class um extends lm {
2473
2473
  }
2474
2474
  }
2475
2475
  }
2476
- if (c.producerStreamMap.forEach((I, y) => {
2476
+ if (d.producerStreamMap.forEach((I, y) => {
2477
2477
  var C, $, ve, Pe, L, A, Ae, _a, Ca, wa, Ra, ba, ka, Aa, Ia, Ma, Da, Oa, Na, La, Va, xa, Ua;
2478
2478
  if (I.outboundVideoRtpId.length > 0) {
2479
2479
  const ue = [];
2480
2480
  I.outboundVideoRtpId.forEach((Ul) => {
2481
- ue.push(c.outboundVideoRtp.get(Ul));
2481
+ ue.push(d.outboundVideoRtp.get(Ul));
2482
2482
  });
2483
2483
  const Z = this.getWorkingSimulcastVideoStats(ue);
2484
2484
  Z.score = rm({
@@ -2506,7 +2506,7 @@ class um extends lm {
2506
2506
  bandwidthLimitations: Z.qualityLimitationReason === "bandwidth"
2507
2507
  }), this.videoProducerToStatsMap.set(y, Z);
2508
2508
  } else if (I.outboundAudioRtpId.length > 0) {
2509
- const ue = c.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
2509
+ const ue = d.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
2510
2510
  ue.score = sm({
2511
2511
  packetsSent: (ue.packetsSent || 0) - (((ka = this.audioProducerToStatsMap.get(y)) == null ? void 0 : ka.packetsSent) || 0),
2512
2512
  packetsLost: (((Aa = ue.remoteData) == null ? void 0 : Aa.packetsLost) || 0) - (((Ma = (Ia = this.audioProducerToStatsMap.get(y)) == null ? void 0 : Ia.remoteData) == null ? void 0 : Ma.packetsLost) || 0),
@@ -2526,19 +2526,19 @@ class um extends lm {
2526
2526
  }), f.forEach((I) => {
2527
2527
  const y = h.find(($) => $.id === I.localCandidateId ? (I.localCandidateId = $.id, $) : null), C = g.find(($) => $.id === I.remoteCandidateId ? (I.remoteCandidateId = $.id, $) : null);
2528
2528
  y && (I.localCandidateType = y.type, I.localCandidateAddress = Hr(y.address), I.localCandidatePort = y.port, I.localCandidateProtocol = y.protocol, I.localCandidateUrl = y.url, I.localCandidateNetworkType = y.networkType, I.localCandidateRelatedAddress = Hr(y.relatedAddress), I.localCandidateRelatedPort = y.relatedPort), C && (I.remoteCandidateType = C.type, I.remoteCandidateAddress = Hr(C.address), I.remoteCandidatePort = C.port, I.remoteCandidateProtocol = C.protocol, I.remoteCandidateUrl = C.url);
2529
- }), c.candidatePair && (c.transport ? (c.transport.bytesReceived = c.candidatePair.bytesReceived, c.transport.bytesSent = c.candidatePair.bytesSent, c.transport.totalRoundTripTime = c.candidatePair.totalRoundTripTime, c.transport.availableOutgoingBitrate = c.candidatePair.availableOutgoingBitrate, c.transport.availableIncomingBitrate = c.candidatePair.availableIncomingBitrate, c.transport.roundTripTime = c.candidatePair.currentRoundTripTime) : c.transport = {
2529
+ }), d.candidatePair && (d.transport ? (d.transport.bytesReceived = d.candidatePair.bytesReceived, d.transport.bytesSent = d.candidatePair.bytesSent, d.transport.totalRoundTripTime = d.candidatePair.totalRoundTripTime, d.transport.availableOutgoingBitrate = d.candidatePair.availableOutgoingBitrate, d.transport.availableIncomingBitrate = d.candidatePair.availableIncomingBitrate, d.transport.roundTripTime = d.candidatePair.currentRoundTripTime) : d.transport = {
2530
2530
  // candidateStats: result.candidatePair,
2531
- bytesReceived: c.candidatePair.bytesReceived,
2532
- bytesSent: c.candidatePair.bytesSent,
2533
- totalRoundTripTime: c.candidatePair.totalRoundTripTime,
2534
- availableOutgoingBitrate: c.candidatePair.availableOutgoingBitrate,
2535
- availableIncomingBitrate: c.candidatePair.availableIncomingBitrate,
2536
- roundTripTime: c.candidatePair.currentRoundTripTime
2537
- }), c.transport && (c.transport.candidatePairs = f), c.transport && !c.transport.roundTripTime) {
2531
+ bytesReceived: d.candidatePair.bytesReceived,
2532
+ bytesSent: d.candidatePair.bytesSent,
2533
+ totalRoundTripTime: d.candidatePair.totalRoundTripTime,
2534
+ availableOutgoingBitrate: d.candidatePair.availableOutgoingBitrate,
2535
+ availableIncomingBitrate: d.candidatePair.availableIncomingBitrate,
2536
+ roundTripTime: d.candidatePair.currentRoundTripTime
2537
+ }), d.transport && (d.transport.candidatePairs = f), d.transport && !d.transport.roundTripTime) {
2538
2538
  let I = 0, y = 0;
2539
- c.remoteInboundRtp.forEach((C, $) => {
2539
+ d.remoteInboundRtp.forEach((C, $) => {
2540
2540
  C.roundTripTime && C.roundTripTime > I && (I = C.roundTripTime, y = C.totalRoundTripTime);
2541
- }), c.transport.roundTripTime = I, c.transport.totalRoundTripTime = y;
2541
+ }), d.transport.roundTripTime = I, d.transport.totalRoundTripTime = y;
2542
2542
  }
2543
2543
  if (E.size > 0)
2544
2544
  try {
@@ -2550,19 +2550,19 @@ class um extends lm {
2550
2550
  this.observer.emit("producer_score", v);
2551
2551
  } catch (I) {
2552
2552
  }
2553
- return c;
2553
+ return d;
2554
2554
  }
2555
2555
  getProducerStatsFromReport(e) {
2556
2556
  const r = [];
2557
2557
  try {
2558
2558
  e.producerStreamMap.forEach((i, n) => {
2559
- const o = this.producerMap.get(n), d = o.track.getSettings(), c = i.outboundVideoRtpId.map((h) => {
2559
+ const o = this.producerMap.get(n), c = o.track.getSettings(), d = i.outboundVideoRtpId.map((h) => {
2560
2560
  const g = e.outboundVideoRtp.get(h);
2561
- return g.frameHeight || (g.frameHeight = d.height, g.frameWidth = d.width, g.framesPerSecond = d.frameRate), g;
2561
+ return g.frameHeight || (g.frameHeight = c.height, g.frameWidth = c.width, g.framesPerSecond = c.frameRate), g;
2562
2562
  }), l = {
2563
2563
  producerId: n,
2564
2564
  appData: o.appData,
2565
- videoStats: c,
2565
+ videoStats: d,
2566
2566
  audioStats: i.outboundAudioRtpId.map((h) => e.outboundAudioRtp.get(h))
2567
2567
  };
2568
2568
  r.push(l);
@@ -2575,15 +2575,15 @@ class um extends lm {
2575
2575
  getConsumerStatsFromParsedConsumerStats(e, r, i) {
2576
2576
  let n;
2577
2577
  try {
2578
- const { peerId: o, producerId: d, appData: c } = this.consumerPeerIdMap.get(i), l = r == null ? void 0 : r.inboundVideoRtpId.map((h) => {
2578
+ const { peerId: o, producerId: c, appData: d } = this.consumerPeerIdMap.get(i), l = r == null ? void 0 : r.inboundVideoRtpId.map((h) => {
2579
2579
  const f = this.consumerMap.get(i).track.getSettings(), v = e.inboundVideoRtp.get(h);
2580
2580
  return v.frameHeight || (v.frameHeight = f.height, v.frameWidth = f.width, v.framesPerSecond = f.frameRate), v;
2581
2581
  });
2582
2582
  n = {
2583
2583
  consumerId: i,
2584
2584
  peerId: o,
2585
- producerId: d,
2586
- appData: c,
2585
+ producerId: c,
2586
+ appData: d,
2587
2587
  videoStats: l,
2588
2588
  audioStats: r == null ? void 0 : r.inboundAudioRtpId.map((h) => e.inboundAudioRtp.get(h))
2589
2589
  };
@@ -2630,12 +2630,12 @@ const Q = (s, t) => (e, r, i) => {
2630
2630
  const n = i.value;
2631
2631
  return i.value = function(...o) {
2632
2632
  try {
2633
- const d = n.apply(this, o);
2634
- return d && d instanceof Promise ? d.catch((c) => {
2635
- ld(this, s, t, c);
2636
- }) : d;
2637
- } catch (d) {
2638
- ld(this, s, t, d);
2633
+ const c = n.apply(this, o);
2634
+ return c && c instanceof Promise ? c.catch((d) => {
2635
+ ld(this, s, t, d);
2636
+ }) : c;
2637
+ } catch (c) {
2638
+ ld(this, s, t, c);
2639
2639
  }
2640
2640
  return null;
2641
2641
  }, i;
@@ -2652,13 +2652,13 @@ var K = globalThis && globalThis.__decorate || function(s, t, e, r) {
2652
2652
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
2653
2653
  n = Reflect.decorate(s, t, e, r);
2654
2654
  else
2655
- for (var d = s.length - 1; d >= 0; d--)
2656
- (o = s[d]) && (n = (i < 3 ? o(n) : i > 3 ? o(t, e, n) : o(t, e)) || n);
2655
+ for (var c = s.length - 1; c >= 0; c--)
2656
+ (o = s[c]) && (n = (i < 3 ? o(n) : i > 3 ? o(t, e, n) : o(t, e)) || n);
2657
2657
  return i > 3 && n && Object.defineProperty(t, e, n), n;
2658
2658
  };
2659
2659
  const z = console;
2660
2660
  let G = class extends st {
2661
- constructor(e = "https://api.testingv3.dyte.in", r = "Blink", i = zg.PROD, n, o, d, c, l) {
2661
+ constructor(e = "https://api.testingv3.dyte.in", r = "Blink", i = zg.PROD, n, o, c, d, l) {
2662
2662
  super();
2663
2663
  p(this, "observer");
2664
2664
  p(this, "eventHandler");
@@ -2678,7 +2678,7 @@ let G = class extends st {
2678
2678
  p(this, "currentUserMediaStates", {});
2679
2679
  if (!l)
2680
2680
  throw Error("authToken is missing but required to initialize CallStats!");
2681
- switch (this.env = i, this.apiHostnames = c, this.logger = o, this.peerId = d, this.eventHandler = new ov({ logger: o, peerId: d, apiHostnames: c, authToken: l }), this.logger.debug("callStats::engineName: ", { engineName: r }), r) {
2681
+ switch (this.env = i, this.apiHostnames = d, this.logger = o, this.peerId = c, this.eventHandler = new ov({ logger: o, peerId: c, apiHostnames: d, authToken: l }), this.logger.debug("callStats::engineName: ", { engineName: r }), r) {
2682
2682
  case "Blink":
2683
2683
  this.measurements = new Ev();
2684
2684
  break;
@@ -2882,13 +2882,13 @@ let G = class extends st {
2882
2882
  event: O.NET_QUALITY_TEST_BEGIN,
2883
2883
  timestamp: r
2884
2884
  }), new Promise((n, o) => u(this, null, function* () {
2885
- const d = [];
2885
+ const c = [];
2886
2886
  try {
2887
- for (const c of e)
2887
+ for (const d of e)
2888
2888
  try {
2889
- if (c.iceServers && c.iceServers.length > 0) {
2890
- const l = yield this.measurements.getNetworkQuality(c.iceServers);
2891
- d.push(j(N({}, c), {
2889
+ if (d.iceServers && d.iceServers.length > 0) {
2890
+ const l = yield this.measurements.getNetworkQuality(d.iceServers);
2891
+ c.push(j(N({}, d), {
2892
2892
  networkResults: l
2893
2893
  }));
2894
2894
  }
@@ -2896,10 +2896,10 @@ let G = class extends st {
2896
2896
  console.warn("Error handling ", l);
2897
2897
  }
2898
2898
  n({
2899
- regionData: d
2899
+ regionData: c
2900
2900
  });
2901
- } catch (c) {
2902
- console.warn("Error in callstats, ", c), o(c);
2901
+ } catch (d) {
2902
+ console.warn("Error in callstats, ", d), o(d);
2903
2903
  }
2904
2904
  })).then((n) => {
2905
2905
  this.eventHandler.callEvent({
@@ -2952,14 +2952,14 @@ let G = class extends st {
2952
2952
  }
2953
2953
  sendPingStatsEvent(e = !0, r) {
2954
2954
  return u(this, null, function* () {
2955
- var d, c;
2955
+ var c, d;
2956
2956
  let i, n;
2957
- if (this.producingTransport && (i = yield this.measurements.getProcessedStats(this.producingTransport, !1, !0), !i || !((d = i == null ? void 0 : i.producerReport) != null && d.length))) {
2957
+ if (this.producingTransport && (i = yield this.measurements.getProcessedStats(this.producingTransport, !1, !0), !i || !((c = i == null ? void 0 : i.producerReport) != null && c.length))) {
2958
2958
  this.logger.debug("callStats::sendPingStatsEvent::staleProducingTransport", { disclaimer: "Stale producer? Regenerating Stream Maps!" });
2959
2959
  const l = yield this.measurements.getProducersReport([...this.producers.values()]);
2960
2960
  i && l ? i.producerReport = l : (i = yield this.measurements.getProcessedStats(this.producingTransport, !1, !0), (!i || !(i != null && i.producerReport)) && this.logger.debug("callStats::sendPingStatsEvent::noProducingTransportReport", { disclaimer: "Stream maps invalid despite regenerating!" }));
2961
2961
  }
2962
- if (this.consumingTransport && (n = yield this.measurements.getProcessedStats(this.consumingTransport, !0, !1), !n || !((c = n.consumerReport) != null && c.length))) {
2962
+ if (this.consumingTransport && (n = yield this.measurements.getProcessedStats(this.consumingTransport, !0, !1), !n || !((d = n.consumerReport) != null && d.length))) {
2963
2963
  this.logger.debug("callStats::sendPingStatsEvent::staleConsumingTransport", { disclaimer: "Stale consumer? Regenerating Stream Maps!" });
2964
2964
  const l = yield this.measurements.getConsumersReport([...this.consumers.values()]);
2965
2965
  n && l ? n.consumerReport = l : (n = yield this.measurements.getProcessedStats(this.consumingTransport, !0, !1), (!n || !n.consumerReport) && this.logger.debug("callStats::sendPingStatsEvent::noConsumingTransportReport", { disclaimer: "Stream maps invalid despite regenerating!" }));
@@ -3264,17 +3264,17 @@ class hm extends st {
3264
3264
  p(this, "logger");
3265
3265
  }
3266
3266
  initialize(f) {
3267
- return u(this, arguments, function* ({ peerId: e, engineName: r, env: i = zg.PROD, iceServers: n, apiBase: o = "https://api.cluster.dyte.in", flags: d, logger: c = console, apiHostnames: l, skipConnectivityChecks: h = !1, authToken: g }) {
3267
+ return u(this, arguments, function* ({ peerId: e, engineName: r, env: i = zg.PROD, iceServers: n, apiBase: o = "https://api.cluster.dyte.in", flags: c, logger: d = console, apiHostnames: l, skipConnectivityChecks: h = !1, authToken: g }) {
3268
3268
  var v, E, _;
3269
3269
  try {
3270
- if (this.peerId = e, this.logger = c, !g) {
3270
+ if (this.peerId = e, this.logger = d, !g) {
3271
3271
  this.logger.error("callStats::initialize", {
3272
3272
  event: "auth_token_missing",
3273
3273
  peerId: this.peerId
3274
3274
  }), this.stallCallStats();
3275
3275
  return;
3276
3276
  }
3277
- this.ipInformation = yield cm.getIPDetails({ peerId: e, apiHostnames: l, logger: c }), this.backend = new Cv(o, r, i, d, c, e, l, g), this.iceServers = n, (v = this.backend) == null || v.registerIceServers(this.iceServers), this.initialized = !0, (_ = (E = this.backend) == null ? void 0 : E.eventHandler) == null || _.emit("initialized", this.ipInformation), this.emit("initialized", this.ipInformation), this.startPreCallTest(h);
3277
+ this.ipInformation = yield cm.getIPDetails({ peerId: e, apiHostnames: l, logger: d }), this.backend = new Cv(o, r, i, c, d, e, l, g), this.iceServers = n, (v = this.backend) == null || v.registerIceServers(this.iceServers), this.initialized = !0, (_ = (E = this.backend) == null ? void 0 : E.eventHandler) == null || _.emit("initialized", this.ipInformation), this.emit("initialized", this.ipInformation), this.startPreCallTest(h);
3278
3278
  } catch (w) {
3279
3279
  this.logger.error("callStats::CallStatsIntegration", {
3280
3280
  peerId: this.peerId,
@@ -3536,7 +3536,7 @@ class hm extends st {
3536
3536
  ivsPlayerEvent(e, r) {
3537
3537
  const i = new Date();
3538
3538
  this.onSafeInitialization(() => {
3539
- var n, o, d, c, l, h, g, f, v, E, _;
3539
+ var n, o, c, d, l, h, g, f, v, E, _;
3540
3540
  switch (e) {
3541
3541
  case "PlayerRebuffering":
3542
3542
  (n = this.backend) == null || n.sendIVSPlayerRebufferEvent(i);
@@ -3545,10 +3545,10 @@ class hm extends st {
3545
3545
  (o = this.backend) == null || o.sendIVSPlayerAudioBlockEvent(i);
3546
3546
  break;
3547
3547
  case "PlayerPlaybackBlocked":
3548
- (d = this.backend) == null || d.sendIVSPlayerPlaybackBlockedEvent(i);
3548
+ (c = this.backend) == null || c.sendIVSPlayerPlaybackBlockedEvent(i);
3549
3549
  break;
3550
3550
  case "PlayerNetworkUnavailable":
3551
- (c = this.backend) == null || c.sendIVSPlayerNetworkUnavailableEvent(i);
3551
+ (d = this.backend) == null || d.sendIVSPlayerNetworkUnavailableEvent(i);
3552
3552
  break;
3553
3553
  case "PlayerInitialized":
3554
3554
  (l = this.backend) == null || l.sendIVSPlayerInitializedEvent(i);
@@ -3692,14 +3692,14 @@ const Vh = class extends st.EventEmitter {
3692
3692
  }
3693
3693
  onAsync(e, r) {
3694
3694
  const i = a(this, Ds), n = (...o) => u(this, null, function* () {
3695
- var c;
3695
+ var d;
3696
3696
  try {
3697
3697
  yield r(...o);
3698
3698
  } catch (l) {
3699
3699
  this.logger.error("[onAsync]", { error: l });
3700
3700
  }
3701
- const d = (c = i.get(e)) == null ? void 0 : c.shift();
3702
- d == null || d();
3701
+ const c = (d = i.get(e)) == null ? void 0 : d.shift();
3702
+ c == null || c();
3703
3703
  });
3704
3704
  return a(this, Os).get(e) || a(this, Os).set(e, []), a(this, Os).get(e).push(n), super.on(e, n);
3705
3705
  }
@@ -3967,8 +3967,8 @@ function Cc(s, t, e, r) {
3967
3967
  var i = !e;
3968
3968
  e || (e = {});
3969
3969
  for (var n = -1, o = t.length; ++n < o; ) {
3970
- var d = t[n], c = r ? r(e[d], s[d], d, e, s) : void 0;
3971
- c === void 0 && (c = s[d]), i ? ih(e, d, c) : Sm(e, d, c);
3970
+ var c = t[n], d = r ? r(e[c], s[c], c, e, s) : void 0;
3971
+ d === void 0 && (d = s[c]), i ? ih(e, c, d) : Sm(e, c, d);
3972
3972
  }
3973
3973
  return e;
3974
3974
  }
@@ -3978,9 +3978,9 @@ function $T(s, t, e) {
3978
3978
  for (var r = arguments, i = -1, n = sp(r.length - t, 0), o = Array(n); ++i < n; )
3979
3979
  o[i] = r[t + i];
3980
3980
  i = -1;
3981
- for (var d = Array(t + 1); ++i < t; )
3982
- d[i] = r[i];
3983
- return d[t] = e(o), ST(s, this, d);
3981
+ for (var c = Array(t + 1); ++i < t; )
3982
+ c[i] = r[i];
3983
+ return c[t] = e(o), ST(s, this, c);
3984
3984
  };
3985
3985
  }
3986
3986
  function BT(s, t) {
@@ -4003,8 +4003,8 @@ function qT(s) {
4003
4003
  return BT(function(t, e) {
4004
4004
  var r = -1, i = e.length, n = i > 1 ? e[i - 1] : void 0, o = i > 2 ? e[2] : void 0;
4005
4005
  for (n = s.length > 3 && typeof n == "function" ? (i--, n) : void 0, o && FT(e[0], e[1], o) && (n = i < 3 ? void 0 : n, i = 1), t = Object(t); ++r < i; ) {
4006
- var d = e[r];
4007
- d && s(t, d, r, n);
4006
+ var c = e[r];
4007
+ c && s(t, c, r, n);
4008
4008
  }
4009
4009
  return t;
4010
4010
  });
@@ -4057,14 +4057,14 @@ var ap = fa && fa.isTypedArray, by = ap ? ah(ap) : Cy;
4057
4057
  const Pl = by;
4058
4058
  var ky = Object.prototype, Ay = ky.hasOwnProperty;
4059
4059
  function Em(s, t) {
4060
- var e = Mt(s), r = !e && lo(s), i = !e && !r && ma(s), n = !e && !r && !i && Pl(s), o = e || r || i || n, d = o ? GT(s.length, String) : [], c = d.length;
4060
+ var e = Mt(s), r = !e && lo(s), i = !e && !r && ma(s), n = !e && !r && !i && Pl(s), o = e || r || i || n, c = o ? GT(s.length, String) : [], d = c.length;
4061
4061
  for (var l in s)
4062
4062
  (t || Ay.call(s, l)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
4063
4063
  (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
4064
4064
  i && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
4065
4065
  n && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
4066
- rh(l, c))) && d.push(l);
4067
- return d;
4066
+ rh(l, d))) && c.push(l);
4067
+ return c;
4068
4068
  }
4069
4069
  function Pm(s, t) {
4070
4070
  return function(e) {
@@ -4492,26 +4492,26 @@ var UP = 1, $P = 2, BP = 4, Lm = "[object Arguments]", HP = "[object Array]", FP
4492
4492
  ge[Lm] = ge[HP] = ge[ZP] = ge[e_] = ge[FP] = ge[qP] = ge[t_] = ge[s_] = ge[r_] = ge[i_] = ge[n_] = ge[WP] = ge[JP] = ge[xm] = ge[KP] = ge[zP] = ge[YP] = ge[QP] = ge[a_] = ge[o_] = ge[c_] = ge[d_] = !0;
4493
4493
  ge[jP] = ge[Vm] = ge[XP] = !1;
4494
4494
  function eo(s, t, e, r, i, n) {
4495
- var o, d = t & UP, c = t & $P, l = t & BP;
4495
+ var o, c = t & UP, d = t & $P, l = t & BP;
4496
4496
  if (e && (o = i ? e(s, r, i, n) : e(s)), o !== void 0)
4497
4497
  return o;
4498
4498
  if (!Kt(s))
4499
4499
  return s;
4500
4500
  var h = Mt(s);
4501
4501
  if (h) {
4502
- if (o = iP(s), !d)
4502
+ if (o = iP(s), !c)
4503
4503
  return fm(s, o);
4504
4504
  } else {
4505
4505
  var g = Sa(s), f = g == Vm || g == GP;
4506
4506
  if (ma(s))
4507
- return Am(s, d);
4507
+ return Am(s, c);
4508
4508
  if (g == xm || g == Lm || f && !i) {
4509
- if (o = c || f ? {} : Nm(s), !d)
4510
- return c ? GE(s, VE(o, s)) : FE(s, LE(o, s));
4509
+ if (o = d || f ? {} : Nm(s), !c)
4510
+ return d ? GE(s, VE(o, s)) : FE(s, LE(o, s));
4511
4511
  } else {
4512
4512
  if (!ge[g])
4513
4513
  return i ? s : {};
4514
- o = AP(s, g, d);
4514
+ o = AP(s, g, c);
4515
4515
  }
4516
4516
  }
4517
4517
  n || (n = new us());
@@ -4523,7 +4523,7 @@ function eo(s, t, e, r, i, n) {
4523
4523
  }) : OP(s) && s.forEach(function(w, R) {
4524
4524
  o.set(R, eo(w, t, e, R, s, n));
4525
4525
  });
4526
- var E = l ? c ? WE : iu : c ? Rc : _l, _ = h ? void 0 : E(s);
4526
+ var E = l ? d ? WE : iu : d ? Rc : _l, _ = h ? void 0 : E(s);
4527
4527
  return AT(_ || s, function(w, R) {
4528
4528
  _ && (R = w, w = s[R]), Sm(o, R, eo(w, t, e, R, s, n));
4529
4529
  }), o;
@@ -4561,14 +4561,14 @@ function Um(s, t) {
4561
4561
  }
4562
4562
  var v_ = 1, T_ = 2;
4563
4563
  function $m(s, t, e, r, i, n) {
4564
- var o = e & v_, d = s.length, c = t.length;
4565
- if (d != c && !(o && c > d))
4564
+ var o = e & v_, c = s.length, d = t.length;
4565
+ if (c != d && !(o && d > c))
4566
4566
  return !1;
4567
4567
  var l = n.get(s), h = n.get(t);
4568
4568
  if (l && h)
4569
4569
  return l == t && h == s;
4570
4570
  var g = -1, f = !0, v = e & T_ ? new po() : void 0;
4571
- for (n.set(s, t), n.set(t, s); ++g < d; ) {
4571
+ for (n.set(s, t), n.set(t, s); ++g < c; ) {
4572
4572
  var E = s[g], _ = t[g];
4573
4573
  if (r)
4574
4574
  var w = o ? r(_, E, g, t, s, n) : r(E, _, g, s, t, n);
@@ -4624,16 +4624,16 @@ function N_(s, t, e, r, i, n, o) {
4624
4624
  case I_:
4625
4625
  return s == t + "";
4626
4626
  case R_:
4627
- var d = y_;
4627
+ var c = y_;
4628
4628
  case A_:
4629
- var c = r & E_;
4630
- if (d || (d = ph), s.size != t.size && !c)
4629
+ var d = r & E_;
4630
+ if (c || (c = ph), s.size != t.size && !d)
4631
4631
  return !1;
4632
4632
  var l = o.get(s);
4633
4633
  if (l)
4634
4634
  return l == t;
4635
4635
  r |= P_, o.set(s, t);
4636
- var h = $m(d(s), d(t), r, i, n, o);
4636
+ var h = $m(c(s), c(t), r, i, n, o);
4637
4637
  return o.delete(s), h;
4638
4638
  case M_:
4639
4639
  if (ql)
@@ -4643,11 +4643,11 @@ function N_(s, t, e, r, i, n, o) {
4643
4643
  }
4644
4644
  var L_ = 1, V_ = Object.prototype, x_ = V_.hasOwnProperty;
4645
4645
  function U_(s, t, e, r, i, n) {
4646
- var o = e & L_, d = iu(s), c = d.length, l = iu(t), h = l.length;
4647
- if (c != h && !o)
4646
+ var o = e & L_, c = iu(s), d = c.length, l = iu(t), h = l.length;
4647
+ if (d != h && !o)
4648
4648
  return !1;
4649
- for (var g = c; g--; ) {
4650
- var f = d[g];
4649
+ for (var g = d; g--; ) {
4650
+ var f = c[g];
4651
4651
  if (!(o ? f in t : x_.call(t, f)))
4652
4652
  return !1;
4653
4653
  }
@@ -4656,8 +4656,8 @@ function U_(s, t, e, r, i, n) {
4656
4656
  return v == t && E == s;
4657
4657
  var _ = !0;
4658
4658
  n.set(s, t), n.set(t, s);
4659
- for (var w = o; ++g < c; ) {
4660
- f = d[g];
4659
+ for (var w = o; ++g < d; ) {
4660
+ f = c[g];
4661
4661
  var R = s[f], D = t[f];
4662
4662
  if (r)
4663
4663
  var U = o ? r(D, R, f, t, s, n) : r(R, D, f, s, t, n);
@@ -4675,16 +4675,16 @@ function U_(s, t, e, r, i, n) {
4675
4675
  }
4676
4676
  var $_ = 1, Ep = "[object Arguments]", Pp = "[object Array]", Lc = "[object Object]", B_ = Object.prototype, _p = B_.hasOwnProperty;
4677
4677
  function H_(s, t, e, r, i, n) {
4678
- var o = Mt(s), d = Mt(t), c = o ? Pp : Sa(s), l = d ? Pp : Sa(t);
4679
- c = c == Ep ? Lc : c, l = l == Ep ? Lc : l;
4680
- var h = c == Lc, g = l == Lc, f = c == l;
4678
+ var o = Mt(s), c = Mt(t), d = o ? Pp : Sa(s), l = c ? Pp : Sa(t);
4679
+ d = d == Ep ? Lc : d, l = l == Ep ? Lc : l;
4680
+ var h = d == Lc, g = l == Lc, f = d == l;
4681
4681
  if (f && ma(s)) {
4682
4682
  if (!ma(t))
4683
4683
  return !1;
4684
4684
  o = !0, h = !1;
4685
4685
  }
4686
4686
  if (f && !h)
4687
- return n || (n = new us()), o || Pl(s) ? $m(s, t, e, r, i, n) : N_(s, t, c, e, r, i, n);
4687
+ return n || (n = new us()), o || Pl(s) ? $m(s, t, e, r, i, n) : N_(s, t, d, e, r, i, n);
4688
4688
  if (!(e & $_)) {
4689
4689
  var v = h && _p.call(s, "__wrapped__"), E = g && _p.call(t, "__wrapped__");
4690
4690
  if (v || E) {
@@ -4703,20 +4703,20 @@ function j_(s, t, e, r) {
4703
4703
  if (s == null)
4704
4704
  return !n;
4705
4705
  for (s = Object(s); i--; ) {
4706
- var d = e[i];
4707
- if (o && d[2] ? d[1] !== s[d[0]] : !(d[0] in s))
4706
+ var c = e[i];
4707
+ if (o && c[2] ? c[1] !== s[c[0]] : !(c[0] in s))
4708
4708
  return !1;
4709
4709
  }
4710
4710
  for (; ++i < n; ) {
4711
- d = e[i];
4712
- var c = d[0], l = s[c], h = d[1];
4713
- if (o && d[2]) {
4714
- if (l === void 0 && !(c in s))
4711
+ c = e[i];
4712
+ var d = c[0], l = s[d], h = c[1];
4713
+ if (o && c[2]) {
4714
+ if (l === void 0 && !(d in s))
4715
4715
  return !1;
4716
4716
  } else {
4717
4717
  var g = new us();
4718
4718
  if (r)
4719
- var f = r(l, h, c, s, t, g);
4719
+ var f = r(l, h, d, s, t, g);
4720
4720
  if (!(f === void 0 ? bl(h, l, F_ | q_, r, g) : f))
4721
4721
  return !1;
4722
4722
  }
@@ -4785,9 +4785,9 @@ function sC(s) {
4785
4785
  }
4786
4786
  function rC(s) {
4787
4787
  return function(t, e, r) {
4788
- for (var i = -1, n = Object(t), o = r(t), d = o.length; d--; ) {
4789
- var c = o[s ? d : ++i];
4790
- if (e(n[c], c, n) === !1)
4788
+ for (var i = -1, n = Object(t), o = r(t), c = o.length; c--; ) {
4789
+ var d = o[s ? c : ++i];
4790
+ if (e(n[d], d, n) === !1)
4791
4791
  break;
4792
4792
  }
4793
4793
  return t;
@@ -4801,7 +4801,7 @@ var aC = function() {
4801
4801
  const jl = aC;
4802
4802
  var oC = "Expected a function", cC = Math.max, dC = Math.min;
4803
4803
  function gh(s, t, e) {
4804
- var r, i, n, o, d, c, l = 0, h = !1, g = !1, f = !0;
4804
+ var r, i, n, o, c, d, l = 0, h = !1, g = !1, f = !0;
4805
4805
  if (typeof s != "function")
4806
4806
  throw new TypeError(oC);
4807
4807
  t = Zh(t) || 0, Kt(e) && (h = !!e.leading, g = "maxWait" in e, n = g ? cC(Zh(e.maxWait) || 0, t) : n, f = "trailing" in e ? !!e.trailing : f);
@@ -4810,40 +4810,40 @@ function gh(s, t, e) {
4810
4810
  return r = i = void 0, l = H, o = s.apply(Le, X), o;
4811
4811
  }
4812
4812
  function E(H) {
4813
- return l = H, d = setTimeout(R, t), h ? v(H) : o;
4813
+ return l = H, c = setTimeout(R, t), h ? v(H) : o;
4814
4814
  }
4815
4815
  function _(H) {
4816
- var X = H - c, Le = H - l, yt = t - X;
4816
+ var X = H - d, Le = H - l, yt = t - X;
4817
4817
  return g ? dC(yt, n - Le) : yt;
4818
4818
  }
4819
4819
  function w(H) {
4820
- var X = H - c, Le = H - l;
4821
- return c === void 0 || X >= t || X < 0 || g && Le >= n;
4820
+ var X = H - d, Le = H - l;
4821
+ return d === void 0 || X >= t || X < 0 || g && Le >= n;
4822
4822
  }
4823
4823
  function R() {
4824
4824
  var H = jl();
4825
4825
  if (w(H))
4826
4826
  return D(H);
4827
- d = setTimeout(R, _(H));
4827
+ c = setTimeout(R, _(H));
4828
4828
  }
4829
4829
  function D(H) {
4830
- return d = void 0, f && r ? v(H) : (r = i = void 0, o);
4830
+ return c = void 0, f && r ? v(H) : (r = i = void 0, o);
4831
4831
  }
4832
4832
  function U() {
4833
- d !== void 0 && clearTimeout(d), l = 0, r = c = i = d = void 0;
4833
+ c !== void 0 && clearTimeout(c), l = 0, r = d = i = c = void 0;
4834
4834
  }
4835
4835
  function B() {
4836
- return d === void 0 ? o : D(jl());
4836
+ return c === void 0 ? o : D(jl());
4837
4837
  }
4838
4838
  function F() {
4839
4839
  var H = jl(), X = w(H);
4840
- if (r = arguments, i = this, c = H, X) {
4841
- if (d === void 0)
4842
- return E(c);
4840
+ if (r = arguments, i = this, d = H, X) {
4841
+ if (c === void 0)
4842
+ return E(d);
4843
4843
  if (g)
4844
- return clearTimeout(d), d = setTimeout(R, t), v(c);
4844
+ return clearTimeout(c), c = setTimeout(R, t), v(d);
4845
4845
  }
4846
- return d === void 0 && (d = setTimeout(R, t)), o;
4846
+ return c === void 0 && (c = setTimeout(R, t)), o;
4847
4847
  }
4848
4848
  return F.cancel = U, F.flush = B, F;
4849
4849
  }
@@ -4861,25 +4861,25 @@ function uC(s) {
4861
4861
  return Cc(s, Rc(s));
4862
4862
  }
4863
4863
  function hC(s, t, e, r, i, n, o) {
4864
- var d = cu(s, e), c = cu(t, e), l = o.get(c);
4864
+ var c = cu(s, e), d = cu(t, e), l = o.get(d);
4865
4865
  if (l) {
4866
4866
  ou(s, e, l);
4867
4867
  return;
4868
4868
  }
4869
- var h = n ? n(d, c, e + "", s, t, o) : void 0, g = h === void 0;
4869
+ var h = n ? n(c, d, e + "", s, t, o) : void 0, g = h === void 0;
4870
4870
  if (g) {
4871
- var f = Mt(c), v = !f && ma(c), E = !f && !v && Pl(c);
4872
- h = c, f || v || E ? Mt(d) ? h = d : lC(d) ? h = fm(d) : v ? (g = !1, h = Am(c, !0)) : E ? (g = !1, h = Om(c, !0)) : h = [] : kE(c) || lo(c) ? (h = d, lo(d) ? h = uC(d) : (!Kt(d) || sh(d)) && (h = Nm(c))) : g = !1;
4871
+ var f = Mt(d), v = !f && ma(d), E = !f && !v && Pl(d);
4872
+ h = d, f || v || E ? Mt(c) ? h = c : lC(c) ? h = fm(c) : v ? (g = !1, h = Am(d, !0)) : E ? (g = !1, h = Om(d, !0)) : h = [] : kE(d) || lo(d) ? (h = c, lo(c) ? h = uC(c) : (!Kt(c) || sh(c)) && (h = Nm(d))) : g = !1;
4873
4873
  }
4874
- g && (o.set(c, h), i(h, c, r, n, o), o.delete(c)), ou(s, e, h);
4874
+ g && (o.set(d, h), i(h, d, r, n, o), o.delete(d)), ou(s, e, h);
4875
4875
  }
4876
4876
  function Fm(s, t, e, r, i) {
4877
4877
  s !== t && nC(t, function(n, o) {
4878
4878
  if (i || (i = new us()), Kt(n))
4879
4879
  hC(s, t, o, e, Fm, r, i);
4880
4880
  else {
4881
- var d = r ? r(cu(s, o), n, o + "", s, t, i) : void 0;
4882
- d === void 0 && (d = n), ou(s, o, d);
4881
+ var c = r ? r(cu(s, o), n, o + "", s, t, i) : void 0;
4882
+ c === void 0 && (c = n), ou(s, o, c);
4883
4883
  }
4884
4884
  }, Rc);
4885
4885
  }
@@ -4918,28 +4918,28 @@ var EC = 1 / 0, PC = hn && 1 / ph(new hn([, -0]))[1] == EC ? function(s) {
4918
4918
  const _C = PC;
4919
4919
  var CC = 200;
4920
4920
  function qm(s, t, e) {
4921
- var r = -1, i = NT, n = s.length, o = !0, d = [], c = d;
4921
+ var r = -1, i = NT, n = s.length, o = !0, c = [], d = c;
4922
4922
  if (e)
4923
4923
  o = !1, i = pC;
4924
4924
  else if (n >= CC) {
4925
4925
  var l = t ? null : _C(s);
4926
4926
  if (l)
4927
4927
  return ph(l);
4928
- o = !1, i = Um, c = new po();
4928
+ o = !1, i = Um, d = new po();
4929
4929
  } else
4930
- c = t ? [] : d;
4930
+ d = t ? [] : c;
4931
4931
  e:
4932
4932
  for (; ++r < n; ) {
4933
4933
  var h = s[r], g = t ? t(h) : h;
4934
4934
  if (h = e || h !== 0 ? h : 0, o && g === g) {
4935
- for (var f = c.length; f--; )
4936
- if (c[f] === g)
4935
+ for (var f = d.length; f--; )
4936
+ if (d[f] === g)
4937
4937
  continue e;
4938
- t && c.push(g), d.push(h);
4938
+ t && d.push(g), c.push(h);
4939
4939
  } else
4940
- i(c, g, e) || (c !== d && c.push(g), d.push(h));
4940
+ i(d, g, e) || (d !== c && d.push(g), c.push(h));
4941
4941
  }
4942
- return d;
4942
+ return c;
4943
4943
  }
4944
4944
  function wC(s) {
4945
4945
  return s && s.length ? qm(s) : [];
@@ -5067,19 +5067,19 @@ function Gm(s, t, e = {}) {
5067
5067
  function wp(s, t, e = {}, r = "") {
5068
5068
  const i = {};
5069
5069
  try {
5070
- const n = JSON.stringify(e), o = JSON.parse(n), d = Gm(
5070
+ const n = JSON.stringify(e), o = JSON.parse(n), c = Gm(
5071
5071
  o,
5072
5072
  r
5073
- ), c = JSON.stringify(d);
5074
- if (!(t == null ? void 0 : t.startsWith("[SDP]")) && c.length > 5e3) {
5073
+ ), d = JSON.stringify(c);
5074
+ if (!(t == null ? void 0 : t.startsWith("[SDP]")) && d.length > 5e3) {
5075
5075
  const h = `Log named: "${t}" is trying to log an flattened object of size
5076
- ${c.length} chars that is beyond permitted limit of 5000 chars. Please optimize.`;
5076
+ ${d.length} chars that is beyond permitted limit of 5000 chars. Please optimize.`;
5077
5077
  throw jm(s) && console.error(h, {
5078
5078
  log: e,
5079
- flattened: c
5079
+ flattened: d
5080
5080
  }), new Error(h);
5081
5081
  }
5082
- return JSON.parse(c);
5082
+ return JSON.parse(d);
5083
5083
  } catch (n) {
5084
5084
  const o = Jc(n);
5085
5085
  i[`${r}.error.message`] = o.message || "", i[`${r}.error.stack`] = o.stack || "", i[`${r}.error.reason`] = o.reason || "", i[`${r}.error.source`] = "safelyFlattenObjForOpenTelemetry";
@@ -5173,12 +5173,12 @@ class P {
5173
5173
  static trace(t, e = void 0) {
5174
5174
  return (r, i, n) => {
5175
5175
  const o = n.value;
5176
- return n.value = function(...c) {
5176
+ return n.value = function(...d) {
5177
5177
  const l = this == null ? void 0 : this.telemetry;
5178
5178
  if (!l || !l.initialized || navigator.isReactNative || !l.tracingEnabled)
5179
- return o.apply(this, c);
5179
+ return o.apply(this, d);
5180
5180
  l.addLogInCurrentSpan("info", t, e);
5181
- const h = performance.now(), g = o.apply(this, c);
5181
+ const h = performance.now(), g = o.apply(this, d);
5182
5182
  return Promise.resolve(g).then(() => {
5183
5183
  const f = performance.now();
5184
5184
  f - h > 10 && l.addLogInCurrentSpan("info", `${t}_timing`, {
@@ -5211,28 +5211,28 @@ class P {
5211
5211
  t
5212
5212
  ))
5213
5213
  try {
5214
- const d = wp(
5214
+ const c = wp(
5215
5215
  n,
5216
5216
  e,
5217
5217
  r,
5218
5218
  "metadata"
5219
- ), c = new Date(), l = j(N({
5219
+ ), d = new Date(), l = j(N({
5220
5220
  message: e,
5221
5221
  level: t
5222
- }, d), {
5223
- loggedAt: c.toISOString(),
5224
- loggedAtTzOffset: c.getTimezoneOffset()
5222
+ }, c), {
5223
+ loggedAt: d.toISOString(),
5224
+ loggedAtTzOffset: d.getTimezoneOffset()
5225
5225
  });
5226
5226
  i ? this.sendOtelLogsToNewRelic([l], {
5227
5227
  isInDestructionMode: !1
5228
5228
  }).catch(() => {
5229
5229
  }) : this.logsCache.push(l);
5230
- } catch (d) {
5230
+ } catch (c) {
5231
5231
  this.addLogInCurrentSpan(
5232
5232
  "error",
5233
5233
  "opentelemetry::addLogInCurrentSpan_failed",
5234
5234
  {
5235
- error: Jc(d)
5235
+ error: Jc(c)
5236
5236
  }
5237
5237
  );
5238
5238
  }
@@ -5246,7 +5246,7 @@ class P {
5246
5246
  8e3
5247
5247
  );
5248
5248
  try {
5249
- const o = Fr.getContext(this.meetingMetadata.peerId), d = JSON.stringify({
5249
+ const o = Fr.getContext(this.meetingMetadata.peerId), c = JSON.stringify({
5250
5250
  meetingMetadata: wp(
5251
5251
  o,
5252
5252
  "sendOtelLogsToNewRelic",
@@ -5256,19 +5256,19 @@ class P {
5256
5256
  serviceName: o.getValue("sdkName"),
5257
5257
  logs: t
5258
5258
  });
5259
- let c;
5259
+ let d;
5260
5260
  const l = {
5261
5261
  Authorization: `Bearer ${o.getValue("authToken")}`
5262
5262
  };
5263
5263
  if (this.isCompressionSupported()) {
5264
- const h = new Blob([d]).stream().pipeThrough(new CompressionStream("gzip"));
5265
- c = yield new Response(h).arrayBuffer(), l["Content-Type"] = "application/gzip", l["Content-Encoding"] = "gzip";
5264
+ const h = new Blob([c]).stream().pipeThrough(new CompressionStream("gzip"));
5265
+ d = yield new Response(h).arrayBuffer(), l["Content-Type"] = "application/gzip", l["Content-Encoding"] = "gzip";
5266
5266
  } else
5267
- c = d, l["Content-Type"] = "application/json";
5267
+ d = c, l["Content-Type"] = "application/json";
5268
5268
  yield fetch(this.logsEndpoint, {
5269
5269
  method: "POST",
5270
5270
  headers: l,
5271
- body: c,
5271
+ body: d,
5272
5272
  signal: i.signal,
5273
5273
  /*
5274
5274
  * NOTE(ravindra-cloudflare):
@@ -5497,12 +5497,12 @@ class k extends Error {
5497
5497
  super(e);
5498
5498
  p(this, "code");
5499
5499
  this.code = r, this.name = "ClientError";
5500
- const o = this.code ? `[ERR${this.code}]` : "[ERR]", d = this.code ? Kc[this.code] : "";
5501
- this.message = `${o}: ${d}
5500
+ const o = this.code ? `[ERR${this.code}]` : "[ERR]", c = this.code ? Kc[this.code] : "";
5501
+ this.message = `${o}: ${c}
5502
5502
  ${this.message}`;
5503
5503
  try {
5504
- let c = n && !!i;
5505
- r && r.endsWith("00") && i && (c = !0), c && i.error("ClientError", {
5504
+ let d = n && !!i;
5505
+ r && r.endsWith("00") && i && (d = !0), d && i.error("ClientError", {
5506
5506
  error: { message: this.message, name: this.name, code: r }
5507
5507
  });
5508
5508
  const l = Fr.getContext(Fr.getMostRecentPeerId());
@@ -5516,7 +5516,7 @@ ${this.message}`;
5516
5516
  typeof window != "undefined" && window.dispatchEvent(new CustomEvent("ClientError", {
5517
5517
  detail: this
5518
5518
  }));
5519
- } catch (c) {
5519
+ } catch (d) {
5520
5520
  }
5521
5521
  }
5522
5522
  }
@@ -5541,8 +5541,8 @@ function Rp(s, t, e) {
5541
5541
  }), n && (s.set = function(o) {
5542
5542
  try {
5543
5543
  return n.apply(this, [o]);
5544
- } catch (d) {
5545
- xc(this, t, e, d);
5544
+ } catch (c) {
5545
+ xc(this, t, e, c);
5546
5546
  }
5547
5547
  }), s;
5548
5548
  }
@@ -5591,38 +5591,38 @@ var FC = (s, t, e) => {
5591
5591
  if (t == 0)
5592
5592
  r = i = n = e;
5593
5593
  else {
5594
- const o = (l, h, g) => (g < 0 && (g += 1), g > 1 && (g -= 1), g < 0.16666666666666666 ? l + (h - l) * 6 * g : g < 0.5 ? h : g < 0.6666666666666666 ? l + (h - l) * (0.6666666666666666 - g) * 6 : l), d = e < 0.5 ? e * (1 + t) : e + t - e * t, c = 2 * e - d;
5595
- r = o(c, d, s + 1 / 3), i = o(c, d, s), n = o(c, d, s - 1 / 3);
5594
+ const o = (l, h, g) => (g < 0 && (g += 1), g > 1 && (g -= 1), g < 0.16666666666666666 ? l + (h - l) * 6 * g : g < 0.5 ? h : g < 0.6666666666666666 ? l + (h - l) * (0.6666666666666666 - g) * 6 : l), c = e < 0.5 ? e * (1 + t) : e + t - e * t, d = 2 * e - c;
5595
+ r = o(d, c, s + 1 / 3), i = o(d, c, s), n = o(d, c, s - 1 / 3);
5596
5596
  }
5597
5597
  return [Math.round(r * 255), Math.round(i * 255), Math.round(n * 255)];
5598
5598
  }, qC = (s, t, e) => {
5599
5599
  s /= 255, t /= 255, e /= 255;
5600
5600
  const r = Math.max(s, t, e), i = Math.min(s, t, e);
5601
5601
  let n, o;
5602
- const d = (r + i) / 2;
5602
+ const c = (r + i) / 2;
5603
5603
  if (r == i)
5604
5604
  n = o = 0;
5605
5605
  else {
5606
- const c = r - i;
5607
- switch (o = d > 0.5 ? c / (2 - r - i) : c / (r + i), r) {
5606
+ const d = r - i;
5607
+ switch (o = c > 0.5 ? d / (2 - r - i) : d / (r + i), r) {
5608
5608
  case s:
5609
- n = (t - e) / c + (t < e ? 6 : 0);
5609
+ n = (t - e) / d + (t < e ? 6 : 0);
5610
5610
  break;
5611
5611
  case t:
5612
- n = (e - s) / c + 2;
5612
+ n = (e - s) / d + 2;
5613
5613
  break;
5614
5614
  case e:
5615
- n = (s - t) / c + 4;
5615
+ n = (s - t) / d + 4;
5616
5616
  break;
5617
5617
  }
5618
5618
  n /= 6;
5619
5619
  }
5620
- return [n, o, d];
5620
+ return [n, o, c];
5621
5621
  }, jC = (s, t, e) => {
5622
5622
  const r = (i) => i.toString(16).padStart(2, "0");
5623
5623
  return `#${r(s)}${r(t)}${r(e)}`;
5624
5624
  }, Jm = (s, t = Wm, e = 0.4) => {
5625
- const r = [], [i, n, o] = HC(s), [d, c, l] = qC(i, n, o), h = Math.round(l * 100);
5625
+ const r = [], [i, n, o] = HC(s), [c, d, l] = qC(i, n, o), h = Math.round(l * 100);
5626
5626
  h > 70 ? e = 0.8 : h > 60 ? e = 0.9 : h < 10 ? e = 0.075 : h < 42 && (e = 0.3);
5627
5627
  const g = t.findIndex((w) => w === 0);
5628
5628
  if (g === -1)
@@ -5631,7 +5631,7 @@ var FC = (s, t, e) => {
5631
5631
  for (const w of t) {
5632
5632
  let R;
5633
5633
  w < 0 ? R = h + w * _ * e : w > 0 ? R = h + w * E * e : R = h;
5634
- const [D, U, B] = FC(d, c, R / 100);
5634
+ const [D, U, B] = FC(c, d, R / 100);
5635
5635
  r.push(jC(D, U, B));
5636
5636
  }
5637
5637
  return r;
@@ -6147,10 +6147,10 @@ function XC(s, t = 2) {
6147
6147
  return s.replace(/[^\u00BF-\u1FFF\u2C00-\uD7FF\w\s]/g, "").trim().split(/\s+/).slice(0, t).map((i) => i.charAt(0)).join("").toUpperCase();
6148
6148
  }
6149
6149
  const kp = 1080, Ap = 1920, ZC = (s, t, e, r, i, n) => {
6150
- let o = 0.5, d = 0.5;
6151
- const c = i, l = n, h = Math.min(e / c, r / l);
6152
- let g = c * h, f = l * h, v, E, _, w, R = 1;
6153
- return g < e && (R = e / g), Math.abs(R - 1) < 1e-14 && f < r && (R = r / f), g *= R, f *= R, _ = c / (g / e), w = l / (f / r), v = (c - _) * o, E = (l - w) * d, v < 0 && (v = 0), E < 0 && (E = 0), _ > c && (_ = c), w > l && (w = l), [v, E, _, w, s, t, e, r];
6150
+ let o = 0.5, c = 0.5;
6151
+ const d = i, l = n, h = Math.min(e / d, r / l);
6152
+ let g = d * h, f = l * h, v, E, _, w, R = 1;
6153
+ return g < e && (R = e / g), Math.abs(R - 1) < 1e-14 && f < r && (R = r / f), g *= R, f *= R, _ = d / (g / e), w = l / (f / r), v = (d - _) * o, E = (l - w) * c, v < 0 && (v = 0), E < 0 && (E = 0), _ > d && (_ = d), w > l && (w = l), [v, E, _, w, s, t, e, r];
6154
6154
  };
6155
6155
  var Ut, ni, Qe, $t, we, es, Ns, it, Me, Sn, vn, Ls, Tn;
6156
6156
  const xh = class extends Ot {
@@ -6320,7 +6320,7 @@ const xh = class extends Ot {
6320
6320
  drawEmptyTile(e, r, i, n) {
6321
6321
  if (a(this, Ut) === void 0)
6322
6322
  return;
6323
- const o = a(this, Ut).getContext("2d"), d = a(this, Ut).width, c = 0, l = 0, h = r - c * 2, g = i - c * 2, f = Math.floor(d / h), v = Math.floor(e / f), _ = e % f * (h + c) + c, w = v * (g + c) + c, { displayText: R, image: D } = n != null ? n : {};
6323
+ const o = a(this, Ut).getContext("2d"), c = a(this, Ut).width, d = 0, l = 0, h = r - d * 2, g = i - d * 2, f = Math.floor(c / h), v = Math.floor(e / f), _ = e % f * (h + d) + d, w = v * (g + d) + d, { displayText: R, image: D } = n != null ? n : {};
6324
6324
  o.fillStyle = R || D ? a(this, es).videoBackground : a(this, es).background, o.strokeStyle = a(this, es).brand, o.beginPath(), o.moveTo(_ + l, w), o.arcTo(_ + h, w, _ + h, w + l, l), o.arcTo(
6325
6325
  _ + h,
6326
6326
  w + g,
@@ -6339,23 +6339,23 @@ const xh = class extends Ot {
6339
6339
  }
6340
6340
  /** @access private */
6341
6341
  drawIcons(e, r, i, n) {
6342
- const o = Math.min(Math.max(n * 0.15, 100), 200), d = o * 0.2, c = o * 0.2;
6343
- let l = r + d;
6344
- const h = i + d, g = (f) => {
6342
+ const o = Math.min(Math.max(n * 0.15, 100), 200), c = o * 0.2, d = o * 0.2;
6343
+ let l = r + c;
6344
+ const h = i + c, g = (f) => {
6345
6345
  const v = a(this, Ut).getContext("2d");
6346
- v.save(), v.fillStyle = a(this, es).background, v.beginPath(), v.moveTo(l + c, h), v.arcTo(l + o, h, l + o, h + c, c), v.arcTo(
6346
+ v.save(), v.fillStyle = a(this, es).background, v.beginPath(), v.moveTo(l + d, h), v.arcTo(l + o, h, l + o, h + d, d), v.arcTo(
6347
6347
  l + o,
6348
6348
  h + o,
6349
- l + o - c,
6349
+ l + o - d,
6350
6350
  h + o,
6351
- c
6352
- ), v.arcTo(l, h + o, l, h + o - c, c), v.arcTo(l, h, l + c, h, c), v.closePath(), v.fill(), typeof f == "string" ? (v.font = `${o / 1.5}px sans-serif`, v.fillStyle = a(this, es).text, v.textAlign = "center", v.textBaseline = "top", v.fillText(f, o / 2 + l, h + d)) : v.drawImage(
6351
+ d
6352
+ ), v.arcTo(l, h + o, l, h + o - d, d), v.arcTo(l, h, l + d, h, d), v.closePath(), v.fill(), typeof f == "string" ? (v.font = `${o / 1.5}px sans-serif`, v.fillStyle = a(this, es).text, v.textAlign = "center", v.textBaseline = "top", v.fillText(f, o / 2 + l, h + c)) : v.drawImage(
6353
6353
  f,
6354
- l + d,
6355
- h + d,
6356
- o - d * 2,
6357
- o - d * 2
6358
- ), l += o + d, v.restore();
6354
+ l + c,
6355
+ h + c,
6356
+ o - c * 2,
6357
+ o - c * 2
6358
+ ), l += o + c, v.restore();
6359
6359
  };
6360
6360
  e.pinned && g(a(this, Sn)), e.handRaised && g(a(this, vn)), e.reaction && g(e.reaction);
6361
6361
  }
@@ -6365,25 +6365,25 @@ const xh = class extends Ot {
6365
6365
  if (a(this, Ut) === void 0)
6366
6366
  return;
6367
6367
  const n = a(this, Ut).getContext("2d"), o = this.getSources();
6368
- let d = 0, c = 0;
6369
- for (; d < a(this, we).height - 5; ) {
6368
+ let c = 0, d = 0;
6369
+ for (; c < a(this, we).height - 5; ) {
6370
6370
  let g = 0;
6371
- for (; g < a(this, we).width - 5 && c < i; ) {
6372
- if ((l = o[c]) != null && l.enabled) {
6373
- const f = o[c].element, [v, E, _, w, R, D, U, B] = ZC(
6371
+ for (; g < a(this, we).width - 5 && d < i; ) {
6372
+ if ((l = o[d]) != null && l.enabled) {
6373
+ const f = o[d].element, [v, E, _, w, R, D, U, B] = ZC(
6374
6374
  g,
6375
- d,
6375
+ c,
6376
6376
  e,
6377
6377
  r,
6378
6378
  f.videoWidth,
6379
6379
  f.videoHeight
6380
6380
  );
6381
- ((h = f == null ? void 0 : f.classList) == null ? void 0 : h.contains("mirror")) ? (n.save(), n.scale(-1, 1), n.drawImage(f, v, E, _, w, -1 * R, D, -1 * U, B), n.restore()) : n.drawImage(f, v, E, _, w, R, D, U, B), this.drawIcons(o[c], R, D, Math.max(U, B));
6381
+ ((h = f == null ? void 0 : f.classList) == null ? void 0 : h.contains("mirror")) ? (n.save(), n.scale(-1, 1), n.drawImage(f, v, E, _, w, -1 * R, D, -1 * U, B), n.restore()) : n.drawImage(f, v, E, _, w, R, D, U, B), this.drawIcons(o[d], R, D, Math.max(U, B));
6382
6382
  } else
6383
- this.drawEmptyTile(c, e, r, o[c]);
6384
- c += 1, g += e;
6383
+ this.drawEmptyTile(d, e, r, o[d]);
6384
+ d += 1, g += e;
6385
6385
  }
6386
- d += r;
6386
+ c += r;
6387
6387
  }
6388
6388
  }
6389
6389
  /** @access private */
@@ -6495,11 +6495,11 @@ const xh = class extends Ot {
6495
6495
  * @param {boolean} enabled if source is enabled
6496
6496
  * @param {?string} [displayText] two character display text
6497
6497
  */
6498
- addSource(e, r, i, n = !1, o = void 0, d = void 0, c = !1) {
6498
+ addSource(e, r, i, n = !1, o = void 0, c = void 0, d = !1) {
6499
6499
  this.logger.debug("Pip::AddSource", {
6500
6500
  pip: {
6501
6501
  id: e,
6502
- handRaised: c
6502
+ handRaised: d
6503
6503
  }
6504
6504
  }), a(this, it)[e] = {
6505
6505
  id: e,
@@ -6507,9 +6507,9 @@ const xh = class extends Ot {
6507
6507
  enabled: i,
6508
6508
  pinned: n,
6509
6509
  displayText: o ? XC(o) : void 0,
6510
- imageUrl: d,
6511
- handRaised: c
6512
- }, d && this.generateAvatar(e, d);
6510
+ imageUrl: c,
6511
+ handRaised: d
6512
+ }, c && this.generateAvatar(e, c);
6513
6513
  }
6514
6514
  /**
6515
6515
  * Update a video source
@@ -11814,21 +11814,21 @@ class or {
11814
11814
  }
11815
11815
  searchMessages(t, e) {
11816
11816
  return u(this, null, function* () {
11817
- var i, n, o, d;
11817
+ var i, n, o, c;
11818
11818
  const r = {
11819
11819
  searchTerm: t,
11820
11820
  timeStamp: (i = e.timestamp) != null ? i : Date.now(),
11821
11821
  size: (n = e.limit) != null ? n : 75,
11822
11822
  from: (o = e.offset) != null ? o : 0,
11823
- reversed: (d = e.reversed) != null ? d : !0
11823
+ reversed: (c = e.reversed) != null ? c : !0
11824
11824
  };
11825
11825
  try {
11826
- const c = yield a(this, _t).sendMessagePromise(
11826
+ const d = yield a(this, _t).sendMessagePromise(
11827
11827
  je.searchChannelMessages,
11828
11828
  OA.toBinary(r)
11829
11829
  );
11830
- return cf.fromBinary(c.payload).messages;
11831
- } catch (c) {
11830
+ return cf.fromBinary(d.payload).messages;
11831
+ } catch (d) {
11832
11832
  return [];
11833
11833
  }
11834
11834
  });
@@ -11887,9 +11887,9 @@ class or {
11887
11887
  let o = i;
11888
11888
  try {
11889
11889
  o = r(n);
11890
- } catch (d) {
11890
+ } catch (c) {
11891
11891
  this.logger.error("chatSocketHandler::on::binary_decode_error", {
11892
- error: d
11892
+ error: c
11893
11893
  });
11894
11894
  }
11895
11895
  return e(o);
@@ -11961,16 +11961,15 @@ function hf(s) {
11961
11961
  }
11962
11962
  class vu extends Error {
11963
11963
  constructor(e) {
11964
- var t = (...args) => {
11965
- super(...args);
11966
- /** HTTP status code. Present only for HTTP error responses (4xx/5xx). */
11967
- p(this, "status");
11968
- /** Full response from the server. Present only for HTTP error responses. */
11969
- p(this, "response");
11970
- /** Whether the request timed out (AbortController fired before a response arrived). */
11971
- p(this, "isTimeout");
11972
- };
11973
- e instanceof Error ? (t(e.message), this.stack = e.stack, this.isTimeout = e.name === "AbortError") : (t(`Request failed with status ${e.status}`), this.status = e.status, this.response = e, this.isTimeout = !1), this.name = "RequestError";
11964
+ const r = e instanceof Error ? e.message : `Request failed with status ${e.status}`;
11965
+ super(r);
11966
+ /** HTTP status code. Present only for HTTP error responses (4xx/5xx). */
11967
+ p(this, "status");
11968
+ /** Full response from the server. Present only for HTTP error responses. */
11969
+ p(this, "response");
11970
+ /** Whether the request timed out (AbortController fired before a response arrived). */
11971
+ p(this, "isTimeout");
11972
+ e instanceof Error ? (this.stack = e.stack, this.isTimeout = e.name === "AbortError") : (this.status = e.status, this.response = e, this.isTimeout = !1), this.name = "RequestError";
11974
11973
  }
11975
11974
  /** Whether this is an HTTP error response (server responded with 4xx/5xx). */
11976
11975
  get isHttpError() {
@@ -11996,8 +11995,8 @@ class Yp {
11996
11995
  const { baseURL: r } = this.defaults, i = t.startsWith("http") ? t : `${r}${t.startsWith("/") ? t : `/${t}`}`;
11997
11996
  if (e) {
11998
11997
  const n = new URLSearchParams();
11999
- return Object.entries(e).forEach(([o, d]) => {
12000
- n.append(o, d);
11998
+ return Object.entries(e).forEach(([o, c]) => {
11999
+ n.append(o, c);
12001
12000
  }), `${i}${i.includes("?") ? "&" : "?"}${n.toString()}`;
12002
12001
  }
12003
12002
  return i;
@@ -12007,15 +12006,15 @@ class Yp {
12007
12006
  var g;
12008
12007
  const e = ((g = t.method) == null ? void 0 : g.toUpperCase()) || "GET", r = this.buildURL(t.url || "", t.params), i = N(N({}, this.defaults.headers.common), t.headers);
12009
12008
  e !== "GET" && e !== "HEAD" && t.data && !i["Content-Type"] && (i["Content-Type"] = "application/json");
12010
- const o = i["Content-Type"] === "application/json" ? JSON.stringify(t.data) : t.data, d = {
12009
+ const o = i["Content-Type"] === "application/json" ? JSON.stringify(t.data) : t.data, c = {
12011
12010
  method: e,
12012
12011
  headers: i,
12013
12012
  body: e !== "GET" && e !== "HEAD" && t.data ? o : void 0
12014
- }, c = t.timeout || this.defaults.timeout, l = t.retry !== void 0 ? t.retry : this.defaults.retry, h = t.retryDelay || this.defaults.retryDelay;
12013
+ }, d = t.timeout || this.defaults.timeout, l = t.retry !== void 0 ? t.retry : this.defaults.retry, h = t.retryDelay || this.defaults.retryDelay;
12015
12014
  try {
12016
- const f = new AbortController(), v = setTimeout(() => f.abort(), c);
12017
- d.signal = f.signal;
12018
- const E = yield fetch(r, d);
12015
+ const f = new AbortController(), v = setTimeout(() => f.abort(), d);
12016
+ c.signal = f.signal;
12017
+ const E = yield fetch(r, c);
12019
12018
  clearTimeout(v);
12020
12019
  let _ = null;
12021
12020
  const w = E.headers.get("content-type");
@@ -12089,10 +12088,10 @@ class c0 {
12089
12088
  retry: i = n0,
12090
12089
  retryDelay: n = a0,
12091
12090
  baseURL: o = ii.apiBase.prod,
12092
- authToken: d,
12093
- cachedUserDetails: c
12091
+ authToken: c,
12092
+ cachedUserDetails: d
12094
12093
  } = e || {};
12095
- this.iceServers = c == null ? void 0 : c.iceServers, this.userDetails = c == null ? void 0 : c.userDetails, this.roomDetails = c == null ? void 0 : c.roomDetails, this.requests = new Yp({
12094
+ this.iceServers = d == null ? void 0 : d.iceServers, this.userDetails = d == null ? void 0 : d.userDetails, this.roomDetails = d == null ? void 0 : d.roomDetails, this.requests = new Yp({
12096
12095
  baseURL: o,
12097
12096
  timeout: r,
12098
12097
  retry: i,
@@ -12105,7 +12104,7 @@ class c0 {
12105
12104
  retry: i,
12106
12105
  retryDelay: n,
12107
12106
  responseType: "json"
12108
- }), this.setAuthToken(d, { bearer: !0 });
12107
+ }), this.setAuthToken(c, { bearer: !0 });
12109
12108
  const l = this.requests.request.bind(this.requests);
12110
12109
  this.requests.request = (h) => u(this, null, function* () {
12111
12110
  var f, v, E, _, w;
@@ -12364,12 +12363,12 @@ const ya = {
12364
12363
  function Nt(s, t) {
12365
12364
  return function(e, r, i) {
12366
12365
  const n = i.value;
12367
- let o = 0, d = Date.now();
12368
- return i.value = function(...c) {
12366
+ let o = 0, c = Date.now();
12367
+ return i.value = function(...d) {
12369
12368
  const l = Date.now(), h = t ? this[t] : s;
12370
- if (l - d > h.period * 1e3 && (d = l, o = 0), o >= h.maxInvocations)
12369
+ if (l - c > h.period * 1e3 && (c = l, o = 0), o >= h.maxInvocations)
12371
12370
  throw new k(`Method rate limit ${h.maxInvocations} invocations/${h.period}sec exceeded`, "0013");
12372
- return o += 1, n.apply(this, c);
12371
+ return o += 1, n.apply(this, d);
12373
12372
  }, i;
12374
12373
  };
12375
12374
  }
@@ -12454,13 +12453,13 @@ let zt = (pg = class extends Ot {
12454
12453
  /** @access private */
12455
12454
  sendTextMessageInternal(t, e) {
12456
12455
  return u(this, null, function* () {
12457
- var i, n, o, d, c, l;
12456
+ var i, n, o, c, d, l;
12458
12457
  if (t.length > this.maxTextLimit)
12459
12458
  throw new k("Max character limit breached", "0503");
12460
12459
  if (e && e.length > 0) {
12461
12460
  if (!((i = a(this, te).permissions) != null && i.chatPrivate.canSend) || !((n = a(this, te).permissions) != null && n.chatPrivate.text))
12462
12461
  throw this.logger.error("sendTextMessage::private_chat_permission_denied"), new k("Could not send message to private chat.", "0501");
12463
- } else if (!((d = (o = a(this, te).permissions) == null ? void 0 : o.chatPublic) != null && d.canSend) || !((l = (c = a(this, te).permissions) == null ? void 0 : c.chatPublic) != null && l.text))
12462
+ } else if (!((c = (o = a(this, te).permissions) == null ? void 0 : o.chatPublic) != null && c.canSend) || !((l = (d = a(this, te).permissions) == null ? void 0 : d.chatPublic) != null && l.text))
12464
12463
  throw this.logger.error("sendTextMessage::public_chat_permission_denied"), new k("Could not send message to public chat.", "0501");
12465
12464
  if (!t)
12466
12465
  throw this.logger.error("sendTextMessage::message_can_not_be_empty"), new k("Message can not be empty.", "0502");
@@ -12479,13 +12478,13 @@ let zt = (pg = class extends Ot {
12479
12478
  /** @access private */
12480
12479
  sendImageMessageInternal(t, e) {
12481
12480
  return u(this, null, function* () {
12482
- var i, n, o, d, c, l;
12481
+ var i, n, o, c, d, l;
12483
12482
  if (e && e.length > 0) {
12484
12483
  if (!((i = a(this, te).permissions) != null && i.chatPrivate.canSend) || !((n = a(this, te).permissions) != null && n.chatPrivate.files)) {
12485
12484
  this.logger.error("sendImageMessage::private_chat_permission_denied");
12486
12485
  return;
12487
12486
  }
12488
- } else if (!((d = (o = a(this, te).permissions) == null ? void 0 : o.chatPublic) != null && d.canSend) || !((l = (c = a(this, te).permissions) == null ? void 0 : c.chatPublic) != null && l.files)) {
12487
+ } else if (!((c = (o = a(this, te).permissions) == null ? void 0 : o.chatPublic) != null && c.canSend) || !((l = (d = a(this, te).permissions) == null ? void 0 : d.chatPublic) != null && l.files)) {
12489
12488
  this.logger.error("sendImageMessage::permission_denied");
12490
12489
  return;
12491
12490
  }
@@ -12518,13 +12517,13 @@ let zt = (pg = class extends Ot {
12518
12517
  /** @access private */
12519
12518
  sendFileMessageInternal(t, e) {
12520
12519
  return u(this, null, function* () {
12521
- var r, i, n, o, d, c;
12520
+ var r, i, n, o, c, d;
12522
12521
  if (e && e.length > 0) {
12523
12522
  if (!((r = a(this, te).permissions) != null && r.chatPrivate.canSend) || !((i = a(this, te).permissions) != null && i.chatPrivate.files)) {
12524
12523
  this.logger.error("sendFileMessage::private_chat_permission_denied");
12525
12524
  return;
12526
12525
  }
12527
- } else if (!((o = (n = a(this, te).permissions) == null ? void 0 : n.chatPublic) != null && o.canSend) || !((c = (d = a(this, te).permissions) == null ? void 0 : d.chatPublic) != null && c.files)) {
12526
+ } else if (!((o = (n = a(this, te).permissions) == null ? void 0 : n.chatPublic) != null && o.canSend) || !((d = (c = a(this, te).permissions) == null ? void 0 : c.chatPublic) != null && d.files)) {
12528
12527
  this.logger.error("sendFileMessage::permission_denied");
12529
12528
  return;
12530
12529
  }
@@ -12575,13 +12574,13 @@ let zt = (pg = class extends Ot {
12575
12574
  */
12576
12575
  sendCustomMessage(t, e) {
12577
12576
  return u(this, null, function* () {
12578
- var n, o, d, c, l, h, g, f, v, E, _, w, R, D, U;
12577
+ var n, o, c, d, l, h, g, f, v, E, _, w, R, D, U;
12579
12578
  if (e && e.length > 0) {
12580
- if (!((n = a(this, te).permissions) != null && n.chatPrivate.canSend) || !((o = a(this, te).permissions) != null && o.chatPrivate.files) || !((d = a(this, te).permissions) != null && d.chatPrivate.text)) {
12579
+ if (!((n = a(this, te).permissions) != null && n.chatPrivate.canSend) || !((o = a(this, te).permissions) != null && o.chatPrivate.files) || !((c = a(this, te).permissions) != null && c.chatPrivate.text)) {
12581
12580
  this.logger.error("sendCustomMessage::private_chat_permission_denied");
12582
12581
  return;
12583
12582
  }
12584
- } else if (!((l = (c = a(this, te).permissions) == null ? void 0 : c.chatPublic) != null && l.canSend) || !((g = (h = a(this, te).permissions) == null ? void 0 : h.chatPublic) != null && g.files) || !((v = (f = a(this, te).permissions) == null ? void 0 : f.chatPublic) != null && v.text)) {
12583
+ } else if (!((l = (d = a(this, te).permissions) == null ? void 0 : d.chatPublic) != null && l.canSend) || !((g = (h = a(this, te).permissions) == null ? void 0 : h.chatPublic) != null && g.files) || !((v = (f = a(this, te).permissions) == null ? void 0 : f.chatPublic) != null && v.text)) {
12585
12584
  this.logger.error("sendCustomMessage::permission_denied");
12586
12585
  return;
12587
12586
  }
@@ -12652,8 +12651,8 @@ let zt = (pg = class extends Ot {
12652
12651
  }
12653
12652
  editImageMessage(t, e) {
12654
12653
  return u(this, null, function* () {
12655
- var i, n, o, d;
12656
- if (!((n = (i = a(this, te).permissions) == null ? void 0 : i.chatPublic) != null && n.canSend) || !((d = (o = a(this, te).permissions) == null ? void 0 : o.chatPublic) != null && d.files)) {
12654
+ var i, n, o, c;
12655
+ if (!((n = (i = a(this, te).permissions) == null ? void 0 : i.chatPublic) != null && n.canSend) || !((c = (o = a(this, te).permissions) == null ? void 0 : o.chatPublic) != null && c.files)) {
12657
12656
  this.logger.error("editImageMessage::permission_denied");
12658
12657
  return;
12659
12658
  }
@@ -12668,13 +12667,13 @@ let zt = (pg = class extends Ot {
12668
12667
  return;
12669
12668
  }
12670
12669
  try {
12671
- const c = St(), { getLocation: l, putLocation: h } = yield c.getPresignedUrls(e.name);
12672
- yield c.uploadFile(e, h), a(this, Je).editMessage(
12670
+ const d = St(), { getLocation: l, putLocation: h } = yield d.getPresignedUrls(e.name);
12671
+ yield d.uploadFile(e, h), a(this, Je).editMessage(
12673
12672
  t,
12674
12673
  l,
12675
12674
  Jt.IMAGE
12676
12675
  );
12677
- } catch (c) {
12676
+ } catch (d) {
12678
12677
  throw new k("Error editing image message.", "0500", this.logger);
12679
12678
  }
12680
12679
  });
@@ -12691,17 +12690,17 @@ let zt = (pg = class extends Ot {
12691
12690
  return;
12692
12691
  }
12693
12692
  try {
12694
- const d = St(), { getLocation: c, putLocation: l } = yield d.getPresignedUrls(e.name);
12695
- yield d.uploadFile(e, l), a(this, Je).editMessage(
12693
+ const c = St(), { getLocation: d, putLocation: l } = yield c.getPresignedUrls(e.name);
12694
+ yield c.uploadFile(e, l), a(this, Je).editMessage(
12696
12695
  t,
12697
12696
  JSON.stringify({
12698
- link: c,
12697
+ link: d,
12699
12698
  name: e.name,
12700
12699
  size: "size" in e ? e.size : 0
12701
12700
  }),
12702
12701
  Jt.FILE
12703
12702
  );
12704
- } catch (d) {
12703
+ } catch (c) {
12705
12704
  throw new k("Error editing file message.", "0500", this.logger);
12706
12705
  }
12707
12706
  });
@@ -12777,7 +12776,7 @@ let zt = (pg = class extends Ot {
12777
12776
  direction: r = "after"
12778
12777
  }) {
12779
12778
  return (yield a(this, Je).getChatMessagesPaginated(t, e, r === "before")).messages.map(
12780
- (d) => to.formatSocketPeerMessage(d)
12779
+ (c) => to.formatSocketPeerMessage(c)
12781
12780
  );
12782
12781
  });
12783
12782
  }
@@ -12798,7 +12797,7 @@ let zt = (pg = class extends Ot {
12798
12797
  oneofKind: "userId",
12799
12798
  userId: i
12800
12799
  })).messages.map(
12801
- (c) => to.formatSocketPeerMessage(c)
12800
+ (d) => to.formatSocketPeerMessage(d)
12802
12801
  );
12803
12802
  });
12804
12803
  }
@@ -12817,7 +12816,7 @@ let zt = (pg = class extends Ot {
12817
12816
  oneofKind: "pinned",
12818
12817
  pinned: !0
12819
12818
  })).messages.map(
12820
- (d) => to.formatSocketPeerMessage(d)
12819
+ (c) => to.formatSocketPeerMessage(c)
12821
12820
  );
12822
12821
  });
12823
12822
  }
@@ -12953,9 +12952,9 @@ const pr = (gg = class {
12953
12952
  images: i,
12954
12953
  message: n,
12955
12954
  videos: o,
12956
- files: d
12955
+ files: c
12957
12956
  } = JSON.parse(s.payload);
12958
- e.message = n, e.html = r, e.images = i, e.videos = o, e.files = d;
12957
+ e.message = n, e.html = r, e.images = i, e.videos = o, e.files = c;
12959
12958
  break;
12960
12959
  }
12961
12960
  }
@@ -13350,10 +13349,10 @@ Pu = R0([
13350
13349
  function b0(s) {
13351
13350
  let t = "", e = [""];
13352
13351
  const r = [e];
13353
- let i = 0, n = 0, o = !0, d;
13354
- for (d of s)
13355
- d === '"' ? (o && d === t && (e[i] += d), o = !o) : d === "," && o ? d = e[++i] = "" : d === `
13356
- ` && o ? (t === "\r" && (e[i] = e[i].slice(0, -1)), e = r[++n] = [d = ""], i = 0) : e[i] += d, t = d;
13352
+ let i = 0, n = 0, o = !0, c;
13353
+ for (c of s)
13354
+ c === '"' ? (o && c === t && (e[i] += c), o = !o) : c === "," && o ? c = e[++i] = "" : c === `
13355
+ ` && o ? (t === "\r" && (e[i] = e[i].slice(0, -1)), e = r[++n] = [c = ""], i = 0) : e[i] += c, t = c;
13357
13356
  return r;
13358
13357
  }
13359
13358
  var k0 = Object.defineProperty, A0 = Object.getOwnPropertyDescriptor, vf = (s, t, e, r) => {
@@ -13400,16 +13399,16 @@ let qr = (vg = class extends Ot {
13400
13399
  i,
13401
13400
  n,
13402
13401
  o,
13403
- d,
13404
- c
13402
+ c,
13403
+ d
13405
13404
  ]] = b0(t);
13406
13405
  return {
13407
13406
  id: ga(),
13408
- name: d,
13407
+ name: c,
13409
13408
  peerId: i,
13410
13409
  userId: n,
13411
13410
  customParticipantId: o,
13412
- transcript: c,
13411
+ transcript: d,
13413
13412
  isPartialTranscript: e,
13414
13413
  date: new Date(parseInt(r, 10) * 1e3)
13415
13414
  };
@@ -13608,16 +13607,16 @@ const Tf = (Tg = class {
13608
13607
  let i;
13609
13608
  try {
13610
13609
  i = qr.parseTranscript(e, r);
13611
- } catch (c) {
13612
- this.logger.error(`Failed to parse transcript: ${e}`, c);
13610
+ } catch (d) {
13611
+ this.logger.error(`Failed to parse transcript: ${e}`, d);
13613
13612
  }
13614
13613
  if (!i) {
13615
13614
  this.logger.warn("Received empty transcript data");
13616
13615
  return;
13617
13616
  }
13618
13617
  this.ai.onTranscript(i);
13619
- const { peerId: n, name: o, transcript: d } = i;
13620
- this.logger.debug(`${t} Received transcript for peer ${n} - ${o}: ${d}`);
13618
+ const { peerId: n, name: o, transcript: c } = i;
13619
+ this.logger.debug(`${t} Received transcript for peer ${n} - ${o}: ${c}`);
13621
13620
  });
13622
13621
  }
13623
13622
  }, yr = new WeakMap(), Rn = new WeakMap(), Ct = new WeakMap(), Tg);
@@ -13652,9 +13651,9 @@ const Fa = {}, dr = {
13652
13651
  }) {
13653
13652
  return (r, i, n) => {
13654
13653
  const o = n.value;
13655
- return n.value = function(...c) {
13654
+ return n.value = function(...d) {
13656
13655
  var E, _;
13657
- const l = (_ = (this == null ? void 0 : this.peerId) || ((E = c[0]) == null ? void 0 : E.authToken)) != null ? _ : "", h = `${t}-${l}`, g = this == null ? void 0 : this.logger;
13656
+ const l = (_ = (this == null ? void 0 : this.peerId) || ((E = d[0]) == null ? void 0 : E.authToken)) != null ? _ : "", h = `${t}-${l}`, g = this == null ? void 0 : this.logger;
13658
13657
  if (Fa[h]) {
13659
13658
  const w = new Error(
13660
13659
  `Unsupported concurrent calls on method: ${s}.`
@@ -13673,7 +13672,7 @@ const Fa = {}, dr = {
13673
13672
  const f = setTimeout(
13674
13673
  () => delete Fa[h],
13675
13674
  e
13676
- ), v = o.apply(this, c);
13675
+ ), v = o.apply(this, d);
13677
13676
  return Promise.resolve(v).then(() => {
13678
13677
  delete Fa[h], clearTimeout(f);
13679
13678
  }).catch(() => {
@@ -13690,8 +13689,8 @@ var O0 = Object.defineProperty, N0 = Object.getOwnPropertyDescriptor, Qi = (s, t
13690
13689
  }, Bt, Cd, ie, _o, ms, Ue, Co, Cu, bn, Qc;
13691
13690
  class Kr extends Ot {
13692
13691
  constructor(e, r, i, n, o) {
13693
- const d = e.getValue("logger");
13694
- super(d);
13692
+ const c = e.getValue("logger");
13693
+ super(c);
13695
13694
  // eslint-disable-next-line class-methods-use-this
13696
13695
  m(this, Co);
13697
13696
  /**
@@ -13730,8 +13729,8 @@ class Kr extends Ot {
13730
13729
  * who has requested leaves/joins the meeting
13731
13730
  */
13732
13731
  [b.UPDATE_STAGE_REQUESTS]: (o) => u(this, [o], function* ({ add: n }) {
13733
- const d = a(this, ms).length, { stageRequests: c } = this.getAccessRequests();
13734
- (n || c.length > d) && this.emit("newStageRequest", { count: c.length }), this.emit("stageAccessRequestUpdate", c);
13732
+ const c = a(this, ms).length, { stageRequests: d } = this.getAccessRequests();
13733
+ (n || d.length > c) && this.emit("newStageRequest", { count: d.length }), this.emit("stageAccessRequestUpdate", d);
13735
13734
  })
13736
13735
  }, r = () => {
13737
13736
  Object.entries(e).forEach(([n, o]) => {
@@ -14228,8 +14227,8 @@ class Pf extends Map {
14228
14227
  return this.set(e.id, e, r);
14229
14228
  }
14230
14229
  set(e, r, i = !0) {
14231
- const n = super.set(e, r), o = (d, ...c) => {
14232
- this.emit(d, r, ...c);
14230
+ const n = super.set(e, r), o = (c, ...d) => {
14231
+ this.emit(c, r, ...d);
14233
14232
  };
14234
14233
  return a(this, hi).set(e, o), r.on("*", o), i && a(this, De).emit(this.onAddEvent, r), n;
14235
14234
  }
@@ -14324,23 +14323,23 @@ const _f = (Eg = class {
14324
14323
  return u(this, null, function* () {
14325
14324
  var l, h;
14326
14325
  const i = s.getValue("logger"), n = s.getValue("connectionHandler"), o = new wu(i);
14327
- let d;
14328
- n.socketState.state === "connected" ? (i.info("Creating active plugins store immediately. Socket is already connected."), d = yield r.create(du, !0)) : i.info("Deferring active plugins store creation until socket connects."), t.forEach((g) => {
14326
+ let c;
14327
+ n.socketState.state === "connected" ? (i.info("Creating active plugins store immediately. Socket is already connected."), c = yield r.create(du, !0)) : i.info("Deferring active plugins store creation until socket connects."), t.forEach((g) => {
14329
14328
  const f = new go(
14330
14329
  s,
14331
14330
  g,
14332
- d,
14331
+ c,
14333
14332
  e
14334
14333
  );
14335
14334
  o.all.add(f);
14336
14335
  });
14337
- const c = new _f(
14336
+ const d = new _f(
14338
14337
  s,
14339
14338
  o,
14340
14339
  r,
14341
- d
14340
+ c
14342
14341
  );
14343
- return d ? V(l = c, Io, ku).call(l) : V(h = c, wd, Cf).call(h), c;
14342
+ return c ? V(l = d, Io, ku).call(l) : V(h = d, wd, Cf).call(h), d;
14344
14343
  });
14345
14344
  }
14346
14345
  cleanup() {
@@ -14590,9 +14589,9 @@ let Ji = (Pg = class extends Ot {
14590
14589
  t === "stop" && (n.state = "STOPPING", this.emit("recordingUpdate", "STOPPING"));
14591
14590
  try {
14592
14591
  yield St().updateRecording(n.id, t);
14593
- } catch (d) {
14592
+ } catch (c) {
14594
14593
  throw this.logger.error("Recording::stop::recording_failed_to_stop", {
14595
- error: d
14594
+ error: c
14596
14595
  }), n.state !== o && (n.state = o, this.emit("recordingUpdate", o)), new k("Error while stopping recording", "1000", this.logger);
14597
14596
  }
14598
14597
  }));
@@ -14820,21 +14819,21 @@ class Tt extends Ta {
14820
14819
  audio: e,
14821
14820
  video: r
14822
14821
  }) {
14823
- var d;
14822
+ var c;
14824
14823
  e ? a(this, Re).getValue("callstats").audioOn() : a(this, Re).getValue("callstats").audioOff(), r ? a(this, Re).getValue("callstats").videoOn() : a(this, Re).getValue("callstats").videoOff();
14825
14824
  let n, o;
14826
14825
  if (e && r)
14827
14826
  try {
14828
- const c = yield a(this, xe).getAudioAndVideoTrack(
14827
+ const d = yield a(this, xe).getAudioAndVideoTrack(
14829
14828
  a(this, me).userSelectedDevice,
14830
14829
  a(this, he).userSelectedDevice
14831
14830
  );
14832
- n = c.audioTrack, o = c.videoTrack;
14833
- } catch (c) {
14831
+ n = d.audioTrack, o = d.videoTrack;
14832
+ } catch (d) {
14834
14833
  this.logger.error(
14835
14834
  "LocalMediaHandler::init::Failed to get audio video tracks",
14836
14835
  {
14837
- error: c
14836
+ error: d
14838
14837
  }
14839
14838
  );
14840
14839
  }
@@ -14844,9 +14843,9 @@ class Tt extends Ta {
14844
14843
  !1,
14845
14844
  a(this, me).userSelectedDevice
14846
14845
  );
14847
- } catch (c) {
14846
+ } catch (d) {
14848
14847
  this.logger.error("LocalMediaHandler::init::Failed to get audio track", {
14849
- error: c
14848
+ error: d
14850
14849
  });
14851
14850
  }
14852
14851
  if (!o && r)
@@ -14854,25 +14853,25 @@ class Tt extends Ta {
14854
14853
  o = yield a(this, xe).getVideoTrack(
14855
14854
  a(this, he).userSelectedDevice
14856
14855
  );
14857
- } catch (c) {
14856
+ } catch (d) {
14858
14857
  this.logger.error("LocalMediaHandler::init::Failed to get video track", {
14859
- error: c
14858
+ error: d
14860
14859
  });
14861
14860
  }
14862
14861
  e && !n && a(this, Re).getValue("callstats").audioOff(), r && !o && a(this, Re).getValue("callstats").videoOff(), yield a(this, me).setMediaTrack(n), yield a(this, he).setMediaTrack(o);
14863
14862
  try {
14864
14863
  yield this.setupSpeaker();
14865
- } catch (c) {
14864
+ } catch (d) {
14866
14865
  }
14867
14866
  if (o) {
14868
- const c = yield this.getDeviceById(o.getSettings().deviceId);
14869
- a(this, Re).getValue("callstats").selectedDevice("VIDEO", c);
14867
+ const d = yield this.getDeviceById(o.getSettings().deviceId);
14868
+ a(this, Re).getValue("callstats").selectedDevice("VIDEO", d);
14870
14869
  }
14871
14870
  if (n) {
14872
- const c = yield this.getDeviceById(n.getSettings().deviceId);
14873
- a(this, Re).getValue("callstats").selectedDevice("AUDIO", c);
14871
+ const d = yield this.getDeviceById(n.getSettings().deviceId);
14872
+ a(this, Re).getValue("callstats").selectedDevice("AUDIO", d);
14874
14873
  }
14875
- (d = a(this, xs).currentDevice) != null && d.deviceId && a(this, Re).getValue("callstats").selectedDevice("SPEAKER", a(this, xs).currentDevice), a(this, xe).onDeviceChange((c, l, h) => {
14874
+ (c = a(this, xs).currentDevice) != null && c.deviceId && a(this, Re).getValue("callstats").selectedDevice("SPEAKER", a(this, xs).currentDevice), a(this, xe).onDeviceChange((d, l, h) => {
14876
14875
  this.onDeviceChange(l, h);
14877
14876
  });
14878
14877
  });
@@ -15064,12 +15063,12 @@ class Tt extends Ta {
15064
15063
  if (this.emit("DEVICE_LIST_UPDATED", e), r || !a(this, Do))
15065
15064
  return;
15066
15065
  let i = !1;
15067
- (n = e == null ? void 0 : e.added) == null || n.reverse().forEach((d) => u(this, null, function* () {
15068
- var c;
15069
- d && !gd(d) && (d.kind === "audioinput" && ((c = this.audioTrack) == null ? void 0 : c.enabled) === !0 ? yield this.setAudioDevice(d, { saveDevicePreference: !1 }) : d.kind === "audiooutput" && (i = !0, yield this.setSpeakerDevice(d, { saveDevicePreference: !1 })));
15070
- })), i || (o = e == null ? void 0 : e.removed) == null || o.forEach((d) => u(this, null, function* () {
15071
- var c;
15072
- if (d.kind === "audiooutput" && ((c = this.getCurrentDevices().speaker) == null ? void 0 : c.deviceId) === d.deviceId) {
15066
+ (n = e == null ? void 0 : e.added) == null || n.reverse().forEach((c) => u(this, null, function* () {
15067
+ var d;
15068
+ c && !gd(c) && (c.kind === "audioinput" && ((d = this.audioTrack) == null ? void 0 : d.enabled) === !0 ? yield this.setAudioDevice(c, { saveDevicePreference: !1 }) : c.kind === "audiooutput" && (i = !0, yield this.setSpeakerDevice(c, { saveDevicePreference: !1 })));
15069
+ })), i || (o = e == null ? void 0 : e.removed) == null || o.forEach((c) => u(this, null, function* () {
15070
+ var d;
15071
+ if (c.kind === "audiooutput" && ((d = this.getCurrentDevices().speaker) == null ? void 0 : d.deviceId) === c.deviceId) {
15073
15072
  const l = yield this.getSpeakerDevices();
15074
15073
  (l == null ? void 0 : l.length) > 0 && (yield this.setSpeakerDevice(l[0], { saveDevicePreference: !1 }));
15075
15074
  }
@@ -15224,21 +15223,21 @@ function rM(s, t, e) {
15224
15223
  if (!(t != null && t.length))
15225
15224
  return e;
15226
15225
  const r = s.getValue("logger"), i = new AudioContext(), n = yield Promise.all(
15227
- t == null ? void 0 : t.map((c) => c(i))
15226
+ t == null ? void 0 : t.map((d) => d(i))
15228
15227
  ), o = i.createMediaStreamSource(
15229
15228
  new MediaStream([e])
15230
- ), d = i.createMediaStreamDestination();
15229
+ ), c = i.createMediaStreamDestination();
15231
15230
  try {
15232
- let c = o;
15231
+ let d = o;
15233
15232
  for (let l = 0; l < n.length; l += 1)
15234
- c.connect(n[l]), c = n[l];
15235
- c.connect(d);
15236
- } catch (c) {
15233
+ d.connect(n[l]), d = n[l];
15234
+ d.connect(c);
15235
+ } catch (d) {
15237
15236
  return r.error("getTransformedAudioTrack::middleware_execution_failed", {
15238
- error: c
15237
+ error: d
15239
15238
  }), e;
15240
15239
  }
15241
- return d.stream.getAudioTracks()[0];
15240
+ return c.stream.getAudioTracks()[0];
15242
15241
  });
15243
15242
  }
15244
15243
  var fi, Oo;
@@ -15279,21 +15278,21 @@ class iM {
15279
15278
  value: e.getSettings()
15280
15279
  }), v;
15281
15280
  }
15282
- const o = document.createElement("video"), d = new MediaStream();
15283
- d.addTrack(e);
15284
- const c = i.getContext("2d");
15285
- o.srcObject = d, o.autoplay = !0, this.terminateMiddlewareWebWorker();
15281
+ const o = document.createElement("video"), c = new MediaStream();
15282
+ c.addTrack(e);
15283
+ const d = i.getContext("2d");
15284
+ o.srcObject = c, o.autoplay = !0, this.terminateMiddlewareWebWorker();
15286
15285
  const l = () => u(this, null, function* () {
15287
15286
  if (e.enabled === !1 || e.readyState === "ended") {
15288
15287
  this.terminateMiddlewareWebWorker(), o.remove(), i.remove();
15289
15288
  return;
15290
15289
  }
15291
15290
  try {
15292
- c.drawImage(o, 0, 0);
15291
+ d.drawImage(o, 0, 0);
15293
15292
  for (let f = 0; f < n.length; f += 1)
15294
15293
  typeof n[f] == "function" && (yield n[f](
15295
15294
  i,
15296
- c
15295
+ d
15297
15296
  ));
15298
15297
  } catch (f) {
15299
15298
  this.logger.error(
@@ -15394,15 +15393,15 @@ const nM = {
15394
15393
  }
15395
15394
  ]]
15396
15395
  ], oM = (s, t) => {
15397
- var c, l, h;
15398
- const e = (c = s == null ? void 0 : s.getValue("overrides")) == null ? void 0 : c.simulcastConfig;
15396
+ var d, l, h;
15397
+ const e = (d = s == null ? void 0 : s.getValue("overrides")) == null ? void 0 : d.simulcastConfig;
15399
15398
  if ((l = e == null ? void 0 : e.encodings) != null && l.length)
15400
15399
  return e.encodings;
15401
15400
  const r = "getSettings" in t && t.getSettings().width || "getConstraints" in t && t.getConstraints().width || "originalSettings" in t && ((h = t.originalSettings) == null ? void 0 : h.width), i = aM, n = i.map(([g]) => g).sort((g, f) => g - f);
15402
- let o = Number.MAX_VALUE, d = 0;
15401
+ let o = Number.MAX_VALUE, c = 0;
15403
15402
  return n.forEach((g, f) => {
15404
- Math.abs(g - r) < o && (o = Math.abs(g - r), d = f);
15405
- }), i[d][1];
15403
+ Math.abs(g - r) < o && (o = Math.abs(g - r), c = f);
15404
+ }), i[c][1];
15406
15405
  };
15407
15406
  var Ce = /* @__PURE__ */ ((s) => (s.WEBCAM = "webcam", s.WEBCAM_BACKUP = "webcam_backup", s.MIC = "mic", s.SCREENSHARE_VIDEO = "screenshare_video", s.SCREENSHARE_AUDIO = "screenshare_audio", s))(Ce || {});
15408
15407
  const cM = zC(), en = _s(
@@ -15424,8 +15423,8 @@ class lM {
15424
15423
  // eslint-disable-next-line class-methods-use-this
15425
15424
  p(this, "getScreenShareConstraints", () => {
15426
15425
  var l, h, g, f, v, E, _, w, R;
15427
- const t = (l = a(this, Si)) == null ? void 0 : l.screenshare, e = (g = (h = t == null ? void 0 : t.width) == null ? void 0 : h.max) != null ? g : 1920, r = (v = (f = t == null ? void 0 : t.height) == null ? void 0 : f.max) != null ? v : 1080, i = (_ = (E = t == null ? void 0 : t.frameRate) == null ? void 0 : E.max) != null ? _ : 5, n = (R = (w = t == null ? void 0 : t.frameRate) == null ? void 0 : w.ideal) != null ? R : 5, o = t == null ? void 0 : t.displaySurface, d = t == null ? void 0 : t.selfBrowserSurface;
15428
- let c = {
15426
+ const t = (l = a(this, Si)) == null ? void 0 : l.screenshare, e = (g = (h = t == null ? void 0 : t.width) == null ? void 0 : h.max) != null ? g : 1920, r = (v = (f = t == null ? void 0 : t.height) == null ? void 0 : f.max) != null ? v : 1080, i = (_ = (E = t == null ? void 0 : t.frameRate) == null ? void 0 : E.max) != null ? _ : 5, n = (R = (w = t == null ? void 0 : t.frameRate) == null ? void 0 : w.ideal) != null ? R : 5, o = t == null ? void 0 : t.displaySurface, c = t == null ? void 0 : t.selfBrowserSurface;
15427
+ let d = {
15429
15428
  width: { max: e },
15430
15429
  height: { max: r },
15431
15430
  frameRate: {
@@ -15433,20 +15432,20 @@ class lM {
15433
15432
  max: i
15434
15433
  }
15435
15434
  };
15436
- return o !== void 0 && ["monitor", "browser", "window"].includes(o) && (c = j(N({}, c), { displaySurface: o })), d !== void 0 && (c = j(N({}, c), { selfBrowserSurface: d })), {
15435
+ return o !== void 0 && ["monitor", "browser", "window"].includes(o) && (d = j(N({}, d), { displaySurface: o })), c !== void 0 && (d = j(N({}, d), { selfBrowserSurface: c })), {
15437
15436
  audio: !0,
15438
- video: c
15437
+ video: d
15439
15438
  };
15440
15439
  });
15441
15440
  // eslint-disable-next-line class-methods-use-this
15442
15441
  p(this, "getAudioConstraints", (t) => {
15443
- var n, o, d, c, l, h, g;
15442
+ var n, o, c, d, l, h, g;
15444
15443
  const e = {}, r = (n = a(this, Si)) == null ? void 0 : n.audio, i = r != null && r.enableStereo ? 2 : 1;
15445
15444
  return Se.isFirefox() || Se.isWebKitBased() ? (e.audio = {
15446
15445
  deviceId: t,
15447
15446
  autoGainControl: (o = r == null ? void 0 : r.autoGainControl) != null ? o : !0,
15448
- echoCancellation: (d = r == null ? void 0 : r.echoCancellation) != null ? d : !0,
15449
- noiseSuppression: (c = r == null ? void 0 : r.noiseSupression) != null ? c : !0,
15447
+ echoCancellation: (c = r == null ? void 0 : r.echoCancellation) != null ? c : !0,
15448
+ noiseSuppression: (d = r == null ? void 0 : r.noiseSupression) != null ? d : !0,
15450
15449
  channelCount: i
15451
15450
  }, e) : (e.audio = {
15452
15451
  autoGainControl: (l = r == null ? void 0 : r.autoGainControl) != null ? l : !0,
@@ -15456,14 +15455,14 @@ class lM {
15456
15455
  }, t && (e.audio.deviceId = { exact: t }), e);
15457
15456
  });
15458
15457
  p(this, "getVideoConstraints", (t) => {
15459
- var o, d, c;
15458
+ var o, c, d;
15460
15459
  const e = {}, r = (o = a(this, Si)) == null ? void 0 : o.video, i = u_(nM);
15461
15460
  let n = i.vga;
15462
15461
  if (typeof r == "string") {
15463
15462
  const l = i[r];
15464
15463
  l && (n = l);
15465
15464
  } else
15466
- r !== void 0 && (n.height.ideal = r.height.ideal, n.width.ideal = r.width.ideal, n.frameRate.ideal = (c = (d = r.frameRate) == null ? void 0 : d.ideal) != null ? c : 30);
15465
+ r !== void 0 && (n.height.ideal = r.height.ideal, n.width.ideal = r.width.ideal, n.frameRate.ideal = (d = (c = r.frameRate) == null ? void 0 : c.ideal) != null ? d : 30);
15467
15466
  return e.video = n, typeof e.video == "boolean" || (t ? e.video.deviceId = { exact: t } : e.video.facingMode = "user"), e;
15468
15467
  });
15469
15468
  S(this, Rd, t), S(this, Si, e);
@@ -15558,16 +15557,16 @@ let Dt = (_g = class extends uM {
15558
15557
  return u(this, null, function* () {
15559
15558
  var r, i, n, o;
15560
15559
  try {
15561
- const d = yield this.getAudioInputDevices(), c = yield this.getVideoInputDevices(), l = !!(d != null && d.find(
15560
+ const c = yield this.getAudioInputDevices(), d = yield this.getVideoInputDevices(), l = !!(c != null && c.find(
15562
15561
  (R) => R.deviceId === t
15563
15562
  ));
15564
15563
  let h;
15565
- t && l ? h = t : d && ((r = d[0]) != null && r.deviceId) && (h = (i = d[0]) == null ? void 0 : i.deviceId);
15566
- const g = !!(c != null && c.find(
15564
+ t && l ? h = t : c && ((r = c[0]) != null && r.deviceId) && (h = (i = c[0]) == null ? void 0 : i.deviceId);
15565
+ const g = !!(d != null && d.find(
15567
15566
  (R) => R.deviceId === e
15568
15567
  ));
15569
15568
  let f;
15570
- e && g ? f = e : c && ((n = c[0]) != null && n.deviceId) && (f = (o = c[0]) == null ? void 0 : o.deviceId);
15569
+ e && g ? f = e : d && ((n = d[0]) != null && n.deviceId) && (f = (o = d[0]) == null ? void 0 : o.deviceId);
15571
15570
  const v = {
15572
15571
  audio: a(this, Ft).getAudioConstraints(h).audio,
15573
15572
  video: a(this, Ft).getVideoConstraints(f).video
@@ -15594,14 +15593,14 @@ let Dt = (_g = class extends uM {
15594
15593
  message: this.permissions.video,
15595
15594
  kind: "video"
15596
15595
  }), { audioTrack: _, videoTrack: w };
15597
- } catch (d) {
15598
- throw this.logger.error("WebMediaInterface.getAudioAndVideoTrack", { error: d }), new k("Couldnt fetch audio and video track", "1605");
15596
+ } catch (c) {
15597
+ throw this.logger.error("WebMediaInterface.getAudioAndVideoTrack", { error: c }), new k("Couldnt fetch audio and video track", "1605");
15599
15598
  }
15600
15599
  });
15601
15600
  }
15602
15601
  getAudioTrack(t, e) {
15603
15602
  return u(this, null, function* () {
15604
- var d, c;
15603
+ var c, d;
15605
15604
  let r = yield this.getAudioInputDevices();
15606
15605
  if (!(r != null && r.length))
15607
15606
  throw this.permissions.audio = "NO_DEVICES_AVAILABLE", a(this, $e).getValue("peerSessionStore").emit(b.MEDIA_PERMISSION_UPDATE, {
@@ -15612,7 +15611,7 @@ let Dt = (_g = class extends uM {
15612
15611
  (l) => l.deviceId === e
15613
15612
  ));
15614
15613
  let n;
15615
- e && i ? n = e : (d = r[0]) != null && d.deviceId && (n = (c = r[0]) == null ? void 0 : c.deviceId);
15614
+ e && i ? n = e : (c = r[0]) != null && c.deviceId && (n = (d = r[0]) == null ? void 0 : d.deviceId);
15616
15615
  const o = (l) => u(this, null, function* () {
15617
15616
  let h;
15618
15617
  try {
@@ -15660,8 +15659,8 @@ let Dt = (_g = class extends uM {
15660
15659
  }
15661
15660
  getVideoTrack(t) {
15662
15661
  return u(this, null, function* () {
15663
- var d, c, l;
15664
- const e = (d = yield this.getCurrentDeviceLabel(t)) == null ? void 0 : d.includes("OBS Virtual"), r = yield this.getVideoInputDevices();
15662
+ var c, d, l;
15663
+ const e = (c = yield this.getCurrentDeviceLabel(t)) == null ? void 0 : c.includes("OBS Virtual"), r = yield this.getVideoInputDevices();
15665
15664
  if (!(r != null && r.length))
15666
15665
  throw this.permissions.video = "NO_DEVICES_AVAILABLE", a(this, $e).getValue("peerSessionStore").emit(b.MEDIA_PERMISSION_UPDATE, {
15667
15666
  message: this.permissions.video,
@@ -15671,7 +15670,7 @@ let Dt = (_g = class extends uM {
15671
15670
  (h) => h.deviceId === t
15672
15671
  ));
15673
15672
  let n;
15674
- t && i ? n = t : (c = r[0]) != null && c.deviceId && (n = (l = r[0]) == null ? void 0 : l.deviceId);
15673
+ t && i ? n = t : (d = r[0]) != null && d.deviceId && (n = (l = r[0]) == null ? void 0 : l.deviceId);
15675
15674
  const o = (h) => u(this, null, function* () {
15676
15675
  try {
15677
15676
  let g = h;
@@ -15790,13 +15789,13 @@ let Dt = (_g = class extends uM {
15790
15789
  };
15791
15790
  return t.sort((i, n) => {
15792
15791
  var h, g;
15793
- const o = e(i), d = e(n);
15794
- if (o !== d)
15795
- return o - d;
15796
- const c = i.deviceId === "default" || ((h = i.label) == null ? void 0 : h.toLowerCase().includes("default")), l = n.deviceId === "default" || ((g = n.label) == null ? void 0 : g.toLowerCase().includes("default"));
15797
- if (c && !l)
15792
+ const o = e(i), c = e(n);
15793
+ if (o !== c)
15794
+ return o - c;
15795
+ const d = i.deviceId === "default" || ((h = i.label) == null ? void 0 : h.toLowerCase().includes("default")), l = n.deviceId === "default" || ((g = n.label) == null ? void 0 : g.toLowerCase().includes("default"));
15796
+ if (d && !l)
15798
15797
  return -1;
15799
- if (!c && l)
15798
+ if (!d && l)
15800
15799
  return 1;
15801
15800
  if (i.kind === "videoinput" && n.kind === "videoinput") {
15802
15801
  const f = r(i), v = r(n);
@@ -15854,23 +15853,23 @@ let Dt = (_g = class extends uM {
15854
15853
  var l, h;
15855
15854
  const i = (g) => `${g.kind}-${g.label}-${g.deviceId}-${g.groupId}`, n = new Set(
15856
15855
  e.map((g) => i(g))
15857
- ), o = yield this.getAvailableDevices(), d = new Set(
15856
+ ), o = yield this.getAvailableDevices(), c = new Set(
15858
15857
  o.map((g) => i(g))
15859
- ), c = {
15858
+ ), d = {
15860
15859
  added: o.filter(
15861
15860
  (g) => !n.has(i(g))
15862
15861
  ),
15863
15862
  removed: e.filter(
15864
- (g) => !d.has(i(g))
15863
+ (g) => !c.has(i(g))
15865
15864
  ),
15866
15865
  devices: o
15867
15866
  };
15868
- if (e = o, (l = c.added) != null && l.length || (h = c.removed) != null && h.length) {
15867
+ if (e = o, (l = d.added) != null && l.length || (h = d.removed) != null && h.length) {
15869
15868
  this.logger.info("repopulated_full_device_list", {
15870
15869
  devices: JSON.stringify(o)
15871
15870
  });
15872
- const g = [...c.added, ...c.removed];
15873
- g.some((f) => f.kind === "audioinput") && a(this, $e).getValue("callstats").devices("AUDIO", o == null ? void 0 : o.filter((f) => f.kind === "audioinput")), g.some((f) => f.kind === "videoinput") && a(this, $e).getValue("callstats").devices("VIDEO", o == null ? void 0 : o.filter((f) => f.kind === "videoinput")), g.some((f) => f.kind === "audiooutput") && a(this, $e).getValue("callstats").devices("SPEAKER", o == null ? void 0 : o.filter((f) => f.kind === "audiooutput")), t(r, c, !1);
15871
+ const g = [...d.added, ...d.removed];
15872
+ g.some((f) => f.kind === "audioinput") && a(this, $e).getValue("callstats").devices("AUDIO", o == null ? void 0 : o.filter((f) => f.kind === "audioinput")), g.some((f) => f.kind === "videoinput") && a(this, $e).getValue("callstats").devices("VIDEO", o == null ? void 0 : o.filter((f) => f.kind === "videoinput")), g.some((f) => f.kind === "audiooutput") && a(this, $e).getValue("callstats").devices("SPEAKER", o == null ? void 0 : o.filter((f) => f.kind === "audiooutput")), t(r, d, !1);
15874
15873
  }
15875
15874
  }),
15876
15875
  { signal: a(this, Dn).signal }
@@ -15940,14 +15939,14 @@ const bf = Dt, Gi = {
15940
15939
  const r = typeof e == "number" ? e : 250, i = s.createMediaStreamSource(t), n = s.createAnalyser();
15941
15940
  n.fftSize = 2048, i.connect(n);
15942
15941
  const o = new Uint8Array(n.fftSize);
15943
- let d = !1;
15942
+ let c = !1;
15944
15943
  setTimeout(() => {
15945
- d = !0;
15944
+ c = !0;
15946
15945
  }, r);
15947
- function c() {
15948
- return d ? Promise.resolve(!0) : (n.getByteTimeDomainData(o), o.some((l) => l !== 128 && l !== 0) ? Promise.resolve(!1) : gM().then(c));
15946
+ function d() {
15947
+ return c ? Promise.resolve(!0) : (n.getByteTimeDomainData(o), o.some((l) => l !== 128 && l !== 0) ? Promise.resolve(!1) : gM().then(d));
15949
15948
  }
15950
- return c().then(
15949
+ return d().then(
15951
15950
  (l) => (i.disconnect(), l),
15952
15951
  (l) => {
15953
15952
  throw i.disconnect(), l;
@@ -16330,7 +16329,7 @@ class Al extends Af {
16330
16329
  }
16331
16330
  conditionallyChangeTrack(t, e = !1) {
16332
16331
  return u(this, null, function* () {
16333
- var c;
16332
+ var d;
16334
16333
  if (!t || this.userSelectedDevice || e)
16335
16334
  return t;
16336
16335
  let r = t;
@@ -16351,16 +16350,16 @@ class Al extends Af {
16351
16350
  ))
16352
16351
  return r;
16353
16352
  if (!(yield Zp(this.logger, r))) {
16354
- const l = (c = o == null ? void 0 : o.devices.concat({
16353
+ const l = (d = o == null ? void 0 : o.devices.concat({
16355
16354
  label: r.label
16356
- })) != null ? c : [{ label: r.label }];
16355
+ })) != null ? d : [{ label: r.label }];
16357
16356
  return Gi.setItem(Zl, JSON.stringify({
16358
16357
  devices: l
16359
16358
  }), this.logger), r;
16360
16359
  }
16361
16360
  this.logger.info("AudioMediaHandler.conditionallyChangeTrack.DetectedSilentTrack");
16362
- const d = r.getSettings().deviceId;
16363
- return n.filter((l) => l.deviceId !== d).some((l) => u(this, null, function* () {
16361
+ const c = r.getSettings().deviceId;
16362
+ return n.filter((l) => l.deviceId !== c).some((l) => u(this, null, function* () {
16364
16363
  var h;
16365
16364
  if (r = yield this.mediaInterface.getAudioTrack(
16366
16365
  !1,
@@ -16414,7 +16413,7 @@ class wM {
16414
16413
  }
16415
16414
  setupSpeaker(r, i) {
16416
16415
  return u(this, arguments, function* (t, { saveDevicePreference: e }) {
16417
- var d, c;
16416
+ var c, d;
16418
16417
  if (!(a(this, vi) instanceof bf))
16419
16418
  return;
16420
16419
  let n = t;
@@ -16422,11 +16421,11 @@ class wM {
16422
16421
  "audiooutput"
16423
16422
  )).filter((h) => !gd(h))), !n)
16424
16423
  throw new k("No speaker found", "1608");
16425
- if (((d = this.currentDevice) == null ? void 0 : d.deviceId) === n.deviceId)
16424
+ if (((c = this.currentDevice) == null ? void 0 : c.deviceId) === n.deviceId)
16426
16425
  return;
16427
16426
  e && this.setUserPreferredDevice(n.deviceId), this.currentDevice = n;
16428
16427
  const o = document.querySelectorAll("audio");
16429
- (c = o[0]) != null && c.setSinkId && o.forEach((l) => u(this, null, function* () {
16428
+ (d = o[0]) != null && d.setSinkId && o.forEach((l) => u(this, null, function* () {
16430
16429
  if (typeof l.sinkId != "undefined" && this.currentDevice.deviceId && l.sinkId !== this.currentDevice.deviceId)
16431
16430
  try {
16432
16431
  yield l.setSinkId(this.currentDevice.deviceId);
@@ -16630,11 +16629,11 @@ class Ic extends Af {
16630
16629
  if (!e || this.userSelectedDevice || r)
16631
16630
  return e;
16632
16631
  let i = e;
16633
- const n = yield this.mediaInterface.getVideoInputDevices(), o = this.isNonPreferredDevice ? n.filter((d) => !this.isNonPreferredDevice(
16634
- d
16632
+ const n = yield this.mediaInterface.getVideoInputDevices(), o = this.isNonPreferredDevice ? n.filter((c) => !this.isNonPreferredDevice(
16633
+ c
16635
16634
  )) : n;
16636
16635
  return !(o != null && o.length) || window.FAST_RTK || o.find(
16637
- (d) => d.deviceId === e.getSettings().deviceId
16636
+ (c) => c.deviceId === e.getSettings().deviceId
16638
16637
  ) || (i.stop(), this.logger.info("localmediahandler::setupstreams::found_video_non_preferred"), i = yield this.mediaInterface.getVideoTrack(
16639
16638
  o[0].deviceId
16640
16639
  )), i;
@@ -16810,11 +16809,11 @@ const cn = class {
16810
16809
  return (i = (r = (e = (t = a(this, at)) == null ? void 0 : t.media) == null ? void 0 : e.video) == null ? void 0 : r.simulcast) != null ? i : !1;
16811
16810
  }
16812
16811
  get mediaConstraints() {
16813
- var t, e, r, i, n, o, d, c, l, h, g, f, v, E, _, w, R, D, U, B, F, H, X, Le;
16812
+ var t, e, r, i, n, o, c, d, l, h, g, f, v, E, _, w, R, D, U, B, F, H, X, Le;
16814
16813
  return {
16815
16814
  audio: {
16816
16815
  enableStereo: (i = (r = (e = (t = a(this, at)) == null ? void 0 : t.media) == null ? void 0 : e.audio) == null ? void 0 : r.enableStereo) != null ? i : en.audio.enableStereo,
16817
- enableHighBitrate: (c = (d = (o = (n = a(this, at)) == null ? void 0 : n.media) == null ? void 0 : o.audio) == null ? void 0 : d.enableHighBitrate) != null ? c : en.audio.enableHighBitrate
16816
+ enableHighBitrate: (d = (c = (o = (n = a(this, at)) == null ? void 0 : n.media) == null ? void 0 : o.audio) == null ? void 0 : c.enableHighBitrate) != null ? d : en.audio.enableHighBitrate
16818
16817
  },
16819
16818
  video: {
16820
16819
  quality: (f = (g = (h = (l = a(this, at)) == null ? void 0 : l.media) == null ? void 0 : h.video) == null ? void 0 : g.quality) != null ? f : en.video.quality,
@@ -17177,12 +17176,12 @@ class Ea {
17177
17176
  }
17178
17177
  Ke = new WeakMap(), Cr = new WeakMap(), wr = new WeakMap(), bd = new WeakSet(), Df = function(t, e, r = !0) {
17179
17178
  let i;
17180
- const n = a(this, Ke)[t], o = Object.prototype.toString.call(e), d = Object.prototype.toString.call(n);
17181
- if (o !== d) {
17179
+ const n = a(this, Ke)[t], o = Object.prototype.toString.call(e), c = Object.prototype.toString.call(n);
17180
+ if (o !== c) {
17182
17181
  this.set(t, e);
17183
17182
  return;
17184
17183
  }
17185
- switch (d) {
17184
+ switch (c) {
17186
17185
  case "[object Array]":
17187
17186
  i = [...n, ...e];
17188
17187
  break;
@@ -17235,10 +17234,10 @@ class $M {
17235
17234
  { name: t, socketHandler: a(this, Rr), meetingId: a(this, br) }
17236
17235
  );
17237
17236
  return a(this, Rr).storeGetKeys(a(this, br), t, []), new Promise((n, o) => {
17238
- const d = setTimeout(() => {
17237
+ const c = setTimeout(() => {
17239
17238
  a(this, rs).delete(t), o(Error("Failed"));
17240
17239
  }, 3e3);
17241
- a(this, rs).set(t, { rejectTimeout: d, resolve: n, store: r });
17240
+ a(this, rs).set(t, { rejectTimeout: c, resolve: n, store: r });
17242
17241
  });
17243
17242
  }
17244
17243
  refresh(t) {
@@ -17265,38 +17264,38 @@ Rr = new WeakMap(), br = new WeakMap(), Uo = new WeakSet(), Iu = function() {
17265
17264
  var n, o;
17266
17265
  if (e.pluginId !== a(this, br))
17267
17266
  return;
17268
- const r = (n = e.storeItems) == null ? void 0 : n.map((d) => {
17269
- var c;
17267
+ const r = (n = e.storeItems) == null ? void 0 : n.map((c) => {
17268
+ var d;
17270
17269
  return {
17271
- timestamp: d.timestamp,
17272
- peerId: d.peerId,
17270
+ timestamp: c.timestamp,
17271
+ peerId: c.peerId,
17273
17272
  payload: JSON.parse(
17274
- (c = d.payload) != null && c.length ? new TextDecoder().decode(d.payload) : "{}"
17273
+ (d = c.payload) != null && d.length ? new TextDecoder().decode(c.payload) : "{}"
17275
17274
  ),
17276
- key: d.storeKey
17275
+ key: c.storeKey
17277
17276
  };
17278
17277
  });
17279
17278
  if (t === Is.storeGetKeys) {
17280
- const d = a(this, rs).get(e.storeName), c = this.stores.get(e.storeName) || (d == null ? void 0 : d.store);
17281
- if (a(this, rs).get(e.storeName) && (this.stores.set(e.storeName, d.store), d.resolve(c), clearTimeout(d.rejectTimeout), a(this, rs).delete(e.storeName)), !c)
17279
+ const c = a(this, rs).get(e.storeName), d = this.stores.get(e.storeName) || (c == null ? void 0 : c.store);
17280
+ if (a(this, rs).get(e.storeName) && (this.stores.set(e.storeName, c.store), c.resolve(d), clearTimeout(c.rejectTimeout), a(this, rs).delete(e.storeName)), !d)
17282
17281
  return;
17283
17282
  r.forEach((l) => {
17284
- c.set(l.key, l.payload, !1, !1);
17283
+ d.set(l.key, l.payload, !1, !1);
17285
17284
  });
17286
17285
  return;
17287
17286
  }
17288
17287
  const i = this.stores.get(e.storeName) || ((o = a(this, rs).get(e.storeName)) == null ? void 0 : o.store);
17289
- i !== void 0 && (t === Is.storeInsertKeys && r.forEach(({ key: d, peerId: c, payload: l }) => {
17290
- c !== a(this, Uo, Iu) && i.set(d, l, !1, !0);
17291
- }), t === Is.storeDeleteKeys && r.forEach(({ key: d, peerId: c }) => {
17292
- c !== a(this, Uo, Iu) && i.delete(d, !1, !0);
17288
+ i !== void 0 && (t === Is.storeInsertKeys && r.forEach(({ key: c, peerId: d, payload: l }) => {
17289
+ d !== a(this, Uo, Iu) && i.set(c, l, !1, !0);
17290
+ }), t === Is.storeDeleteKeys && r.forEach(({ key: c, peerId: d }) => {
17291
+ d !== a(this, Uo, Iu) && i.delete(c, !1, !0);
17293
17292
  }));
17294
17293
  })
17295
17294
  );
17296
17295
  });
17297
17296
  };
17298
17297
  function ri(s) {
17299
- var t, e, r, i, n, o, d, c, l, h, g, f, v;
17298
+ var t, e, r, i, n, o, c, d, l, h, g, f, v;
17300
17299
  return s ? {
17301
17300
  media: {
17302
17301
  audio: {
@@ -17313,8 +17312,8 @@ function ri(s) {
17313
17312
  enabled: s.screenShareEnabled,
17314
17313
  permission: "mediaPermissions" in s ? (n = s.mediaPermissions) == null ? void 0 : n.screenshare : null,
17315
17314
  audio: {
17316
- enabled: (d = (o = s.screenShareTracks) == null ? void 0 : o.audio) == null ? void 0 : d.enabled,
17317
- trackId: (l = (c = s.screenShareTracks) == null ? void 0 : c.audio) == null ? void 0 : l.id
17315
+ enabled: (c = (o = s.screenShareTracks) == null ? void 0 : o.audio) == null ? void 0 : c.enabled,
17316
+ trackId: (l = (d = s.screenShareTracks) == null ? void 0 : d.audio) == null ? void 0 : l.id
17318
17317
  },
17319
17318
  video: {
17320
17319
  enabled: (g = (h = s.screenShareTracks) == null ? void 0 : h.video) == null ? void 0 : g.enabled,
@@ -17441,11 +17440,11 @@ let ir = (Cg = class extends Ot {
17441
17440
  const { clientWidth: e, clientHeight: r } = t, { width: i, height: n } = this.videoTrack.getSettings();
17442
17441
  if (!i || !n)
17443
17442
  return;
17444
- const o = n / r, d = i / e, c = Math.max(o, d);
17445
- c > qM && a(this, Bs) === 1 ? (S(this, Bs, 0), a(this, wt).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
17443
+ const o = n / r, c = i / e, d = Math.max(o, c);
17444
+ d > qM && a(this, Bs) === 1 ? (S(this, Bs, 0), a(this, wt).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
17446
17445
  peerId: this.id,
17447
17446
  maxSpatialLayer: a(this, Bs)
17448
- })) : c < FM && a(this, Bs) === 0 && (S(this, Bs, 1), a(this, wt).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
17447
+ })) : d < FM && a(this, Bs) === 0 && (S(this, Bs, 1), a(this, wt).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
17449
17448
  peerId: this.id,
17450
17449
  maxSpatialLayer: a(this, Bs)
17451
17450
  }));
@@ -17453,8 +17452,8 @@ let ir = (Cg = class extends Ot {
17453
17452
  S(this, wt, t);
17454
17453
  const {
17455
17454
  id: o,
17456
- userId: d,
17457
- displayName: c,
17455
+ userId: c,
17456
+ displayName: d,
17458
17457
  device: l,
17459
17458
  picture: h,
17460
17459
  isHost: g,
@@ -17468,7 +17467,7 @@ let ir = (Cg = class extends Ot {
17468
17467
  producers: U,
17469
17468
  metadata: B
17470
17469
  } = e;
17471
- this.id = o, this.userId = d, this.name = c, this.device = l, this.picture = h, this.isHost = g, this.flags = f, this.manualProducerConfig = bC, S(this, $n, v != null ? v : "ON_STAGE"), this.customParticipantId = E, this.audioEnabled = !_, this.audioTrack = w, this.videoEnabled = R, this.videoTrack = D, this.screenShareTracks = {
17470
+ this.id = o, this.userId = c, this.name = d, this.device = l, this.picture = h, this.isHost = g, this.flags = f, this.manualProducerConfig = bC, S(this, $n, v != null ? v : "ON_STAGE"), this.customParticipantId = E, this.audioEnabled = !_, this.audioTrack = w, this.videoEnabled = R, this.videoTrack = D, this.screenShareTracks = {
17472
17471
  audio: void 0,
17473
17472
  video: void 0
17474
17473
  }, this.producers = U != null ? U : [], this.presetName = B == null ? void 0 : B.preset_name, S(this, Un, !1), S(this, $s, r), S(this, Bo, i), this.setupEvents(), this.updateVideo = this.updateVideo.bind(this), V(this, Ho, Mu).call(this);
@@ -18154,10 +18153,10 @@ let Yt = (wg = class extends Ot {
18154
18153
  }
18155
18154
  });
18156
18155
  const { compulsoryPeers: t } = this.selectedPeers, e = t.filter(
18157
- (d) => this.joined.has(d)
18156
+ (c) => this.joined.has(c)
18158
18157
  ), r = Array.from(this.pinned.keys()).filter(
18159
- (d) => !e.includes(d)
18160
- ), i = Array.from(this.joined.toArray().filter((d) => d.stageStatus === "ON_STAGE").map((d) => d.id)), n = Math.max(
18158
+ (c) => !e.includes(c)
18159
+ ), i = Array.from(this.joined.toArray().filter((c) => c.stageStatus === "ON_STAGE").map((c) => c.id)), n = Math.max(
18161
18160
  (this.currentPage - 1) * (this.maxActiveParticipantsCount - e.length - r.length)
18162
18161
  ), o = this.currentPage * (this.maxActiveParticipantsCount - e.length - r.length);
18163
18162
  return e.concat(r, i.slice(n, o));
@@ -18571,10 +18570,10 @@ const Uf = (Rg = class {
18571
18570
  }
18572
18571
  selectPagePeers(s) {
18573
18572
  const { compulsoryPeers: t } = this.selectedPeers, e = t.filter(
18574
- (c) => this.participants.joined.has(c)
18573
+ (d) => this.participants.joined.has(d)
18575
18574
  ), r = Array.from(this.participants.pinned.keys()).filter(
18576
- (c) => !e.includes(c)
18577
- ), i = Array.from(this.participants.joined.toArray().filter((c) => c.stageStatus === "ON_STAGE").map((c) => c.id)), n = Math.max(
18575
+ (d) => !e.includes(d)
18576
+ ), i = Array.from(this.participants.joined.toArray().filter((d) => d.stageStatus === "ON_STAGE").map((d) => d.id)), n = Math.max(
18578
18577
  (s - 1) * (this.maxPreferredStreams - e.length - r.length)
18579
18578
  ), o = s * (this.maxPreferredStreams - e.length - r.length);
18580
18579
  return e.concat(r, i.slice(n, o));
@@ -18582,17 +18581,17 @@ const Uf = (Rg = class {
18582
18581
  selectActivePeers(s) {
18583
18582
  const t = /* @__PURE__ */ new Map(), e = Array.from(
18584
18583
  this.participants.joined.toArray().filter((h) => h.stageStatus === "ON_STAGE").map((h) => (t.set(h.id, !0), h.id))
18585
- ), r = this.selectedPeers.peers, i = this.participants.pinned.toArray().reduce((h, g) => (g.stageStatus !== "ON_STAGE" ? this.participants.pinned.delete(g.id) : h.push(g.id), h), []), n = this.self.stageStatus === "ON_STAGE" ? 1 : 0, o = s - n, d = new Set(
18584
+ ), r = this.selectedPeers.peers, i = this.participants.pinned.toArray().reduce((h, g) => (g.stageStatus !== "ON_STAGE" ? this.participants.pinned.delete(g.id) : h.push(g.id), h), []), n = this.self.stageStatus === "ON_STAGE" ? 1 : 0, o = s - n, c = new Set(
18586
18585
  r.concat(i).filter((h) => h !== this.self.id && t.has(h))
18587
18586
  );
18588
- let c = Array.from(d);
18589
- const l = o - d.size;
18587
+ let d = Array.from(c);
18588
+ const l = o - c.size;
18590
18589
  if (l >= 0) {
18591
- const h = e.filter((g) => !d.has(g) && g !== this.self.id).slice(0, l);
18592
- c = Array.from(d).concat(h);
18590
+ const h = e.filter((g) => !c.has(g) && g !== this.self.id).slice(0, l);
18591
+ d = Array.from(c).concat(h);
18593
18592
  } else
18594
- c = c.slice(0, o);
18595
- return c;
18593
+ d = d.slice(0, o);
18594
+ return d;
18596
18595
  }
18597
18596
  /**
18598
18597
  * NOTE(ravindra-cloudflare):
@@ -18670,8 +18669,8 @@ const Uf = (Rg = class {
18670
18669
  */
18671
18670
  syncConsumers() {
18672
18671
  return u(this, null, function* () {
18673
- var d, c, l, h, g;
18674
- if (((l = (c = (d = this.context.getValue("connectionHandler")) == null ? void 0 : d.mediaState) == null ? void 0 : c.recv) == null ? void 0 : l.state) !== "connected") {
18672
+ var c, d, l, h, g;
18673
+ if (((l = (d = (c = this.context.getValue("connectionHandler")) == null ? void 0 : c.mediaState) == null ? void 0 : d.recv) == null ? void 0 : l.state) !== "connected") {
18675
18674
  this.logger.info("syncConsumers: Connection not ready, exiting.");
18676
18675
  return;
18677
18676
  }
@@ -18806,8 +18805,8 @@ const Uf = (Rg = class {
18806
18805
  */
18807
18806
  updateParticipantsMapMinReplacement(s, t) {
18808
18807
  const e = Array.from(s.keys()), r = new Map(s), i = new Set(t), n = [];
18809
- e.forEach((o, d) => {
18810
- (!i.has(o) || !this.participants.joined.get(o)) && n.push(d);
18808
+ e.forEach((o, c) => {
18809
+ (!i.has(o) || !this.participants.joined.get(o)) && n.push(c);
18811
18810
  }), t.forEach((o) => {
18812
18811
  if (s.get(o))
18813
18812
  return;
@@ -18815,8 +18814,8 @@ const Uf = (Rg = class {
18815
18814
  e.push(o);
18816
18815
  return;
18817
18816
  }
18818
- const d = n.shift();
18819
- e[d] = o;
18817
+ const c = n.shift();
18818
+ e[c] = o;
18820
18819
  }), n.forEach((o) => {
18821
18820
  e.splice(o, 1);
18822
18821
  }), Array.from(s.keys()).forEach((o) => {
@@ -18934,8 +18933,8 @@ const Uf = (Rg = class {
18934
18933
  peerId: r,
18935
18934
  scoreStats: i
18936
18935
  }) => {
18937
- var d;
18938
- const n = t === "video" && ((d = e == null ? void 0 : e.screenShare) != null ? d : !1), o = this.participants.joined.get(r);
18936
+ var c;
18937
+ const n = t === "video" && ((c = e == null ? void 0 : e.screenShare) != null ? c : !1), o = this.participants.joined.get(r);
18939
18938
  o && (o.emit("mediaScoreUpdate", {
18940
18939
  kind: t,
18941
18940
  isScreenshare: n,
@@ -19014,8 +19013,8 @@ const Uf = (Rg = class {
19014
19013
  appData: i,
19015
19014
  track: n,
19016
19015
  producerId: o,
19017
- rtpReceiver: d,
19018
- paused: c,
19016
+ rtpReceiver: c,
19017
+ paused: d,
19019
19018
  localId: l
19020
19019
  } = (g = t.get(s)) != null ? g : {};
19021
19020
  if (!e)
@@ -19028,7 +19027,7 @@ const Uf = (Rg = class {
19028
19027
  supportsRemoteControl: !!(i != null && i.supportsRemoteControl),
19029
19028
  screenShare: !!(i != null && i.screenShare)
19030
19029
  },
19031
- remotelyPaused: c,
19030
+ remotelyPaused: d,
19032
19031
  producerId: o
19033
19032
  }
19034
19033
  }), {};
@@ -19039,23 +19038,23 @@ const Uf = (Rg = class {
19039
19038
  peerId: e,
19040
19039
  kind: r,
19041
19040
  appData: h,
19042
- remotelyPaused: c,
19041
+ remotelyPaused: d,
19043
19042
  producerId: o
19044
19043
  }
19045
19044
  }), this.consumerPeerMap.set(s, {
19046
19045
  type: r,
19047
19046
  peerId: e,
19048
19047
  appData: h,
19049
- remotelyPaused: c,
19048
+ remotelyPaused: d,
19050
19049
  producerId: o
19051
19050
  }), {
19052
19051
  peerId: e,
19053
19052
  kind: r,
19054
19053
  appData: h,
19055
- remotelyPaused: c,
19054
+ remotelyPaused: d,
19056
19055
  track: n,
19057
19056
  producerId: o,
19058
- rtpReceiver: d,
19057
+ rtpReceiver: c,
19059
19058
  localId: l
19060
19059
  };
19061
19060
  }
@@ -19078,8 +19077,8 @@ const Uf = (Rg = class {
19078
19077
  }
19079
19078
  }), this.consumerPeerMap.delete(s), e === "video" && r.screenShare !== !0 && this.videoPeerConsumerMap.delete(t), !o)
19080
19079
  return;
19081
- const d = o.producers.find((l) => l.producerId === n);
19082
- d && (d.consumer = {
19080
+ const c = o.producers.find((l) => l.producerId === n);
19081
+ c && (c.consumer = {
19083
19082
  id: s,
19084
19083
  peerId: t,
19085
19084
  kind: void 0,
@@ -19089,11 +19088,11 @@ const Uf = (Rg = class {
19089
19088
  rtpReceiver: void 0,
19090
19089
  localId: void 0
19091
19090
  });
19092
- const c = [];
19093
- r && r.screenShare ? (o.setScreenShareEnabled(!1), this.context.getValue("callstats").consumerSharedMediaState(s, { screen: !1 }), o.screenShareTracks.video && c.push(o.screenShareTracks.video.id), o.screenShareTracks.audio && c.push(o.screenShareTracks.audio.id), o.screenShareTracks = {
19091
+ const d = [];
19092
+ r && r.screenShare ? (o.setScreenShareEnabled(!1), this.context.getValue("callstats").consumerSharedMediaState(s, { screen: !1 }), o.screenShareTracks.video && d.push(o.screenShareTracks.video.id), o.screenShareTracks.audio && d.push(o.screenShareTracks.audio.id), o.screenShareTracks = {
19094
19093
  audio: void 0,
19095
19094
  video: void 0
19096
- }) : e === "audio" ? (o.setAudioEnabled(!1), o.audioTrack && c.push(o.audioTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { audio: !1 }), o.audioTrack = void 0) : e === "video" && (o.setVideoEnabled(!1), this.updatePipSource(o.id, !1), o.videoTrack && c.push(o.videoTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { video: !1 }), o.videoTrack = void 0), r.e2ee && c.forEach((l) => {
19095
+ }) : e === "audio" ? (o.setAudioEnabled(!1), o.audioTrack && d.push(o.audioTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { audio: !1 }), o.audioTrack = void 0) : e === "video" && (o.setVideoEnabled(!1), this.updatePipSource(o.id, !1), o.videoTrack && d.push(o.videoTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { video: !1 }), o.videoTrack = void 0), r.e2ee && d.forEach((l) => {
19097
19096
  this.context.getValue("peerSessionStore").emit(
19098
19097
  b.E2EE_INACTIVE_CONSUMER,
19099
19098
  {
@@ -19111,8 +19110,8 @@ const Uf = (Rg = class {
19111
19110
  appData: i,
19112
19111
  track: n,
19113
19112
  remotelyPaused: o,
19114
- producerId: d,
19115
- rtpReceiver: c,
19113
+ producerId: c,
19114
+ rtpReceiver: d,
19116
19115
  localId: l
19117
19116
  } = t;
19118
19117
  if (!e)
@@ -19124,23 +19123,23 @@ const Uf = (Rg = class {
19124
19123
  kind: r,
19125
19124
  appData: i,
19126
19125
  remotelyPaused: o,
19127
- producerId: d
19126
+ producerId: c
19128
19127
  }
19129
19128
  });
19130
19129
  const h = this.participants.joined.get(e);
19131
19130
  if (!h)
19132
19131
  return;
19133
- const g = h.producers.find((v) => v.producerId === d);
19132
+ const g = h.producers.find((v) => v.producerId === c);
19134
19133
  if (g && (g.consumer = {
19135
19134
  id: s,
19136
19135
  peerId: e,
19137
19136
  kind: r,
19138
19137
  appData: i,
19139
19138
  paused: o,
19140
- producerId: d,
19141
- rtpReceiver: c,
19139
+ producerId: c,
19140
+ rtpReceiver: d,
19142
19141
  localId: l
19143
- }), i.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: e, rtpReceiver: c, track: n }), i.screenShare) {
19142
+ }), i.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: e, rtpReceiver: d, track: n }), i.screenShare) {
19144
19143
  r === "video" ? h.screenShareTracks.video = n : r === "audio" && (h.screenShareTracks.audio = n), h.setScreenShareEnabled(!0), (f = this.context) == null || f.getValue("callstats").consumerSharedMediaState(s, { screen: !0 });
19145
19144
  return;
19146
19145
  }
@@ -19159,8 +19158,8 @@ const Uf = (Rg = class {
19159
19158
  appData: i,
19160
19159
  remotelyPaused: n,
19161
19160
  producerId: o,
19162
- rtpReceiver: d,
19163
- localId: c
19161
+ rtpReceiver: c,
19162
+ localId: d
19164
19163
  } = this.processMedia(s);
19165
19164
  if (!t)
19166
19165
  return;
@@ -19185,8 +19184,8 @@ const Uf = (Rg = class {
19185
19184
  appData: i,
19186
19185
  paused: n,
19187
19186
  producerId: o,
19188
- rtpReceiver: d,
19189
- localId: c
19187
+ rtpReceiver: c,
19188
+ localId: d
19190
19189
  }), r && i.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_INACTIVE_CONSUMER, { peerId: t, trackId: r.id }), e === "video" ? (l.videoTrack = r, l.setVideoEnabled(!1), this.updatePipSource(l.id, !1), this.context.getValue("callstats").consumerSharedMediaState(s, { video: !1 })) : e === "audio" && (l.audioTrack = r, l.setAudioEnabled(l.audioEnabled), this.context.getValue("callstats").consumerSharedMediaState(s, {
19191
19190
  audio: l.audioEnabled
19192
19191
  }));
@@ -19199,8 +19198,8 @@ const Uf = (Rg = class {
19199
19198
  track: i,
19200
19199
  appData: n,
19201
19200
  producerId: o,
19202
- rtpReceiver: d,
19203
- localId: c
19201
+ rtpReceiver: c,
19202
+ localId: d
19204
19203
  } = this.processMedia(s);
19205
19204
  if (!t)
19206
19205
  return;
@@ -19225,8 +19224,8 @@ const Uf = (Rg = class {
19225
19224
  appData: n,
19226
19225
  paused: r,
19227
19226
  producerId: o,
19228
- rtpReceiver: d,
19229
- localId: c
19227
+ rtpReceiver: c,
19228
+ localId: d
19230
19229
  }), n.screenShare) {
19231
19230
  e === "video" ? l.screenShareTracks.video = i : e === "audio" && (l.screenShareTracks.audio = i), (!r || this.self.permissions.isRecorder) && l.setScreenShareEnabled(!0), n.supportsRemoteControl && (l.supportsRemoteControl = !0), this.participants.broadcastMessage("screenshareConsumerCreated", {
19232
19231
  producerId: o,
@@ -19250,10 +19249,10 @@ const Uf = (Rg = class {
19250
19249
  video: !r
19251
19250
  })) : e === "audio" && (l.audioTrack = i, r || l.setAudioEnabled(!0), this.context.getValue("callstats").consumerSharedMediaState(s, {
19252
19251
  audio: !r
19253
- })), !r && n.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: t, rtpReceiver: d, track: i });
19252
+ })), !r && n.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: t, rtpReceiver: c, track: i });
19254
19253
  }
19255
19254
  static formatSocketPeerMessage(s) {
19256
- var e, r, i, n, o, d;
19255
+ var e, r, i, n, o, c;
19257
19256
  if (!s)
19258
19257
  return;
19259
19258
  const t = Th(s.stageType);
@@ -19275,7 +19274,7 @@ const Uf = (Rg = class {
19275
19274
  flags: {
19276
19275
  hiddenParticipant: (i = s.flags) == null ? void 0 : i.hiddenParticipant,
19277
19276
  hidden_participant: (n = s.flags) == null ? void 0 : n.hiddenParticipant,
19278
- recorder: ((o = s.flags) == null ? void 0 : o.recorderType) !== void 0 && ((d = s.flags) == null ? void 0 : d.recorderType) !== "NONE"
19277
+ recorder: ((o = s.flags) == null ? void 0 : o.recorderType) !== void 0 && ((c = s.flags) == null ? void 0 : c.recorderType) !== "NONE"
19279
19278
  }
19280
19279
  };
19281
19280
  }
@@ -19349,15 +19348,15 @@ const Nd = class extends Ot {
19349
19348
  connectedMeetings: i,
19350
19349
  plugins: n,
19351
19350
  polls: o,
19352
- media: d
19353
- } = l, c = Nc(l, [
19351
+ media: c
19352
+ } = l, d = Nc(l, [
19354
19353
  "chat",
19355
19354
  "connectedMeetings",
19356
19355
  "plugins",
19357
19356
  "polls",
19358
19357
  "media"
19359
19358
  ]);
19360
- if (r && (r.private && hr(a(this, Y).chat.private, r.private), r.public && hr(a(this, Y).chat.public, r.public), this.emit("chatUpdate")), i && hr(a(this, Y).connectedMeetings, i), d) {
19359
+ if (r && (r.private && hr(a(this, Y).chat.private, r.private), r.public && hr(a(this, Y).chat.public, r.public), this.emit("chatUpdate")), i && hr(a(this, Y).connectedMeetings, i), c) {
19361
19360
  const v = (_) => {
19362
19361
  switch (_) {
19363
19362
  case $r.NONE:
@@ -19376,15 +19375,15 @@ const Nd = class extends Ot {
19376
19375
  video: void 0,
19377
19376
  screenshare: void 0
19378
19377
  };
19379
- (h = d.audio) != null && h.canProduce && (E.audio = {
19380
- canProduce: v(d.audio.canProduce)
19381
- }), (g = d.video) != null && g.canProduce && (E.video = {
19382
- canProduce: v(d.video.canProduce)
19383
- }), (f = d.screenshare) != null && f.canProduce && (E.screenshare = {
19384
- canProduce: v(d.screenshare.canProduce)
19378
+ (h = c.audio) != null && h.canProduce && (E.audio = {
19379
+ canProduce: v(c.audio.canProduce)
19380
+ }), (g = c.video) != null && g.canProduce && (E.video = {
19381
+ canProduce: v(c.video.canProduce)
19382
+ }), (f = c.screenshare) != null && f.canProduce && (E.screenshare = {
19383
+ canProduce: v(c.screenshare.canProduce)
19385
19384
  }), hr(a(this, Y).media, E);
19386
19385
  }
19387
- n && (hr(a(this, Y).plugins, n), this.emit("pluginsUpdate")), o && (hr(a(this, Y).polls, o), this.emit("pollsUpdate")), Object.keys(c).length !== 0 && hr(a(this, Y), c), this.emit("permissionsUpdate", e);
19386
+ n && (hr(a(this, Y).plugins, n), this.emit("pluginsUpdate")), o && (hr(a(this, Y).polls, o), this.emit("pollsUpdate")), Object.keys(d).length !== 0 && hr(a(this, Y), d), this.emit("permissionsUpdate", e);
19388
19387
  });
19389
19388
  if (!r)
19390
19389
  throw this.logger.error("PermissionPreset::load_preset_permissions_failed"), new k("Could not load preset permissions.", "0904");
@@ -19653,7 +19652,7 @@ class $f extends Ot {
19653
19652
  }
19654
19653
  updatePermission() {
19655
19654
  return u(this, null, function* () {
19656
- var c, l;
19655
+ var d, l;
19657
19656
  const e = (h, g) => {
19658
19657
  this.mediaPermissions[h] = g;
19659
19658
  const f = { message: this.mediaPermissions[h], kind: h };
@@ -19661,9 +19660,9 @@ class $f extends Ot {
19661
19660
  };
19662
19661
  if (Se.getName() === "firefox")
19663
19662
  return;
19664
- const r = "microphone", i = "camera", n = yield (c = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : c.query({ name: r }), o = yield (l = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : l.query({
19663
+ const r = "microphone", i = "camera", n = yield (d = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : d.query({ name: r }), o = yield (l = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : l.query({
19665
19664
  name: i
19666
- }), d = (h, g) => {
19665
+ }), c = (h, g) => {
19667
19666
  switch (g) {
19668
19667
  case "granted":
19669
19668
  e(h, "ACCEPTED");
@@ -19677,7 +19676,7 @@ class $f extends Ot {
19677
19676
  }
19678
19677
  this.localMediaHandler.repopulateAvailableDevices();
19679
19678
  };
19680
- n && (n.onchange = () => d("audio", n.state)), o && (o.onchange = () => d("video", o.state));
19679
+ n && (n.onchange = () => c("audio", n.state)), o && (o.onchange = () => c("video", o.state));
19681
19680
  });
19682
19681
  }
19683
19682
  // eslint-disable-next-line class-methods-use-this
@@ -19686,18 +19685,18 @@ class $f extends Ot {
19686
19685
  message: e,
19687
19686
  kind: r
19688
19687
  }) {
19689
- var n, o, d, c;
19688
+ var n, o, c, d;
19690
19689
  switch (r) {
19691
19690
  case "audio": {
19692
19691
  (n = a(this, Rt)) == null || n.getValue("callstats").mediaPermission("AUDIO", e), (o = a(this, Rt)) == null || o.getValue("callstats").mediaPermission("SPEAKER", e);
19693
19692
  break;
19694
19693
  }
19695
19694
  case "video": {
19696
- (d = a(this, Rt)) == null || d.getValue("callstats").mediaPermission("VIDEO", e);
19695
+ (c = a(this, Rt)) == null || c.getValue("callstats").mediaPermission("VIDEO", e);
19697
19696
  break;
19698
19697
  }
19699
19698
  case "screenshare": {
19700
- (c = a(this, Rt)) == null || c.getValue("callstats").mediaPermission("SCREENSHARE", e);
19699
+ (d = a(this, Rt)) == null || d.getValue("callstats").mediaPermission("SCREENSHARE", e);
19701
19700
  break;
19702
19701
  }
19703
19702
  }
@@ -19710,7 +19709,7 @@ class $f extends Ot {
19710
19709
  /** @access private */
19711
19710
  init() {
19712
19711
  return u(this, arguments, function* (e = {}, r = !1, i = null) {
19713
- var n, o, d, c, l, h, g;
19712
+ var n, o, c, d, l, h, g;
19714
19713
  if (Se.init(), i && S(this, Rt, i), !this.localMediaHandler)
19715
19714
  try {
19716
19715
  let f = !0;
@@ -19724,7 +19723,7 @@ class $f extends Ot {
19724
19723
  i,
19725
19724
  e.constraints,
19726
19725
  (o = i == null ? void 0 : i.getValue("defaults")) == null ? void 0 : o.isNonPreferredDevice,
19727
- (d = i == null ? void 0 : i.getValue("defaults")) == null ? void 0 : d.autoSwitchAudioDevice
19726
+ (c = i == null ? void 0 : i.getValue("defaults")) == null ? void 0 : c.autoSwitchAudioDevice
19728
19727
  );
19729
19728
  if (i == null || i.getValue("peerSessionStore").on(
19730
19729
  b.MEDIA_PERMISSION_UPDATE,
@@ -19762,7 +19761,7 @@ class $f extends Ot {
19762
19761
  }), this.emit("mediaPermissionError", v), this.emit("mediaPermissionUpdate", { message: _, kind: E });
19763
19762
  })
19764
19763
  ), f) {
19765
- this.logger.info(`Setting up SelfMedia streams using media handler. audio:${(c = e == null ? void 0 : e.audio) != null ? c : !0} video:${(l = e == null ? void 0 : e.video) != null ? l : !0}`);
19764
+ this.logger.info(`Setting up SelfMedia streams using media handler. audio:${(d = e == null ? void 0 : e.audio) != null ? d : !0} video:${(l = e == null ? void 0 : e.video) != null ? l : !0}`);
19766
19765
  const v = this.localMediaHandler.setupStreams({
19767
19766
  video: (h = e == null ? void 0 : e.video) != null ? h : !0,
19768
19767
  audio: (g = e == null ? void 0 : e.audio) != null ? g : !0
@@ -20116,14 +20115,14 @@ let We = (bg = class extends $f {
20116
20115
  static __init__(t, e, r, i, n, o = !1) {
20117
20116
  return u(this, null, function* () {
20118
20117
  var f, v, E, _, w, R;
20119
- let d = (v = (f = t.getValue("defaults")) == null ? void 0 : f.audio) != null ? v : !0, c = (_ = (E = t.getValue("defaults")) == null ? void 0 : E.video) != null ? _ : !0;
20120
- r.canProduceAudio !== "ALLOWED" && (d = !1), r.canProduceVideo !== "ALLOWED" && (c = !1);
20118
+ let c = (v = (f = t.getValue("defaults")) == null ? void 0 : f.audio) != null ? v : !0, d = (_ = (E = t.getValue("defaults")) == null ? void 0 : E.video) != null ? _ : !0;
20119
+ r.canProduceAudio !== "ALLOWED" && (c = !1), r.canProduceVideo !== "ALLOWED" && (d = !1);
20121
20120
  const l = new We(t, e, r, i, n), h = dM(i.mediaConstraints);
20122
20121
  hr(h, (w = t.getValue("defaults")) == null ? void 0 : w.mediaConfiguration);
20123
20122
  const g = (R = t.getValue("defaults")) == null ? void 0 : R.mediaHandler;
20124
20123
  return g && (g.context = t), yield l.init({
20125
- audio: d,
20126
- video: c,
20124
+ audio: c,
20125
+ video: d,
20127
20126
  constraints: h
20128
20127
  }, o, t), l.setupEvents(), l;
20129
20128
  });
@@ -20500,8 +20499,8 @@ let We = (bg = class extends $f {
20500
20499
  const o = (r = t.srcObject) == null ? void 0 : r.getTracks()[0];
20501
20500
  if ((o == null ? void 0 : o.id) === this.videoTrack.id)
20502
20501
  return;
20503
- const d = new MediaStream();
20504
- d.addTrack(this.videoTrack), t.srcObject = d, e || (i = a(this, Hs, Xr)) == null || i.enableSource(this.id);
20502
+ const c = new MediaStream();
20503
+ c.addTrack(this.videoTrack), t.srcObject = c, e || (i = a(this, Hs, Xr)) == null || i.enableSource(this.id);
20505
20504
  } else
20506
20505
  t.srcObject = void 0, e || (n = a(this, Hs, Xr)) == null || n.disableSource(this.id);
20507
20506
  t.style.display = this.videoEnabled ? "block" : "none";
@@ -20637,17 +20636,17 @@ class Lu {
20637
20636
  enqueuedAt: Date.now(),
20638
20637
  executedAt: void 0,
20639
20638
  completed: !1,
20640
- resolve: (d) => {
20639
+ resolve: (c) => {
20641
20640
  if (o.completed)
20642
20641
  return;
20643
- o.completed = !0, this.pendingTasks.delete(o.id), i(d);
20644
- const [c] = this.pendingTasks.values();
20645
- c && !c.executedAt && this.execute(c);
20642
+ o.completed = !0, this.pendingTasks.delete(o.id), i(c);
20643
+ const [d] = this.pendingTasks.values();
20644
+ d && !d.executedAt && this.execute(d);
20646
20645
  },
20647
- reject: (d) => {
20648
- if (!o.completed && (o.completed = !0, this.pendingTasks.delete(o.id), n(d), !this.stopping)) {
20649
- const [c] = this.pendingTasks.values();
20650
- c && !c.executedAt && this.execute(c);
20646
+ reject: (c) => {
20647
+ if (!o.completed && (o.completed = !0, this.pendingTasks.delete(o.id), n(c), !this.stopping)) {
20648
+ const [d] = this.pendingTasks.values();
20649
+ d && !d.executedAt && this.execute(d);
20651
20650
  }
20652
20651
  }
20653
20652
  };
@@ -20733,25 +20732,25 @@ function Bf(s, t) {
20733
20732
  maxRetryCount: 3,
20734
20733
  delayTime: 10
20735
20734
  }, t);
20736
- let d = 0, c, l = !1;
20735
+ let c = 0, d, l = !1;
20737
20736
  const h = (g) => {
20738
20737
  l = !0, r(g);
20739
20738
  };
20740
- for (; d < n; ) {
20739
+ for (; c < n; ) {
20741
20740
  try {
20742
- const g = yield s(d, h);
20741
+ const g = yield s(c, h);
20743
20742
  return e(g);
20744
20743
  } catch (g) {
20745
- if (c = g, l)
20744
+ if (d = g, l)
20746
20745
  break;
20747
- if (d < n)
20748
- i === "linear" ? yield tg(o * (d + 1)) : i === "exponential" && (yield tg(o * (d + Math.max(0, d - 1))));
20746
+ if (c < n)
20747
+ i === "linear" ? yield tg(o * (c + 1)) : i === "exponential" && (yield tg(o * (c + Math.max(0, c - 1))));
20749
20748
  else
20750
20749
  break;
20751
20750
  }
20752
- d += 1;
20751
+ c += 1;
20753
20752
  }
20754
- return r(c);
20753
+ return r(d);
20755
20754
  }));
20756
20755
  });
20757
20756
  }
@@ -20776,7 +20775,7 @@ function qc(s) {
20776
20775
  }
20777
20776
  function rD(s) {
20778
20777
  const t = RTCRtpReceiver.getCapabilities("audio"), e = RTCRtpReceiver.getCapabilities("video"), r = RTCRtpSender.getCapabilities("audio"), i = RTCRtpSender.getCapabilities("video");
20779
- s && (e.codecs = e.codecs.filter(({ mimeType: c }) => s === c), i.codecs = i.codecs.filter(({ mimeType: c }) => s === c));
20778
+ s && (e.codecs = e.codecs.filter(({ mimeType: d }) => s === d), i.codecs = i.codecs.filter(({ mimeType: d }) => s === d));
20780
20779
  const n = {
20781
20780
  audio: qc(t),
20782
20781
  video: qc(e)
@@ -21011,13 +21010,13 @@ class Ml extends st.EventEmitter {
21011
21010
  setTimeout(o, r, "event request timeout");
21012
21011
  try {
21013
21012
  this.emit(e.toString(), ...i, n, o);
21014
- } catch (d) {
21013
+ } catch (c) {
21015
21014
  this.logger.error(
21016
21015
  `EnhancedEventEmitter:: safeEmitAsPromise() | event listener for event ${e.toString()} threw an error [event:%s]:%o`,
21017
21016
  {
21018
- error: d
21017
+ error: c
21019
21018
  }
21020
- ), o(d);
21019
+ ), o(c);
21021
21020
  }
21022
21021
  });
21023
21022
  });
@@ -21074,7 +21073,7 @@ class kh extends Ml {
21074
21073
  iceTransportPolicy: i,
21075
21074
  additionalSettings: n,
21076
21075
  proprietaryConstraints: o,
21077
- onTrackHandler: d
21076
+ onTrackHandler: c
21078
21077
  }) {
21079
21078
  this.logger.debug("HandlerInterface::init()"), this._direction = e, this.pc = new RTCPeerConnection(
21080
21079
  N({
@@ -21084,8 +21083,8 @@ class kh extends Ml {
21084
21083
  rtcpMuxPolicy: "require"
21085
21084
  }, n),
21086
21085
  o
21087
- ), d && this.pc.addEventListener("track", (c) => {
21088
- d(c);
21086
+ ), c && this.pc.addEventListener("track", (d) => {
21087
+ c(d);
21089
21088
  }), this._addEventListeners();
21090
21089
  }
21091
21090
  connect() {
@@ -21167,8 +21166,8 @@ class kh extends Ml {
21167
21166
  throw new Error("associated RTCRtpTransceiver not found");
21168
21167
  const n = i.sender.getParameters();
21169
21168
  n.encodings.forEach(
21170
- (o, d) => {
21171
- d <= r ? o.active = !0 : o.active = !1;
21169
+ (o, c) => {
21170
+ c <= r ? o.active = !0 : o.active = !1;
21172
21171
  }
21173
21172
  ), yield i.sender.setParameters(n);
21174
21173
  });
@@ -21181,8 +21180,8 @@ class kh extends Ml {
21181
21180
  throw new Error("associated RTCRtpTransceiver not found");
21182
21181
  const n = i.sender.getParameters();
21183
21182
  n.encodings.forEach(
21184
- (o, d) => {
21185
- n.encodings[d] = N(N({}, o), r);
21183
+ (o, c) => {
21184
+ n.encodings[c] = N(N({}, o), r);
21186
21185
  }
21187
21186
  ), yield i.sender.setParameters(n);
21188
21187
  });
@@ -21306,8 +21305,8 @@ class Ah extends kh {
21306
21305
  sdpSemantics: "unified-plan"
21307
21306
  }, i),
21308
21307
  n
21309
- ), o && this.pc.addEventListener("track", (d) => {
21310
- o(d);
21308
+ ), o && this.pc.addEventListener("track", (c) => {
21309
+ o(c);
21311
21310
  }), this._addEventListeners();
21312
21311
  }
21313
21312
  send(n) {
@@ -21343,22 +21342,22 @@ class Ah extends kh {
21343
21342
  h.push(f);
21344
21343
  }), this.logger.info(`selected codecs: ${JSON.stringify(h)}`), o.setCodecPreferences(h);
21345
21344
  }
21346
- const d = yield this.pc.createOffer();
21347
- if (yield this.pc.setLocalDescription(d), r && r.findIndex(({ name: l }) => l === "opus") >= 0) {
21345
+ const c = yield this.pc.createOffer();
21346
+ if (yield this.pc.setLocalDescription(c), r && r.findIndex(({ name: l }) => l === "opus") >= 0) {
21348
21347
  const { enableDtx: l, enableStereo: h } = this, g = this.enableHighBitrate ? h ? 128e3 : 64e3 : h ? 64e3 : 32e3;
21349
- d.sdp = d.sdp.replace(
21348
+ c.sdp = c.sdp.replace(
21350
21349
  "minptime=10;useinbandfec=1",
21351
21350
  `minptime=10;useinbandfec=1;${l ? "usedtx=1;" : ""}${h ? "stereo=1;sprop-stereo=1;" : ""}maxaveragebitrate=${g}`
21352
- ), d.sdp += `a=rtcp-fb:111 nack\r
21351
+ ), c.sdp += `a=rtcp-fb:111 nack\r
21353
21352
  `;
21354
21353
  }
21355
21354
  this.midTransceiverMap.set(o.mid, o);
21356
- const c = (l) => u(this, null, function* () {
21355
+ const d = (l) => u(this, null, function* () {
21357
21356
  return this.logger.debug(`[SDP] send() | calling pc.setRemoteDescription() [answer:${JSON.stringify(l)}]`), yield this.pc.setRemoteDescription(l), o.mid;
21358
21357
  });
21359
- return this.logger.debug(`[SDP] send() | calling pc.setLocalDescription() [offer: ${JSON.stringify(d, void 0, 2)}]`), {
21360
- offerSdp: d,
21361
- callback: c,
21358
+ return this.logger.debug(`[SDP] send() | calling pc.setLocalDescription() [offer: ${JSON.stringify(c, void 0, 2)}]`), {
21359
+ offerSdp: c,
21360
+ callback: d,
21362
21361
  sender: o.sender,
21363
21362
  mid: o.mid
21364
21363
  };
@@ -21405,16 +21404,16 @@ class fd extends kh {
21405
21404
  screenShare: n
21406
21405
  }) {
21407
21406
  this._assertSendDirection();
21408
- const d = this.supportsSendEncodings && r !== void 0 ? { sendEncodings: r } : {}, c = this.pc.addTransceiver(e, N({
21407
+ const c = this.supportsSendEncodings && r !== void 0 ? { sendEncodings: r } : {}, d = this.pc.addTransceiver(e, N({
21409
21408
  direction: "sendonly",
21410
21409
  streams: [
21411
21410
  n ? this._sendScreenShareStream : this._sendWebStream
21412
21411
  ]
21413
- }, d));
21412
+ }, c));
21414
21413
  if (!this.supportsSendEncodings && r) {
21415
21414
  r.reverse();
21416
- const f = c.sender.getParameters();
21417
- f.encodings = r, yield c.sender.setParameters(f);
21415
+ const f = d.sender.getParameters();
21416
+ f.encodings = r, yield d.sender.setParameters(f);
21418
21417
  }
21419
21418
  const l = (f, v) => {
21420
21419
  var B;
@@ -21428,13 +21427,13 @@ class fd extends kh {
21428
21427
  `minptime=10;useinbandfec=1;${f ? "usedtx=1;" : ""}${v ? "stereo=1;sprop-stereo=1;" : ""}maxaveragebitrate=${E}`
21429
21428
  );
21430
21429
  }
21431
- return this.midTransceiverMap.set(c.mid, c), {
21430
+ return this.midTransceiverMap.set(d.mid, d), {
21432
21431
  offerSdp: h,
21433
21432
  callback: (f) => u(this, null, function* () {
21434
- return this.logger.debug(`send() | calling pc.setRemoteDescription() [answer:${JSON.stringify(f)}]`), yield this.pc.setRemoteDescription(f), c.mid;
21433
+ return this.logger.debug(`send() | calling pc.setRemoteDescription() [answer:${JSON.stringify(f)}]`), yield this.pc.setRemoteDescription(f), d.mid;
21435
21434
  }),
21436
- sender: c.sender,
21437
- mid: c.mid
21435
+ sender: d.sender,
21436
+ mid: d.mid
21438
21437
  };
21439
21438
  });
21440
21439
  }
@@ -21446,8 +21445,8 @@ class fd extends kh {
21446
21445
  throw new Error("associated RTCRtpTransceiver not found");
21447
21446
  const n = i.sender.getParameters(), o = n.encodings.length - 1 - r;
21448
21447
  n.encodings.forEach(
21449
- (d, c) => {
21450
- c >= o ? d.active = !0 : d.active = !1;
21448
+ (c, d) => {
21449
+ d >= o ? c.active = !0 : c.active = !1;
21451
21450
  }
21452
21451
  ), yield i.sender.setParameters(n);
21453
21452
  });
@@ -21491,12 +21490,12 @@ class Ih extends kh {
21491
21490
  i ? this._sendScreenShareStream : this._sendWebStream
21492
21491
  ],
21493
21492
  sendEncodings: e
21494
- }), d = RTCRtpSender.getCapabilities(typeof t == "string" ? t : t.kind);
21495
- this.logger.info(`Safari12::senders available params: ${JSON.stringify(d)}`);
21496
- const c = [];
21493
+ }), c = RTCRtpSender.getCapabilities(typeof t == "string" ? t : t.kind);
21494
+ this.logger.info(`Safari12::senders available params: ${JSON.stringify(c)}`);
21495
+ const d = [];
21497
21496
  r && r.length > 0 && r.forEach((g) => {
21498
21497
  var v;
21499
- const f = d.codecs.find(
21498
+ const f = c.codecs.find(
21500
21499
  (E) => E.mimeType.includes(g.name)
21501
21500
  );
21502
21501
  if (g.parameters) {
@@ -21506,8 +21505,8 @@ class Ih extends kh {
21506
21505
  const _ = [...new Set(E).values()];
21507
21506
  f.sdpFmtpLine = _.join(";");
21508
21507
  }
21509
- c.push(f);
21510
- }), this.logger.info(`Safari12::selected codecs: ${JSON.stringify(c)}`), o.setCodecPreferences(c);
21508
+ d.push(f);
21509
+ }), this.logger.info(`Safari12::selected codecs: ${JSON.stringify(d)}`), o.setCodecPreferences(d);
21511
21510
  const l = yield this.pc.createOffer();
21512
21511
  if (yield this.pc.setLocalDescription(l), t === "audio" || t.kind === "audio") {
21513
21512
  const { enableStereo: g, enableDtx: f } = this, v = this.enableHighBitrate ? g ? 128e3 : 64e3 : g ? 64e3 : 32e3;
@@ -21916,35 +21915,35 @@ const dn = class extends st.EventEmitter {
21916
21915
  });
21917
21916
  p(this, "request", (e) => u(this, null, function* () {
21918
21917
  const r = dn.createRequest(e), i = new Promise((n, o) => {
21919
- const { id: c } = r.payload._bolt, l = {
21920
- id: c,
21918
+ const { id: d } = r.payload._bolt, l = {
21919
+ id: d,
21921
21920
  method: r.type,
21922
21921
  resolve: (h) => {
21923
- this.queue.delete(c) && (clearTimeout(l.timer), n(h));
21922
+ this.queue.delete(d) && (clearTimeout(l.timer), n(h));
21924
21923
  },
21925
21924
  timer: setTimeout(() => {
21926
- this.queue.delete(c) && o(new Error(`request timeout for message id: ${c}`));
21925
+ this.queue.delete(d) && o(new Error(`request timeout for message id: ${d}`));
21927
21926
  }, 2e4),
21928
21927
  cancel: (h) => {
21929
- this.queue.delete(c) && (clearTimeout(l.timer), o(h));
21928
+ this.queue.delete(d) && (clearTimeout(l.timer), o(h));
21930
21929
  }
21931
21930
  };
21932
- this.queue.set(c, l);
21931
+ this.queue.set(d, l);
21933
21932
  });
21934
21933
  return this.channel.send(JSON.stringify(r)), i;
21935
21934
  }));
21936
21935
  p(this, "send", (e) => {
21937
21936
  const r = JSON.stringify(e), i = 16384;
21938
21937
  if (r.length > i) {
21939
- const n = i - 200, o = Math.ceil(r.length / n), d = [];
21938
+ const n = i - 200, o = Math.ceil(r.length / n), c = [];
21940
21939
  for (let l = 0; l < o; l += 1) {
21941
21940
  const h = l * n, g = (l + 1) * n;
21942
- d.push(r.slice(h, g));
21941
+ c.push(r.slice(h, g));
21943
21942
  }
21944
- const c = ga();
21943
+ const d = ga();
21945
21944
  for (let l = 0; l < o; l += 1) {
21946
- const h = d[l], f = JSON.stringify({
21947
- id: c,
21945
+ const h = c[l], f = JSON.stringify({
21946
+ id: d,
21948
21947
  count: o,
21949
21948
  chunkIndex: l,
21950
21949
  chunk: h
@@ -21959,17 +21958,17 @@ const dn = class extends st.EventEmitter {
21959
21958
  a(this, Dr).has(e.id) || a(this, Dr).set(e.id, []);
21960
21959
  const r = a(this, Dr).get(e.id);
21961
21960
  if (r[e.chunkIndex] = e, (r == null ? void 0 : r.length) === e.count && !r.some((n) => n === void 0)) {
21962
- const n = a(this, Dr).get(e.id), o = n == null ? void 0 : n.reduce((c, l) => c + l.chunk, "");
21961
+ const n = a(this, Dr).get(e.id), o = n == null ? void 0 : n.reduce((d, l) => d + l.chunk, "");
21963
21962
  a(this, Dr).delete(e.id);
21964
- const d = JSON.parse(o);
21965
- if (!d.payload || !qf(d.payload))
21963
+ const c = JSON.parse(o);
21964
+ if (!c.payload || !qf(c.payload))
21966
21965
  throw new Error("corrupted incoming message over dc", {
21967
- cause: { code: "CORRUPT_DC_MESSAGE", values: d }
21966
+ cause: { code: "CORRUPT_DC_MESSAGE", values: c }
21968
21967
  });
21969
- if (this.processBoltHandshake(d))
21968
+ if (this.processBoltHandshake(c))
21970
21969
  return;
21971
- if (this.serverProtocolVersion = (i = d.payload._bolt) == null ? void 0 : i.version, !this.processResponseMsg(d))
21972
- return d;
21970
+ if (this.serverProtocolVersion = (i = c.payload._bolt) == null ? void 0 : i.version, !this.processResponseMsg(c))
21971
+ return c;
21973
21972
  }
21974
21973
  });
21975
21974
  p(this, "processResponseMsg", (e) => {
@@ -22045,8 +22044,8 @@ const ln = class extends Ml {
22045
22044
  direction: i,
22046
22045
  handlerFactory: n,
22047
22046
  iceServers: o,
22048
- iceTransportPolicy: d,
22049
- proprietaryConstraints: c,
22047
+ iceTransportPolicy: c,
22048
+ proprietaryConstraints: d,
22050
22049
  additionalSettings: l,
22051
22050
  appData: h,
22052
22051
  config: g
@@ -22090,9 +22089,9 @@ const ln = class extends Ml {
22090
22089
  onTrackHandler: this._ontrack.bind(this),
22091
22090
  direction: i,
22092
22091
  iceServers: o,
22093
- iceTransportPolicy: d,
22092
+ iceTransportPolicy: c,
22094
22093
  additionalSettings: l,
22095
- proprietaryConstraints: c
22094
+ proprietaryConstraints: d
22096
22095
  }), this.appData = h || {};
22097
22096
  const E = 3e4;
22098
22097
  this.transportConnectionPromise = new Promise((D) => {
@@ -22248,8 +22247,8 @@ const ln = class extends Ml {
22248
22247
  const {
22249
22248
  track: n,
22250
22249
  encodings: o,
22251
- codecOptions: d,
22252
- stopTracks: c = !0,
22250
+ codecOptions: c,
22251
+ stopTracks: d = !0,
22253
22252
  disableTrackOnPause: l = !0,
22254
22253
  zeroRtpOnPause: h = !1,
22255
22254
  appData: g = {}
@@ -22264,7 +22263,7 @@ const ln = class extends Ml {
22264
22263
  } = yield this.handler.send({
22265
22264
  track: n,
22266
22265
  encodings: o,
22267
- codecOptions: d,
22266
+ codecOptions: c,
22268
22267
  screenShare: g == null ? void 0 : g.screenShare
22269
22268
  }), { answer: U, producerId: B } = yield r(
22270
22269
  {
@@ -22272,7 +22271,7 @@ const ln = class extends Ml {
22272
22271
  kind: n.kind,
22273
22272
  paused: l ? !n.enabled || Object.hasOwn(n, "fakeTracks") : !1,
22274
22273
  appData: j(N({}, g || {}), { mid: D }),
22275
- codecOptions: d,
22274
+ codecOptions: c,
22276
22275
  producingTransportId: this.serverId
22277
22276
  }
22278
22277
  ), F = yield w(U);
@@ -22282,7 +22281,7 @@ const ln = class extends Ml {
22282
22281
  id: f,
22283
22282
  localId: v,
22284
22283
  track: n,
22285
- stopTracks: c,
22284
+ stopTracks: d,
22286
22285
  disableTrackOnPause: l,
22287
22286
  zeroRtpOnPause: h,
22288
22287
  appData: g,
@@ -22320,14 +22319,14 @@ const ln = class extends Ml {
22320
22319
  return this.awaitQueue.push(() => u(this, null, function* () {
22321
22320
  const n = {}, {
22322
22321
  consumerStates: o,
22323
- sessionDescription: d,
22324
- failedProducers: c
22322
+ sessionDescription: c,
22323
+ failedProducers: d
22325
22324
  } = yield r(e);
22326
22325
  o.forEach((h, g) => {
22327
22326
  n[g] = this.createConsumerObjectAndWaitForTrack(j(N({}, h), {
22328
22327
  producerId: g
22329
22328
  }));
22330
- }), d && (this.logger.info("Session description found, sending negotiation request"), yield i(d));
22329
+ }), c && (this.logger.info("Session description found, sending negotiation request"), yield i(c));
22331
22330
  const l = [];
22332
22331
  return yield Promise.all(Object.entries(n).map(
22333
22332
  ([h, g]) => g.then((f) => l.push(f)).catch(() => {
@@ -22336,7 +22335,7 @@ const ln = class extends Ml {
22336
22335
  transport: { serverId: this.serverId }
22337
22336
  });
22338
22337
  })
22339
- )), { consumers: l, failedProducers: c };
22338
+ )), { consumers: l, failedProducers: d };
22340
22339
  }), "Transport.consume", { producersLength: e.length });
22341
22340
  });
22342
22341
  }
@@ -22353,12 +22352,12 @@ const ln = class extends Ml {
22353
22352
  }
22354
22353
  static setCodecAndFmtpMappings(e, r, i) {
22355
22354
  const n = Zt.parse(e.sdp);
22356
- return n.media = n.media.map((d) => {
22357
- if (r.includes(d.mid.toString())) {
22358
- const c = N({}, d);
22359
- return c.rtp = i[d.mid.toString()].rtp, c.fmtp = i[d.mid.toString()].fmtp, c.payloads = i[d.mid.toString()].payloads, c.rtcpFb = i[d.mid.toString()].rtcpFb, c;
22355
+ return n.media = n.media.map((c) => {
22356
+ if (r.includes(c.mid.toString())) {
22357
+ const d = N({}, c);
22358
+ return d.rtp = i[c.mid.toString()].rtp, d.fmtp = i[c.mid.toString()].fmtp, d.payloads = i[c.mid.toString()].payloads, d.rtcpFb = i[c.mid.toString()].rtcpFb, d;
22360
22359
  }
22361
- return d;
22360
+ return c;
22362
22361
  }), j(N({}, e), {
22363
22362
  sdp: Zt.write(n)
22364
22363
  });
@@ -22372,8 +22371,8 @@ const ln = class extends Ml {
22372
22371
  static setHeaderExtensionMappings(e, r) {
22373
22372
  const i = Zt.parse(e.sdp);
22374
22373
  return i.media = i.media.map((o) => {
22375
- const d = N({}, o);
22376
- return d.ext = r[o.mid], d;
22374
+ const c = N({}, o);
22375
+ return c.ext = r[o.mid], c;
22377
22376
  }), j(N({}, e), {
22378
22377
  sdp: Zt.write(i)
22379
22378
  });
@@ -22388,17 +22387,17 @@ const ln = class extends Ml {
22388
22387
  this.handler.pc.remoteDescription
22389
22388
  );
22390
22389
  this.logger.info("Stopping transceivers", { consumerIds: e.map(({ id: l }) => l) }), e.forEach((l) => l.close(void 0, !0));
22391
- let d = yield this.handler.pc.createOffer();
22392
- this.logger.info("[SDP] Created offer for closing consumers", { sdp: d.sdp }), d = ln.setCodecAndFmtpMappings(
22393
- d,
22390
+ let c = yield this.handler.pc.createOffer();
22391
+ this.logger.info("[SDP] Created offer for closing consumers", { sdp: c.sdp }), c = ln.setCodecAndFmtpMappings(
22392
+ c,
22394
22393
  i,
22395
22394
  n
22396
- ), d = ln.setHeaderExtensionMappings(
22397
- d,
22395
+ ), c = ln.setHeaderExtensionMappings(
22396
+ c,
22398
22397
  o
22399
- ), this.logger.info("[SDP] Updated codec and fmtp mappings in close consumer offer", { sdp: d.sdp }), yield this.setLocalDescription(d), this.logger.info("Successfully set local description in close consumers");
22400
- const c = yield r(e, d);
22401
- this.logger.info("[SDP] Received answer in close consumers", { sdp: c.sdp }), yield this.setRemoteDescription(c), this.logger.info("[SDP] Remote description was set successfully in close consumers", { sdp: c.sdp });
22398
+ ), this.logger.info("[SDP] Updated codec and fmtp mappings in close consumer offer", { sdp: c.sdp }), yield this.setLocalDescription(c), this.logger.info("Successfully set local description in close consumers");
22399
+ const d = yield r(e, c);
22400
+ this.logger.info("[SDP] Received answer in close consumers", { sdp: d.sdp }), yield this.setRemoteDescription(d), this.logger.info("[SDP] Remote description was set successfully in close consumers", { sdp: d.sdp });
22402
22401
  } catch (i) {
22403
22402
  this.logger.error("Failed to close consumers", { error: i });
22404
22403
  }
@@ -22413,10 +22412,10 @@ const ln = class extends Ml {
22413
22412
  const i = Zt.parse(r.sdp);
22414
22413
  return i.media = i.media.map((n) => {
22415
22414
  if (n.type === "audio") {
22416
- const o = N({}, n), d = o.fmtp.find(
22415
+ const o = N({}, n), c = o.fmtp.find(
22417
22416
  (l) => l.payload === 111
22418
22417
  );
22419
- return d && (d.config += ";stereo=1;sprop-stereo=1"), o.rtcpFb || (o.rtcpFb = []), o.rtcpFb.some(
22418
+ return c && (c.config += ";stereo=1;sprop-stereo=1"), o.rtcpFb || (o.rtcpFb = []), o.rtcpFb.some(
22420
22419
  (l) => l.type === "nack"
22421
22420
  ) || o.rtcpFb.push({
22422
22421
  payload: parseInt(o.payloads, 10),
@@ -22463,13 +22462,13 @@ const ln = class extends Ml {
22463
22462
  producerId: i,
22464
22463
  producingPeerId: n,
22465
22464
  producingTransportId: o,
22466
- streamId: d,
22467
- paused: c,
22465
+ streamId: c,
22466
+ paused: d,
22468
22467
  screenShare: l,
22469
22468
  appData: h,
22470
22469
  kind: g,
22471
22470
  mimeType: f
22472
- } = e, v = `${d}:${g}`, E = j(N({}, e), {
22471
+ } = e, v = `${c}:${g}`, E = j(N({}, e), {
22473
22472
  name: "consumer creation task error",
22474
22473
  message: "consumer creation failed"
22475
22474
  });
@@ -22488,7 +22487,7 @@ const ln = class extends Ml {
22488
22487
  localId: F.mid,
22489
22488
  transceiver: F,
22490
22489
  track: H,
22491
- paused: c,
22490
+ paused: d,
22492
22491
  producerId: i,
22493
22492
  producingPeerId: n,
22494
22493
  producingTransportId: o,
@@ -22738,12 +22737,12 @@ class pD extends st.EventEmitter {
22738
22737
  stopTransports(e) {
22739
22738
  var r, i;
22740
22739
  if (e.send && this.sendTransport !== void 0) {
22741
- const { id: n, serverId: o, direction: d } = a(this, Xe);
22742
- this.logger.info("Closing send transport", { transport: { id: n, serverId: o, type: d } }), a(this, Xe).close(), a(this, Xe).removeAllListeners(), S(this, Xe, void 0);
22740
+ const { id: n, serverId: o, direction: c } = a(this, Xe);
22741
+ this.logger.info("Closing send transport", { transport: { id: n, serverId: o, type: c } }), a(this, Xe).close(), a(this, Xe).removeAllListeners(), S(this, Xe, void 0);
22743
22742
  }
22744
22743
  if (e.recv && this.recvTransport !== void 0) {
22745
- const { id: n, serverId: o, direction: d } = a(this, Ze);
22746
- this.logger.info("Closing recv transport", { transport: { id: n, serverId: o, type: d } }), (r = a(this, Ze)) == null || r.close(), (i = a(this, Ze)) == null || i.removeAllListeners(), S(this, Ze, void 0);
22744
+ const { id: n, serverId: o, direction: c } = a(this, Ze);
22745
+ this.logger.info("Closing recv transport", { transport: { id: n, serverId: o, type: c } }), (r = a(this, Ze)) == null || r.close(), (i = a(this, Ze)) == null || i.removeAllListeners(), S(this, Ze, void 0);
22747
22746
  }
22748
22747
  V(this, Qo, Uu).call(this);
22749
22748
  }
@@ -22764,7 +22763,7 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22764
22763
  });
22765
22764
  }, Bd = new WeakSet(), jf = function(e) {
22766
22765
  return u(this, null, function* () {
22767
- var o, d, c, l, h, g, f, v;
22766
+ var o, c, d, l, h, g, f, v;
22768
22767
  va(this.context, "forceRelay") && S(this, Ts, "relay"), this.logger.info(`ICE Transport Policy set to ${a(this, Ts)}`);
22769
22768
  const n = yield St().getICEServers().catch((E) => (this.logger.warn(`failed to get iceservers from server: ${E.message}`), []));
22770
22769
  e.send && V(this, Fd, Wf).call(this, {
@@ -22773,7 +22772,7 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22773
22772
  encodedInsertableStreams: (o = this.context.getValue("modules").e2ee) == null ? void 0 : o.enabled
22774
22773
  },
22775
22774
  config: {
22776
- enableHighBitrate: (l = (c = (d = this.context.getValue("defaults").mediaConfiguration) == null ? void 0 : d.audio) == null ? void 0 : c.enableHighBitrate) != null ? l : !1,
22775
+ enableHighBitrate: (l = (d = (c = this.context.getValue("defaults").mediaConfiguration) == null ? void 0 : c.audio) == null ? void 0 : d.enableHighBitrate) != null ? l : !1,
22777
22776
  enableStereo: (f = (g = (h = this.context.getValue("defaults").mediaConfiguration) == null ? void 0 : h.audio) == null ? void 0 : g.enableStereo) != null ? f : !1,
22778
22777
  enableDtx: !1
22779
22778
  },
@@ -22791,8 +22790,8 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22791
22790
  const { id: r, serverId: i, direction: n } = e;
22792
22791
  V(this, jd, Kf).call(this, e);
22793
22792
  try {
22794
- return yield Bf((d, c) => u(this, null, function* () {
22795
- d > 0 && this.logger.debug(`Retrying transport connect, count: ${d}`, {
22793
+ return yield Bf((c, d) => u(this, null, function* () {
22794
+ c > 0 && this.logger.debug(`Retrying transport connect, count: ${c}`, {
22796
22795
  transport: { id: r, serverId: i, type: n }
22797
22796
  });
22798
22797
  try {
@@ -22801,7 +22800,7 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22801
22800
  yield V(this, Hd, Gf).call(this, e);
22802
22801
  } catch (l) {
22803
22802
  if (l instanceof vr) {
22804
- c(l);
22803
+ d(l);
22805
22804
  return;
22806
22805
  }
22807
22806
  throw this.logger.error("Failed to connect transport, retrying", { transport: e, error: l }), l;
@@ -22885,8 +22884,8 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22885
22884
  }
22886
22885
  );
22887
22886
  const o = () => {
22888
- const d = a(this, Mi)[r];
22889
- d !== void 0 && (clearTimeout(d), a(this, Mi)[r] = void 0);
22887
+ const c = a(this, Mi)[r];
22888
+ c !== void 0 && (clearTimeout(c), a(this, Mi)[r] = void 0);
22890
22889
  };
22891
22890
  switch (n) {
22892
22891
  case "connected":
@@ -22906,7 +22905,7 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22906
22905
  })), e.on("icecandidate", (n) => u(this, null, function* () {
22907
22906
  this.logger.debug("Sending iceCandidate:", { iceCandidate: n });
22908
22907
  })), e.on("datachannel:events", (n, o) => u(this, null, function* () {
22909
- var d, c;
22908
+ var c, d;
22910
22909
  this.logger.debug("Got data channel message on event:", {
22911
22910
  rtcChannel: { label: n, message: o }
22912
22911
  });
@@ -22923,7 +22922,7 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22923
22922
  break;
22924
22923
  }
22925
22924
  case "hub-disconnect": {
22926
- this.logger.debug(`media hub disconnected, full_reconnect: ${(d = o.payload) == null ? void 0 : d.full_reconnect}`), ((c = o.payload) == null ? void 0 : c.full_reconnect) === !0 && this.handleErrors("rejoin");
22925
+ this.logger.debug(`media hub disconnected, full_reconnect: ${(c = o.payload) == null ? void 0 : c.full_reconnect}`), ((d = o.payload) == null ? void 0 : d.full_reconnect) === !0 && this.handleErrors("rejoin");
22927
22926
  break;
22928
22927
  }
22929
22928
  case "error":
@@ -22943,7 +22942,7 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22943
22942
  return u(this, null, function* () {
22944
22943
  const i = e === "recv";
22945
22944
  try {
22946
- const { sdp: n, type: o } = r, d = {
22945
+ const { sdp: n, type: o } = r, c = {
22947
22946
  consuming: i,
22948
22947
  description: {
22949
22948
  sdp: n,
@@ -22952,7 +22951,7 @@ Xn = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), Ko = new WeakMap(),
22952
22951
  },
22953
22952
  producers: []
22954
22953
  };
22955
- return a(this, Zn).connectTransport(d);
22954
+ return a(this, Zn).connectTransport(c);
22956
22955
  } catch (n) {
22957
22956
  throw this.logger.error(
22958
22957
  `Error in ${e} transport connection:`,
@@ -23003,8 +23002,8 @@ class gD {
23003
23002
  if (!t || t && t.length === 0)
23004
23003
  throw new Error("List of producers is required");
23005
23004
  const e = /* @__PURE__ */ new Map(), r = [];
23006
- t.forEach((c) => {
23007
- const { producingPeerId: l, producerId: h, producingTransportId: g } = c, f = {
23005
+ t.forEach((d) => {
23006
+ const { producingPeerId: l, producerId: h, producingTransportId: g } = d, f = {
23008
23007
  simulcast: {
23009
23008
  preferredRid: "f",
23010
23009
  priorityOrdering: "asciibetical",
@@ -23021,16 +23020,16 @@ class gD {
23021
23020
  requests: r,
23022
23021
  consumingTransportId: this.recvTransport.serverId
23023
23022
  }), n = /* @__PURE__ */ new Map();
23024
- t.forEach((c) => n.set(c.producerId, c));
23025
- const o = /* @__PURE__ */ new Map(), d = [];
23026
- return Object.entries(i.consumerStateMap).forEach(([c, l]) => {
23027
- const h = n.get(c);
23023
+ t.forEach((d) => n.set(d.producerId, d));
23024
+ const o = /* @__PURE__ */ new Map(), c = [];
23025
+ return Object.entries(i.consumerStateMap).forEach(([d, l]) => {
23026
+ const h = n.get(d);
23028
23027
  if (!h)
23029
23028
  return;
23030
23029
  if (l.errorCode) {
23031
- a(this, Gt).warn(`Consumer request failed for producer ${c}`, {
23030
+ a(this, Gt).warn(`Consumer request failed for producer ${d}`, {
23032
23031
  error: { message: l.errorCode }
23033
- }), d.push(j(N({}, h), { errorCode: l.errorCode }));
23032
+ }), c.push(j(N({}, h), { errorCode: l.errorCode }));
23034
23033
  return;
23035
23034
  }
23036
23035
  let g = {};
@@ -23038,7 +23037,7 @@ class gD {
23038
23037
  g = JSON.parse(l.producerState.appData);
23039
23038
  } catch (f) {
23040
23039
  }
23041
- o.set(c, {
23040
+ o.set(d, {
23042
23041
  consumerId: l.consumerId,
23043
23042
  producingTransportId: h.producingTransportId,
23044
23043
  producingPeerId: h.producingPeerId,
@@ -23050,7 +23049,7 @@ class gD {
23050
23049
  mimeType: h.mimeType,
23051
23050
  appData: g
23052
23051
  });
23053
- }), { consumerStates: o, sessionDescription: i.sessionDescription, failedProducers: d };
23052
+ }), { consumerStates: o, sessionDescription: i.sessionDescription, failedProducers: c };
23054
23053
  });
23055
23054
  }
23056
23055
  negotiate(t) {
@@ -23094,10 +23093,10 @@ class gD {
23094
23093
  },
23095
23094
  consumerIds: n,
23096
23095
  consumingTransportId: this.recvTransport.serverId
23097
- }, d = yield this.socketHandler.closeConsumer(o), c = BR.fromBinary(d).description;
23096
+ }, c = yield this.socketHandler.closeConsumer(o), d = BR.fromBinary(c).description;
23098
23097
  return {
23099
- sdp: c.sdp,
23100
- type: c.type
23098
+ sdp: d.sdp,
23099
+ type: d.type
23101
23100
  };
23102
23101
  });
23103
23102
  return yield this.recvTransport.awaitQueue.push(() => this.recvTransport.closeConsumers(t, e), "ConsumerStrategy.close", { consumersLength: t.length }), {};
@@ -23109,11 +23108,11 @@ class gD {
23109
23108
  requests: [],
23110
23109
  consumingTransportId: this.recvTransport.serverId
23111
23110
  }, i = t.filter((n) => n && n.id);
23112
- i.forEach(({ id: n, producingTransportId: o, localId: d }) => {
23111
+ i.forEach(({ id: n, producingTransportId: o, localId: c }) => {
23113
23112
  r.requests.push({
23114
23113
  producerId: n,
23115
23114
  producingTransportId: o,
23116
- mid: d,
23115
+ mid: c,
23117
23116
  simulcast: {
23118
23117
  preferredRid: e === 0 ? "q" : "h",
23119
23118
  priorityOrdering: "asciibetical",
@@ -23135,7 +23134,7 @@ class Mh {
23135
23134
  (n) => e === "video" ? n.type === "video" : n.type === "audio"
23136
23135
  ).at(-1).msid;
23137
23136
  }
23138
- create(d) {
23137
+ create(c) {
23139
23138
  return u(this, arguments, function* ({
23140
23139
  offer: t,
23141
23140
  kind: e,
@@ -23145,7 +23144,7 @@ class Mh {
23145
23144
  producingTransportId: o
23146
23145
  }) {
23147
23146
  var f, v;
23148
- const c = Mh.getMSIDFromSDP(t.sdp, e), l = {
23147
+ const d = Mh.getMSIDFromSDP(t.sdp, e), l = {
23149
23148
  description: {
23150
23149
  sdp: t.sdp,
23151
23150
  type: t.type,
@@ -23153,7 +23152,7 @@ class Mh {
23153
23152
  },
23154
23153
  paused: r,
23155
23154
  kind: e,
23156
- msid: c,
23155
+ msid: d,
23157
23156
  appData: JSON.stringify(i),
23158
23157
  screenShare: (f = i.screenShare) != null ? f : !1,
23159
23158
  mimeType: `${e}/${(v = n[0]) == null ? void 0 : v.name}`,
@@ -23320,18 +23319,18 @@ Or = new WeakMap(), Nr = new WeakMap(), sa = new WeakMap(), tc = new WeakMap(),
23320
23319
  throw new Error("Recv transport is closed");
23321
23320
  const e = 500, r = a(this, qs).splice(0, a(this, qs).length);
23322
23321
  try {
23323
- const i = new Set(Array.from(this.consumers.values()).map(({ producerId: c }) => c)), n = r.filter(({ producerId: c }) => !this.producers.get(c) && !i.has(c));
23322
+ const i = new Set(Array.from(this.consumers.values()).map(({ producerId: d }) => d)), n = r.filter(({ producerId: d }) => !this.producers.get(d) && !i.has(d));
23324
23323
  if (n.length === 0)
23325
23324
  return;
23326
- const { consumers: o, failedProducers: d } = yield this.recvTransport.consume(
23325
+ const { consumers: o, failedProducers: c } = yield this.recvTransport.consume(
23327
23326
  n,
23328
23327
  V(this, Yd, Xf).bind(this),
23329
23328
  a(this, ys).negotiate.bind(a(this, ys))
23330
23329
  );
23331
- if (o.forEach(V(this, Qd, Zf).bind(this)), d != null && d.length) {
23332
- this.logger.error("Failed to create consumers for producers", { producers: d });
23333
- const c = d.filter(({ errorCode: l, producerId: h }) => l === "not_found_track_error" ? (this.logger.error(`Track not found for producer: ${h}. This will not be retried.`), !1) : l === "backend_error" ? (this.logger.error("Unrecoverable error: backend error"), !1) : !0);
23334
- S(this, qs, a(this, qs).concat(c)), S(this, ra, setTimeout(
23330
+ if (o.forEach(V(this, Qd, Zf).bind(this)), c != null && c.length) {
23331
+ this.logger.error("Failed to create consumers for producers", { producers: c });
23332
+ const d = c.filter(({ errorCode: l, producerId: h }) => l === "not_found_track_error" ? (this.logger.error(`Track not found for producer: ${h}. This will not be retried.`), !1) : l === "backend_error" ? (this.logger.error("Unrecoverable error: backend error"), !1) : !0);
23333
+ S(this, qs, a(this, qs).concat(d)), S(this, ra, setTimeout(
23335
23334
  V(this, sc, Fu).bind(this),
23336
23335
  e
23337
23336
  ));
@@ -23357,12 +23356,12 @@ Or = new WeakMap(), Nr = new WeakMap(), sa = new WeakMap(), tc = new WeakMap(),
23357
23356
  return a(this, tc).create(e);
23358
23357
  }, zd = new WeakSet(), Qf = function(e, r) {
23359
23358
  e.on("close", (i, n) => u(this, null, function* () {
23360
- const { offer: o, reason: d } = i;
23359
+ const { offer: o, reason: c } = i;
23361
23360
  if (this.logger.info("producer::closing", {
23362
- debuggingHint: d,
23361
+ debuggingHint: c,
23363
23362
  producer: j(N({}, e), { status: "closing" })
23364
- }), d !== fo) {
23365
- const c = {
23363
+ }), c !== fo) {
23364
+ const d = {
23366
23365
  producerId: e.id,
23367
23366
  description: {
23368
23367
  sdp: o.sdp,
@@ -23371,7 +23370,7 @@ Or = new WeakMap(), Nr = new WeakMap(), sa = new WeakMap(), tc = new WeakMap(),
23371
23370
  }
23372
23371
  };
23373
23372
  try {
23374
- const l = yield this.socketHandler.closeProducer(c), h = {
23373
+ const l = yield this.socketHandler.closeProducer(d), h = {
23375
23374
  sdp: l == null ? void 0 : l.sdp,
23376
23375
  type: l == null ? void 0 : l.type
23377
23376
  };
@@ -23417,8 +23416,8 @@ const sl = class {
23417
23416
  hangoverFrames: i = 5,
23418
23417
  noiseAdaptationRate: n = 0.95,
23419
23418
  voiceAdaptationRate: o = 0.99,
23420
- minEnergyThreshold: d = 5e-3,
23421
- maxEnergyThreshold: c = 0.2,
23419
+ minEnergyThreshold: c = 5e-3,
23420
+ maxEnergyThreshold: d = 0.2,
23422
23421
  energyRatioThreshold: l = 1.5,
23423
23422
  noiseHistorySize: h = 50
23424
23423
  } = {}) {
@@ -23450,7 +23449,7 @@ const sl = class {
23450
23449
  m(this, Oi, 0);
23451
23450
  m(this, js, []);
23452
23451
  m(this, cc, void 0);
23453
- S(this, ia, t), S(this, pt, t), S(this, rc, e), S(this, ic, r), S(this, nc, i), S(this, na, n), S(this, aa, o), S(this, ac, d), S(this, oc, c), S(this, oa, l), S(this, cc, h), S(this, as, t / 2);
23452
+ S(this, ia, t), S(this, pt, t), S(this, rc, e), S(this, ic, r), S(this, nc, i), S(this, na, n), S(this, aa, o), S(this, ac, c), S(this, oc, d), S(this, oa, l), S(this, cc, h), S(this, as, t / 2);
23454
23453
  }
23455
23454
  get voiceDetected() {
23456
23455
  return a(this, os);
@@ -23461,8 +23460,8 @@ const sl = class {
23461
23460
  * @returns boolean indicating if voice activity is detected
23462
23461
  */
23463
23462
  processAudioChunk(t) {
23464
- var o, d;
23465
- const e = V(o = sl, el, sS).call(o, t), r = V(d = sl, tl, rS).call(d, t);
23463
+ var o, c;
23464
+ const e = V(o = sl, el, sS).call(o, t), r = V(c = sl, tl, rS).call(c, t);
23466
23465
  return V(this, Xd, eS).call(this, e), e / a(this, as) > a(this, oa) && e > a(this, pt) && r > a(this, rc) ? (S(this, Di, a(this, Di) + 1), S(this, Oi, a(this, nc)), a(this, Di) >= a(this, ic) && S(this, os, !0)) : (S(this, Di, 0), a(this, Oi) > 0 ? S(this, Oi, a(this, Oi) - 1) : a(this, os) && S(this, os, !1), a(this, os) || V(this, Zd, tS).call(this, e)), { energy: e, isVoice: a(this, os) };
23467
23466
  }
23468
23467
  /**
@@ -23772,8 +23771,8 @@ class ne {
23772
23771
  () => V(this, ol, oS).call(this, t, e, r, i),
23773
23772
  "joinRoom"
23774
23773
  );
23775
- } catch (d) {
23776
- return this.logger.error("Error in room joining process", { error: d }), this.context.getValue("peerSessionStore").emit(b.ROOM_NODE_FAILED), { roomJoined: !1, error: d };
23774
+ } catch (c) {
23775
+ return this.logger.error("Error in room joining process", { error: c }), this.context.getValue("peerSessionStore").emit(b.ROOM_NODE_FAILED), { roomJoined: !1, error: c };
23777
23776
  }
23778
23777
  });
23779
23778
  }
@@ -23787,8 +23786,8 @@ class ne {
23787
23786
  return a(this, kt) ? a(this, kt) : (S(this, kt, (() => u(this, null, function* () {
23788
23787
  try {
23789
23788
  yield V(this, fc, ju).call(this, t, e, r, i);
23790
- } catch (d) {
23791
- throw S(this, kt, null), d;
23789
+ } catch (c) {
23790
+ throw S(this, kt, null), c;
23792
23791
  }
23793
23792
  }))()), a(this, kt));
23794
23793
  });
@@ -23859,11 +23858,11 @@ class ne {
23859
23858
  }
23860
23859
  const i = V(this, gl, gS).call(this, t), n = va(this.context, "disableSimulcast"), o = (g = (h = this.context) == null ? void 0 : h.getValue("overrides")) == null ? void 0 : g.simulcastConfig;
23861
23860
  n || o && o.disable || !((v = (f = this.context) == null ? void 0 : f.getValue("theme")) != null && v.isSimulcastEnabled) ? this.logger.info("Simulcast disabled for webcam producer, SFU: CF") : (this.logger.info("Simulcast enabled for SFU: CF"), i.encodings = oM(this.context, t), this.logger.info(`Simulcast encodings: ${JSON.stringify(i.encodings)}`));
23862
- const c = () => {
23861
+ const d = () => {
23863
23862
  this.logger.info("Disabling video due to the producer closure"), a(this, tt).delete(e);
23864
23863
  }, l = a(this, q).createProducer(
23865
23864
  i,
23866
- c
23865
+ d
23867
23866
  );
23868
23867
  return V(this, $i, Ya).call(this, e, l.then((E) => E.id)), l.then((E) => E.track);
23869
23868
  });
@@ -23897,10 +23896,10 @@ class ne {
23897
23896
  i,
23898
23897
  n
23899
23898
  );
23900
- V(this, $i, Ya).call(this, Ce.SCREENSHARE_VIDEO, o.then((c) => c.id));
23901
- let d;
23899
+ V(this, $i, Ya).call(this, Ce.SCREENSHARE_VIDEO, o.then((d) => d.id));
23900
+ let c;
23902
23901
  if (r) {
23903
- const c = {
23902
+ const d = {
23904
23903
  track: r,
23905
23904
  codecOptions: [{ name: "opus" }],
23906
23905
  appData: {
@@ -23912,12 +23911,12 @@ class ne {
23912
23911
  zeroRtpOnPause: !1
23913
23912
  }, l = () => {
23914
23913
  };
23915
- d = a(this, q).createProducer(
23916
- c,
23914
+ c = a(this, q).createProducer(
23915
+ d,
23917
23916
  l
23918
- ), V(this, $i, Ya).call(this, Ce.SCREENSHARE_AUDIO, d.then((h) => h.id));
23917
+ ), V(this, $i, Ya).call(this, Ce.SCREENSHARE_AUDIO, c.then((h) => h.id));
23919
23918
  }
23920
- yield Promise.all([o, d || Promise.resolve()]), this.context.getValue("callstats").screenShareStart();
23919
+ yield Promise.all([o, c || Promise.resolve()]), this.context.getValue("callstats").screenShareStart();
23921
23920
  });
23922
23921
  }
23923
23922
  shareMic(t) {
@@ -23929,9 +23928,9 @@ class ne {
23929
23928
  if (e) {
23930
23929
  const o = yield e;
23931
23930
  if (a(this, q).producers.has(o)) {
23932
- const d = a(this, q).producers.get(o);
23933
- if (!d.closed) {
23934
- yield d.replaceTrack({ track: t }), yield this.resumeMic(), a(this, gt) && (a(this, gt).audioTrack = t, a(this, gt).producerId = o, a(this, gt).start());
23931
+ const c = a(this, q).producers.get(o);
23932
+ if (!c.closed) {
23933
+ yield c.replaceTrack({ track: t }), yield this.resumeMic(), a(this, gt) && (a(this, gt).audioTrack = t, a(this, gt).producerId = o, a(this, gt).start());
23935
23934
  return;
23936
23935
  }
23937
23936
  yield a(this, q).closeProducer(o, { stopTrack: !1 });
@@ -24189,23 +24188,23 @@ class ne {
24189
24188
  kind: i,
24190
24189
  pause: n,
24191
24190
  producerId: o,
24192
- screenShare: d
24191
+ screenShare: c
24193
24192
  }
24194
24193
  } = Lp.fromBinary(t);
24195
- if (d)
24194
+ if (c)
24196
24195
  return;
24197
- const c = i === tr.AUDIO ? "audio" : "video";
24196
+ const d = i === tr.AUDIO ? "audio" : "video";
24198
24197
  if (this.logger.info(
24199
- `producer toggle broadcast: ${e}, producerId: ${o}, kind:${c}, paused:${n} payload: ${JSON.stringify(Lp.fromBinary(t))}`
24198
+ `producer toggle broadcast: ${e}, producerId: ${o}, kind:${d}, paused:${n} payload: ${JSON.stringify(Lp.fromBinary(t))}`
24200
24199
  ), e === this.peerId && r !== this.peerId && n && this.context.getValue("peerSessionStore").emit(
24201
- c === "audio" ? b.MUTE_SELF : b.MUTE_SELF_VIDEO
24200
+ d === "audio" ? b.MUTE_SELF : b.MUTE_SELF_VIDEO
24202
24201
  ), e === this.peerId)
24203
24202
  return;
24204
24203
  this.context.getValue("peerSessionStore").emit(b.PRODUCER_TOGGLE, {
24205
24204
  peerId: e,
24206
24205
  producerId: o,
24207
24206
  paused: n,
24208
- kind: c
24207
+ kind: d
24209
24208
  }), Array.from(
24210
24209
  this.getConsumers().values()
24211
24210
  ).filter((h) => h.producerId === o).forEach((h) => {
@@ -24316,15 +24315,15 @@ pc = new WeakMap(), gc = new WeakMap(), et = new WeakMap(), q = new WeakMap(), a
24316
24315
  S(this, gc, t);
24317
24316
  let n = !1;
24318
24317
  if (r) {
24319
- const { recv: d, send: c } = (o = a(this, zs, ei).mediaState) != null ? o : {};
24320
- (c == null ? void 0 : c.state) === jr.CONNECTED && (d == null ? void 0 : d.state) === jr.CONNECTED ? (this.logger.info("MediaNodeClient.joinRoom: transports healthy — partial reset (producers only)"), yield a(this, q).closeAllProducersLocally(), a(this, tt).clear(), a(this, Ps).clear(), S(this, kt, null), n = !0) : (this.logger.info("MediaNodeClient.joinRoom: transports unhealthy — full reset"), this.reset({ resetTransportQueue: !1 }));
24318
+ const { recv: c, send: d } = (o = a(this, zs, ei).mediaState) != null ? o : {};
24319
+ (d == null ? void 0 : d.state) === jr.CONNECTED && (c == null ? void 0 : c.state) === jr.CONNECTED ? (this.logger.info("MediaNodeClient.joinRoom: transports healthy — partial reset (producers only)"), yield a(this, q).closeAllProducersLocally(), a(this, tt).clear(), a(this, Ps).clear(), S(this, kt, null), n = !0) : (this.logger.info("MediaNodeClient.joinRoom: transports unhealthy — full reset"), this.reset({ resetTransportQueue: !1 }));
24321
24320
  }
24322
24321
  try {
24323
24322
  a(this, kt) ? yield a(this, kt) : yield V(this, fc, ju).call(this, t, e, r, i, n), V(this, dl, dS).call(this, e);
24324
- const { joined: d, error: c } = yield V(this, cl, cS).call(this);
24325
- return { roomJoined: d, error: c };
24326
- } catch (d) {
24327
- return this.logger.error("Failed to complete room join", { error: d }), { roomJoined: !1, error: d };
24323
+ const { joined: c, error: d } = yield V(this, cl, cS).call(this);
24324
+ return { roomJoined: c, error: d };
24325
+ } catch (c) {
24326
+ return this.logger.error("Failed to complete room join", { error: c }), { roomJoined: !1, error: c };
24328
24327
  } finally {
24329
24328
  S(this, kt, null);
24330
24329
  }
@@ -24392,8 +24391,8 @@ pc = new WeakMap(), gc = new WeakMap(), et = new WeakMap(), q = new WeakMap(), a
24392
24391
  i,
24393
24392
  r
24394
24393
  );
24395
- } catch (d) {
24396
- throw this.logger.error("Failed to send joinRoom message after retries", { error: d }), d;
24394
+ } catch (c) {
24395
+ throw this.logger.error("Failed to send joinRoom message after retries", { error: c }), c;
24397
24396
  }
24398
24397
  }),
24399
24398
  {
@@ -24585,18 +24584,18 @@ const fS = (kg = class {
24585
24584
  }
24586
24585
  static init(s, t, e, r, i) {
24587
24586
  return u(this, null, function* () {
24588
- const n = St(), o = s.getValue("peerId"), d = !!s.getValue("cachedUserDetails"), c = yield We.__init__(
24587
+ const n = St(), o = s.getValue("peerId"), c = !!s.getValue("cachedUserDetails"), d = yield We.__init__(
24589
24588
  s,
24590
24589
  e,
24591
24590
  r,
24592
24591
  i,
24593
24592
  i.name,
24594
- d
24593
+ c
24595
24594
  );
24596
- s.setValue("self", c);
24595
+ s.setValue("self", d);
24597
24596
  const l = s.getValue("logger");
24598
24597
  return navigator.product !== "ReactNative" ? setTimeout(() => u(this, null, function* () {
24599
- const g = yield c.getAllDevices();
24598
+ const g = yield d.getAllDevices();
24600
24599
  l.info("populated_full_device_list", {
24601
24600
  devices: JSON.stringify(g)
24602
24601
  }), s.getValue("callstats").devices("AUDIO", g == null ? void 0 : g.filter((f) => f.kind === "audioinput")), s.getValue("callstats").devices("VIDEO", g == null ? void 0 : g.filter((f) => f.kind === "videoinput")), s.getValue("callstats").devices("SPEAKER", g == null ? void 0 : g.filter((f) => f.kind === "audiooutput")), l.info("Callstats:: initializing");
@@ -24625,12 +24624,12 @@ const fS = (kg = class {
24625
24624
  } catch (f) {
24626
24625
  l.error("Callstats:: initialization failed", { error: f });
24627
24626
  }
24628
- }), 0) : l.info("Callstats:: Skipped initialization due to navigator product being ReactNative."), new fS(s, c, t, i.viewType);
24627
+ }), 0) : l.info("Callstats:: Skipped initialization due to navigator product being ReactNative."), new fS(s, d, t, i.viewType);
24629
24628
  });
24630
24629
  }
24631
24630
  shareMediaTracks() {
24632
24631
  return u(this, null, function* () {
24633
- var d;
24632
+ var c;
24634
24633
  const {
24635
24634
  audioTrack: s,
24636
24635
  videoTrack: t,
@@ -24644,7 +24643,7 @@ const fS = (kg = class {
24644
24643
  if ((s == null ? void 0 : s.readyState) === "live")
24645
24644
  try {
24646
24645
  yield a(this, mt, Vt).shareMic(s), this.self.audioEnabled || a(this, mt, Vt).pauseMic();
24647
- } catch (c) {
24646
+ } catch (d) {
24648
24647
  this.self.disableAudio();
24649
24648
  }
24650
24649
  else
@@ -24653,17 +24652,17 @@ const fS = (kg = class {
24653
24652
  if ((t == null ? void 0 : t.readyState) === "live")
24654
24653
  try {
24655
24654
  yield a(this, mt, Vt).shareWebcam(t), this.self.videoEnabled || a(this, mt, Vt).pauseWebcam();
24656
- } catch (c) {
24655
+ } catch (d) {
24657
24656
  this.self.disableVideo();
24658
24657
  }
24659
24658
  else
24660
24659
  this.logger.warn("shareMediaTracks: video track is dead, disabling video"), this.self.disableVideo();
24661
24660
  if (e.canProduceScreenshare === W.Allowed && n) {
24662
- const c = o.video, l = o.audio;
24663
- if ((c == null ? void 0 : c.readyState) === "live")
24661
+ const d = o.video, l = o.audio;
24662
+ if ((d == null ? void 0 : d.readyState) === "live")
24664
24663
  try {
24665
- yield (d = a(this, mt, Vt)) == null ? void 0 : d.shareScreen({
24666
- video: c,
24664
+ yield (c = a(this, mt, Vt)) == null ? void 0 : c.shareScreen({
24665
+ video: d,
24667
24666
  audio: (l == null ? void 0 : l.readyState) === "live" ? l : void 0
24668
24667
  });
24669
24668
  } catch (h) {
@@ -24821,21 +24820,21 @@ const fS = (kg = class {
24821
24820
  peerId: t
24822
24821
  });
24823
24822
  }
24824
- const { canProduceAudio: d, canProduceVideo: c, canProduceScreenshare: l } = this.self.permissions, { roomJoined: h, error: g } = (o = yield (n = a(this, mt, Vt)) == null ? void 0 : n.joinRoom(
24823
+ const { canProduceAudio: c, canProduceVideo: d, canProduceScreenshare: l } = this.self.permissions, { roomJoined: h, error: g } = (o = yield (n = a(this, mt, Vt)) == null ? void 0 : n.joinRoom(
24825
24824
  this.self.name,
24826
24825
  r,
24827
24826
  s,
24828
24827
  {
24829
- canProduceAudio: d,
24830
- canProduceVideo: c,
24828
+ canProduceAudio: c,
24829
+ canProduceVideo: d,
24831
24830
  canProduceScreenshare: l
24832
24831
  }
24833
24832
  )) != null ? o : {};
24834
24833
  if (!h)
24835
24834
  throw g != null ? g : new Error("Could not connect to media server");
24836
24835
  this.logger.info(i === "ON_STAGE" ? "Peer is on stage. Sharing media tracks" : "Peer is not on stage. Not sharing media tracks"), i === "ON_STAGE" && (yield this.shareMediaTracks()), this.logger.info(i === "ON_STAGE" ? "Peer is on stage. Shared media tracks" : "Peer is not on stage. Did not share media tracks"), this.self.roomState = "joined", this.self.emit("roomJoined", { reconnected: s });
24837
- } catch (d) {
24838
- throw this.logger.error("SelfController.mediaRoomJoin", { error: d }), d;
24836
+ } catch (c) {
24837
+ throw this.logger.error("SelfController.mediaRoomJoin", { error: c }), c;
24839
24838
  }
24840
24839
  });
24841
24840
  }
@@ -24924,9 +24923,9 @@ class wD {
24924
24923
  let o = i;
24925
24924
  try {
24926
24925
  o = r(n);
24927
- } catch (d) {
24926
+ } catch (c) {
24928
24927
  this.logger.error("aiSocketHandler::on::binary_decode_error", {
24929
- error: d
24928
+ error: c
24930
24929
  });
24931
24930
  }
24932
24931
  return e(o);
@@ -24998,9 +24997,9 @@ class Dl {
24998
24997
  let o = i;
24999
24998
  try {
25000
24999
  o = r(n);
25001
- } catch (d) {
25000
+ } catch (c) {
25002
25001
  this.logger.error("pollSocketHandler::on::binary_decode_error", {
25003
- error: d
25002
+ error: c
25004
25003
  });
25005
25004
  }
25006
25005
  return e(o);
@@ -25075,8 +25074,8 @@ class SS {
25075
25074
  try {
25076
25075
  const { peer: n } = tn.fromBinary((yield r).payload);
25077
25076
  a(this, At).getValue("connectionHandler").socketJoined = !0, a(this, At).getValue("peerSessionStore").emit(b.SOCKET_SERVICE_ROOM_JOINED, { peer: n });
25078
- const o = this.getRoomState(), d = this.getRoomPeersNonPaginated(), [{ room: c }, { peers: l }] = yield Promise.all([o, d]);
25079
- return a(this, At).getValue("peerSessionStore").emit(b.ROOM_STATE, c), a(this, At).getValue("peerSessionStore").emit(b.SOCKET_PEERS, l), { peer: n };
25077
+ const o = this.getRoomState(), c = this.getRoomPeersNonPaginated(), [{ room: d }, { peers: l }] = yield Promise.all([o, c]);
25078
+ return a(this, At).getValue("peerSessionStore").emit(b.ROOM_STATE, d), a(this, At).getValue("peerSessionStore").emit(b.SOCKET_PEERS, l), { peer: n };
25080
25079
  } catch (n) {
25081
25080
  throw this.logger.error("RoomSocketHandler.joinRoom.failed", {
25082
25081
  error: n
@@ -25393,9 +25392,9 @@ class SS {
25393
25392
  return e(void 0);
25394
25393
  try {
25395
25394
  o = r(n);
25396
- } catch (d) {
25395
+ } catch (c) {
25397
25396
  this.logger.error("roomSocketHandler::on::binary_decode_error", {
25398
- error: d
25397
+ error: c
25399
25398
  });
25400
25399
  }
25401
25400
  return e(o);
@@ -25688,13 +25687,13 @@ de.prototype.emit = function(s) {
25688
25687
  var o = new Error("Unhandled error." + (n ? " (" + n.message + ")" : ""));
25689
25688
  throw o.context = n, o;
25690
25689
  }
25691
- var d = i[s];
25692
- if (d === void 0)
25690
+ var c = i[s];
25691
+ if (c === void 0)
25693
25692
  return !1;
25694
- if (typeof d == "function")
25695
- ng(d, this, t);
25693
+ if (typeof c == "function")
25694
+ ng(c, this, t);
25696
25695
  else
25697
- for (var c = d.length, l = CS(d, c), e = 0; e < c; ++e)
25696
+ for (var d = c.length, l = CS(c, d), e = 0; e < d; ++e)
25698
25697
  ng(l[e], this, t);
25699
25698
  return !0;
25700
25699
  };
@@ -25708,8 +25707,8 @@ function yS(s, t, e, r) {
25708
25707
  o = n[t] = e, ++s._eventsCount;
25709
25708
  else if (typeof o == "function" ? o = n[t] = r ? [e, o] : [o, e] : r ? o.unshift(e) : o.push(e), i = TS(s), i > 0 && o.length > i && !o.warned) {
25710
25709
  o.warned = !0;
25711
- var d = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
25712
- d.name = "MaxListenersExceededWarning", d.emitter = s, d.type = t, d.count = o.length, xD(d);
25710
+ var c = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
25711
+ c.name = "MaxListenersExceededWarning", c.emitter = s, c.type = t, c.count = o.length, xD(c);
25713
25712
  }
25714
25713
  return s;
25715
25714
  }
@@ -25951,8 +25950,8 @@ class JD {
25951
25950
  constructor(t, e) {
25952
25951
  var E, _, w, R, D, U, B, F, H, X, Le, yt;
25953
25952
  ae(this, Gu), ae(this, Qa), ae(this, Wu), ae(this, id), ae(this, vd), ae(this, Ku), ae(this, so), ae(this, mn), ae(this, Td), ae(this, fn), ae(this, Yu), ae(this, no), ae(this, ao), ae(this, ke, void 0), ae(this, nn, void 0), ae(this, oe, void 0), ae(this, Ee, void 0), ae(this, fr, void 0), ae(this, Ge, void 0), ae(this, Xs, void 0), ae(this, Br, void 0), ae(this, ds, void 0), ae(this, an, void 0), ae(this, on, void 0), ae(this, As, void 0);
25954
- var r, i, n, o, d, c, l, h, g, f, v;
25955
- se(this, nn, t), se(this, fr, []), se(this, Ge, new Sd()), se(this, Xs, !0), se(this, ds, !1), se(this, oe, e != null ? e : {}), (E = (r = M(this, oe)).autoReconnect) != null || (r.autoReconnect = !0), (_ = (i = M(this, oe)).retryConnectionInterval) != null || (i.retryConnectionInterval = 1e3), (w = (n = M(this, oe)).pingTimeout) != null || (n.pingTimeout = 3e4), (R = (o = M(this, oe)).connectionTimeout) != null || (o.connectionTimeout = 5e3), (D = (d = M(this, oe)).debug) != null || (d.debug = !0), (U = (c = M(this, oe)).maxReconnectionAttempts) != null || (c.maxReconnectionAttempts = 10), (B = (l = M(this, oe)).disconnectOnPingTimeout) != null || (l.disconnectOnPingTimeout = !0), (F = (h = M(this, oe)).queueOnDisconnect) != null || (h.queueOnDisconnect = !1), (H = (g = M(this, oe)).flushOnReconnect) != null || (g.flushOnReconnect = !1), (X = (f = M(this, oe)).clientInitiatedPings) != null || (f.clientInitiatedPings = !1), (Le = (v = M(this, oe)).clientInitiatedPingInterval) != null || (v.clientInitiatedPingInterval = 3e4), se(this, Br, {
25953
+ var r, i, n, o, c, d, l, h, g, f, v;
25954
+ se(this, nn, t), se(this, fr, []), se(this, Ge, new Sd()), se(this, Xs, !0), se(this, ds, !1), se(this, oe, e != null ? e : {}), (E = (r = M(this, oe)).autoReconnect) != null || (r.autoReconnect = !0), (_ = (i = M(this, oe)).retryConnectionInterval) != null || (i.retryConnectionInterval = 1e3), (w = (n = M(this, oe)).pingTimeout) != null || (n.pingTimeout = 3e4), (R = (o = M(this, oe)).connectionTimeout) != null || (o.connectionTimeout = 5e3), (D = (c = M(this, oe)).debug) != null || (c.debug = !0), (U = (d = M(this, oe)).maxReconnectionAttempts) != null || (d.maxReconnectionAttempts = 10), (B = (l = M(this, oe)).disconnectOnPingTimeout) != null || (l.disconnectOnPingTimeout = !0), (F = (h = M(this, oe)).queueOnDisconnect) != null || (h.queueOnDisconnect = !1), (H = (g = M(this, oe)).flushOnReconnect) != null || (g.flushOnReconnect = !1), (X = (f = M(this, oe)).clientInitiatedPings) != null || (f.clientInitiatedPings = !1), (Le = (v = M(this, oe)).clientInitiatedPingInterval) != null || (v.clientInitiatedPingInterval = 3e4), se(this, Br, {
25956
25955
  code: void 0,
25957
25956
  reason: void 0
25958
25957
  }), se(this, Ee, (yt = M(this, oe).logger) != null ? yt : new WD(M(this, oe).debug ? "debug" : "info")), se(this, As, new GD());
@@ -26033,8 +26032,8 @@ class JD {
26033
26032
  }, M(this, ke).onclose = (n) => {
26034
26033
  try {
26035
26034
  i && clearTimeout(i);
26036
- const { code: o, reason: d } = n;
26037
- r(d), M(this, Ee).debug("Socket closed. Close event:", { event: n }), M(this, Ee).debug(`Connection closed code: ${o}`), M(this, Ee).debug(`Connection closed reason: ${d}`), M(this, ds) || re(this, vd, Ju).call(this, o, d);
26035
+ const { code: o, reason: c } = n;
26036
+ r(c), M(this, Ee).debug("Socket closed. Close event:", { event: n }), M(this, Ee).debug(`Connection closed code: ${o}`), M(this, Ee).debug(`Connection closed reason: ${c}`), M(this, ds) || re(this, vd, Ju).call(this, o, c);
26038
26037
  } catch (o) {
26039
26038
  re(this, Qa, rd).call(this, o);
26040
26039
  }
@@ -26353,8 +26352,8 @@ const DS = (Ag = class {
26353
26352
  }) {
26354
26353
  const n = i != null ? i : s;
26355
26354
  return new Promise(
26356
- (o, d) => {
26357
- const c = (E, _) => {
26355
+ (o, c) => {
26356
+ const d = (E, _) => {
26358
26357
  a(this, Te).removeListener(n, E), a(this, Te).removeListener(lg, _), a(this, Te).removeListener(
26359
26358
  Sr.errorResponse,
26360
26359
  _
@@ -26382,16 +26381,16 @@ const DS = (Ag = class {
26382
26381
  w = new Error("failed to parse error message", { cause: D });
26383
26382
  }
26384
26383
  }
26385
- d(w), c(v, f);
26384
+ c(w), d(v, f);
26386
26385
  }
26387
26386
  }, v = ({
26388
26387
  id: E,
26389
26388
  payload: _
26390
26389
  }) => {
26391
- l === E && (o({ id: E, payload: _ }), c(v, f));
26390
+ l === E && (o({ id: E, payload: _ }), d(v, f));
26392
26391
  };
26393
26392
  a(this, Te).on(n, v), a(this, Te).on(lg, f), a(this, Te).on(Sr.errorResponse, f), a(this, Te).on(ls.errorResponse, f), setTimeout(() => {
26394
- c(v, f), d(new Error(`request timeout for callback eventId:${s}`));
26393
+ d(v, f), c(new Error(`request timeout for callback eventId:${s}`));
26395
26394
  }, t), a(this, Te).send(
26396
26395
  s,
26397
26396
  l,
@@ -26469,13 +26468,13 @@ const DS = (Ag = class {
26469
26468
  useMediaV2: !0
26470
26469
  }, n !== s && { oldPeerID: n }), {
26471
26470
  ping: this.capabilities.includes("PING"),
26472
- capabilities: this.capabilities.map((d) => pd[d]).join(" "),
26471
+ capabilities: this.capabilities.map((c) => pd[c]).join(" "),
26473
26472
  joinWithDetails: !0,
26474
26473
  useCfWorker: !0,
26475
26474
  useStartSession: !0
26476
26475
  });
26477
- return Object.entries(o).forEach(([d, c]) => {
26478
- i.searchParams.append(d, c.toString());
26476
+ return Object.entries(o).forEach(([c, d]) => {
26477
+ i.searchParams.append(c, d.toString());
26479
26478
  }), i.href;
26480
26479
  }, Ec = new WeakSet(), Xu = function() {
26481
26480
  return `${this.peerId}-${(Math.random() + 1).toString(36).substring(7)}`;
@@ -26502,11 +26501,11 @@ class QD {
26502
26501
  handleConnectedRoomsDumpRaw({ payload: t }) {
26503
26502
  var n;
26504
26503
  const e = jb.fromBinary(t), r = e.meetings.map((o) => {
26505
- var d;
26504
+ var c;
26506
26505
  return {
26507
26506
  id: o.id,
26508
26507
  title: o.title,
26509
- participants: (d = o.participants) != null ? d : []
26508
+ participants: (c = o.participants) != null ? c : []
26510
26509
  };
26511
26510
  });
26512
26511
  return {
@@ -26623,7 +26622,7 @@ class OS extends Ot {
26623
26622
  }
26624
26623
  /** @access private */
26625
26624
  validateMoveAction(e, r) {
26626
- var c;
26625
+ var d;
26627
26626
  if (!(r != null && r.length))
26628
26627
  throw new Error("You're trying to move participants with an empty list.");
26629
26628
  const i = a(this, It).getValue("self").permissions.connectedMeetings;
@@ -26638,7 +26637,7 @@ class OS extends Ot {
26638
26637
  throw new Error(
26639
26638
  "You are not allowed to move other participants. Please enable canAlterConnectedMeetings permission in your preset."
26640
26639
  );
26641
- if (e === ((c = this.parentMeeting) == null ? void 0 : c.id)) {
26640
+ if (e === ((d = this.parentMeeting) == null ? void 0 : d.id)) {
26642
26641
  if (!i.canSwitchToParentMeeting)
26643
26642
  throw new Error(
26644
26643
  "You are not allowed to move to the parent meeting. Please enable canSwitchToParentMeeting permission in your preset."
@@ -26756,19 +26755,19 @@ class OS extends Ot {
26756
26755
  (o) => !i.includes(o.id)
26757
26756
  )), this.meetings = this.meetings.map((o) => {
26758
26757
  if (r === o.id) {
26759
- const d = o.participants.concat(
26760
- i.map((c) => n.get(c))
26758
+ const c = o.participants.concat(
26759
+ i.map((d) => n.get(d))
26761
26760
  );
26762
26761
  return j(N({}, o), {
26763
- participants: d
26762
+ participants: c
26764
26763
  });
26765
26764
  }
26766
26765
  if (e === o.id) {
26767
- const d = o.participants.filter(
26768
- (c) => !i.includes(c.id)
26766
+ const c = o.participants.filter(
26767
+ (d) => !i.includes(d.id)
26769
26768
  );
26770
26769
  return j(N({}, o), {
26771
- participants: d
26770
+ participants: c
26772
26771
  });
26773
26772
  }
26774
26773
  return o;
@@ -26845,7 +26844,7 @@ const NS = (Ig = class {
26845
26844
  authToken: s,
26846
26845
  meetingId: t
26847
26846
  }) {
26848
- var n, o, d, c;
26847
+ var n, o, c, d;
26849
26848
  this.logger.info("ConnectedMeetingsController::switchMeeting:: asking ui-kit to show switching breakout UI"), this.connectedMeetings.emit("changingMeeting", t);
26850
26849
  const r = {
26851
26850
  video: a(this, pe).getValue("self").videoEnabled,
@@ -26874,14 +26873,14 @@ const NS = (Ig = class {
26874
26873
  }),
26875
26874
  authToken: s
26876
26875
  }));
26877
- this.logger.info(`ConnectedMeetingsController::switchMeeting:: initialized new meeting. Meeting Id: ${(d = i == null ? void 0 : i.meta) == null ? void 0 : d.meetingId}`);
26876
+ this.logger.info(`ConnectedMeetingsController::switchMeeting:: initialized new meeting. Meeting Id: ${(c = i == null ? void 0 : i.meta) == null ? void 0 : c.meetingId}`);
26878
26877
  try {
26879
26878
  const { hidden: l } = a(this, pe).getValue("self");
26880
26879
  i.self.setName(a(this, pe).getValue("self").name), yield i.join(), l && i.self.hide();
26881
26880
  } catch (l) {
26882
26881
  this.logger.error("ConnectedMeetingsController.joinRoom", { error: l });
26883
26882
  }
26884
- return this.logger.info(`ConnectedMeetingsController::switchMeeting:: asking ui-kit to show in-meeting ui of newly joined meeting id: ${(c = i == null ? void 0 : i.meta) == null ? void 0 : c.meetingId}`), this.connectedMeetings.emit("meetingChanged", i), i;
26883
+ return this.logger.info(`ConnectedMeetingsController::switchMeeting:: asking ui-kit to show in-meeting ui of newly joined meeting id: ${(d = i == null ? void 0 : i.meta) == null ? void 0 : d.meetingId}`), this.connectedMeetings.emit("meetingChanged", i), i;
26885
26884
  });
26886
26885
  }
26887
26886
  handleConnectedRoomsDump(s) {
@@ -26973,11 +26972,11 @@ const Xa = class {
26973
26972
  meetingId: i,
26974
26973
  organizationId: n,
26975
26974
  cachedUserDetails: o,
26976
- logger: d
26975
+ logger: c
26977
26976
  } = s.getAllValues();
26978
26977
  if (ED(s), Se.isSupported() === !1)
26979
- throw new k("Browser not supported", "0010", d, !0);
26980
- const c = u0(
26978
+ throw new k("Browser not supported", "0010", c, !0);
26979
+ const d = u0(
26981
26980
  s,
26982
26981
  {
26983
26982
  authToken: r,
@@ -26985,24 +26984,24 @@ const Xa = class {
26985
26984
  cachedUserDetails: o
26986
26985
  }
26987
26986
  );
26988
- c.setRoomName(i), c.setRoomUUID(i), c.setOrganizationId(n), c.setHeader("tracing-id", t), s.setValue("apiClient", c);
26987
+ d.setRoomName(i), d.setRoomUUID(i), d.setOrganizationId(n), d.setHeader("tracing-id", t), s.setValue("apiClient", d);
26989
26988
  const l = new J0(s);
26990
26989
  s.setValue("connectionHandler", l);
26991
26990
  let h = "", g = "", f = null;
26992
- d.info("CF SFU is being used.");
26991
+ c.info("CF SFU is being used.");
26993
26992
  try {
26994
- f = yield c.getUserDetails(), h = ((U = f.meeting) == null ? void 0 : U.title) || "", g = ((B = f.socket) == null ? void 0 : B.baseUri) || s.getValue("baseURI"), s.setValue("presetName", f.preset.name), s.setValue("socketBaseURI", g), d.info(`Socket Base URI ${g} is being used`);
26993
+ f = yield d.getUserDetails(), h = ((U = f.meeting) == null ? void 0 : U.title) || "", g = ((B = f.socket) == null ? void 0 : B.baseUri) || s.getValue("baseURI"), s.setValue("presetName", f.preset.name), s.setValue("socketBaseURI", g), c.info(`Socket Base URI ${g} is being used`);
26995
26994
  } catch (H) {
26996
- throw d.error("Failed to get user details", { error: H }), H instanceof vu ? H.status === 401 ? new k("Unauthorized. The auth token may be invalid or expired. (401)", "0004") : H.status === 403 ? new k("Access denied. Insufficient permissions to join the meeting. (403)", "0004") : H.status === 404 ? new k(
26995
+ throw c.error("Failed to get user details", { error: H }), H instanceof vu ? H.status === 401 ? new k("Unauthorized. The auth token may be invalid or expired. (401)", "0004") : H.status === 403 ? new k("Access denied. Insufficient permissions to join the meeting. (403)", "0004") : H.status === 404 ? (c.error("[ERROR:0004] participant-details returned 404."), new k(
26997
26996
  "The auth token is not associated with an active participant in this meeting. The meeting may have ended, or the participant may no longer exist. (404)",
26998
26997
  "0004"
26999
- ) : H.status >= 500 ? new k(`The server encountered an error. Try again. (${H.status})`, "0001") : H.isHttpError ? new k(`Request rejected by the server. (${H.status})`, "0001") : H.isTimeout ? new k("Connection timed out. Check the network and try again.", "0001") : new k("Unable to connect to the server. Check the internet connection.", "0001") : new k((H == null ? void 0 : H.message) || "Failed to initialize.", "0001");
26998
+ )) : H.status >= 500 ? new k(`The server encountered an error. Try again. (${H.status})`, "0001") : H.isHttpError ? new k(`Request rejected by the server. (${H.status})`, "0001") : H.isTimeout ? new k("Connection timed out. Check the network and try again.", "0001") : new k("Unable to connect to the server. Check the internet connection.", "0001") : new k((H == null ? void 0 : H.message) || "Failed to initialize.", "0001");
27000
26999
  }
27001
27000
  const v = Xa.createSocketService(s), E = v.connect();
27002
27001
  try {
27003
27002
  yield E;
27004
27003
  } catch (H) {
27005
- d.error(
27004
+ c.error(
27006
27005
  "[Controller]: Failed to connect to socket server:",
27007
27006
  { error: H }
27008
27007
  );
@@ -27027,7 +27026,7 @@ const Xa = class {
27027
27026
  !1,
27028
27027
  w
27029
27028
  )) == null || F.catch((X) => {
27030
- d.error(
27029
+ c.error(
27031
27030
  "[Controller]: Failed to queue partial media room promise:",
27032
27031
  { error: X }
27033
27032
  );
@@ -27039,7 +27038,7 @@ const Xa = class {
27039
27038
  static setupControllers(s, t, e, r, i, n) {
27040
27039
  return u(this, null, function* () {
27041
27040
  var Pe, L, A;
27042
- const o = t.getValue("modules"), { participant: d } = e, c = t.getValue("defaults"), l = t.getValue("logger"), { viewType: h, mediaConstraints: { audio: g } } = i;
27041
+ const o = t.getValue("modules"), { participant: c } = e, d = t.getValue("defaults"), l = t.getValue("logger"), { viewType: h, mediaConstraints: { audio: g } } = i;
27043
27042
  t.setValue("viewType", h), t.setValue("defaults", N({
27044
27043
  mediaConfiguration: {
27045
27044
  audio: {
@@ -27047,7 +27046,7 @@ const Xa = class {
27047
27046
  enableStereo: (L = g.enableStereo) != null ? L : !1
27048
27047
  }
27049
27048
  }
27050
- }, c)), t.setValue("maxPreferredStreams", Se.isMobile() ? i.maxVideoStreams.mobile : i.maxVideoStreams.desktop);
27049
+ }, d)), t.setValue("maxPreferredStreams", Se.isMobile() ? i.maxVideoStreams.mobile : i.maxVideoStreams.desktop);
27051
27050
  let f, v, E, _, w, R, D, U, B;
27052
27051
  const F = new wD(t, s), H = new QD(
27053
27052
  s
@@ -27056,7 +27055,7 @@ const Xa = class {
27056
27055
  const X = new Dl(t, s), Le = new or(t, s), yt = new MD(s), Qt = new SS(t, s), Yr = new DD(t, s), I = new CD(s), y = yield zr.init(
27057
27056
  t,
27058
27057
  Qt,
27059
- d,
27058
+ c,
27060
27059
  n,
27061
27060
  i
27062
27061
  );
@@ -27103,7 +27102,7 @@ const Xa = class {
27103
27102
  "The plugin module cannot be initialized without the `participant` module",
27104
27103
  "0102"
27105
27104
  );
27106
- const Ae = c.plugins || [];
27105
+ const Ae = d.plugins || [];
27107
27106
  _ = yield wf.init(
27108
27107
  t,
27109
27108
  Ae,
@@ -27147,12 +27146,12 @@ const Xa = class {
27147
27146
  });
27148
27147
  }
27149
27148
  static createSocketService(s) {
27150
- var c;
27149
+ var d;
27151
27150
  const {
27152
27151
  peerId: t,
27153
27152
  meetingId: e,
27154
27153
  authToken: r
27155
- } = s.getAllValues(), o = ((c = s.getValue("socketBaseURI")) != null ? c : "").includes("realtime.cloudflare.com") ? [] : ["PING"];
27154
+ } = s.getAllValues(), o = ((d = s.getValue("socketBaseURI")) != null ? d : "").includes("realtime.cloudflare.com") ? [] : ["PING"];
27156
27155
  return s.getValue("logger").info(`Socket service capabilities: ${JSON.stringify(o)}`), new Dc(s, {
27157
27156
  peerId: t,
27158
27157
  meetingId: e,
@@ -27306,13 +27305,13 @@ let Gr = (Mg = class {
27306
27305
  */
27307
27306
  static initMedia() {
27308
27307
  return u(this, arguments, function* (t = {}, e = !1, r = void 0) {
27309
- var c;
27310
- const i = (c = r == null ? void 0 : r.peerId) != null ? c : ga(), n = Fr.createContext(i, {
27308
+ var d;
27309
+ const i = (d = r == null ? void 0 : r.peerId) != null ? d : ga(), n = Fr.createContext(i, {
27311
27310
  peerId: i
27312
27311
  }), o = n.getValue("logger");
27313
27312
  o.init(n);
27314
- const d = new $f(n, o);
27315
- return yield d.init(t, e, n), n.setValue("defaults", { mediaHandler: d }), d;
27313
+ const c = new $f(n, o);
27314
+ return yield c.init(t, e, n), n.setValue("defaults", { mediaHandler: c }), c;
27316
27315
  });
27317
27316
  }
27318
27317
  static init(t) {
@@ -27323,14 +27322,14 @@ let Gr = (Mg = class {
27323
27322
  if ((_ = o.baseURI) != null && _.includes("dyte.io"))
27324
27323
  throw new k("Dyte Base URIs are no longer supported. Use RealtimeKit Base URIs.", "0001");
27325
27324
  window.__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = !0;
27326
- const d = Gr.setupContext(
27325
+ const c = Gr.setupContext(
27327
27326
  e,
27328
27327
  t,
27329
27328
  n,
27330
27329
  o
27331
- ), c = d.getValue("telemetry"), l = d.getValue("logger");
27332
- jS(l), ug.init(l), c.init(
27333
- d,
27330
+ ), d = c.getValue("telemetry"), l = c.getValue("logger");
27331
+ jS(l), ug.init(l), d.init(
27332
+ c,
27334
27333
  {
27335
27334
  roomName: n,
27336
27335
  userId: o.participantId,
@@ -27339,14 +27338,14 @@ let Gr = (Mg = class {
27339
27338
  },
27340
27339
  (R = (w = t.modules) == null ? void 0 : w.tracing) != null ? R : !0,
27341
27340
  (U = (D = t == null ? void 0 : t.modules) == null ? void 0 : D.devTools) == null ? void 0 : U.logLevel
27342
- ), l.init(d), l.info("Client::init::options", {
27341
+ ), l.init(c), l.info("Client::init::options", {
27343
27342
  clientInitOptions: j(N({}, t), {
27344
27343
  authToken: `${(B = t.authToken) == null ? void 0 : B.slice(0, 10)}...
27345
27344
  ${(F = t.authToken) == null ? void 0 : F.slice(-10)}`
27346
27345
  })
27347
27346
  });
27348
- const h = yield Vl.init(d), g = new Gr(d, h);
27349
- return d.setValue("meeting", g), g;
27347
+ const h = yield Vl.init(c), g = new Gr(c, h);
27348
+ return c.setValue("meeting", g), g;
27350
27349
  });
27351
27350
  }
27352
27351
  /**
@@ -27357,13 +27356,13 @@ let Gr = (Mg = class {
27357
27356
  * @param {any} args
27358
27357
  */
27359
27358
  static setupContext(t, e, r, i) {
27360
- var c, l;
27361
- const n = Fr.createContext(t, e), o = N(N({}, kC), e == null ? void 0 : e.modules), d = e.defaults || {
27359
+ var d, l;
27360
+ const n = Fr.createContext(t, e), o = N(N({}, kC), e == null ? void 0 : e.modules), c = e.defaults || {
27362
27361
  audio: !0,
27363
27362
  video: !0
27364
27363
  };
27365
- return n.setValue("options", e), n.setValue("peerId", t), n.setValue("modules", o), n.setValue("sdkName", "web-core"), n.setValue("meetingId", r), n.setValue("apiBase", i.apiBase), n.setValue("baseURI", i.baseURI), n.setValue("userId", i.participantId), n.setValue("organizationId", i.orgId), n.setValue("authToken", e.authToken), n.setValue("overrides", (c = e.overrides) != null ? c : {}), n.setValue("env", AC({ baseURI: i.baseURI })), n.setValue("defaults", d), n.setValue("onError", e.onError || (() => {
27366
- })), n.setValue("cachedUserDetails", _s(e.cachedUserDetails)), n.setValue("sdkVersion", "2.0.2-staging.1"), (l = e.modules) != null && l.experimentalAudioPlayback && n.setValue("audioPlayback", new cO()), n;
27364
+ return n.setValue("options", e), n.setValue("peerId", t), n.setValue("modules", o), n.setValue("sdkName", "web-core"), n.setValue("meetingId", r), n.setValue("apiBase", i.apiBase), n.setValue("baseURI", i.baseURI), n.setValue("userId", i.participantId), n.setValue("organizationId", i.orgId), n.setValue("authToken", e.authToken), n.setValue("overrides", (d = e.overrides) != null ? d : {}), n.setValue("env", AC({ baseURI: i.baseURI })), n.setValue("defaults", c), n.setValue("onError", e.onError || (() => {
27365
+ })), n.setValue("cachedUserDetails", _s(e.cachedUserDetails)), n.setValue("sdkVersion", "2.0.2-staging.3"), (l = e.modules) != null && l.experimentalAudioPlayback && n.setValue("audioPlayback", new cO()), n;
27367
27366
  }
27368
27367
  join() {
27369
27368
  return u(this, null, function* () {