@cloudflare/realtimekit 1.5.2-staging.5 → 1.5.2-staging.7
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/EncryptionManager.d.ts +0 -1
- package/dist/browser.js +11 -11
- package/dist/dependencies.txt +1 -1
- package/dist/index.cjs.js +5 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +167 -171
- package/dist/index.es5.js +157 -160
- package/dist/index.rn.js +5 -5
- package/dist/ts3.4/dist/EncryptionManager.d.ts +0 -1
- package/dist/ts3.4/dist/index.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.es5.js
CHANGED
|
@@ -3,7 +3,7 @@ import ov from "bowser";
|
|
|
3
3
|
import { MessageType as _, PbLong as Co, typeofJsonValue as Wg } from "@protobuf-ts/runtime";
|
|
4
4
|
import * as cc from "worker-timers";
|
|
5
5
|
import * as mn from "sdp-transform";
|
|
6
|
-
var Ag = ["chat", "connectedMeetings", "plugins", "polls", "media"], Ig = ["id"], Mg = ["meetingId"], ee, An, $e, ra, bc, Us, In, Tc, Qu, $i, Li, io, zt, Ni, Mn, ta, js, _n, Fs, Hs, Qt, Vi,
|
|
6
|
+
var Ag = ["chat", "connectedMeetings", "plugins", "polls", "media"], Ig = ["id"], Mg = ["meetingId"], ee, An, $e, ra, bc, Us, In, Tc, Qu, $i, Li, io, zt, Ni, Mn, ta, js, _n, Fs, Hs, Qt, Vi, Sr, On, Ui, Bs, qs, Dn, $n, Gs, Ln, na, ji, Fi, Hi, Nr, Le, Bi, qi, Rr, Nn, rn, Vn, Yu, ft, Ws, Xt, Un, gt, Xu, Js, Zu, xu, be, Ks, jn, Gi, Fn, mr, Vr, Wr, Wi, Ji, ar, Ki, Ve, mt, Ne, zi, Se, ia, aa, zs, Qd, Qi, Jr, X, yr, Yt, ye, ke, Ur, Ue, Qs, Ys, pe, Oe, Hn;
|
|
7
7
|
function Yd(s, t) {
|
|
8
8
|
if (s == null)
|
|
9
9
|
return {};
|
|
@@ -2124,12 +2124,12 @@ var Vv = /* @__PURE__ */ S(function s() {
|
|
|
2124
2124
|
}
|
|
2125
2125
|
if (d.producerStreamMap.forEach(function(re, te) {
|
|
2126
2126
|
if (re.outboundVideoRtpId.length > 0) {
|
|
2127
|
-
var
|
|
2127
|
+
var Ar, kr, Oa, Tt, Da, $a, La, Na, wt, Va, Eo = [];
|
|
2128
2128
|
re.outboundVideoRtpId.forEach(function(al) {
|
|
2129
2129
|
Eo.push(d.outboundVideoRtp.get(al));
|
|
2130
2130
|
});
|
|
2131
2131
|
var Ce = n.getWorkingSimulcastVideoStats(Eo);
|
|
2132
|
-
Ce.score = _v({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((
|
|
2132
|
+
Ce.score = _v({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((Ar = Ce.remoteData) === null || Ar === void 0 ? void 0 : Ar.jitter) || 0, isScreenShare: n.screenShareProducers.has(te), packetsSent: (Ce.packetsSent || 0) - (((kr = n.videoProducerToStatsMap.get(te)) === null || kr === void 0 ? void 0 : kr.packetsSent) || 0), packetsLost: (((Oa = Ce.remoteData) === null || Oa === void 0 ? void 0 : Oa.packetsLost) || 0) - (((Tt = n.videoProducerToStatsMap.get(te)) === null || Tt === void 0 || (Tt = Tt.remoteData) === null || Tt === void 0 ? void 0 : Tt.packetsLost) || 0), framesEncoded: (Ce.framesEncoded || 0) - (((Da = n.videoProducerToStatsMap.get(te)) === null || Da === void 0 ? void 0 : Da.framesEncoded) || 0) }), k.set(te, {
|
|
2133
2133
|
score: +(Ce.score * 10).toFixed(),
|
|
2134
2134
|
frameWidth: Ce.frameWidth || 0,
|
|
2135
2135
|
frameHeight: Ce.frameHeight || 0,
|
|
@@ -2143,23 +2143,23 @@ var Vv = /* @__PURE__ */ S(function s() {
|
|
|
2143
2143
|
bandwidthLimitations: Ce.qualityLimitationReason === "bandwidth"
|
|
2144
2144
|
}), n.videoProducerToStatsMap.set(te, Ce);
|
|
2145
2145
|
} else if (re.outboundAudioRtpId.length > 0) {
|
|
2146
|
-
var Ua, ja, Pt, Fa, Ha, Ba, qa, St, Ga,
|
|
2147
|
-
|
|
2148
|
-
score: +(
|
|
2149
|
-
bitrate: ((
|
|
2146
|
+
var Ua, ja, Pt, Fa, Ha, Ba, qa, St, Ga, Ir = d.outboundAudioRtp.get(re.outboundAudioRtpId[0]);
|
|
2147
|
+
Ir.score = Mv({ packetsSent: (Ir.packetsSent || 0) - (((Ua = n.audioProducerToStatsMap.get(te)) === null || Ua === void 0 ? void 0 : Ua.packetsSent) || 0), packetsLost: (((ja = Ir.remoteData) === null || ja === void 0 ? void 0 : ja.packetsLost) || 0) - (((Pt = n.audioProducerToStatsMap.get(te)) === null || Pt === void 0 || (Pt = Pt.remoteData) === null || Pt === void 0 ? void 0 : Pt.packetsLost) || 0), jitter: ((Fa = Ir.remoteData) === null || Fa === void 0 ? void 0 : Fa.jitter) || 0 }), k.set(te, {
|
|
2148
|
+
score: +(Ir.score * 10).toFixed(),
|
|
2149
|
+
bitrate: ((Ir.bytesSent || 0) - (((Ha = n.audioProducerToStatsMap.get(te)) === null || Ha === void 0 ? void 0 : Ha.bytesSent) || 0)) * 8 / 7,
|
|
2150
2150
|
// Bytes received in last 7 seconds
|
|
2151
|
-
packetsLostPercentage: Pc({ packetsSent: (
|
|
2152
|
-
jitter: ((Ga =
|
|
2151
|
+
packetsLostPercentage: Pc({ packetsSent: (Ir.packetsSent || 0) - (((Ba = n.audioProducerToStatsMap.get(te)) === null || Ba === void 0 ? void 0 : Ba.packetsSent) || 0), packetsLost: (((qa = Ir.remoteData) === null || qa === void 0 ? void 0 : qa.packetsLost) || 0) - (((St = n.audioProducerToStatsMap.get(te)) === null || St === void 0 || (St = St.remoteData) === null || St === void 0 ? void 0 : St.packetsLost) || 0) }),
|
|
2152
|
+
jitter: ((Ga = Ir.remoteData) === null || Ga === void 0 ? void 0 : Ga.jitter) || 0,
|
|
2153
2153
|
isScreenShare: n.screenShareProducers.has(te)
|
|
2154
|
-
}), n.audioProducerToStatsMap.set(te,
|
|
2154
|
+
}), n.audioProducerToStatsMap.set(te, Ir);
|
|
2155
2155
|
}
|
|
2156
2156
|
}), g.forEach(function(re) {
|
|
2157
2157
|
var te = v.find(function(kr) {
|
|
2158
2158
|
return kr.id === re.localCandidateId ? (re.localCandidateId = kr.id, kr) : null;
|
|
2159
|
-
}),
|
|
2159
|
+
}), Ar = f.find(function(kr) {
|
|
2160
2160
|
return kr.id === re.remoteCandidateId ? (re.remoteCandidateId = kr.id, kr) : null;
|
|
2161
2161
|
});
|
|
2162
|
-
te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort),
|
|
2162
|
+
te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort), Ar && (re.remoteCandidateType = Ar.type, re.remoteCandidateAddress = ca(Ar.address), re.remoteCandidatePort = Ar.port, re.remoteCandidateProtocol = Ar.protocol, re.remoteCandidateUrl = Ar.url);
|
|
2163
2163
|
}), 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 = {
|
|
2164
2164
|
// candidateStats: result.candidatePair,
|
|
2165
2165
|
bytesReceived: d.candidatePair.bytesReceived,
|
|
@@ -2762,12 +2762,12 @@ var Vv = /* @__PURE__ */ S(function s() {
|
|
|
2762
2762
|
}
|
|
2763
2763
|
if (d.producerStreamMap.forEach(function(re, te) {
|
|
2764
2764
|
if (re.outboundVideoRtpId.length > 0) {
|
|
2765
|
-
var
|
|
2765
|
+
var Ar, kr, Oa, Tt, Da, $a, La, Na, wt, Va, Eo = [];
|
|
2766
2766
|
re.outboundVideoRtpId.forEach(function(al) {
|
|
2767
2767
|
Eo.push(d.outboundVideoRtp.get(al));
|
|
2768
2768
|
});
|
|
2769
2769
|
var Ce = n.getWorkingSimulcastVideoStats(Eo);
|
|
2770
|
-
Ce.score = _v({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((
|
|
2770
|
+
Ce.score = _v({ frameWidth: Ce.frameWidth || 0, framesPerSecond: Ce.framesPerSecond || 0, jitter: ((Ar = Ce.remoteData) === null || Ar === void 0 ? void 0 : Ar.jitter) || 0, isScreenShare: n.screenShareProducers.has(te), packetsSent: (Ce.packetsSent || 0) - (((kr = n.videoProducerToStatsMap.get(te)) === null || kr === void 0 ? void 0 : kr.packetsSent) || 0), packetsLost: (((Oa = Ce.remoteData) === null || Oa === void 0 ? void 0 : Oa.packetsLost) || 0) - (((Tt = n.videoProducerToStatsMap.get(te)) === null || Tt === void 0 || (Tt = Tt.remoteData) === null || Tt === void 0 ? void 0 : Tt.packetsLost) || 0), framesEncoded: (Ce.framesEncoded || 0) - (((Da = n.videoProducerToStatsMap.get(te)) === null || Da === void 0 ? void 0 : Da.framesEncoded) || 0) }), k.set(te, {
|
|
2771
2771
|
score: +(Ce.score * 10).toFixed(),
|
|
2772
2772
|
frameWidth: Ce.frameWidth || 0,
|
|
2773
2773
|
frameHeight: Ce.frameHeight || 0,
|
|
@@ -2781,23 +2781,23 @@ var Vv = /* @__PURE__ */ S(function s() {
|
|
|
2781
2781
|
bandwidthLimitations: Ce.qualityLimitationReason === "bandwidth"
|
|
2782
2782
|
}), n.videoProducerToStatsMap.set(te, Ce);
|
|
2783
2783
|
} else if (re.outboundAudioRtpId.length > 0) {
|
|
2784
|
-
var Ua, ja, Pt, Fa, Ha, Ba, qa, St, Ga,
|
|
2785
|
-
|
|
2786
|
-
score: +(
|
|
2787
|
-
bitrate: ((
|
|
2784
|
+
var Ua, ja, Pt, Fa, Ha, Ba, qa, St, Ga, Ir = d.outboundAudioRtp.get(re.outboundAudioRtpId[0]);
|
|
2785
|
+
Ir.score = Mv({ packetsSent: (Ir.packetsSent || 0) - (((Ua = n.audioProducerToStatsMap.get(te)) === null || Ua === void 0 ? void 0 : Ua.packetsSent) || 0), packetsLost: (((ja = Ir.remoteData) === null || ja === void 0 ? void 0 : ja.packetsLost) || 0) - (((Pt = n.audioProducerToStatsMap.get(te)) === null || Pt === void 0 || (Pt = Pt.remoteData) === null || Pt === void 0 ? void 0 : Pt.packetsLost) || 0), jitter: ((Fa = Ir.remoteData) === null || Fa === void 0 ? void 0 : Fa.jitter) || 0 }), k.set(te, {
|
|
2786
|
+
score: +(Ir.score * 10).toFixed(),
|
|
2787
|
+
bitrate: ((Ir.bytesSent || 0) - (((Ha = n.audioProducerToStatsMap.get(te)) === null || Ha === void 0 ? void 0 : Ha.bytesSent) || 0)) * 8 / 7,
|
|
2788
2788
|
// Bytes received in last 7 seconds
|
|
2789
|
-
packetsLostPercentage: Pc({ packetsSent: (
|
|
2790
|
-
jitter: ((Ga =
|
|
2789
|
+
packetsLostPercentage: Pc({ packetsSent: (Ir.packetsSent || 0) - (((Ba = n.audioProducerToStatsMap.get(te)) === null || Ba === void 0 ? void 0 : Ba.packetsSent) || 0), packetsLost: (((qa = Ir.remoteData) === null || qa === void 0 ? void 0 : qa.packetsLost) || 0) - (((St = n.audioProducerToStatsMap.get(te)) === null || St === void 0 || (St = St.remoteData) === null || St === void 0 ? void 0 : St.packetsLost) || 0) }),
|
|
2790
|
+
jitter: ((Ga = Ir.remoteData) === null || Ga === void 0 ? void 0 : Ga.jitter) || 0,
|
|
2791
2791
|
isScreenShare: n.screenShareProducers.has(te)
|
|
2792
|
-
}), n.audioProducerToStatsMap.set(te,
|
|
2792
|
+
}), n.audioProducerToStatsMap.set(te, Ir);
|
|
2793
2793
|
}
|
|
2794
2794
|
}), g.forEach(function(re) {
|
|
2795
2795
|
var te = v.find(function(kr) {
|
|
2796
2796
|
return kr.id === re.localCandidateId ? (re.localCandidateId = kr.id, kr) : null;
|
|
2797
|
-
}),
|
|
2797
|
+
}), Ar = f.find(function(kr) {
|
|
2798
2798
|
return kr.id === re.remoteCandidateId ? (re.remoteCandidateId = kr.id, kr) : null;
|
|
2799
2799
|
});
|
|
2800
|
-
te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort),
|
|
2800
|
+
te && (re.localCandidateType = te.type, re.localCandidateAddress = ca(te.address), re.localCandidatePort = te.port, re.localCandidateProtocol = te.protocol, re.localCandidateUrl = te.url, re.localCandidateNetworkType = te.networkType, re.localCandidateRelatedAddress = ca(te.relatedAddress), re.localCandidateRelatedPort = te.relatedPort), Ar && (re.remoteCandidateType = Ar.type, re.remoteCandidateAddress = ca(Ar.address), re.remoteCandidatePort = Ar.port, re.remoteCandidateProtocol = Ar.protocol, re.remoteCandidateUrl = Ar.url);
|
|
2801
2801
|
}), 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 = {
|
|
2802
2802
|
// candidateStats: result.candidatePair,
|
|
2803
2803
|
bytesReceived: d.candidatePair.bytesReceived,
|
|
@@ -10715,9 +10715,9 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10715
10715
|
return n && i && oA(e, r, i), i;
|
|
10716
10716
|
}, xt = /* @__PURE__ */ function(s) {
|
|
10717
10717
|
return s[s.TEXT = 0] = "TEXT", s[s.IMAGE = 1] = "IMAGE", s[s.FILE = 2] = "FILE", s[s.CUSTOM = 3] = "CUSTOM", s;
|
|
10718
|
-
}(xt || {}),
|
|
10718
|
+
}(xt || {}), Mr = /* @__PURE__ */ E("socket"), za = /* @__PURE__ */ E("context"), Mi = /* @__PURE__ */ function() {
|
|
10719
10719
|
function s(t, e) {
|
|
10720
|
-
P(this, s), Object.defineProperty(this,
|
|
10720
|
+
P(this, s), Object.defineProperty(this, Mr, { writable: !0, value: void 0 }), Object.defineProperty(this, za, { writable: !0, value: void 0 }), c(this, Mr)[Mr] = e, c(this, za)[za] = t;
|
|
10721
10721
|
}
|
|
10722
10722
|
return S(s, [{
|
|
10723
10723
|
key: "telemetry",
|
|
@@ -10737,7 +10737,7 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10737
10737
|
}, { key: "logger", get: function() {
|
|
10738
10738
|
return c(this, za)[za].getValue("logger");
|
|
10739
10739
|
} }, { key: "getChatMessages", value: function() {
|
|
10740
|
-
return c(this,
|
|
10740
|
+
return c(this, Mr)[Mr].sendMessagePromise(Kr.getMessages);
|
|
10741
10741
|
} }, { key: "getChatMessagesPaginated", value: function() {
|
|
10742
10742
|
var t = m(/* @__PURE__ */ h().mark(function r(n, i, a, o) {
|
|
10743
10743
|
var u, l;
|
|
@@ -10751,7 +10751,7 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10751
10751
|
from: 0,
|
|
10752
10752
|
// NOTE(ikabra): We do not need offset for timeStamp based pagination.
|
|
10753
10753
|
reversed: a
|
|
10754
|
-
}, o && { filters: { filters: o } }), p.next = 3, c(this,
|
|
10754
|
+
}, o && { filters: { filters: o } }), p.next = 3, c(this, Mr)[Mr].sendMessagePromise(Kr.getPaginatedMessages, mR.toBinary(u));
|
|
10755
10755
|
case 3:
|
|
10756
10756
|
if (l = p.sent, l.payload) {
|
|
10757
10757
|
p.next = 6;
|
|
@@ -10772,10 +10772,10 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10772
10772
|
return e;
|
|
10773
10773
|
}() }, { key: "sendMessageToRoom", value: function(e, r) {
|
|
10774
10774
|
var n = { payloadType: r, payload: e };
|
|
10775
|
-
c(this,
|
|
10775
|
+
c(this, Mr)[Mr].sendMessage(Kr.sendMessageToRoom, wR.toBinary(n));
|
|
10776
10776
|
} }, { key: "sendMessageToPeers", value: function(e, r, n) {
|
|
10777
10777
|
var i = { payloadType: r, peerIds: n, payload: e };
|
|
10778
|
-
c(this,
|
|
10778
|
+
c(this, Mr)[Mr].sendMessage(Kr.sendMessageToPeers, ER.toBinary(i));
|
|
10779
10779
|
} }, { key: "sendMessage", value: function(e, r, n) {
|
|
10780
10780
|
if (n && n.length > 0) {
|
|
10781
10781
|
this.sendMessageToPeers(e, r, n);
|
|
@@ -10789,7 +10789,7 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10789
10789
|
for (; ; )
|
|
10790
10790
|
switch (p.prev = p.next) {
|
|
10791
10791
|
case 0:
|
|
10792
|
-
return u = { chatId: n, payloadType: a, payload: i }, o !== void 0 && (u.pinned = o), p.next = 4, c(this,
|
|
10792
|
+
return u = { chatId: n, payloadType: a, payload: i }, o !== void 0 && (u.pinned = o), p.next = 4, c(this, Mr)[Mr].sendMessagePromise(Kr.editMessage, MR.toBinary(u));
|
|
10793
10793
|
case 4:
|
|
10794
10794
|
return l = p.sent, p.abrupt("return", ac.fromBinary(l.payload).message);
|
|
10795
10795
|
case 6:
|
|
@@ -10809,7 +10809,7 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10809
10809
|
for (; ; )
|
|
10810
10810
|
switch (l.prev = l.next) {
|
|
10811
10811
|
case 0:
|
|
10812
|
-
return i = { chatId: n }, l.next = 3, c(this,
|
|
10812
|
+
return i = { chatId: n }, l.next = 3, c(this, Mr)[Mr].sendMessagePromise(Kr.deleteMessage, NR.toBinary(i));
|
|
10813
10813
|
case 3:
|
|
10814
10814
|
return a = l.sent, o = sc.fromBinary(a.payload), l.abrupt("return", { id: o.chatId });
|
|
10815
10815
|
case 6:
|
|
@@ -10829,7 +10829,7 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10829
10829
|
for (; ; )
|
|
10830
10830
|
switch (f.prev = f.next) {
|
|
10831
10831
|
case 0:
|
|
10832
|
-
return d = { searchTerm: n, timeStamp: (a = i.timestamp) !== null && a !== void 0 ? a : Date.now(), size: (o = i.limit) !== null && o !== void 0 ? o : 75, from: (u = i.offset) !== null && u !== void 0 ? u : 0, reversed: (l = i.reversed) !== null && l !== void 0 ? l : !0 }, f.prev = 1, f.next = 4, c(this,
|
|
10832
|
+
return d = { searchTerm: n, timeStamp: (a = i.timestamp) !== null && a !== void 0 ? a : Date.now(), size: (o = i.limit) !== null && o !== void 0 ? o : 75, from: (u = i.offset) !== null && u !== void 0 ? u : 0, reversed: (l = i.reversed) !== null && l !== void 0 ? l : !0 }, f.prev = 1, f.next = 4, c(this, Mr)[Mr].sendMessagePromise(Kr.searchChannelMessages, jR.toBinary(d));
|
|
10833
10833
|
case 4:
|
|
10834
10834
|
return p = f.sent, f.abrupt("return", Vf.fromBinary(p.payload).messages);
|
|
10835
10835
|
case 8:
|
|
@@ -10851,7 +10851,7 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10851
10851
|
for (; ; )
|
|
10852
10852
|
switch (l.prev = l.next) {
|
|
10853
10853
|
case 0:
|
|
10854
|
-
return a = { chatId: n, pinned: i }, l.next = 3, c(this,
|
|
10854
|
+
return a = { chatId: n, pinned: i }, l.next = 3, c(this, Mr)[Mr].sendMessagePromise(Kr.pinMessage, OR.toBinary(a));
|
|
10855
10855
|
case 3:
|
|
10856
10856
|
return o = l.sent, l.abrupt("return", ic.fromBinary(o.payload));
|
|
10857
10857
|
case 5:
|
|
@@ -10892,7 +10892,7 @@ var Y = qu(X1, tA), Kr = qu(Z1, nA), mi = qu(x1, iA), yi = qu(eA, aA), sa = Ff(j
|
|
|
10892
10892
|
this.logger.warn("ChatSocketHandler::Event ".concat(e, " is not recognized"));
|
|
10893
10893
|
return;
|
|
10894
10894
|
}
|
|
10895
|
-
c(this,
|
|
10895
|
+
c(this, Mr)[Mr].on(e, function(o) {
|
|
10896
10896
|
var u = o.payload, l = a;
|
|
10897
10897
|
try {
|
|
10898
10898
|
l = i(u);
|
|
@@ -12854,9 +12854,9 @@ var HA = Object.defineProperty, BA = Object.getOwnPropertyDescriptor, qA = funct
|
|
|
12854
12854
|
for (var i = n > 1 ? void 0 : n ? BA(e, r) : e, a = t.length - 1, o; a >= 0; a--)
|
|
12855
12855
|
(o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
|
|
12856
12856
|
return n && i && HA(e, r, i), i;
|
|
12857
|
-
}, Wf = (Qt = /* @__PURE__ */ E("self"), Vi = /* @__PURE__ */ E("roomSocketHandler"),
|
|
12857
|
+
}, Wf = (Qt = /* @__PURE__ */ E("self"), Vi = /* @__PURE__ */ E("roomSocketHandler"), Sr = /* @__PURE__ */ E("context"), /* @__PURE__ */ function() {
|
|
12858
12858
|
function s(t, e, r, n, i, a) {
|
|
12859
|
-
P(this, s), this.meta = void 0, this.ai = void 0, Object.defineProperty(this, Qt, { writable: !0, value: void 0 }), Object.defineProperty(this, Vi, { writable: !0, value: void 0 }), this.aiSocketHandler = void 0, Object.defineProperty(this,
|
|
12859
|
+
P(this, s), this.meta = void 0, this.ai = void 0, Object.defineProperty(this, Qt, { writable: !0, value: void 0 }), Object.defineProperty(this, Vi, { writable: !0, value: void 0 }), this.aiSocketHandler = void 0, Object.defineProperty(this, Sr, { writable: !0, value: void 0 }), c(this, Sr)[Sr] = t, this.meta = new ud(t, e, e.config.viewType, r, a), this.ai = n, c(this, Qt)[Qt] = e, c(this, Vi)[Vi] = r, this.aiSocketHandler = i, this.setupEvents();
|
|
12860
12860
|
}
|
|
12861
12861
|
return S(s, [{
|
|
12862
12862
|
key: "telemetry",
|
|
@@ -12866,7 +12866,7 @@ var HA = Object.defineProperty, BA = Object.getOwnPropertyDescriptor, qA = funct
|
|
|
12866
12866
|
* Not for external use
|
|
12867
12867
|
*/
|
|
12868
12868
|
function() {
|
|
12869
|
-
return c(this,
|
|
12869
|
+
return c(this, Sr)[Sr].getValue("telemetry");
|
|
12870
12870
|
}
|
|
12871
12871
|
)
|
|
12872
12872
|
/**
|
|
@@ -12874,26 +12874,26 @@ var HA = Object.defineProperty, BA = Object.getOwnPropertyDescriptor, qA = funct
|
|
|
12874
12874
|
* Not for external use
|
|
12875
12875
|
*/
|
|
12876
12876
|
}, { key: "logger", get: function() {
|
|
12877
|
-
return c(this,
|
|
12877
|
+
return c(this, Sr)[Sr].getValue("logger");
|
|
12878
12878
|
} }, { key: "conditionallySetActiveTab", value: function(e) {
|
|
12879
12879
|
var r;
|
|
12880
12880
|
e != null && e.currentTab && ((r = this.meta.selfActiveTab) === null || r === void 0 ? void 0 : r.id) !== e.currentTab.id && (this.meta.setSelfActiveTab(e.currentTab, qf.Meeting), this.meta.emit("activeTabUpdate", e.currentTab));
|
|
12881
12881
|
} }, { key: "setupEvents", value: function() {
|
|
12882
12882
|
var e = this;
|
|
12883
|
-
c(this,
|
|
12883
|
+
c(this, Sr)[Sr].getValue("peerSessionStore").on(F.TRANSPORT_STATE_UPDATE, function(r) {
|
|
12884
12884
|
e.meta.emit("mediaConnectionUpdate", r);
|
|
12885
|
-
}), c(this,
|
|
12885
|
+
}), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.SOCKET_STATE_UPDATE, function(r) {
|
|
12886
12886
|
e.meta.emit("socketConnectionUpdate", r);
|
|
12887
|
-
}), c(this,
|
|
12887
|
+
}), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.ROOM_STATE, function(r) {
|
|
12888
12888
|
var n = r.createdAt, i = r.roomUuid, a = e.meta.meetingStartedTimestamp;
|
|
12889
12889
|
if (i && (e.meta.sessionId = i), n && !a) {
|
|
12890
12890
|
var o = new Date(n * 1e3);
|
|
12891
12891
|
e.meta.meetingStartedTimestamp = o, e.meta.emit("meetingStartTimeUpdate", { meetingStartedTimestamp: e.meta.meetingStartedTimestamp });
|
|
12892
12892
|
}
|
|
12893
|
-
}), c(this,
|
|
12893
|
+
}), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.PRODUCER_SCORE_UPDATE, function(r) {
|
|
12894
12894
|
var n = r.score;
|
|
12895
12895
|
n < 5 && e.meta.emit("poorConnection", { score: n });
|
|
12896
|
-
}), c(this, Qt)[Qt].permissions.canSpotlight && (this.logger.info("MetaController::Asserting Spotlight"), this.meta.selfActiveTab && c(this, Vi)[Vi].broadcastMessage("spotlight", { userId: c(this, Qt)[Qt].userId, currentTab: this.meta.selfActiveTab })), c(this,
|
|
12896
|
+
}), c(this, Qt)[Qt].permissions.canSpotlight && (this.logger.info("MetaController::Asserting Spotlight"), this.meta.selfActiveTab && c(this, Vi)[Vi].broadcastMessage("spotlight", { userId: c(this, Qt)[Qt].userId, currentTab: this.meta.selfActiveTab })), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.PEER_JOINED_INTERNAL, /* @__PURE__ */ function() {
|
|
12897
12897
|
var r = m(/* @__PURE__ */ h().mark(function n(i) {
|
|
12898
12898
|
return h().wrap(function(o) {
|
|
12899
12899
|
for (; ; )
|
|
@@ -12909,7 +12909,7 @@ var HA = Object.defineProperty, BA = Object.getOwnPropertyDescriptor, qA = funct
|
|
|
12909
12909
|
return function(n) {
|
|
12910
12910
|
return r.apply(this, arguments);
|
|
12911
12911
|
};
|
|
12912
|
-
}()), c(this,
|
|
12912
|
+
}()), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.ROOM_MESSAGE, function(r) {
|
|
12913
12913
|
var n, i, a;
|
|
12914
12914
|
if ("type" in r) {
|
|
12915
12915
|
if (r.type !== "spotlight")
|
|
@@ -12922,7 +12922,7 @@ var HA = Object.defineProperty, BA = Object.getOwnPropertyDescriptor, qA = funct
|
|
|
12922
12922
|
} else
|
|
12923
12923
|
return;
|
|
12924
12924
|
e.logger.info("Spotlight Assertion Received", { spotlight: { spotlighter: { id: a.userId }, currentTab: { id: (n = a.currentTab) === null || n === void 0 ? void 0 : n.id, type: (i = a.currentTab) === null || i === void 0 ? void 0 : i.type } } }), e.conditionallySetActiveTab(a);
|
|
12925
|
-
}), c(this,
|
|
12925
|
+
}), c(this, Sr)[Sr].getValue("peerSessionStore").on(F.MESSAGE, function(r) {
|
|
12926
12926
|
var n, i, a;
|
|
12927
12927
|
if ("type" in r) {
|
|
12928
12928
|
if (r.type !== "spotlight")
|
|
@@ -15011,9 +15011,9 @@ var Yn = /* @__PURE__ */ E("middlewareWebWorkerInterval"), No = /* @__PURE__ */
|
|
|
15011
15011
|
return l.forEach(function(v, f) {
|
|
15012
15012
|
Math.abs(v - o) < d && (d = Math.abs(v - o), p = f);
|
|
15013
15013
|
}), u[p][1];
|
|
15014
|
-
},
|
|
15014
|
+
}, Er = /* @__PURE__ */ function(s) {
|
|
15015
15015
|
return s.WEBCAM = "webcam", s.WEBCAM_BACKUP = "webcam_backup", s.MIC = "mic", s.SCREENSHARE_VIDEO = "screenshare_video", s.SCREENSHARE_AUDIO = "screenshare_audio", s;
|
|
15016
|
-
}(
|
|
15016
|
+
}(Er || {}), SI = eP(), Zs = Bn(SI.config.media);
|
|
15017
15017
|
function EI(s) {
|
|
15018
15018
|
var t = {};
|
|
15019
15019
|
if (s.audio) {
|
|
@@ -17506,20 +17506,20 @@ var oM = Object.defineProperty, uM = Object.getOwnPropertyDescriptor, wo = funct
|
|
|
17506
17506
|
for (var i = n > 1 ? void 0 : n ? uM(e, r) : e, a = t.length - 1, o; a >= 0; a--)
|
|
17507
17507
|
(o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
|
|
17508
17508
|
return n && i && oM(e, r, i), i;
|
|
17509
|
-
}, cM = 0.8, lM = 1.2, Ri = (Bi = /* @__PURE__ */ E("isPinned"), qi = /* @__PURE__ */ E("stageStatus"),
|
|
17509
|
+
}, cM = 0.8, lM = 1.2, Ri = (Bi = /* @__PURE__ */ E("isPinned"), qi = /* @__PURE__ */ E("stageStatus"), Rr = /* @__PURE__ */ E("context"), Nn = /* @__PURE__ */ E("roomNodeClient"), rn = /* @__PURE__ */ E("audioPlayback"), Vn = /* @__PURE__ */ E("mediaJoined"), Yu = /* @__PURE__ */ E("socketJoined"), ft = /* @__PURE__ */ E("self"), Ws = /* @__PURE__ */ E("roomSocketHandler"), Xt = /* @__PURE__ */ E("videoElements"), Un = /* @__PURE__ */ E("pip"), gt = /* @__PURE__ */ E("maxSpatialLayer"), Xu = /* @__PURE__ */ E("videoDimensionsUpdated"), Js = /* @__PURE__ */ E("updateVideos"), Zu = /* @__PURE__ */ E("updateAudio"), xu = /* @__PURE__ */ E("updateScreenShare"), /* @__PURE__ */ function(s) {
|
|
17510
17510
|
function t(e, r, n, i) {
|
|
17511
17511
|
var a;
|
|
17512
17512
|
P(this, t);
|
|
17513
17513
|
var o = e.getValue("logger");
|
|
17514
|
-
a = C(this, t, [o]), Object.defineProperty(a, xu, { value: yM }), Object.defineProperty(a, Zu, { value: mM }), Object.defineProperty(a, Js, { value: gM }), Object.defineProperty(a, Un, { get: fM, set: void 0 }), Object.defineProperty(a, Yu, { get: vM, set: void 0 }), Object.defineProperty(a, Vn, { get: hM, set: void 0 }), Object.defineProperty(a, rn, { get: pM, set: void 0 }), Object.defineProperty(a, Nn, { get: dM, set: void 0 }), a.id = void 0, a.userId = void 0, a.name = void 0, a.picture = void 0, a.isHost = void 0, a.customParticipantId = void 0, a.flags = void 0, a.device = void 0, a.videoTrack = void 0, a.audioTrack = void 0, a.screenShareTracks = void 0, a.videoEnabled = void 0, a.audioEnabled = void 0, a.screenShareEnabled = void 0, a.producers = void 0, a.manualProducerConfig = void 0, Object.defineProperty(a, Bi, { writable: !0, value: void 0 }), a.supportsRemoteControl = !1, Object.defineProperty(a, qi, { writable: !0, value: void 0 }), a.presetName = void 0, Object.defineProperty(a,
|
|
17514
|
+
a = C(this, t, [o]), Object.defineProperty(a, xu, { value: yM }), Object.defineProperty(a, Zu, { value: mM }), Object.defineProperty(a, Js, { value: gM }), Object.defineProperty(a, Un, { get: fM, set: void 0 }), Object.defineProperty(a, Yu, { get: vM, set: void 0 }), Object.defineProperty(a, Vn, { get: hM, set: void 0 }), Object.defineProperty(a, rn, { get: pM, set: void 0 }), Object.defineProperty(a, Nn, { get: dM, set: void 0 }), a.id = void 0, a.userId = void 0, a.name = void 0, a.picture = void 0, a.isHost = void 0, a.customParticipantId = void 0, a.flags = void 0, a.device = void 0, a.videoTrack = void 0, a.audioTrack = void 0, a.screenShareTracks = void 0, a.videoEnabled = void 0, a.audioEnabled = void 0, a.screenShareEnabled = void 0, a.producers = void 0, a.manualProducerConfig = void 0, Object.defineProperty(a, Bi, { writable: !0, value: void 0 }), a.supportsRemoteControl = !1, Object.defineProperty(a, qi, { writable: !0, value: void 0 }), a.presetName = void 0, Object.defineProperty(a, Rr, { writable: !0, value: void 0 }), Object.defineProperty(a, ft, { writable: !0, value: void 0 }), Object.defineProperty(a, Ws, { writable: !0, value: void 0 }), Object.defineProperty(a, Xt, { writable: !0, value: /* @__PURE__ */ new Map() }), Object.defineProperty(a, gt, { writable: !0, value: 1 }), Object.defineProperty(a, Xu, { writable: !0, value: vp(function(H) {
|
|
17515
17515
|
if (a.videoTrack) {
|
|
17516
17516
|
var V = H.clientWidth, L = H.clientHeight, N = a.videoTrack.getSettings(), Q = N.width, U = N.height;
|
|
17517
17517
|
if (!(!Q || !U)) {
|
|
17518
17518
|
var J = U / L, Z = Q / V, ge = Math.max(J, Z);
|
|
17519
|
-
ge > lM && c(a, gt)[gt] === 1 ? (c(a, gt)[gt] = 0, c(a,
|
|
17519
|
+
ge > lM && c(a, gt)[gt] === 1 ? (c(a, gt)[gt] = 0, c(a, Rr)[Rr].getValue("peerSessionStore").emit(F.MAX_SPATIAL_LAYER_CHANGE, { peerId: a.id, maxSpatialLayer: c(a, gt)[gt] })) : ge < cM && c(a, gt)[gt] === 0 && (c(a, gt)[gt] = 1, c(a, Rr)[Rr].getValue("peerSessionStore").emit(F.MAX_SPATIAL_LAYER_CHANGE, { peerId: a.id, maxSpatialLayer: c(a, gt)[gt] }));
|
|
17520
17520
|
}
|
|
17521
17521
|
}
|
|
17522
|
-
}, 2e3) }), c(a,
|
|
17522
|
+
}, 2e3) }), c(a, Rr)[Rr] = e;
|
|
17523
17523
|
var u = r.id, l = r.userId, d = r.displayName, p = r.device, v = r.picture, f = r.isHost, g = r.flags, k = r.clientSpecificId, y = r.stageStatus, b = r.customParticipantId, T = r.audioMuted, w = r.audioTrack, A = r.videoEnabled, M = A === void 0 ? !1 : A, O = r.videoTrack, I = r.producers, D = r.metadata;
|
|
17524
17524
|
return a.id = u, a.userId = l, a.name = d, a.device = p, a.picture = v, a.isHost = f, a.flags = g, a.manualProducerConfig = Ow, c(a, qi)[qi] = y != null ? y : "ON_STAGE", a.customParticipantId = b != null ? b : k, a.audioEnabled = !T, a.audioTrack = w, a.videoEnabled = M, a.videoTrack = O, a.screenShareTracks = { audio: void 0, video: void 0 }, a.producers = I != null ? I : [], a.presetName = D == null ? void 0 : D.preset_name, c(a, Bi)[Bi] = !1, c(a, ft)[ft] = n, c(a, Ws)[Ws] = i, a.setupEvents(), a.updateVideo = a.updateVideo.bind(a), c(a, Js)[Js](), a;
|
|
17525
17525
|
}
|
|
@@ -17542,7 +17542,7 @@ var oM = Object.defineProperty, uM = Object.getOwnPropertyDescriptor, wo = funct
|
|
|
17542
17542
|
* Not for external use
|
|
17543
17543
|
*/
|
|
17544
17544
|
function() {
|
|
17545
|
-
return c(this,
|
|
17545
|
+
return c(this, Rr)[Rr].getValue("telemetry");
|
|
17546
17546
|
}
|
|
17547
17547
|
) }, {
|
|
17548
17548
|
key: "setVideoEnabled",
|
|
@@ -17686,7 +17686,7 @@ var oM = Object.defineProperty, uM = Object.getOwnPropertyDescriptor, wo = funct
|
|
|
17686
17686
|
o.next = 8;
|
|
17687
17687
|
break;
|
|
17688
17688
|
}
|
|
17689
|
-
return o.next = 7, c(this,
|
|
17689
|
+
return o.next = 7, c(this, Rr)[Rr].getValue("peerSessionStore").emitAsync(F.KICK_PEER, { peerId: i });
|
|
17690
17690
|
case 7:
|
|
17691
17691
|
return o.abrupt("return");
|
|
17692
17692
|
case 8:
|
|
@@ -17813,19 +17813,19 @@ var oM = Object.defineProperty, uM = Object.getOwnPropertyDescriptor, wo = funct
|
|
|
17813
17813
|
) }]);
|
|
17814
17814
|
}(qt));
|
|
17815
17815
|
function dM() {
|
|
17816
|
-
return c(this,
|
|
17816
|
+
return c(this, Rr)[Rr].getValue("roomNodeClient");
|
|
17817
17817
|
}
|
|
17818
17818
|
function pM() {
|
|
17819
|
-
return c(this,
|
|
17819
|
+
return c(this, Rr)[Rr].getValue("audioPlayback");
|
|
17820
17820
|
}
|
|
17821
17821
|
function hM() {
|
|
17822
|
-
return c(this,
|
|
17822
|
+
return c(this, Rr)[Rr].getValue("connectionHandler").mediaJoined;
|
|
17823
17823
|
}
|
|
17824
17824
|
function vM() {
|
|
17825
|
-
return c(this,
|
|
17825
|
+
return c(this, Rr)[Rr].getValue("connectionHandler").socketJoined;
|
|
17826
17826
|
}
|
|
17827
17827
|
function fM() {
|
|
17828
|
-
return c(this,
|
|
17828
|
+
return c(this, Rr)[Rr].getValue("pip");
|
|
17829
17829
|
}
|
|
17830
17830
|
function gM() {
|
|
17831
17831
|
Array.from(c(this, Xt)[Xt].keys()).forEach(this.updateVideo);
|
|
@@ -19743,10 +19743,10 @@ var dr = Bn(fp().permissions), G = /* @__PURE__ */ E("permissions"), rs = /* @__
|
|
|
19743
19743
|
function _M() {
|
|
19744
19744
|
return c(this, vs)[vs].getValue("stageStatus");
|
|
19745
19745
|
}
|
|
19746
|
-
var
|
|
19746
|
+
var _r = /* @__PURE__ */ E("context"), ag = /* @__PURE__ */ function(s) {
|
|
19747
19747
|
function t(e, r) {
|
|
19748
19748
|
var n;
|
|
19749
|
-
return P(this, t), n = C(this, t, [r]), n.localMediaHandler = void 0, Object.defineProperty(n,
|
|
19749
|
+
return P(this, t), n = C(this, t, [r]), n.localMediaHandler = void 0, Object.defineProperty(n, _r, { writable: !0, value: void 0 }), c(n, _r)[_r] = e, n;
|
|
19750
19750
|
}
|
|
19751
19751
|
return R(t, s), S(t, [{
|
|
19752
19752
|
key: "updatePermission",
|
|
@@ -19760,7 +19760,7 @@ var Or = /* @__PURE__ */ E("context"), ag = /* @__PURE__ */ function(s) {
|
|
|
19760
19760
|
if (u = function(b, T) {
|
|
19761
19761
|
i.mediaPermissions[b] = T;
|
|
19762
19762
|
var w = { message: i.mediaPermissions[b], kind: b };
|
|
19763
|
-
T === "DENIED" ? c(i,
|
|
19763
|
+
T === "DENIED" ? c(i, _r)[_r].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_ERROR, w) : c(i, _r)[_r].getValue("peerSessionStore").emit(F.MEDIA_PERMISSION_UPDATE, w);
|
|
19764
19764
|
}, gr.getName() !== "firefox") {
|
|
19765
19765
|
k.next = 3;
|
|
19766
19766
|
break;
|
|
@@ -19811,11 +19811,11 @@ var Or = /* @__PURE__ */ E("context"), ag = /* @__PURE__ */ function(s) {
|
|
|
19811
19811
|
a = i.message, o = i.kind, f.t0 = o, f.next = f.t0 === "audio" ? 4 : f.t0 === "video" ? 7 : f.t0 === "screenshare" ? 9 : 11;
|
|
19812
19812
|
break;
|
|
19813
19813
|
case 4:
|
|
19814
|
-
return (u = c(this,
|
|
19814
|
+
return (u = c(this, _r)[_r]) === null || u === void 0 || u.getValue("callstats").mediaPermission("AUDIO", a), (l = c(this, _r)[_r]) === null || l === void 0 || l.getValue("callstats").mediaPermission("SPEAKER", a), f.abrupt("break", 11);
|
|
19815
19815
|
case 7:
|
|
19816
|
-
return (d = c(this,
|
|
19816
|
+
return (d = c(this, _r)[_r]) === null || d === void 0 || d.getValue("callstats").mediaPermission("VIDEO", a), f.abrupt("break", 11);
|
|
19817
19817
|
case 9:
|
|
19818
|
-
return (p = c(this,
|
|
19818
|
+
return (p = c(this, _r)[_r]) === null || p === void 0 || p.getValue("callstats").mediaPermission("SCREENSHARE", a), f.abrupt("break", 11);
|
|
19819
19819
|
case 11:
|
|
19820
19820
|
case "end":
|
|
19821
19821
|
return f.stop();
|
|
@@ -19830,7 +19830,7 @@ var Or = /* @__PURE__ */ E("context"), ag = /* @__PURE__ */ function(s) {
|
|
|
19830
19830
|
key: "peerId",
|
|
19831
19831
|
get: function() {
|
|
19832
19832
|
var r;
|
|
19833
|
-
return (r = c(this,
|
|
19833
|
+
return (r = c(this, _r)[_r]) === null || r === void 0 ? void 0 : r.getValue("peerId");
|
|
19834
19834
|
}
|
|
19835
19835
|
/**
|
|
19836
19836
|
* @param {Object} options
|
|
@@ -19847,7 +19847,7 @@ var Or = /* @__PURE__ */ E("context"), ag = /* @__PURE__ */ function(s) {
|
|
|
19847
19847
|
for (; ; )
|
|
19848
19848
|
switch (O.prev = O.next) {
|
|
19849
19849
|
case 0:
|
|
19850
|
-
if (a = A.length > 0 && A[0] !== void 0 ? A[0] : {}, o = A.length > 1 && A[1] !== void 0 ? A[1] : !1, u = A.length > 2 && A[2] !== void 0 ? A[2] : null, gr.init(), u && (c(this,
|
|
19850
|
+
if (a = A.length > 0 && A[0] !== void 0 ? A[0] : {}, o = A.length > 1 && A[1] !== void 0 ? A[1] : !1, u = A.length > 2 && A[2] !== void 0 ? A[2] : null, gr.init(), u && (c(this, _r)[_r] = u), !this.localMediaHandler) {
|
|
19851
19851
|
O.next = 7;
|
|
19852
19852
|
break;
|
|
19853
19853
|
}
|
|
@@ -19944,7 +19944,7 @@ var Or = /* @__PURE__ */ E("context"), ag = /* @__PURE__ */ function(s) {
|
|
|
19944
19944
|
}() }, {
|
|
19945
19945
|
key: "context",
|
|
19946
19946
|
set: function(r) {
|
|
19947
|
-
c(this,
|
|
19947
|
+
c(this, _r)[_r] = r, this.localMediaHandler.context = r;
|
|
19948
19948
|
}
|
|
19949
19949
|
/**
|
|
19950
19950
|
* Returns the `audioTrack`.
|
|
@@ -22632,10 +22632,10 @@ function xM() {
|
|
|
22632
22632
|
this.logger.error("Consumer::destroyTrack()", j(j({}, c(this, ct)[ct]), {}, { error: s }));
|
|
22633
22633
|
}
|
|
22634
22634
|
}
|
|
22635
|
-
var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns = /* @__PURE__ */ E("disableTrackOnPause"), ri = /* @__PURE__ */ E("zeroRtpOnPause"), qr = /* @__PURE__ */ E("closed"), We = /* @__PURE__ */ E("track"), cn = /* @__PURE__ */ E("paused"), is = /* @__PURE__ */ E("maxSpatialLayer"), Rl = /* @__PURE__ */ E("context"),
|
|
22635
|
+
var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns = /* @__PURE__ */ E("disableTrackOnPause"), ri = /* @__PURE__ */ E("zeroRtpOnPause"), qr = /* @__PURE__ */ E("closed"), We = /* @__PURE__ */ E("track"), cn = /* @__PURE__ */ E("paused"), is = /* @__PURE__ */ E("maxSpatialLayer"), Rl = /* @__PURE__ */ E("context"), Or = /* @__PURE__ */ E("metadata"), e_ = /* @__PURE__ */ function(s) {
|
|
22636
22636
|
function t(e, r) {
|
|
22637
22637
|
var n, i, a;
|
|
22638
|
-
return P(this, t), a = C(this, t, [e]), Object.defineProperty(a,
|
|
22638
|
+
return P(this, t), a = C(this, t, [e]), Object.defineProperty(a, Or, { get: r_, set: void 0 }), a.id = void 0, a.localId = void 0, Object.defineProperty(a, Zr, { writable: !0, value: void 0 }), a.kind = void 0, a.appData = void 0, a.rtpSender = void 0, Object.defineProperty(a, ts, { writable: !0, value: void 0 }), Object.defineProperty(a, ns, { writable: !0, value: void 0 }), Object.defineProperty(a, ri, { writable: !0, value: void 0 }), Object.defineProperty(a, qr, { writable: !0, value: !1 }), Object.defineProperty(a, We, { writable: !0, value: void 0 }), Object.defineProperty(a, cn, { writable: !0, value: void 0 }), Object.defineProperty(a, is, { writable: !0, value: void 0 }), Object.defineProperty(a, Rl, { writable: !0, value: void 0 }), a.id = r.id, a.localId = r.localId, c(a, We)[We] = r.track, a.kind = (n = r.track) === null || n === void 0 ? void 0 : n.kind, c(a, cn)[cn] = r.disableTrackOnPause ? !((i = r.track) !== null && i !== void 0 && i.enabled) : !1, c(a, is)[is] = void 0, c(a, ts)[ts] = r.stopTracks, c(a, ns)[ns] = r.disableTrackOnPause, c(a, ri)[ri] = r.zeroRtpOnPause, a.appData = r.appData || {}, a._onTrackEnded = a._onTrackEnded.bind(a), c(a, Zr)[Zr] = r.handler, a.rtpSender = r.rtpSender, a._handleTrack(), c(a, Rl)[Rl] = e, a;
|
|
22639
22639
|
}
|
|
22640
22640
|
return R(t, s), S(t, [{
|
|
22641
22641
|
key: "closed",
|
|
@@ -22682,7 +22682,7 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22682
22682
|
}
|
|
22683
22683
|
return v.abrupt("return");
|
|
22684
22684
|
case 2:
|
|
22685
|
-
if (this.logger.debug("Producer::close() ".concat(i ? "with reason ".concat(i) : ""), c(this,
|
|
22685
|
+
if (this.logger.debug("Producer::close() ".concat(i ? "with reason ".concat(i) : ""), c(this, Or)[Or]), c(this, qr)[qr] = !0, this._destroyTrack(), i !== Lu) {
|
|
22686
22686
|
v.next = 8;
|
|
22687
22687
|
break;
|
|
22688
22688
|
}
|
|
@@ -22730,7 +22730,7 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22730
22730
|
}() }, {
|
|
22731
22731
|
key: "pause",
|
|
22732
22732
|
value: function() {
|
|
22733
|
-
this.logger.debug("Producer::pause()", c(this,
|
|
22733
|
+
this.logger.debug("Producer::pause()", c(this, Or)[Or]), c(this, qr)[qr] && this.logger.error("Producer::pause() | Producer closed", c(this, Or)[Or]), c(this, cn)[cn] = !0, c(this, We)[We] && c(this, ns)[ns] && (c(this, We)[We].enabled = !1), c(this, ri)[ri] && c(this, Zr)[Zr].replaceTrack(this.localId, null), this.emit("pause");
|
|
22734
22734
|
}
|
|
22735
22735
|
/**
|
|
22736
22736
|
* Resumes sending media.
|
|
@@ -22738,8 +22738,8 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22738
22738
|
}, {
|
|
22739
22739
|
key: "resume",
|
|
22740
22740
|
value: function() {
|
|
22741
|
-
if (this.logger.debug("Producer::resume()", c(this,
|
|
22742
|
-
this.logger.error("Producer::resume() | Producer closed", c(this,
|
|
22741
|
+
if (this.logger.debug("Producer::resume()", c(this, Or)[Or]), c(this, qr)[qr]) {
|
|
22742
|
+
this.logger.error("Producer::resume() | Producer closed", c(this, Or)[Or]);
|
|
22743
22743
|
return;
|
|
22744
22744
|
}
|
|
22745
22745
|
c(this, cn)[cn] = !1, c(this, We)[We] && c(this, ns)[ns] && (c(this, We)[We].enabled = !0), c(this, ri)[ri] && c(this, Zr)[Zr].replaceTrack(this.localId, c(this, We)[We]), this.emit("resume");
|
|
@@ -22754,7 +22754,7 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22754
22754
|
for (; ; )
|
|
22755
22755
|
switch (u.prev = u.next) {
|
|
22756
22756
|
case 0:
|
|
22757
|
-
if (a = i.track, this.logger.debug("Producer::replaceTrack() trackId: ".concat(a == null ? void 0 : a.id), c(this,
|
|
22757
|
+
if (a = i.track, this.logger.debug("Producer::replaceTrack() trackId: ".concat(a == null ? void 0 : a.id), c(this, Or)[Or]), !c(this, qr)[qr]) {
|
|
22758
22758
|
u.next = 7;
|
|
22759
22759
|
break;
|
|
22760
22760
|
}
|
|
@@ -22762,7 +22762,7 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22762
22762
|
try {
|
|
22763
22763
|
a.stop();
|
|
22764
22764
|
} catch (l) {
|
|
22765
|
-
this.logger.error("Producer::replaceTrack", j(j({}, c(this,
|
|
22765
|
+
this.logger.error("Producer::replaceTrack", j(j({}, c(this, Or)[Or]), {}, { error: l }));
|
|
22766
22766
|
}
|
|
22767
22767
|
throw new en("closed");
|
|
22768
22768
|
case 7:
|
|
@@ -22776,7 +22776,7 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22776
22776
|
u.next = 12;
|
|
22777
22777
|
break;
|
|
22778
22778
|
}
|
|
22779
|
-
return this.logger.debug("replaceTrack() | same track, ignored trackId: ".concat(a.id), c(this,
|
|
22779
|
+
return this.logger.debug("replaceTrack() | same track, ignored trackId: ".concat(a.id), c(this, Or)[Or]), u.abrupt("return");
|
|
22780
22780
|
case 12:
|
|
22781
22781
|
if (!(!c(this, ri)[ri] || !c(this, cn)[cn])) {
|
|
22782
22782
|
u.next = 15;
|
|
@@ -22862,7 +22862,7 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22862
22862
|
}
|
|
22863
22863
|
return r;
|
|
22864
22864
|
}() }, { key: "_onTrackEnded", value: function() {
|
|
22865
|
-
this.logger.debug('Producer::track "ended" event trackId: '.concat(this.track.id), c(this,
|
|
22865
|
+
this.logger.debug('Producer::track "ended" event trackId: '.concat(this.track.id), c(this, Or)[Or]), this.safeEmit("trackended", this.track.id);
|
|
22866
22866
|
} }, { key: "_handleTrack", value: function() {
|
|
22867
22867
|
c(this, We)[We] && c(this, We)[We].addEventListener("ended", this._onTrackEnded);
|
|
22868
22868
|
} }, { key: "_destroyTrack", value: function() {
|
|
@@ -22871,7 +22871,7 @@ var Zr = /* @__PURE__ */ E("handler"), ts = /* @__PURE__ */ E("stopTracks"), ns
|
|
|
22871
22871
|
c(this, We)[We].removeEventListener("ended", this._onTrackEnded), c(this, ts)[ts] && c(this, We)[We].stop();
|
|
22872
22872
|
} catch (n) {
|
|
22873
22873
|
var r;
|
|
22874
|
-
this.logger.error("Producer::_destroyTrack trackId: ".concat((r = this.track) === null || r === void 0 ? void 0 : r.id), j(j({}, c(this,
|
|
22874
|
+
this.logger.error("Producer::_destroyTrack trackId: ".concat((r = this.track) === null || r === void 0 ? void 0 : r.id), j(j({}, c(this, Or)[Or]), {}, { error: n }));
|
|
22875
22875
|
}
|
|
22876
22876
|
} }]);
|
|
22877
22877
|
}(Yc);
|
|
@@ -24613,10 +24613,10 @@ function R_(s) {
|
|
|
24613
24613
|
};
|
|
24614
24614
|
}()), c(this, yn)[yn].set(s.id, s), this.producerIdToConsumerIdMap.set(s.producerId, s.id), this.context.getValue("peerSessionStore").emit(F.NEW_CONSUMER, { id: s.id, appData: s.appData, peerId: s.peerId });
|
|
24615
24615
|
}
|
|
24616
|
-
var Yo = /* @__PURE__ */ E("zeroCrossingThreshold"), Xo = /* @__PURE__ */ E("minVoiceDuration"), Zo = /* @__PURE__ */ E("hangoverFrames"), ss = /* @__PURE__ */ E("initialEnergyThreshold"), ws = /* @__PURE__ */ E("noiseAdaptationRate"), Ps = /* @__PURE__ */ E("voiceAdaptationRate"), fu = /* @__PURE__ */ E("minEnergyThreshold"), gu = /* @__PURE__ */ E("maxEnergyThreshold"), os = /* @__PURE__ */ E("energyRatioThreshold"),
|
|
24616
|
+
var Yo = /* @__PURE__ */ E("zeroCrossingThreshold"), Xo = /* @__PURE__ */ E("minVoiceDuration"), Zo = /* @__PURE__ */ E("hangoverFrames"), ss = /* @__PURE__ */ E("initialEnergyThreshold"), ws = /* @__PURE__ */ E("noiseAdaptationRate"), Ps = /* @__PURE__ */ E("voiceAdaptationRate"), fu = /* @__PURE__ */ E("minEnergyThreshold"), gu = /* @__PURE__ */ E("maxEnergyThreshold"), os = /* @__PURE__ */ E("energyRatioThreshold"), Pr = /* @__PURE__ */ E("currentEnergyThreshold"), rt = /* @__PURE__ */ E("backgroundNoiseEnergy"), xr = /* @__PURE__ */ E("voiceDetected"), ai = /* @__PURE__ */ E("consecutiveVoiceFrames"), si = /* @__PURE__ */ E("hangoverCount"), Vt = /* @__PURE__ */ E("noiseEnergyHistory"), mu = /* @__PURE__ */ E("noiseHistorySize"), $l = /* @__PURE__ */ E("updateEnergyThreshold"), Ll = /* @__PURE__ */ E("updateNoiseEstimate"), _d = /* @__PURE__ */ E("calculateEnergy"), Od = /* @__PURE__ */ E("calculateZeroCrossingRate"), Ep = /* @__PURE__ */ function() {
|
|
24617
24617
|
function s() {
|
|
24618
24618
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.initialEnergyThreshold, r = e === void 0 ? 0.015 : e, n = t.zeroCrossingThreshold, i = n === void 0 ? 20 : n, a = t.minVoiceDuration, o = a === void 0 ? 3 : a, u = t.hangoverFrames, l = u === void 0 ? 5 : u, d = t.noiseAdaptationRate, p = d === void 0 ? 0.95 : d, v = t.voiceAdaptationRate, f = v === void 0 ? 0.99 : v, g = t.minEnergyThreshold, k = g === void 0 ? 5e-3 : g, y = t.maxEnergyThreshold, b = y === void 0 ? 0.2 : y, T = t.energyRatioThreshold, w = T === void 0 ? 1.5 : T, A = t.noiseHistorySize, M = A === void 0 ? 50 : A;
|
|
24619
|
-
P(this, s), Object.defineProperty(this, Ll, { value: I_ }), Object.defineProperty(this, $l, { value: A_ }), Object.defineProperty(this, Yo, { writable: !0, value: void 0 }), Object.defineProperty(this, Xo, { writable: !0, value: void 0 }), Object.defineProperty(this, Zo, { writable: !0, value: void 0 }), Object.defineProperty(this, ss, { writable: !0, value: void 0 }), Object.defineProperty(this, ws, { writable: !0, value: void 0 }), Object.defineProperty(this, Ps, { writable: !0, value: void 0 }), Object.defineProperty(this, fu, { writable: !0, value: void 0 }), Object.defineProperty(this, gu, { writable: !0, value: void 0 }), Object.defineProperty(this, os, { writable: !0, value: void 0 }), Object.defineProperty(this,
|
|
24619
|
+
P(this, s), Object.defineProperty(this, Ll, { value: I_ }), Object.defineProperty(this, $l, { value: A_ }), Object.defineProperty(this, Yo, { writable: !0, value: void 0 }), Object.defineProperty(this, Xo, { writable: !0, value: void 0 }), Object.defineProperty(this, Zo, { writable: !0, value: void 0 }), Object.defineProperty(this, ss, { writable: !0, value: void 0 }), Object.defineProperty(this, ws, { writable: !0, value: void 0 }), Object.defineProperty(this, Ps, { writable: !0, value: void 0 }), Object.defineProperty(this, fu, { writable: !0, value: void 0 }), Object.defineProperty(this, gu, { writable: !0, value: void 0 }), Object.defineProperty(this, os, { writable: !0, value: void 0 }), Object.defineProperty(this, Pr, { writable: !0, value: void 0 }), Object.defineProperty(this, rt, { writable: !0, value: void 0 }), Object.defineProperty(this, xr, { writable: !0, value: !1 }), Object.defineProperty(this, ai, { writable: !0, value: 0 }), Object.defineProperty(this, si, { writable: !0, value: 0 }), Object.defineProperty(this, Vt, { writable: !0, value: [] }), Object.defineProperty(this, mu, { writable: !0, value: void 0 }), c(this, ss)[ss] = r, c(this, Pr)[Pr] = r, c(this, Yo)[Yo] = i, c(this, Xo)[Xo] = o, c(this, Zo)[Zo] = l, c(this, ws)[ws] = p, c(this, Ps)[Ps] = f, c(this, fu)[fu] = k, c(this, gu)[gu] = b, c(this, os)[os] = w, c(this, mu)[mu] = M, c(this, rt)[rt] = r / 2;
|
|
24620
24620
|
}
|
|
24621
24621
|
return S(s, [{
|
|
24622
24622
|
key: "voiceDetected",
|
|
@@ -24631,7 +24631,7 @@ var Yo = /* @__PURE__ */ E("zeroCrossingThreshold"), Xo = /* @__PURE__ */ E("min
|
|
|
24631
24631
|
}, { key: "processAudioChunk", value: function(e) {
|
|
24632
24632
|
var r = c(s, _d)[_d](e), n = c(s, Od)[Od](e);
|
|
24633
24633
|
c(this, $l)[$l](r);
|
|
24634
|
-
var i = r / c(this, rt)[rt], a = i > c(this, os)[os] && r > c(this,
|
|
24634
|
+
var i = r / c(this, rt)[rt], a = i > c(this, os)[os] && r > c(this, Pr)[Pr] && n > c(this, Yo)[Yo];
|
|
24635
24635
|
return a ? (c(this, ai)[ai] += 1, c(this, si)[si] = c(this, Zo)[Zo], c(this, ai)[ai] >= c(this, Xo)[Xo] && (c(this, xr)[xr] = !0)) : (c(this, ai)[ai] = 0, c(this, si)[si] > 0 ? c(this, si)[si] -= 1 : c(this, xr)[xr] && (c(this, xr)[xr] = !1), c(this, xr)[xr] || c(this, Ll)[Ll](r)), { energy: r, isVoice: c(this, xr)[xr] };
|
|
24636
24636
|
} }, {
|
|
24637
24637
|
key: "reset",
|
|
@@ -24640,21 +24640,21 @@ var Yo = /* @__PURE__ */ E("zeroCrossingThreshold"), Xo = /* @__PURE__ */ E("min
|
|
|
24640
24640
|
* Reset the detector state
|
|
24641
24641
|
*/
|
|
24642
24642
|
function() {
|
|
24643
|
-
c(this, xr)[xr] = !1, c(this, ai)[ai] = 0, c(this, si)[si] = 0, c(this,
|
|
24643
|
+
c(this, xr)[xr] = !1, c(this, ai)[ai] = 0, c(this, si)[si] = 0, c(this, Pr)[Pr] = c(this, ss)[ss], c(this, rt)[rt] = c(this, ss)[ss] / 2, c(this, Vt)[Vt] = [];
|
|
24644
24644
|
}
|
|
24645
24645
|
)
|
|
24646
24646
|
/**
|
|
24647
24647
|
* Get current adaptive threshold values for debugging/visualization
|
|
24648
24648
|
*/
|
|
24649
24649
|
}, { key: "getThresholdInfo", value: function() {
|
|
24650
|
-
return { currentEnergyThreshold: c(this,
|
|
24650
|
+
return { currentEnergyThreshold: c(this, Pr)[Pr], backgroundNoiseEnergy: c(this, rt)[rt], energyRatioThreshold: c(this, os)[os] };
|
|
24651
24651
|
} }]);
|
|
24652
24652
|
}();
|
|
24653
24653
|
function A_(s) {
|
|
24654
|
-
c(this, xr)[xr] ? c(this,
|
|
24654
|
+
c(this, xr)[xr] ? c(this, Pr)[Pr] = c(this, Ps)[Ps] * c(this, Pr)[Pr] + (1 - c(this, Ps)[Ps]) * s : c(this, Pr)[Pr] = c(this, ws)[ws] * c(this, Pr)[Pr] + (1 - c(this, ws)[ws]) * c(this, rt)[rt], c(this, Pr)[Pr] = Math.max(c(this, fu)[fu], Math.min(c(this, gu)[gu], c(this, Pr)[Pr]));
|
|
24655
24655
|
}
|
|
24656
24656
|
function I_(s) {
|
|
24657
|
-
if (s < c(this,
|
|
24657
|
+
if (s < c(this, Pr)[Pr] * 1.2)
|
|
24658
24658
|
if (c(this, Vt)[Vt].push(s), c(this, Vt)[Vt].length > c(this, mu)[mu] && c(this, Vt)[Vt].shift(), c(this, Vt)[Vt].length >= 10) {
|
|
24659
24659
|
var t = Ie(c(this, Vt)[Vt]).sort(function(r, n) {
|
|
24660
24660
|
return r - n;
|
|
@@ -25058,7 +25058,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25058
25058
|
for (; ; )
|
|
25059
25059
|
switch (w.prev = w.next) {
|
|
25060
25060
|
case 0:
|
|
25061
|
-
if (u =
|
|
25061
|
+
if (u = Er.WEBCAM, l = c(this, vr)[vr](u), !l) {
|
|
25062
25062
|
w.next = 17;
|
|
25063
25063
|
break;
|
|
25064
25064
|
}
|
|
@@ -25136,11 +25136,11 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25136
25136
|
return k.abrupt("return");
|
|
25137
25137
|
case 3:
|
|
25138
25138
|
return u = { track: a, codecOptions: [{ name: "VP8" }], appData: { screenShare: !0, e2ee: this.e2ee, supportsRemoteControl: gr.isElectron() }, stopTracks: !1 }, l = function() {
|
|
25139
|
-
i.logger.info("Disabling screenShare due to the producer closure"), c(i, tr)[tr].delete(
|
|
25140
|
-
}, d = c(this, W)[W].createProducer(u, l), c(this, ci)[ci](
|
|
25139
|
+
i.logger.info("Disabling screenShare due to the producer closure"), c(i, tr)[tr].delete(Er.SCREENSHARE_VIDEO), c(i, tr)[tr].delete(Er.SCREENSHARE_AUDIO);
|
|
25140
|
+
}, d = c(this, W)[W].createProducer(u, l), c(this, ci)[ci](Er.SCREENSHARE_VIDEO, d.then(function(y) {
|
|
25141
25141
|
return y.id;
|
|
25142
25142
|
})), o && (v = { track: o, codecOptions: [{ name: "opus" }], appData: { screenShare: !0, e2ee: this.e2ee, supportsRemoteControl: gr.isElectron() }, stopTracks: !1, zeroRtpOnPause: !1 }, f = function() {
|
|
25143
|
-
}, p = c(this, W)[W].createProducer(v, f), c(this, ci)[ci](
|
|
25143
|
+
}, p = c(this, W)[W].createProducer(v, f), c(this, ci)[ci](Er.SCREENSHARE_AUDIO, p.then(function(y) {
|
|
25144
25144
|
return y.id;
|
|
25145
25145
|
}))), k.next = 10, Promise.all([d, p || Promise.resolve()]);
|
|
25146
25146
|
case 10:
|
|
@@ -25168,7 +25168,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25168
25168
|
}
|
|
25169
25169
|
throw new en("track undefined");
|
|
25170
25170
|
case 3:
|
|
25171
|
-
if (a = c(this, vr)[vr](
|
|
25171
|
+
if (a = c(this, vr)[vr](Er.MIC), !a) {
|
|
25172
25172
|
f.next = 22;
|
|
25173
25173
|
break;
|
|
25174
25174
|
}
|
|
@@ -25195,8 +25195,8 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25195
25195
|
return f.abrupt("return");
|
|
25196
25196
|
case 22:
|
|
25197
25197
|
return l = c(this, Fl)[Fl](n), d = function() {
|
|
25198
|
-
c(i, tr)[tr].delete(
|
|
25199
|
-
}, p = c(this, W)[W].createProducer(l, d), c(this, ci)[ci](
|
|
25198
|
+
c(i, tr)[tr].delete(Er.MIC);
|
|
25199
|
+
}, p = c(this, W)[W].createProducer(l, d), c(this, ci)[ci](Er.MIC, p.then(function(g) {
|
|
25200
25200
|
return g.id;
|
|
25201
25201
|
})), f.next = 28, p.then(function(g) {
|
|
25202
25202
|
c(i, br)[br] && (c(i, br)[br].audioTrack = g.track, c(i, br)[br].producerId = g.id, c(i, br)[br].start());
|
|
@@ -25223,7 +25223,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25223
25223
|
for (; ; )
|
|
25224
25224
|
switch (l.prev = l.next) {
|
|
25225
25225
|
case 0:
|
|
25226
|
-
return l.next = 2, c(this, vr)[vr](
|
|
25226
|
+
return l.next = 2, c(this, vr)[vr](Er.MIC);
|
|
25227
25227
|
case 2:
|
|
25228
25228
|
if (i = l.sent, a = c(this, W)[W].producers.get(i), a) {
|
|
25229
25229
|
l.next = 7;
|
|
@@ -25255,7 +25255,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25255
25255
|
for (; ; )
|
|
25256
25256
|
switch (u.prev = u.next) {
|
|
25257
25257
|
case 0:
|
|
25258
|
-
return u.next = 2, c(this, vr)[vr](
|
|
25258
|
+
return u.next = 2, c(this, vr)[vr](Er.WEBCAM);
|
|
25259
25259
|
case 2:
|
|
25260
25260
|
if (n = u.sent, i = c(this, W)[W].producers.get(n), i) {
|
|
25261
25261
|
u.next = 7;
|
|
@@ -25281,7 +25281,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25281
25281
|
for (; ; )
|
|
25282
25282
|
switch (u.prev = u.next) {
|
|
25283
25283
|
case 0:
|
|
25284
|
-
return u.next = 2, c(this, vr)[vr](
|
|
25284
|
+
return u.next = 2, c(this, vr)[vr](Er.MIC);
|
|
25285
25285
|
case 2:
|
|
25286
25286
|
if (n = u.sent, i = c(this, W)[W].producers.get(n), i) {
|
|
25287
25287
|
u.next = 7;
|
|
@@ -25313,7 +25313,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25313
25313
|
for (; ; )
|
|
25314
25314
|
switch (d.prev = d.next) {
|
|
25315
25315
|
case 0:
|
|
25316
|
-
return n = u.length > 0 && u[0] !== void 0 ? u[0] :
|
|
25316
|
+
return n = u.length > 0 && u[0] !== void 0 ? u[0] : Er.WEBCAM, d.next = 3, c(this, vr)[vr](n);
|
|
25317
25317
|
case 3:
|
|
25318
25318
|
if (i = d.sent, a = c(this, W)[W].producers.get(i), a) {
|
|
25319
25319
|
d.next = 8;
|
|
@@ -25345,7 +25345,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25345
25345
|
for (; ; )
|
|
25346
25346
|
switch (o.prev = o.next) {
|
|
25347
25347
|
case 0:
|
|
25348
|
-
return n =
|
|
25348
|
+
return n = Er.WEBCAM, o.next = 3, c(this, vr)[vr](n);
|
|
25349
25349
|
case 3:
|
|
25350
25350
|
if (i = o.sent, c(this, jl)[jl](n), !i) {
|
|
25351
25351
|
o.next = 8;
|
|
@@ -25369,7 +25369,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25369
25369
|
for (; ; )
|
|
25370
25370
|
switch (o.prev = o.next) {
|
|
25371
25371
|
case 0:
|
|
25372
|
-
return o.next = 2, c(this, vr)[vr](
|
|
25372
|
+
return o.next = 2, c(this, vr)[vr](Er.MIC);
|
|
25373
25373
|
case 2:
|
|
25374
25374
|
if (i = o.sent, !i) {
|
|
25375
25375
|
o.next = 6;
|
|
@@ -25377,7 +25377,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25377
25377
|
}
|
|
25378
25378
|
return o.next = 6, c(this, W)[W].closeProducer(i);
|
|
25379
25379
|
case 6:
|
|
25380
|
-
(n = c(this, br)[br]) === null || n === void 0 || n.stop(), c(this, tr)[tr].delete(
|
|
25380
|
+
(n = c(this, br)[br]) === null || n === void 0 || n.stop(), c(this, tr)[tr].delete(Er.MIC);
|
|
25381
25381
|
case 8:
|
|
25382
25382
|
case "end":
|
|
25383
25383
|
return o.stop();
|
|
@@ -25395,9 +25395,9 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25395
25395
|
for (; ; )
|
|
25396
25396
|
switch (o.prev = o.next) {
|
|
25397
25397
|
case 0:
|
|
25398
|
-
return this.logger.info("screen_sharing_stopped"), this.context.getValue("callstats").screenShareStop(), o.next = 4, c(this, vr)[vr](
|
|
25398
|
+
return this.logger.info("screen_sharing_stopped"), this.context.getValue("callstats").screenShareStop(), o.next = 4, c(this, vr)[vr](Er.SCREENSHARE_VIDEO);
|
|
25399
25399
|
case 4:
|
|
25400
|
-
return n = o.sent, o.next = 7, c(this, vr)[vr](
|
|
25400
|
+
return n = o.sent, o.next = 7, c(this, vr)[vr](Er.SCREENSHARE_AUDIO);
|
|
25401
25401
|
case 7:
|
|
25402
25402
|
if (i = o.sent, !n) {
|
|
25403
25403
|
o.next = 11;
|
|
@@ -25411,7 +25411,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25411
25411
|
}
|
|
25412
25412
|
return o.next = 14, c(this, W)[W].closeProducer(i);
|
|
25413
25413
|
case 14:
|
|
25414
|
-
c(this, ut)[ut].clear(), c(this, tr)[tr].delete(
|
|
25414
|
+
c(this, ut)[ut].clear(), c(this, tr)[tr].delete(Er.SCREENSHARE_VIDEO), c(this, tr)[tr].delete(Er.SCREENSHARE_AUDIO);
|
|
25415
25415
|
case 17:
|
|
25416
25416
|
case "end":
|
|
25417
25417
|
return o.stop();
|
|
@@ -25450,7 +25450,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25450
25450
|
l.next = 7;
|
|
25451
25451
|
break;
|
|
25452
25452
|
}
|
|
25453
|
-
return l.next = 3, c(this, vr)[vr](
|
|
25453
|
+
return l.next = 3, c(this, vr)[vr](Er.WEBCAM);
|
|
25454
25454
|
case 3:
|
|
25455
25455
|
return a = l.sent, l.next = 6, c(this, W)[W].closeProducer(a, { stopTrack: !1 });
|
|
25456
25456
|
case 6:
|
|
@@ -25460,7 +25460,7 @@ var j_ = Object.defineProperty, F_ = Object.getOwnPropertyDescriptor, Ze = funct
|
|
|
25460
25460
|
l.next = 14;
|
|
25461
25461
|
break;
|
|
25462
25462
|
}
|
|
25463
|
-
return l.next = 10, c(this, vr)[vr](
|
|
25463
|
+
return l.next = 10, c(this, vr)[vr](Er.SCREENSHARE_VIDEO);
|
|
25464
25464
|
case 10:
|
|
25465
25465
|
return o = l.sent, l.next = 13, c(this, W)[W].closeProducer(o, { stopTrack: !1 });
|
|
25466
25466
|
case 13:
|
|
@@ -26600,9 +26600,9 @@ var oO = Object.defineProperty, uO = Object.getOwnPropertyDescriptor, cO = funct
|
|
|
26600
26600
|
for (var i = n > 1 ? void 0 : n ? uO(e, r) : e, a = t.length - 1, o; a >= 0; a--)
|
|
26601
26601
|
(o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
|
|
26602
26602
|
return n && i && oO(e, r, i), i;
|
|
26603
|
-
},
|
|
26603
|
+
}, Dr = /* @__PURE__ */ E("context"), lg = /* @__PURE__ */ function() {
|
|
26604
26604
|
function s(t, e) {
|
|
26605
|
-
P(this, s), this.socket = void 0, Object.defineProperty(this,
|
|
26605
|
+
P(this, s), this.socket = void 0, Object.defineProperty(this, Dr, { writable: !0, value: void 0 }), c(this, Dr)[Dr] = t, this.socket = e, this.handleSocketEvents(), c(this, Dr)[Dr].setValue("roomSocketHandler", this);
|
|
26606
26606
|
}
|
|
26607
26607
|
return S(s, [{
|
|
26608
26608
|
key: "telemetry",
|
|
@@ -26612,7 +26612,7 @@ var oO = Object.defineProperty, uO = Object.getOwnPropertyDescriptor, cO = funct
|
|
|
26612
26612
|
* Not for external use
|
|
26613
26613
|
*/
|
|
26614
26614
|
function() {
|
|
26615
|
-
return c(this,
|
|
26615
|
+
return c(this, Dr)[Dr].getValue("telemetry");
|
|
26616
26616
|
}
|
|
26617
26617
|
)
|
|
26618
26618
|
/**
|
|
@@ -26620,7 +26620,7 @@ var oO = Object.defineProperty, uO = Object.getOwnPropertyDescriptor, cO = funct
|
|
|
26620
26620
|
* Not for external use
|
|
26621
26621
|
*/
|
|
26622
26622
|
}, { key: "logger", get: function() {
|
|
26623
|
-
return c(this,
|
|
26623
|
+
return c(this, Dr)[Dr].getValue("logger");
|
|
26624
26624
|
} }, { key: "cleanup", value: function() {
|
|
26625
26625
|
try {
|
|
26626
26626
|
var e;
|
|
@@ -26637,9 +26637,9 @@ var oO = Object.defineProperty, uO = Object.getOwnPropertyDescriptor, cO = funct
|
|
|
26637
26637
|
case 0:
|
|
26638
26638
|
return this.socket.joinAttempted = !0, a = { capabilities: [], peer: { displayName: (i = n.name) !== null && i !== void 0 ? i : "Participant", customParticipantId: n.customParticipantId, peerId: n.id, userId: n.userId, displayPictureUrl: n.picture, waitlisted: !1 }, roomUuid: "" }, o = this.socket.sendMessagePromise(Y.joinRoom, FE.toBinary(a)), b.prev = 3, b.t0 = xs, b.next = 7, o;
|
|
26639
26639
|
case 7:
|
|
26640
|
-
return b.t1 = b.sent.payload, u = b.t0.fromBinary.call(b.t0, b.t1), l = u.peer, c(this,
|
|
26640
|
+
return b.t1 = b.sent.payload, u = b.t0.fromBinary.call(b.t0, b.t1), l = u.peer, c(this, Dr)[Dr].getValue("connectionHandler").socketJoined = !0, c(this, Dr)[Dr].getValue("peerSessionStore").emit(F.SOCKET_SERVICE_ROOM_JOINED, { peer: l }), d = this.getRoomState(), p = this.getRoomPeersNonPaginated(), b.next = 16, Promise.all([d, p]);
|
|
26641
26641
|
case 16:
|
|
26642
|
-
return v = b.sent, f = je(v, 2), g = f[0].room, k = f[1].peers, c(this,
|
|
26642
|
+
return v = b.sent, f = je(v, 2), g = f[0].room, k = f[1].peers, c(this, Dr)[Dr].getValue("peerSessionStore").emit(F.ROOM_STATE, g), c(this, Dr)[Dr].getValue("peerSessionStore").emit(F.SOCKET_PEERS, k), b.abrupt("return", { peer: l });
|
|
26643
26643
|
case 25:
|
|
26644
26644
|
throw b.prev = 25, b.t2 = b.catch(3), this.logger.error("RoomSocketHandler.joinRoom.failed", { error: b.t2 }), b.t2;
|
|
26645
26645
|
case 29:
|
|
@@ -27002,7 +27002,7 @@ var oO = Object.defineProperty, uO = Object.getOwnPropertyDescriptor, cO = funct
|
|
|
27002
27002
|
var n = r.payload;
|
|
27003
27003
|
try {
|
|
27004
27004
|
var i = Io.fromBinary(n);
|
|
27005
|
-
c(e,
|
|
27005
|
+
c(e, Dr)[Dr].getValue("peerSessionStore").emit(F.ROOM_MESSAGE, { payload: JSON.parse(new TextDecoder().decode(i.payload)), type: i.type, timestamp: i.timestamp });
|
|
27006
27006
|
} catch (a) {
|
|
27007
27007
|
e.logger.error("failed to decode broadcast message:", a);
|
|
27008
27008
|
}
|
|
@@ -27010,7 +27010,7 @@ var oO = Object.defineProperty, uO = Object.getOwnPropertyDescriptor, cO = funct
|
|
|
27010
27010
|
var n = r.payload;
|
|
27011
27011
|
try {
|
|
27012
27012
|
var i = Io.fromBinary(n);
|
|
27013
|
-
c(e,
|
|
27013
|
+
c(e, Dr)[Dr].getValue("peerSessionStore").emit(F.MESSAGE, { payload: JSON.parse(new TextDecoder().decode(i.payload)), type: i.type, timestamp: i.timestamp });
|
|
27014
27014
|
} catch (a) {
|
|
27015
27015
|
e.logger.error("failed to decode peer broadcast message:", a);
|
|
27016
27016
|
}
|
|
@@ -27607,18 +27607,18 @@ var Yi = { debug: 0, info: 1, warn: 2, error: 3 }, ds, ps, EO = /* @__PURE__ */
|
|
|
27607
27607
|
ds = /* @__PURE__ */ new WeakMap(), ps = /* @__PURE__ */ new WeakMap();
|
|
27608
27608
|
var bg = /* @__PURE__ */ function(s) {
|
|
27609
27609
|
return s[s.CONNECTING = 0] = "CONNECTING", s[s.OPEN = 1] = "OPEN", s[s.CLOSING = 2] = "CLOSING", s[s.CLOSED = 3] = "CLOSED", s;
|
|
27610
|
-
}(bg || {}), ev = "2", rv = "3",
|
|
27610
|
+
}(bg || {}), ev = "2", rv = "3", Cr, ro, Qe, wr, ea, zr, wi, ua, kn, to, no, gi, qd, Tg, uu, gc, Gd, wg, mc, Bl, Oc, Wd, Jd, Pg, Tu, yc, lo, wu, Dc, Kd, po, Pu, zd, Sg, Su, kc, Eu, $c, CO = /* @__PURE__ */ function() {
|
|
27611
27611
|
function s(t, e) {
|
|
27612
27612
|
var r, n, i, a, o, u, l, d, p, v, f, g;
|
|
27613
|
-
P(this, s), ze(this, qd), ze(this, uu), ze(this, Gd), ze(this, mc), ze(this, Oc), ze(this, Jd), ze(this, Tu), ze(this, lo), ze(this, Dc), ze(this, po), ze(this, zd), ze(this, Su), ze(this, Eu), ze(this,
|
|
27613
|
+
P(this, s), ze(this, qd), ze(this, uu), ze(this, Gd), ze(this, mc), ze(this, Oc), ze(this, Jd), ze(this, Tu), ze(this, lo), ze(this, Dc), ze(this, po), ze(this, zd), ze(this, Su), ze(this, Eu), ze(this, Cr, void 0), ze(this, ro, void 0), ze(this, Qe, void 0), ze(this, wr, void 0), ze(this, ea, void 0), ze(this, zr, void 0), ze(this, wi, void 0), ze(this, ua, void 0), ze(this, kn, void 0), ze(this, to, void 0), ze(this, no, void 0), ze(this, gi, void 0);
|
|
27614
27614
|
var k, y, b, T, w, A, M, O, I, D, H;
|
|
27615
|
-
qe(this, ro, t), qe(this, ea, []), qe(this, zr, new _c()), qe(this, wi, !0), qe(this, kn, !1), qe(this, Qe, e != null ? e : {}), (r = (k = q(this, Qe)).autoReconnect) !== null && r !== void 0 || (k.autoReconnect = !0), (n = (y = q(this, Qe)).retryConnectionInterval) !== null && n !== void 0 || (y.retryConnectionInterval = 1e3), (i = (b = q(this, Qe)).pingTimeout) !== null && i !== void 0 || (b.pingTimeout = 3e4), (a = (T = q(this, Qe)).connectionTimeout) !== null && a !== void 0 || (T.connectionTimeout = 5e3), (o = (w = q(this, Qe)).debug) !== null && o !== void 0 || (w.debug = !0), (u = (A = q(this, Qe)).maxReconnectionAttempts) !== null && u !== void 0 || (A.maxReconnectionAttempts = 10), (l = (M = q(this, Qe)).disconnectOnPingTimeout) !== null && l !== void 0 || (M.disconnectOnPingTimeout = !0), (d = (O = q(this, Qe)).queueOnDisconnect) !== null && d !== void 0 || (O.queueOnDisconnect = !1), (p = (I = q(this, Qe)).flushOnReconnect) !== null && p !== void 0 || (I.flushOnReconnect = !1), (v = (D = q(this, Qe)).clientInitiatedPings) !== null && v !== void 0 || (D.clientInitiatedPings = !1), (f = (H = q(this, Qe)).clientInitiatedPingInterval) !== null && f !== void 0 || (H.clientInitiatedPingInterval = 3e4), qe(this, ua, { code: void 0, reason: void 0 }), qe(this,
|
|
27615
|
+
qe(this, ro, t), qe(this, ea, []), qe(this, zr, new _c()), qe(this, wi, !0), qe(this, kn, !1), qe(this, Qe, e != null ? e : {}), (r = (k = q(this, Qe)).autoReconnect) !== null && r !== void 0 || (k.autoReconnect = !0), (n = (y = q(this, Qe)).retryConnectionInterval) !== null && n !== void 0 || (y.retryConnectionInterval = 1e3), (i = (b = q(this, Qe)).pingTimeout) !== null && i !== void 0 || (b.pingTimeout = 3e4), (a = (T = q(this, Qe)).connectionTimeout) !== null && a !== void 0 || (T.connectionTimeout = 5e3), (o = (w = q(this, Qe)).debug) !== null && o !== void 0 || (w.debug = !0), (u = (A = q(this, Qe)).maxReconnectionAttempts) !== null && u !== void 0 || (A.maxReconnectionAttempts = 10), (l = (M = q(this, Qe)).disconnectOnPingTimeout) !== null && l !== void 0 || (M.disconnectOnPingTimeout = !0), (d = (O = q(this, Qe)).queueOnDisconnect) !== null && d !== void 0 || (O.queueOnDisconnect = !1), (p = (I = q(this, Qe)).flushOnReconnect) !== null && p !== void 0 || (I.flushOnReconnect = !1), (v = (D = q(this, Qe)).clientInitiatedPings) !== null && v !== void 0 || (D.clientInitiatedPings = !1), (f = (H = q(this, Qe)).clientInitiatedPingInterval) !== null && f !== void 0 || (H.clientInitiatedPingInterval = 3e4), qe(this, ua, { code: void 0, reason: void 0 }), qe(this, wr, (g = q(this, Qe).logger) !== null && g !== void 0 ? g : new EO(q(this, Qe).debug ? "debug" : "info")), qe(this, gi, new SO());
|
|
27616
27616
|
}
|
|
27617
27617
|
return S(s, [{
|
|
27618
27618
|
key: "readyState",
|
|
27619
27619
|
get: function() {
|
|
27620
27620
|
var e;
|
|
27621
|
-
return (e = q(this,
|
|
27621
|
+
return (e = q(this, Cr)) == null ? void 0 : e.readyState;
|
|
27622
27622
|
}
|
|
27623
27623
|
/**
|
|
27624
27624
|
* Sockrates connection URL.
|
|
@@ -27682,7 +27682,7 @@ var bg = /* @__PURE__ */ function(s) {
|
|
|
27682
27682
|
u.next = 4;
|
|
27683
27683
|
break;
|
|
27684
27684
|
}
|
|
27685
|
-
return q(this,
|
|
27685
|
+
return q(this, wr).debug("Websocket was already connecting or connected."), u.abrupt("return");
|
|
27686
27686
|
case 4:
|
|
27687
27687
|
if (q(this, wi) === !1) {
|
|
27688
27688
|
u.next = 6;
|
|
@@ -27691,29 +27691,29 @@ var bg = /* @__PURE__ */ function(s) {
|
|
|
27691
27691
|
return u.abrupt("return", new Promise(function(l, d) {
|
|
27692
27692
|
Ge(n, po, Pu).call(n), Ge(n, Eu, $c).call(n);
|
|
27693
27693
|
try {
|
|
27694
|
-
qe(n,
|
|
27694
|
+
qe(n, Cr, new WebSocket(Ge(n, qd, Tg).call(n, q(n, ro)))), q(n, Cr).binaryType = "arraybuffer", q(n, wr).debug("Connecting");
|
|
27695
27695
|
var p = setTimeout(function() {
|
|
27696
|
-
q(n,
|
|
27696
|
+
q(n, wr).debug("Connection timeout. Closing socket"), qe(n, wi, !0), Ge(n, Eu, $c).call(n), q(n, Cr).close(3001, "Connection Timeout"), q(n, Qe).autoReconnect && !q(n, kn) && (q(n, zr).emit(
|
|
27697
27697
|
"reconnecting"
|
|
27698
27698
|
/* reconnecting */
|
|
27699
27699
|
), Ge(n, Tu, yc).call(n)), d(new Error("Connection timed out!"));
|
|
27700
27700
|
}, q(n, Qe).connectionTimeout);
|
|
27701
|
-
q(n,
|
|
27702
|
-
q(n,
|
|
27701
|
+
q(n, Cr).onopen = function() {
|
|
27702
|
+
q(n, wr).debug("Ready State: ".concat(bg[q(n, Cr).readyState])), p && clearTimeout(p), Ge(n, Dc, Kd).call(n), Ge(n, zd, Sg).call(n), qe(n, ua, { code: void 0, reason: void 0 }), q(n, zr).emit(
|
|
27703
27703
|
"connected"
|
|
27704
27704
|
/* connected */
|
|
27705
27705
|
), q(n, Qe).flushOnReconnect && n.flush(), l();
|
|
27706
|
-
}, q(n,
|
|
27706
|
+
}, q(n, Cr).onclose = function(v) {
|
|
27707
27707
|
try {
|
|
27708
27708
|
p && clearTimeout(p);
|
|
27709
27709
|
var f = v.code, g = v.reason;
|
|
27710
|
-
d(g), q(n,
|
|
27710
|
+
d(g), q(n, wr).debug("Socket closed. Close event:", { event: v }), q(n, wr).debug("Connection closed code: ".concat(f)), q(n, wr).debug("Connection closed reason: ".concat(g)), q(n, kn) || Ge(n, Oc, Wd).call(n, f, g);
|
|
27711
27711
|
} catch (k) {
|
|
27712
27712
|
Ge(n, uu, gc).call(n, k);
|
|
27713
27713
|
}
|
|
27714
|
-
}, q(n,
|
|
27714
|
+
}, q(n, Cr).onerror = function(v) {
|
|
27715
27715
|
Ge(n, uu, gc).call(n, v);
|
|
27716
|
-
}, q(n,
|
|
27716
|
+
}, q(n, Cr).onmessage = function(v) {
|
|
27717
27717
|
return Ge(n, Gd, wg).call(n, v);
|
|
27718
27718
|
};
|
|
27719
27719
|
} catch (v) {
|
|
@@ -27739,8 +27739,8 @@ var bg = /* @__PURE__ */ function(s) {
|
|
|
27739
27739
|
key: "send",
|
|
27740
27740
|
value: function(e, r, n, i) {
|
|
27741
27741
|
var a = { event: e, id: r, payload: n, metadata: i };
|
|
27742
|
-
if (q(this, Qe).queueOnDisconnect && (!q(this,
|
|
27743
|
-
return q(this,
|
|
27742
|
+
if (q(this, Qe).queueOnDisconnect && (!q(this, Cr) || q(this, Cr).readyState !== 1))
|
|
27743
|
+
return q(this, wr).debug("Queuing message since socket is not connected!", a), q(this, ea).push(a), !1;
|
|
27744
27744
|
var o = kg.encode(a);
|
|
27745
27745
|
return Ge(this, lo, wu).call(this, o);
|
|
27746
27746
|
}
|
|
@@ -27827,10 +27827,10 @@ var bg = /* @__PURE__ */ function(s) {
|
|
|
27827
27827
|
* Disconnect the socket.
|
|
27828
27828
|
*/
|
|
27829
27829
|
}, { key: "disconnect", value: function() {
|
|
27830
|
-
qe(this, wi, !1), Ge(this, po, Pu).call(this), Ge(this, Su, kc).call(this), this.removeAllListeners(), qe(this, ua, { code: 1e3, reason: "Sockrates disconnect method called" }), q(this,
|
|
27830
|
+
qe(this, wi, !1), Ge(this, po, Pu).call(this), Ge(this, Su, kc).call(this), this.removeAllListeners(), qe(this, ua, { code: 1e3, reason: "Sockrates disconnect method called" }), q(this, Cr).close(1e3, "Sockrates disconnect method called.");
|
|
27831
27831
|
} }]);
|
|
27832
27832
|
}();
|
|
27833
|
-
|
|
27833
|
+
Cr = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), Qe = /* @__PURE__ */ new WeakMap(), wr = /* @__PURE__ */ new WeakMap(), ea = /* @__PURE__ */ new WeakMap(), zr = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new WeakMap(), ua = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), to = /* @__PURE__ */ new WeakMap(), no = /* @__PURE__ */ new WeakMap(), gi = /* @__PURE__ */ new WeakMap(), qd = /* @__PURE__ */ new WeakSet(), Tg = function(t) {
|
|
27834
27834
|
if (t.startsWith("ws://") || t.startsWith("wss://"))
|
|
27835
27835
|
return t;
|
|
27836
27836
|
if (t.startsWith("https://"))
|
|
@@ -27839,25 +27839,25 @@ Rr = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), Qe = /*
|
|
|
27839
27839
|
return "ws://".concat(t.substring(7));
|
|
27840
27840
|
throw new Error("Invalid URL. URL must start with http(s):// or ws(s)://.");
|
|
27841
27841
|
}, uu = /* @__PURE__ */ new WeakSet(), gc = function(t, e) {
|
|
27842
|
-
q(this,
|
|
27842
|
+
q(this, wr).error("Error:", { error: t }), q(this, zr).emit("errored", { error: t }), e == null || e(t);
|
|
27843
27843
|
}, Gd = /* @__PURE__ */ new WeakSet(), wg = function(t) {
|
|
27844
27844
|
if (Ge(this, Dc, Kd).call(this), t.data === ev) {
|
|
27845
|
-
q(this,
|
|
27845
|
+
q(this, wr).debug("Received ping from server"), Ge(this, lo, wu).call(this, rv);
|
|
27846
27846
|
return;
|
|
27847
27847
|
}
|
|
27848
27848
|
if (t.data === rv) {
|
|
27849
|
-
q(this,
|
|
27849
|
+
q(this, wr).debug("Received pong from server");
|
|
27850
27850
|
return;
|
|
27851
27851
|
}
|
|
27852
27852
|
var e = kg.decode(t.data), r = e.id, n = e.payload;
|
|
27853
|
-
q(this,
|
|
27853
|
+
q(this, wr).debug("Received message", { event: e.event, messageID: r }), q(this, zr).emit(e.event.toString(), { id: r, payload: n });
|
|
27854
27854
|
}, mc = /* @__PURE__ */ new WeakSet(), Bl = function() {
|
|
27855
|
-
return q(this,
|
|
27855
|
+
return q(this, Cr).readyState === 1;
|
|
27856
27856
|
}, Oc = /* @__PURE__ */ new WeakSet(), Wd = function(t, e) {
|
|
27857
27857
|
qe(this, ua, { reason: e, code: t }), q(this, zr).emit("disconnected", { code: t, reason: e });
|
|
27858
27858
|
}, Jd = /* @__PURE__ */ new WeakSet(), Pg = function() {
|
|
27859
27859
|
var t = q(this, ua), e = t.reason, r = t.code;
|
|
27860
|
-
r && r !== 1e3 && q(this, wi) && q(this, Qe).autoReconnect && !q(this, kn) && (q(this,
|
|
27860
|
+
r && r !== 1e3 && q(this, wi) && q(this, Qe).autoReconnect && !q(this, kn) && (q(this, wr).debug("Triggering reconnection due to ".concat(e, ".")), q(this, zr).emit(
|
|
27861
27861
|
"reconnecting"
|
|
27862
27862
|
/* reconnecting */
|
|
27863
27863
|
), Ge(this, Tu, yc).call(this));
|
|
@@ -27872,7 +27872,7 @@ Rr = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), Qe = /*
|
|
|
27872
27872
|
i.next = 4;
|
|
27873
27873
|
break;
|
|
27874
27874
|
}
|
|
27875
|
-
return q(this,
|
|
27875
|
+
return q(this, wr).debug("Reconnect called when already in a reconnect loop. Ignoring."), i.abrupt("return");
|
|
27876
27876
|
case 4:
|
|
27877
27877
|
if (q(this, kn) || q(this, gi).reset(), !(q(this, Qe).maxReconnectionAttempts !== null && q(this, gi).getAttempts() >= q(this, Qe).maxReconnectionAttempts)) {
|
|
27878
27878
|
i.next = 7;
|
|
@@ -27891,7 +27891,7 @@ Rr = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), Qe = /*
|
|
|
27891
27891
|
}
|
|
27892
27892
|
return i.abrupt("return");
|
|
27893
27893
|
case 13:
|
|
27894
|
-
return q(this,
|
|
27894
|
+
return q(this, wr).debug("Reconnection attempt ".concat(q(this, gi).getAttempts())), q(this, zr).emit("reconnectAttempt", { attempt: q(this, gi).getAttempts() }), i.next = 17, this.connect();
|
|
27895
27895
|
case 17:
|
|
27896
27896
|
if (Ge(this, mc, Bl).call(this)) {
|
|
27897
27897
|
i.next = 19;
|
|
@@ -27905,7 +27905,7 @@ Rr = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), Qe = /*
|
|
|
27905
27905
|
), i.next = 25;
|
|
27906
27906
|
break;
|
|
27907
27907
|
case 22:
|
|
27908
|
-
i.prev = 22, i.t0 = i.catch(8), q(this,
|
|
27908
|
+
i.prev = 22, i.t0 = i.catch(8), q(this, wr).debug("Failed to reconnect."), q(this, zr).emit("reconnectFailure", { attempt: q(this, gi).getAttempts() }), Ge(this, Tu, yc).call(this, !1);
|
|
27909
27909
|
case 25:
|
|
27910
27910
|
case "end":
|
|
27911
27911
|
return i.stop();
|
|
@@ -27917,29 +27917,29 @@ Rr = /* @__PURE__ */ new WeakMap(), ro = /* @__PURE__ */ new WeakMap(), Qe = /*
|
|
|
27917
27917
|
};
|
|
27918
27918
|
}(), lo = /* @__PURE__ */ new WeakSet(), wu = function(t) {
|
|
27919
27919
|
try {
|
|
27920
|
-
return q(this,
|
|
27920
|
+
return q(this, Cr).send(t), !0;
|
|
27921
27921
|
} catch (e) {
|
|
27922
|
-
return q(this,
|
|
27922
|
+
return q(this, wr).error(e.message), !1;
|
|
27923
27923
|
}
|
|
27924
27924
|
}, Dc = /* @__PURE__ */ new WeakSet(), Kd = function() {
|
|
27925
27925
|
var t = this;
|
|
27926
|
-
this.config.disconnectOnPingTimeout && (q(this,
|
|
27926
|
+
this.config.disconnectOnPingTimeout && (q(this, wr).debug("Resetting ping timeout"), Ge(this, po, Pu).call(this), qe(this, to, setTimeout(function() {
|
|
27927
27927
|
var e;
|
|
27928
|
-
q(t,
|
|
27928
|
+
q(t, wr).debug("Disconnecting the socket due to ping timeout"), qe(t, wi, !0);
|
|
27929
27929
|
var r = 3002, n = "Ping timeout";
|
|
27930
|
-
(e = q(t,
|
|
27930
|
+
(e = q(t, Cr)) == null || e.close(r, n), Ge(t, Oc, Wd).call(t, r, n);
|
|
27931
27931
|
}, q(this, Qe).pingTimeout)));
|
|
27932
27932
|
}, po = /* @__PURE__ */ new WeakSet(), Pu = function() {
|
|
27933
27933
|
q(this, to) && (clearTimeout(q(this, to)), qe(this, to, void 0));
|
|
27934
27934
|
}, zd = /* @__PURE__ */ new WeakSet(), Sg = function() {
|
|
27935
27935
|
var t = this;
|
|
27936
27936
|
Ge(this, Su, kc).call(this), q(this, Qe).clientInitiatedPings && qe(this, no, setInterval(function() {
|
|
27937
|
-
Ge(t, mc, Bl).call(t) && (q(t,
|
|
27937
|
+
Ge(t, mc, Bl).call(t) && (q(t, wr).debug("Sending client-initiated ping"), Ge(t, lo, wu).call(t, ev));
|
|
27938
27938
|
}, q(this, Qe).clientInitiatedPingInterval));
|
|
27939
27939
|
}, Su = /* @__PURE__ */ new WeakSet(), kc = function() {
|
|
27940
27940
|
q(this, no) && (clearInterval(q(this, no)), qe(this, no, void 0));
|
|
27941
27941
|
}, Eu = /* @__PURE__ */ new WeakSet(), $c = function() {
|
|
27942
|
-
Ge(this, Su, kc).call(this), q(this,
|
|
27942
|
+
Ge(this, Su, kc).call(this), q(this, Cr) && (q(this, Cr).onopen = void 0, q(this, Cr).onerror = void 0, q(this, Cr).onmessage = void 0, q(this, Cr).onclose = void 0);
|
|
27943
27943
|
};
|
|
27944
27944
|
var RO = Object.defineProperty, AO = Object.getOwnPropertyDescriptor, rl = function(t, e, r, n) {
|
|
27945
27945
|
for (var i = n > 1 ? void 0 : n ? AO(e, r) : e, a = t.length - 1, o; a >= 0; a--)
|
|
@@ -28322,31 +28322,28 @@ var DO = /* @__PURE__ */ function() {
|
|
|
28322
28322
|
for (var i = n > 1 ? void 0 : n ? LO(e, r) : e, a = t.length - 1, o; a >= 0; a--)
|
|
28323
28323
|
(o = t[a]) && (i = (n ? o(e, r, i) : o(i)) || i);
|
|
28324
28324
|
return n && i && $O(e, r, i), i;
|
|
28325
|
-
},
|
|
28325
|
+
}, $r = /* @__PURE__ */ E("context"), Cg = /* @__PURE__ */ function(s) {
|
|
28326
28326
|
function t(e) {
|
|
28327
28327
|
var r;
|
|
28328
28328
|
P(this, t);
|
|
28329
28329
|
var n = e.getValue("logger");
|
|
28330
|
-
return r = C(this, t, [n]), r.meetings = [], r.parentMeeting = null, Object.defineProperty(r,
|
|
28330
|
+
return r = C(this, t, [n]), r.meetings = [], r.parentMeeting = null, Object.defineProperty(r, $r, { writable: !0, value: void 0 }), c(r, $r)[$r] = e, r;
|
|
28331
28331
|
}
|
|
28332
|
-
return R(t, s), S(t, [{ key: "
|
|
28333
|
-
var r = c(this, wr)[wr].getValue("self").permissions.connectedMeetings;
|
|
28334
|
-
return r ? r.canAlterConnectedMeetings || r.canSwitchConnectedMeetings || r.canSwitchToParentMeeting : !1;
|
|
28335
|
-
} }, { key: "isActive", get: function() {
|
|
28332
|
+
return R(t, s), S(t, [{ key: "isActive", get: function() {
|
|
28336
28333
|
return this.meetings.length !== 0;
|
|
28337
28334
|
} }, { key: "validateAlterAction", value: function() {
|
|
28338
|
-
var r = c(this,
|
|
28335
|
+
var r = c(this, $r)[$r].getValue("self").permissions.connectedMeetings;
|
|
28339
28336
|
if (!(r != null && r.canAlterConnectedMeetings))
|
|
28340
28337
|
throw new Error("You are not allowed to perform this action. Please enable canAlterConnectedMeetings permission in your preset.");
|
|
28341
28338
|
} }, { key: "validateMoveAction", value: function(r, n) {
|
|
28342
28339
|
var i;
|
|
28343
28340
|
if (!(n != null && n.length))
|
|
28344
28341
|
throw new Error("You're trying to move participants with an empty list.");
|
|
28345
|
-
var a = c(this,
|
|
28342
|
+
var a = c(this, $r)[$r].getValue("self").permissions.connectedMeetings;
|
|
28346
28343
|
if (!a)
|
|
28347
28344
|
throw new Error("You are not allowed to perform this action. Please enable connected meetings permissions in your preset.");
|
|
28348
28345
|
if (!a.canAlterConnectedMeetings) {
|
|
28349
|
-
var o = c(this,
|
|
28346
|
+
var o = c(this, $r)[$r].getValue("userId"), u = n.length === 1 && n[0] === o;
|
|
28350
28347
|
if (!u)
|
|
28351
28348
|
throw new Error("You are not allowed to move other participants. Please enable canAlterConnectedMeetings permission in your preset.");
|
|
28352
28349
|
var l = r === ((i = this.parentMeeting) === null || i === void 0 ? void 0 : i.id);
|
|
@@ -28367,7 +28364,7 @@ var DO = /* @__PURE__ */ function() {
|
|
|
28367
28364
|
for (; ; )
|
|
28368
28365
|
switch (o.prev = o.next) {
|
|
28369
28366
|
case 0:
|
|
28370
|
-
return this.logger.info("Getting connected meetings dump"), o.next = 3, c(this,
|
|
28367
|
+
return this.logger.info("Getting connected meetings dump"), o.next = 3, c(this, $r)[$r].getValue("connectedMeetingsSocketHandler").getConnectedRoomsDump();
|
|
28371
28368
|
case 3:
|
|
28372
28369
|
return i = o.sent, this.logger.info("Got connected meetings dump"), o.abrupt("return", i);
|
|
28373
28370
|
case 6:
|
|
@@ -28392,7 +28389,7 @@ var DO = /* @__PURE__ */ function() {
|
|
|
28392
28389
|
for (; ; )
|
|
28393
28390
|
switch (u.prev = u.next) {
|
|
28394
28391
|
case 0:
|
|
28395
|
-
return this.validateAlterAction(), this.logger.info("Creating connected meetings ".concat(JSON.stringify(i))), u.next = 4, c(this,
|
|
28392
|
+
return this.validateAlterAction(), this.logger.info("Creating connected meetings ".concat(JSON.stringify(i))), u.next = 4, c(this, $r)[$r].getValue("connectedMeetingsSocketHandler").createConnectedRooms(i);
|
|
28396
28393
|
case 4:
|
|
28397
28394
|
return a = u.sent, this.logger.info("Created connected meetings ".concat(JSON.stringify(a))), u.abrupt("return", a.map(function(l) {
|
|
28398
28395
|
return { id: l.id, title: l.title };
|
|
@@ -28413,7 +28410,7 @@ var DO = /* @__PURE__ */ function() {
|
|
|
28413
28410
|
for (; ; )
|
|
28414
28411
|
switch (o.prev = o.next) {
|
|
28415
28412
|
case 0:
|
|
28416
|
-
return this.validateAlterAction(), this.logger.info("Updating connected meetings ".concat(JSON.stringify(i))), o.next = 4, c(this,
|
|
28413
|
+
return this.validateAlterAction(), this.logger.info("Updating connected meetings ".concat(JSON.stringify(i))), o.next = 4, c(this, $r)[$r].getValue("connectedMeetingsSocketHandler").updateConnectedRooms(i.map(function(u) {
|
|
28417
28414
|
return { meetingId: u.id, title: u.title };
|
|
28418
28415
|
}));
|
|
28419
28416
|
case 4:
|
|
@@ -28441,7 +28438,7 @@ var DO = /* @__PURE__ */ function() {
|
|
|
28441
28438
|
})) : Promise.resolve();
|
|
28442
28439
|
}), this.logger.info("Moved participants before deleting connected meetings ".concat(JSON.stringify(i), ". Deleting now.")), d.next = 6, Promise.all(o);
|
|
28443
28440
|
case 6:
|
|
28444
|
-
return d.next = 8, c(this,
|
|
28441
|
+
return d.next = 8, c(this, $r)[$r].getValue("connectedMeetingsSocketHandler").disableConnectedRooms(i);
|
|
28445
28442
|
case 8:
|
|
28446
28443
|
return u = d.sent, this.logger.info("Deleted connected meetings ".concat(JSON.stringify(i))), d.abrupt("return", u);
|
|
28447
28444
|
case 11:
|
|
@@ -28461,7 +28458,7 @@ var DO = /* @__PURE__ */ function() {
|
|
|
28461
28458
|
for (; ; )
|
|
28462
28459
|
switch (d.prev = d.next) {
|
|
28463
28460
|
case 0:
|
|
28464
|
-
return this.validateMoveAction(a, o), this.logger.info("Moving connected meetings participants ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this,
|
|
28461
|
+
return this.validateMoveAction(a, o), this.logger.info("Moving connected meetings participants ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this, $r)[$r].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: i, destinationMeetingId: a, participants: o.map(function(p) {
|
|
28465
28462
|
return { id: p };
|
|
28466
28463
|
}) });
|
|
28467
28464
|
case 4:
|
|
@@ -28485,7 +28482,7 @@ var DO = /* @__PURE__ */ function() {
|
|
|
28485
28482
|
case 0:
|
|
28486
28483
|
return this.validateMoveAction(a, o.map(function(p) {
|
|
28487
28484
|
return p.id;
|
|
28488
|
-
})), this.logger.info("Moving connected meetings participants (custom preset) ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this,
|
|
28485
|
+
})), this.logger.info("Moving connected meetings participants (custom preset) ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), d.next = 4, c(this, $r)[$r].getValue("connectedMeetingsSocketHandler").movePeersBetweenRooms({ sourceMeetingId: i, destinationMeetingId: a, participants: o });
|
|
28489
28486
|
case 4:
|
|
28490
28487
|
return u = d.sent, u.success ? (this.logger.info("Moved connected meetings participants (custom preset) ".concat(JSON.stringify(o), " from ").concat(i, " to ").concat(a)), this.moveSuccessHandler(i, a, o.map(function(p) {
|
|
28491
28488
|
return p.id;
|