sip-connector 13.3.0 → 14.0.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/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  var se = Object.defineProperty;
2
2
  var oe = (n, e, t) => e in n ? se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var a = (n, e, t) => oe(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { B as G, N as K, l as u, E as x, s as re, a as ie, P as ce, b as ae, S as sn } from "./SipConnector-B4xLnl6L.js";
5
- import { i as mn, j as hn, m as Rn, k as gn, c as pn, d as yn, f as En, g as Tn, e as bn, h as Mn } from "./SipConnector-B4xLnl6L.js";
4
+ import { B as G, N as K, l as c, E as x, s as re, a as ie, P as ce, b as ae } from "./SipConnector-Cc1z-VjV.js";
5
+ import { i as Cn, j as mn, m as hn, k as Rn, S as gn, c as pn, d as yn, f as En, g as Tn, e as bn, h as Mn } from "./SipConnector-Cc1z-VjV.js";
6
6
  import { sequentPromises as ue } from "sequent-promises";
7
7
  import { createStackPromises as le } from "stack-promises";
8
8
  import { isCanceledError as de } from "@krivega/cancelable-promise";
9
9
  import { hasCanceledError as Se } from "repeated-calls";
10
10
  import { debounce as fe } from "ts-debounce";
11
- import { default as _n } from "debug";
11
+ import { default as An } from "debug";
12
12
  const H = (n) => {
13
13
  const { url: e, cause: t } = n;
14
14
  let s = e;
15
15
  return (t === G || t === K) && (s = `${n.message.to.uri.user}@${n.message.to.uri.host}`), s;
16
16
  };
17
- var q = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(q || {});
17
+ var Y = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(Y || {});
18
18
  const Ce = (n = new Error()) => {
19
19
  var o;
20
20
  const { cause: e, socket: t } = n;
@@ -41,7 +41,7 @@ const Ce = (n = new Error()) => {
41
41
  try {
42
42
  e = JSON.stringify(n);
43
43
  } catch (t) {
44
- u("failed to stringify message", t);
44
+ c("failed to stringify message", t);
45
45
  }
46
46
  return e;
47
47
  }, he = (n = new Error()) => {
@@ -49,7 +49,7 @@ const Ce = (n = new Error()) => {
49
49
  return typeof s == "object" && s !== null ? r.message = me(s) : s && (r.message = String(s)), o && (r.link = o), e && (r.code = e), t && (r.cause = t), r;
50
50
  }, Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
51
51
  __proto__: null,
52
- EErrorTypes: q,
52
+ EErrorTypes: Y,
53
53
  getLinkError: H,
54
54
  getTypeFromError: Ce,
55
55
  getValuesFromError: he
@@ -61,8 +61,8 @@ const Ce = (n = new Error()) => {
61
61
  isRegistered: o,
62
62
  isPresentationCall: r
63
63
  }) => {
64
- const i = [], c = t ? "0" : "1", l = s ? "0" : "1";
65
- return i.push(`X-Vinteo-Mic-State: ${c}`, `X-Vinteo-MainCam-State: ${l}`), o || i.push("X-Vinteo-Purgatory-Call: yes"), n && i.push(`X-Vinteo-Session: ${n}`), r && i.push("X-Vinteo-Presentation-Call: yes"), e && i.push(`X-Vinteo-Remote: ${e}`), i;
64
+ const i = [], u = t ? "0" : "1", l = s ? "0" : "1";
65
+ return i.push(`X-Vinteo-Mic-State: ${u}`, `X-Vinteo-MainCam-State: ${l}`), o || i.push("X-Vinteo-Purgatory-Call: yes"), n && i.push(`X-Vinteo-Session: ${n}`), r && i.push("X-Vinteo-Presentation-Call: yes"), e && i.push(`X-Vinteo-Remote: ${e}`), i;
66
66
  }, pe = "[@*!|]", ye = "_", Ee = (n) => {
67
67
  let e = n;
68
68
  return e = e.replaceAll(new RegExp(pe, "g"), ye), e;
@@ -80,23 +80,23 @@ const Ce = (n = new Error()) => {
80
80
  browserName: t,
81
81
  browserVersion: s,
82
82
  appName: o
83
- }) => n ? Te({ appVersion: e, browserName: t, browserVersion: s, appName: o }) : "Chrome", Y = "purgatory", D = (n) => n === Y, Me = (n) => (e) => [...e].map((s) => async () => n(s)), Ae = async ({
83
+ }) => n ? Te({ appVersion: e, browserName: t, browserVersion: s, appName: o }) : "Chrome", q = "purgatory", D = (n) => n === q, Me = (n) => (e) => [...e].map((s) => async () => n(s)), _e = async ({
84
84
  accumulatedKeys: n,
85
85
  sendKey: e,
86
86
  canRunTask: t
87
87
  }) => {
88
88
  const o = Me(e)(n);
89
89
  return ue(o, t);
90
- }, _e = (n) => (t) => (u("onStartMainCam"), n.onSession("admin-start-main-cam", t)), ve = (n) => (t) => (u("onStartMic"), n.onSession("admin-start-mic", t)), Oe = (n) => (t) => (u("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), Ne = (n) => (t) => (u("onStopMic"), n.onSession("admin-stop-mic", t)), we = ({ sipConnector: n }) => {
90
+ }, Ae = (n) => (t) => (c("onStartMainCam"), n.onSession("admin-start-main-cam", t)), ve = (n) => (t) => (c("onStartMic"), n.onSession("admin-start-mic", t)), Oe = (n) => (t) => (c("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), Ne = (n) => (t) => (c("onStopMic"), n.onSession("admin-stop-mic", t)), we = ({ sipConnector: n }) => {
91
91
  const e = (m, p) => ({ isSyncForced: h = !1 }) => {
92
92
  if (h) {
93
93
  m();
94
94
  return;
95
95
  }
96
96
  p();
97
- }, t = _e(n), s = Oe(n), o = ve(n), r = Ne(n);
97
+ }, t = Ae(n), s = Oe(n), o = ve(n), r = Ne(n);
98
98
  let i = () => {
99
- }, c = () => {
99
+ }, u = () => {
100
100
  }, l = () => {
101
101
  }, S = () => {
102
102
  };
@@ -110,22 +110,22 @@ const Ce = (n = new Error()) => {
110
110
  onStopMicForced: T,
111
111
  onStopMicNotForced: b
112
112
  }) => {
113
- const _ = e(
113
+ const A = e(
114
114
  m,
115
115
  p
116
116
  );
117
- i = t(_);
117
+ i = t(A);
118
118
  const v = e(
119
119
  h,
120
120
  R
121
121
  );
122
- c = s(v);
122
+ u = s(v);
123
123
  const O = e(y, E);
124
124
  l = o(O);
125
125
  const N = e(T, b);
126
126
  S = r(N);
127
127
  }, f = () => {
128
- i(), c(), l(), S();
128
+ i(), u(), l(), S();
129
129
  };
130
130
  return {
131
131
  start: (m) => {
@@ -135,15 +135,15 @@ const Ce = (n = new Error()) => {
135
135
  f();
136
136
  }
137
137
  };
138
- }, ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
138
+ }, un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
139
139
  __proto__: null,
140
- PURGATORY_CONFERENCE_NUMBER: Y,
140
+ PURGATORY_CONFERENCE_NUMBER: q,
141
141
  createSyncMediaState: we,
142
142
  error: Re,
143
143
  getExtraHeaders: ge,
144
144
  getUserAgent: be,
145
145
  hasPurgatory: D,
146
- sendDTMFAccumulated: Ae
146
+ sendDTMFAccumulated: _e
147
147
  }, Symbol.toStringTag, { value: "Module" })), Be = (n) => [...n.keys()].map((e) => n.get(e)), Pe = (n, e) => Be(n).find((t) => t.type === e), De = async (n) => n.getStats().then((e) => {
148
148
  const t = Pe(e, "codec");
149
149
  return t == null ? void 0 : t.mimeType;
@@ -158,10 +158,10 @@ const Ce = (n = new Error()) => {
158
158
  targetSize: e,
159
159
  codec: t
160
160
  }) => {
161
- const s = n.getSettings(), o = s.width, r = s.height, i = o / e.width, c = r / e.height, l = Math.max(i, c, He), S = Z(e.width, t);
161
+ const s = n.getSettings(), o = s.width, r = s.height, i = o / e.width, u = r / e.height, l = Math.max(i, u, He), S = Z(e.width, t);
162
162
  return { scaleResolutionDownBy: l, maxBitrate: S };
163
163
  }, ne = le(), Xe = async () => ne().catch((n) => {
164
- u("videoSendingBalancer: error", n);
164
+ c("videoSendingBalancer: error", n);
165
165
  }), je = async (n) => (ne.add(n), Xe()), X = async ({
166
166
  sender: n,
167
167
  scaleResolutionDownBy: e,
@@ -180,10 +180,10 @@ const Ce = (n = new Error()) => {
180
180
  videoTrack: e,
181
181
  codec: t
182
182
  }, s) => {
183
- const i = e.getSettings().width, c = Z(i, t);
183
+ const i = e.getSettings().width, u = Z(i, t);
184
184
  return X({
185
185
  sender: n,
186
- maxBitrate: c,
186
+ maxBitrate: u,
187
187
  onSetParameters: s,
188
188
  scaleResolutionDownBy: 1
189
189
  });
@@ -193,7 +193,7 @@ const Ce = (n = new Error()) => {
193
193
  resolution: t,
194
194
  codec: s
195
195
  }, o) => {
196
- const [r, i] = t.split("x"), { maxBitrate: c, scaleResolutionDownBy: l } = ee({
196
+ const [r, i] = t.split("x"), { maxBitrate: u, scaleResolutionDownBy: l } = ee({
197
197
  videoTrack: e,
198
198
  codec: s,
199
199
  targetSize: {
@@ -203,7 +203,7 @@ const Ce = (n = new Error()) => {
203
203
  });
204
204
  return X({
205
205
  sender: n,
206
- maxBitrate: c,
206
+ maxBitrate: u,
207
207
  onSetParameters: o,
208
208
  scaleResolutionDownBy: l
209
209
  });
@@ -246,18 +246,18 @@ const Ce = (n = new Error()) => {
246
246
  const r = t.getSenders(), i = Ie(r);
247
247
  if (!(i != null && i.track))
248
248
  return j;
249
- const c = await De(i);
250
- return z(c, o) ? j : Ke(
249
+ const u = await De(i);
250
+ return z(u, o) ? j : Ke(
251
251
  {
252
252
  mainCam: n,
253
253
  resolutionMainCam: e,
254
254
  sender: i,
255
- codec: c,
255
+ codec: u,
256
256
  videoTrack: i.track
257
257
  },
258
258
  s
259
259
  );
260
- }, dn = (n, {
260
+ }, ln = (n, {
261
261
  ignoreForCodec: e,
262
262
  onSetParameters: t
263
263
  } = {}) => {
@@ -299,16 +299,16 @@ const Ce = (n = new Error()) => {
299
299
  return o();
300
300
  }
301
301
  };
302
- }, qe = (n) => n.getVideoTracks()[0], B = ({
302
+ }, Ye = (n) => n.getVideoTracks()[0], B = ({
303
303
  mediaStream: n,
304
304
  simulcastEncodings: e,
305
305
  sendEncodings: t
306
306
  }) => {
307
307
  if (e && e.length > 0) {
308
- const s = t ?? [], o = qe(n);
308
+ const s = t ?? [], o = Ye(n);
309
309
  return e.forEach((r, i) => {
310
- const c = s[i] ?? {};
311
- c.active = !0, r.rid !== void 0 && (c.rid = r.rid), r.scalabilityMode !== void 0 && (c.scalabilityMode = r.scalabilityMode);
310
+ const u = s[i] ?? {};
311
+ u.active = !0, r.rid !== void 0 && (u.rid = r.rid), r.scalabilityMode !== void 0 && (u.scalabilityMode = r.scalabilityMode);
312
312
  const { maxBitrate: l, scaleResolutionDownBy: S } = ee({
313
313
  videoTrack: o,
314
314
  targetSize: {
@@ -316,26 +316,30 @@ const Ce = (n = new Error()) => {
316
316
  height: r.height
317
317
  }
318
318
  });
319
- c.maxBitrate = l, c.scaleResolutionDownBy = S, s[i] = c;
319
+ u.maxBitrate = l, u.scaleResolutionDownBy = S, s[i] = u;
320
320
  }), s;
321
321
  }
322
322
  return t;
323
- }, Ye = (n, e) => [...n, ...e].filter((o, r, i) => r === i.findIndex((c) => c.clockRate === o.clockRate && c.mimeType === o.mimeType && c.channels === o.channels && c.sdpFmtpLine === o.sdpFmtpLine)), ze = (n) => {
323
+ }, qe = (n, e) => n.filter((s) => e.some((o) => o.clockRate === s.clockRate && o.mimeType === s.mimeType && o.channels === s.channels && o.sdpFmtpLine === s.sdpFmtpLine)), ze = (n) => {
324
324
  const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, o = t === null ? [] : t.codecs;
325
- return Ye(s, o);
325
+ return qe(s, o);
326
326
  }, Qe = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
327
- const o = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), i = o === -1 ? Number.MAX_VALUE : o, c = r === -1 ? Number.MAX_VALUE : r;
328
- return i - c;
327
+ const o = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), i = o === -1 ? Number.MAX_VALUE : o, u = r === -1 ? Number.MAX_VALUE : r;
328
+ return i - u;
329
329
  }), Je = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), P = (n, {
330
330
  preferredMimeTypesVideoCodecs: e,
331
331
  excludeMimeTypesVideoCodecs: t
332
332
  }) => async (s) => {
333
333
  var o;
334
- if (typeof s.setCodecPreferences == "function" && ((o = s.sender.track) == null ? void 0 : o.kind) === "video" && (e !== void 0 && (e == null ? void 0 : e.length) > 0 || t !== void 0 && (t == null ? void 0 : t.length) > 0)) {
335
- const r = ze("video"), i = Je(r, t), c = Qe(i, e);
336
- s.setCodecPreferences(c);
334
+ try {
335
+ if (typeof s.setCodecPreferences == "function" && ((o = s.sender.track) == null ? void 0 : o.kind) === "video" && (e !== void 0 && (e == null ? void 0 : e.length) > 0 || t !== void 0 && (t == null ? void 0 : t.length) > 0)) {
336
+ const r = ze("video"), i = Je(r, t), u = Qe(i, e);
337
+ s.setCodecPreferences(u);
338
+ }
339
+ Object.keys(n).length > 0 && await ie(s.sender, n);
340
+ } catch (r) {
341
+ c("updateTransceiver error", r);
337
342
  }
338
- Object.keys(n).length > 0 && await ie(s.sender, n);
339
343
  }, $ = (n) => {
340
344
  if (!de(n) && !Se(n))
341
345
  throw n;
@@ -362,7 +366,7 @@ const Ce = (n = new Error()) => {
362
366
  "isConfigured",
363
367
  "isRegistered"
364
368
  ]);
365
- class Sn {
369
+ class dn {
366
370
  constructor(e, {
367
371
  preferredMimeTypesVideoCodecs: t,
368
372
  excludeMimeTypesVideoCodecs: s
@@ -417,21 +421,21 @@ class Sn {
417
421
  sipServerUrl: o,
418
422
  remoteAddress: r,
419
423
  displayName: i,
420
- name: c,
424
+ name: u,
421
425
  password: l,
422
426
  isRegisteredUser: S,
423
427
  isDisconnectOnFail: C
424
428
  } = e;
425
- return u("connectToServer", e), this.sipConnector.connect({
429
+ return c("connectToServer", e), this.sipConnector.connect({
426
430
  userAgent: t,
427
431
  sipWebSocketServerURL: s,
428
432
  sipServerUrl: o,
429
433
  remoteAddress: r,
430
434
  displayName: i,
431
435
  password: l,
432
- user: c,
436
+ user: u,
433
437
  register: S
434
- }).then((f) => (u("connectToServer then"), { ua: f, isSuccessful: !0 })).catch(async (f) => (u("connectToServer catch: error", f), C === !0 ? this.sipConnector.disconnect().then(() => $(f)).catch(() => $(f)) : $(f)));
438
+ }).then((f) => (c("connectToServer then"), { ua: f, isSuccessful: !0 })).catch(async (f) => (c("connectToServer catch: error", f), C === !0 ? this.sipConnector.disconnect().then(() => $(f)).catch(() => $(f)) : $(f)));
435
439
  });
436
440
  a(this, "callToServer", async (e) => {
437
441
  const {
@@ -440,7 +444,7 @@ class Sn {
440
444
  extraHeaders: o,
441
445
  iceServers: r,
442
446
  contentHint: i,
443
- simulcastEncodings: c,
447
+ simulcastEncodings: u,
444
448
  degradationPreference: l,
445
449
  sendEncodings: S,
446
450
  offerToReceiveAudio: C,
@@ -455,10 +459,10 @@ class Sn {
455
459
  onFailProgressCall: E,
456
460
  onFinishProgressCall: T,
457
461
  onEndedCall: b
458
- } = e, _ = this.resolveHandleReadyRemoteStreamsDebounced({
462
+ } = e, A = this.resolveHandleReadyRemoteStreamsDebounced({
459
463
  onReadyRemoteStreams: m
460
464
  }), v = this.resolveHandleReadyRemoteStreams({
461
- onReadyRemoteStreams: _
465
+ onReadyRemoteStreams: A
462
466
  }), O = P(
463
467
  {
464
468
  degradationPreference: l
@@ -468,8 +472,8 @@ class Sn {
468
472
  excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
469
473
  }
470
474
  );
471
- u("callToServer", e);
472
- const N = async () => (u("startCall"), this.sipConnector.call({
475
+ c("callToServer", e);
476
+ const N = async () => (c("startCall"), this.sipConnector.call({
473
477
  mediaStream: s,
474
478
  extraHeaders: o,
475
479
  iceServers: r,
@@ -480,27 +484,27 @@ class Sn {
480
484
  directionAudio: F,
481
485
  sendEncodings: B({
482
486
  mediaStream: s,
483
- simulcastEncodings: c,
487
+ simulcastEncodings: u,
484
488
  sendEncodings: S
485
489
  }),
486
490
  number: t,
487
491
  onAddedTransceiver: O,
488
492
  ontrack: v
489
493
  }));
490
- let M = !1, A;
491
- const w = (u("subscribeEnterConference: onEnterConference", y), R ?? y ? this.sipConnector.onSession("enterRoom", ({ room: d }) => {
492
- u("enterRoom", { _room: d, isSuccessProgressCall: M }), A = d, D(A) ? R && R() : y && y({ isSuccessProgressCall: M });
494
+ let M = !1, _;
495
+ const w = (c("subscribeEnterConference: onEnterConference", y), R ?? y ? this.sipConnector.onSession("enterRoom", ({ room: d }) => {
496
+ c("enterRoom", { _room: d, isSuccessProgressCall: M }), _ = d, D(_) ? R && R() : y && y({ isSuccessProgressCall: M });
493
497
  }) : () => {
494
- }), k = (d) => (u("onSuccess"), M = !0, _(), h && h({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
498
+ }), k = (d) => (c("onSuccess"), M = !0, A(), h && h({ isPurgatory: D(_) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
495
499
  w(), b && b();
496
500
  }), d), U = (d) => {
497
- throw u("onFail"), E && E(), w(), d;
501
+ throw c("onFail"), E && E(), w(), d;
498
502
  }, V = () => {
499
- u("onFinish"), T && T();
503
+ c("onFinish"), T && T();
500
504
  };
501
- return u("onBeforeProgressCall"), p && p(t), N().then(k).catch((d) => U(d)).finally(V);
505
+ return c("onBeforeProgressCall"), p && p(t), N().then(k).catch((d) => U(d)).finally(V);
502
506
  });
503
- a(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (u("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (u("disconnectFromServer: catch", e), { isSuccessful: !1 })));
507
+ a(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (c("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (c("disconnectFromServer: catch", e), { isSuccessful: !1 })));
504
508
  a(this, "answerIncomingCall", async (e) => {
505
509
  const {
506
510
  mediaStream: t,
@@ -508,7 +512,7 @@ class Sn {
508
512
  iceServers: o,
509
513
  contentHint: r,
510
514
  simulcastEncodings: i,
511
- degradationPreference: c,
515
+ degradationPreference: u,
512
516
  sendEncodings: l,
513
517
  offerToReceiveAudio: S,
514
518
  offerToReceiveVideo: C,
@@ -524,18 +528,18 @@ class Sn {
524
528
  onEndedCall: T
525
529
  } = e, b = this.resolveHandleReadyRemoteStreamsDebounced({
526
530
  onReadyRemoteStreams: F
527
- }), _ = this.resolveHandleReadyRemoteStreams({
531
+ }), A = this.resolveHandleReadyRemoteStreams({
528
532
  onReadyRemoteStreams: b
529
533
  }), v = P(
530
534
  {
531
- degradationPreference: c
535
+ degradationPreference: u
532
536
  },
533
537
  {
534
538
  preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
535
539
  excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
536
540
  }
537
541
  );
538
- u("answerIncomingCall", e);
542
+ c("answerIncomingCall", e);
539
543
  const O = async () => this.sipConnector.answerToIncomingCall({
540
544
  mediaStream: t,
541
545
  extraHeaders: s,
@@ -551,23 +555,23 @@ class Sn {
551
555
  sendEncodings: l
552
556
  }),
553
557
  onAddedTransceiver: v,
554
- ontrack: _
558
+ ontrack: A
555
559
  }), N = () => {
556
560
  const { remoteCallerData: d } = this.sipConnector;
557
561
  return d.incomingNumber;
558
562
  };
559
- let M = !1, A;
560
- const w = (u("subscribeEnterConference: onEnterConference", R), h ?? R ? this.sipConnector.onSession("enterRoom", (d) => {
561
- u("enterRoom", { _room: d, isSuccessProgressCall: M }), A = d, D(A) ? h && h() : R && R({ isSuccessProgressCall: M });
563
+ let M = !1, _;
564
+ const w = (c("subscribeEnterConference: onEnterConference", R), h ?? R ? this.sipConnector.onSession("enterRoom", (d) => {
565
+ c("enterRoom", { _room: d, isSuccessProgressCall: M }), _ = d, D(_) ? h && h() : R && R({ isSuccessProgressCall: M });
562
566
  }) : () => {
563
- }), k = (d) => (u("onSuccess"), M = !0, b(), p && p({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
567
+ }), k = (d) => (c("onSuccess"), M = !0, b(), p && p({ isPurgatory: D(_) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
564
568
  w(), T && T();
565
569
  }), d), U = (d) => {
566
- throw u("onFail"), y && y(), w(), d;
570
+ throw c("onFail"), y && y(), w(), d;
567
571
  }, V = () => {
568
- u("onFinish"), E && E();
572
+ c("onFinish"), E && E();
569
573
  };
570
- if (u("onBeforeProgressCall"), m) {
574
+ if (c("onBeforeProgressCall"), m) {
571
575
  const d = N();
572
576
  m(d);
573
577
  }
@@ -580,7 +584,7 @@ class Sn {
580
584
  contentHint: o,
581
585
  simulcastEncodings: r,
582
586
  degradationPreference: i,
583
- sendEncodings: c,
587
+ sendEncodings: u,
584
588
  preferredMimeTypesVideoCodecs: l,
585
589
  excludeMimeTypesVideoCodecs: S
586
590
  }) => {
@@ -593,14 +597,14 @@ class Sn {
593
597
  excludeMimeTypesVideoCodecs: S
594
598
  }
595
599
  );
596
- return u("updatePresentation"), this.sipConnector.updatePresentation(e, {
600
+ return c("updatePresentation"), this.sipConnector.updatePresentation(e, {
597
601
  isP2P: t,
598
602
  maxBitrate: s,
599
603
  contentHint: o,
600
604
  sendEncodings: B({
601
605
  mediaStream: e,
602
606
  simulcastEncodings: r,
603
- sendEncodings: c
607
+ sendEncodings: u
604
608
  }),
605
609
  onAddedTransceiver: C
606
610
  });
@@ -612,7 +616,7 @@ class Sn {
612
616
  contentHint: o,
613
617
  simulcastEncodings: r,
614
618
  degradationPreference: i,
615
- sendEncodings: c,
619
+ sendEncodings: u,
616
620
  preferredMimeTypesVideoCodecs: l,
617
621
  excludeMimeTypesVideoCodecs: S
618
622
  }, C) => {
@@ -625,7 +629,7 @@ class Sn {
625
629
  excludeMimeTypesVideoCodecs: S
626
630
  }
627
631
  );
628
- return u("startPresentation"), this.sipConnector.startPresentation(
632
+ return c("startPresentation"), this.sipConnector.startPresentation(
629
633
  e,
630
634
  {
631
635
  isP2P: t,
@@ -634,28 +638,28 @@ class Sn {
634
638
  sendEncodings: B({
635
639
  mediaStream: e,
636
640
  simulcastEncodings: r,
637
- sendEncodings: c
641
+ sendEncodings: u
638
642
  }),
639
643
  onAddedTransceiver: f
640
644
  },
641
645
  C
642
646
  );
643
647
  });
644
- a(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (u("stopShareSipConnector"), this.sipConnector.stopPresentation({
648
+ a(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (c("stopShareSipConnector"), this.sipConnector.stopPresentation({
645
649
  isP2P: e
646
650
  }).catch((t) => {
647
- u(t);
651
+ c(t);
648
652
  })));
649
653
  a(this, "sendRefusalToTurnOnMic", async () => {
650
654
  if (this.sipConnector.isCallActive)
651
- return u("sendRefusalToTurnOnMic"), this.sipConnector.sendRefusalToTurnOnMic().catch((e) => {
652
- u("sendRefusalToTurnOnMic: error", e);
655
+ return c("sendRefusalToTurnOnMic"), this.sipConnector.sendRefusalToTurnOnMic().catch((e) => {
656
+ c("sendRefusalToTurnOnMic: error", e);
653
657
  });
654
658
  });
655
659
  a(this, "sendRefusalToTurnOnCam", async () => {
656
660
  if (this.sipConnector.isCallActive)
657
- return u("sendRefusalToTurnOnCam"), this.sipConnector.sendRefusalToTurnOnCam().catch((e) => {
658
- u("sendRefusalToTurnOnCam: error", e);
661
+ return c("sendRefusalToTurnOnCam"), this.sipConnector.sendRefusalToTurnOnCam().catch((e) => {
662
+ c("sendRefusalToTurnOnCam: error", e);
659
663
  });
660
664
  });
661
665
  a(this, "sendMediaState", async ({
@@ -663,7 +667,7 @@ class Sn {
663
667
  isEnabledMic: t
664
668
  }) => {
665
669
  if (this.sipConnector.isCallActive)
666
- return u("sendMediaState"), this.sipConnector.sendMediaState({ cam: e, mic: t });
670
+ return c("sendMediaState"), this.sipConnector.sendMediaState({ cam: e, mic: t });
667
671
  });
668
672
  a(this, "replaceMediaStream", async (e, {
669
673
  deleteExisting: t,
@@ -671,19 +675,19 @@ class Sn {
671
675
  forceRenegotiation: o,
672
676
  contentHint: r,
673
677
  simulcastEncodings: i,
674
- degradationPreference: c,
678
+ degradationPreference: u,
675
679
  sendEncodings: l
676
680
  } = {}) => {
677
681
  const S = P(
678
682
  {
679
- degradationPreference: c
683
+ degradationPreference: u
680
684
  },
681
685
  {
682
686
  preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
683
687
  excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
684
688
  }
685
689
  );
686
- return u("replaceMediaStream"), this.sipConnector.replaceMediaStream(e, {
690
+ return c("replaceMediaStream"), this.sipConnector.replaceMediaStream(e, {
687
691
  deleteExisting: t,
688
692
  addMissing: s,
689
693
  forceRenegotiation: o,
@@ -698,53 +702,53 @@ class Sn {
698
702
  });
699
703
  a(this, "askPermissionToEnableCam", async () => {
700
704
  if (this.sipConnector.isCallActive)
701
- return u("askPermissionToEnableCam"), this.sipConnector.askPermissionToEnableCam();
705
+ return c("askPermissionToEnableCam"), this.sipConnector.askPermissionToEnableCam();
702
706
  });
703
707
  a(this, "resolveHandleReadyRemoteStreamsDebounced", ({
704
708
  onReadyRemoteStreams: e
705
709
  }) => fe(() => {
706
710
  const t = this.sipConnector.getRemoteStreams();
707
- u("remoteStreams", t), t && e(t);
711
+ c("remoteStreams", t), t && e(t);
708
712
  }, 200));
709
713
  a(this, "resolveHandleReadyRemoteStreams", ({
710
714
  onReadyRemoteStreams: e
711
715
  }) => ({ track: t }) => {
712
716
  Ze(t) && e();
713
717
  });
714
- a(this, "getRemoteStreams", () => (u("getRemoteStreams"), this.sipConnector.getRemoteStreams()));
715
- a(this, "onUseLicense", (e) => (u("onUseLicense"), this.sipConnector.onSession("useLicense", e)));
716
- a(this, "onMustStopPresentation", (e) => (u("onMustStopPresentation"), this.sipConnector.onSession("mustStopPresentation", e)));
717
- a(this, "onMoveToSpectators", (e) => (u("onMoveToSpectators"), this.sipConnector.onSession(ce, e)));
718
- a(this, "onMoveToParticipants", (e) => (u("onMoveToParticipants"), this.sipConnector.onSession(ae, e)));
718
+ a(this, "getRemoteStreams", () => (c("getRemoteStreams"), this.sipConnector.getRemoteStreams()));
719
+ a(this, "onUseLicense", (e) => (c("onUseLicense"), this.sipConnector.onSession("useLicense", e)));
720
+ a(this, "onMustStopPresentation", (e) => (c("onMustStopPresentation"), this.sipConnector.onSession("mustStopPresentation", e)));
721
+ a(this, "onMoveToSpectators", (e) => (c("onMoveToSpectators"), this.sipConnector.onSession(ce, e)));
722
+ a(this, "onMoveToParticipants", (e) => (c("onMoveToParticipants"), this.sipConnector.onSession(ae, e)));
719
723
  return this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.sipConnector = e, new Proxy(this, {
720
724
  get: (o, r, i) => {
721
725
  if (typeof r == "string" && en.has(r) && r in this.sipConnector) {
722
726
  const l = Reflect.get(this.sipConnector, r, this.sipConnector);
723
727
  return typeof l == "function" ? l.bind(this.sipConnector) : l;
724
728
  }
725
- const c = Reflect.get(o, r, i);
726
- return typeof c == "function" ? c.bind(o) : c;
729
+ const u = Reflect.get(o, r, i);
730
+ return typeof u == "function" ? u.bind(o) : u;
727
731
  }
728
732
  });
729
733
  }
730
734
  }
731
735
  export {
732
736
  x as EEventsMainCAM,
733
- mn as EEventsMic,
734
- hn as EEventsSyncMediaState,
735
- Rn as EMimeTypesVideoCodecs,
736
- gn as EUseLicense,
737
- Sn as SipConnectorFacade,
737
+ Cn as EEventsMic,
738
+ mn as EEventsSyncMediaState,
739
+ hn as EMimeTypesVideoCodecs,
740
+ Rn as EUseLicense,
741
+ gn as SipConnector,
742
+ dn as SipConnectorFacade,
738
743
  pn as causes,
739
744
  yn as constants,
740
- _n as debug,
741
- sn as default,
745
+ An as debug,
742
746
  En as disableDebug,
743
747
  Tn as enableDebug,
744
748
  bn as eventNames,
745
749
  De as getCodecFromSender,
746
750
  Mn as hasCanceledCallError,
747
- dn as resolveVideoSendingBalancer,
751
+ ln as resolveVideoSendingBalancer,
748
752
  ie as setParametersToSender,
749
- ln as tools
753
+ un as tools
750
754
  };