sip-connector 16.0.2 → 16.1.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.
@@ -1,14 +1,14 @@
1
1
  import { Events as D, TypedEvents as j } from "events-constructor";
2
- import { CancelableRequest as Ae } from "@krivega/cancelable-promise";
2
+ import { CancelableRequest as Re } from "@krivega/cancelable-promise";
3
3
  import q from "debug";
4
- import { hasCanceledError as Re, repeatedCallsAsync as K } from "repeated-calls";
5
- import { setup as Ie, createActor as _e } from "xstate";
6
- import { SetTimeoutRequest as Z } from "@krivega/timeout-requester";
4
+ import { hasCanceledError as Ie, repeatedCallsAsync as K } from "repeated-calls";
5
+ import { setup as _e, createActor as Me } from "xstate";
6
+ import { createStackPromises as Z } from "stack-promises";
7
+ import { SetTimeoutRequest as ee } from "@krivega/timeout-requester";
7
8
  import "ua-parser-js";
8
9
  import "sequent-promises";
9
- import { createStackPromises as Me } from "stack-promises";
10
10
  var C = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n))(C || {}), $ = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))($ || {});
11
- const ee = [
11
+ const te = [
12
12
  "peerconnection",
13
13
  "connecting",
14
14
  "sending",
@@ -39,8 +39,8 @@ const ee = [
39
39
  "peerconnection:confirmed",
40
40
  "peerconnection:ontrack",
41
41
  "ended:fromserver"
42
- ], te = [
43
- ...ee,
42
+ ], ne = [
43
+ ...te,
44
44
  ...me
45
45
  ], pe = (n, e) => {
46
46
  n.getVideoTracks().forEach((s) => {
@@ -59,7 +59,7 @@ const ee = [
59
59
  function Pe(n) {
60
60
  return (e) => `sip:${e}@${n}`;
61
61
  }
62
- const fe = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, ne = (n) => n.trim().replaceAll(" ", "_"), Oe = fe(1e5, 99999999), ve = (n) => n.some((t) => {
62
+ const fe = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, se = (n) => n.trim().replaceAll(" ", "_"), Oe = fe(1e5, 99999999), ve = (n) => n.some((t) => {
63
63
  const { kind: s } = t;
64
64
  return s === "video";
65
65
  });
@@ -74,7 +74,7 @@ class De {
74
74
  this.events = e;
75
75
  }
76
76
  }
77
- var se = /* @__PURE__ */ ((n) => (n.BYE = "Terminated", n.WEBRTC_ERROR = "WebRTC Error", n.CANCELED = "Canceled", n.REQUEST_TIMEOUT = "Request Timeout", n.REJECTED = "Rejected", n.REDIRECTED = "Redirected", n.UNAVAILABLE = "Unavailable", n.NOT_FOUND = "Not Found", n.ADDRESS_INCOMPLETE = "Address Incomplete", n.INCOMPATIBLE_SDP = "Incompatible SDP", n.BAD_MEDIA_DESCRIPTION = "Bad Media Description", n))(se || {});
77
+ var ie = /* @__PURE__ */ ((n) => (n.BYE = "Terminated", n.WEBRTC_ERROR = "WebRTC Error", n.CANCELED = "Canceled", n.REQUEST_TIMEOUT = "Request Timeout", n.REJECTED = "Rejected", n.REDIRECTED = "Redirected", n.UNAVAILABLE = "Unavailable", n.NOT_FOUND = "Not Found", n.ADDRESS_INCOMPLETE = "Address Incomplete", n.INCOMPATIBLE_SDP = "Incompatible SDP", n.BAD_MEDIA_DESCRIPTION = "Bad Media Description", n))(ie || {});
78
78
  class ye {
79
79
  remoteStreams = {};
80
80
  reset() {
@@ -170,7 +170,7 @@ class be extends De {
170
170
  const { rtcSession: e } = this;
171
171
  if (e && !e.isEnded())
172
172
  return e.terminateAsync({
173
- cause: se.CANCELED
173
+ cause: ie.CANCELED
174
174
  }).finally(() => {
175
175
  this.reset();
176
176
  });
@@ -272,7 +272,7 @@ class be extends De {
272
272
  });
273
273
  subscribeToSessionEvents(e) {
274
274
  this.events.eachTriggers((t, s) => {
275
- const i = ee.find((r) => r === s);
275
+ const i = te.find((r) => r === s);
276
276
  i && (e.on(i, t), this.disposers.add(() => {
277
277
  e.off(i, t);
278
278
  }));
@@ -295,7 +295,7 @@ class we {
295
295
  events;
296
296
  strategy;
297
297
  constructor(e) {
298
- this.events = new D(te), this.strategy = e ?? new be(this.events);
298
+ this.events = new D(ne), this.strategy = e ?? new be(this.events);
299
299
  }
300
300
  get requested() {
301
301
  return this.strategy.requested;
@@ -339,13 +339,13 @@ class we {
339
339
  getRemoteStreams = () => this.strategy.getRemoteStreams();
340
340
  replaceMediaStream = async (...e) => this.strategy.replaceMediaStream(...e);
341
341
  }
342
- const G = "sip-connector", R = q(G), un = () => {
342
+ const G = "sip-connector", R = q(G), Tn = () => {
343
343
  q.enable(G);
344
- }, Tn = () => {
344
+ }, Sn = () => {
345
345
  q.enable(`-${G}`);
346
346
  }, Ue = "Error decline with 603", Le = 1006, Be = (n) => typeof n == "object" && n !== null && "code" in n && n.code === Le, ke = (n) => n.message === Ue;
347
347
  var l = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n))(l || {}), k = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(k || {}), F = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n.SPECTATOR_OVER_SFU = "SPECTATOROVERSFU", n))(F || {}), O = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(O || {}), M = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.STATS = "application/vinteo.webrtc.stats", n))(M || {}), P = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(P || {}), W = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(W || {}), H = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(H || {}), Fe = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Fe || {}), g = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS_OVER_SFU = "participant:move-request-to-spectators-over-sfu", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n))(g || {});
348
- const ie = [
348
+ const re = [
349
349
  "participation:accepting-word-request",
350
350
  "participation:cancelling-word-request",
351
351
  "participant:move-request-to-stream",
@@ -384,7 +384,7 @@ class $e {
384
384
  connectionManager: e,
385
385
  callManager: t
386
386
  }) {
387
- this.connectionManager = e, this.callManager = t, this.events = new D(ie), this.subscribe();
387
+ this.connectionManager = e, this.callManager = t, this.events = new D(re), this.subscribe();
388
388
  }
389
389
  async waitChannels() {
390
390
  return this.wait(g.CHANNELS);
@@ -783,16 +783,16 @@ const Ve = (n, e) => (n.degradationPreference = e.degradationPreference, n), We
783
783
  for (let t = n.encodings.length; t < e; t += 1)
784
784
  n.encodings.push({});
785
785
  return n;
786
- }, re = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n, He = re(), xe = (n, e) => {
786
+ }, ae = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n, He = ae(), xe = (n, e) => {
787
787
  if (He(n, e))
788
788
  return n;
789
789
  }, qe = (n, e) => {
790
790
  const t = n.maxBitrate, s = xe(e, t);
791
791
  return s !== void 0 && (n.maxBitrate = s), n;
792
- }, ae = 1, Ge = re(
793
- ae
792
+ }, oe = 1, Ge = ae(
793
+ oe
794
794
  ), Qe = (n, e) => {
795
- const t = n === void 0 ? void 0 : Math.max(n, ae);
795
+ const t = n === void 0 ? void 0 : Math.max(n, oe);
796
796
  if (t !== void 0 && Ge(
797
797
  t,
798
798
  e
@@ -834,7 +834,7 @@ const Ve = (n, e) => (n.degradationPreference = e.degradationPreference, n), We
834
834
  ze(t, e), Ve(t, e);
835
835
  const i = Je(s, t);
836
836
  return i && await n.setParameters(t), { parameters: t, isChanged: i };
837
- }, oe = async (n, e, t) => {
837
+ }, ce = async (n, e, t) => {
838
838
  const { isChanged: s, parameters: i } = await Xe(n, {
839
839
  encodings: [
840
840
  {
@@ -847,16 +847,16 @@ const Ve = (n, e) => (n.degradationPreference = e.degradationPreference, n), We
847
847
  }, je = (n, e) => n.find((t) => t.track !== null && e.getTracks().includes(t.track)), Ke = async (n, e, t) => {
848
848
  const s = je(n, e);
849
849
  if (s)
850
- return oe(s, { maxBitrate: t });
850
+ return ce(s, { maxBitrate: t });
851
851
  };
852
852
  var f = /* @__PURE__ */ ((n) => (n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n))(f || {});
853
- const ce = [
853
+ const de = [
854
854
  "presentation:start",
855
855
  "presentation:started",
856
856
  "presentation:end",
857
857
  "presentation:ended",
858
858
  "presentation:failed"
859
- ], Ze = 1, Sn = (n) => Re(n);
859
+ ], Ze = 1, En = (n) => Ie(n);
860
860
  class et {
861
861
  events;
862
862
  promisePendingStartPresentation;
@@ -869,7 +869,7 @@ class et {
869
869
  callManager: e,
870
870
  maxBitrate: t
871
871
  }) {
872
- this.callManager = e, this.maxBitrate = t, this.events = new D(ce), this.subscribe();
872
+ this.callManager = e, this.maxBitrate = t, this.events = new D(de), this.subscribe();
873
873
  }
874
874
  get isPendingPresentation() {
875
875
  return !!this.promisePendingStartPresentation || !!this.promisePendingStopPresentation;
@@ -1103,7 +1103,7 @@ class tt {
1103
1103
  }
1104
1104
  }
1105
1105
  var N = /* @__PURE__ */ ((n) => (n.CONNECTING = "connecting", n.CONNECTED = "connected", n.DISCONNECTED = "disconnected", n.NEW_RTC_SESSION = "newRTCSession", n.REGISTERED = "registered", n.UNREGISTERED = "unregistered", n.REGISTRATION_FAILED = "registrationFailed", n.NEW_MESSAGE = "newMessage", n.SIP_EVENT = "sipEvent", n))(N || {});
1106
- const de = [
1106
+ const he = [
1107
1107
  "connecting",
1108
1108
  "connected",
1109
1109
  "disconnected",
@@ -1113,7 +1113,7 @@ const de = [
1113
1113
  "registrationFailed",
1114
1114
  "newMessage",
1115
1115
  "sipEvent"
1116
- ], he = [...de], nt = 3;
1116
+ ], ge = [...he], nt = 3;
1117
1117
  class st {
1118
1118
  cancelableConnectWithRepeatedCalls;
1119
1119
  JsSIP;
@@ -1140,7 +1140,7 @@ class st {
1140
1140
  }
1141
1141
  let r = !1;
1142
1142
  const a = this.getConnectionConfiguration();
1143
- e !== void 0 && e !== a.displayName && (r = i.set("display_name", ne(e)), this.updateConnectionConfiguration("displayName", e));
1143
+ e !== void 0 && e !== a.displayName && (r = i.set("display_name", se(e)), this.updateConnectionConfiguration("displayName", e));
1144
1144
  const o = r;
1145
1145
  o ? t(o) : s(new Error("nothing changed"));
1146
1146
  });
@@ -1249,8 +1249,8 @@ class st {
1249
1249
  this.cancelableConnectWithRepeatedCalls?.cancel();
1250
1250
  }
1251
1251
  }
1252
- var ge = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(ge || {});
1253
- const it = Ie({
1252
+ var le = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(le || {});
1253
+ const it = _e({
1254
1254
  types: {
1255
1255
  context: {},
1256
1256
  events: {}
@@ -1571,7 +1571,7 @@ class rt {
1571
1571
  unsubscribeFromEvents;
1572
1572
  actorSubscription;
1573
1573
  constructor(e) {
1574
- this.events = e, this.actor = _e(it), this.actorSubscription = this.actor.subscribe((t) => {
1574
+ this.events = e, this.actor = Me(it), this.actorSubscription = this.actor.subscribe((t) => {
1575
1575
  const s = t.value;
1576
1576
  this.stateChangeListeners.forEach((i) => {
1577
1577
  i(s);
@@ -1657,7 +1657,7 @@ class rt {
1657
1657
  return this.actor.getSnapshot().can({ type: e });
1658
1658
  }
1659
1659
  getValidEvents() {
1660
- return Object.values(ge).filter((e) => this.canTransition(e));
1660
+ return Object.values(le).filter((e) => this.canTransition(e));
1661
1661
  }
1662
1662
  hasState(e) {
1663
1663
  return this.actor.getSnapshot().matches(e);
@@ -1890,7 +1890,7 @@ class v {
1890
1890
  password: t,
1891
1891
  register: a,
1892
1892
  uri: m,
1893
- display_name: ne(i),
1893
+ display_name: se(i),
1894
1894
  user_agent: T,
1895
1895
  sdpSemantics: "unified-plan",
1896
1896
  sockets: [I],
@@ -1919,7 +1919,7 @@ class v {
1919
1919
  extraHeaders: e.extraHeaders
1920
1920
  });
1921
1921
  return t.eachTriggers((a, o) => {
1922
- const c = de.find((d) => d === o);
1922
+ const c = he.find((d) => d === o);
1923
1923
  c && r.on(c, a);
1924
1924
  }), { ua: r, helpers: i };
1925
1925
  }
@@ -1936,7 +1936,7 @@ class dt {
1936
1936
  configurationManager;
1937
1937
  JsSIP;
1938
1938
  constructor({ JsSIP: e }) {
1939
- this.JsSIP = e, this.events = new D(he), this.uaFactory = new v(e), this.registrationManager = new at({
1939
+ this.JsSIP = e, this.events = new D(ge), this.uaFactory = new v(e), this.registrationManager = new at({
1940
1940
  events: this.events,
1941
1941
  getUaProtected: this.getUaProtected
1942
1942
  }), this.stateMachine = new rt(this.events), this.configurationManager = new tt({
@@ -2035,19 +2035,37 @@ class dt {
2035
2035
  };
2036
2036
  getUa = () => this.ua;
2037
2037
  }
2038
+ class ht {
2039
+ connectionManager;
2040
+ stackPromises = Z({
2041
+ noRunIsNotActual: !0
2042
+ });
2043
+ constructor({ connectionManager: e }) {
2044
+ this.connectionManager = e;
2045
+ }
2046
+ connect = async (...e) => this.stackPromises.run(async () => this.connectionManager.connect(...e));
2047
+ disconnect = async () => this.stackPromises.run(async () => this.connectionManager.disconnect());
2048
+ register = async () => this.stackPromises.run(async () => this.connectionManager.register());
2049
+ unregister = async () => this.stackPromises.run(async () => this.connectionManager.unregister());
2050
+ tryRegister = async () => this.stackPromises.run(async () => this.connectionManager.tryRegister());
2051
+ checkTelephony = async (...e) => this.stackPromises.run(async () => this.connectionManager.checkTelephony(...e));
2052
+ sendOptions = async (...e) => this.stackPromises.run(async () => this.connectionManager.sendOptions(...e));
2053
+ ping = async (...e) => this.stackPromises.run(async () => this.connectionManager.ping(...e));
2054
+ set = async (...e) => this.stackPromises.run(async () => this.connectionManager.set(...e));
2055
+ }
2038
2056
  var U = /* @__PURE__ */ ((n) => (n.INCOMING_CALL = "incomingCall", n.DECLINED_INCOMING_CALL = "declinedIncomingCall", n.TERMINATED_INCOMING_CALL = "terminatedIncomingCall", n.FAILED_INCOMING_CALL = "failedIncomingCall", n))(U || {}), x = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(x || {});
2039
- const le = [
2057
+ const ue = [
2040
2058
  "incomingCall",
2041
2059
  "declinedIncomingCall",
2042
2060
  "terminatedIncomingCall",
2043
2061
  "failedIncomingCall"
2044
- ], ht = 486, gt = 487;
2045
- class lt {
2062
+ ], gt = 486, lt = 487;
2063
+ class ut {
2046
2064
  events;
2047
2065
  incomingRTCSession;
2048
2066
  connectionManager;
2049
2067
  constructor(e) {
2050
- this.connectionManager = e, this.events = new D(le), this.start();
2068
+ this.connectionManager = e, this.events = new D(ue), this.start();
2051
2069
  }
2052
2070
  get remoteCallerData() {
2053
2071
  return {
@@ -2077,7 +2095,7 @@ class lt {
2077
2095
  return this.removeIncomingSession(), e;
2078
2096
  };
2079
2097
  async declineToIncomingCall({
2080
- statusCode: e = gt
2098
+ statusCode: e = lt
2081
2099
  } = {}) {
2082
2100
  return new Promise((t, s) => {
2083
2101
  try {
@@ -2089,7 +2107,7 @@ class lt {
2089
2107
  });
2090
2108
  }
2091
2109
  async busyIncomingCall() {
2092
- return this.declineToIncomingCall({ statusCode: ht });
2110
+ return this.declineToIncomingCall({ statusCode: gt });
2093
2111
  }
2094
2112
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
2095
2113
  on(e, t) {
@@ -2135,10 +2153,10 @@ class lt {
2135
2153
  }
2136
2154
  const w = 1e3;
2137
2155
  var E = /* @__PURE__ */ ((n) => (n.INBOUND_RTP = "inbound-rtp", n.REMOTE_OUTBOUND_RTP = "remote-outbound-rtp", n.MEDIA_SOURCE = "media-source", n.OUTBOUND_RTP = "outbound-rtp", n.REMOTE_INBOUND_RTP = "remote-inbound-rtp", n.CODEC = "codec", n.CANDIDATE_PAIR = "candidate-pair", n.CERTIFICATE = "certificate", n.TRANSPORT = "transport", n.LOCAL_CANDIDATE = "local-candidate", n.REMOTE_CANDIDATE = "remote-candidate", n))(E || {});
2138
- const ue = ["collected"], Y = () => "performance" in window ? performance.now() : Date.now(), L = (n) => [...n.keys()].reduce((e, t) => {
2156
+ const Te = ["collected"], Y = () => "performance" in window ? performance.now() : Date.now(), L = (n) => [...n.keys()].reduce((e, t) => {
2139
2157
  const s = n.get(t);
2140
2158
  return s === void 0 ? e : { ...e, [s.type]: s };
2141
- }, {}), ut = (n) => {
2159
+ }, {}), Tt = (n) => {
2142
2160
  if (!n)
2143
2161
  return {
2144
2162
  outboundRtp: void 0,
@@ -2184,7 +2202,7 @@ const ue = ["collected"], Y = () => "performance" in window ? performance.now()
2184
2202
  codec: t[E.CODEC],
2185
2203
  synchronizationSources: e
2186
2204
  };
2187
- }, Tt = ({
2205
+ }, St = ({
2188
2206
  audioReceiverStats: n,
2189
2207
  synchronizationSourcesAudio: e
2190
2208
  }) => {
@@ -2202,7 +2220,7 @@ const ue = ["collected"], Y = () => "performance" in window ? performance.now()
2202
2220
  remoteOutboundRtp: t[E.REMOTE_OUTBOUND_RTP],
2203
2221
  synchronizationSources: e
2204
2222
  };
2205
- }, Te = (n) => {
2223
+ }, Se = (n) => {
2206
2224
  if (!n)
2207
2225
  return {
2208
2226
  candidatePair: void 0,
@@ -2219,18 +2237,18 @@ const ue = ["collected"], Y = () => "performance" in window ? performance.now()
2219
2237
  remoteCandidate: e[E.REMOTE_CANDIDATE],
2220
2238
  transport: e[E.TRANSPORT]
2221
2239
  };
2222
- }, St = ({
2240
+ }, Et = ({
2223
2241
  audioSenderStats: n,
2224
2242
  videoSenderFirstStats: e,
2225
2243
  videoSenderSecondStats: t
2226
2244
  }) => ({
2227
2245
  video: z(e),
2228
2246
  secondVideo: z(t),
2229
- audio: ut(n),
2230
- additional: Te(
2247
+ audio: Tt(n),
2248
+ additional: Se(
2231
2249
  n ?? e ?? t
2232
2250
  )
2233
- }), Et = ({
2251
+ }), Ct = ({
2234
2252
  audioReceiverStats: n,
2235
2253
  videoReceiverFirstStats: e,
2236
2254
  videoReceiverSecondStats: t,
@@ -2244,14 +2262,14 @@ const ue = ["collected"], Y = () => "performance" in window ? performance.now()
2244
2262
  videoReceiversStats: t,
2245
2263
  synchronizationSourcesVideo: s.video
2246
2264
  }),
2247
- audio: Tt({
2265
+ audio: St({
2248
2266
  audioReceiverStats: n,
2249
2267
  synchronizationSourcesAudio: s.audio
2250
2268
  }),
2251
- additional: Te(
2269
+ additional: Se(
2252
2270
  n ?? e ?? t
2253
2271
  )
2254
- }), Ct = ({
2272
+ }), Nt = ({
2255
2273
  audioSenderStats: n,
2256
2274
  videoSenderFirstStats: e,
2257
2275
  videoSenderSecondStats: t,
@@ -2260,11 +2278,11 @@ const ue = ["collected"], Y = () => "performance" in window ? performance.now()
2260
2278
  videoReceiverSecondStats: r,
2261
2279
  synchronizationSources: a
2262
2280
  }) => {
2263
- const o = St({
2281
+ const o = Et({
2264
2282
  audioSenderStats: n,
2265
2283
  videoSenderFirstStats: e,
2266
2284
  videoSenderSecondStats: t
2267
- }), c = Et({
2285
+ }), c = Ct({
2268
2286
  audioReceiverStats: s,
2269
2287
  videoReceiverFirstStats: i,
2270
2288
  videoReceiverSecondStats: r,
@@ -2274,7 +2292,7 @@ const ue = ["collected"], Y = () => "performance" in window ? performance.now()
2274
2292
  outbound: o,
2275
2293
  inbound: c
2276
2294
  };
2277
- }, Nt = async (n) => {
2295
+ }, At = async (n) => {
2278
2296
  const e = "audio", t = "video", s = n.getSenders(), i = s.find((h) => h.track?.kind === e), r = s.filter((h) => h.track?.kind === t), a = n.getReceivers(), o = a.find((h) => h.track.kind === e), c = a.filter((h) => h.track.kind === t), d = {
2279
2297
  trackIdentifier: o?.track.id,
2280
2298
  item: o?.getSynchronizationSources()[0]
@@ -2311,22 +2329,22 @@ const ue = ["collected"], Y = () => "performance" in window ? performance.now()
2311
2329
  videoReceiverSecondStats: b
2312
2330
  };
2313
2331
  });
2314
- }, At = (n) => {
2332
+ }, Rt = (n) => {
2315
2333
  R(String(n));
2316
2334
  };
2317
- class Rt {
2335
+ class It {
2318
2336
  events;
2319
2337
  setTimeoutRequest;
2320
- requesterAllStatistics = new Ae(Nt);
2338
+ requesterAllStatistics = new Re(At);
2321
2339
  constructor() {
2322
- this.events = new j(ue), this.setTimeoutRequest = new Z();
2340
+ this.events = new j(Te), this.setTimeoutRequest = new ee();
2323
2341
  }
2324
2342
  get requested() {
2325
2343
  return this.setTimeoutRequest.requested;
2326
2344
  }
2327
2345
  start(e, {
2328
2346
  interval: t = w,
2329
- onError: s = At
2347
+ onError: s = Rt
2330
2348
  } = {}) {
2331
2349
  this.stop(), this.setTimeoutRequest.request(() => {
2332
2350
  this.collectStatistics(e, {
@@ -2357,7 +2375,7 @@ class Rt {
2357
2375
  }) => {
2358
2376
  const s = Y();
2359
2377
  this.requesterAllStatistics.request(e).then((i) => {
2360
- this.events.trigger("collected", Ct(i));
2378
+ this.events.trigger("collected", Nt(i));
2361
2379
  const a = Y() - s;
2362
2380
  let o = w;
2363
2381
  a > 48 ? o = w * 4 : a > 32 ? o = w * 3 : a > 16 && (o = w * 2), this.start(e, {
@@ -2369,7 +2387,7 @@ class Rt {
2369
2387
  });
2370
2388
  };
2371
2389
  }
2372
- class It {
2390
+ class _t {
2373
2391
  availableIncomingBitrate;
2374
2392
  statsPeerConnection;
2375
2393
  callManager;
@@ -2379,7 +2397,7 @@ class It {
2379
2397
  callManager: e,
2380
2398
  apiManager: t
2381
2399
  }) {
2382
- this.callManager = e, this.apiManager = t, this.statsPeerConnection = new Rt(), this.subscribe();
2400
+ this.callManager = e, this.apiManager = t, this.statsPeerConnection = new It(), this.subscribe();
2383
2401
  }
2384
2402
  get events() {
2385
2403
  return this.statsPeerConnection.events;
@@ -2421,33 +2439,33 @@ class It {
2421
2439
  });
2422
2440
  }
2423
2441
  }
2424
- const _t = (n, e) => n.filter((s) => e.some((i) => i.clockRate === s.clockRate && i.mimeType === s.mimeType && i.channels === s.channels && i.sdpFmtpLine === s.sdpFmtpLine)), Mt = (n) => {
2442
+ const Mt = (n, e) => n.filter((s) => e.some((i) => i.clockRate === s.clockRate && i.mimeType === s.mimeType && i.channels === s.channels && i.sdpFmtpLine === s.sdpFmtpLine)), mt = (n) => {
2425
2443
  const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, i = t === null ? [] : t.codecs;
2426
- return _t(s, i);
2427
- }, mt = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
2444
+ return Mt(s, i);
2445
+ }, pt = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
2428
2446
  const i = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), a = i === -1 ? Number.MAX_VALUE : i, o = r === -1 ? Number.MAX_VALUE : r;
2429
2447
  return a - o;
2430
- }), pt = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), Pt = (n, {
2448
+ }), Pt = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), ft = (n, {
2431
2449
  preferredMimeTypesVideoCodecs: e,
2432
2450
  excludeMimeTypesVideoCodecs: t
2433
2451
  }) => {
2434
2452
  try {
2435
2453
  if (typeof n.setCodecPreferences == "function" && n.sender.track?.kind === "video" && (e !== void 0 && e.length > 0 || t !== void 0 && t.length > 0)) {
2436
- const s = Mt("video"), i = pt(s, t), r = mt(i, e);
2454
+ const s = mt("video"), i = Pt(s, t), r = pt(i, e);
2437
2455
  n.setCodecPreferences(r);
2438
2456
  }
2439
2457
  } catch (s) {
2440
2458
  R("setCodecPreferences error", s);
2441
2459
  }
2442
- }, ft = (n) => [...n.keys()].map((e) => n.get(e)), Ot = (n, e) => ft(n).find((t) => t?.type === e), vt = async (n) => n.getStats().then((e) => Ot(e, "codec")?.mimeType);
2443
- class Dt {
2460
+ }, Ot = (n) => [...n.keys()].map((e) => n.get(e)), vt = (n, e) => Ot(n).find((t) => t?.type === e), Dt = async (n) => n.getStats().then((e) => vt(e, "codec")?.mimeType);
2461
+ class yt {
2444
2462
  // eslint-disable-next-line @typescript-eslint/class-methods-use-this
2445
2463
  async getCodecFromSender(e) {
2446
- return await vt(e) ?? "";
2464
+ return await Dt(e) ?? "";
2447
2465
  }
2448
2466
  }
2449
- class yt {
2450
- stackPromises = Me({
2467
+ class bt {
2468
+ stackPromises = Z({
2451
2469
  noRunIsNotActual: !0
2452
2470
  });
2453
2471
  /**
@@ -2471,30 +2489,30 @@ class yt {
2471
2489
  });
2472
2490
  }
2473
2491
  }
2474
- class bt {
2492
+ class wt {
2475
2493
  taskQueue;
2476
2494
  onSetParameters;
2477
2495
  constructor(e) {
2478
- this.onSetParameters = e, this.taskQueue = new yt();
2496
+ this.onSetParameters = e, this.taskQueue = new bt();
2479
2497
  }
2480
2498
  async setEncodingsToSender(e, t) {
2481
- return this.taskQueue.add(async () => oe(e, t, this.onSetParameters));
2499
+ return this.taskQueue.add(async () => ce(e, t, this.onSetParameters));
2482
2500
  }
2483
2501
  stop() {
2484
2502
  this.taskQueue.stop();
2485
2503
  }
2486
2504
  }
2487
- const Se = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), wt = 1e6, p = (n) => n * wt, Ee = p(0.06), Ce = p(4), Ut = (n) => n <= 64 ? Ee : n <= 128 ? p(0.12) : n <= 256 ? p(0.25) : n <= 384 ? p(0.32) : n <= 426 ? p(0.38) : n <= 640 ? p(0.5) : n <= 848 ? p(0.7) : n <= 1280 ? p(1) : n <= 1920 ? p(2) : Ce, Lt = "av1", Bt = (n) => Se(n, Lt), kt = 0.6, Q = (n, e) => Bt(e) ? n * kt : n, Ft = (n) => Q(Ee, n), $t = (n) => Q(Ce, n), X = (n, e) => {
2488
- const t = Ut(n);
2505
+ const Ee = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), Ut = 1e6, p = (n) => n * Ut, Ce = p(0.06), Ne = p(4), Lt = (n) => n <= 64 ? Ce : n <= 128 ? p(0.12) : n <= 256 ? p(0.25) : n <= 384 ? p(0.32) : n <= 426 ? p(0.38) : n <= 640 ? p(0.5) : n <= 848 ? p(0.7) : n <= 1280 ? p(1) : n <= 1920 ? p(2) : Ne, Bt = "av1", kt = (n) => Ee(n, Bt), Ft = 0.6, Q = (n, e) => kt(e) ? n * Ft : n, $t = (n) => Q(Ce, n), Vt = (n) => Q(Ne, n), X = (n, e) => {
2506
+ const t = Lt(n);
2489
2507
  return Q(t, e);
2490
- }, V = 1, Vt = ({
2508
+ }, V = 1, Wt = ({
2491
2509
  videoTrack: n,
2492
2510
  targetSize: e
2493
2511
  }) => {
2494
2512
  const t = n.getSettings(), s = t.width, i = t.height, r = s === void 0 ? V : s / e.width, a = i === void 0 ? V : i / e.height;
2495
2513
  return Math.max(r, a, V);
2496
2514
  };
2497
- class Wt {
2515
+ class Ht {
2498
2516
  ignoreForCodec;
2499
2517
  senderFinder;
2500
2518
  codecProvider;
@@ -2527,7 +2545,7 @@ class Wt {
2527
2545
  if (!i?.track)
2528
2546
  return { ...this.resultNoChanged, sender: i };
2529
2547
  const r = await this.codecProvider.getCodecFromSender(i);
2530
- if (Se(r, this.ignoreForCodec))
2548
+ if (Ee(r, this.ignoreForCodec))
2531
2549
  return { ...this.resultNoChanged, sender: i };
2532
2550
  const { mainCam: a, resolutionMainCam: o } = t ?? {};
2533
2551
  return this.processSender(
@@ -2569,7 +2587,7 @@ class Wt {
2569
2587
  async downgradeResolutionSender(e) {
2570
2588
  const { sender: t, codec: s } = e, i = {
2571
2589
  scaleResolutionDownBy: 200,
2572
- maxBitrate: Ft(s)
2590
+ maxBitrate: $t(s)
2573
2591
  };
2574
2592
  return this.parametersSetter.setEncodingsToSender(t, i);
2575
2593
  }
@@ -2579,7 +2597,7 @@ class Wt {
2579
2597
  * @returns Promise с результатом
2580
2598
  */
2581
2599
  async setBitrateByTrackResolution(e) {
2582
- const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ? $t(i) : X(a, i);
2600
+ const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ? Vt(i) : X(a, i);
2583
2601
  return this.parametersSetter.setEncodingsToSender(t, {
2584
2602
  scaleResolutionDownBy: 1,
2585
2603
  maxBitrate: o
@@ -2595,7 +2613,7 @@ class Wt {
2595
2613
  const [s, i] = e.split("x"), { sender: r, videoTrack: a, codec: o } = t, c = {
2596
2614
  width: Number(s),
2597
2615
  height: Number(i)
2598
- }, d = Vt({
2616
+ }, d = Wt({
2599
2617
  videoTrack: a,
2600
2618
  targetSize: c
2601
2619
  }), u = X(c.width, o), T = {
@@ -2605,14 +2623,14 @@ class Wt {
2605
2623
  return this.parametersSetter.setEncodingsToSender(r, T);
2606
2624
  }
2607
2625
  }
2608
- const Ht = (n) => n.find((e) => e.track?.kind === "video");
2609
- class xt {
2626
+ const xt = (n) => n.find((e) => e.track?.kind === "video");
2627
+ class qt {
2610
2628
  // eslint-disable-next-line @typescript-eslint/class-methods-use-this
2611
2629
  findVideoSender(e) {
2612
- return Ht(e);
2630
+ return xt(e);
2613
2631
  }
2614
2632
  }
2615
- class qt {
2633
+ class Gt {
2616
2634
  currentSender;
2617
2635
  originalReplaceTrack;
2618
2636
  lastWidth;
@@ -2625,7 +2643,7 @@ class qt {
2625
2643
  pollIntervalMs: e = 1e3,
2626
2644
  maxPollIntervalMs: t
2627
2645
  }) {
2628
- this.pollIntervalMs = e, this.maxPollIntervalMs = t ?? e * 16, this.currentPollIntervalMs = this.pollIntervalMs, this.setTimeoutRequest = new Z();
2646
+ this.pollIntervalMs = e, this.maxPollIntervalMs = t ?? e * 16, this.currentPollIntervalMs = this.pollIntervalMs, this.setTimeoutRequest = new ee();
2629
2647
  }
2630
2648
  /**
2631
2649
  * Проверяет актуальный video-sender и (при необходимости) перенастраивает наблюдение.
@@ -2676,7 +2694,7 @@ class qt {
2676
2694
  this.setTimeoutRequest.cancelRequest(), this.lastWidth = void 0, this.lastHeight = void 0;
2677
2695
  }
2678
2696
  }
2679
- class Gt {
2697
+ class Qt {
2680
2698
  apiManager;
2681
2699
  currentHandler;
2682
2700
  constructor(e) {
@@ -2696,7 +2714,7 @@ class Gt {
2696
2714
  this.currentHandler && (this.apiManager.off("main-cam-control", this.currentHandler), this.currentHandler = void 0);
2697
2715
  }
2698
2716
  }
2699
- class Qt {
2717
+ class Yt {
2700
2718
  eventHandler;
2701
2719
  senderBalancer;
2702
2720
  parametersSetterWithQueue;
@@ -2708,16 +2726,16 @@ class Qt {
2708
2726
  onSetParameters: i,
2709
2727
  pollIntervalMs: r
2710
2728
  } = {}) {
2711
- this.getConnection = t, this.eventHandler = new Gt(e), this.parametersSetterWithQueue = new bt(i), this.senderBalancer = new Wt(
2729
+ this.getConnection = t, this.eventHandler = new Qt(e), this.parametersSetterWithQueue = new wt(i), this.senderBalancer = new Ht(
2712
2730
  {
2713
- senderFinder: new xt(),
2714
- codecProvider: new Dt(),
2731
+ senderFinder: new qt(),
2732
+ codecProvider: new yt(),
2715
2733
  parametersSetter: this.parametersSetterWithQueue
2716
2734
  },
2717
2735
  {
2718
2736
  ignoreForCodec: s
2719
2737
  }
2720
- ), this.trackMonitor = new qt({ pollIntervalMs: r });
2738
+ ), this.trackMonitor = new Gt({ pollIntervalMs: r });
2721
2739
  }
2722
2740
  /**
2723
2741
  * Подписывается на события управления главной камерой
@@ -2762,13 +2780,13 @@ class Qt {
2762
2780
  });
2763
2781
  };
2764
2782
  }
2765
- const Ne = [
2783
+ const Ae = [
2766
2784
  "balancing-scheduled",
2767
2785
  "balancing-started",
2768
2786
  "balancing-stopped",
2769
2787
  "parameters-updated"
2770
2788
  ];
2771
- class Yt {
2789
+ class zt {
2772
2790
  isBalancingActive = !1;
2773
2791
  events;
2774
2792
  callManager;
@@ -2776,7 +2794,7 @@ class Yt {
2776
2794
  videoSendingBalancer;
2777
2795
  startBalancingTimer;
2778
2796
  constructor(e, t, s = {}) {
2779
- this.events = new j(Ne), this.callManager = e, this.balancingStartDelay = s.balancingStartDelay ?? 1e4, this.videoSendingBalancer = new Qt(
2797
+ this.events = new j(Ae), this.callManager = e, this.balancingStartDelay = s.balancingStartDelay ?? 1e4, this.videoSendingBalancer = new Yt(
2780
2798
  t,
2781
2799
  () => e.connection,
2782
2800
  {
@@ -2846,18 +2864,19 @@ class Yt {
2846
2864
  this.startBalancingTimer && (clearTimeout(this.startBalancingTimer), this.startBalancingTimer = void 0);
2847
2865
  }
2848
2866
  }
2849
- const zt = 1e6, Jt = he.map((n) => `connection:${n}`), Xt = te.map((n) => `call:${n}`), jt = ie.map((n) => `api:${n}`), Kt = le.map((n) => `incoming-call:${n}`), Zt = ce.map((n) => `presentation:${n}`), en = ue.map((n) => `stats:${n}`), tn = Ne.map((n) => `video-balancer:${n}`), nn = [
2850
- ...Jt,
2867
+ const Jt = 1e6, Xt = ge.map((n) => `connection:${n}`), jt = ne.map((n) => `call:${n}`), Kt = re.map((n) => `api:${n}`), Zt = ue.map((n) => `incoming-call:${n}`), en = de.map((n) => `presentation:${n}`), tn = Te.map((n) => `stats:${n}`), nn = Ae.map((n) => `video-balancer:${n}`), sn = [
2851
2868
  ...Xt,
2852
2869
  ...jt,
2853
2870
  ...Kt,
2854
2871
  ...Zt,
2855
2872
  ...en,
2856
- ...tn
2873
+ ...tn,
2874
+ ...nn
2857
2875
  ];
2858
- class En {
2876
+ class Cn {
2859
2877
  events;
2860
2878
  connectionManager;
2879
+ connectionQueueManager;
2861
2880
  callManager;
2862
2881
  apiManager;
2863
2882
  incomingCallManager;
@@ -2871,16 +2890,18 @@ class En {
2871
2890
  excludeMimeTypesVideoCodecs: s,
2872
2891
  videoBalancerOptions: i
2873
2892
  } = {}) {
2874
- this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events = new D(nn), this.connectionManager = new dt({ JsSIP: e }), this.callManager = new we(), this.apiManager = new $e({
2893
+ this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events = new D(sn), this.connectionManager = new dt({ JsSIP: e }), this.connectionQueueManager = new ht({
2894
+ connectionManager: this.connectionManager
2895
+ }), this.callManager = new we(), this.apiManager = new $e({
2875
2896
  connectionManager: this.connectionManager,
2876
2897
  callManager: this.callManager
2877
- }), this.incomingCallManager = new lt(this.connectionManager), this.presentationManager = new et({
2898
+ }), this.incomingCallManager = new ut(this.connectionManager), this.presentationManager = new et({
2878
2899
  callManager: this.callManager,
2879
- maxBitrate: zt
2880
- }), this.statsManager = new It({
2900
+ maxBitrate: Jt
2901
+ }), this.statsManager = new _t({
2881
2902
  callManager: this.callManager,
2882
2903
  apiManager: this.apiManager
2883
- }), this.videoSendingBalancerManager = new Yt(
2904
+ }), this.videoSendingBalancerManager = new zt(
2884
2905
  this.callManager,
2885
2906
  this.apiManager,
2886
2907
  i
@@ -2944,15 +2965,15 @@ class En {
2944
2965
  off(e, t) {
2945
2966
  this.events.off(e, t);
2946
2967
  }
2947
- connect = async (...e) => this.connectionManager.connect(...e);
2948
- set = async (...e) => this.connectionManager.set(...e);
2949
- disconnect = async () => this.connectionManager.disconnect();
2950
- register = async () => this.connectionManager.register();
2951
- unregister = async () => this.connectionManager.unregister();
2952
- tryRegister = async () => this.connectionManager.tryRegister();
2953
- sendOptions = async (e, t, s) => this.connectionManager.sendOptions(e, t, s);
2954
- ping = async (e, t) => this.connectionManager.ping(e, t);
2955
- checkTelephony = async (e) => this.connectionManager.checkTelephony(e);
2968
+ connect = async (...e) => this.connectionQueueManager.connect(...e);
2969
+ set = async (...e) => this.connectionQueueManager.set(...e);
2970
+ disconnect = async () => this.connectionQueueManager.disconnect();
2971
+ register = async () => this.connectionQueueManager.register();
2972
+ unregister = async () => this.connectionQueueManager.unregister();
2973
+ tryRegister = async () => this.connectionQueueManager.tryRegister();
2974
+ sendOptions = async (e, t, s) => this.connectionQueueManager.sendOptions(e, t, s);
2975
+ ping = async (e, t) => this.connectionQueueManager.ping(e, t);
2976
+ checkTelephony = async (e) => this.connectionQueueManager.checkTelephony(e);
2956
2977
  isConfigured = () => this.connectionManager.isConfigured();
2957
2978
  getConnectionConfiguration = () => this.connectionManager.getConnectionConfiguration();
2958
2979
  getSipServerUrl = (e) => this.connectionManager.getSipServerUrl(e);
@@ -3067,7 +3088,7 @@ class En {
3067
3088
  return this.apiManager.askPermissionToEnableCam(...e);
3068
3089
  }
3069
3090
  setCodecPreferences(e) {
3070
- Pt(e, {
3091
+ ft(e, {
3071
3092
  preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
3072
3093
  excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
3073
3094
  });
@@ -3105,18 +3126,18 @@ class En {
3105
3126
  }
3106
3127
  }
3107
3128
  export {
3108
- se as E,
3129
+ ie as E,
3109
3130
  $ as O,
3110
- En as S,
3131
+ Cn as S,
3111
3132
  Xe as a,
3112
3133
  Fe as b,
3113
3134
  E as c,
3114
- Tn as d,
3115
- un as e,
3116
- Rt as f,
3117
- vt as g,
3118
- Sn as h,
3135
+ Sn as d,
3136
+ Tn as e,
3137
+ It as f,
3138
+ Dt as g,
3139
+ En as h,
3119
3140
  R as l,
3120
3141
  B as p,
3121
- oe as s
3142
+ ce as s
3122
3143
  };