@vkontakte/calls-sdk 2.8.13-beta.6 → 2.8.13-dev.05e6b21e.0
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/calls-sdk.cjs.js +6 -6
- package/calls-sdk.esm.js +292 -246
- package/classes/AudioOutput.d.ts +3 -1
- package/classes/MediaSource.d.ts +3 -1
- package/classes/stat/ConversationStats.d.ts +2 -0
- package/classes/stat/MediaStats.d.ts +22 -0
- package/enums/Stat.d.ts +3 -0
- package/package.json +1 -1
package/calls-sdk.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @vkontakte/calls-sdk v2.8.13-
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/calls-sdk v2.8.13-dev.05e6b21e.0
|
|
3
|
+
* Fri, 02 Oct 2026 07:50:18 GMT
|
|
4
4
|
* https://calls-sdk.cdn-vk.ru/doc/latest/index.html
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -1244,8 +1244,8 @@ var O = /* @__PURE__ */ function(e) {
|
|
|
1244
1244
|
}({}), Jt = /* @__PURE__ */ function(e) {
|
|
1245
1245
|
return e[e.CAMERA = 1] = "CAMERA", e[e.SCREEN = 2] = "SCREEN", e;
|
|
1246
1246
|
}({}), Yt = class extends b {
|
|
1247
|
-
constructor(e = z, t = null) {
|
|
1248
|
-
super(), h(this, "_stream", null), h(this, "_screenTrack", null), h(this, "_audioShareTrack", null), h(this, "_screenShareTrack", null), h(this, "_sendVideoTrack", null), h(this, "_cameraVideoTrack", null), h(this, "_micAudioTrack", null), h(this, "_audioEffectsTrack", null), h(this, "_mediaSettings", D()), h(this, "_lastMediaSettings", null), h(this, "_videoStatusOnScreenCapturingEnabled", !1), h(this, "_effect", null), h(this, "_audioEffectParams", null), h(this, "_onDeviceChange", void 0), h(this, "_animojiEnabled", !1), h(this, "_videoEffectsFpsLimiter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_cameraTrackSetAt", 0), h(this, "_cameraMuteRecoveredAt", 0), h(this, "_micTrackSetAt", 0), h(this, "_micMuteRecoveredAt", 0), h(this, "videoTrackMuteHandler", () => {
|
|
1247
|
+
constructor(e = z, t = null, n = null) {
|
|
1248
|
+
super(), h(this, "_stream", null), h(this, "_screenTrack", null), h(this, "_audioShareTrack", null), h(this, "_screenShareTrack", null), h(this, "_sendVideoTrack", null), h(this, "_cameraVideoTrack", null), h(this, "_micAudioTrack", null), h(this, "_audioEffectsTrack", null), h(this, "_mediaSettings", D()), h(this, "_lastMediaSettings", null), h(this, "_videoStatusOnScreenCapturingEnabled", !1), h(this, "_effect", null), h(this, "_audioEffectParams", null), h(this, "_onDeviceChange", void 0), h(this, "_animojiEnabled", !1), h(this, "_videoEffectsFpsLimiter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_mediaStats", void 0), h(this, "_cameraTrackSetAt", 0), h(this, "_cameraMuteRecoveredAt", 0), h(this, "_micTrackSetAt", 0), h(this, "_micMuteRecoveredAt", 0), h(this, "videoTrackMuteHandler", () => {
|
|
1249
1249
|
!this._mediaSettings.isVideoEnabled || this._cameraMuteRecoveredAt >= this._cameraTrackSetAt || E.browserName() !== "Safari" || (this._cameraMuteRecoveredAt = Date.now(), this._logger?.log(C.ERROR, "camera_mute_recover"), this._debug.log("[MediaSource] Safari camera mute recovery"), this.toggleVideo(!0).then(() => this._logger?.log(C.ERROR, "camera_mute_recover_success")).catch((e) => {
|
|
1250
1250
|
this._logger?.log(C.ERROR, "camera_mute_recover_fail"), this._debug.warn("[MediaSource] Camera mute recovery failed", e);
|
|
1251
1251
|
}));
|
|
@@ -1253,7 +1253,7 @@ var O = /* @__PURE__ */ function(e) {
|
|
|
1253
1253
|
!this._mediaSettings.isAudioEnabled || this._micMuteRecoveredAt >= this._micTrackSetAt || E.browserName() !== "Safari" || (this._micMuteRecoveredAt = Date.now(), this._logger?.log(C.ERROR, "mic_mute_recover"), this._debug.log("[MediaSource] Safari mic mute recovery"), this.toggleAudio(!0).then(() => this._logger?.log(C.ERROR, "mic_mute_recover_success")).catch((e) => {
|
|
1254
1254
|
this._logger?.log(C.ERROR, "mic_mute_recover_fail"), this._debug.warn("[MediaSource] Mic mute recovery failed", e);
|
|
1255
1255
|
}));
|
|
1256
|
-
}), this._debug = e, this._logger = t, this._initDeviceChangeListener(), N.audioShare && (this._audioShareTrack = this.getSilentAudioShareTrack()), N.enableVideoEffectsFpsDegradation && (this._videoEffectsFpsLimiter = new Kt(this._debug), this._videoEffectsFpsLimiter.addEventListener(Gt.FpsLimit, this.handleVideoEffectsLowFps.bind(this)));
|
|
1256
|
+
}), this._debug = e, this._logger = t, this._mediaStats = n, this._initDeviceChangeListener(), N.audioShare && (this._audioShareTrack = this.getSilentAudioShareTrack()), N.enableVideoEffectsFpsDegradation && (this._videoEffectsFpsLimiter = new Kt(this._debug), this._videoEffectsFpsLimiter.addEventListener(Gt.FpsLimit, this.handleVideoEffectsLowFps.bind(this)));
|
|
1257
1257
|
}
|
|
1258
1258
|
get cameraVideoTrack() {
|
|
1259
1259
|
return this._cameraVideoTrack;
|
|
@@ -1272,7 +1272,7 @@ var O = /* @__PURE__ */ function(e) {
|
|
|
1272
1272
|
try {
|
|
1273
1273
|
this._stream = await E.getUserMedia(n, r, t, this._debug, this._logger), this.cameraVideoTrack?.stop(), this.cameraVideoTrack = this._stream.getVideoTracks()[0], this._micAudioTrack?.stop(), this._setMicAudioTrack(this._stream.getAudioTracks()[0]), this._audioEffectsTrack?.stop(), this._mediaSettings.isVideoEnabled = n && this._stream.getVideoTracks().filter((e) => e.enabled).length > 0 || !1, this._mediaSettings.isAudioEnabled = r && this._stream.getAudioTracks().filter((e) => e.enabled).length > 0 || !1, this._mediaSettings.isAnimojiEnabled = i && !this._mediaSettings.isVideoEnabled || !1, this._animojiEnabled = i, this._triggerEvent("SOURCE_READY");
|
|
1274
1274
|
} catch (e) {
|
|
1275
|
-
throw new k(e);
|
|
1275
|
+
throw r && this._mediaStats?.logAudioError("init", e), new k(e);
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
1278
|
getStream() {
|
|
@@ -1358,7 +1358,7 @@ var O = /* @__PURE__ */ function(e) {
|
|
|
1358
1358
|
this._logger?.log(C.DEVICE_CHANGED, "audio"), this._debug.log("Audio stream changed", e), await this._replaceLocalTrack(e), this._mediaSettings.isAudioEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "audio" });
|
|
1359
1359
|
}
|
|
1360
1360
|
} catch (e) {
|
|
1361
|
-
throw this._logger?.log(C.ERROR, "change_audio"), this._debug.error("Microphone change failed", e), e;
|
|
1361
|
+
throw this._logger?.log(C.ERROR, "change_audio"), this._mediaStats?.logAudioError("start", e), this._debug.error("Microphone change failed", e), e;
|
|
1362
1362
|
}
|
|
1363
1363
|
}
|
|
1364
1364
|
async _changeScreen(e, t, n) {
|
|
@@ -1389,7 +1389,15 @@ var O = /* @__PURE__ */ function(e) {
|
|
|
1389
1389
|
}
|
|
1390
1390
|
async _applyAudioEffect() {
|
|
1391
1391
|
if (!N.audioEffects || !this._audioEffectParams) return N.audioEffects?.pause(), this._micAudioTrack;
|
|
1392
|
-
|
|
1392
|
+
if (!N.audioEffects.isInitialized) {
|
|
1393
|
+
let e = Date.now();
|
|
1394
|
+
try {
|
|
1395
|
+
await N.audioEffects.init(), this._mediaStats?.logMlReady("audio_effects", Date.now() - e);
|
|
1396
|
+
} catch (e) {
|
|
1397
|
+
throw this._mediaStats?.logMlError("audio_effects", e), e;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
N.audioEffects.resume(), N.audioEffects.setEffects(this._audioEffectParams.effects, this._audioEffectParams.isPreset), N.audioEffects.setSource(this._micAudioTrack);
|
|
1393
1401
|
let e = N.audioEffects.outputStream.getAudioTracks()[0];
|
|
1394
1402
|
return (!this._audioEffectsTrack || this._audioEffectsTrack.id !== e.id) && (this._audioEffectsTrack = e), this._audioEffectsTrack;
|
|
1395
1403
|
}
|
|
@@ -1476,7 +1484,7 @@ var O = /* @__PURE__ */ function(e) {
|
|
|
1476
1484
|
let e = await E.getUserAudio(void 0, this._debug, this._logger);
|
|
1477
1485
|
this._setMicAudioTrack(e.getAudioTracks()[0]), await t(await this._applyAudioEffect(), !0);
|
|
1478
1486
|
} catch (e) {
|
|
1479
|
-
throw N.audioEffects?.pause(), await t(E.getSilentMediaTrack(), !1), typeof e == "string" ? Error(e) : e;
|
|
1487
|
+
throw this._mediaStats?.logAudioError("start", e), N.audioEffects?.pause(), await t(E.getSilentMediaTrack(), !1), typeof e == "string" ? Error(e) : e;
|
|
1480
1488
|
}
|
|
1481
1489
|
else N.audioEffects?.pause(), await t(E.getSilentMediaTrack(), !1);
|
|
1482
1490
|
}
|
|
@@ -2182,7 +2190,7 @@ var xn = bn.getInstance(), N = class e {
|
|
|
2182
2190
|
return 1.1;
|
|
2183
2191
|
}
|
|
2184
2192
|
static get sdkVersion() {
|
|
2185
|
-
return "2.8.13-
|
|
2193
|
+
return "2.8.13-dev.05e6b21e.0";
|
|
2186
2194
|
}
|
|
2187
2195
|
static get debug() {
|
|
2188
2196
|
return e._params.debug;
|
|
@@ -3634,7 +3642,7 @@ var Bn = 0, Vn = 1, Hn = 2, Un = 3, Wn = 4, Gn = 5, Kn = 6, qn = 7, Jn = 0, Yn =
|
|
|
3634
3642
|
};
|
|
3635
3643
|
}
|
|
3636
3644
|
}, U = /* @__PURE__ */ function(e) {
|
|
3637
|
-
return e.CALL_INIT = "call_init", e.CALL_START = "call_start", e.CALL_ACCEPTED_OUTGOING = "call_accepted_outgoing", e.CALL_ACCEPTED_INCOMING = "call_accepted_incoming", e.FIRST_MEDIA_SENT = "first_media_sent", e.CALL_FINISH = "call_finish", e.CODEC_USAGE = "codec_usage", e.SIGNALING_CONNECTED = "signaling_connected", e.SCREENSHARE_FIRST_FRAME = "screen_share_first_frame", e.FIRST_MEDIA_RECEIVED = "first_media_received", e.CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally", e.USER_FEEDBACK_RECEIVED = "UserFeedbackReceived", e.SIGNALING_PING_SUMMARY = "signaling_ping_summary", e.SIGNALING_COMMAND_SUMMARY = "signaling_command_summary", e.API_CALL = "api_call", e.SDP_CREATE_OFFER = "sdp_create_offer", e.SDP_CREATE_ANSWER = "sdp_create_answer", e.SDP_SET_LOCAL_OFFER = "sdp_set_local_offer", e.SDP_SET_LOCAL_PRANSWER = "sdp_set_local_pranswer", e.SDP_SET_LOCAL_ANSWER = "sdp_set_local_answer", e.SDP_SET_LOCAL_ROLLBACK = "sdp_set_local_rollback", e.SDP_SET_REMOTE_OFFER = "sdp_set_remote_offer", e.SDP_SET_REMOTE_PRANSWER = "sdp_set_remote_pranswer", e.SDP_SET_REMOTE_ANSWER = "sdp_set_remote_answer", e.SDP_SET_REMOTE_ROLLBACK = "sdp_set_remote_rollback", e.SDP_GENERATED = "sdp_generated", e.SDP_RECEIVED = "sdp_received", e.WEBSOCKET_CONNECTED = "websocket_connected", e.WEBSOCKET_RECONNECTED = "websocket_reconnected", e.WEBSOCKET_FAILED_PINGS = "websocket_failed_pings", e.WEBSOCKET_FAILED_EXCEPTION = "websocket_failed_exception", e.WEBSOCKET_TIMEOUT = "websocket_timeout", e.WEBSOCKET_RESTART = "websocket_restart", e.WEBTRANSPORT_CONNECTED = "webtransport_connected", e.WEBTRANSPORT_RECONNECTED = "webtransport_reconnected", e.WEBTRANSPORT_FAILED_PINGS = "webtransport_failed_pings", e.WEBTRANSPORT_FAILED_EXCEPTION = "webtransport_failed_exception", e.WEBTRANSPORT_TIMEOUT = "webtransport_timeout", e.WEBTRANSPORT_RESTART = "webtransport_restart", e;
|
|
3645
|
+
return e.CALL_INIT = "call_init", e.CALL_START = "call_start", e.CALL_ACCEPTED_OUTGOING = "call_accepted_outgoing", e.CALL_ACCEPTED_INCOMING = "call_accepted_incoming", e.FIRST_MEDIA_SENT = "first_media_sent", e.CALL_FINISH = "call_finish", e.CODEC_USAGE = "codec_usage", e.SIGNALING_CONNECTED = "signaling_connected", e.SCREENSHARE_FIRST_FRAME = "screen_share_first_frame", e.FIRST_MEDIA_RECEIVED = "first_media_received", e.CALL_DECLINED_OR_HANGED_LOCALLY = "CallDeclinedOrHangedLocally", e.USER_FEEDBACK_RECEIVED = "UserFeedbackReceived", e.SIGNALING_PING_SUMMARY = "signaling_ping_summary", e.SIGNALING_COMMAND_SUMMARY = "signaling_command_summary", e.API_CALL = "api_call", e.SDP_CREATE_OFFER = "sdp_create_offer", e.SDP_CREATE_ANSWER = "sdp_create_answer", e.SDP_SET_LOCAL_OFFER = "sdp_set_local_offer", e.SDP_SET_LOCAL_PRANSWER = "sdp_set_local_pranswer", e.SDP_SET_LOCAL_ANSWER = "sdp_set_local_answer", e.SDP_SET_LOCAL_ROLLBACK = "sdp_set_local_rollback", e.SDP_SET_REMOTE_OFFER = "sdp_set_remote_offer", e.SDP_SET_REMOTE_PRANSWER = "sdp_set_remote_pranswer", e.SDP_SET_REMOTE_ANSWER = "sdp_set_remote_answer", e.SDP_SET_REMOTE_ROLLBACK = "sdp_set_remote_rollback", e.SDP_GENERATED = "sdp_generated", e.SDP_RECEIVED = "sdp_received", e.AUDIO_ERROR = "audio_error", e.ML_READY_TO_USE = "ml_ready_to_use", e.ML_ERROR = "ml_error", e.WEBSOCKET_CONNECTED = "websocket_connected", e.WEBSOCKET_RECONNECTED = "websocket_reconnected", e.WEBSOCKET_FAILED_PINGS = "websocket_failed_pings", e.WEBSOCKET_FAILED_EXCEPTION = "websocket_failed_exception", e.WEBSOCKET_TIMEOUT = "websocket_timeout", e.WEBSOCKET_RESTART = "websocket_restart", e.WEBTRANSPORT_CONNECTED = "webtransport_connected", e.WEBTRANSPORT_RECONNECTED = "webtransport_reconnected", e.WEBTRANSPORT_FAILED_PINGS = "webtransport_failed_pings", e.WEBTRANSPORT_FAILED_EXCEPTION = "webtransport_failed_exception", e.WEBTRANSPORT_TIMEOUT = "webtransport_timeout", e.WEBTRANSPORT_RESTART = "webtransport_restart", e;
|
|
3638
3646
|
}(U || {}), nr = 1e3;
|
|
3639
3647
|
function W(e, t, n = 0) {
|
|
3640
3648
|
return t in e && e[t] ? e[t] : n;
|
|
@@ -8285,8 +8293,8 @@ var Ao = class {
|
|
|
8285
8293
|
}));
|
|
8286
8294
|
}
|
|
8287
8295
|
}, jo = class {
|
|
8288
|
-
constructor(e, t = !1, n = z, r = null) {
|
|
8289
|
-
h(this, "_audioElement", null), h(this, "_debug", void 0), h(this, "_preparedAudioElement", void 0), h(this, "_audioTracks", /* @__PURE__ */ new Map()), h(this, "_allowMultipleTracks", void 0), h(this, "_volume", 1), h(this, "_features", { setSinkId: !!Audio.prototype.setSinkId }), h(this, "_statFirstMediaReceived", void 0), h(this, "_logger", void 0), this._statFirstMediaReceived = e, this._allowMultipleTracks = t, this._debug = n, this._logger = r, this._preparedAudioElement = this._prepareAudioElement();
|
|
8296
|
+
constructor(e, t = !1, n = z, r = null, i = null) {
|
|
8297
|
+
h(this, "_audioElement", null), h(this, "_debug", void 0), h(this, "_preparedAudioElement", void 0), h(this, "_audioTracks", /* @__PURE__ */ new Map()), h(this, "_allowMultipleTracks", void 0), h(this, "_volume", 1), h(this, "_features", { setSinkId: !!Audio.prototype.setSinkId }), h(this, "_statFirstMediaReceived", void 0), h(this, "_logger", void 0), h(this, "_mediaStats", void 0), this._statFirstMediaReceived = e, this._allowMultipleTracks = t, this._debug = n, this._logger = r, this._mediaStats = i, this._preparedAudioElement = this._prepareAudioElement();
|
|
8290
8298
|
}
|
|
8291
8299
|
add(e, t) {
|
|
8292
8300
|
this._allowMultipleTracks || this._clearTracks();
|
|
@@ -8325,7 +8333,7 @@ var Ao = class {
|
|
|
8325
8333
|
let e = E.getSavedOutput();
|
|
8326
8334
|
e && (await this._audioElement.setSinkId?.(e.deviceId), this._debug.debug("[audio] Output device changed", e));
|
|
8327
8335
|
} catch (e) {
|
|
8328
|
-
throw this._logger?.log(C.ERROR, "change_output"), this._debug.error("[audio] Output change failed", e), e;
|
|
8336
|
+
throw this._logger?.log(C.ERROR, "change_output"), this._mediaStats?.logAudioError("start", e), this._debug.error("[audio] Output change failed", e), e;
|
|
8329
8337
|
}
|
|
8330
8338
|
}
|
|
8331
8339
|
_getTracks() {
|
|
@@ -8355,7 +8363,7 @@ var Ao = class {
|
|
|
8355
8363
|
a ? t.setSinkId?.(a.deviceId).then(() => {
|
|
8356
8364
|
this._debug.debug("[audio] Output device", a);
|
|
8357
8365
|
}).catch((e) => {
|
|
8358
|
-
this._debug.warn("[audio] Failed to set output device", a, e);
|
|
8366
|
+
this._mediaStats?.logAudioError("init", e), this._debug.warn("[audio] Failed to set output device", a, e);
|
|
8359
8367
|
}) : this._debug.debug("[audio] Output device: system default");
|
|
8360
8368
|
}
|
|
8361
8369
|
_stopAudioElement() {
|
|
@@ -10009,6 +10017,44 @@ var $s = class {
|
|
|
10009
10017
|
}), this._codecUsages.clear();
|
|
10010
10018
|
}
|
|
10011
10019
|
}, tc = class {
|
|
10020
|
+
constructor(e) {
|
|
10021
|
+
h(this, "_statAggregator", void 0), this._statAggregator = e;
|
|
10022
|
+
}
|
|
10023
|
+
logAudioError(e, t) {
|
|
10024
|
+
this._statAggregator?.logEventualStat({
|
|
10025
|
+
name: U.AUDIO_ERROR,
|
|
10026
|
+
value: nc(t),
|
|
10027
|
+
string_value: rc(t) ? `${e}: ${rc(t)}` : e
|
|
10028
|
+
});
|
|
10029
|
+
}
|
|
10030
|
+
logMlReady(e, t) {
|
|
10031
|
+
this._statAggregator?.logEventualStat({
|
|
10032
|
+
name: U.ML_READY_TO_USE,
|
|
10033
|
+
value: Math.round(t),
|
|
10034
|
+
source: e
|
|
10035
|
+
});
|
|
10036
|
+
}
|
|
10037
|
+
logMlError(e, t) {
|
|
10038
|
+
this._statAggregator?.logEventualStat({
|
|
10039
|
+
name: U.ML_ERROR,
|
|
10040
|
+
value: nc(t),
|
|
10041
|
+
source: e,
|
|
10042
|
+
string_value: ic(t)
|
|
10043
|
+
});
|
|
10044
|
+
}
|
|
10045
|
+
};
|
|
10046
|
+
function nc(e) {
|
|
10047
|
+
return e instanceof DOMException ? e.code : 0;
|
|
10048
|
+
}
|
|
10049
|
+
function rc(e) {
|
|
10050
|
+
return e instanceof Error ? e.name : "";
|
|
10051
|
+
}
|
|
10052
|
+
function ic(e) {
|
|
10053
|
+
return e instanceof Error ? `${e.name}: ${e.message}` : typeof e == "string" ? e : "";
|
|
10054
|
+
}
|
|
10055
|
+
//#endregion
|
|
10056
|
+
//#region src/classes/stat/StatAggregator.ts
|
|
10057
|
+
var ac = class {
|
|
10012
10058
|
constructor(e) {
|
|
10013
10059
|
h(this, "_logger", void 0), h(this, "_eventualLogs", /* @__PURE__ */ new Set()), h(this, "_lastCallStatContext", null), this._logger = e;
|
|
10014
10060
|
}
|
|
@@ -10051,7 +10097,7 @@ var $s = class {
|
|
|
10051
10097
|
for (let [t, r] of Object.entries(e)) r !== void 0 && (r === null ? delete n[t] : n[t] = r);
|
|
10052
10098
|
this._logger.logClientStats(n, { occurredAt: t });
|
|
10053
10099
|
}
|
|
10054
|
-
},
|
|
10100
|
+
}, oc = class {
|
|
10055
10101
|
constructor(e) {
|
|
10056
10102
|
if (h(this, "q", void 0), h(this, "inits", []), h(this, "n", [
|
|
10057
10103
|
1,
|
|
@@ -10110,7 +10156,7 @@ var $s = class {
|
|
|
10110
10156
|
5
|
|
10111
10157
|
];
|
|
10112
10158
|
}
|
|
10113
|
-
},
|
|
10159
|
+
}, sc = class {
|
|
10114
10160
|
constructor() {
|
|
10115
10161
|
h(this, "n", 0), h(this, "mean", 0);
|
|
10116
10162
|
}
|
|
@@ -10122,9 +10168,9 @@ var $s = class {
|
|
|
10122
10168
|
get avg() {
|
|
10123
10169
|
return this.n ? this.mean : NaN;
|
|
10124
10170
|
}
|
|
10125
|
-
},
|
|
10171
|
+
}, cc = class {
|
|
10126
10172
|
constructor() {
|
|
10127
|
-
h(this, "count", 0), h(this, "minVal", Infinity), h(this, "maxVal", -Infinity), h(this, "mean", new
|
|
10173
|
+
h(this, "count", 0), h(this, "minVal", Infinity), h(this, "maxVal", -Infinity), h(this, "mean", new sc()), h(this, "p50", new oc(.5)), h(this, "p95", new oc(.95));
|
|
10128
10174
|
}
|
|
10129
10175
|
add(e) {
|
|
10130
10176
|
e < this.minVal && (this.minVal = e), e > this.maxVal && (this.maxVal = e), this.mean.add(e), this.p50.add(e), this.p95.add(e), this.count++;
|
|
@@ -10142,11 +10188,11 @@ var $s = class {
|
|
|
10142
10188
|
get hasData() {
|
|
10143
10189
|
return this.count > 0;
|
|
10144
10190
|
}
|
|
10145
|
-
},
|
|
10191
|
+
}, lc = class {
|
|
10146
10192
|
constructor(e) {
|
|
10147
10193
|
h(this, "_logger", void 0), h(this, "trackerByTransport", {
|
|
10148
|
-
ws: new
|
|
10149
|
-
wt: new
|
|
10194
|
+
ws: new cc(),
|
|
10195
|
+
wt: new cc()
|
|
10150
10196
|
}), h(this, "lastSeen", {}), this._logger = e;
|
|
10151
10197
|
}
|
|
10152
10198
|
mark(e) {
|
|
@@ -10175,17 +10221,17 @@ var $s = class {
|
|
|
10175
10221
|
}
|
|
10176
10222
|
destroy() {
|
|
10177
10223
|
this.trackerByTransport = {
|
|
10178
|
-
ws: new
|
|
10179
|
-
wt: new
|
|
10224
|
+
ws: new cc(),
|
|
10225
|
+
wt: new cc()
|
|
10180
10226
|
}, this.lastSeen = {};
|
|
10181
10227
|
}
|
|
10182
|
-
},
|
|
10228
|
+
}, uc = class {
|
|
10183
10229
|
constructor(e) {
|
|
10184
10230
|
h(this, "_logger", void 0), h(this, "trackerByCommand", /* @__PURE__ */ new Map()), this._logger = e;
|
|
10185
10231
|
}
|
|
10186
10232
|
mark(e, t, n) {
|
|
10187
10233
|
let r = `${e}|${n}`, i;
|
|
10188
|
-
this.trackerByCommand.has(r) ? i = this.trackerByCommand.get(r) : (i = new
|
|
10234
|
+
this.trackerByCommand.has(r) ? i = this.trackerByCommand.get(r) : (i = new cc(), this.trackerByCommand.set(r, i)), i.add(t);
|
|
10189
10235
|
}
|
|
10190
10236
|
logMetrics() {
|
|
10191
10237
|
for (let [e, t] of this.trackerByCommand.entries()) {
|
|
@@ -10207,9 +10253,9 @@ var $s = class {
|
|
|
10207
10253
|
destroy() {
|
|
10208
10254
|
this.trackerByCommand.clear();
|
|
10209
10255
|
}
|
|
10210
|
-
},
|
|
10256
|
+
}, dc = class {
|
|
10211
10257
|
constructor(e, t, n, r) {
|
|
10212
|
-
h(this, "logger", void 0), h(this, "lifecycle", void 0), h(this, "statAggregator", void 0), h(this, "codecStatsAggregator", void 0), h(this, "pings", void 0), h(this, "signalingCommands", void 0), h(this, "apiCalls", void 0), h(this, "_api", void 0), h(this, "_unloading", !1), this.logger = new Ls(e, t, n, r), this.lifecycle = new $s(this.logger), this.statAggregator = new
|
|
10258
|
+
h(this, "logger", void 0), h(this, "lifecycle", void 0), h(this, "statAggregator", void 0), h(this, "codecStatsAggregator", void 0), h(this, "pings", void 0), h(this, "signalingCommands", void 0), h(this, "apiCalls", void 0), h(this, "media", void 0), h(this, "_api", void 0), h(this, "_unloading", !1), this.logger = new Ls(e, t, n, r), this.lifecycle = new $s(this.logger), this.statAggregator = new ac(this.logger), this.codecStatsAggregator = new ec(this.logger, r), this.pings = new lc(this.logger), this.signalingCommands = new uc(this.logger), this.apiCalls = new Rs(this.statAggregator), this.media = new tc(this.statAggregator), this._api = e, this._api.setApiCallStats(this.apiCalls);
|
|
10213
10259
|
}
|
|
10214
10260
|
prepareForUnload() {
|
|
10215
10261
|
N.statQueueEnabled && (this._unloading = !0, this.logger.enterUnloadMode(), this.pings.logMetrics(), this.signalingCommands.logMetrics());
|
|
@@ -10226,7 +10272,7 @@ var $s = class {
|
|
|
10226
10272
|
destroy() {
|
|
10227
10273
|
this._api.setApiCallStats(null), this.lifecycle.markTerminated(), this.lifecycle.destroy(), this.statAggregator.destroy(), this.codecStatsAggregator.destroy(), this.pings.destroy(), this.signalingCommands.destroy(), this.logger.destroy(), N.statQueueEnabled && !this._unloading && Fs.notifyCallFinished();
|
|
10228
10274
|
}
|
|
10229
|
-
},
|
|
10275
|
+
}, fc = class {
|
|
10230
10276
|
constructor(e) {
|
|
10231
10277
|
h(this, "_statAggregator", void 0), h(this, "_isCallMarked", !1), h(this, "_isFinished", !1), h(this, "_callType", null), this._statAggregator = e;
|
|
10232
10278
|
}
|
|
@@ -10251,8 +10297,8 @@ var $s = class {
|
|
|
10251
10297
|
call_type: this._callType
|
|
10252
10298
|
}));
|
|
10253
10299
|
}
|
|
10254
|
-
},
|
|
10255
|
-
function
|
|
10300
|
+
}, pc = 1e3, mc = 1e4;
|
|
10301
|
+
function hc(e, t, n, r) {
|
|
10256
10302
|
return new k(e, {
|
|
10257
10303
|
callError: {
|
|
10258
10304
|
scope: "external",
|
|
@@ -10263,7 +10309,7 @@ function dc(e, t, n, r) {
|
|
|
10263
10309
|
message: r
|
|
10264
10310
|
});
|
|
10265
10311
|
}
|
|
10266
|
-
var
|
|
10312
|
+
var gc = 15, $ = class e extends b {
|
|
10267
10313
|
constructor(e, t) {
|
|
10268
10314
|
super(), h(this, "_api", void 0), h(this, "_signaling", void 0), h(this, "_signalingActor", void 0), h(this, "_displayLayoutRequester", void 0), h(this, "_mediaSource", null), h(this, "_conversation", null), h(this, "_myLastRequestedLayouts", {}), h(this, "_state", "IDLE"), h(this, "_previousState", null), h(this, "_waitingHallHoldPending", !1), h(this, "_participantState", X.CALLED), h(this, "_participants", {}), h(this, "_directTransportIsMaster", void 0), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_debug", z.createSessionLogger()), h(this, "_volumesDetector", null), h(this, "_speakerDetector", null), h(this, "_localVolumeDetector", null), h(this, "_specListener", null), h(this, "_activeSpeakerId", null), h(this, "_lastSignalledActiveSpeakerId", null), h(this, "_isRealTimeAsrRequested", !1), h(this, "_serverSettings", Mr()), h(this, "_serverTimeOffset", 0), h(this, "_delayedHangup", !1), h(this, "_onFastHangup", void 0), h(this, "_hangupEmitted", !1), h(this, "_hangupPromise", null), h(this, "_abortController", null), h(this, "_registeredPeerReceived", !1), h(this, "_calleeUnavailableTimer", null), h(this, "_reservedId", null), h(this, "_onUnload", void 0), h(this, "_onRestore", void 0), h(this, "_audioOutput", void 0), h(this, "_stats", void 0), h(this, "_lastStalled", {}), h(this, "_audioMixStalled", !1), h(this, "_audioFix", null), h(this, "_streamByStreamId", /* @__PURE__ */ new Map()), h(this, "_streamIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_streamWaitTimerByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_sequenceNumberByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownTimestampByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownQueueCleanupTimer", null), h(this, "_statFirstMediaReceived", void 0), h(this, "_toggleLocalVideo", ko((e) => {
|
|
10269
10315
|
if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "video_1" : "video_0"), this._mediaSource.toggleVideo(e);
|
|
@@ -10279,7 +10325,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10279
10325
|
captureAudio: !1
|
|
10280
10326
|
});
|
|
10281
10327
|
}
|
|
10282
|
-
}, 100)), this._stats = new
|
|
10328
|
+
}, 100)), this._stats = new dc(e, t, () => this._conversation?.id || null, () => this._transport?.getTopology() ?? this._conversation?.topology), this._api = e, this._signaling = new eo(this._debug, this._stats.logger, this._stats.statAggregator, this._stats.pings, this._stats.signalingCommands), this._signalingActor = new Ho(this._onSignalingNotification.bind(this), this._debug), this._displayLayoutRequester = new Ro({
|
|
10283
10329
|
api: this._api,
|
|
10284
10330
|
debug: this._debug,
|
|
10285
10331
|
getParticipants: () => this._participants,
|
|
@@ -10290,13 +10336,13 @@ var fc = 15, $ = class e extends b {
|
|
|
10290
10336
|
this._stopFirstMediaSentProbe(), this._conversation && this._api && this._sendHangupApi(this._conversation.id, this._state === "IDLE" ? O.CANCELED : O.HUNGUP), this._stats.prepareForUnload(), this._stats.destroy();
|
|
10291
10337
|
}, this._onRestore = () => {
|
|
10292
10338
|
this._stats.restoreAfterUnload();
|
|
10293
|
-
}, window.addEventListener("pagehide", this._onUnload), window.addEventListener("pageshow", this._onRestore), this._statFirstMediaReceived = new
|
|
10339
|
+
}, window.addEventListener("pagehide", this._onUnload), window.addEventListener("pageshow", this._onRestore), this._statFirstMediaReceived = new fc(this._stats.statAggregator), this._audioOutput = new jo(this._statFirstMediaReceived, N.transparentAudio, this._debug, this._stats.logger, this._stats.media), N.videoTracksCount > 0 && (this._cooldownQueueCleanupTimer = window.setInterval(this._cleanupCooldownQueue.bind(this), pc));
|
|
10294
10340
|
}
|
|
10295
10341
|
static current() {
|
|
10296
10342
|
return B.getActive() ?? (N.hold ? null : B.getFirst());
|
|
10297
10343
|
}
|
|
10298
10344
|
static hangupAfterInit(e) {
|
|
10299
|
-
let t =
|
|
10345
|
+
let t = _c;
|
|
10300
10346
|
if (t) {
|
|
10301
10347
|
if (typeof e == "function" && (t._onFastHangup = e), t._delayedHangup === !1 && !t._conversation) {
|
|
10302
10348
|
t._delayedHangup = !0, t._abortController?.abort(new k(O.CANCELED));
|
|
@@ -10369,7 +10415,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10369
10415
|
this._stats.lifecycle.markInitializationStarted({
|
|
10370
10416
|
source: "outgoing",
|
|
10371
10417
|
conversationId: u
|
|
10372
|
-
}), this._debug.setConversationId(u),
|
|
10418
|
+
}), this._debug.setConversationId(u), _c = this, this._abortController = new AbortController(), this._api.setAbortSignal(this._abortController?.signal), this._signaling.setAbortSignal(this._abortController?.signal);
|
|
10373
10419
|
try {
|
|
10374
10420
|
this._mediaSource = this._createMediaSource(), await this._mediaSource.request(n);
|
|
10375
10421
|
let l = this._mediaSource.mediaSettings;
|
|
@@ -10401,18 +10447,18 @@ var fc = 15, $ = class e extends b {
|
|
|
10401
10447
|
let e = B.get(this._conversation.id);
|
|
10402
10448
|
e && e !== this && e._close(new k(O.HUNGUP, { remote: !0 }));
|
|
10403
10449
|
}
|
|
10404
|
-
return B.add(this), await B.setActive(this.id),
|
|
10450
|
+
return B.add(this), await B.setActive(this.id), _c = null, this._conversation.concurrent && await this._acceptConcurrent(), f && !this._registeredPeerReceived && this._state !== "CLOSE" && (this._calleeUnavailableTimer = window.setTimeout(() => {
|
|
10405
10451
|
this._calleeUnavailableTimer = null, this._close(new k(O.CALLEE_UNAVAILABLE), { signalingReason: O.CANCELED });
|
|
10406
10452
|
}, f)), this._conversation;
|
|
10407
10453
|
} catch (e) {
|
|
10408
|
-
throw
|
|
10454
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, { errorText: "Unable to start conversation" }), e;
|
|
10409
10455
|
}
|
|
10410
10456
|
}
|
|
10411
10457
|
async onJoin(e) {
|
|
10412
10458
|
this._stats.lifecycle.markInitializationStarted({
|
|
10413
10459
|
source: e.anonymous ? "anonym_join" : "join",
|
|
10414
10460
|
conversationId: e.conversationId
|
|
10415
|
-
}),
|
|
10461
|
+
}), _c = this, this._state = "PROCESSING", this._debug.setConversationId(e.conversationId ?? null), this._abortController = new AbortController(), this._api.setAbortSignal(this._abortController?.signal), this._signaling.setAbortSignal(this._abortController?.signal);
|
|
10416
10462
|
try {
|
|
10417
10463
|
let t = !!e.observedIds?.length;
|
|
10418
10464
|
if (t && N.videoTracksCount > 0) throw this._debug.error("Observer mode: please set videoTracksCount=0"), new k(O.UNSUPPORTED, { callError: {
|
|
@@ -10429,9 +10475,9 @@ var fc = 15, $ = class e extends b {
|
|
|
10429
10475
|
code: "conversation",
|
|
10430
10476
|
description: "not-initialized-after-join"
|
|
10431
10477
|
} });
|
|
10432
|
-
return this._conversation.observer = t, R.onLocalStream(this._mediaSource.getStream(), n, this.id), this._conversation.waitForAdmin || this._conversation.waitingHall ? (this._debug.log(this._conversation.waitForAdmin ? "Wait for admin" : "In waiting hall"), B.add(this),
|
|
10478
|
+
return this._conversation.observer = t, R.onLocalStream(this._mediaSource.getStream(), n, this.id), this._conversation.waitForAdmin || this._conversation.waitingHall ? (this._debug.log(this._conversation.waitForAdmin ? "Wait for admin" : "In waiting hall"), B.add(this), _c = null, this._signaling.readyToSend(), R.onLocalStatus(this._conversation.waitForAdmin ? P.WAIT_FOR_ADMIN : P.WAITING_HALL, this.id), this._conversation) : this._onJoinPart2(r);
|
|
10433
10479
|
} catch (e) {
|
|
10434
|
-
throw
|
|
10480
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, { errorText: "Unable to join conversation" }), e;
|
|
10435
10481
|
}
|
|
10436
10482
|
}
|
|
10437
10483
|
async _onJoinPart2(e, t = !0, n = !1) {
|
|
@@ -10446,7 +10492,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10446
10492
|
if (this._delayedHangup) throw new k(O.CANCELED);
|
|
10447
10493
|
this._processConnectionSharedMovieInfo(e), this._processConversationUrlSharingInfo(e), this._processConnectionAsrInfo(e);
|
|
10448
10494
|
let r = this._extractExternalRoomsData(e.rooms?.rooms, e.rooms?.roomId);
|
|
10449
|
-
R.onConversation(this._conversation.externalId, this._conversation.mediaModifiers, this._getMuteStatesForCurrentRoom(), this._getMainRoomParticipants(), r, this.id), this._onConversationParticipantListChunk(e), this._processPinnedParticipants(e), R.onLocalStatus(P.WAITING, this.id), this._toggleJoinAvailability(), this._changeNeedRate(), t && (this._state = "ACTIVE"), this._changeFeatureSet(), t && (B.add(this), n ? await this._holdLocally() : await B.setActive(this.id),
|
|
10495
|
+
R.onConversation(this._conversation.externalId, this._conversation.mediaModifiers, this._getMuteStatesForCurrentRoom(), this._getMainRoomParticipants(), r, this.id), this._onConversationParticipantListChunk(e), this._processPinnedParticipants(e), R.onLocalStatus(P.WAITING, this.id), this._toggleJoinAvailability(), this._changeNeedRate(), t && (this._state = "ACTIVE"), this._changeFeatureSet(), t && (B.add(this), n ? await this._holdLocally() : await B.setActive(this.id), _c = null);
|
|
10450
10496
|
let i = this._extractLocalParticipantFromConnection(e);
|
|
10451
10497
|
if (i) {
|
|
10452
10498
|
let e = M.mapParticipantState(i);
|
|
@@ -10454,7 +10500,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10454
10500
|
}
|
|
10455
10501
|
return t && this._openTransport(Object.values(this._participants), !1), this._conversation;
|
|
10456
10502
|
} catch (e) {
|
|
10457
|
-
throw
|
|
10503
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, { errorText: "Unable to join conversation" }), e;
|
|
10458
10504
|
}
|
|
10459
10505
|
}
|
|
10460
10506
|
_extractExternalRooms(e) {
|
|
@@ -10474,7 +10520,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10474
10520
|
B.reserve(e), this._reservedId = e, a && this._api.setUserId(a), this._stats.lifecycle.markInitializationStarted({
|
|
10475
10521
|
source: "incoming",
|
|
10476
10522
|
conversationId: e
|
|
10477
|
-
}), this._debug.setConversationId(e),
|
|
10523
|
+
}), this._debug.setConversationId(e), _c = this, this._abortController = new AbortController(), this._api.setAbortSignal(this._abortController?.signal), this._signaling.setAbortSignal(this._abortController?.signal);
|
|
10478
10524
|
try {
|
|
10479
10525
|
let a = await this._prepareConversation(e, t, n, r, i);
|
|
10480
10526
|
if (this._mediaSource = this._createMediaSource(), !this._conversation) throw new k(O.UNKNOWN_ERROR, { callError: {
|
|
@@ -10483,9 +10529,9 @@ var fc = 15, $ = class e extends b {
|
|
|
10483
10529
|
description: "incoming-not-initialized"
|
|
10484
10530
|
} });
|
|
10485
10531
|
if (!a.conversation.participants.find((e) => e.state === X.CALLED && e.id === this._conversation?.userId)) throw this._debug.log("Push rejected (there is an active call)"), this._stats.logger.log(C.PUSH, "rejected"), new k(O.REJECTED);
|
|
10486
|
-
if (await this._processConnection(a), this._extractConnectionUrlSharingInfo(a), this._allocateTransport(), this._createSpeakerDetector(), this._createSpecListener(), this._processPinnedParticipants(a), this._signaling.readyToSend(), this._stats.lifecycle.markCallStarted(), this._stats.logger.log(C.PUSH, "accepted"), B.add(this),
|
|
10532
|
+
if (await this._processConnection(a), this._extractConnectionUrlSharingInfo(a), this._allocateTransport(), this._createSpeakerDetector(), this._createSpecListener(), this._processPinnedParticipants(a), this._signaling.readyToSend(), this._stats.lifecycle.markCallStarted(), this._stats.logger.log(C.PUSH, "accepted"), B.add(this), _c = null, this._delayedHangup) throw new k(O.CANCELED);
|
|
10487
10533
|
} catch (e) {
|
|
10488
|
-
throw
|
|
10534
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, {
|
|
10489
10535
|
errorText: "Unable to handle inbound call push",
|
|
10490
10536
|
signalingReason: e instanceof k && e.hangup === O.BUSY ? O.BUSY : void 0
|
|
10491
10537
|
}), e;
|
|
@@ -10772,10 +10818,10 @@ var fc = 15, $ = class e extends b {
|
|
|
10772
10818
|
isVideo: f,
|
|
10773
10819
|
joiningAllowed: a,
|
|
10774
10820
|
requireAuthToJoin: o
|
|
10775
|
-
}, this._abortController?.signal), !e) throw
|
|
10821
|
+
}, this._abortController?.signal), !e) throw hc(O.FAST_START_ERROR, "invalid-response", "fast-start-response-empty");
|
|
10776
10822
|
if (!e.internalCallerParams) {
|
|
10777
10823
|
let t = e.rejectedParticipants[0]?.status;
|
|
10778
|
-
throw
|
|
10824
|
+
throw hc(O.FAST_START_ERROR, t ? "fast-start" : "invalid-response", t ?? "fast-start-internal-caller-params-empty", JSON.stringify(e));
|
|
10779
10825
|
}
|
|
10780
10826
|
} catch (e) {
|
|
10781
10827
|
throw this._delayedHangup && this._abortController?.signal.aborted ? new k(O.CANCELED) : e instanceof k ? e : e instanceof Error ? new k(O.FAST_START_ERROR, { message: e.message }) : new k(O.FAST_START_ERROR, { message: String(e) });
|
|
@@ -10797,7 +10843,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10797
10843
|
token: new URL(t.endpoint).searchParams.get("token") ?? ""
|
|
10798
10844
|
}, this._debug.debug("FastStart", p), m = "fastStart";
|
|
10799
10845
|
} catch {
|
|
10800
|
-
throw
|
|
10846
|
+
throw hc(O.FAST_START_ERROR, "invalid-response", "fast-start-internal-caller-params-invalid");
|
|
10801
10847
|
}
|
|
10802
10848
|
} else p = await this._api.startConversation(d, e, t, f, i, a, o, { onlyAdminCanShareMovie: s }, c), this._debug.debug("Api.startConversation", p), m = "startConversation";
|
|
10803
10849
|
Mo(p, m), this._setConversationParams(p), this._stats.lifecycle.bindConversationId(p.id);
|
|
@@ -10825,9 +10871,9 @@ var fc = 15, $ = class e extends b {
|
|
|
10825
10871
|
joinLink: i,
|
|
10826
10872
|
isVideo: c,
|
|
10827
10873
|
internalParams: this._buildInternalParams()
|
|
10828
|
-
}, this._abortController?.signal), !e) throw
|
|
10829
|
-
if (!e.internalCallerParams) throw
|
|
10830
|
-
if (!e.conversationId) throw
|
|
10874
|
+
}, this._abortController?.signal), !e) throw hc(O.FAST_JOIN_ERROR, "invalid-response", "fast-join-response-empty");
|
|
10875
|
+
if (!e.internalCallerParams) throw hc(O.FAST_JOIN_ERROR, "invalid-response", "fast-join-internal-caller-params-empty", JSON.stringify(e));
|
|
10876
|
+
if (!e.conversationId) throw hc(O.FAST_JOIN_ERROR, "invalid-response", "fast-join-conversation-id-empty", JSON.stringify(e));
|
|
10831
10877
|
} catch (e) {
|
|
10832
10878
|
throw this._delayedHangup && this._abortController?.signal.aborted ? new k(O.CANCELED) : e instanceof k ? e : e instanceof Error ? new k(O.FAST_JOIN_ERROR, { message: e.message }) : new k(O.FAST_JOIN_ERROR, { message: String(e) });
|
|
10833
10879
|
}
|
|
@@ -10845,7 +10891,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10845
10891
|
token: new URL(t.endpoint).searchParams.get("token") ?? ""
|
|
10846
10892
|
}, this._debug.debug("FastJoin", l), u = "fastJoin";
|
|
10847
10893
|
} catch (e) {
|
|
10848
|
-
throw e instanceof k ? e :
|
|
10894
|
+
throw e instanceof k ? e : hc(O.FAST_JOIN_ERROR, "invalid-response", "fast-join-internal-caller-params-invalid");
|
|
10849
10895
|
}
|
|
10850
10896
|
} else if (t) l = await this._api.joinConversation(t, c, r), u = "joinConversation";
|
|
10851
10897
|
else if (i) l = await this._api.joinConversationByLink(i, c, a, o), u = "joinConversationByLink";
|
|
@@ -11027,7 +11073,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11027
11073
|
this._conversation.acceptTime = e.conversation.acceptTime, this._conversation.features = e.conversation.features || [], this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._conversation.participantsLimit = e.conversation.participantsLimit || 30, this._conversation.topology = e.conversation.topology || J.DIRECT, this._conversation.concurrent = e.isConcurrent || !1, this._conversation.chatId = e.conversation.multichatId, this._conversation.mediaModifiers = e.mediaModifiers, this._conversation.waitingHall = !1, this._conversation.waitForAdmin = !1, this._conversation.restricted = !1, this._cacheParticipantExternalIds(e.conversation.participants ?? []);
|
|
11028
11074
|
}
|
|
11029
11075
|
_createMediaSource() {
|
|
11030
|
-
let e = new Yt(this._debug, this._stats.logger);
|
|
11076
|
+
let e = new Yt(this._debug, this._stats.logger, this._stats.media);
|
|
11031
11077
|
return this.subscribe(e, qt.SOURCE_CHANGED, this._onLocalMediaStreamChanged.bind(this)), this.subscribe(e, qt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._audioFix = new Ao(e, this._debug, this._stats.logger), e;
|
|
11032
11078
|
}
|
|
11033
11079
|
async _connectSignaling(e, t) {
|
|
@@ -11336,7 +11382,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11336
11382
|
_onRemoveParticipant(e) {
|
|
11337
11383
|
this._debug.debug(`Remove participant [${e}]`);
|
|
11338
11384
|
let t = [], n = this._participants;
|
|
11339
|
-
for (let r = 0; r <=
|
|
11385
|
+
for (let r = 0; r <= gc; r++) {
|
|
11340
11386
|
let i = n[M.compose(e, r)];
|
|
11341
11387
|
i && t.push(i);
|
|
11342
11388
|
}
|
|
@@ -11559,7 +11605,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11559
11605
|
});
|
|
11560
11606
|
}
|
|
11561
11607
|
}
|
|
11562
|
-
if (r && r.length && (this._debug.warn("Could not allocate one or more participants", r), t)) throw new
|
|
11608
|
+
if (r && r.length && (this._debug.warn("Could not allocate one or more participants", r), t)) throw new vc("Could not allocate one or more participants", r);
|
|
11563
11609
|
}
|
|
11564
11610
|
async _cleanupCooldownQueue() {
|
|
11565
11611
|
let e = {}, t = this._cooldownTimestampByStreamDescription.entries();
|
|
@@ -11567,7 +11613,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11567
11613
|
let n = t.next();
|
|
11568
11614
|
if (n.done) break;
|
|
11569
11615
|
let r = n.value;
|
|
11570
|
-
if (r[1] +
|
|
11616
|
+
if (r[1] + mc > Date.now()) break;
|
|
11571
11617
|
let i = r[0];
|
|
11572
11618
|
await this._stopStreaming(i), e[i] = { stopStream: !0 };
|
|
11573
11619
|
} while (!0);
|
|
@@ -13099,11 +13145,11 @@ var fc = 15, $ = class e extends b {
|
|
|
13099
13145
|
_getParticipant(e) {
|
|
13100
13146
|
return this._participants[e];
|
|
13101
13147
|
}
|
|
13102
|
-
},
|
|
13148
|
+
}, _c = null, vc = class e extends Error {
|
|
13103
13149
|
constructor(t, n) {
|
|
13104
13150
|
super(t), h(this, "participantErrors", void 0), Object.setPrototypeOf(this, e.prototype), this.participantErrors = n;
|
|
13105
13151
|
}
|
|
13106
|
-
},
|
|
13152
|
+
}, yc = class {
|
|
13107
13153
|
constructor() {
|
|
13108
13154
|
h(this, "_abortSignal", void 0), h(this, "_apiCallStats", null);
|
|
13109
13155
|
}
|
|
@@ -13148,7 +13194,7 @@ var fc = 15, $ = class e extends b {
|
|
|
13148
13194
|
async getInbounds() {
|
|
13149
13195
|
return [];
|
|
13150
13196
|
}
|
|
13151
|
-
},
|
|
13197
|
+
}, bc = class e {
|
|
13152
13198
|
constructor() {
|
|
13153
13199
|
h(this, "_participantIdToExternalId", /* @__PURE__ */ new Map()), h(this, "_externalIdToParticipantId", /* @__PURE__ */ new Map()), h(this, "_decorativeIdToInitialId", /* @__PURE__ */ new Map()), h(this, "_initialIdToDecorativeId", /* @__PURE__ */ new Map());
|
|
13154
13200
|
}
|
|
@@ -13183,27 +13229,27 @@ var fc = 15, $ = class e extends b {
|
|
|
13183
13229
|
clear() {
|
|
13184
13230
|
this._participantIdToExternalId.clear(), this._externalIdToParticipantId.clear(), this._decorativeIdToInitialId.clear(), this._initialIdToDecorativeId.clear();
|
|
13185
13231
|
}
|
|
13186
|
-
},
|
|
13187
|
-
function
|
|
13232
|
+
}, xc = "anonymLogin:", Sc = 700, Cc = 3e3;
|
|
13233
|
+
function wc(e) {
|
|
13188
13234
|
let t = e.error_code;
|
|
13189
13235
|
switch (t) {
|
|
13190
|
-
case 2: return
|
|
13191
|
-
case 4: return e.error_msg.includes("participants.limit.exceeded") ?
|
|
13192
|
-
case 300: return
|
|
13193
|
-
case 1101: return
|
|
13194
|
-
case 1102: return
|
|
13195
|
-
case 1103: return
|
|
13196
|
-
case 1104: return
|
|
13197
|
-
case 1106: return
|
|
13198
|
-
case 1113: return
|
|
13236
|
+
case 2: return Tc(O.SERVICE_UNAVAILABLE, t, "service-unavailable");
|
|
13237
|
+
case 4: return e.error_msg.includes("participants.limit.exceeded") ? Tc(O.PARTICIPANT_LIMIT_REACHED, t, "participants-limit-exceeded") : Tc(x.API, t, "request-error");
|
|
13238
|
+
case 300: return Tc(O.NOT_FOUND, t, "not-found");
|
|
13239
|
+
case 1101: return Tc(O.SERVICE_DISABLED, t, "vchat-service-disabled");
|
|
13240
|
+
case 1102: return Tc(O.CALLEE_IS_OFFLINE, t, "target-user-unavailable");
|
|
13241
|
+
case 1103: return Tc(O.NOT_FRIENDS, t, "friendship-required");
|
|
13242
|
+
case 1104: return Dc(t, "youla-api-error");
|
|
13243
|
+
case 1106: return Dc(t, "vk-api-error");
|
|
13244
|
+
case 1113: return Tc(O.CALLER_IS_REJECTED, t, "caller-is-rejected");
|
|
13199
13245
|
case 1114: {
|
|
13200
13246
|
let n = e.custom_error?.vchat_detailed_api_error?.code, r = n?.startsWith("obsolete_client");
|
|
13201
|
-
return
|
|
13247
|
+
return Tc(r ? O.OBSOLETE_CLIENT : O.VCHAT_DETAILED_ERROR, t, n ?? "detailed-error", r ? n : void 0);
|
|
13202
13248
|
}
|
|
13203
|
-
default: return
|
|
13249
|
+
default: return Tc(x.API, t, "api-error");
|
|
13204
13250
|
}
|
|
13205
13251
|
}
|
|
13206
|
-
function
|
|
13252
|
+
function Tc(e, t, n, r) {
|
|
13207
13253
|
return {
|
|
13208
13254
|
type: e,
|
|
13209
13255
|
callError: {
|
|
@@ -13215,10 +13261,10 @@ function xc(e, t, n, r) {
|
|
|
13215
13261
|
message: r
|
|
13216
13262
|
};
|
|
13217
13263
|
}
|
|
13218
|
-
function
|
|
13264
|
+
function Ec(e) {
|
|
13219
13265
|
return e?.error_code === void 0 ? e instanceof k && e.callError && "code" in e.callError ? String(e.callError.code) : e instanceof Error ? e.name : "network" : String(e.error_code);
|
|
13220
13266
|
}
|
|
13221
|
-
function
|
|
13267
|
+
function Dc(e, t) {
|
|
13222
13268
|
return {
|
|
13223
13269
|
type: O.EXTERNAL_API_ERROR,
|
|
13224
13270
|
callError: {
|
|
@@ -13229,9 +13275,9 @@ function Cc(e, t) {
|
|
|
13229
13275
|
}
|
|
13230
13276
|
};
|
|
13231
13277
|
}
|
|
13232
|
-
var
|
|
13278
|
+
var Oc = class extends yc {
|
|
13233
13279
|
constructor(...e) {
|
|
13234
|
-
super(...e), h(this, "_uuid", void 0), h(this, "_idCache", new
|
|
13280
|
+
super(...e), h(this, "_uuid", void 0), h(this, "_idCache", new bc());
|
|
13235
13281
|
}
|
|
13236
13282
|
async _callUnsafe(e, t = {}, n = !1) {
|
|
13237
13283
|
let r = async (i) => {
|
|
@@ -13240,10 +13286,10 @@ var wc = class extends hc {
|
|
|
13240
13286
|
let r = await hs(e, t, n);
|
|
13241
13287
|
return this._apiCallStats?.log(e, performance.now() - a), r;
|
|
13242
13288
|
} catch (t) {
|
|
13243
|
-
if (this._apiCallStats?.log(e, performance.now() - a,
|
|
13289
|
+
if (this._apiCallStats?.log(e, performance.now() - a, Ec(t)), !t || typeof t != "object" || !Object.hasOwn(t, "error_msg")) {
|
|
13244
13290
|
i++;
|
|
13245
13291
|
let n = t && (typeof t == "object" || typeof t == "function") ? Object.getOwnPropertyNames(t).map((e) => `${e}: ${JSON.stringify(t[e])}`) : [String(t)];
|
|
13246
|
-
if (z.debug(`${e} network error, attempt ${i}: ${n.join("\n ")}`), this._abortSignal?.aborted && (z.debug(`${e} aborted`), this._abortSignal.throwIfAborted()), i < N.apiMaxAttempt) return await M.delay(Math.min(i *
|
|
13292
|
+
if (z.debug(`${e} network error, attempt ${i}: ${n.join("\n ")}`), this._abortSignal?.aborted && (z.debug(`${e} aborted`), this._abortSignal.throwIfAborted()), i < N.apiMaxAttempt) return await M.delay(Math.min(i * Sc, Cc), { signal: this._abortSignal }), r(i);
|
|
13247
13293
|
}
|
|
13248
13294
|
throw z.warn(e, "error", t), t;
|
|
13249
13295
|
}
|
|
@@ -13260,8 +13306,8 @@ var wc = class extends hc {
|
|
|
13260
13306
|
message: i?.error_msg,
|
|
13261
13307
|
code: i?.error_code
|
|
13262
13308
|
};
|
|
13263
|
-
if (i.custom_error && (a.custom_error = i.custom_error),
|
|
13264
|
-
let e =
|
|
13309
|
+
if (i.custom_error && (a.custom_error = i.custom_error), kc(i)) {
|
|
13310
|
+
let e = wc(i);
|
|
13265
13311
|
throw a.callError = e.callError, a.message = e.message ?? a.message, new k(e.type, a);
|
|
13266
13312
|
}
|
|
13267
13313
|
throw new k(x.API, a);
|
|
@@ -13313,17 +13359,17 @@ var wc = class extends hc {
|
|
|
13313
13359
|
return e && (t.session_data.auth_token = e, t.session_data.version = 3), this._callUnsafe("auth.anonymLogin", t, !0);
|
|
13314
13360
|
}
|
|
13315
13361
|
_getAnonymLoginCacheKey() {
|
|
13316
|
-
return N.authToken ? `${
|
|
13362
|
+
return N.authToken ? `${xc}${N.authToken}` : null;
|
|
13317
13363
|
}
|
|
13318
13364
|
_getCachedAnonymLogin() {
|
|
13319
13365
|
let e = this._getAnonymLoginCacheKey();
|
|
13320
13366
|
if (!e) return null;
|
|
13321
13367
|
let t = w.get(e);
|
|
13322
|
-
return
|
|
13368
|
+
return Ac(t) ? t : (t && w.remove(e), null);
|
|
13323
13369
|
}
|
|
13324
13370
|
_setCachedAnonymLogin(e) {
|
|
13325
13371
|
let t = this._getAnonymLoginCacheKey();
|
|
13326
|
-
!t || !
|
|
13372
|
+
!t || !Ac(e) || w.set(t, {
|
|
13327
13373
|
session_key: e.session_key,
|
|
13328
13374
|
session_secret_key: e.session_secret_key,
|
|
13329
13375
|
uid: e.uid
|
|
@@ -13537,19 +13583,19 @@ var wc = class extends hc {
|
|
|
13537
13583
|
return Array.isArray(e?.inbounds) ? e.inbounds : [];
|
|
13538
13584
|
}
|
|
13539
13585
|
};
|
|
13540
|
-
function
|
|
13586
|
+
function kc(e) {
|
|
13541
13587
|
return typeof e == "object" && !!e && "error_code" in e && "error_msg" in e;
|
|
13542
13588
|
}
|
|
13543
|
-
function
|
|
13589
|
+
function Ac(e) {
|
|
13544
13590
|
return typeof e == "object" && !!e && "session_key" in e && "session_secret_key" in e && typeof e.session_key == "string" && e.session_key.length > 0 && typeof e.session_secret_key == "string" && e.session_secret_key.length > 0;
|
|
13545
13591
|
}
|
|
13546
13592
|
//#endregion
|
|
13547
13593
|
//#region src/enums/RecordRole.ts
|
|
13548
|
-
var
|
|
13594
|
+
var jc = /* @__PURE__ */ function(e) {
|
|
13549
13595
|
return e.KING = "KING", e.PAWN = "PAWN", e;
|
|
13550
|
-
}(
|
|
13596
|
+
}(jc || {}), Mc = /* @__PURE__ */ function(e) {
|
|
13551
13597
|
return e.OFF = "0", e.ON = "1", e;
|
|
13552
|
-
}({}),
|
|
13598
|
+
}({}), Nc = class {
|
|
13553
13599
|
constructor(e) {
|
|
13554
13600
|
h(this, "_queue", void 0), h(this, "_readCursor", void 0), h(this, "_writeCursor", void 0), h(this, "_moveReadCursor", void 0), h(this, "_left", void 0), this._queue = Array(e).fill(null), this._readCursor = this._writeCursor = this._left = 0, this._moveReadCursor = !1;
|
|
13555
13601
|
}
|
|
@@ -13572,7 +13618,7 @@ var Dc = /* @__PURE__ */ function(e) {
|
|
|
13572
13618
|
let e = this._queue[this._readCursor];
|
|
13573
13619
|
return e && (this._moveReadCursor = !1, this._queue[this._readCursor] = null, this._readCursor = this.nextCursor(this._readCursor), --this._left), e;
|
|
13574
13620
|
}
|
|
13575
|
-
},
|
|
13621
|
+
}, Pc = class {
|
|
13576
13622
|
constructor(e, t, n, r = null) {
|
|
13577
13623
|
h(this, "_uuid", void 0), h(this, "_apiKey", void 0), h(this, "_callToken", void 0), h(this, "_apiEnv", void 0), h(this, "_baseApiUrl", void 0), h(this, "_sessionKey", void 0), this._uuid = M.uuid(), this._apiKey = t, this._callToken = n, this._apiEnv = e, this._baseApiUrl = r;
|
|
13578
13624
|
}
|
|
@@ -13598,7 +13644,7 @@ var Dc = /* @__PURE__ */ function(e) {
|
|
|
13598
13644
|
};
|
|
13599
13645
|
t?.peerId && (n.peerId = t.peerId), await hs("vchat.hangupConversation", n, !0, await fs(this._baseApiUrl, this._apiEnv));
|
|
13600
13646
|
}
|
|
13601
|
-
},
|
|
13647
|
+
}, Fc, Ic = null, Lc = !1, Rc = {
|
|
13602
13648
|
getCameras: E.getCameras,
|
|
13603
13649
|
getMicrophones: E.getMicrophones,
|
|
13604
13650
|
getOutput: E.getOutput,
|
|
@@ -13624,27 +13670,27 @@ var Dc = /* @__PURE__ */ function(e) {
|
|
|
13624
13670
|
baseChromeVersion: E.baseChromeVersion,
|
|
13625
13671
|
getAudioContext: E.getAudioContext,
|
|
13626
13672
|
isAudioShareSupported: E.isAudioShareSupported
|
|
13627
|
-
},
|
|
13628
|
-
function
|
|
13629
|
-
|
|
13673
|
+
}, zc = { participantMarkerCompare: M.participantMarkerCompare };
|
|
13674
|
+
function Bc(e) {
|
|
13675
|
+
Ic = e;
|
|
13630
13676
|
}
|
|
13631
|
-
function
|
|
13677
|
+
function Vc(e) {
|
|
13632
13678
|
N.videoEffects = e;
|
|
13633
13679
|
}
|
|
13634
|
-
function
|
|
13680
|
+
function Hc(e) {
|
|
13635
13681
|
N.audioEffects = e;
|
|
13636
13682
|
}
|
|
13637
|
-
function
|
|
13683
|
+
function Uc(e, t = {}) {
|
|
13638
13684
|
N.vad = e, N.vadOptions = t;
|
|
13639
13685
|
}
|
|
13640
|
-
function
|
|
13686
|
+
function Wc(e, t = null, n = {}, r = 1) {
|
|
13641
13687
|
N.vmoji = e, N.vmojiOptions = {
|
|
13642
13688
|
protocolVersion: r,
|
|
13643
13689
|
renderingOptions: n
|
|
13644
13690
|
}, t && e.setSDK(t);
|
|
13645
13691
|
}
|
|
13646
|
-
async function
|
|
13647
|
-
N.set(t),
|
|
13692
|
+
async function Gc(t) {
|
|
13693
|
+
N.set(t), Fc || (Fc = new Oc()), N.statQueueEnabled && (Ts.setApi(Fc), N.autoStartStats && Qc()), e.disableLog(!N.debug), z.toggle(N.debug), z.log(`Calls SDK ${N.sdkVersion}`, t), await E.init();
|
|
13648
13694
|
let n = E.getBrowserSupportFailure();
|
|
13649
13695
|
if (n) throw new k(x.UNSUPPORTED, { callError: {
|
|
13650
13696
|
scope: "internal",
|
|
@@ -13653,19 +13699,19 @@ async function Vc(t) {
|
|
|
13653
13699
|
} });
|
|
13654
13700
|
z.log("UserAgent:", navigator.userAgent), z.log("Screen resolution:", `${window.screen.width}x${window.screen.height}`), z.log("Permissions:", `Camera: ${E.hasCameraPermission()}, Mic: ${E.hasMicrophonePermission()}`), z.log("Simulcast:", `${t.simulcast} => ${N.simulcast}`);
|
|
13655
13701
|
}
|
|
13656
|
-
async function
|
|
13702
|
+
async function Kc(e, t = [S.AUDIO], n = "", r = !1, i = !1, a, o, s) {
|
|
13657
13703
|
let c = [];
|
|
13658
|
-
return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]),
|
|
13704
|
+
return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), Jc([], no.USER, t, n, r, i, a, c, o, s);
|
|
13659
13705
|
}
|
|
13660
|
-
function
|
|
13706
|
+
function qc(e, t = []) {
|
|
13661
13707
|
let n = e.getIncomingCallerExternalId();
|
|
13662
13708
|
return n ? t.length === 1 && t[0].id === n.id && t[0].type === n.type : !1;
|
|
13663
13709
|
}
|
|
13664
|
-
async function
|
|
13710
|
+
async function Jc(e, t = no.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
|
|
13665
13711
|
if (!N.hold && B.getActive()) throw z.error("There is already active call"), new k(O.HAS_ACTIVE_CALL);
|
|
13666
13712
|
let u = B.getAll().find((e) => e.isIncomingRinging);
|
|
13667
|
-
if (!N.hold && u && !
|
|
13668
|
-
return new $(new
|
|
13713
|
+
if (!N.hold && u && !qc(u, s)) throw z.error("There is already incoming call"), new k(O.HAS_ACTIVE_CALL);
|
|
13714
|
+
return new $(new Oc(), Ic).onStart({
|
|
13669
13715
|
opponentIds: e,
|
|
13670
13716
|
opponentType: t,
|
|
13671
13717
|
mediaOptions: n,
|
|
@@ -13678,49 +13724,49 @@ async function Wc(e, t = no.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
|
|
|
13678
13724
|
conversationId: l
|
|
13679
13725
|
});
|
|
13680
13726
|
}
|
|
13681
|
-
async function
|
|
13682
|
-
return
|
|
13727
|
+
async function Yc(e, t) {
|
|
13728
|
+
return Xc(e, j.USER, void 0, t);
|
|
13683
13729
|
}
|
|
13684
|
-
async function
|
|
13730
|
+
async function Xc(e, t = j.USER, n, r, i, a) {
|
|
13685
13731
|
if (e === $.id()) throw Error("Push has already been processed");
|
|
13686
|
-
return new $(new
|
|
13732
|
+
return new $(new Oc(), Ic).onPush(e, t, n, r, i, a);
|
|
13687
13733
|
}
|
|
13688
|
-
async function
|
|
13689
|
-
return
|
|
13734
|
+
async function Zc() {
|
|
13735
|
+
return Fc.getInbounds();
|
|
13690
13736
|
}
|
|
13691
|
-
function
|
|
13737
|
+
function Qc() {
|
|
13692
13738
|
if (N.statQueueEnabled) {
|
|
13693
|
-
if (!
|
|
13739
|
+
if (!Fc) {
|
|
13694
13740
|
z.error("[CallsSDK] startStats() called before init()");
|
|
13695
13741
|
return;
|
|
13696
13742
|
}
|
|
13697
|
-
|
|
13743
|
+
Lc || (Lc = !0, Fs.start(Fc));
|
|
13698
13744
|
}
|
|
13699
13745
|
}
|
|
13700
|
-
async function
|
|
13701
|
-
return e && (N.authToken = e), t !== void 0 && N.apiBaseUrl !== t && (N.apiBaseUrl = t, us()),
|
|
13746
|
+
async function $c(e, t) {
|
|
13747
|
+
return e && (N.authToken = e), t !== void 0 && N.apiBaseUrl !== t && (N.apiBaseUrl = t, us()), Fc.authorize();
|
|
13702
13748
|
}
|
|
13703
|
-
async function
|
|
13704
|
-
return
|
|
13749
|
+
async function el(e = [S.AUDIO], t) {
|
|
13750
|
+
return Tu(t).accept(e);
|
|
13705
13751
|
}
|
|
13706
|
-
async function
|
|
13707
|
-
let t =
|
|
13752
|
+
async function tl(e) {
|
|
13753
|
+
let t = Su(e?.conversationId);
|
|
13708
13754
|
if (t) return t.decline(e);
|
|
13709
13755
|
}
|
|
13710
|
-
async function
|
|
13711
|
-
return
|
|
13756
|
+
async function nl(e, t = [S.AUDIO]) {
|
|
13757
|
+
return rl(e, t);
|
|
13712
13758
|
}
|
|
13713
|
-
async function
|
|
13759
|
+
async function rl(e, t, n) {
|
|
13714
13760
|
if (!N.hold && B.callsLength > 0) throw z.error("There is already active call"), new k(O.HAS_ACTIVE_CALL);
|
|
13715
|
-
return new $(new
|
|
13761
|
+
return new $(new Oc(), Ic).onJoin({
|
|
13716
13762
|
conversationId: e,
|
|
13717
13763
|
mediaOptions: t,
|
|
13718
13764
|
chatId: n
|
|
13719
13765
|
});
|
|
13720
13766
|
}
|
|
13721
|
-
async function
|
|
13767
|
+
async function il(e, t = [S.AUDIO], n, r, i, a) {
|
|
13722
13768
|
if (!N.hold && B.callsLength > 0) throw z.error("There is already active call"), new k(O.HAS_ACTIVE_CALL);
|
|
13723
|
-
return n && (N.anonymToken = n), new $(new
|
|
13769
|
+
return n && (N.anonymToken = n), new $(new Oc(), Ic).onJoin({
|
|
13724
13770
|
joinLink: e,
|
|
13725
13771
|
mediaOptions: t,
|
|
13726
13772
|
observedIds: r,
|
|
@@ -13729,30 +13775,30 @@ async function el(e, t = [S.AUDIO], n, r, i, a) {
|
|
|
13729
13775
|
anonymous: !!N.anonymToken
|
|
13730
13776
|
});
|
|
13731
13777
|
}
|
|
13732
|
-
function
|
|
13733
|
-
let t =
|
|
13778
|
+
function al(e) {
|
|
13779
|
+
let t = Su(e?.conversationId);
|
|
13734
13780
|
return t ? t.hangup(e) : ($.hangupAfterInit(e?.onFastHangup), Promise.resolve());
|
|
13735
13781
|
}
|
|
13736
|
-
async function
|
|
13782
|
+
async function ol(e, t) {
|
|
13737
13783
|
let n = Array.isArray(e) ? e : [e], r = $.current();
|
|
13738
13784
|
r && await r.addParticipant(n, t);
|
|
13739
13785
|
}
|
|
13740
|
-
async function
|
|
13786
|
+
async function sl(e, t) {
|
|
13741
13787
|
let n = $.current();
|
|
13742
13788
|
if (n) {
|
|
13743
13789
|
let r = e.map((e) => M.composeUserId(e));
|
|
13744
13790
|
await n.addParticipantLegacy(r, t);
|
|
13745
13791
|
}
|
|
13746
13792
|
}
|
|
13747
|
-
async function
|
|
13748
|
-
let n =
|
|
13793
|
+
async function cl(e, t = !1) {
|
|
13794
|
+
let n = Eu(e, "removeParticipant");
|
|
13749
13795
|
if (n) try {
|
|
13750
13796
|
await n.conversation.removeParticipant(M.decomposeParticipantId(n.participantId).compositeUserId, t);
|
|
13751
13797
|
} catch (e) {
|
|
13752
13798
|
z.warn(`Failed to remove participant ${n.participantId}. Perhaps he is no longer on the call. ${e}`);
|
|
13753
13799
|
}
|
|
13754
13800
|
}
|
|
13755
|
-
async function
|
|
13801
|
+
async function ll(e, t = !1) {
|
|
13756
13802
|
let n = $.current();
|
|
13757
13803
|
if (n) try {
|
|
13758
13804
|
await n.removeParticipant(M.composeUserId(e), t);
|
|
@@ -13760,13 +13806,13 @@ async function al(e, t = !1) {
|
|
|
13760
13806
|
z.warn(`Failed to remove participant ${e}. Perhaps he is no longer on the call. ${t}`);
|
|
13761
13807
|
}
|
|
13762
13808
|
}
|
|
13763
|
-
async function
|
|
13809
|
+
async function ul(e, t) {
|
|
13764
13810
|
let n = $.current();
|
|
13765
13811
|
if (e === "videoinput" && jt.contains(t)) return N.videoFacingMode = t, n ? (E.isMobile() && n.stopVideoTrack(), n.changeDevice(e)) : void 0;
|
|
13766
13812
|
if (!await E._saveDeviceId(e, t)) throw Error(`Device not found: ${t}`);
|
|
13767
13813
|
if (n) return n.changeDevice(e);
|
|
13768
13814
|
}
|
|
13769
|
-
async function
|
|
13815
|
+
async function dl(e, t) {
|
|
13770
13816
|
let n = typeof e == "object" ? {
|
|
13771
13817
|
...e,
|
|
13772
13818
|
fastScreenSharing: e.captureScreen && e.fastScreenSharing,
|
|
@@ -13775,40 +13821,40 @@ async function sl(e, t) {
|
|
|
13775
13821
|
captureScreen: e,
|
|
13776
13822
|
fastScreenSharing: !1,
|
|
13777
13823
|
captureAudio: !1
|
|
13778
|
-
}, r =
|
|
13824
|
+
}, r = Su(t);
|
|
13779
13825
|
return r ? r.toggleScreenCapturing(n) : Promise.reject();
|
|
13780
13826
|
}
|
|
13781
|
-
function
|
|
13827
|
+
function fl(e) {
|
|
13782
13828
|
let t = $.current();
|
|
13783
13829
|
t && t.toggleAnimojiCapturing(e);
|
|
13784
13830
|
}
|
|
13785
|
-
async function
|
|
13831
|
+
async function pl(e, t = !1) {
|
|
13786
13832
|
let n = $.current();
|
|
13787
13833
|
n && await n.setVideoStream(e, t);
|
|
13788
13834
|
}
|
|
13789
|
-
async function
|
|
13790
|
-
let n =
|
|
13835
|
+
async function ml(e, t) {
|
|
13836
|
+
let n = Su(t);
|
|
13791
13837
|
n && await n.toggleLocalVideo(e);
|
|
13792
13838
|
}
|
|
13793
|
-
async function
|
|
13794
|
-
let n =
|
|
13839
|
+
async function hl(e, t) {
|
|
13840
|
+
let n = Su(t);
|
|
13795
13841
|
n && await n.toggleLocalAudio(e);
|
|
13796
13842
|
}
|
|
13797
|
-
async function
|
|
13843
|
+
async function gl(e) {
|
|
13798
13844
|
let t = $.current();
|
|
13799
13845
|
if (t) return t.setLocalResolution(e);
|
|
13800
13846
|
}
|
|
13801
|
-
async function
|
|
13847
|
+
async function _l(e) {
|
|
13802
13848
|
let t = $.current();
|
|
13803
13849
|
t && await t.changePriorities(e);
|
|
13804
13850
|
}
|
|
13805
|
-
async function
|
|
13851
|
+
async function vl(e, t) {
|
|
13806
13852
|
let n = $.current();
|
|
13807
13853
|
if (n) {
|
|
13808
13854
|
if (t) {
|
|
13809
13855
|
let r = n.getCachedParticipantIdByExternalId(t);
|
|
13810
13856
|
if (!r) {
|
|
13811
|
-
|
|
13857
|
+
Cu(t, "changeParticipantState", n);
|
|
13812
13858
|
return;
|
|
13813
13859
|
}
|
|
13814
13860
|
await n.changeParticipantState(e, r);
|
|
@@ -13817,161 +13863,161 @@ async function ml(e, t) {
|
|
|
13817
13863
|
await n.changeParticipantState(e);
|
|
13818
13864
|
}
|
|
13819
13865
|
}
|
|
13820
|
-
async function
|
|
13866
|
+
async function yl() {
|
|
13821
13867
|
let e = $.current();
|
|
13822
13868
|
e && await e.putHandsDown();
|
|
13823
13869
|
}
|
|
13824
|
-
async function
|
|
13870
|
+
async function bl(e) {
|
|
13825
13871
|
let t = $.current();
|
|
13826
13872
|
t && await t.updateDisplayLayout(e);
|
|
13827
13873
|
}
|
|
13828
|
-
async function
|
|
13874
|
+
async function xl(e) {
|
|
13829
13875
|
let t = $.current();
|
|
13830
13876
|
t && await t.requestDisplayLayout(e);
|
|
13831
13877
|
}
|
|
13832
|
-
async function
|
|
13833
|
-
let r =
|
|
13878
|
+
async function Sl(e, t, n = !1) {
|
|
13879
|
+
let r = Eu(e, "grantRoles");
|
|
13834
13880
|
r && await r.conversation.grantRoles(r.participantId, t, n);
|
|
13835
13881
|
}
|
|
13836
|
-
async function
|
|
13882
|
+
async function Cl(e, t, n, r = !1) {
|
|
13837
13883
|
let i = $.current();
|
|
13838
13884
|
i && await i.grantRoles(M.composeParticipantId(e, j.USER, t), n, r);
|
|
13839
13885
|
}
|
|
13840
|
-
async function
|
|
13886
|
+
async function wl({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
|
|
13841
13887
|
if (e) {
|
|
13842
|
-
let i =
|
|
13888
|
+
let i = Eu(e, "muteParticipant");
|
|
13843
13889
|
return i ? i.conversation.muteParticipant(i.participantId, t, n, r) : void 0;
|
|
13844
13890
|
}
|
|
13845
13891
|
let i = $.current();
|
|
13846
13892
|
i && await i.muteParticipant(null, t, n, r);
|
|
13847
13893
|
}
|
|
13848
|
-
async function
|
|
13894
|
+
async function Tl({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
|
|
13849
13895
|
let a = $.current();
|
|
13850
13896
|
if (a) {
|
|
13851
13897
|
let o = e ? M.composeParticipantId(e, j.USER, r) : null;
|
|
13852
13898
|
await a.muteParticipant(o, t, n, i);
|
|
13853
13899
|
}
|
|
13854
13900
|
}
|
|
13855
|
-
async function
|
|
13856
|
-
let r =
|
|
13901
|
+
async function El(e, t = !1, n = null) {
|
|
13902
|
+
let r = Eu(e, "pinParticipant");
|
|
13857
13903
|
r && await r.conversation.pinParticipant(r.participantId, t, n);
|
|
13858
13904
|
}
|
|
13859
|
-
async function
|
|
13905
|
+
async function Dl(e, t = !1, n = 0, r = null) {
|
|
13860
13906
|
let i = $.current();
|
|
13861
13907
|
i && await i.pinParticipant(M.composeParticipantId(e, j.USER, n), t, r);
|
|
13862
13908
|
}
|
|
13863
|
-
async function
|
|
13909
|
+
async function Ol(e) {
|
|
13864
13910
|
let t = $.current();
|
|
13865
13911
|
t && await t.updateMediaModifiers(e);
|
|
13866
13912
|
}
|
|
13867
|
-
async function
|
|
13913
|
+
async function kl(e) {
|
|
13868
13914
|
let t = $.current();
|
|
13869
13915
|
t && await t.enableVideoSuspend(e);
|
|
13870
13916
|
}
|
|
13871
|
-
async function
|
|
13917
|
+
async function Al(e) {
|
|
13872
13918
|
let t = $.current();
|
|
13873
13919
|
t && await t.enableVideoSuspendSuggest(e);
|
|
13874
13920
|
}
|
|
13875
|
-
async function
|
|
13921
|
+
async function jl(e) {
|
|
13876
13922
|
let t = $.current();
|
|
13877
13923
|
t && await t.changeOptions(e);
|
|
13878
13924
|
}
|
|
13879
|
-
async function
|
|
13925
|
+
async function Ml(e, t = null) {
|
|
13880
13926
|
if (t) {
|
|
13881
|
-
let n =
|
|
13927
|
+
let n = Eu(t, "chatMessage");
|
|
13882
13928
|
return n ? n.conversation.chatMessage(e, M.decomposeParticipantId(n.participantId).compositeUserId) : void 0;
|
|
13883
13929
|
}
|
|
13884
13930
|
let n = $.current();
|
|
13885
13931
|
n && await n.chatMessage(e, null);
|
|
13886
13932
|
}
|
|
13887
|
-
async function
|
|
13933
|
+
async function Nl(e, t = null) {
|
|
13888
13934
|
let n = $.current();
|
|
13889
13935
|
if (n) {
|
|
13890
13936
|
let r = t ? M.composeUserId(t) : null;
|
|
13891
13937
|
await n.chatMessage(e, r);
|
|
13892
13938
|
}
|
|
13893
13939
|
}
|
|
13894
|
-
async function
|
|
13940
|
+
async function Pl(e = 10) {
|
|
13895
13941
|
let t = $.current();
|
|
13896
13942
|
if (t) return t.chatHistory(e);
|
|
13897
13943
|
}
|
|
13898
|
-
async function
|
|
13944
|
+
async function Fl(e, t = null) {
|
|
13899
13945
|
if (t) {
|
|
13900
|
-
let n =
|
|
13946
|
+
let n = Eu(t, "customData");
|
|
13901
13947
|
return n ? n.conversation.customData(e, n.participantId) : void 0;
|
|
13902
13948
|
}
|
|
13903
13949
|
let n = $.current();
|
|
13904
13950
|
n && await n.customData(e, null);
|
|
13905
13951
|
}
|
|
13906
|
-
async function
|
|
13952
|
+
async function Il(e, t = null, n = 0) {
|
|
13907
13953
|
let r = $.current();
|
|
13908
13954
|
if (r) {
|
|
13909
13955
|
let i = t ? M.composeParticipantId(t, j.USER, n) : null;
|
|
13910
13956
|
await r.customData(e, i);
|
|
13911
13957
|
}
|
|
13912
13958
|
}
|
|
13913
|
-
async function
|
|
13914
|
-
return (await
|
|
13959
|
+
async function Ll(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, waitForAdmin: r = !1, closedConversation: i = !1 } = {}, a) {
|
|
13960
|
+
return (await Fc.createConversation(a ?? M.uuid(), e, t, {
|
|
13915
13961
|
onlyAdminCanShareMovie: n,
|
|
13916
13962
|
waitForAdmin: r,
|
|
13917
13963
|
closedConversation: i
|
|
13918
13964
|
})).join_link;
|
|
13919
13965
|
}
|
|
13920
|
-
async function
|
|
13966
|
+
async function Rl(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
|
|
13921
13967
|
let a = i.map((e) => Z.fromId(e));
|
|
13922
|
-
return (await
|
|
13968
|
+
return (await Fc.createConversation(M.uuid(), e, t, {
|
|
13923
13969
|
onlyAdminCanShareMovie: n,
|
|
13924
13970
|
audienceMode: !0,
|
|
13925
13971
|
audioOnly: r
|
|
13926
13972
|
}, a)).join_link;
|
|
13927
13973
|
}
|
|
13928
|
-
async function
|
|
13974
|
+
async function zl() {
|
|
13929
13975
|
let e = $.current();
|
|
13930
13976
|
return e ? e.createJoinLink() : Promise.reject();
|
|
13931
13977
|
}
|
|
13932
|
-
async function
|
|
13978
|
+
async function Bl() {
|
|
13933
13979
|
let e = $.current();
|
|
13934
13980
|
return e ? e.removeJoinLink() : Promise.reject();
|
|
13935
13981
|
}
|
|
13936
|
-
async function
|
|
13937
|
-
return
|
|
13982
|
+
async function Vl(e, t) {
|
|
13983
|
+
return Fc.getAnonymTokenByLink(e, t);
|
|
13938
13984
|
}
|
|
13939
|
-
function
|
|
13985
|
+
function Hl(e) {
|
|
13940
13986
|
let t = $.current();
|
|
13941
13987
|
t && t.setVolume(e);
|
|
13942
13988
|
}
|
|
13943
|
-
function
|
|
13989
|
+
function Ul(e) {
|
|
13944
13990
|
N.forceRelayPolicy = e;
|
|
13945
13991
|
}
|
|
13946
|
-
async function
|
|
13992
|
+
async function Wl(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
|
|
13947
13993
|
let o = $.current();
|
|
13948
13994
|
return o ? o.startStream(e, t, n, r, i, a) : Promise.reject();
|
|
13949
13995
|
}
|
|
13950
|
-
async function
|
|
13996
|
+
async function Gl(e = null, t) {
|
|
13951
13997
|
let n = $.current();
|
|
13952
13998
|
return n ? n.stopStream(e, t) : Promise.reject();
|
|
13953
13999
|
}
|
|
13954
|
-
async function
|
|
14000
|
+
async function Kl(e = null) {
|
|
13955
14001
|
let t = $.current();
|
|
13956
14002
|
return t ? t.publishStream(e) : Promise.reject();
|
|
13957
14003
|
}
|
|
13958
|
-
async function
|
|
14004
|
+
async function ql() {
|
|
13959
14005
|
let e = $.current();
|
|
13960
14006
|
return e ? e.getStreamInfo() : Promise.reject();
|
|
13961
14007
|
}
|
|
13962
|
-
async function
|
|
14008
|
+
async function Jl(e) {
|
|
13963
14009
|
let t = $.current();
|
|
13964
14010
|
return t ? t.addMovie(e) : Promise.reject();
|
|
13965
14011
|
}
|
|
13966
|
-
async function
|
|
14012
|
+
async function Yl(e) {
|
|
13967
14013
|
let t = $.current();
|
|
13968
14014
|
return t ? t.updateMovie(e) : Promise.reject();
|
|
13969
14015
|
}
|
|
13970
|
-
async function
|
|
14016
|
+
async function Xl(e) {
|
|
13971
14017
|
let t = $.current();
|
|
13972
14018
|
return t ? t.removeMovie(e) : Promise.reject();
|
|
13973
14019
|
}
|
|
13974
|
-
async function
|
|
14020
|
+
async function Zl(e, t) {
|
|
13975
14021
|
let n = $.current();
|
|
13976
14022
|
if (n) {
|
|
13977
14023
|
let r = [], i = [];
|
|
@@ -13993,46 +14039,46 @@ async function ql(e, t) {
|
|
|
13993
14039
|
});
|
|
13994
14040
|
}
|
|
13995
14041
|
if (i.length) {
|
|
13996
|
-
|
|
14042
|
+
wu(i, "updateRooms", n);
|
|
13997
14043
|
return;
|
|
13998
14044
|
}
|
|
13999
14045
|
return n.updateRooms(r, t);
|
|
14000
14046
|
}
|
|
14001
14047
|
return Promise.reject();
|
|
14002
14048
|
}
|
|
14003
|
-
async function
|
|
14049
|
+
async function Ql(e, t) {
|
|
14004
14050
|
let n = $.current();
|
|
14005
14051
|
return n ? n.activateRooms(e, t) : Promise.reject();
|
|
14006
14052
|
}
|
|
14007
|
-
async function
|
|
14053
|
+
async function $l(e = null, t = null) {
|
|
14008
14054
|
let n = $.current();
|
|
14009
14055
|
if (!n) return Promise.reject();
|
|
14010
14056
|
let r;
|
|
14011
14057
|
if (t && (r = n.getCachedParticipantIdByExternalId(t) ?? void 0, !r)) {
|
|
14012
|
-
|
|
14058
|
+
Cu(t, "switchRoom", n);
|
|
14013
14059
|
return;
|
|
14014
14060
|
}
|
|
14015
14061
|
return n.switchRoom(e, r);
|
|
14016
14062
|
}
|
|
14017
|
-
async function
|
|
14063
|
+
async function eu(e) {
|
|
14018
14064
|
let t = $.current();
|
|
14019
14065
|
return t ? t.removeRooms(e) : Promise.reject();
|
|
14020
14066
|
}
|
|
14021
|
-
function
|
|
14067
|
+
function tu(e) {
|
|
14022
14068
|
N.statisticsInterval = e;
|
|
14023
14069
|
let t = $.current();
|
|
14024
14070
|
if (t) return t.updateStatisticsInterval();
|
|
14025
14071
|
}
|
|
14026
|
-
function
|
|
14072
|
+
function nu(t) {
|
|
14027
14073
|
e.disableLog(!t), z.toggle(t);
|
|
14028
14074
|
}
|
|
14029
|
-
function
|
|
14075
|
+
function ru(e, ...t) {
|
|
14030
14076
|
N.debugLog && ($.debugMessage(e, "[external]", ...t) || z.send(e, "[external]", ...t));
|
|
14031
14077
|
}
|
|
14032
|
-
function
|
|
14078
|
+
function iu(e, t, ...n) {
|
|
14033
14079
|
N.debugLog && ($.debugMessageWithContext(e, t, "[external]", ...n) || z.send(e, "[external]", ...n));
|
|
14034
14080
|
}
|
|
14035
|
-
var
|
|
14081
|
+
var au = {
|
|
14036
14082
|
list: Ne,
|
|
14037
14083
|
get: Pe,
|
|
14038
14084
|
getJson: Fe,
|
|
@@ -14040,7 +14086,7 @@ var tu = {
|
|
|
14040
14086
|
clear: Le,
|
|
14041
14087
|
stats: Re
|
|
14042
14088
|
};
|
|
14043
|
-
function
|
|
14089
|
+
function ou() {
|
|
14044
14090
|
let e = [
|
|
14045
14091
|
[`Calls SDK ${N.sdkVersion}`, N.toJSON()],
|
|
14046
14092
|
["UserAgent:", navigator.userAgent],
|
|
@@ -14058,139 +14104,139 @@ function nu() {
|
|
|
14058
14104
|
d: e
|
|
14059
14105
|
}));
|
|
14060
14106
|
}
|
|
14061
|
-
async function
|
|
14107
|
+
async function su() {
|
|
14062
14108
|
let e = $.id(), t = $.debugSessionId();
|
|
14063
14109
|
if (!t || !e) throw z.error("[uploadDebugLogs]", "No conversation id found"), Error("No conversation id found");
|
|
14064
14110
|
let n = await Pe({ sessionId: t });
|
|
14065
14111
|
if (n.length === 0) throw z.error("[uploadDebugLogs]", "No logs found"), Error("No logs found");
|
|
14066
14112
|
let r = n[0].t, i = n[n.length - 1].t;
|
|
14067
14113
|
try {
|
|
14068
|
-
return
|
|
14114
|
+
return Fc?.uploadDebugLogs(e, r, i, JSON.stringify([...ou(), ...n]));
|
|
14069
14115
|
} catch (e) {
|
|
14070
14116
|
throw z.error("[uploadDebugLogs]", "Error while uploading logs", e), Error("Error while uploading logs", { cause: e });
|
|
14071
14117
|
}
|
|
14072
14118
|
}
|
|
14073
|
-
async function
|
|
14119
|
+
async function cu(e) {
|
|
14074
14120
|
let t = $.current();
|
|
14075
14121
|
if (t) return t.videoEffect(e);
|
|
14076
14122
|
}
|
|
14077
|
-
async function
|
|
14123
|
+
async function lu(e, t) {
|
|
14078
14124
|
let n = $.current();
|
|
14079
14125
|
if (n) return n.audioEffect(e.length > 0 ? e : null, t);
|
|
14080
14126
|
}
|
|
14081
|
-
async function
|
|
14127
|
+
async function uu(e) {
|
|
14082
14128
|
let t = $.current();
|
|
14083
14129
|
t && await t.setAudioStream(e);
|
|
14084
14130
|
}
|
|
14085
|
-
async function
|
|
14131
|
+
async function du(e, t = null, n = null) {
|
|
14086
14132
|
let r = $.current();
|
|
14087
14133
|
if (!r) return;
|
|
14088
14134
|
let i = n ?? t?.id, a = null;
|
|
14089
14135
|
if (t && (a = r.getCachedParticipantIdByExternalId(t), !a)) {
|
|
14090
|
-
|
|
14136
|
+
Cu(t, "setVmojiSvg", r);
|
|
14091
14137
|
return;
|
|
14092
14138
|
}
|
|
14093
14139
|
r.setAnimojiSvg(e, a, i);
|
|
14094
14140
|
}
|
|
14095
|
-
function
|
|
14141
|
+
function fu(e) {
|
|
14096
14142
|
let t = $.current();
|
|
14097
14143
|
t && t.setAnimojiFill(e);
|
|
14098
14144
|
}
|
|
14099
|
-
async function
|
|
14100
|
-
return
|
|
14145
|
+
async function pu(e = null, t, n = !1) {
|
|
14146
|
+
return Tu().getWaitingHall(e, t, n);
|
|
14101
14147
|
}
|
|
14102
|
-
async function
|
|
14103
|
-
return
|
|
14148
|
+
async function mu() {
|
|
14149
|
+
return Tu().getAudienceModeHands();
|
|
14104
14150
|
}
|
|
14105
|
-
async function
|
|
14106
|
-
let n =
|
|
14151
|
+
async function hu(e, t = !1) {
|
|
14152
|
+
let n = Tu(), r;
|
|
14107
14153
|
if (e) {
|
|
14108
14154
|
let t = n.getCachedParticipantIdByExternalId(e);
|
|
14109
14155
|
if (!t) {
|
|
14110
|
-
|
|
14156
|
+
Cu(e, "promoteParticipant", n);
|
|
14111
14157
|
return;
|
|
14112
14158
|
}
|
|
14113
14159
|
r = M.decomposeParticipantId(t).compositeUserId;
|
|
14114
14160
|
}
|
|
14115
14161
|
return n.promoteParticipant(r, t);
|
|
14116
14162
|
}
|
|
14117
|
-
async function
|
|
14118
|
-
return
|
|
14163
|
+
async function gu(e = !1) {
|
|
14164
|
+
return Tu().requestPromotion(e);
|
|
14119
14165
|
}
|
|
14120
|
-
async function
|
|
14121
|
-
return
|
|
14166
|
+
async function _u(e = !1) {
|
|
14167
|
+
return Tu().acceptPromotion(e);
|
|
14122
14168
|
}
|
|
14123
|
-
async function
|
|
14124
|
-
return
|
|
14169
|
+
async function vu(e) {
|
|
14170
|
+
return Tu().getParticipantListChunk(e);
|
|
14125
14171
|
}
|
|
14126
|
-
async function
|
|
14127
|
-
return
|
|
14172
|
+
async function yu(e) {
|
|
14173
|
+
return Tu().getParticipants(e);
|
|
14128
14174
|
}
|
|
14129
|
-
async function
|
|
14130
|
-
return
|
|
14175
|
+
async function bu(e) {
|
|
14176
|
+
return Tu().feedback(e);
|
|
14131
14177
|
}
|
|
14132
|
-
async function
|
|
14133
|
-
return
|
|
14178
|
+
async function xu(e, t, n) {
|
|
14179
|
+
return Tu(n).enableFeatureForRoles(e, t);
|
|
14134
14180
|
}
|
|
14135
|
-
function
|
|
14181
|
+
function Su(e) {
|
|
14136
14182
|
return e ? B.get(e) ?? null : $.current() ?? B.getFirst();
|
|
14137
14183
|
}
|
|
14138
|
-
function
|
|
14184
|
+
function Cu(e, t, n) {
|
|
14139
14185
|
R.onNonFatalError(/* @__PURE__ */ Error(`Participant ID mapping not found for external ID "${e.id}" while handling ${t}`), n.id);
|
|
14140
14186
|
}
|
|
14141
|
-
function
|
|
14187
|
+
function wu(e, t, n) {
|
|
14142
14188
|
let r = Array.from(new Set(e));
|
|
14143
14189
|
R.onNonFatalError(/* @__PURE__ */ Error(`Participant ID mapping not found for external IDs "${r.join("\", \"")}" while handling ${t}`), n.id);
|
|
14144
14190
|
}
|
|
14145
|
-
function
|
|
14146
|
-
let t =
|
|
14191
|
+
function Tu(e) {
|
|
14192
|
+
let t = Su(e);
|
|
14147
14193
|
if (!t) throw Error("Conversation not found");
|
|
14148
14194
|
return t;
|
|
14149
14195
|
}
|
|
14150
|
-
function
|
|
14196
|
+
function Eu(e, t) {
|
|
14151
14197
|
let n = $.current();
|
|
14152
14198
|
if (!n) return null;
|
|
14153
14199
|
let r = n.getCachedParticipantIdByExternalId(e);
|
|
14154
14200
|
return r ? {
|
|
14155
14201
|
conversation: n,
|
|
14156
14202
|
participantId: r
|
|
14157
|
-
} : (
|
|
14203
|
+
} : (Cu(e, t, n), null);
|
|
14158
14204
|
}
|
|
14159
|
-
async function
|
|
14160
|
-
await
|
|
14205
|
+
async function Du(e) {
|
|
14206
|
+
await Fc.removeHistoryRecords(e);
|
|
14161
14207
|
}
|
|
14162
|
-
async function
|
|
14208
|
+
async function Ou(e) {
|
|
14163
14209
|
let t = $.current() ?? B.getFirst();
|
|
14164
14210
|
t && await t.startAsr(e);
|
|
14165
14211
|
}
|
|
14166
|
-
async function
|
|
14212
|
+
async function ku(e) {
|
|
14167
14213
|
let t = $.current() ?? B.getFirst();
|
|
14168
14214
|
t && await t.stopAsr(e);
|
|
14169
14215
|
}
|
|
14170
|
-
async function
|
|
14216
|
+
async function Au(e) {
|
|
14171
14217
|
let t = $.current() ?? B.getFirst();
|
|
14172
14218
|
t && await t.requestAsr(e);
|
|
14173
14219
|
}
|
|
14174
|
-
async function
|
|
14220
|
+
async function ju(e) {
|
|
14175
14221
|
let t = $.current();
|
|
14176
14222
|
return t ? t.startUrlSharing(e) : Promise.reject();
|
|
14177
14223
|
}
|
|
14178
|
-
async function
|
|
14224
|
+
async function Mu() {
|
|
14179
14225
|
let e = $.current();
|
|
14180
14226
|
return e ? e.stopUrlSharing() : Promise.reject();
|
|
14181
14227
|
}
|
|
14182
|
-
async function
|
|
14228
|
+
async function Nu(e) {
|
|
14183
14229
|
await B.switchCall(e);
|
|
14184
14230
|
}
|
|
14185
|
-
function
|
|
14231
|
+
function Pu() {
|
|
14186
14232
|
return B.getActiveId();
|
|
14187
14233
|
}
|
|
14188
|
-
function
|
|
14234
|
+
function Fu() {
|
|
14189
14235
|
return $.getSyncedTime();
|
|
14190
14236
|
}
|
|
14191
|
-
function
|
|
14237
|
+
function Iu() {
|
|
14192
14238
|
return N.sdkVersion;
|
|
14193
14239
|
}
|
|
14194
14240
|
typeof window < "u" && (window.__CALLS_SDK = xn);
|
|
14195
14241
|
//#endregion
|
|
14196
|
-
export {
|
|
14242
|
+
export { Oc as Api, Pc as ApiExternal, Nc as ArrayDequeue, y as AuthData, f as BaseLogger, to as CallDirection, no as CallType, ro as ChatRoomEventType, io as ConversationFeature, ao as ConversationOption, wn as DebugMessageType, _o as ExternalIdType, jt as FacingMode, x as FatalError, k as HangupReason, O as HangupType, S as MediaOption, A as MediaTrackKind, H as MediaType, co as MuteState, X as ParticipantState, Mc as ParticipantStateDataValue, P as ParticipantStatus, jc as RecordRole, lo as RoomsEventType, eo as Signaling, V as SignalingCommandType, br as SignalingConnectionType, K as SignalingNotification, U as Stat, J as TransportTopology, po as UserRole, j as UserType, Bo as VolumeDetector, el as acceptCall, _u as acceptPromotion, Ql as activateRooms, Jl as addMovie, ol as addParticipant, sl as addParticipantInternal, $c as authorize, Rc as browser, Jc as callInternal, Kc as callTo, dl as captureScreen, fl as captureVmoji, lu as changeAudioEffect, jl as changeConversationOptions, ul as changeDevice, vl as changeParticipantState, _l as changePriorities, cu as changeVideoEffect, Pl as chatHistory, Ml as chatMessage, Nl as chatMessageInternal, zl as createJoinLink, Fl as customData, Il as customDataInternal, nu as debug, au as debugLogs, ru as debugMessage, iu as debugMessageWithContext, tl as declineCall, xu as enableFeatureForRoles, kl as enableVideoSuspend, Al as enableVideoSuspendSuggest, bu as feedback, Ul as forceRelayPolicy, Pu as getActiveCallId, Vl as getAnonymTokenByLink, mu as getAudienceModeHands, Zc as getInbounds, vu as getParticipantListChunk, yu as getParticipants, ql as getStreamInfo, Fu as getSyncedTime, pu as getWaitingHall, Sl as grantRoles, Cl as grantRolesInternal, al as hangup, Gc as init, nl as joinCall, il as joinCallByLink, rl as joinCallInternal, wl as muteParticipant, Tl as muteParticipantInternal, El as pinParticipant, Dl as pinParticipantInternal, Yc as processPush, Xc as processPushInternal, hu as promoteParticipant, Kl as publishStream, yl as putHandsDown, Du as removeHistoryRecords, Bl as removeJoinLink, Xl as removeMovie, cl as removeParticipant, ll as removeParticipantInternal, eu as removeRooms, Au as requestAsr, xl as requestDisplayLayout, gu as requestPromotion, Hc as setAudioEffects, uu as setAudioStream, gl as setLocalResolution, Bc as setLogger, Ol as setMediaModifiers, tu as setStatisticsInterval, Uc as setVad, Vc as setVideoEffects, pl as setVideoStream, Wc as setVmoji, fu as setVmojiFill, du as setVmojiSvg, Hl as setVolume, Ou as startAsr, Rl as startAudienceConversation, Ll as startConversation, Qc as startStats, Wl as startStream, ju as startUrlSharing, ku as stopAsr, Gl as stopStream, Mu as stopUrlSharing, Nu as switchCall, $l as switchRoom, hl as toggleLocalAudio, ml as toggleLocalVideo, bl as updateDisplayLayout, Yl as updateMovie, Zl as updateRooms, su as uploadDebugLogs, zc as utils, Iu as version };
|