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

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.es5.js CHANGED
@@ -23431,10 +23431,22 @@ var Vl = /* @__PURE__ */ E("context"), Gt = /* @__PURE__ */ E("logger"), MM = /*
23431
23431
  }).at(-1).msid;
23432
23432
  return i;
23433
23433
  } }]);
23434
- }(), yn = /* @__PURE__ */ E("producers"), Tn = /* @__PURE__ */ E("consumers"), os = /* @__PURE__ */ E("producerIdToConsumerIdMap"), yu = /* @__PURE__ */ E("producerStrategy"), hr = /* @__PURE__ */ E("consumerStrategy"), $l = /* @__PURE__ */ E("metrics"), Hr = /* @__PURE__ */ E("producersToConsume"), ys = /* @__PURE__ */ E("processConsumerTimeout"), ku = /* @__PURE__ */ E("processConsumers"), Ul = /* @__PURE__ */ E("producerCreationRequest"), jl = /* @__PURE__ */ E("handleProducer"), Ld = /* @__PURE__ */ E("consumerCreationRequest"), Nd = /* @__PURE__ */ E("handleConsumer"), DM = /* @__PURE__ */ function(s) {
23434
+ }();
23435
+ function DM(s) {
23436
+ try {
23437
+ var r = JSON.parse(s.message);
23438
+ if (me(r) !== "object" || r === null)
23439
+ return {};
23440
+ var e = r.errorCode, t = r.errorDescription;
23441
+ return N(N({}, typeof e == "string" && { errorCode: e }), typeof t == "string" && { errorDescription: t });
23442
+ } catch (n) {
23443
+ return {};
23444
+ }
23445
+ }
23446
+ var yn = /* @__PURE__ */ E("producers"), Tn = /* @__PURE__ */ E("consumers"), os = /* @__PURE__ */ E("producerIdToConsumerIdMap"), yu = /* @__PURE__ */ E("producerStrategy"), hr = /* @__PURE__ */ E("consumerStrategy"), $l = /* @__PURE__ */ E("metrics"), Hr = /* @__PURE__ */ E("producersToConsume"), ys = /* @__PURE__ */ E("processConsumerTimeout"), ku = /* @__PURE__ */ E("processConsumers"), Ul = /* @__PURE__ */ E("producerCreationRequest"), jl = /* @__PURE__ */ E("handleProducer"), Ld = /* @__PURE__ */ E("consumerCreationRequest"), Nd = /* @__PURE__ */ E("handleConsumer"), LM = /* @__PURE__ */ function(s) {
23435
23447
  function r(e, t) {
23436
23448
  var n;
23437
- return b(this, r), n = C(this, r, [e, t]), Object.defineProperty(n, Nd, { value: UM }), Object.defineProperty(n, Ld, { value: $M }), Object.defineProperty(n, jl, { value: VM }), Object.defineProperty(n, Ul, { value: NM }), Object.defineProperty(n, ku, { value: LM }), Object.defineProperty(n, yn, { writable: !0, value: void 0 }), Object.defineProperty(n, Tn, { writable: !0, value: void 0 }), Object.defineProperty(n, os, { writable: !0, value: void 0 }), Object.defineProperty(n, yu, { writable: !0, value: void 0 }), Object.defineProperty(n, hr, { writable: !0, value: void 0 }), Object.defineProperty(n, $l, { writable: !0, value: { producerCreationFailureCount: 0, consumerCreationFailureCount: 0, producerNotReadyFailureCount: 0 } }), Object.defineProperty(n, Hr, { writable: !0, value: [] }), Object.defineProperty(n, ys, { writable: !0, value: void 0 }), n.context = e, n.sendTransportConnectedCallback = /* @__PURE__ */ m(/* @__PURE__ */ h().m(function i() {
23449
+ return b(this, r), n = C(this, r, [e, t]), Object.defineProperty(n, Nd, { value: jM }), Object.defineProperty(n, Ld, { value: UM }), Object.defineProperty(n, jl, { value: $M }), Object.defineProperty(n, Ul, { value: VM }), Object.defineProperty(n, ku, { value: NM }), Object.defineProperty(n, yn, { writable: !0, value: void 0 }), Object.defineProperty(n, Tn, { writable: !0, value: void 0 }), Object.defineProperty(n, os, { writable: !0, value: void 0 }), Object.defineProperty(n, yu, { writable: !0, value: void 0 }), Object.defineProperty(n, hr, { writable: !0, value: void 0 }), Object.defineProperty(n, $l, { writable: !0, value: { producerCreationFailureCount: 0, consumerCreationFailureCount: 0, producerNotReadyFailureCount: 0 } }), Object.defineProperty(n, Hr, { writable: !0, value: [] }), Object.defineProperty(n, ys, { writable: !0, value: void 0 }), n.context = e, n.sendTransportConnectedCallback = /* @__PURE__ */ m(/* @__PURE__ */ h().m(function i() {
23438
23450
  return h().w(function(a) {
23439
23451
  for (; ; )
23440
23452
  switch (a.n) {
@@ -23678,62 +23690,62 @@ var Vl = /* @__PURE__ */ E("context"), Gt = /* @__PURE__ */ E("logger"), MM = /*
23678
23690
  return t;
23679
23691
  }() }]);
23680
23692
  }(kM);
23681
- function LM() {
23693
+ function NM() {
23682
23694
  return Vd.apply(this, arguments);
23683
23695
  }
23684
23696
  function Vd() {
23685
23697
  return Vd = m(/* @__PURE__ */ h().m(function s() {
23686
- var r = this, e, t, n, i, a, o, u, l, d;
23687
- return h().w(function(p) {
23698
+ var r = this, e, t, n, i, a, o, u, l, d, p, v, f, g;
23699
+ return h().w(function(y) {
23688
23700
  for (; ; )
23689
- switch (p.p = p.n) {
23701
+ switch (y.p = y.n) {
23690
23702
  case 0:
23691
23703
  if (!(!this.recvTransport || this.recvTransport.closed)) {
23692
- p.n = 1;
23704
+ y.n = 1;
23693
23705
  break;
23694
23706
  }
23695
23707
  throw new Error("Recv transport is closed");
23696
23708
  case 1:
23697
- if (e = 500, t = c(this, Hr)[Hr].splice(0, c(this, Hr)[Hr].length), p.p = 2, n = new Set(Array.from(this.consumers.values()).map(function(v) {
23698
- var f = v.producerId;
23699
- return f;
23700
- })), i = t.filter(function(v) {
23701
- var f = v.producerId;
23702
- return !r.producers.get(f) && !n.has(f);
23709
+ if (e = 500, t = c(this, Hr)[Hr].splice(0, c(this, Hr)[Hr].length), y.p = 2, n = new Set(Array.from(this.consumers.values()).map(function(k) {
23710
+ var w = k.producerId;
23711
+ return w;
23712
+ })), i = t.filter(function(k) {
23713
+ var w = k.producerId;
23714
+ return !r.producers.get(w) && !n.has(w);
23703
23715
  }), i.length !== 0) {
23704
- p.n = 3;
23716
+ y.n = 3;
23705
23717
  break;
23706
23718
  }
23707
- return p.a(2);
23719
+ return y.a(2);
23708
23720
  case 3:
23709
- return p.n = 4, this.recvTransport.consume(i, c(this, Ld)[Ld].bind(this), c(this, hr)[hr].negotiate.bind(c(this, hr)[hr]));
23721
+ return y.n = 4, this.recvTransport.consume(i, c(this, Ld)[Ld].bind(this), c(this, hr)[hr].negotiate.bind(c(this, hr)[hr]));
23710
23722
  case 4:
23711
- a = p.v, o = a.consumers, u = a.failedProducers, o.forEach(c(this, Nd)[Nd].bind(this)), u != null && u.length && (this.logger.error("Failed to create consumers for producers", { producers: u }), l = u.filter(function(v) {
23712
- var f = v.errorCode, g = v.producerId;
23713
- return f === "not_found_track_error" ? (r.logger.error("Track not found for producer: ".concat(g, ". This will not be retried.")), !1) : f === "backend_error" ? (r.logger.error("Unrecoverable error: backend error"), !1) : !0;
23714
- }), c(this, Hr)[Hr] = c(this, Hr)[Hr].concat(l), c(this, ys)[ys] = setTimeout(c(this, ku)[ku].bind(this), e)), p.n = 6;
23723
+ a = y.v, o = a.consumers, u = a.failedProducers, o.forEach(c(this, Nd)[Nd].bind(this)), u != null && u.length && (this.logger.error("Failed to create consumers for producers", { producers: u }), l = u.filter(function(k) {
23724
+ var w = k.errorCode, T = k.producerId;
23725
+ return w === "not_found_track_error" ? (r.logger.error("Track not found for producer: ".concat(T, ". This will not be retried.")), !1) : w === "backend_error" ? (r.logger.error("Unrecoverable error: backend error"), !1) : !0;
23726
+ }), c(this, Hr)[Hr] = c(this, Hr)[Hr].concat(l), c(this, ys)[ys] = setTimeout(c(this, ku)[ku].bind(this), e)), y.n = 6;
23715
23727
  break;
23716
23728
  case 5:
23717
- if (p.p = 5, d = p.v, this.logger.error("failed to consume on transport", { error: d }), !(d.errorCode === "internal_error" && d.errorDescription === "Backend error" || d.errorCode === "invalid_session_description")) {
23718
- p.n = 6;
23729
+ if (y.p = 5, g = y.v, d = g instanceof Error ? g : new Error(String(g)), this.logger.error("failed to consume on transport", { error: d }), p = DM(d), v = p.errorCode, f = p.errorDescription, !(v === "internal_error" && f === "Backend error" || v === "invalid_session_description")) {
23730
+ y.n = 6;
23719
23731
  break;
23720
23732
  }
23721
- this.logger.error("Irrecoverable error, closing current recvTransport to create a new one", { transport: this.recvTransport, error: { code: d.errorCode, message: d.errorDescription } });
23733
+ this.logger.error("Irrecoverable error, closing current recvTransport to create a new one", { transport: this.recvTransport, error: { code: v, message: f } });
23722
23734
  try {
23723
23735
  this.stopTransports({ recv: !0 });
23724
- } catch (v) {
23736
+ } catch (k) {
23725
23737
  }
23726
- return p.n = 6, this.setupTransports({ recv: !0 });
23738
+ return y.n = 6, this.setupTransports({ recv: !0 });
23727
23739
  case 6:
23728
- return p.a(2);
23740
+ return y.a(2);
23729
23741
  }
23730
23742
  }, s, this, [[2, 5]]);
23731
23743
  })), Vd.apply(this, arguments);
23732
23744
  }
23733
- function NM(s) {
23745
+ function VM(s) {
23734
23746
  return c(this, yu)[yu].create(s);
23735
23747
  }
23736
- function VM(s, r) {
23748
+ function $M(s, r) {
23737
23749
  var e = this;
23738
23750
  s.on("close", /* @__PURE__ */ function() {
23739
23751
  var t = m(/* @__PURE__ */ h().m(function n(i, a) {
@@ -23766,7 +23778,7 @@ function VM(s, r) {
23766
23778
  e.logger.info("producer::trackended", { producer: N(N({}, s), {}, { status: "UNKNOWN" }) });
23767
23779
  }), c(this, yn)[yn].set(s.id, s);
23768
23780
  }
23769
- function $M(s) {
23781
+ function UM(s) {
23770
23782
  return $d.apply(this, arguments);
23771
23783
  }
23772
23784
  function $d() {
@@ -23789,7 +23801,7 @@ function $d() {
23789
23801
  }, s, this, [[0, 3]]);
23790
23802
  })), $d.apply(this, arguments);
23791
23803
  }
23792
- function UM(s) {
23804
+ function jM(s) {
23793
23805
  var r = this;
23794
23806
  s.on("close", /* @__PURE__ */ function() {
23795
23807
  var e = m(/* @__PURE__ */ h().m(function t(n) {
@@ -23811,7 +23823,7 @@ function UM(s) {
23811
23823
  var eu = /* @__PURE__ */ E("zeroCrossingThreshold"), tu = /* @__PURE__ */ E("minVoiceDuration"), ru = /* @__PURE__ */ E("hangoverFrames"), us = /* @__PURE__ */ E("initialEnergyThreshold"), Ss = /* @__PURE__ */ E("noiseAdaptationRate"), Es = /* @__PURE__ */ E("voiceAdaptationRate"), Tu = /* @__PURE__ */ E("minEnergyThreshold"), wu = /* @__PURE__ */ E("maxEnergyThreshold"), cs = /* @__PURE__ */ E("energyRatioThreshold"), wt = /* @__PURE__ */ E("currentEnergyThreshold"), rr = /* @__PURE__ */ E("backgroundNoiseEnergy"), er = /* @__PURE__ */ E("voiceDetected"), oi = /* @__PURE__ */ E("consecutiveVoiceFrames"), ui = /* @__PURE__ */ E("hangoverCount"), jr = /* @__PURE__ */ E("noiseEnergyHistory"), bu = /* @__PURE__ */ E("noiseHistorySize"), Fl = /* @__PURE__ */ E("updateEnergyThreshold"), Hl = /* @__PURE__ */ E("updateNoiseEstimate"), Ud = /* @__PURE__ */ E("calculateEnergy"), jd = /* @__PURE__ */ E("calculateZeroCrossingRate"), Dh = /* @__PURE__ */ function() {
23812
23824
  function s() {
23813
23825
  var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = r.initialEnergyThreshold, t = e === void 0 ? 0.015 : e, n = r.zeroCrossingThreshold, i = n === void 0 ? 20 : n, a = r.minVoiceDuration, o = a === void 0 ? 3 : a, u = r.hangoverFrames, l = u === void 0 ? 5 : u, d = r.noiseAdaptationRate, p = d === void 0 ? 0.95 : d, v = r.voiceAdaptationRate, f = v === void 0 ? 0.99 : v, g = r.minEnergyThreshold, y = g === void 0 ? 5e-3 : g, k = r.maxEnergyThreshold, w = k === void 0 ? 0.2 : k, T = r.energyRatioThreshold, S = T === void 0 ? 1.5 : T, A = r.noiseHistorySize, M = A === void 0 ? 50 : A;
23814
- b(this, s), Object.defineProperty(this, Hl, { value: FM }), Object.defineProperty(this, Fl, { value: jM }), Object.defineProperty(this, eu, { writable: !0, value: void 0 }), Object.defineProperty(this, tu, { writable: !0, value: void 0 }), Object.defineProperty(this, ru, { writable: !0, value: void 0 }), Object.defineProperty(this, us, { writable: !0, value: void 0 }), Object.defineProperty(this, Ss, { writable: !0, value: void 0 }), Object.defineProperty(this, Es, { writable: !0, value: void 0 }), Object.defineProperty(this, Tu, { writable: !0, value: void 0 }), Object.defineProperty(this, wu, { writable: !0, value: void 0 }), Object.defineProperty(this, cs, { writable: !0, value: void 0 }), Object.defineProperty(this, wt, { writable: !0, value: void 0 }), Object.defineProperty(this, rr, { writable: !0, value: void 0 }), Object.defineProperty(this, er, { writable: !0, value: !1 }), Object.defineProperty(this, oi, { writable: !0, value: 0 }), Object.defineProperty(this, ui, { writable: !0, value: 0 }), Object.defineProperty(this, jr, { writable: !0, value: [] }), Object.defineProperty(this, bu, { writable: !0, value: void 0 }), c(this, us)[us] = t, c(this, wt)[wt] = t, c(this, eu)[eu] = i, c(this, tu)[tu] = o, c(this, ru)[ru] = l, c(this, Ss)[Ss] = p, c(this, Es)[Es] = f, c(this, Tu)[Tu] = y, c(this, wu)[wu] = w, c(this, cs)[cs] = S, c(this, bu)[bu] = M, c(this, rr)[rr] = t / 2;
23826
+ b(this, s), Object.defineProperty(this, Hl, { value: HM }), Object.defineProperty(this, Fl, { value: FM }), Object.defineProperty(this, eu, { writable: !0, value: void 0 }), Object.defineProperty(this, tu, { writable: !0, value: void 0 }), Object.defineProperty(this, ru, { writable: !0, value: void 0 }), Object.defineProperty(this, us, { writable: !0, value: void 0 }), Object.defineProperty(this, Ss, { writable: !0, value: void 0 }), Object.defineProperty(this, Es, { writable: !0, value: void 0 }), Object.defineProperty(this, Tu, { writable: !0, value: void 0 }), Object.defineProperty(this, wu, { writable: !0, value: void 0 }), Object.defineProperty(this, cs, { writable: !0, value: void 0 }), Object.defineProperty(this, wt, { writable: !0, value: void 0 }), Object.defineProperty(this, rr, { writable: !0, value: void 0 }), Object.defineProperty(this, er, { writable: !0, value: !1 }), Object.defineProperty(this, oi, { writable: !0, value: 0 }), Object.defineProperty(this, ui, { writable: !0, value: 0 }), Object.defineProperty(this, jr, { writable: !0, value: [] }), Object.defineProperty(this, bu, { writable: !0, value: void 0 }), c(this, us)[us] = t, c(this, wt)[wt] = t, c(this, eu)[eu] = i, c(this, tu)[tu] = o, c(this, ru)[ru] = l, c(this, Ss)[Ss] = p, c(this, Es)[Es] = f, c(this, Tu)[Tu] = y, c(this, wu)[wu] = w, c(this, cs)[cs] = S, c(this, bu)[bu] = M, c(this, rr)[rr] = t / 2;
23815
23827
  }
23816
23828
  return P(s, [{
23817
23829
  key: "voiceDetected",
@@ -23845,10 +23857,10 @@ var eu = /* @__PURE__ */ E("zeroCrossingThreshold"), tu = /* @__PURE__ */ E("min
23845
23857
  return { currentEnergyThreshold: c(this, wt)[wt], backgroundNoiseEnergy: c(this, rr)[rr], energyRatioThreshold: c(this, cs)[cs] };
23846
23858
  } }]);
23847
23859
  }();
23848
- function jM(s) {
23860
+ function FM(s) {
23849
23861
  c(this, er)[er] ? c(this, wt)[wt] = c(this, Es)[Es] * c(this, wt)[wt] + (1 - c(this, Es)[Es]) * s : c(this, wt)[wt] = c(this, Ss)[Ss] * c(this, wt)[wt] + (1 - c(this, Ss)[Ss]) * c(this, rr)[rr], c(this, wt)[wt] = Math.max(c(this, Tu)[Tu], Math.min(c(this, wu)[wu], c(this, wt)[wt]));
23850
23862
  }
23851
- function FM(s) {
23863
+ function HM(s) {
23852
23864
  if (s < c(this, wt)[wt] * 1.2)
23853
23865
  if (c(this, jr)[jr].push(s), c(this, jr)[jr].length > c(this, bu)[bu] && c(this, jr)[jr].shift(), c(this, jr)[jr].length >= 10) {
23854
23866
  var r = _e(c(this, jr)[jr]).sort(function(t, n) {
@@ -23858,20 +23870,20 @@ function FM(s) {
23858
23870
  } else
23859
23871
  c(this, rr)[rr] = 0.95 * c(this, rr)[rr] + 0.05 * s;
23860
23872
  }
23861
- function HM(s) {
23873
+ function BM(s) {
23862
23874
  return Math.sqrt(s.map(function(r) {
23863
23875
  return r * r;
23864
23876
  }).reduce(function(r, e) {
23865
23877
  return r + e;
23866
23878
  }) / s.length);
23867
23879
  }
23868
- function BM(s) {
23880
+ function qM(s) {
23869
23881
  for (var r = 0, e = 1; e < s.length; e += 1)
23870
23882
  (s[e] >= 0 && s[e - 1] < 0 || s[e] < 0 && s[e - 1] >= 0) && (r += 1);
23871
23883
  return r;
23872
23884
  }
23873
- Object.defineProperty(Dh, jd, { value: BM });
23874
- Object.defineProperty(Dh, Ud, { value: HM });
23885
+ Object.defineProperty(Dh, jd, { value: qM });
23886
+ Object.defineProperty(Dh, Ud, { value: BM });
23875
23887
  var nu = /* @__PURE__ */ E("context"), nv = /* @__PURE__ */ function() {
23876
23888
  function s(r) {
23877
23889
  var e = this;
@@ -23925,7 +23937,7 @@ var nu = /* @__PURE__ */ E("context"), nv = /* @__PURE__ */ function() {
23925
23937
  var n = this.audioContext.createMediaStreamSource(t);
23926
23938
  n.connect(this.analyser);
23927
23939
  } }]);
23928
- }(), qM = /* @__PURE__ */ function() {
23940
+ }(), GM = /* @__PURE__ */ function() {
23929
23941
  function s() {
23930
23942
  b(this, s);
23931
23943
  }
@@ -23950,11 +23962,11 @@ var nu = /* @__PURE__ */ E("context"), nv = /* @__PURE__ */ function() {
23950
23962
  } }, { key: "clearTimeout", value: function(e) {
23951
23963
  return navigator && navigator.RNBackgroundTimerImpl ? navigator.RNBackgroundTimerImpl.clearTimeout(e) : global.clearTimeout(e);
23952
23964
  } }]);
23953
- }(), GM = 60, WM = 400, Dr = /* @__PURE__ */ E("interval"), Lr = /* @__PURE__ */ E("reportInterval"), Fr = /* @__PURE__ */ E("producerId"), au = /* @__PURE__ */ E("audioTrack"), ks = /* @__PURE__ */ E("energy"), Ts = /* @__PURE__ */ E("vad"), fn = /* @__PURE__ */ E("minEnergy"), fi = /* @__PURE__ */ E("maxEnergy"), ws = /* @__PURE__ */ E("previousState"), ci = /* @__PURE__ */ E("context"), Vr = /* @__PURE__ */ E("audioSampler"), cr = /* @__PURE__ */ E("timer"), Bl = /* @__PURE__ */ E("getAudioCharacteristics"), Bu = /* @__PURE__ */ E("isSilent"), ql = /* @__PURE__ */ E("report"), Fd = /* @__PURE__ */ E("logScale"), il = /* @__PURE__ */ function() {
23965
+ }(), WM = 60, JM = 400, Dr = /* @__PURE__ */ E("interval"), Lr = /* @__PURE__ */ E("reportInterval"), Fr = /* @__PURE__ */ E("producerId"), au = /* @__PURE__ */ E("audioTrack"), ks = /* @__PURE__ */ E("energy"), Ts = /* @__PURE__ */ E("vad"), fn = /* @__PURE__ */ E("minEnergy"), fi = /* @__PURE__ */ E("maxEnergy"), ws = /* @__PURE__ */ E("previousState"), ci = /* @__PURE__ */ E("context"), Vr = /* @__PURE__ */ E("audioSampler"), cr = /* @__PURE__ */ E("timer"), Bl = /* @__PURE__ */ E("getAudioCharacteristics"), Bu = /* @__PURE__ */ E("isSilent"), ql = /* @__PURE__ */ E("report"), Fd = /* @__PURE__ */ E("logScale"), il = /* @__PURE__ */ function() {
23954
23966
  function s(r, e) {
23955
- b(this, s), Object.defineProperty(this, ql, { value: zM }), Object.defineProperty(this, Bl, { value: JM }), Object.defineProperty(this, Dr, { writable: !0, value: void 0 }), Object.defineProperty(this, Lr, { writable: !0, value: void 0 }), Object.defineProperty(this, Fr, { writable: !0, value: void 0 }), Object.defineProperty(this, au, { writable: !0, value: void 0 }), Object.defineProperty(this, ks, { writable: !0, value: void 0 }), Object.defineProperty(this, Ts, { writable: !0, value: void 0 }), Object.defineProperty(this, fn, { writable: !0, value: void 0 }), Object.defineProperty(this, fi, { writable: !0, value: void 0 }), Object.defineProperty(this, ws, { writable: !0, value: void 0 }), Object.defineProperty(this, ci, { writable: !0, value: void 0 }), Object.defineProperty(this, Vr, { writable: !0, value: void 0 }), Object.defineProperty(this, cr, { writable: !0, value: void 0 }), this.reportRequest = e, c(this, ci)[ci] = r, c(this, Ts)[Ts] = new Dh();
23967
+ b(this, s), Object.defineProperty(this, ql, { value: QM }), Object.defineProperty(this, Bl, { value: KM }), Object.defineProperty(this, Dr, { writable: !0, value: void 0 }), Object.defineProperty(this, Lr, { writable: !0, value: void 0 }), Object.defineProperty(this, Fr, { writable: !0, value: void 0 }), Object.defineProperty(this, au, { writable: !0, value: void 0 }), Object.defineProperty(this, ks, { writable: !0, value: void 0 }), Object.defineProperty(this, Ts, { writable: !0, value: void 0 }), Object.defineProperty(this, fn, { writable: !0, value: void 0 }), Object.defineProperty(this, fi, { writable: !0, value: void 0 }), Object.defineProperty(this, ws, { writable: !0, value: void 0 }), Object.defineProperty(this, ci, { writable: !0, value: void 0 }), Object.defineProperty(this, Vr, { writable: !0, value: void 0 }), Object.defineProperty(this, cr, { writable: !0, value: void 0 }), this.reportRequest = e, c(this, ci)[ci] = r, c(this, Ts)[Ts] = new Dh();
23956
23968
  var t = navigator, n = t.isReactNative;
23957
- c(this, Vr)[Vr] = n ? new nv(c(this, ci)[ci]) : new iv(c(this, ci)[ci]), c(this, cr)[cr] = n ? qM : fc;
23969
+ c(this, Vr)[Vr] = n ? new nv(c(this, ci)[ci]) : new iv(c(this, ci)[ci]), c(this, cr)[cr] = n ? GM : fc;
23958
23970
  }
23959
23971
  return P(s, [{ key: "logger", get: (
23960
23972
  /**
@@ -23987,7 +23999,7 @@ var nu = /* @__PURE__ */ E("context"), nv = /* @__PURE__ */ function() {
23987
23999
  return u.a(2);
23988
24000
  }
23989
24001
  }, t);
23990
- })), GM), c(this, Lr)[Lr] && c(this, cr)[cr].clearInterval(c(this, Lr)[Lr]), c(this, Lr)[Lr] = c(this, cr)[cr].setInterval(c(this, ql)[ql].bind(this), WM);
24002
+ })), WM), c(this, Lr)[Lr] && c(this, cr)[cr].clearInterval(c(this, Lr)[Lr]), c(this, Lr)[Lr] = c(this, cr)[cr].setInterval(c(this, ql)[ql].bind(this), JM);
23991
24003
  } }, { key: "stop", value: function() {
23992
24004
  try {
23993
24005
  this.logger.debug("AudioActivityReporter: Stopping audio activity reporter: ".concat(c(this, Fr)[Fr])), c(this, Dr)[Dr] && (c(this, cr)[cr].clearInterval(c(this, Dr)[Dr]), c(this, Dr)[Dr] = void 0), c(this, Lr)[Lr] && (c(this, cr)[cr].clearInterval(c(this, Lr)[Lr]), c(this, Lr)[Lr] = void 0);
@@ -23997,7 +24009,7 @@ var nu = /* @__PURE__ */ E("context"), nv = /* @__PURE__ */ function() {
23997
24009
  } }]);
23998
24010
  }();
23999
24011
  rh = il;
24000
- function JM() {
24012
+ function KM() {
24001
24013
  var s = c(this, Vr)[Vr].samples, r = c(this, Ts)[Ts].processAudioChunk(s), e = r.energy, t = r.isVoice, n = c(rh, Fd)[Fd](e);
24002
24014
  if (n === -1 / 0 || e < 1e-6)
24003
24015
  return { energy: 0, isVoice: !1 };
@@ -24005,32 +24017,32 @@ function JM() {
24005
24017
  var i = (n - c(this, fn)[fn]) / (c(this, fi)[fi] - c(this, fn)[fn]) * 10 || 0;
24006
24018
  return { energy: i, isVoice: t };
24007
24019
  }
24008
- function KM(s) {
24020
+ function zM(s) {
24009
24021
  return s < 5;
24010
24022
  }
24011
- function zM() {
24023
+ function QM() {
24012
24024
  var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : c(this, ks)[ks];
24013
24025
  if (!(!c(this, Fr)[Fr] || !s)) {
24014
24026
  var r = { producerId: c(this, Fr)[Fr], energy: Math.round(s), silent: c(rh, Bu)[Bu](s) };
24015
24027
  c(this, ws)[ws] = r.silent, this.reportRequest(r);
24016
24028
  }
24017
24029
  }
24018
- function QM(s) {
24030
+ function YM(s) {
24019
24031
  var r = Math.log10(s);
24020
24032
  return Math.round(r);
24021
24033
  }
24022
- Object.defineProperty(il, Fd, { value: QM });
24023
- Object.defineProperty(il, Bu, { value: KM });
24024
- var YM = Object.defineProperty, XM = Object.getOwnPropertyDescriptor, Qe = function(r, e, t, n) {
24025
- for (var i = n > 1 ? void 0 : n ? XM(e, t) : e, a = r.length - 1, o; a >= 0; a--)
24034
+ Object.defineProperty(il, Fd, { value: YM });
24035
+ Object.defineProperty(il, Bu, { value: zM });
24036
+ var XM = Object.defineProperty, ZM = Object.getOwnPropertyDescriptor, Qe = function(r, e, t, n) {
24037
+ for (var i = n > 1 ? void 0 : n ? ZM(e, t) : e, a = r.length - 1, o; a >= 0; a--)
24026
24038
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
24027
- return n && i && YM(e, t, i), i;
24039
+ return n && i && XM(e, t, i), i;
24028
24040
  }, Pu = /* @__PURE__ */ E("roomUUID"), Su = /* @__PURE__ */ E("peerDisplayName"), Ze = /* @__PURE__ */ E("socketClient"), H = /* @__PURE__ */ E("sfuHandler"), Hd = /* @__PURE__ */ E("rtpCapabilities"), ct = /* @__PURE__ */ E("events"), gi = /* @__PURE__ */ E("roomJoiningInProgress"), mi = /* @__PURE__ */ E("onceJoined"), li = /* @__PURE__ */ E("transportQueue"), su = /* @__PURE__ */ E("rejoinRoomFn"), Nt = /* @__PURE__ */ E("connectionPromise"), lr = /* @__PURE__ */ E("screenshareConsumerProducer"), xe = /* @__PURE__ */ E("producerTypes"), yt = /* @__PURE__ */ E("audioActivityReporter"), $r = /* @__PURE__ */ E("connectionHandler"), Gl = /* @__PURE__ */ E("joinRoom"), Bd = /* @__PURE__ */ E("completeJoinRoom"), qd = /* @__PURE__ */ E("reportRoomJoinedAnalytics"), Eu = /* @__PURE__ */ E("initializeConnection"), Gd = /* @__PURE__ */ E("getRtpCapabilities"), Wd = /* @__PURE__ */ E("sendJoinRoomMessage"), lt = /* @__PURE__ */ E("getProducer"), di = /* @__PURE__ */ E("setProducer"), Wl = /* @__PURE__ */ E("deleteProducer"), Jl = /* @__PURE__ */ E("getMicProducerDefaults"), Kl = /* @__PURE__ */ E("getWebcamProducerDefaults"), Ge = /* @__PURE__ */ function() {
24029
24041
  function s(r, e) {
24030
24042
  var t, n, i = this;
24031
- b(this, s), Object.defineProperty(this, Kl, { value: cO }), Object.defineProperty(this, Jl, { value: uO }), Object.defineProperty(this, Wl, { value: oO }), Object.defineProperty(this, di, { value: sO }), Object.defineProperty(this, lt, { value: aO }), Object.defineProperty(this, Wd, { value: iO }), Object.defineProperty(this, Gd, { value: nO }), Object.defineProperty(this, Eu, { value: rO }), Object.defineProperty(this, qd, { value: tO }), Object.defineProperty(this, Bd, { value: eO }), Object.defineProperty(this, Gl, { value: xM }), Object.defineProperty(this, $r, { get: ZM, set: void 0 }), this.context = void 0, this.authToken = void 0, this.e2ee = void 0, Object.defineProperty(this, Pu, { writable: !0, value: void 0 }), Object.defineProperty(this, Su, { writable: !0, value: void 0 }), Object.defineProperty(this, Ze, { writable: !0, value: void 0 }), Object.defineProperty(this, H, { writable: !0, value: void 0 }), Object.defineProperty(this, Hd, { writable: !0, value: void 0 }), Object.defineProperty(this, ct, { writable: !0, value: void 0 }), Object.defineProperty(this, gi, { writable: !0, value: void 0 }), Object.defineProperty(this, mi, { writable: !0, value: void 0 }), Object.defineProperty(this, li, { writable: !0, value: void 0 }), Object.defineProperty(this, su, { writable: !0, value: void 0 }), Object.defineProperty(this, Nt, { writable: !0, value: null }), Object.defineProperty(this, lr, { writable: !0, value: void 0 }), Object.defineProperty(this, xe, { writable: !0, value: void 0 }), Object.defineProperty(this, yt, { writable: !0, value: void 0 }), this.context = r;
24043
+ b(this, s), Object.defineProperty(this, Kl, { value: lO }), Object.defineProperty(this, Jl, { value: cO }), Object.defineProperty(this, Wl, { value: uO }), Object.defineProperty(this, di, { value: oO }), Object.defineProperty(this, lt, { value: sO }), Object.defineProperty(this, Wd, { value: aO }), Object.defineProperty(this, Gd, { value: iO }), Object.defineProperty(this, Eu, { value: nO }), Object.defineProperty(this, qd, { value: rO }), Object.defineProperty(this, Bd, { value: tO }), Object.defineProperty(this, Gl, { value: eO }), Object.defineProperty(this, $r, { get: xM, set: void 0 }), this.context = void 0, this.authToken = void 0, this.e2ee = void 0, Object.defineProperty(this, Pu, { writable: !0, value: void 0 }), Object.defineProperty(this, Su, { writable: !0, value: void 0 }), Object.defineProperty(this, Ze, { writable: !0, value: void 0 }), Object.defineProperty(this, H, { writable: !0, value: void 0 }), Object.defineProperty(this, Hd, { writable: !0, value: void 0 }), Object.defineProperty(this, ct, { writable: !0, value: void 0 }), Object.defineProperty(this, gi, { writable: !0, value: void 0 }), Object.defineProperty(this, mi, { writable: !0, value: void 0 }), Object.defineProperty(this, li, { writable: !0, value: void 0 }), Object.defineProperty(this, su, { writable: !0, value: void 0 }), Object.defineProperty(this, Nt, { writable: !0, value: null }), Object.defineProperty(this, lr, { writable: !0, value: void 0 }), Object.defineProperty(this, xe, { writable: !0, value: void 0 }), Object.defineProperty(this, yt, { writable: !0, value: void 0 }), this.context = r;
24032
24044
  var a = e.socket;
24033
- this.mediaJoined = !1, c(this, Ze)[Ze] = a, c(this, gi)[gi] = !1, c(this, H)[H] = new DM(r, a), c(this, ct)[ct] = c(this, H)[H].events, c(this, lr)[lr] = /* @__PURE__ */ new Set(), c(this, xe)[xe] = /* @__PURE__ */ new Map(), c(this, mi)[mi] = !1, c(this, li)[li] = new wd(r.getValue("logger")), c(this, yt)[yt] = new il(this.context, c(this, H)[H].socketHandler.audioActivity.bind(c(this, H)[H].socketHandler)), this.e2ee = (t = (n = r.getValue("modules").e2ee) === null || n === void 0 ? void 0 : n.enabled) !== null && t !== void 0 ? t : !1, this.handleSocketEvents(), this.handleCallstatsEvents(), c(this, su)[su] = wh(/* @__PURE__ */ m(/* @__PURE__ */ h().m(function o() {
24045
+ this.mediaJoined = !1, c(this, Ze)[Ze] = a, c(this, gi)[gi] = !1, c(this, H)[H] = new LM(r, a), c(this, ct)[ct] = c(this, H)[H].events, c(this, lr)[lr] = /* @__PURE__ */ new Set(), c(this, xe)[xe] = /* @__PURE__ */ new Map(), c(this, mi)[mi] = !1, c(this, li)[li] = new wd(r.getValue("logger")), c(this, yt)[yt] = new il(this.context, c(this, H)[H].socketHandler.audioActivity.bind(c(this, H)[H].socketHandler)), this.e2ee = (t = (n = r.getValue("modules").e2ee) === null || n === void 0 ? void 0 : n.enabled) !== null && t !== void 0 ? t : !1, this.handleSocketEvents(), this.handleCallstatsEvents(), c(this, su)[su] = wh(/* @__PURE__ */ m(/* @__PURE__ */ h().m(function o() {
24034
24046
  var u, l;
24035
24047
  return h().w(function(d) {
24036
24048
  for (; ; )
@@ -24906,10 +24918,10 @@ var YM = Object.defineProperty, XM = Object.getOwnPropertyDescriptor, Qe = funct
24906
24918
  });
24907
24919
  } }]);
24908
24920
  }();
24909
- function ZM() {
24921
+ function xM() {
24910
24922
  return this.context.getValue("connectionHandler");
24911
24923
  }
24912
- function xM(s, r, e, t) {
24924
+ function eO(s, r, e, t) {
24913
24925
  return Jd.apply(this, arguments);
24914
24926
  }
24915
24927
  function Jd() {
@@ -24958,7 +24970,7 @@ function Jd() {
24958
24970
  }, s, this, [[3, 8, 9, 10]]);
24959
24971
  })), Jd.apply(this, arguments);
24960
24972
  }
24961
- function eO() {
24973
+ function tO() {
24962
24974
  return Kd.apply(this, arguments);
24963
24975
  }
24964
24976
  function Kd() {
@@ -24977,7 +24989,7 @@ function Kd() {
24977
24989
  }, s, this, [[0, 2]]);
24978
24990
  })), Kd.apply(this, arguments);
24979
24991
  }
24980
- function tO(s) {
24992
+ function rO(s) {
24981
24993
  var r = this;
24982
24994
  navigator.product !== "ReactNative" && setTimeout(function() {
24983
24995
  try {
@@ -24988,7 +25000,7 @@ function tO(s) {
24988
25000
  }
24989
25001
  }, 0);
24990
25002
  }
24991
- function rO(s, r, e, t) {
25003
+ function nO(s, r, e, t) {
24992
25004
  return zd.apply(this, arguments);
24993
25005
  }
24994
25006
  function zd() {
@@ -25021,11 +25033,11 @@ function zd() {
25021
25033
  }, s, this, [[1, 6]]);
25022
25034
  })), zd.apply(this, arguments);
25023
25035
  }
25024
- function nO() {
25036
+ function iO() {
25025
25037
  var s = tM("video/VP8");
25026
25038
  return c(this, Hd)[Hd] = s, s;
25027
25039
  }
25028
- function iO(s, r, e, t) {
25040
+ function aO(s, r, e, t) {
25029
25041
  return Qd.apply(this, arguments);
25030
25042
  }
25031
25043
  function Qd() {
@@ -25069,19 +25081,19 @@ function Qd() {
25069
25081
  }, s);
25070
25082
  })), Qd.apply(this, arguments);
25071
25083
  }
25072
- function aO(s) {
25084
+ function sO(s) {
25073
25085
  return c(this, xe)[xe].get(s);
25074
25086
  }
25075
- function sO(s, r) {
25087
+ function oO(s, r) {
25076
25088
  return c(this, xe)[xe].set(s, r);
25077
25089
  }
25078
- function oO(s) {
25090
+ function uO(s) {
25079
25091
  return c(this, xe)[xe].delete(s);
25080
25092
  }
25081
- function uO(s) {
25093
+ function cO(s) {
25082
25094
  return { track: s, encodings: [{ priority: "high" }], codecOptions: [{ name: "opus" }], appData: { e2ee: this.e2ee }, stopTracks: !1, zeroRtpOnPause: !1 };
25083
25095
  }
25084
- function cO(s) {
25096
+ function lO(s) {
25085
25097
  return { track: s, codecOptions: [{ name: "VP8" }], appData: { screenShare: !1, e2ee: this.e2ee }, stopTracks: !1 };
25086
25098
  }
25087
25099
  Qe([L.trace("MediaNodeClient.reset")], Ge.prototype, "reset", 1);
@@ -25122,7 +25134,7 @@ function vg(s, r) {
25122
25134
  var t = new Ge(s, r);
25123
25135
  return s.setValue("roomNodeClient", t), t;
25124
25136
  }
25125
- function lO(s) {
25137
+ function dO(s) {
25126
25138
  var r = s.getValue("roomNodeClient");
25127
25139
  try {
25128
25140
  r == null || r.leaveRoom();
@@ -25131,13 +25143,13 @@ function lO(s) {
25131
25143
  }
25132
25144
  s.setValue("roomNodeClient", void 0);
25133
25145
  }
25134
- var dO = Object.defineProperty, hO = Object.getOwnPropertyDescriptor, Us = function(r, e, t, n) {
25135
- for (var i = n > 1 ? void 0 : n ? hO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
25146
+ var hO = Object.defineProperty, pO = Object.getOwnPropertyDescriptor, Us = function(r, e, t, n) {
25147
+ for (var i = n > 1 ? void 0 : n ? pO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
25136
25148
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
25137
- return n && i && dO(e, t, i), i;
25149
+ return n && i && hO(e, t, i), i;
25138
25150
  }, fg = (Yi = /* @__PURE__ */ E("socketService"), Jt = /* @__PURE__ */ E("roomSocketHandler"), Y = /* @__PURE__ */ E("context"), gt = /* @__PURE__ */ E("roomNodeClient"), /* @__PURE__ */ function() {
25139
25151
  function s(r, e, t, n) {
25140
- b(this, s), Object.defineProperty(this, gt, { get: pO, set: void 0 }), this.self = void 0, this.authToken = void 0, Object.defineProperty(this, Yi, { writable: !0, value: void 0 }), this.viewType = void 0, Object.defineProperty(this, Jt, { writable: !0, value: void 0 }), Object.defineProperty(this, Y, { writable: !0, value: void 0 });
25152
+ b(this, s), Object.defineProperty(this, gt, { get: vO, set: void 0 }), this.self = void 0, this.authToken = void 0, Object.defineProperty(this, Yi, { writable: !0, value: void 0 }), this.viewType = void 0, Object.defineProperty(this, Jt, { writable: !0, value: void 0 }), Object.defineProperty(this, Y, { writable: !0, value: void 0 });
25141
25153
  var i = t.socket, a = r.getValue("authToken");
25142
25154
  this.self = e, c(this, Y)[Y] = r, this.viewType = n, this.authToken = a, c(this, Yi)[Yi] = i, c(this, Jt)[Jt] = t, this.setupEvents();
25143
25155
  }
@@ -25627,7 +25639,7 @@ var dO = Object.defineProperty, hO = Object.getOwnPropertyDescriptor, Us = funct
25627
25639
  return e;
25628
25640
  }() }]);
25629
25641
  }());
25630
- function pO() {
25642
+ function vO() {
25631
25643
  return c(this, Y)[Y].getValue("roomNodeClient");
25632
25644
  }
25633
25645
  var Ta = fg;
@@ -25638,7 +25650,7 @@ Us([L.trace("SelfController.leaveRoom")], Ta.prototype, "leaveRoom", 1);
25638
25650
  Us([L.trace("SelfController.joinMediaRoom")], Ta.prototype, "joinMediaRoom", 1);
25639
25651
  Us([L.trace("SelfController.leaveMediaRoom")], Ta.prototype, "leaveMediaRoom", 1);
25640
25652
  Us([L.trace("SelfController.init")], Ta, "init", 1);
25641
- var ou = /* @__PURE__ */ E("socket"), vO = /* @__PURE__ */ function() {
25653
+ var ou = /* @__PURE__ */ E("socket"), fO = /* @__PURE__ */ function() {
25642
25654
  function s(r) {
25643
25655
  b(this, s), Object.defineProperty(this, ou, { writable: !0, value: void 0 }), c(this, ou)[ou] = r;
25644
25656
  }
@@ -25652,7 +25664,7 @@ var ou = /* @__PURE__ */ E("socket"), vO = /* @__PURE__ */ function() {
25652
25664
  }
25653
25665
  });
25654
25666
  } }]);
25655
- }(), uu = /* @__PURE__ */ E("socket"), cu = /* @__PURE__ */ E("context"), fO = /* @__PURE__ */ function() {
25667
+ }(), uu = /* @__PURE__ */ E("socket"), cu = /* @__PURE__ */ E("context"), gO = /* @__PURE__ */ function() {
25656
25668
  function s(r, e) {
25657
25669
  b(this, s), Object.defineProperty(this, uu, { writable: !0, value: void 0 }), Object.defineProperty(this, cu, { writable: !0, value: void 0 }), c(this, uu)[uu] = e, c(this, cu)[cu] = r;
25658
25670
  }
@@ -25686,10 +25698,10 @@ var ou = /* @__PURE__ */ E("socket"), vO = /* @__PURE__ */ function() {
25686
25698
  return t(l);
25687
25699
  });
25688
25700
  } }]);
25689
- }(), gO = Object.defineProperty, mO = Object.getOwnPropertyDescriptor, Lh = function(r, e, t, n) {
25690
- for (var i = n > 1 ? void 0 : n ? mO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
25701
+ }(), mO = Object.defineProperty, yO = Object.getOwnPropertyDescriptor, Lh = function(r, e, t, n) {
25702
+ for (var i = n > 1 ? void 0 : n ? yO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
25691
25703
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
25692
- return n && i && gO(e, t, i), i;
25704
+ return n && i && mO(e, t, i), i;
25693
25705
  }, Nr = /* @__PURE__ */ E("socket"), ls = /* @__PURE__ */ E("context"), al = /* @__PURE__ */ function() {
25694
25706
  function s(r, e) {
25695
25707
  b(this, s), Object.defineProperty(this, Nr, { writable: !0, value: void 0 }), Object.defineProperty(this, ls, { writable: !0, value: void 0 }), c(this, Nr)[Nr] = e, c(this, ls)[ls] = r;
@@ -25745,10 +25757,10 @@ var ou = /* @__PURE__ */ E("socket"), vO = /* @__PURE__ */ function() {
25745
25757
  Lh([L.trace("PollSocketHandler.getPolls")], al.prototype, "getPolls", 1);
25746
25758
  Lh([L.trace("PollSocketHandler.createPoll")], al.prototype, "createPoll", 1);
25747
25759
  Lh([L.trace("PollSocketHandler.votePoll")], al.prototype, "votePoll", 1);
25748
- var yO = Object.defineProperty, kO = Object.getOwnPropertyDescriptor, TO = function(r, e, t, n) {
25749
- for (var i = n > 1 ? void 0 : n ? kO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
25760
+ var kO = Object.defineProperty, TO = Object.getOwnPropertyDescriptor, wO = function(r, e, t, n) {
25761
+ for (var i = n > 1 ? void 0 : n ? TO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
25750
25762
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
25751
- return n && i && yO(e, t, i), i;
25763
+ return n && i && kO(e, t, i), i;
25752
25764
  }, Dt = /* @__PURE__ */ E("context"), gg = /* @__PURE__ */ function() {
25753
25765
  function s(r, e) {
25754
25766
  b(this, s), this.socket = void 0, Object.defineProperty(this, Dt, { writable: !0, value: void 0 }), c(this, Dt)[Dt] = r, this.socket = e, this.handleSocketEvents(), c(this, Dt)[Dt].setValue("roomSocketHandler", this);
@@ -26218,8 +26230,8 @@ var yO = Object.defineProperty, kO = Object.getOwnPropertyDescriptor, TO = funct
26218
26230
  return e;
26219
26231
  }() }]);
26220
26232
  }();
26221
- TO([L.trace("RoomSocketHandler.joinRoom")], gg.prototype, "joinRoom", 1);
26222
- var kt = /* @__PURE__ */ E("socket"), wO = /* @__PURE__ */ function() {
26233
+ wO([L.trace("RoomSocketHandler.joinRoom")], gg.prototype, "joinRoom", 1);
26234
+ var kt = /* @__PURE__ */ E("socket"), bO = /* @__PURE__ */ function() {
26223
26235
  function s(r) {
26224
26236
  b(this, s), Object.defineProperty(this, kt, { writable: !0, value: void 0 }), c(this, kt)[kt] = r;
26225
26237
  }
@@ -26334,7 +26346,7 @@ var kt = /* @__PURE__ */ E("socket"), wO = /* @__PURE__ */ function() {
26334
26346
  }
26335
26347
  return e;
26336
26348
  }() }]);
26337
- }(), pn = /* @__PURE__ */ E("socket"), ds = /* @__PURE__ */ E("context"), bO = /* @__PURE__ */ function() {
26349
+ }(), pn = /* @__PURE__ */ E("socket"), ds = /* @__PURE__ */ E("context"), PO = /* @__PURE__ */ function() {
26338
26350
  function s(r, e) {
26339
26351
  b(this, s), Object.defineProperty(this, pn, { writable: !0, value: void 0 }), Object.defineProperty(this, ds, { writable: !0, value: void 0 }), c(this, pn)[pn] = e, c(this, ds)[ds] = r;
26340
26352
  }
@@ -26371,10 +26383,10 @@ var kt = /* @__PURE__ */ E("socket"), wO = /* @__PURE__ */ function() {
26371
26383
  return t(u, o);
26372
26384
  });
26373
26385
  } }]);
26374
- }(), PO = Object.defineProperty, SO = function(r, e, t) {
26375
- return e in r ? PO(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
26376
- }, EO = function(r, e, t) {
26377
- return SO(r, me(e) != "symbol" ? e + "" : e, t), t;
26386
+ }(), SO = Object.defineProperty, EO = function(r, e, t) {
26387
+ return e in r ? SO(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
26388
+ }, CO = function(r, e, t) {
26389
+ return EO(r, me(e) != "symbol" ? e + "" : e, t), t;
26378
26390
  }, Nh = function(r, e, t) {
26379
26391
  if (!e.has(r))
26380
26392
  throw TypeError("Cannot " + t);
@@ -26388,7 +26400,7 @@ var kt = /* @__PURE__ */ E("socket"), wO = /* @__PURE__ */ function() {
26388
26400
  return Nh(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t;
26389
26401
  }, He = function(r, e, t) {
26390
26402
  return Nh(r, e, "access private method"), t;
26391
- }, $c = {}, CO = { get exports() {
26403
+ }, $c = {}, RO = { get exports() {
26392
26404
  return $c;
26393
26405
  }, set exports(s) {
26394
26406
  $c = s;
@@ -26400,7 +26412,7 @@ ho && typeof ho.ownKeys == "function" ? wc = ho.ownKeys : Object.getOwnPropertyS
26400
26412
  } : wc = function(r) {
26401
26413
  return Object.getOwnPropertyNames(r);
26402
26414
  };
26403
- function RO(s) {
26415
+ function _O(s) {
26404
26416
  console && console.warn && console.warn(s);
26405
26417
  }
26406
26418
  var mg = Number.isNaN || function(s) {
@@ -26409,8 +26421,8 @@ var mg = Number.isNaN || function(s) {
26409
26421
  function ze() {
26410
26422
  ze.init.call(this);
26411
26423
  }
26412
- CO.exports = ze;
26413
- $c.once = MO;
26424
+ RO.exports = ze;
26425
+ $c.once = OO;
26414
26426
  ze.EventEmitter = ze;
26415
26427
  ze.prototype._events = void 0;
26416
26428
  ze.prototype._eventsCount = 0;
@@ -26473,7 +26485,7 @@ function kg(s, r, e, t) {
26473
26485
  else if (typeof a == "function" ? a = i[r] = t ? [e, a] : [a, e] : t ? a.unshift(e) : a.push(e), n = yg(s), n > 0 && a.length > n && !a.warned) {
26474
26486
  a.warned = !0;
26475
26487
  var o = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + String(r) + " listeners added. Use emitter.setMaxListeners() to increase limit");
26476
- o.name = "MaxListenersExceededWarning", o.emitter = s, o.type = r, o.count = a.length, RO(o);
26488
+ o.name = "MaxListenersExceededWarning", o.emitter = s, o.type = r, o.count = a.length, _O(o);
26477
26489
  }
26478
26490
  return s;
26479
26491
  }
@@ -26484,12 +26496,12 @@ ze.prototype.on = ze.prototype.addListener;
26484
26496
  ze.prototype.prependListener = function(s, r) {
26485
26497
  return kg(this, s, r, !0);
26486
26498
  };
26487
- function _O() {
26499
+ function AO() {
26488
26500
  if (!this.fired)
26489
26501
  return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
26490
26502
  }
26491
26503
  function Tg(s, r, e) {
26492
- var t = { fired: !1, wrapFn: void 0, target: s, type: r, listener: e }, n = _O.bind(t);
26504
+ var t = { fired: !1, wrapFn: void 0, target: s, type: r, listener: e }, n = AO.bind(t);
26493
26505
  return n.listener = e, t.wrapFn = n, n;
26494
26506
  }
26495
26507
  ze.prototype.once = function(s, r) {
@@ -26514,7 +26526,7 @@ ze.prototype.removeListener = function(s, r) {
26514
26526
  }
26515
26527
  if (n < 0)
26516
26528
  return this;
26517
- n === 0 ? e.shift() : AO(e, n), e.length === 1 && (t[s] = e[0]), t.removeListener !== void 0 && this.emit("removeListener", s, a || r);
26529
+ n === 0 ? e.shift() : IO(e, n), e.length === 1 && (t[s] = e[0]), t.removeListener !== void 0 && this.emit("removeListener", s, a || r);
26518
26530
  }
26519
26531
  return this;
26520
26532
  };
@@ -26543,7 +26555,7 @@ function wg(s, r, e) {
26543
26555
  if (t === void 0)
26544
26556
  return [];
26545
26557
  var n = t[r];
26546
- return n === void 0 ? [] : typeof n == "function" ? e ? [n.listener || n] : [n] : e ? IO(n) : Pg(n, n.length);
26558
+ return n === void 0 ? [] : typeof n == "function" ? e ? [n.listener || n] : [n] : e ? MO(n) : Pg(n, n.length);
26547
26559
  }
26548
26560
  ze.prototype.listeners = function(s) {
26549
26561
  return wg(this, s, !0);
@@ -26574,17 +26586,17 @@ function Pg(s, r) {
26574
26586
  e[t] = s[t];
26575
26587
  return e;
26576
26588
  }
26577
- function AO(s, r) {
26589
+ function IO(s, r) {
26578
26590
  for (; r + 1 < s.length; r++)
26579
26591
  s[r] = s[r + 1];
26580
26592
  s.pop();
26581
26593
  }
26582
- function IO(s) {
26594
+ function MO(s) {
26583
26595
  for (var r = new Array(s.length), e = 0; e < r.length; ++e)
26584
26596
  r[e] = s[e].listener || s[e];
26585
26597
  return r;
26586
26598
  }
26587
- function MO(s, r) {
26599
+ function OO(s, r) {
26588
26600
  return new Promise(function(e, t) {
26589
26601
  function n(a) {
26590
26602
  s.removeListener(r, i), t(a);
@@ -26592,10 +26604,10 @@ function MO(s, r) {
26592
26604
  function i() {
26593
26605
  typeof s.removeListener == "function" && s.removeListener("error", n), e([].slice.call(arguments));
26594
26606
  }
26595
- Sg(s, r, i, { once: !0 }), r !== "error" && OO(s, n, { once: !0 });
26607
+ Sg(s, r, i, { once: !0 }), r !== "error" && DO(s, n, { once: !0 });
26596
26608
  });
26597
26609
  }
26598
- function OO(s, r, e) {
26610
+ function DO(s, r, e) {
26599
26611
  typeof s.on == "function" && Sg(s, "error", r, e);
26600
26612
  }
26601
26613
  function Sg(s, r, e, t) {
@@ -26608,7 +26620,7 @@ function Sg(s, r, e, t) {
26608
26620
  else
26609
26621
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + me(s));
26610
26622
  }
26611
- var DO = /* @__PURE__ */ function(s) {
26623
+ var LO = /* @__PURE__ */ function(s) {
26612
26624
  function r() {
26613
26625
  return b(this, r), C(this, r, ["message.v1.SocketMessage", [{
26614
26626
  no: 1,
@@ -26640,7 +26652,7 @@ var DO = /* @__PURE__ */ function(s) {
26640
26652
  }]]);
26641
26653
  }
26642
26654
  return R(r, s), P(r);
26643
- }(I), ov = new DO(), Eg = /* @__PURE__ */ function() {
26655
+ }(I), ov = new LO(), Eg = /* @__PURE__ */ function() {
26644
26656
  function s() {
26645
26657
  b(this, s);
26646
26658
  }
@@ -26650,13 +26662,13 @@ var DO = /* @__PURE__ */ function(s) {
26650
26662
  return ov.fromBinary(new Uint8Array(e));
26651
26663
  } }]);
26652
26664
  }();
26653
- function LO(s, r) {
26665
+ function NO(s, r) {
26654
26666
  return Math.floor(Math.random() * (r - s + 1) + s);
26655
26667
  }
26656
- var ea, NO = /* @__PURE__ */ function() {
26668
+ var ea, VO = /* @__PURE__ */ function() {
26657
26669
  function s() {
26658
26670
  var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
26659
- b(this, s), EO(this, "opts"), We(this, ea, void 0), this.opts = { initialTimeout: r.initialTimeout || 1e3, maxTimeout: r.maxTimeout || 1e4, factor: r.factor || 2 }, Ue(this, ea, 0);
26671
+ b(this, s), CO(this, "opts"), We(this, ea, void 0), this.opts = { initialTimeout: r.initialTimeout || 1e3, maxTimeout: r.maxTimeout || 1e4, factor: r.factor || 2 }, Ue(this, ea, 0);
26660
26672
  }
26661
26673
  return P(s, [{ key: "wait", value: function() {
26662
26674
  var r = m(/* @__PURE__ */ h().m(function t() {
@@ -26665,7 +26677,7 @@ var ea, NO = /* @__PURE__ */ function() {
26665
26677
  for (; ; )
26666
26678
  switch (i.n) {
26667
26679
  case 0:
26668
- return Ue(this, ea, j(this, ea) + 1), n = LO(0, Math.min(this.opts.maxTimeout, this.opts.initialTimeout * Math.pow(2, j(this, ea)))), i.n = 1, new Promise(function(a) {
26680
+ return Ue(this, ea, j(this, ea) + 1), n = NO(0, Math.min(this.opts.maxTimeout, this.opts.initialTimeout * Math.pow(2, j(this, ea)))), i.n = 1, new Promise(function(a) {
26669
26681
  setTimeout(a, n);
26670
26682
  });
26671
26683
  case 1:
@@ -26684,7 +26696,7 @@ var ea, NO = /* @__PURE__ */ function() {
26684
26696
  } }]);
26685
26697
  }();
26686
26698
  ea = /* @__PURE__ */ new WeakMap();
26687
- var Xi = { debug: 0, info: 1, warn: 2, error: 3 }, ps, vs, VO = /* @__PURE__ */ function() {
26699
+ var Xi = { debug: 0, info: 1, warn: 2, error: 3 }, ps, vs, $O = /* @__PURE__ */ function() {
26688
26700
  function s(r) {
26689
26701
  b(this, s), We(this, ps, void 0), We(this, vs, void 0), Ue(this, ps, console), Ue(this, vs, r);
26690
26702
  }
@@ -26709,12 +26721,12 @@ var Xi = { debug: 0, info: 1, warn: 2, error: 3 }, ps, vs, VO = /* @__PURE__ */
26709
26721
  ps = /* @__PURE__ */ new WeakMap(), vs = /* @__PURE__ */ new WeakMap();
26710
26722
  var Cg = /* @__PURE__ */ function(s) {
26711
26723
  return s[s.CONNECTING = 0] = "CONNECTING", s[s.OPEN = 1] = "OPEN", s[s.CLOSING = 2] = "CLOSING", s[s.CLOSED = 3] = "CLOSED", s;
26712
- }(Cg || {}), uv = "2", cv = "3", Et, to, Je, Tt, ta, zt, Si, la, wn, ro, no, yi, Yd, Rg, hu, bc, Xd, _g, Pc, zl, Uc, Zd, xd, Ag, Cu, Sc, po, Ru, jc, eh, vo, _u, th, Ig, Au, Ec, Iu, Fc, $O = /* @__PURE__ */ function() {
26724
+ }(Cg || {}), uv = "2", cv = "3", Et, to, Je, Tt, ta, zt, Si, la, wn, ro, no, yi, Yd, Rg, hu, bc, Xd, _g, Pc, zl, Uc, Zd, xd, Ag, Cu, Sc, po, Ru, jc, eh, vo, _u, th, Ig, Au, Ec, Iu, Fc, UO = /* @__PURE__ */ function() {
26713
26725
  function s(r, e) {
26714
26726
  var t, n, i, a, o, u, l, d, p, v, f, g;
26715
26727
  b(this, s), We(this, Yd), We(this, hu), We(this, Xd), We(this, Pc), We(this, Uc), We(this, xd), We(this, Cu), We(this, po), We(this, jc), We(this, vo), We(this, th), We(this, Au), We(this, Iu), We(this, Et, void 0), We(this, to, void 0), We(this, Je, void 0), We(this, Tt, void 0), We(this, ta, void 0), We(this, zt, void 0), We(this, Si, void 0), We(this, la, void 0), We(this, wn, void 0), We(this, ro, void 0), We(this, no, void 0), We(this, yi, void 0);
26716
26728
  var y, k, w, T, S, A, M, _, O, D, B;
26717
- Ue(this, to, r), Ue(this, ta, []), Ue(this, zt, new $c()), Ue(this, Si, !0), Ue(this, wn, !1), Ue(this, Je, e != null ? e : {}), (t = (y = j(this, Je)).autoReconnect) !== null && t !== void 0 || (y.autoReconnect = !0), (n = (k = j(this, Je)).retryConnectionInterval) !== null && n !== void 0 || (k.retryConnectionInterval = 1e3), (i = (w = j(this, Je)).pingTimeout) !== null && i !== void 0 || (w.pingTimeout = 3e4), (a = (T = j(this, Je)).connectionTimeout) !== null && a !== void 0 || (T.connectionTimeout = 5e3), (o = (S = j(this, Je)).debug) !== null && o !== void 0 || (S.debug = !0), (u = (A = j(this, Je)).maxReconnectionAttempts) !== null && u !== void 0 || (A.maxReconnectionAttempts = 10), (l = (M = j(this, Je)).disconnectOnPingTimeout) !== null && l !== void 0 || (M.disconnectOnPingTimeout = !0), (d = (_ = j(this, Je)).queueOnDisconnect) !== null && d !== void 0 || (_.queueOnDisconnect = !1), (p = (O = j(this, Je)).flushOnReconnect) !== null && p !== void 0 || (O.flushOnReconnect = !1), (v = (D = j(this, Je)).clientInitiatedPings) !== null && v !== void 0 || (D.clientInitiatedPings = !1), (f = (B = j(this, Je)).clientInitiatedPingInterval) !== null && f !== void 0 || (B.clientInitiatedPingInterval = 3e4), Ue(this, la, { code: void 0, reason: void 0 }), Ue(this, Tt, (g = j(this, Je).logger) !== null && g !== void 0 ? g : new VO(j(this, Je).debug ? "debug" : "info")), Ue(this, yi, new NO());
26729
+ Ue(this, to, r), Ue(this, ta, []), Ue(this, zt, new $c()), Ue(this, Si, !0), Ue(this, wn, !1), Ue(this, Je, e != null ? e : {}), (t = (y = j(this, Je)).autoReconnect) !== null && t !== void 0 || (y.autoReconnect = !0), (n = (k = j(this, Je)).retryConnectionInterval) !== null && n !== void 0 || (k.retryConnectionInterval = 1e3), (i = (w = j(this, Je)).pingTimeout) !== null && i !== void 0 || (w.pingTimeout = 3e4), (a = (T = j(this, Je)).connectionTimeout) !== null && a !== void 0 || (T.connectionTimeout = 5e3), (o = (S = j(this, Je)).debug) !== null && o !== void 0 || (S.debug = !0), (u = (A = j(this, Je)).maxReconnectionAttempts) !== null && u !== void 0 || (A.maxReconnectionAttempts = 10), (l = (M = j(this, Je)).disconnectOnPingTimeout) !== null && l !== void 0 || (M.disconnectOnPingTimeout = !0), (d = (_ = j(this, Je)).queueOnDisconnect) !== null && d !== void 0 || (_.queueOnDisconnect = !1), (p = (O = j(this, Je)).flushOnReconnect) !== null && p !== void 0 || (O.flushOnReconnect = !1), (v = (D = j(this, Je)).clientInitiatedPings) !== null && v !== void 0 || (D.clientInitiatedPings = !1), (f = (B = j(this, Je)).clientInitiatedPingInterval) !== null && f !== void 0 || (B.clientInitiatedPingInterval = 3e4), Ue(this, la, { code: void 0, reason: void 0 }), Ue(this, Tt, (g = j(this, Je).logger) !== null && g !== void 0 ? g : new $O(j(this, Je).debug ? "debug" : "info")), Ue(this, yi, new VO());
26718
26730
  }
26719
26731
  return P(s, [{
26720
26732
  key: "readyState",
@@ -27041,18 +27053,18 @@ Et = /* @__PURE__ */ new WeakMap(), to = /* @__PURE__ */ new WeakMap(), Je = /*
27041
27053
  }, Iu = /* @__PURE__ */ new WeakSet(), Fc = function() {
27042
27054
  He(this, Au, Ec).call(this), j(this, Et) && (j(this, Et).onopen = void 0, j(this, Et).onerror = void 0, j(this, Et).onmessage = void 0, j(this, Et).onclose = void 0);
27043
27055
  };
27044
- var UO = Object.defineProperty, jO = Object.getOwnPropertyDescriptor, ol = function(r, e, t, n) {
27045
- for (var i = n > 1 ? void 0 : n ? jO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27056
+ var jO = Object.defineProperty, FO = Object.getOwnPropertyDescriptor, ol = function(r, e, t, n) {
27057
+ for (var i = n > 1 ? void 0 : n ? FO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27046
27058
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
27047
- return n && i && UO(e, t, i), i;
27048
- }, lv = 65535, FO = 3e3, Mg = (Qr = /* @__PURE__ */ E("url"), fe = /* @__PURE__ */ E("sockrates"), ge = /* @__PURE__ */ E("connectionHandler"), Ut = /* @__PURE__ */ E("socketDisconnectionTimeout"), Le = /* @__PURE__ */ E("context"), Qs = /* @__PURE__ */ E("getSocketURL"), Ys = /* @__PURE__ */ E("generateId"), /* @__PURE__ */ function() {
27059
+ return n && i && jO(e, t, i), i;
27060
+ }, lv = 65535, HO = 3e3, Mg = (Qr = /* @__PURE__ */ E("url"), fe = /* @__PURE__ */ E("sockrates"), ge = /* @__PURE__ */ E("connectionHandler"), Ut = /* @__PURE__ */ E("socketDisconnectionTimeout"), Le = /* @__PURE__ */ E("context"), Qs = /* @__PURE__ */ E("getSocketURL"), Ys = /* @__PURE__ */ E("generateId"), /* @__PURE__ */ function() {
27049
27061
  function s(r, e) {
27050
27062
  var t = e.peerId, n = e.meetingId, i = e.authToken, a = e.capabilities;
27051
- if (b(this, s), Object.defineProperty(this, Ys, { value: qO }), Object.defineProperty(this, Qs, { value: BO }), Object.defineProperty(this, ge, { get: HO, set: void 0 }), Object.defineProperty(this, Qr, { writable: !0, value: void 0 }), Object.defineProperty(this, fe, { writable: !0, value: void 0 }), this.roomName = void 0, this.authToken = void 0, this.capabilities = void 0, Object.defineProperty(this, Ut, { writable: !0, value: void 0 }), Object.defineProperty(this, Le, { writable: !0, value: void 0 }), !t || !n || !i)
27063
+ if (b(this, s), Object.defineProperty(this, Ys, { value: GO }), Object.defineProperty(this, Qs, { value: qO }), Object.defineProperty(this, ge, { get: BO, set: void 0 }), Object.defineProperty(this, Qr, { writable: !0, value: void 0 }), Object.defineProperty(this, fe, { writable: !0, value: void 0 }), this.roomName = void 0, this.authToken = void 0, this.capabilities = void 0, Object.defineProperty(this, Ut, { writable: !0, value: void 0 }), Object.defineProperty(this, Le, { writable: !0, value: void 0 }), !t || !n || !i)
27052
27064
  throw new $("peerId, meetingId, or authToken can not be empty", "0404");
27053
27065
  c(this, Ut)[Ut] = void 0, c(this, Le)[Le] = r, this.capabilities = a, this.roomName = n, this.authToken = i, c(this, Qr)[Qr] = c(this, Qs)[Qs](t);
27054
27066
  var o = a.includes("PING");
27055
- c(this, fe)[fe] = new $O(c(this, Qr)[Qr], {
27067
+ c(this, fe)[fe] = new UO(c(this, Qr)[Qr], {
27056
27068
  autoReconnect: !0,
27057
27069
  disconnectOnPingTimeout: o,
27058
27070
  queueOnDisconnect: !1,
@@ -27201,7 +27213,7 @@ var UO = Object.defineProperty, jO = Object.getOwnPropertyDescriptor, ol = funct
27201
27213
  var o = (n = c(e, ge)[ge].mediaState) !== null && n !== void 0 ? n : {}, u = o.recv, l = o.send;
27202
27214
  u != null && u.state && (u == null ? void 0 : u.state) !== fa.CONNECTED || l != null && l.state && (l == null ? void 0 : l.state) !== fa.CONNECTED ? c(e, Le)[Le].getValue("peerSessionStore").emit(V.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: c(e, ge)[ge].joinAttempted }) : c(e, Ut)[Ut] = setTimeout(function() {
27203
27215
  c(e, Le)[Le].getValue("peerSessionStore").emit(V.SOCKET_SERVICE_DISCONNECTED, { joinAttempted: c(e, ge)[ge].joinAttempted }), c(e, Ut)[Ut] = void 0;
27204
- }, FO), c(e, ge)[ge].updateSocketConnectionState("disconnected");
27216
+ }, HO), c(e, ge)[ge].updateSocketConnectionState("disconnected");
27205
27217
  }), this.onStateEvent("reconnecting", /* @__PURE__ */ m(/* @__PURE__ */ h().m(function t() {
27206
27218
  return h().w(function(n) {
27207
27219
  for (; ; )
@@ -27256,10 +27268,10 @@ var UO = Object.defineProperty, jO = Object.getOwnPropertyDescriptor, ol = funct
27256
27268
  return lo({ servicePrefix: "socket-edge", baseURI: e });
27257
27269
  } }]);
27258
27270
  }());
27259
- function HO() {
27271
+ function BO() {
27260
27272
  return c(this, Le)[Le].getValue("connectionHandler");
27261
27273
  }
27262
- function BO(s) {
27274
+ function qO(s) {
27263
27275
  var r = c(this, Le)[Le].getValue("socketBaseURI") || c(this, Le)[Le].getValue("baseURI"), e = Mg.getSocketEdgeDomain(r);
27264
27276
  typeof ko(c(this, Le)[Le], "socket_server_base") == "string" && (e = ko(c(this, Le)[Le], "socket_server_base"));
27265
27277
  var t = "wss://".concat(e), n = new URL("".concat(t, "/ws")), i = this.peerId, a = N(N({ roomID: this.roomName, peerID: s, authToken: this.authToken, useMediaV2: !0 }, i !== s && { oldPeerID: i }), {}, { ping: this.capabilities.includes("PING"), capabilities: this.capabilities.map(function(o) {
@@ -27270,7 +27282,7 @@ function BO(s) {
27270
27282
  n.searchParams.append(l, d.toString());
27271
27283
  }), n.href;
27272
27284
  }
27273
- function qO() {
27285
+ function GO() {
27274
27286
  return "".concat(this.peerId, "-").concat((Math.random() + 1).toString(36).substring(7));
27275
27287
  }
27276
27288
  var xu = Mg;
@@ -27278,7 +27290,7 @@ ol([L.trace("SocketService.connect")], xu.prototype, "connect", 1);
27278
27290
  ol([L.trace("SocketService.disconnect")], xu.prototype, "disconnect", 1);
27279
27291
  ol([L.trace("SocketService.sendMessagePromise")], xu.prototype, "sendMessagePromise", 1);
27280
27292
  ol([L.trace("SocketService.sendMessagePromiseWithTimeout")], xu.prototype, "sendMessagePromiseWithTimeout", 1);
27281
- var GO = /* @__PURE__ */ function() {
27293
+ var WO = /* @__PURE__ */ function() {
27282
27294
  function s(r) {
27283
27295
  b(this, s), this.socketService = void 0, this.socketService = r;
27284
27296
  }
@@ -27417,10 +27429,10 @@ var GO = /* @__PURE__ */ function() {
27417
27429
  }
27418
27430
  return e;
27419
27431
  }() }]);
27420
- }(), WO = Object.defineProperty, JO = Object.getOwnPropertyDescriptor, KO = function(r, e, t, n) {
27421
- for (var i = n > 1 ? void 0 : n ? JO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27432
+ }(), JO = Object.defineProperty, KO = Object.getOwnPropertyDescriptor, zO = function(r, e, t, n) {
27433
+ for (var i = n > 1 ? void 0 : n ? KO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27422
27434
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
27423
- return n && i && WO(e, t, i), i;
27435
+ return n && i && JO(e, t, i), i;
27424
27436
  }, Lt = /* @__PURE__ */ E("context"), Og = /* @__PURE__ */ function(s) {
27425
27437
  function r(e) {
27426
27438
  var t;
@@ -27615,11 +27627,11 @@ var GO = /* @__PURE__ */ function() {
27615
27627
  });
27616
27628
  } }]);
27617
27629
  }(Gr);
27618
- KO([Wr({ maxInvocations: 60, period: 60 })], Og.prototype, "getConnectedMeetings", 1);
27619
- var zO = Object.defineProperty, QO = Object.getOwnPropertyDescriptor, Vh = function(r, e, t, n) {
27620
- for (var i = n > 1 ? void 0 : n ? QO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27630
+ zO([Wr({ maxInvocations: 60, period: 60 })], Og.prototype, "getConnectedMeetings", 1);
27631
+ var QO = Object.defineProperty, YO = Object.getOwnPropertyDescriptor, Vh = function(r, e, t, n) {
27632
+ for (var i = n > 1 ? void 0 : n ? YO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27621
27633
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
27622
- return n && i && zO(e, t, i), i;
27634
+ return n && i && QO(e, t, i), i;
27623
27635
  }, Dg = (de = /* @__PURE__ */ E("context"), /* @__PURE__ */ function() {
27624
27636
  function s(r) {
27625
27637
  b(this, s), this.connectedMeetings = void 0, Object.defineProperty(this, de, { writable: !0, value: void 0 }), c(this, de)[de] = r, this.connectedMeetings = new Og(r);
@@ -27667,7 +27679,7 @@ var zO = Object.defineProperty, QO = Object.getOwnPropertyDescriptor, Vh = funct
27667
27679
  case 3:
27668
27680
  k.p = 3, g = k.v, this.logger.error("ConnectedMeetingsController:: switchMeeting:: issues in leaving previous meeting. Meeting Id: ".concat((d = c(this, de)[de].getValue("meeting")) === null || d === void 0 || (d = d.meta) === null || d === void 0 ? void 0 : d.meetingId), { error: g });
27669
27681
  case 4:
27670
- return this.logger.info("ConnectedMeetingsController::switchMeeting:: initializing new meeting. Meeting Id: ".concat(u)), k.n = 5, aD.init(N(N({}, c(this, de)[de].getValue("options")), {}, { cachedUserDetails: null, defaults: N(N(N({}, c(this, de)[de].getValue("options").defaults), l), {}, {
27682
+ return this.logger.info("ConnectedMeetingsController::switchMeeting:: initializing new meeting. Meeting Id: ".concat(u)), k.n = 5, sD.init(N(N({}, c(this, de)[de].getValue("options")), {}, { cachedUserDetails: null, defaults: N(N(N({}, c(this, de)[de].getValue("options").defaults), l), {}, {
27671
27683
  /**
27672
27684
  * NOTE(ravindra-cloudflare):
27673
27685
  * Protected methods & variables of SelfMedia,
@@ -27734,10 +27746,10 @@ var zO = Object.defineProperty, QO = Object.getOwnPropertyDescriptor, Vh = funct
27734
27746
  Vh([L.trace("ConnectedMeetingsController.getConnectedMeetings")], ul.prototype, "getConnectedMeetings", 1);
27735
27747
  Vh([L.trace("ConnectedMeetingsController.setupEvents")], ul.prototype, "setupEvents", 1);
27736
27748
  Vh([L.trace("ConnectedMeetingsController.switchMeeting")], ul.prototype, "switchMeeting", 1);
27737
- var YO = Object.defineProperty, XO = Object.getOwnPropertyDescriptor, $h = function(r, e, t, n) {
27738
- for (var i = n > 1 ? void 0 : n ? XO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27749
+ var XO = Object.defineProperty, ZO = Object.getOwnPropertyDescriptor, $h = function(r, e, t, n) {
27750
+ for (var i = n > 1 ? void 0 : n ? ZO(e, t) : e, a = r.length - 1, o; a >= 0; a--)
27739
27751
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
27740
- return n && i && YO(e, t, i), i;
27752
+ return n && i && XO(e, t, i), i;
27741
27753
  }, pu = /* @__PURE__ */ function() {
27742
27754
  function s(r, e, t) {
27743
27755
  b(this, s), this.apiBase = void 0, this.selfController = void 0, this.pollController = void 0, this.chatController = void 0, this.metaController = void 0, this.storesManager = void 0, this.stageController = void 0, this.pluginController = void 0, this.internalsController = void 0, this.recordingController = void 0, this.livestreamController = void 0, this.participantController = void 0, this.connectedMeetingsController = void 0, this.telemetry = void 0, this.logger = void 0, this.apiBase = r, this.storesManager = e.storesManager, this.metaController = e.metaController, this.selfController = e.selfController, this.chatController = e.chatController, this.pollController = e.pollController, this.stageController = e.stageController, this.pluginController = e.pluginController, this.recordingController = e.recordingController, this.internalsController = e.internalsController, this.participantController = e.participantController, this.livestreamController = e.livestreamController, this.connectedMeetingsController = e.connectedMeetingsController, this.telemetry = t.getValue("telemetry"), this.logger = t.getValue("logger");
@@ -27749,7 +27761,7 @@ var YO = Object.defineProperty, XO = Object.getOwnPropertyDescriptor, $h = funct
27749
27761
  for (; ; )
27750
27762
  switch (U.p = U.n) {
27751
27763
  case 0:
27752
- if (i = n.getAllValues(), a = i.peerId, o = i.apiBase, u = i.authToken, l = i.meetingId, d = i.organizationId, p = i.cachedUserDetails, v = i.logger, lO(n), ht.isSupported() !== !1) {
27764
+ if (i = n.getAllValues(), a = i.peerId, o = i.apiBase, u = i.authToken, l = i.meetingId, d = i.organizationId, p = i.cachedUserDetails, v = i.logger, dO(n), ht.isSupported() !== !1) {
27753
27765
  U.n = 1;
27754
27766
  break;
27755
27767
  }
@@ -27830,7 +27842,7 @@ var YO = Object.defineProperty, XO = Object.getOwnPropertyDescriptor, $h = funct
27830
27842
  for (; ; )
27831
27843
  switch (K.n) {
27832
27844
  case 0:
27833
- return f = i.getValue("modules"), g = a.participant, y = i.getValue("defaults"), k = i.getValue("logger"), w = u.viewType, T = u.mediaConstraints.audio, i.setValue("viewType", w), i.setValue("defaults", N({ mediaConfiguration: { audio: { enableHighBitrate: (d = T.enableHighBitrate) !== null && d !== void 0 ? d : !1, enableStereo: (p = T.enableStereo) !== null && p !== void 0 ? p : !1 } } }, y)), i.setValue("maxPreferredStreams", ht.isMobile() ? u.maxVideoStreams.mobile : u.maxVideoStreams.desktop), J = new fO(i, n), x = new GO(n), i.setValue("connectedMeetingsSocketHandler", x), F = new al(i, n), U = new Oi(i, n), ne = new wO(n), be = new gg(i, n), pt = new bO(i, n), je = new vO(n), K.n = 1, Ta.init(i, be, g, l, u);
27845
+ return f = i.getValue("modules"), g = a.participant, y = i.getValue("defaults"), k = i.getValue("logger"), w = u.viewType, T = u.mediaConstraints.audio, i.setValue("viewType", w), i.setValue("defaults", N({ mediaConfiguration: { audio: { enableHighBitrate: (d = T.enableHighBitrate) !== null && d !== void 0 ? d : !1, enableStereo: (p = T.enableStereo) !== null && p !== void 0 ? p : !1 } } }, y)), i.setValue("maxPreferredStreams", ht.isMobile() ? u.maxVideoStreams.mobile : u.maxVideoStreams.desktop), J = new gO(i, n), x = new WO(n), i.setValue("connectedMeetingsSocketHandler", x), F = new al(i, n), U = new Oi(i, n), ne = new bO(n), be = new gg(i, n), pt = new PO(i, n), je = new fO(n), K.n = 1, Ta.init(i, be, g, l, u);
27834
27846
  case 1:
27835
27847
  return vt = K.v, i.setValue("selfController", vt), K.n = 2, Zf.init(i, vt.self, be, J, o);
27836
27848
  case 2:
@@ -27909,7 +27921,7 @@ var YO = Object.defineProperty, XO = Object.getOwnPropertyDescriptor, $h = funct
27909
27921
  $h([L.trace("Controller.init")], cl, "init", 1);
27910
27922
  $h([L.trace("Controller.createRoomNodeClient")], cl, "createRoomNodeClient", 1);
27911
27923
  $h([L.trace("Controller.createSocketService")], cl, "createSocketService", 1);
27912
- var ZO = /* @__PURE__ */ P(function s() {
27924
+ var xO = /* @__PURE__ */ P(function s() {
27913
27925
  var r = this;
27914
27926
  b(this, s), this.battery = void 0, this.logger = void 0, this.init = /* @__PURE__ */ function() {
27915
27927
  var e = m(/* @__PURE__ */ h().m(function t(n) {
@@ -27953,8 +27965,8 @@ var ZO = /* @__PURE__ */ P(function s() {
27953
27965
  (e = r.battery) === null || e === void 0 || e.removeEventListener("chargingchange", r.updateChargeInfo), (t = r.battery) === null || t === void 0 || t.removeEventListener("levelchange", r.updateLevelInfo);
27954
27966
  }
27955
27967
  };
27956
- }), dv = new ZO();
27957
- function xO(s, r) {
27968
+ }), dv = new xO();
27969
+ function eD(s, r) {
27958
27970
  s.startsWith("eyJ") || console.error("Invalid auth token provided. Ensure you are passing a %cparticipant `authToken`%c — not an Org API Key or an incorrectly formatted token.\nYou get the participant token from the Add Participant API: https://docs.realtime.cloudflare.com/api#/operations/add_participant", "font-weight: bold", "font-weight: normal");
27959
27971
  try {
27960
27972
  var e = JSON.parse(atob(s.split(".")[1])), t = e.meetingId, n = e.orgId, i = e.participantId;
@@ -27968,9 +27980,9 @@ function xO(s, r) {
27968
27980
  throw new $("Invalid auth token", "0004");
27969
27981
  }
27970
27982
  }
27971
- var vn = /* @__PURE__ */ E("audioEl"), hi = /* @__PURE__ */ E("stream"), pi = /* @__PURE__ */ E("tracks"), Mu = /* @__PURE__ */ E("onError"), Ql = /* @__PURE__ */ E("runErrorCallbacks"), eD = /* @__PURE__ */ function() {
27983
+ var vn = /* @__PURE__ */ E("audioEl"), hi = /* @__PURE__ */ E("stream"), pi = /* @__PURE__ */ E("tracks"), Mu = /* @__PURE__ */ E("onError"), Ql = /* @__PURE__ */ E("runErrorCallbacks"), tD = /* @__PURE__ */ function() {
27972
27984
  function s() {
27973
- b(this, s), Object.defineProperty(this, Ql, { value: tD }), Object.defineProperty(this, vn, { writable: !0, value: new Audio() }), Object.defineProperty(this, hi, { writable: !0, value: new MediaStream() }), Object.defineProperty(this, pi, { writable: !0, value: /* @__PURE__ */ new Map() }), Object.defineProperty(this, Mu, { writable: !0, value: void 0 }), c(this, vn)[vn].srcObject = c(this, hi)[hi], c(this, vn)[vn].autoplay = !0;
27985
+ b(this, s), Object.defineProperty(this, Ql, { value: rD }), Object.defineProperty(this, vn, { writable: !0, value: new Audio() }), Object.defineProperty(this, hi, { writable: !0, value: new MediaStream() }), Object.defineProperty(this, pi, { writable: !0, value: /* @__PURE__ */ new Map() }), Object.defineProperty(this, Mu, { writable: !0, value: void 0 }), c(this, vn)[vn].srcObject = c(this, hi)[hi], c(this, vn)[vn].autoplay = !0;
27974
27986
  }
27975
27987
  return P(s, [{ key: "playTracks", value: function() {
27976
27988
  var r = m(/* @__PURE__ */ h().m(function t(n) {
@@ -28015,11 +28027,11 @@ var vn = /* @__PURE__ */ E("audioEl"), hi = /* @__PURE__ */ E("stream"), pi = /*
28015
28027
  c(this, Mu)[Mu] = e;
28016
28028
  } }]);
28017
28029
  }();
28018
- function tD(s) {
28030
+ function rD(s) {
28019
28031
  var r, e;
28020
28032
  (r = (e = c(this, Mu))[Mu]) === null || r === void 0 || r.call(e, s);
28021
28033
  }
28022
- var vi = /* @__PURE__ */ E("trackMap"), rD = /* @__PURE__ */ function(s) {
28034
+ var vi = /* @__PURE__ */ E("trackMap"), nD = /* @__PURE__ */ function(s) {
28023
28035
  function r() {
28024
28036
  var e;
28025
28037
  return b(this, r), e = C(this, r), Object.defineProperty(e, vi, { writable: !0, value: void 0 }), c(e, vi)[vi] = /* @__PURE__ */ new Map(), e;
@@ -28030,10 +28042,10 @@ var vi = /* @__PURE__ */ E("trackMap"), rD = /* @__PURE__ */ function(s) {
28030
28042
  var n = c(this, vi)[vi].get(t);
28031
28043
  n && this.removeTrack(n), c(this, vi)[vi].delete(t);
28032
28044
  } }]);
28033
- }(eD), nD = Object.defineProperty, iD = Object.getOwnPropertyDescriptor, ll = function(r, e, t, n) {
28034
- for (var i = n > 1 ? void 0 : n ? iD(e, t) : e, a = r.length - 1, o; a >= 0; a--)
28045
+ }(tD), iD = Object.defineProperty, aD = Object.getOwnPropertyDescriptor, ll = function(r, e, t, n) {
28046
+ for (var i = n > 1 ? void 0 : n ? aD(e, t) : e, a = r.length - 1, o; a >= 0; a--)
28035
28047
  (o = r[a]) && (i = (n ? o(e, t, i) : o(i)) || i);
28036
- return n && i && nD(e, t, i), i;
28048
+ return n && i && iD(e, t, i), i;
28037
28049
  }, ga = (Ae = /* @__PURE__ */ E("controller"), Fn = /* @__PURE__ */ E("context"), /* @__PURE__ */ function() {
28038
28050
  function s(r, e) {
28039
28051
  b(this, s), Object.defineProperty(this, Ae, { writable: !0, value: void 0 }), Object.defineProperty(this, Fn, { writable: !0, value: void 0 }), c(this, Fn)[Fn] = r, c(this, Ae)[Ae] = e;
@@ -28226,7 +28238,7 @@ var vi = /* @__PURE__ */ E("trackMap"), rD = /* @__PURE__ */ function(s) {
28226
28238
  for (; ; )
28227
28239
  switch (D.n) {
28228
28240
  case 0:
28229
- if (ht.init(), f = (i = n == null || (a = n.cachedUserDetails) === null || a === void 0 ? void 0 : a.peerId) !== null && i !== void 0 ? i : fo(), g = n.authToken, y = n.baseURI, k = xO(g, y), w = k.meetingId, T = nh(k, Vg), !((o = T.baseURI) !== null && o !== void 0 && o.includes("dyte.io"))) {
28241
+ if (ht.init(), f = (i = n == null || (a = n.cachedUserDetails) === null || a === void 0 ? void 0 : a.peerId) !== null && i !== void 0 ? i : fo(), g = n.authToken, y = n.baseURI, k = eD(g, y), w = k.meetingId, T = nh(k, Vg), !((o = T.baseURI) !== null && o !== void 0 && o.includes("dyte.io"))) {
28230
28242
  D.n = 1;
28231
28243
  break;
28232
28244
  }
@@ -28254,14 +28266,14 @@ var vi = /* @__PURE__ */ E("trackMap"), rD = /* @__PURE__ */ function(s) {
28254
28266
  }, { key: "setupContext", value: function(e, t, n, i) {
28255
28267
  var a, o, u = ha.createContext(e, t), l = N(N({}, Fb), t == null ? void 0 : t.modules), d = t.defaults || { audio: !0, video: !0 };
28256
28268
  return u.setValue("options", t), u.setValue("peerId", e), u.setValue("modules", l), u.setValue("sdkName", "web-core"), u.setValue("meetingId", n), u.setValue("apiBase", i.apiBase), u.setValue("baseURI", i.baseURI), u.setValue("userId", i.participantId), u.setValue("organizationId", i.orgId), u.setValue("authToken", t.authToken), u.setValue("overrides", (a = t.overrides) !== null && a !== void 0 ? a : {}), u.setValue("env", Hb({ baseURI: i.baseURI })), u.setValue("defaults", d), u.setValue("onError", t.onError || function() {
28257
- }), u.setValue("cachedUserDetails", Bn(t.cachedUserDetails)), u.setValue("sdkVersion", "2.0.2-staging.3"), (o = t.modules) !== null && o !== void 0 && o.experimentalAudioPlayback && u.setValue("audioPlayback", new rD()), u;
28269
+ }), u.setValue("cachedUserDetails", Bn(t.cachedUserDetails)), u.setValue("sdkVersion", "2.0.2-staging.4"), (o = t.modules) !== null && o !== void 0 && o.experimentalAudioPlayback && u.setValue("audioPlayback", new nD()), u;
28258
28270
  } }]);
28259
28271
  }());
28260
28272
  ll([ir("0002"), Li.executeWithLock({ methodName: "meeting.join", lockName: "Client.join", timeout: 3e3 })], ga.prototype, "join", 1);
28261
28273
  ll([ir("0003")], ga.prototype, "leave", 1);
28262
28274
  ll([ir("0001"), Li.executeWithLock({ methodName: "Client.init", lockName: "Client.init", timeout: 3e3 })], ga, "init", 1);
28263
28275
  ga = ll([ir("0000")], ga);
28264
- var aD = ga;
28276
+ var sD = ga;
28265
28277
  export {
28266
- aD as default
28278
+ sD as default
28267
28279
  };