@vkontakte/calls-sdk 2.8.13-beta.5 → 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 +295 -247
- 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/types/Params.d.ts +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;
|
|
@@ -2248,6 +2256,8 @@ var xn = bn.getInstance(), N = class e {
|
|
|
2248
2256
|
case "CALLS_BENDER": return "https://api-bender.calls-test.oneme.ru/api";
|
|
2249
2257
|
case "CALLS_MAMES": return "https://calls-mames.okcdn.ru/api";
|
|
2250
2258
|
case "CALLS_MARS": return "https://api-mars.calls-test.oneme.ru/api";
|
|
2259
|
+
case "CALLS_CHELSEA": return "https://api-chelsea.calls-test.oneme.ru/api";
|
|
2260
|
+
case "CALLS_KERZH": return "https://api-kerzh.calls-test.oneme.ru/api";
|
|
2251
2261
|
default: return e._params.apiEnv;
|
|
2252
2262
|
}
|
|
2253
2263
|
}
|
|
@@ -3632,7 +3642,7 @@ var Bn = 0, Vn = 1, Hn = 2, Un = 3, Wn = 4, Gn = 5, Kn = 6, qn = 7, Jn = 0, Yn =
|
|
|
3632
3642
|
};
|
|
3633
3643
|
}
|
|
3634
3644
|
}, U = /* @__PURE__ */ function(e) {
|
|
3635
|
-
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;
|
|
3636
3646
|
}(U || {}), nr = 1e3;
|
|
3637
3647
|
function W(e, t, n = 0) {
|
|
3638
3648
|
return t in e && e[t] ? e[t] : n;
|
|
@@ -8283,8 +8293,8 @@ var Ao = class {
|
|
|
8283
8293
|
}));
|
|
8284
8294
|
}
|
|
8285
8295
|
}, jo = class {
|
|
8286
|
-
constructor(e, t = !1, n = z, r = null) {
|
|
8287
|
-
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();
|
|
8288
8298
|
}
|
|
8289
8299
|
add(e, t) {
|
|
8290
8300
|
this._allowMultipleTracks || this._clearTracks();
|
|
@@ -8323,7 +8333,7 @@ var Ao = class {
|
|
|
8323
8333
|
let e = E.getSavedOutput();
|
|
8324
8334
|
e && (await this._audioElement.setSinkId?.(e.deviceId), this._debug.debug("[audio] Output device changed", e));
|
|
8325
8335
|
} catch (e) {
|
|
8326
|
-
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;
|
|
8327
8337
|
}
|
|
8328
8338
|
}
|
|
8329
8339
|
_getTracks() {
|
|
@@ -8353,7 +8363,7 @@ var Ao = class {
|
|
|
8353
8363
|
a ? t.setSinkId?.(a.deviceId).then(() => {
|
|
8354
8364
|
this._debug.debug("[audio] Output device", a);
|
|
8355
8365
|
}).catch((e) => {
|
|
8356
|
-
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);
|
|
8357
8367
|
}) : this._debug.debug("[audio] Output device: system default");
|
|
8358
8368
|
}
|
|
8359
8369
|
_stopAudioElement() {
|
|
@@ -10007,6 +10017,44 @@ var $s = class {
|
|
|
10007
10017
|
}), this._codecUsages.clear();
|
|
10008
10018
|
}
|
|
10009
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 {
|
|
10010
10058
|
constructor(e) {
|
|
10011
10059
|
h(this, "_logger", void 0), h(this, "_eventualLogs", /* @__PURE__ */ new Set()), h(this, "_lastCallStatContext", null), this._logger = e;
|
|
10012
10060
|
}
|
|
@@ -10049,7 +10097,7 @@ var $s = class {
|
|
|
10049
10097
|
for (let [t, r] of Object.entries(e)) r !== void 0 && (r === null ? delete n[t] : n[t] = r);
|
|
10050
10098
|
this._logger.logClientStats(n, { occurredAt: t });
|
|
10051
10099
|
}
|
|
10052
|
-
},
|
|
10100
|
+
}, oc = class {
|
|
10053
10101
|
constructor(e) {
|
|
10054
10102
|
if (h(this, "q", void 0), h(this, "inits", []), h(this, "n", [
|
|
10055
10103
|
1,
|
|
@@ -10108,7 +10156,7 @@ var $s = class {
|
|
|
10108
10156
|
5
|
|
10109
10157
|
];
|
|
10110
10158
|
}
|
|
10111
|
-
},
|
|
10159
|
+
}, sc = class {
|
|
10112
10160
|
constructor() {
|
|
10113
10161
|
h(this, "n", 0), h(this, "mean", 0);
|
|
10114
10162
|
}
|
|
@@ -10120,9 +10168,9 @@ var $s = class {
|
|
|
10120
10168
|
get avg() {
|
|
10121
10169
|
return this.n ? this.mean : NaN;
|
|
10122
10170
|
}
|
|
10123
|
-
},
|
|
10171
|
+
}, cc = class {
|
|
10124
10172
|
constructor() {
|
|
10125
|
-
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));
|
|
10126
10174
|
}
|
|
10127
10175
|
add(e) {
|
|
10128
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++;
|
|
@@ -10140,11 +10188,11 @@ var $s = class {
|
|
|
10140
10188
|
get hasData() {
|
|
10141
10189
|
return this.count > 0;
|
|
10142
10190
|
}
|
|
10143
|
-
},
|
|
10191
|
+
}, lc = class {
|
|
10144
10192
|
constructor(e) {
|
|
10145
10193
|
h(this, "_logger", void 0), h(this, "trackerByTransport", {
|
|
10146
|
-
ws: new
|
|
10147
|
-
wt: new
|
|
10194
|
+
ws: new cc(),
|
|
10195
|
+
wt: new cc()
|
|
10148
10196
|
}), h(this, "lastSeen", {}), this._logger = e;
|
|
10149
10197
|
}
|
|
10150
10198
|
mark(e) {
|
|
@@ -10173,17 +10221,17 @@ var $s = class {
|
|
|
10173
10221
|
}
|
|
10174
10222
|
destroy() {
|
|
10175
10223
|
this.trackerByTransport = {
|
|
10176
|
-
ws: new
|
|
10177
|
-
wt: new
|
|
10224
|
+
ws: new cc(),
|
|
10225
|
+
wt: new cc()
|
|
10178
10226
|
}, this.lastSeen = {};
|
|
10179
10227
|
}
|
|
10180
|
-
},
|
|
10228
|
+
}, uc = class {
|
|
10181
10229
|
constructor(e) {
|
|
10182
10230
|
h(this, "_logger", void 0), h(this, "trackerByCommand", /* @__PURE__ */ new Map()), this._logger = e;
|
|
10183
10231
|
}
|
|
10184
10232
|
mark(e, t, n) {
|
|
10185
10233
|
let r = `${e}|${n}`, i;
|
|
10186
|
-
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);
|
|
10187
10235
|
}
|
|
10188
10236
|
logMetrics() {
|
|
10189
10237
|
for (let [e, t] of this.trackerByCommand.entries()) {
|
|
@@ -10205,9 +10253,9 @@ var $s = class {
|
|
|
10205
10253
|
destroy() {
|
|
10206
10254
|
this.trackerByCommand.clear();
|
|
10207
10255
|
}
|
|
10208
|
-
},
|
|
10256
|
+
}, dc = class {
|
|
10209
10257
|
constructor(e, t, n, r) {
|
|
10210
|
-
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);
|
|
10211
10259
|
}
|
|
10212
10260
|
prepareForUnload() {
|
|
10213
10261
|
N.statQueueEnabled && (this._unloading = !0, this.logger.enterUnloadMode(), this.pings.logMetrics(), this.signalingCommands.logMetrics());
|
|
@@ -10224,7 +10272,7 @@ var $s = class {
|
|
|
10224
10272
|
destroy() {
|
|
10225
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();
|
|
10226
10274
|
}
|
|
10227
|
-
},
|
|
10275
|
+
}, fc = class {
|
|
10228
10276
|
constructor(e) {
|
|
10229
10277
|
h(this, "_statAggregator", void 0), h(this, "_isCallMarked", !1), h(this, "_isFinished", !1), h(this, "_callType", null), this._statAggregator = e;
|
|
10230
10278
|
}
|
|
@@ -10249,8 +10297,8 @@ var $s = class {
|
|
|
10249
10297
|
call_type: this._callType
|
|
10250
10298
|
}));
|
|
10251
10299
|
}
|
|
10252
|
-
},
|
|
10253
|
-
function
|
|
10300
|
+
}, pc = 1e3, mc = 1e4;
|
|
10301
|
+
function hc(e, t, n, r) {
|
|
10254
10302
|
return new k(e, {
|
|
10255
10303
|
callError: {
|
|
10256
10304
|
scope: "external",
|
|
@@ -10261,7 +10309,7 @@ function dc(e, t, n, r) {
|
|
|
10261
10309
|
message: r
|
|
10262
10310
|
});
|
|
10263
10311
|
}
|
|
10264
|
-
var
|
|
10312
|
+
var gc = 15, $ = class e extends b {
|
|
10265
10313
|
constructor(e, t) {
|
|
10266
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) => {
|
|
10267
10315
|
if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "video_1" : "video_0"), this._mediaSource.toggleVideo(e);
|
|
@@ -10277,7 +10325,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10277
10325
|
captureAudio: !1
|
|
10278
10326
|
});
|
|
10279
10327
|
}
|
|
10280
|
-
}, 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({
|
|
10281
10329
|
api: this._api,
|
|
10282
10330
|
debug: this._debug,
|
|
10283
10331
|
getParticipants: () => this._participants,
|
|
@@ -10288,13 +10336,13 @@ var fc = 15, $ = class e extends b {
|
|
|
10288
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();
|
|
10289
10337
|
}, this._onRestore = () => {
|
|
10290
10338
|
this._stats.restoreAfterUnload();
|
|
10291
|
-
}, 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));
|
|
10292
10340
|
}
|
|
10293
10341
|
static current() {
|
|
10294
10342
|
return B.getActive() ?? (N.hold ? null : B.getFirst());
|
|
10295
10343
|
}
|
|
10296
10344
|
static hangupAfterInit(e) {
|
|
10297
|
-
let t =
|
|
10345
|
+
let t = _c;
|
|
10298
10346
|
if (t) {
|
|
10299
10347
|
if (typeof e == "function" && (t._onFastHangup = e), t._delayedHangup === !1 && !t._conversation) {
|
|
10300
10348
|
t._delayedHangup = !0, t._abortController?.abort(new k(O.CANCELED));
|
|
@@ -10367,7 +10415,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10367
10415
|
this._stats.lifecycle.markInitializationStarted({
|
|
10368
10416
|
source: "outgoing",
|
|
10369
10417
|
conversationId: u
|
|
10370
|
-
}), 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);
|
|
10371
10419
|
try {
|
|
10372
10420
|
this._mediaSource = this._createMediaSource(), await this._mediaSource.request(n);
|
|
10373
10421
|
let l = this._mediaSource.mediaSettings;
|
|
@@ -10399,18 +10447,18 @@ var fc = 15, $ = class e extends b {
|
|
|
10399
10447
|
let e = B.get(this._conversation.id);
|
|
10400
10448
|
e && e !== this && e._close(new k(O.HUNGUP, { remote: !0 }));
|
|
10401
10449
|
}
|
|
10402
|
-
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(() => {
|
|
10403
10451
|
this._calleeUnavailableTimer = null, this._close(new k(O.CALLEE_UNAVAILABLE), { signalingReason: O.CANCELED });
|
|
10404
10452
|
}, f)), this._conversation;
|
|
10405
10453
|
} catch (e) {
|
|
10406
|
-
throw
|
|
10454
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, { errorText: "Unable to start conversation" }), e;
|
|
10407
10455
|
}
|
|
10408
10456
|
}
|
|
10409
10457
|
async onJoin(e) {
|
|
10410
10458
|
this._stats.lifecycle.markInitializationStarted({
|
|
10411
10459
|
source: e.anonymous ? "anonym_join" : "join",
|
|
10412
10460
|
conversationId: e.conversationId
|
|
10413
|
-
}),
|
|
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);
|
|
10414
10462
|
try {
|
|
10415
10463
|
let t = !!e.observedIds?.length;
|
|
10416
10464
|
if (t && N.videoTracksCount > 0) throw this._debug.error("Observer mode: please set videoTracksCount=0"), new k(O.UNSUPPORTED, { callError: {
|
|
@@ -10427,9 +10475,9 @@ var fc = 15, $ = class e extends b {
|
|
|
10427
10475
|
code: "conversation",
|
|
10428
10476
|
description: "not-initialized-after-join"
|
|
10429
10477
|
} });
|
|
10430
|
-
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);
|
|
10431
10479
|
} catch (e) {
|
|
10432
|
-
throw
|
|
10480
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, { errorText: "Unable to join conversation" }), e;
|
|
10433
10481
|
}
|
|
10434
10482
|
}
|
|
10435
10483
|
async _onJoinPart2(e, t = !0, n = !1) {
|
|
@@ -10444,7 +10492,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10444
10492
|
if (this._delayedHangup) throw new k(O.CANCELED);
|
|
10445
10493
|
this._processConnectionSharedMovieInfo(e), this._processConversationUrlSharingInfo(e), this._processConnectionAsrInfo(e);
|
|
10446
10494
|
let r = this._extractExternalRoomsData(e.rooms?.rooms, e.rooms?.roomId);
|
|
10447
|
-
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);
|
|
10448
10496
|
let i = this._extractLocalParticipantFromConnection(e);
|
|
10449
10497
|
if (i) {
|
|
10450
10498
|
let e = M.mapParticipantState(i);
|
|
@@ -10452,7 +10500,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10452
10500
|
}
|
|
10453
10501
|
return t && this._openTransport(Object.values(this._participants), !1), this._conversation;
|
|
10454
10502
|
} catch (e) {
|
|
10455
|
-
throw
|
|
10503
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, { errorText: "Unable to join conversation" }), e;
|
|
10456
10504
|
}
|
|
10457
10505
|
}
|
|
10458
10506
|
_extractExternalRooms(e) {
|
|
@@ -10472,7 +10520,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10472
10520
|
B.reserve(e), this._reservedId = e, a && this._api.setUserId(a), this._stats.lifecycle.markInitializationStarted({
|
|
10473
10521
|
source: "incoming",
|
|
10474
10522
|
conversationId: e
|
|
10475
|
-
}), 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);
|
|
10476
10524
|
try {
|
|
10477
10525
|
let a = await this._prepareConversation(e, t, n, r, i);
|
|
10478
10526
|
if (this._mediaSource = this._createMediaSource(), !this._conversation) throw new k(O.UNKNOWN_ERROR, { callError: {
|
|
@@ -10481,9 +10529,9 @@ var fc = 15, $ = class e extends b {
|
|
|
10481
10529
|
description: "incoming-not-initialized"
|
|
10482
10530
|
} });
|
|
10483
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);
|
|
10484
|
-
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);
|
|
10485
10533
|
} catch (e) {
|
|
10486
|
-
throw
|
|
10534
|
+
throw _c = null, this._cleanupRegistry(), this._close(e, {
|
|
10487
10535
|
errorText: "Unable to handle inbound call push",
|
|
10488
10536
|
signalingReason: e instanceof k && e.hangup === O.BUSY ? O.BUSY : void 0
|
|
10489
10537
|
}), e;
|
|
@@ -10770,10 +10818,10 @@ var fc = 15, $ = class e extends b {
|
|
|
10770
10818
|
isVideo: f,
|
|
10771
10819
|
joiningAllowed: a,
|
|
10772
10820
|
requireAuthToJoin: o
|
|
10773
|
-
}, this._abortController?.signal), !e) throw
|
|
10821
|
+
}, this._abortController?.signal), !e) throw hc(O.FAST_START_ERROR, "invalid-response", "fast-start-response-empty");
|
|
10774
10822
|
if (!e.internalCallerParams) {
|
|
10775
10823
|
let t = e.rejectedParticipants[0]?.status;
|
|
10776
|
-
throw
|
|
10824
|
+
throw hc(O.FAST_START_ERROR, t ? "fast-start" : "invalid-response", t ?? "fast-start-internal-caller-params-empty", JSON.stringify(e));
|
|
10777
10825
|
}
|
|
10778
10826
|
} catch (e) {
|
|
10779
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) });
|
|
@@ -10795,7 +10843,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10795
10843
|
token: new URL(t.endpoint).searchParams.get("token") ?? ""
|
|
10796
10844
|
}, this._debug.debug("FastStart", p), m = "fastStart";
|
|
10797
10845
|
} catch {
|
|
10798
|
-
throw
|
|
10846
|
+
throw hc(O.FAST_START_ERROR, "invalid-response", "fast-start-internal-caller-params-invalid");
|
|
10799
10847
|
}
|
|
10800
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";
|
|
10801
10849
|
Mo(p, m), this._setConversationParams(p), this._stats.lifecycle.bindConversationId(p.id);
|
|
@@ -10823,9 +10871,9 @@ var fc = 15, $ = class e extends b {
|
|
|
10823
10871
|
joinLink: i,
|
|
10824
10872
|
isVideo: c,
|
|
10825
10873
|
internalParams: this._buildInternalParams()
|
|
10826
|
-
}, this._abortController?.signal), !e) throw
|
|
10827
|
-
if (!e.internalCallerParams) throw
|
|
10828
|
-
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));
|
|
10829
10877
|
} catch (e) {
|
|
10830
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) });
|
|
10831
10879
|
}
|
|
@@ -10843,7 +10891,7 @@ var fc = 15, $ = class e extends b {
|
|
|
10843
10891
|
token: new URL(t.endpoint).searchParams.get("token") ?? ""
|
|
10844
10892
|
}, this._debug.debug("FastJoin", l), u = "fastJoin";
|
|
10845
10893
|
} catch (e) {
|
|
10846
|
-
throw e instanceof k ? e :
|
|
10894
|
+
throw e instanceof k ? e : hc(O.FAST_JOIN_ERROR, "invalid-response", "fast-join-internal-caller-params-invalid");
|
|
10847
10895
|
}
|
|
10848
10896
|
} else if (t) l = await this._api.joinConversation(t, c, r), u = "joinConversation";
|
|
10849
10897
|
else if (i) l = await this._api.joinConversationByLink(i, c, a, o), u = "joinConversationByLink";
|
|
@@ -11025,7 +11073,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11025
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 ?? []);
|
|
11026
11074
|
}
|
|
11027
11075
|
_createMediaSource() {
|
|
11028
|
-
let e = new Yt(this._debug, this._stats.logger);
|
|
11076
|
+
let e = new Yt(this._debug, this._stats.logger, this._stats.media);
|
|
11029
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;
|
|
11030
11078
|
}
|
|
11031
11079
|
async _connectSignaling(e, t) {
|
|
@@ -11334,7 +11382,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11334
11382
|
_onRemoveParticipant(e) {
|
|
11335
11383
|
this._debug.debug(`Remove participant [${e}]`);
|
|
11336
11384
|
let t = [], n = this._participants;
|
|
11337
|
-
for (let r = 0; r <=
|
|
11385
|
+
for (let r = 0; r <= gc; r++) {
|
|
11338
11386
|
let i = n[M.compose(e, r)];
|
|
11339
11387
|
i && t.push(i);
|
|
11340
11388
|
}
|
|
@@ -11557,7 +11605,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11557
11605
|
});
|
|
11558
11606
|
}
|
|
11559
11607
|
}
|
|
11560
|
-
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);
|
|
11561
11609
|
}
|
|
11562
11610
|
async _cleanupCooldownQueue() {
|
|
11563
11611
|
let e = {}, t = this._cooldownTimestampByStreamDescription.entries();
|
|
@@ -11565,7 +11613,7 @@ var fc = 15, $ = class e extends b {
|
|
|
11565
11613
|
let n = t.next();
|
|
11566
11614
|
if (n.done) break;
|
|
11567
11615
|
let r = n.value;
|
|
11568
|
-
if (r[1] +
|
|
11616
|
+
if (r[1] + mc > Date.now()) break;
|
|
11569
11617
|
let i = r[0];
|
|
11570
11618
|
await this._stopStreaming(i), e[i] = { stopStream: !0 };
|
|
11571
11619
|
} while (!0);
|
|
@@ -13069,7 +13117,7 @@ var fc = 15, $ = class e extends b {
|
|
|
13069
13117
|
this._warnParticipantNotInConversation(e.participantId);
|
|
13070
13118
|
return;
|
|
13071
13119
|
}
|
|
13072
|
-
if (t.isOnHold = e.hold, this._specListener?.onParticipantHoldChanged(), this._transport?.setRemoteHold(e.hold), e.hold) this._setParticipantsStatus([t], P.ONHOLD), this._audioOutput.destroy();
|
|
13120
|
+
if (t.isOnHold = e.hold, this._specListener?.onParticipantHoldChanged(), this._transport?.setRemoteHold(e.hold), e.hold) this._setParticipantsStatus([t], P.ONHOLD), this._transport?.getTopology() === J.DIRECT && this._audioOutput.destroy();
|
|
13073
13121
|
else {
|
|
13074
13122
|
let e = this._transport?.getTopology() === J.DIRECT ? P.CONNECTING : P.CONNECTED;
|
|
13075
13123
|
this._setParticipantsStatus([t], e);
|
|
@@ -13097,11 +13145,11 @@ var fc = 15, $ = class e extends b {
|
|
|
13097
13145
|
_getParticipant(e) {
|
|
13098
13146
|
return this._participants[e];
|
|
13099
13147
|
}
|
|
13100
|
-
},
|
|
13148
|
+
}, _c = null, vc = class e extends Error {
|
|
13101
13149
|
constructor(t, n) {
|
|
13102
13150
|
super(t), h(this, "participantErrors", void 0), Object.setPrototypeOf(this, e.prototype), this.participantErrors = n;
|
|
13103
13151
|
}
|
|
13104
|
-
},
|
|
13152
|
+
}, yc = class {
|
|
13105
13153
|
constructor() {
|
|
13106
13154
|
h(this, "_abortSignal", void 0), h(this, "_apiCallStats", null);
|
|
13107
13155
|
}
|
|
@@ -13146,7 +13194,7 @@ var fc = 15, $ = class e extends b {
|
|
|
13146
13194
|
async getInbounds() {
|
|
13147
13195
|
return [];
|
|
13148
13196
|
}
|
|
13149
|
-
},
|
|
13197
|
+
}, bc = class e {
|
|
13150
13198
|
constructor() {
|
|
13151
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());
|
|
13152
13200
|
}
|
|
@@ -13181,27 +13229,27 @@ var fc = 15, $ = class e extends b {
|
|
|
13181
13229
|
clear() {
|
|
13182
13230
|
this._participantIdToExternalId.clear(), this._externalIdToParticipantId.clear(), this._decorativeIdToInitialId.clear(), this._initialIdToDecorativeId.clear();
|
|
13183
13231
|
}
|
|
13184
|
-
},
|
|
13185
|
-
function
|
|
13232
|
+
}, xc = "anonymLogin:", Sc = 700, Cc = 3e3;
|
|
13233
|
+
function wc(e) {
|
|
13186
13234
|
let t = e.error_code;
|
|
13187
13235
|
switch (t) {
|
|
13188
|
-
case 2: return
|
|
13189
|
-
case 4: return e.error_msg.includes("participants.limit.exceeded") ?
|
|
13190
|
-
case 300: return
|
|
13191
|
-
case 1101: return
|
|
13192
|
-
case 1102: return
|
|
13193
|
-
case 1103: return
|
|
13194
|
-
case 1104: return
|
|
13195
|
-
case 1106: return
|
|
13196
|
-
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");
|
|
13197
13245
|
case 1114: {
|
|
13198
13246
|
let n = e.custom_error?.vchat_detailed_api_error?.code, r = n?.startsWith("obsolete_client");
|
|
13199
|
-
return
|
|
13247
|
+
return Tc(r ? O.OBSOLETE_CLIENT : O.VCHAT_DETAILED_ERROR, t, n ?? "detailed-error", r ? n : void 0);
|
|
13200
13248
|
}
|
|
13201
|
-
default: return
|
|
13249
|
+
default: return Tc(x.API, t, "api-error");
|
|
13202
13250
|
}
|
|
13203
13251
|
}
|
|
13204
|
-
function
|
|
13252
|
+
function Tc(e, t, n, r) {
|
|
13205
13253
|
return {
|
|
13206
13254
|
type: e,
|
|
13207
13255
|
callError: {
|
|
@@ -13213,10 +13261,10 @@ function xc(e, t, n, r) {
|
|
|
13213
13261
|
message: r
|
|
13214
13262
|
};
|
|
13215
13263
|
}
|
|
13216
|
-
function
|
|
13264
|
+
function Ec(e) {
|
|
13217
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);
|
|
13218
13266
|
}
|
|
13219
|
-
function
|
|
13267
|
+
function Dc(e, t) {
|
|
13220
13268
|
return {
|
|
13221
13269
|
type: O.EXTERNAL_API_ERROR,
|
|
13222
13270
|
callError: {
|
|
@@ -13227,9 +13275,9 @@ function Cc(e, t) {
|
|
|
13227
13275
|
}
|
|
13228
13276
|
};
|
|
13229
13277
|
}
|
|
13230
|
-
var
|
|
13278
|
+
var Oc = class extends yc {
|
|
13231
13279
|
constructor(...e) {
|
|
13232
|
-
super(...e), h(this, "_uuid", void 0), h(this, "_idCache", new
|
|
13280
|
+
super(...e), h(this, "_uuid", void 0), h(this, "_idCache", new bc());
|
|
13233
13281
|
}
|
|
13234
13282
|
async _callUnsafe(e, t = {}, n = !1) {
|
|
13235
13283
|
let r = async (i) => {
|
|
@@ -13238,10 +13286,10 @@ var wc = class extends hc {
|
|
|
13238
13286
|
let r = await hs(e, t, n);
|
|
13239
13287
|
return this._apiCallStats?.log(e, performance.now() - a), r;
|
|
13240
13288
|
} catch (t) {
|
|
13241
|
-
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")) {
|
|
13242
13290
|
i++;
|
|
13243
13291
|
let n = t && (typeof t == "object" || typeof t == "function") ? Object.getOwnPropertyNames(t).map((e) => `${e}: ${JSON.stringify(t[e])}`) : [String(t)];
|
|
13244
|
-
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);
|
|
13245
13293
|
}
|
|
13246
13294
|
throw z.warn(e, "error", t), t;
|
|
13247
13295
|
}
|
|
@@ -13258,8 +13306,8 @@ var wc = class extends hc {
|
|
|
13258
13306
|
message: i?.error_msg,
|
|
13259
13307
|
code: i?.error_code
|
|
13260
13308
|
};
|
|
13261
|
-
if (i.custom_error && (a.custom_error = i.custom_error),
|
|
13262
|
-
let e =
|
|
13309
|
+
if (i.custom_error && (a.custom_error = i.custom_error), kc(i)) {
|
|
13310
|
+
let e = wc(i);
|
|
13263
13311
|
throw a.callError = e.callError, a.message = e.message ?? a.message, new k(e.type, a);
|
|
13264
13312
|
}
|
|
13265
13313
|
throw new k(x.API, a);
|
|
@@ -13311,17 +13359,17 @@ var wc = class extends hc {
|
|
|
13311
13359
|
return e && (t.session_data.auth_token = e, t.session_data.version = 3), this._callUnsafe("auth.anonymLogin", t, !0);
|
|
13312
13360
|
}
|
|
13313
13361
|
_getAnonymLoginCacheKey() {
|
|
13314
|
-
return N.authToken ? `${
|
|
13362
|
+
return N.authToken ? `${xc}${N.authToken}` : null;
|
|
13315
13363
|
}
|
|
13316
13364
|
_getCachedAnonymLogin() {
|
|
13317
13365
|
let e = this._getAnonymLoginCacheKey();
|
|
13318
13366
|
if (!e) return null;
|
|
13319
13367
|
let t = w.get(e);
|
|
13320
|
-
return
|
|
13368
|
+
return Ac(t) ? t : (t && w.remove(e), null);
|
|
13321
13369
|
}
|
|
13322
13370
|
_setCachedAnonymLogin(e) {
|
|
13323
13371
|
let t = this._getAnonymLoginCacheKey();
|
|
13324
|
-
!t || !
|
|
13372
|
+
!t || !Ac(e) || w.set(t, {
|
|
13325
13373
|
session_key: e.session_key,
|
|
13326
13374
|
session_secret_key: e.session_secret_key,
|
|
13327
13375
|
uid: e.uid
|
|
@@ -13535,19 +13583,19 @@ var wc = class extends hc {
|
|
|
13535
13583
|
return Array.isArray(e?.inbounds) ? e.inbounds : [];
|
|
13536
13584
|
}
|
|
13537
13585
|
};
|
|
13538
|
-
function
|
|
13586
|
+
function kc(e) {
|
|
13539
13587
|
return typeof e == "object" && !!e && "error_code" in e && "error_msg" in e;
|
|
13540
13588
|
}
|
|
13541
|
-
function
|
|
13589
|
+
function Ac(e) {
|
|
13542
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;
|
|
13543
13591
|
}
|
|
13544
13592
|
//#endregion
|
|
13545
13593
|
//#region src/enums/RecordRole.ts
|
|
13546
|
-
var
|
|
13594
|
+
var jc = /* @__PURE__ */ function(e) {
|
|
13547
13595
|
return e.KING = "KING", e.PAWN = "PAWN", e;
|
|
13548
|
-
}(
|
|
13596
|
+
}(jc || {}), Mc = /* @__PURE__ */ function(e) {
|
|
13549
13597
|
return e.OFF = "0", e.ON = "1", e;
|
|
13550
|
-
}({}),
|
|
13598
|
+
}({}), Nc = class {
|
|
13551
13599
|
constructor(e) {
|
|
13552
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;
|
|
13553
13601
|
}
|
|
@@ -13570,7 +13618,7 @@ var Dc = /* @__PURE__ */ function(e) {
|
|
|
13570
13618
|
let e = this._queue[this._readCursor];
|
|
13571
13619
|
return e && (this._moveReadCursor = !1, this._queue[this._readCursor] = null, this._readCursor = this.nextCursor(this._readCursor), --this._left), e;
|
|
13572
13620
|
}
|
|
13573
|
-
},
|
|
13621
|
+
}, Pc = class {
|
|
13574
13622
|
constructor(e, t, n, r = null) {
|
|
13575
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;
|
|
13576
13624
|
}
|
|
@@ -13596,7 +13644,7 @@ var Dc = /* @__PURE__ */ function(e) {
|
|
|
13596
13644
|
};
|
|
13597
13645
|
t?.peerId && (n.peerId = t.peerId), await hs("vchat.hangupConversation", n, !0, await fs(this._baseApiUrl, this._apiEnv));
|
|
13598
13646
|
}
|
|
13599
|
-
},
|
|
13647
|
+
}, Fc, Ic = null, Lc = !1, Rc = {
|
|
13600
13648
|
getCameras: E.getCameras,
|
|
13601
13649
|
getMicrophones: E.getMicrophones,
|
|
13602
13650
|
getOutput: E.getOutput,
|
|
@@ -13622,27 +13670,27 @@ var Dc = /* @__PURE__ */ function(e) {
|
|
|
13622
13670
|
baseChromeVersion: E.baseChromeVersion,
|
|
13623
13671
|
getAudioContext: E.getAudioContext,
|
|
13624
13672
|
isAudioShareSupported: E.isAudioShareSupported
|
|
13625
|
-
},
|
|
13626
|
-
function
|
|
13627
|
-
|
|
13673
|
+
}, zc = { participantMarkerCompare: M.participantMarkerCompare };
|
|
13674
|
+
function Bc(e) {
|
|
13675
|
+
Ic = e;
|
|
13628
13676
|
}
|
|
13629
|
-
function
|
|
13677
|
+
function Vc(e) {
|
|
13630
13678
|
N.videoEffects = e;
|
|
13631
13679
|
}
|
|
13632
|
-
function
|
|
13680
|
+
function Hc(e) {
|
|
13633
13681
|
N.audioEffects = e;
|
|
13634
13682
|
}
|
|
13635
|
-
function
|
|
13683
|
+
function Uc(e, t = {}) {
|
|
13636
13684
|
N.vad = e, N.vadOptions = t;
|
|
13637
13685
|
}
|
|
13638
|
-
function
|
|
13686
|
+
function Wc(e, t = null, n = {}, r = 1) {
|
|
13639
13687
|
N.vmoji = e, N.vmojiOptions = {
|
|
13640
13688
|
protocolVersion: r,
|
|
13641
13689
|
renderingOptions: n
|
|
13642
13690
|
}, t && e.setSDK(t);
|
|
13643
13691
|
}
|
|
13644
|
-
async function
|
|
13645
|
-
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();
|
|
13646
13694
|
let n = E.getBrowserSupportFailure();
|
|
13647
13695
|
if (n) throw new k(x.UNSUPPORTED, { callError: {
|
|
13648
13696
|
scope: "internal",
|
|
@@ -13651,19 +13699,19 @@ async function Vc(t) {
|
|
|
13651
13699
|
} });
|
|
13652
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}`);
|
|
13653
13701
|
}
|
|
13654
|
-
async function
|
|
13702
|
+
async function Kc(e, t = [S.AUDIO], n = "", r = !1, i = !1, a, o, s) {
|
|
13655
13703
|
let c = [];
|
|
13656
|
-
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);
|
|
13657
13705
|
}
|
|
13658
|
-
function
|
|
13706
|
+
function qc(e, t = []) {
|
|
13659
13707
|
let n = e.getIncomingCallerExternalId();
|
|
13660
13708
|
return n ? t.length === 1 && t[0].id === n.id && t[0].type === n.type : !1;
|
|
13661
13709
|
}
|
|
13662
|
-
async function
|
|
13710
|
+
async function Jc(e, t = no.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
|
|
13663
13711
|
if (!N.hold && B.getActive()) throw z.error("There is already active call"), new k(O.HAS_ACTIVE_CALL);
|
|
13664
13712
|
let u = B.getAll().find((e) => e.isIncomingRinging);
|
|
13665
|
-
if (!N.hold && u && !
|
|
13666
|
-
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({
|
|
13667
13715
|
opponentIds: e,
|
|
13668
13716
|
opponentType: t,
|
|
13669
13717
|
mediaOptions: n,
|
|
@@ -13676,49 +13724,49 @@ async function Wc(e, t = no.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
|
|
|
13676
13724
|
conversationId: l
|
|
13677
13725
|
});
|
|
13678
13726
|
}
|
|
13679
|
-
async function
|
|
13680
|
-
return
|
|
13727
|
+
async function Yc(e, t) {
|
|
13728
|
+
return Xc(e, j.USER, void 0, t);
|
|
13681
13729
|
}
|
|
13682
|
-
async function
|
|
13730
|
+
async function Xc(e, t = j.USER, n, r, i, a) {
|
|
13683
13731
|
if (e === $.id()) throw Error("Push has already been processed");
|
|
13684
|
-
return new $(new
|
|
13732
|
+
return new $(new Oc(), Ic).onPush(e, t, n, r, i, a);
|
|
13685
13733
|
}
|
|
13686
|
-
async function
|
|
13687
|
-
return
|
|
13734
|
+
async function Zc() {
|
|
13735
|
+
return Fc.getInbounds();
|
|
13688
13736
|
}
|
|
13689
|
-
function
|
|
13737
|
+
function Qc() {
|
|
13690
13738
|
if (N.statQueueEnabled) {
|
|
13691
|
-
if (!
|
|
13739
|
+
if (!Fc) {
|
|
13692
13740
|
z.error("[CallsSDK] startStats() called before init()");
|
|
13693
13741
|
return;
|
|
13694
13742
|
}
|
|
13695
|
-
|
|
13743
|
+
Lc || (Lc = !0, Fs.start(Fc));
|
|
13696
13744
|
}
|
|
13697
13745
|
}
|
|
13698
|
-
async function
|
|
13699
|
-
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();
|
|
13700
13748
|
}
|
|
13701
|
-
async function
|
|
13702
|
-
return
|
|
13749
|
+
async function el(e = [S.AUDIO], t) {
|
|
13750
|
+
return Tu(t).accept(e);
|
|
13703
13751
|
}
|
|
13704
|
-
async function
|
|
13705
|
-
let t =
|
|
13752
|
+
async function tl(e) {
|
|
13753
|
+
let t = Su(e?.conversationId);
|
|
13706
13754
|
if (t) return t.decline(e);
|
|
13707
13755
|
}
|
|
13708
|
-
async function
|
|
13709
|
-
return
|
|
13756
|
+
async function nl(e, t = [S.AUDIO]) {
|
|
13757
|
+
return rl(e, t);
|
|
13710
13758
|
}
|
|
13711
|
-
async function
|
|
13759
|
+
async function rl(e, t, n) {
|
|
13712
13760
|
if (!N.hold && B.callsLength > 0) throw z.error("There is already active call"), new k(O.HAS_ACTIVE_CALL);
|
|
13713
|
-
return new $(new
|
|
13761
|
+
return new $(new Oc(), Ic).onJoin({
|
|
13714
13762
|
conversationId: e,
|
|
13715
13763
|
mediaOptions: t,
|
|
13716
13764
|
chatId: n
|
|
13717
13765
|
});
|
|
13718
13766
|
}
|
|
13719
|
-
async function
|
|
13767
|
+
async function il(e, t = [S.AUDIO], n, r, i, a) {
|
|
13720
13768
|
if (!N.hold && B.callsLength > 0) throw z.error("There is already active call"), new k(O.HAS_ACTIVE_CALL);
|
|
13721
|
-
return n && (N.anonymToken = n), new $(new
|
|
13769
|
+
return n && (N.anonymToken = n), new $(new Oc(), Ic).onJoin({
|
|
13722
13770
|
joinLink: e,
|
|
13723
13771
|
mediaOptions: t,
|
|
13724
13772
|
observedIds: r,
|
|
@@ -13727,30 +13775,30 @@ async function el(e, t = [S.AUDIO], n, r, i, a) {
|
|
|
13727
13775
|
anonymous: !!N.anonymToken
|
|
13728
13776
|
});
|
|
13729
13777
|
}
|
|
13730
|
-
function
|
|
13731
|
-
let t =
|
|
13778
|
+
function al(e) {
|
|
13779
|
+
let t = Su(e?.conversationId);
|
|
13732
13780
|
return t ? t.hangup(e) : ($.hangupAfterInit(e?.onFastHangup), Promise.resolve());
|
|
13733
13781
|
}
|
|
13734
|
-
async function
|
|
13782
|
+
async function ol(e, t) {
|
|
13735
13783
|
let n = Array.isArray(e) ? e : [e], r = $.current();
|
|
13736
13784
|
r && await r.addParticipant(n, t);
|
|
13737
13785
|
}
|
|
13738
|
-
async function
|
|
13786
|
+
async function sl(e, t) {
|
|
13739
13787
|
let n = $.current();
|
|
13740
13788
|
if (n) {
|
|
13741
13789
|
let r = e.map((e) => M.composeUserId(e));
|
|
13742
13790
|
await n.addParticipantLegacy(r, t);
|
|
13743
13791
|
}
|
|
13744
13792
|
}
|
|
13745
|
-
async function
|
|
13746
|
-
let n =
|
|
13793
|
+
async function cl(e, t = !1) {
|
|
13794
|
+
let n = Eu(e, "removeParticipant");
|
|
13747
13795
|
if (n) try {
|
|
13748
13796
|
await n.conversation.removeParticipant(M.decomposeParticipantId(n.participantId).compositeUserId, t);
|
|
13749
13797
|
} catch (e) {
|
|
13750
13798
|
z.warn(`Failed to remove participant ${n.participantId}. Perhaps he is no longer on the call. ${e}`);
|
|
13751
13799
|
}
|
|
13752
13800
|
}
|
|
13753
|
-
async function
|
|
13801
|
+
async function ll(e, t = !1) {
|
|
13754
13802
|
let n = $.current();
|
|
13755
13803
|
if (n) try {
|
|
13756
13804
|
await n.removeParticipant(M.composeUserId(e), t);
|
|
@@ -13758,13 +13806,13 @@ async function al(e, t = !1) {
|
|
|
13758
13806
|
z.warn(`Failed to remove participant ${e}. Perhaps he is no longer on the call. ${t}`);
|
|
13759
13807
|
}
|
|
13760
13808
|
}
|
|
13761
|
-
async function
|
|
13809
|
+
async function ul(e, t) {
|
|
13762
13810
|
let n = $.current();
|
|
13763
13811
|
if (e === "videoinput" && jt.contains(t)) return N.videoFacingMode = t, n ? (E.isMobile() && n.stopVideoTrack(), n.changeDevice(e)) : void 0;
|
|
13764
13812
|
if (!await E._saveDeviceId(e, t)) throw Error(`Device not found: ${t}`);
|
|
13765
13813
|
if (n) return n.changeDevice(e);
|
|
13766
13814
|
}
|
|
13767
|
-
async function
|
|
13815
|
+
async function dl(e, t) {
|
|
13768
13816
|
let n = typeof e == "object" ? {
|
|
13769
13817
|
...e,
|
|
13770
13818
|
fastScreenSharing: e.captureScreen && e.fastScreenSharing,
|
|
@@ -13773,40 +13821,40 @@ async function sl(e, t) {
|
|
|
13773
13821
|
captureScreen: e,
|
|
13774
13822
|
fastScreenSharing: !1,
|
|
13775
13823
|
captureAudio: !1
|
|
13776
|
-
}, r =
|
|
13824
|
+
}, r = Su(t);
|
|
13777
13825
|
return r ? r.toggleScreenCapturing(n) : Promise.reject();
|
|
13778
13826
|
}
|
|
13779
|
-
function
|
|
13827
|
+
function fl(e) {
|
|
13780
13828
|
let t = $.current();
|
|
13781
13829
|
t && t.toggleAnimojiCapturing(e);
|
|
13782
13830
|
}
|
|
13783
|
-
async function
|
|
13831
|
+
async function pl(e, t = !1) {
|
|
13784
13832
|
let n = $.current();
|
|
13785
13833
|
n && await n.setVideoStream(e, t);
|
|
13786
13834
|
}
|
|
13787
|
-
async function
|
|
13788
|
-
let n =
|
|
13835
|
+
async function ml(e, t) {
|
|
13836
|
+
let n = Su(t);
|
|
13789
13837
|
n && await n.toggleLocalVideo(e);
|
|
13790
13838
|
}
|
|
13791
|
-
async function
|
|
13792
|
-
let n =
|
|
13839
|
+
async function hl(e, t) {
|
|
13840
|
+
let n = Su(t);
|
|
13793
13841
|
n && await n.toggleLocalAudio(e);
|
|
13794
13842
|
}
|
|
13795
|
-
async function
|
|
13843
|
+
async function gl(e) {
|
|
13796
13844
|
let t = $.current();
|
|
13797
13845
|
if (t) return t.setLocalResolution(e);
|
|
13798
13846
|
}
|
|
13799
|
-
async function
|
|
13847
|
+
async function _l(e) {
|
|
13800
13848
|
let t = $.current();
|
|
13801
13849
|
t && await t.changePriorities(e);
|
|
13802
13850
|
}
|
|
13803
|
-
async function
|
|
13851
|
+
async function vl(e, t) {
|
|
13804
13852
|
let n = $.current();
|
|
13805
13853
|
if (n) {
|
|
13806
13854
|
if (t) {
|
|
13807
13855
|
let r = n.getCachedParticipantIdByExternalId(t);
|
|
13808
13856
|
if (!r) {
|
|
13809
|
-
|
|
13857
|
+
Cu(t, "changeParticipantState", n);
|
|
13810
13858
|
return;
|
|
13811
13859
|
}
|
|
13812
13860
|
await n.changeParticipantState(e, r);
|
|
@@ -13815,161 +13863,161 @@ async function ml(e, t) {
|
|
|
13815
13863
|
await n.changeParticipantState(e);
|
|
13816
13864
|
}
|
|
13817
13865
|
}
|
|
13818
|
-
async function
|
|
13866
|
+
async function yl() {
|
|
13819
13867
|
let e = $.current();
|
|
13820
13868
|
e && await e.putHandsDown();
|
|
13821
13869
|
}
|
|
13822
|
-
async function
|
|
13870
|
+
async function bl(e) {
|
|
13823
13871
|
let t = $.current();
|
|
13824
13872
|
t && await t.updateDisplayLayout(e);
|
|
13825
13873
|
}
|
|
13826
|
-
async function
|
|
13874
|
+
async function xl(e) {
|
|
13827
13875
|
let t = $.current();
|
|
13828
13876
|
t && await t.requestDisplayLayout(e);
|
|
13829
13877
|
}
|
|
13830
|
-
async function
|
|
13831
|
-
let r =
|
|
13878
|
+
async function Sl(e, t, n = !1) {
|
|
13879
|
+
let r = Eu(e, "grantRoles");
|
|
13832
13880
|
r && await r.conversation.grantRoles(r.participantId, t, n);
|
|
13833
13881
|
}
|
|
13834
|
-
async function
|
|
13882
|
+
async function Cl(e, t, n, r = !1) {
|
|
13835
13883
|
let i = $.current();
|
|
13836
13884
|
i && await i.grantRoles(M.composeParticipantId(e, j.USER, t), n, r);
|
|
13837
13885
|
}
|
|
13838
|
-
async function
|
|
13886
|
+
async function wl({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
|
|
13839
13887
|
if (e) {
|
|
13840
|
-
let i =
|
|
13888
|
+
let i = Eu(e, "muteParticipant");
|
|
13841
13889
|
return i ? i.conversation.muteParticipant(i.participantId, t, n, r) : void 0;
|
|
13842
13890
|
}
|
|
13843
13891
|
let i = $.current();
|
|
13844
13892
|
i && await i.muteParticipant(null, t, n, r);
|
|
13845
13893
|
}
|
|
13846
|
-
async function
|
|
13894
|
+
async function Tl({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
|
|
13847
13895
|
let a = $.current();
|
|
13848
13896
|
if (a) {
|
|
13849
13897
|
let o = e ? M.composeParticipantId(e, j.USER, r) : null;
|
|
13850
13898
|
await a.muteParticipant(o, t, n, i);
|
|
13851
13899
|
}
|
|
13852
13900
|
}
|
|
13853
|
-
async function
|
|
13854
|
-
let r =
|
|
13901
|
+
async function El(e, t = !1, n = null) {
|
|
13902
|
+
let r = Eu(e, "pinParticipant");
|
|
13855
13903
|
r && await r.conversation.pinParticipant(r.participantId, t, n);
|
|
13856
13904
|
}
|
|
13857
|
-
async function
|
|
13905
|
+
async function Dl(e, t = !1, n = 0, r = null) {
|
|
13858
13906
|
let i = $.current();
|
|
13859
13907
|
i && await i.pinParticipant(M.composeParticipantId(e, j.USER, n), t, r);
|
|
13860
13908
|
}
|
|
13861
|
-
async function
|
|
13909
|
+
async function Ol(e) {
|
|
13862
13910
|
let t = $.current();
|
|
13863
13911
|
t && await t.updateMediaModifiers(e);
|
|
13864
13912
|
}
|
|
13865
|
-
async function
|
|
13913
|
+
async function kl(e) {
|
|
13866
13914
|
let t = $.current();
|
|
13867
13915
|
t && await t.enableVideoSuspend(e);
|
|
13868
13916
|
}
|
|
13869
|
-
async function
|
|
13917
|
+
async function Al(e) {
|
|
13870
13918
|
let t = $.current();
|
|
13871
13919
|
t && await t.enableVideoSuspendSuggest(e);
|
|
13872
13920
|
}
|
|
13873
|
-
async function
|
|
13921
|
+
async function jl(e) {
|
|
13874
13922
|
let t = $.current();
|
|
13875
13923
|
t && await t.changeOptions(e);
|
|
13876
13924
|
}
|
|
13877
|
-
async function
|
|
13925
|
+
async function Ml(e, t = null) {
|
|
13878
13926
|
if (t) {
|
|
13879
|
-
let n =
|
|
13927
|
+
let n = Eu(t, "chatMessage");
|
|
13880
13928
|
return n ? n.conversation.chatMessage(e, M.decomposeParticipantId(n.participantId).compositeUserId) : void 0;
|
|
13881
13929
|
}
|
|
13882
13930
|
let n = $.current();
|
|
13883
13931
|
n && await n.chatMessage(e, null);
|
|
13884
13932
|
}
|
|
13885
|
-
async function
|
|
13933
|
+
async function Nl(e, t = null) {
|
|
13886
13934
|
let n = $.current();
|
|
13887
13935
|
if (n) {
|
|
13888
13936
|
let r = t ? M.composeUserId(t) : null;
|
|
13889
13937
|
await n.chatMessage(e, r);
|
|
13890
13938
|
}
|
|
13891
13939
|
}
|
|
13892
|
-
async function
|
|
13940
|
+
async function Pl(e = 10) {
|
|
13893
13941
|
let t = $.current();
|
|
13894
13942
|
if (t) return t.chatHistory(e);
|
|
13895
13943
|
}
|
|
13896
|
-
async function
|
|
13944
|
+
async function Fl(e, t = null) {
|
|
13897
13945
|
if (t) {
|
|
13898
|
-
let n =
|
|
13946
|
+
let n = Eu(t, "customData");
|
|
13899
13947
|
return n ? n.conversation.customData(e, n.participantId) : void 0;
|
|
13900
13948
|
}
|
|
13901
13949
|
let n = $.current();
|
|
13902
13950
|
n && await n.customData(e, null);
|
|
13903
13951
|
}
|
|
13904
|
-
async function
|
|
13952
|
+
async function Il(e, t = null, n = 0) {
|
|
13905
13953
|
let r = $.current();
|
|
13906
13954
|
if (r) {
|
|
13907
13955
|
let i = t ? M.composeParticipantId(t, j.USER, n) : null;
|
|
13908
13956
|
await r.customData(e, i);
|
|
13909
13957
|
}
|
|
13910
13958
|
}
|
|
13911
|
-
async function
|
|
13912
|
-
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, {
|
|
13913
13961
|
onlyAdminCanShareMovie: n,
|
|
13914
13962
|
waitForAdmin: r,
|
|
13915
13963
|
closedConversation: i
|
|
13916
13964
|
})).join_link;
|
|
13917
13965
|
}
|
|
13918
|
-
async function
|
|
13966
|
+
async function Rl(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
|
|
13919
13967
|
let a = i.map((e) => Z.fromId(e));
|
|
13920
|
-
return (await
|
|
13968
|
+
return (await Fc.createConversation(M.uuid(), e, t, {
|
|
13921
13969
|
onlyAdminCanShareMovie: n,
|
|
13922
13970
|
audienceMode: !0,
|
|
13923
13971
|
audioOnly: r
|
|
13924
13972
|
}, a)).join_link;
|
|
13925
13973
|
}
|
|
13926
|
-
async function
|
|
13974
|
+
async function zl() {
|
|
13927
13975
|
let e = $.current();
|
|
13928
13976
|
return e ? e.createJoinLink() : Promise.reject();
|
|
13929
13977
|
}
|
|
13930
|
-
async function
|
|
13978
|
+
async function Bl() {
|
|
13931
13979
|
let e = $.current();
|
|
13932
13980
|
return e ? e.removeJoinLink() : Promise.reject();
|
|
13933
13981
|
}
|
|
13934
|
-
async function
|
|
13935
|
-
return
|
|
13982
|
+
async function Vl(e, t) {
|
|
13983
|
+
return Fc.getAnonymTokenByLink(e, t);
|
|
13936
13984
|
}
|
|
13937
|
-
function
|
|
13985
|
+
function Hl(e) {
|
|
13938
13986
|
let t = $.current();
|
|
13939
13987
|
t && t.setVolume(e);
|
|
13940
13988
|
}
|
|
13941
|
-
function
|
|
13989
|
+
function Ul(e) {
|
|
13942
13990
|
N.forceRelayPolicy = e;
|
|
13943
13991
|
}
|
|
13944
|
-
async function
|
|
13992
|
+
async function Wl(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
|
|
13945
13993
|
let o = $.current();
|
|
13946
13994
|
return o ? o.startStream(e, t, n, r, i, a) : Promise.reject();
|
|
13947
13995
|
}
|
|
13948
|
-
async function
|
|
13996
|
+
async function Gl(e = null, t) {
|
|
13949
13997
|
let n = $.current();
|
|
13950
13998
|
return n ? n.stopStream(e, t) : Promise.reject();
|
|
13951
13999
|
}
|
|
13952
|
-
async function
|
|
14000
|
+
async function Kl(e = null) {
|
|
13953
14001
|
let t = $.current();
|
|
13954
14002
|
return t ? t.publishStream(e) : Promise.reject();
|
|
13955
14003
|
}
|
|
13956
|
-
async function
|
|
14004
|
+
async function ql() {
|
|
13957
14005
|
let e = $.current();
|
|
13958
14006
|
return e ? e.getStreamInfo() : Promise.reject();
|
|
13959
14007
|
}
|
|
13960
|
-
async function
|
|
14008
|
+
async function Jl(e) {
|
|
13961
14009
|
let t = $.current();
|
|
13962
14010
|
return t ? t.addMovie(e) : Promise.reject();
|
|
13963
14011
|
}
|
|
13964
|
-
async function
|
|
14012
|
+
async function Yl(e) {
|
|
13965
14013
|
let t = $.current();
|
|
13966
14014
|
return t ? t.updateMovie(e) : Promise.reject();
|
|
13967
14015
|
}
|
|
13968
|
-
async function
|
|
14016
|
+
async function Xl(e) {
|
|
13969
14017
|
let t = $.current();
|
|
13970
14018
|
return t ? t.removeMovie(e) : Promise.reject();
|
|
13971
14019
|
}
|
|
13972
|
-
async function
|
|
14020
|
+
async function Zl(e, t) {
|
|
13973
14021
|
let n = $.current();
|
|
13974
14022
|
if (n) {
|
|
13975
14023
|
let r = [], i = [];
|
|
@@ -13991,46 +14039,46 @@ async function ql(e, t) {
|
|
|
13991
14039
|
});
|
|
13992
14040
|
}
|
|
13993
14041
|
if (i.length) {
|
|
13994
|
-
|
|
14042
|
+
wu(i, "updateRooms", n);
|
|
13995
14043
|
return;
|
|
13996
14044
|
}
|
|
13997
14045
|
return n.updateRooms(r, t);
|
|
13998
14046
|
}
|
|
13999
14047
|
return Promise.reject();
|
|
14000
14048
|
}
|
|
14001
|
-
async function
|
|
14049
|
+
async function Ql(e, t) {
|
|
14002
14050
|
let n = $.current();
|
|
14003
14051
|
return n ? n.activateRooms(e, t) : Promise.reject();
|
|
14004
14052
|
}
|
|
14005
|
-
async function
|
|
14053
|
+
async function $l(e = null, t = null) {
|
|
14006
14054
|
let n = $.current();
|
|
14007
14055
|
if (!n) return Promise.reject();
|
|
14008
14056
|
let r;
|
|
14009
14057
|
if (t && (r = n.getCachedParticipantIdByExternalId(t) ?? void 0, !r)) {
|
|
14010
|
-
|
|
14058
|
+
Cu(t, "switchRoom", n);
|
|
14011
14059
|
return;
|
|
14012
14060
|
}
|
|
14013
14061
|
return n.switchRoom(e, r);
|
|
14014
14062
|
}
|
|
14015
|
-
async function
|
|
14063
|
+
async function eu(e) {
|
|
14016
14064
|
let t = $.current();
|
|
14017
14065
|
return t ? t.removeRooms(e) : Promise.reject();
|
|
14018
14066
|
}
|
|
14019
|
-
function
|
|
14067
|
+
function tu(e) {
|
|
14020
14068
|
N.statisticsInterval = e;
|
|
14021
14069
|
let t = $.current();
|
|
14022
14070
|
if (t) return t.updateStatisticsInterval();
|
|
14023
14071
|
}
|
|
14024
|
-
function
|
|
14072
|
+
function nu(t) {
|
|
14025
14073
|
e.disableLog(!t), z.toggle(t);
|
|
14026
14074
|
}
|
|
14027
|
-
function
|
|
14075
|
+
function ru(e, ...t) {
|
|
14028
14076
|
N.debugLog && ($.debugMessage(e, "[external]", ...t) || z.send(e, "[external]", ...t));
|
|
14029
14077
|
}
|
|
14030
|
-
function
|
|
14078
|
+
function iu(e, t, ...n) {
|
|
14031
14079
|
N.debugLog && ($.debugMessageWithContext(e, t, "[external]", ...n) || z.send(e, "[external]", ...n));
|
|
14032
14080
|
}
|
|
14033
|
-
var
|
|
14081
|
+
var au = {
|
|
14034
14082
|
list: Ne,
|
|
14035
14083
|
get: Pe,
|
|
14036
14084
|
getJson: Fe,
|
|
@@ -14038,7 +14086,7 @@ var tu = {
|
|
|
14038
14086
|
clear: Le,
|
|
14039
14087
|
stats: Re
|
|
14040
14088
|
};
|
|
14041
|
-
function
|
|
14089
|
+
function ou() {
|
|
14042
14090
|
let e = [
|
|
14043
14091
|
[`Calls SDK ${N.sdkVersion}`, N.toJSON()],
|
|
14044
14092
|
["UserAgent:", navigator.userAgent],
|
|
@@ -14056,139 +14104,139 @@ function nu() {
|
|
|
14056
14104
|
d: e
|
|
14057
14105
|
}));
|
|
14058
14106
|
}
|
|
14059
|
-
async function
|
|
14107
|
+
async function su() {
|
|
14060
14108
|
let e = $.id(), t = $.debugSessionId();
|
|
14061
14109
|
if (!t || !e) throw z.error("[uploadDebugLogs]", "No conversation id found"), Error("No conversation id found");
|
|
14062
14110
|
let n = await Pe({ sessionId: t });
|
|
14063
14111
|
if (n.length === 0) throw z.error("[uploadDebugLogs]", "No logs found"), Error("No logs found");
|
|
14064
14112
|
let r = n[0].t, i = n[n.length - 1].t;
|
|
14065
14113
|
try {
|
|
14066
|
-
return
|
|
14114
|
+
return Fc?.uploadDebugLogs(e, r, i, JSON.stringify([...ou(), ...n]));
|
|
14067
14115
|
} catch (e) {
|
|
14068
14116
|
throw z.error("[uploadDebugLogs]", "Error while uploading logs", e), Error("Error while uploading logs", { cause: e });
|
|
14069
14117
|
}
|
|
14070
14118
|
}
|
|
14071
|
-
async function
|
|
14119
|
+
async function cu(e) {
|
|
14072
14120
|
let t = $.current();
|
|
14073
14121
|
if (t) return t.videoEffect(e);
|
|
14074
14122
|
}
|
|
14075
|
-
async function
|
|
14123
|
+
async function lu(e, t) {
|
|
14076
14124
|
let n = $.current();
|
|
14077
14125
|
if (n) return n.audioEffect(e.length > 0 ? e : null, t);
|
|
14078
14126
|
}
|
|
14079
|
-
async function
|
|
14127
|
+
async function uu(e) {
|
|
14080
14128
|
let t = $.current();
|
|
14081
14129
|
t && await t.setAudioStream(e);
|
|
14082
14130
|
}
|
|
14083
|
-
async function
|
|
14131
|
+
async function du(e, t = null, n = null) {
|
|
14084
14132
|
let r = $.current();
|
|
14085
14133
|
if (!r) return;
|
|
14086
14134
|
let i = n ?? t?.id, a = null;
|
|
14087
14135
|
if (t && (a = r.getCachedParticipantIdByExternalId(t), !a)) {
|
|
14088
|
-
|
|
14136
|
+
Cu(t, "setVmojiSvg", r);
|
|
14089
14137
|
return;
|
|
14090
14138
|
}
|
|
14091
14139
|
r.setAnimojiSvg(e, a, i);
|
|
14092
14140
|
}
|
|
14093
|
-
function
|
|
14141
|
+
function fu(e) {
|
|
14094
14142
|
let t = $.current();
|
|
14095
14143
|
t && t.setAnimojiFill(e);
|
|
14096
14144
|
}
|
|
14097
|
-
async function
|
|
14098
|
-
return
|
|
14145
|
+
async function pu(e = null, t, n = !1) {
|
|
14146
|
+
return Tu().getWaitingHall(e, t, n);
|
|
14099
14147
|
}
|
|
14100
|
-
async function
|
|
14101
|
-
return
|
|
14148
|
+
async function mu() {
|
|
14149
|
+
return Tu().getAudienceModeHands();
|
|
14102
14150
|
}
|
|
14103
|
-
async function
|
|
14104
|
-
let n =
|
|
14151
|
+
async function hu(e, t = !1) {
|
|
14152
|
+
let n = Tu(), r;
|
|
14105
14153
|
if (e) {
|
|
14106
14154
|
let t = n.getCachedParticipantIdByExternalId(e);
|
|
14107
14155
|
if (!t) {
|
|
14108
|
-
|
|
14156
|
+
Cu(e, "promoteParticipant", n);
|
|
14109
14157
|
return;
|
|
14110
14158
|
}
|
|
14111
14159
|
r = M.decomposeParticipantId(t).compositeUserId;
|
|
14112
14160
|
}
|
|
14113
14161
|
return n.promoteParticipant(r, t);
|
|
14114
14162
|
}
|
|
14115
|
-
async function
|
|
14116
|
-
return
|
|
14163
|
+
async function gu(e = !1) {
|
|
14164
|
+
return Tu().requestPromotion(e);
|
|
14117
14165
|
}
|
|
14118
|
-
async function
|
|
14119
|
-
return
|
|
14166
|
+
async function _u(e = !1) {
|
|
14167
|
+
return Tu().acceptPromotion(e);
|
|
14120
14168
|
}
|
|
14121
|
-
async function
|
|
14122
|
-
return
|
|
14169
|
+
async function vu(e) {
|
|
14170
|
+
return Tu().getParticipantListChunk(e);
|
|
14123
14171
|
}
|
|
14124
|
-
async function
|
|
14125
|
-
return
|
|
14172
|
+
async function yu(e) {
|
|
14173
|
+
return Tu().getParticipants(e);
|
|
14126
14174
|
}
|
|
14127
|
-
async function
|
|
14128
|
-
return
|
|
14175
|
+
async function bu(e) {
|
|
14176
|
+
return Tu().feedback(e);
|
|
14129
14177
|
}
|
|
14130
|
-
async function
|
|
14131
|
-
return
|
|
14178
|
+
async function xu(e, t, n) {
|
|
14179
|
+
return Tu(n).enableFeatureForRoles(e, t);
|
|
14132
14180
|
}
|
|
14133
|
-
function
|
|
14181
|
+
function Su(e) {
|
|
14134
14182
|
return e ? B.get(e) ?? null : $.current() ?? B.getFirst();
|
|
14135
14183
|
}
|
|
14136
|
-
function
|
|
14184
|
+
function Cu(e, t, n) {
|
|
14137
14185
|
R.onNonFatalError(/* @__PURE__ */ Error(`Participant ID mapping not found for external ID "${e.id}" while handling ${t}`), n.id);
|
|
14138
14186
|
}
|
|
14139
|
-
function
|
|
14187
|
+
function wu(e, t, n) {
|
|
14140
14188
|
let r = Array.from(new Set(e));
|
|
14141
14189
|
R.onNonFatalError(/* @__PURE__ */ Error(`Participant ID mapping not found for external IDs "${r.join("\", \"")}" while handling ${t}`), n.id);
|
|
14142
14190
|
}
|
|
14143
|
-
function
|
|
14144
|
-
let t =
|
|
14191
|
+
function Tu(e) {
|
|
14192
|
+
let t = Su(e);
|
|
14145
14193
|
if (!t) throw Error("Conversation not found");
|
|
14146
14194
|
return t;
|
|
14147
14195
|
}
|
|
14148
|
-
function
|
|
14196
|
+
function Eu(e, t) {
|
|
14149
14197
|
let n = $.current();
|
|
14150
14198
|
if (!n) return null;
|
|
14151
14199
|
let r = n.getCachedParticipantIdByExternalId(e);
|
|
14152
14200
|
return r ? {
|
|
14153
14201
|
conversation: n,
|
|
14154
14202
|
participantId: r
|
|
14155
|
-
} : (
|
|
14203
|
+
} : (Cu(e, t, n), null);
|
|
14156
14204
|
}
|
|
14157
|
-
async function
|
|
14158
|
-
await
|
|
14205
|
+
async function Du(e) {
|
|
14206
|
+
await Fc.removeHistoryRecords(e);
|
|
14159
14207
|
}
|
|
14160
|
-
async function
|
|
14208
|
+
async function Ou(e) {
|
|
14161
14209
|
let t = $.current() ?? B.getFirst();
|
|
14162
14210
|
t && await t.startAsr(e);
|
|
14163
14211
|
}
|
|
14164
|
-
async function
|
|
14212
|
+
async function ku(e) {
|
|
14165
14213
|
let t = $.current() ?? B.getFirst();
|
|
14166
14214
|
t && await t.stopAsr(e);
|
|
14167
14215
|
}
|
|
14168
|
-
async function
|
|
14216
|
+
async function Au(e) {
|
|
14169
14217
|
let t = $.current() ?? B.getFirst();
|
|
14170
14218
|
t && await t.requestAsr(e);
|
|
14171
14219
|
}
|
|
14172
|
-
async function
|
|
14220
|
+
async function ju(e) {
|
|
14173
14221
|
let t = $.current();
|
|
14174
14222
|
return t ? t.startUrlSharing(e) : Promise.reject();
|
|
14175
14223
|
}
|
|
14176
|
-
async function
|
|
14224
|
+
async function Mu() {
|
|
14177
14225
|
let e = $.current();
|
|
14178
14226
|
return e ? e.stopUrlSharing() : Promise.reject();
|
|
14179
14227
|
}
|
|
14180
|
-
async function
|
|
14228
|
+
async function Nu(e) {
|
|
14181
14229
|
await B.switchCall(e);
|
|
14182
14230
|
}
|
|
14183
|
-
function
|
|
14231
|
+
function Pu() {
|
|
14184
14232
|
return B.getActiveId();
|
|
14185
14233
|
}
|
|
14186
|
-
function
|
|
14234
|
+
function Fu() {
|
|
14187
14235
|
return $.getSyncedTime();
|
|
14188
14236
|
}
|
|
14189
|
-
function
|
|
14237
|
+
function Iu() {
|
|
14190
14238
|
return N.sdkVersion;
|
|
14191
14239
|
}
|
|
14192
14240
|
typeof window < "u" && (window.__CALLS_SDK = xn);
|
|
14193
14241
|
//#endregion
|
|
14194
|
-
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 };
|