fcr-core 3.8.0-alpha → 3.8.1-alpha

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.
Files changed (60) hide show
  1. package/lib/chat-connection/index.js +26 -40
  2. package/lib/engine/index.js +72 -66
  3. package/lib/imports.js +0 -1
  4. package/lib/media-control/desktop.js +13 -18
  5. package/lib/media-control/mobile.js +13 -18
  6. package/lib/monitor-control/index.js +5 -10
  7. package/lib/peer-session/index.js +39 -47
  8. package/lib/plugins/chatroom.js +213 -229
  9. package/lib/room-control/ability-control/index.js +9 -14
  10. package/lib/room-control/group-control/index.js +16 -21
  11. package/lib/room-control/helpers/validation-helper.js +1 -1
  12. package/lib/room-control/index.js +36 -53
  13. package/lib/room-control/interpreter-control/index.js +34 -47
  14. package/lib/room-control/interpreter-control/room.js +4 -6
  15. package/lib/room-control/join-before-host-waitingroom-control/index.js +4 -6
  16. package/lib/room-control/mainroom-control/index.js +27 -35
  17. package/lib/room-control/privilege-control/helper.js +5 -8
  18. package/lib/room-control/privilege-control/index.js +19 -26
  19. package/lib/room-control/room-connector-control/index.js +19 -28
  20. package/lib/room-control/room-control-factory.js +1 -2
  21. package/lib/room-control/room-session/index.js +39 -46
  22. package/lib/room-control/shared-cache.js +29 -36
  23. package/lib/room-control/sharing-control/index.d.ts +1 -1
  24. package/lib/room-control/sharing-control/index.js +34 -42
  25. package/lib/room-control/stream-control/index.js +191 -195
  26. package/lib/room-control/stream-control/type.d.ts +1 -1
  27. package/lib/room-control/stt-control/de-compress-gzip.js +0 -10
  28. package/lib/room-control/stt-control/index.js +95 -98
  29. package/lib/room-control/stt-control/type.d.ts +1 -1
  30. package/lib/room-control/user-control/index.js +136 -143
  31. package/lib/room-control/waitingroom-control/index.js +9 -14
  32. package/lib/room-control/whiteboard-control/utils.js +2 -4
  33. package/lib/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
  34. package/lib/room-control/whiteboard-control-v1/board-window.js +88 -99
  35. package/lib/room-control/whiteboard-control-v1/factory.js +4 -7
  36. package/lib/room-control/whiteboard-control-v1/index.js +28 -40
  37. package/lib/room-control/whiteboard-control-v1/mount-manager.js +2 -4
  38. package/lib/room-control/whiteboard-control-v1/utils.js +14 -17
  39. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +4 -6
  40. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +5 -10
  41. package/lib/room-control/whiteboard-control-v2/base/index.js +34 -41
  42. package/lib/room-control/whiteboard-control-v2/base/main-window.js +24 -29
  43. package/lib/room-control/whiteboard-control-v2/utils.js +6 -7
  44. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +0 -1
  45. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +23 -34
  46. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +7 -14
  47. package/lib/room-router/index.js +47 -53
  48. package/lib/room-router/type.d.ts +2 -2
  49. package/lib/service/api.js +227 -250
  50. package/lib/utilities/collection.js +2 -3
  51. package/lib/utilities/error-helpers.js +27 -34
  52. package/lib/utilities/error.js +8 -9
  53. package/lib/utilities/join-helper.js +25 -32
  54. package/lib/utilities/logger.js +3 -6
  55. package/lib/utilities/parameters.js +4 -8
  56. package/lib/utilities/retry-helpers.js +0 -1
  57. package/lib/utilities/stream.js +11 -16
  58. package/lib/utilities/user.js +3 -4
  59. package/lib/utilities/validate-params.js +1 -2
  60. package/package.json +5 -6
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.description.js");
4
- require("core-js/modules/es.error.cause.js");
5
3
  require("core-js/modules/esnext.function.metadata.js");
6
4
  require("core-js/modules/esnext.symbol.metadata.js");
7
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -27,29 +25,30 @@ require("core-js/modules/esnext.map.merge.js");
27
25
  require("core-js/modules/esnext.map.reduce.js");
28
26
  require("core-js/modules/esnext.map.some.js");
29
27
  require("core-js/modules/esnext.map.update.js");
30
- require("core-js/modules/web.dom-collections.iterator.js");
31
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
32
28
  var _imports = require("../../imports");
33
29
  var _user = require("../../utilities/user");
34
30
  var _logger = require("../../utilities/logger");
35
31
  var _error = require("../../utilities/error");
36
32
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
37
33
  var _schema = require("../../schema");
38
- var _FcrGroupControl;
39
- let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs, _ref;
34
+ let _initProto, _getGroupUserListDecs, _addGroupsDecs, _updateGroupsDecs, _deleteGroupsDecs, _addUsersDecs, _removeUsersDecs, _moveUsersDecs;
40
35
  function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
41
36
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
42
37
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
43
38
  function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
44
39
  function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
45
- _ref = (_getGroupUserListDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _addGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _addUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _removeUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _moveUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema, _schema.stringSchema)], "logger");
46
40
  class FcrGroupControl {
41
+ static {
42
+ [_initProto] = _applyDecs(this, [[_imports.trace, 2, "getGroupList"], [_getGroupUserListDecs, 2, "getGroupUserList"], [_addGroupsDecs, 2, "addGroups"], [_updateGroupsDecs, 2, "updateGroups"], [_deleteGroupsDecs, 2, "deleteGroups"], [_imports.trace, 2, "deleteAllGroups"], [_addUsersDecs, 2, "addUsers"], [_removeUsersDecs, 2, "removeUsers"], [_moveUsersDecs, 2, "moveUsers"]], []).e;
43
+ }
44
+ //@internal
45
+ [(_getGroupUserListDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _addGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupCreateConfigArraySchema)], _updateGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrGroupUpdateOptionsArraySchema)], _deleteGroupsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _addUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _removeUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema)], _moveUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema, _schema.stringSchema, _schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
46
+ prefix: 'FcrGroupControl'
47
+ }));
48
+ //@internal
49
+
50
+ _observable = new _imports.AgoraObservable();
47
51
  constructor(_engine, _scene, _api, _sharedCache) {
48
- //@internal
49
- (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
50
- prefix: 'FcrGroupControl'
51
- })));
52
- (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
53
52
  this._engine = _engine;
54
53
  this._scene = _scene;
55
54
  this._api = _api;
@@ -61,8 +60,7 @@ class FcrGroupControl {
61
60
  _addSceneObserver() {
62
61
  const observer = {
63
62
  onScenePropertiesUpdated: (sceneId, event) => {
64
- var _event$cause;
65
- if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 11) {
63
+ if (event.cause?.cmd === 11) {
66
64
  const data = event.cause.data;
67
65
  const changedProperties = event.changedProperties;
68
66
  const groupDetails = changedProperties.groups.details;
@@ -90,8 +88,7 @@ class FcrGroupControl {
90
88
  this._observable.notifyObservers('onGroupsUpdated', groupEvents);
91
89
  }
92
90
  if (data.actionType === 4) {
93
- var _data$changeGroups, _data$changeGroups2, _data$changeGroups3;
94
- (_data$changeGroups = data.changeGroups) === null || _data$changeGroups === void 0 || _data$changeGroups.forEach(group => {
91
+ data.changeGroups?.forEach(group => {
95
92
  const {
96
93
  removeUsers,
97
94
  groupUuid
@@ -112,7 +109,7 @@ class FcrGroupControl {
112
109
  }
113
110
  });
114
111
  const toGroupMap = new Map();
115
- (_data$changeGroups2 = data.changeGroups) === null || _data$changeGroups2 === void 0 || _data$changeGroups2.forEach(group => {
112
+ data.changeGroups?.forEach(group => {
116
113
  const {
117
114
  removeUsers
118
115
  } = group;
@@ -155,7 +152,7 @@ class FcrGroupControl {
155
152
  };
156
153
  }));
157
154
  });
158
- (_data$changeGroups3 = data.changeGroups) === null || _data$changeGroups3 === void 0 || _data$changeGroups3.forEach(group => {
155
+ data.changeGroups?.forEach(group => {
159
156
  const {
160
157
  addUsers,
161
158
  groupUuid
@@ -262,6 +259,4 @@ class FcrGroupControl {
262
259
  this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onGroupsAdded', 'onGroupsUpdated', 'onGroupsRemoved', 'onUserListAddedToGroup', 'onUserListRemovedFromGroup', 'onUserListMoveToGroup']));
263
260
  }
264
261
  }
265
- exports.FcrGroupControl = FcrGroupControl;
266
- _FcrGroupControl = FcrGroupControl;
267
- [_initProto] = _applyDecs(_FcrGroupControl, [[_imports.trace, 2, "getGroupList"], [_getGroupUserListDecs, 2, "getGroupUserList"], [_addGroupsDecs, 2, "addGroups"], [_updateGroupsDecs, 2, "updateGroups"], [_deleteGroupsDecs, 2, "deleteGroups"], [_imports.trace, 2, "deleteAllGroups"], [_addUsersDecs, 2, "addUsers"], [_removeUsersDecs, 2, "removeUsers"], [_moveUsersDecs, 2, "moveUsers"]], []).e;
262
+ exports.FcrGroupControl = FcrGroupControl;
@@ -33,7 +33,7 @@ function validateControllerInitialized(controller, controllerType) {
33
33
  */
34
34
  function validateRoomJoined(joinRoomSuccess, operation) {
35
35
  if (!joinRoomSuccess) {
36
- throw _errorHelpers.roomControlErrorHelper.createOperationError("".concat(operation, ", please join room first"));
36
+ throw _errorHelpers.roomControlErrorHelper.createOperationError(`${operation}, please join room first`);
37
37
  }
38
38
  }
39
39
 
@@ -1,12 +1,7 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.description.js");
4
- require("core-js/modules/es.error.cause.js");
5
3
  require("core-js/modules/es.array.push.js");
6
4
  require("core-js/modules/esnext.function.metadata.js");
7
- require("core-js/modules/esnext.iterator.constructor.js");
8
- require("core-js/modules/esnext.iterator.filter.js");
9
- require("core-js/modules/esnext.iterator.for-each.js");
10
5
  require("core-js/modules/esnext.map.delete-all.js");
11
6
  require("core-js/modules/esnext.map.emplace.js");
12
7
  require("core-js/modules/esnext.map.every.js");
@@ -22,13 +17,10 @@ require("core-js/modules/esnext.map.reduce.js");
22
17
  require("core-js/modules/esnext.map.some.js");
23
18
  require("core-js/modules/esnext.map.update.js");
24
19
  require("core-js/modules/esnext.symbol.metadata.js");
25
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
26
20
  Object.defineProperty(exports, "__esModule", {
27
21
  value: true
28
22
  });
29
23
  exports.FcrSubRoomControlImpl = exports.FcrBaseRoomControlImpl = void 0;
30
- require("core-js/modules/web.dom-collections.iterator.js");
31
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
32
24
  var _imports = require("../imports");
33
25
  var _type = require("../type");
34
26
  var _type2 = require("./type");
@@ -46,7 +38,6 @@ var _2 = require("..");
46
38
  var _helpers = require("./helpers");
47
39
  var _errorHelpers = require("../utilities/error-helpers");
48
40
  var _sttControl = require("./stt-control");
49
- var _FcrBaseRoomControlImpl;
50
41
  let _initProto; // Core SDK imports
51
42
  // Service and API imports
52
43
  // Type definitions
@@ -55,8 +46,6 @@ let _initProto; // Core SDK imports
55
46
  // Error handling and utilities
56
47
  // Core state
57
48
  // Helpers and utilities
58
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
59
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
60
49
  function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
61
50
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
62
51
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -71,15 +60,18 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
71
60
  * @internal
72
61
  */
73
62
  class FcrBaseRoomControlImpl {
63
+ static {
64
+ [_initProto] = _applyDecs(this, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_imports.trace, 2, "start"], [_imports.trace, 2, "end"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getRoomState"], [_imports.trace, 2, "getRoomProperties"], [_imports.trace, 2, "getRoomPropertiesByKeyPath"], [_imports.trace, 2, "updateRoomProperties"], [_imports.trace, 2, "updateIncrementRoomProperties"], [_imports.trace, 2, "deleteRoomProperties"], [_imports.trace, 2, "startCloudRecording"], [_imports.trace, 2, "pauseCloudRecording"], [_imports.trace, 2, "resumeCloudRecording"], [_imports.trace, 2, "stopCloudRecording"], [_imports.trace, 2, "getLiveStreamingState"], [_imports.trace, 2, "getLiveStreamingConfig"], [_imports.trace, 2, "startLiveStreaming"], [_imports.trace, 2, "updateLiveStreamingLayout"], [_imports.trace, 2, "stopLiveStreaming"], [_imports.trace, 2, "getCloudRecordingState"], [_imports.trace, 2, "sendRoomMessage"]], []).e;
65
+ }
66
+ //@internal
67
+ logger = (_initProto(this), (0, _logger.createLogger)({
68
+ prefix: 'FcrBaseRoomControlImpl'
69
+ }));
70
+ _observable = new _imports.AgoraObservable();
71
+ _joinRoomSuccess = false;
72
+ _joining = false;
73
+ _joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
74
74
  constructor(_engine, _scene, _api, _config, _roomType, _chatConnection, _sharedCache, _chatRoomControl) {
75
- //@internal
76
- (0, _defineProperty2.default)(this, "logger", (_initProto(this), (0, _logger.createLogger)({
77
- prefix: 'FcrBaseRoomControlImpl'
78
- })));
79
- (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
80
- (0, _defineProperty2.default)(this, "_joinRoomSuccess", false);
81
- (0, _defineProperty2.default)(this, "_joining", false);
82
- (0, _defineProperty2.default)(this, "_joinState", _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED);
83
75
  this._engine = _engine;
84
76
  this._scene = _scene;
85
77
  this._api = _api;
@@ -103,9 +95,8 @@ class FcrBaseRoomControlImpl {
103
95
  };
104
96
  this._sceneObserver = {
105
97
  onJoinSceneSuccess: (sceneId, localUser) => {
106
- var _this$_chatRoomContro;
107
98
  this._joinRoomSuccess = true;
108
- (_this$_chatRoomContro = this._chatRoomControl) === null || _this$_chatRoomContro === void 0 || _this$_chatRoomContro.join();
99
+ this._chatRoomControl?.join();
109
100
  this._userControl = new _userControl.FcrUserControlImpl(this._scene, this._api, this._sharedCache);
110
101
  this._streamControl = new _streamControl.FcrStreamControlImpl(this._engine, this._scene, this._api, this._sharedCache);
111
102
  this._roomSessionControl = new _roomSession.FcrRoomSessionControlImpl(this, this._api, localUser.getLocalUserId());
@@ -137,25 +128,22 @@ class FcrBaseRoomControlImpl {
137
128
  this._observable.notifyObservers('onRoomMessageReceived', sceneId, message);
138
129
  const payload = message.payload;
139
130
  if (message.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_ROUTE_SWITCH) {
140
- var _this$_userControl;
141
- const localUserRole = (_this$_userControl = this._userControl) === null || _this$_userControl === void 0 ? void 0 : _this$_userControl.getLocalUser().userRole;
131
+ const localUserRole = this._userControl?.getLocalUser().userRole;
142
132
  if (localUserRole && payload.targetRoles.includes(_type.FcrUserRoleToStringMap[localUserRole])) {
143
- var _this$_userControl2;
144
133
  this._observable.notifyObservers('onRoomRouteSwitched', {
145
134
  targetRouting: {
146
135
  roomId: payload.toRoom.roomUuid,
147
136
  roomType: payload.toRoom.roomType,
148
137
  isJoined: false
149
138
  },
150
- operatorUser: (_this$_userControl2 = this._userControl) === null || _this$_userControl2 === void 0 ? void 0 : _this$_userControl2.getUser(message.senderId)
139
+ operatorUser: this._userControl?.getUser(message.senderId)
151
140
  });
152
141
  this.leave();
153
142
  }
154
143
  }
155
144
  },
156
145
  onScenePropertiesUpdated: async (sceneId, event) => {
157
- var _event$cause, _event$cause2, _event$cause3, _event$cause4;
158
- if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.CLOUD_RECORDING) {
146
+ if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.CLOUD_RECORDING) {
159
147
  const {
160
148
  state,
161
149
  ready,
@@ -164,7 +152,7 @@ class FcrBaseRoomControlImpl {
164
152
  const recordState = this._formatRecordingState(state, ready, onhold);
165
153
  this._observable.notifyObservers('onCloudRecordingStateUpdated', sceneId, recordState);
166
154
  }
167
- if (((_event$cause2 = event.cause) === null || _event$cause2 === void 0 ? void 0 : _event$cause2.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_STATE_UPDATE) {
155
+ if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_STATE_UPDATE) {
168
156
  const schedule = event.changedProperties.schedule;
169
157
  if (schedule.state === _helpers.ROOM_STATE_VALUES.ENDED) {
170
158
  this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
@@ -172,7 +160,7 @@ class FcrBaseRoomControlImpl {
172
160
  }
173
161
  this._observable.notifyObservers('onRoomStateUpdated', sceneId, schedule.state);
174
162
  }
175
- if (((_event$cause3 = event.cause) === null || _event$cause3 === void 0 ? void 0 : _event$cause3.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
163
+ if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
176
164
  const changedProperties = {};
177
165
  for (const key in event.changedProperties) {
178
166
  if (key.startsWith('flexProps')) {
@@ -181,17 +169,17 @@ class FcrBaseRoomControlImpl {
181
169
  }
182
170
  if (Object.keys(changedProperties).length > 0) {
183
171
  const structure = (0, _collection.convertToStructure)(changedProperties);
184
- this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, _objectSpread(_objectSpread({}, event), {}, {
172
+ this._observable.notifyObservers('onRoomPropertiesUpdated', sceneId, {
173
+ ...event,
185
174
  changedProperties: structure['flexProps']
186
- }));
175
+ });
187
176
  }
188
177
  }
189
- if (((_event$cause4 = event.cause) === null || _event$cause4 === void 0 ? void 0 : _event$cause4.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.LIVE_STREAMING_UPDATE) {
190
- var _event$cause5;
178
+ if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.LIVE_STREAMING_UPDATE) {
191
179
  let liveStreamingState = _type.FcrLiveStreamingState.STOPPED;
192
180
  let state = this._scene.getScenePropertiesByKeyPath('live.state');
193
181
  let pageUrl = this._scene.getScenePropertiesByKeyPath('live.pageUrl');
194
- const reason = (_event$cause5 = event.cause) === null || _event$cause5 === void 0 || (_event$cause5 = _event$cause5.data) === null || _event$cause5 === void 0 ? void 0 : _event$cause5.reason;
182
+ const reason = event.cause?.data?.reason;
195
183
  if (state === _helpers.LIVE_STREAMING_STATE_VALUES.STARTED) {
196
184
  liveStreamingState = _type.FcrLiveStreamingState.STARTED;
197
185
  }
@@ -202,8 +190,7 @@ class FcrBaseRoomControlImpl {
202
190
  }
203
191
  },
204
192
  onScenePropertiesDeleted: (sceneId, event) => {
205
- var _event$cause6;
206
- if (((_event$cause6 = event.cause) === null || _event$cause6 === void 0 ? void 0 : _event$cause6.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
193
+ if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.ROOM_PROPERTIES_UPDATE) {
207
194
  this._observable.notifyObservers('onRoomPropertiesDeleted', sceneId, event);
208
195
  }
209
196
  },
@@ -214,8 +201,7 @@ class FcrBaseRoomControlImpl {
214
201
  this._observable.notifyObservers('onNetworkStatsUpdated', sceneId, stats);
215
202
  },
216
203
  onUserPropertiesUpdated: (_, event) => {
217
- var _event$cause7;
218
- if (((_event$cause7 = event.cause) === null || _event$cause7 === void 0 ? void 0 : _event$cause7.cmd) === _helpers.ROOM_MESSAGE_COMMANDS.USER_KICK_OUT && event.modifiedUser.userId === this._scene.localUser.getLocalUserId()) {
204
+ if (event.cause?.cmd === _helpers.ROOM_MESSAGE_COMMANDS.USER_KICK_OUT && event.modifiedUser.userId === this._scene.localUser.getLocalUserId()) {
219
205
  this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
220
206
  this._cleanup();
221
207
  }
@@ -317,17 +303,16 @@ class FcrBaseRoomControlImpl {
317
303
  * @returns 房间信息,如果未加入房间则返回 undefined
318
304
  */
319
305
  getRoomInfo() {
320
- var _userProperties$info, _passwordInfo$payload;
321
306
  const sceneInfo = this._scene.getSceneInfo();
322
307
  const passwordInfo = this._scene.getScenePropertiesByKeyPath('security.password');
323
308
  const userProperties = this._scene.getUserPropertiesByUserId(this._scene.localUser.getLocalUserId());
324
- const shareLink = userProperties === null || userProperties === void 0 || (_userProperties$info = userProperties.info) === null || _userProperties$info === void 0 ? void 0 : _userProperties$info.shareLink;
309
+ const shareLink = userProperties?.info?.shareLink;
325
310
  const label = this._scene.getScenePropertiesByKeyPath('label');
326
311
  return sceneInfo ? {
327
312
  roomId: sceneInfo.sceneId,
328
313
  roomName: sceneInfo.sceneName,
329
314
  roomType: this._roomType,
330
- password: passwordInfo === null || passwordInfo === void 0 || (_passwordInfo$payload = passwordInfo.payload) === null || _passwordInfo$payload === void 0 ? void 0 : _passwordInfo$payload.text,
315
+ password: passwordInfo?.payload?.text,
331
316
  inviteLink: shareLink,
332
317
  label
333
318
  } : void 0;
@@ -340,13 +325,13 @@ class FcrBaseRoomControlImpl {
340
325
  * @throws {FcrError} 如果未加入房间
341
326
  */
342
327
  getRoomSchedule() {
343
- var _schedule$duration, _schedule$startTime;
344
328
  (0, _helpers.validateRoomJoined)(this._joinRoomSuccess, 'get schedule info');
345
329
  const schedule = this._scene.getScenePropertiesByKeyPath('schedule');
346
- return _objectSpread(_objectSpread({}, schedule), {}, {
347
- duration: (_schedule$duration = schedule.duration) !== null && _schedule$duration !== void 0 ? _schedule$duration : 0,
348
- startTime: Math.floor(((_schedule$startTime = schedule.startTime) !== null && _schedule$startTime !== void 0 ? _schedule$startTime : 0) / 1000)
349
- });
330
+ return {
331
+ ...schedule,
332
+ duration: schedule.duration ?? 0,
333
+ startTime: Math.floor((schedule.startTime ?? 0) / 1000)
334
+ };
350
335
  }
351
336
  /**
352
337
  * 加入房间
@@ -431,7 +416,7 @@ class FcrBaseRoomControlImpl {
431
416
  async _handleRobotUserSetup(options) {
432
417
  if (options.userRole === _type.FcrUserRole.ROBOT) {
433
418
  const res = (0, _error.handleRequestError)(() => this._api.setCloudRecordingReady(this._scene.sceneId), _error.FcrErrorModuleCode.ROOM, 'set cloud recording ready failed');
434
- this.logger.info("set cloud recording ready, response: ".concat((0, _imports.jsonstring)(res)));
419
+ this.logger.info(`set cloud recording ready, response: ${(0, _imports.jsonstring)(res)}`);
435
420
  }
436
421
  }
437
422
 
@@ -440,7 +425,7 @@ class FcrBaseRoomControlImpl {
440
425
  * @private
441
426
  */
442
427
  _handleJoinFailure(error) {
443
- this.logger.error("failed to join room: ".concat(error.message));
428
+ this.logger.error(`failed to join room: ${error.message}`);
444
429
  this._observable.notifyObservers('onJoinRoomFailure', this._scene.sceneId, error);
445
430
  }
446
431
 
@@ -580,9 +565,9 @@ class FcrBaseRoomControlImpl {
580
565
  this._scene.removeObserver(this._sceneObserver);
581
566
  this._engine.removeObserver(this._engineObserver);
582
567
  try {
583
- var _this$_chatRoomContro2, _this$sharingControl, _this$sharingControl2;
584
- return await Promise.all([// @ts-ignore
585
- (_this$_chatRoomContro2 = this._chatRoomControl) === null || _this$_chatRoomContro2 === void 0 ? void 0 : _this$_chatRoomContro2.leave(), (_this$sharingControl = this.sharingControl) === null || _this$sharingControl === void 0 ? void 0 : _this$sharingControl.getBoardControl().close(), (_this$sharingControl2 = this.sharingControl) === null || _this$sharingControl2 === void 0 ? void 0 : _this$sharingControl2.getAnnotationControl().close(), this._scene.leave()]);
568
+ return await Promise.all([
569
+ // @ts-ignore
570
+ this._chatRoomControl?.leave(), this.sharingControl?.getBoardControl().close(), this.sharingControl?.getAnnotationControl().close(), this._scene.leave()]);
586
571
  } finally {
587
572
  this._joinRoomSuccess = false;
588
573
  }
@@ -619,7 +604,5 @@ class FcrBaseRoomControlImpl {
619
604
  * @internal
620
605
  */
621
606
  exports.FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
622
- _FcrBaseRoomControlImpl = FcrBaseRoomControlImpl;
623
- [_initProto] = _applyDecs(_FcrBaseRoomControlImpl, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_imports.trace, 2, "start"], [_imports.trace, 2, "end"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getRoomState"], [_imports.trace, 2, "getRoomProperties"], [_imports.trace, 2, "getRoomPropertiesByKeyPath"], [_imports.trace, 2, "updateRoomProperties"], [_imports.trace, 2, "updateIncrementRoomProperties"], [_imports.trace, 2, "deleteRoomProperties"], [_imports.trace, 2, "startCloudRecording"], [_imports.trace, 2, "pauseCloudRecording"], [_imports.trace, 2, "resumeCloudRecording"], [_imports.trace, 2, "stopCloudRecording"], [_imports.trace, 2, "getLiveStreamingState"], [_imports.trace, 2, "getLiveStreamingConfig"], [_imports.trace, 2, "startLiveStreaming"], [_imports.trace, 2, "updateLiveStreamingLayout"], [_imports.trace, 2, "stopLiveStreaming"], [_imports.trace, 2, "getCloudRecordingState"], [_imports.trace, 2, "sendRoomMessage"]], []).e;
624
607
  class FcrSubRoomControlImpl extends FcrBaseRoomControlImpl {}
625
608
  exports.FcrSubRoomControlImpl = FcrSubRoomControlImpl;
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.description.js");
4
- require("core-js/modules/es.error.cause.js");
5
3
  require("core-js/modules/es.array.push.js");
6
4
  require("core-js/modules/esnext.function.metadata.js");
7
5
  require("core-js/modules/esnext.map.delete-all.js");
@@ -26,8 +24,6 @@ Object.defineProperty(exports, "__esModule", {
26
24
  exports.FcrInterpreterControlImpl = void 0;
27
25
  require("core-js/modules/esnext.iterator.constructor.js");
28
26
  require("core-js/modules/esnext.iterator.map.js");
29
- require("core-js/modules/web.dom-collections.iterator.js");
30
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
31
27
  var _imports = require("../../imports");
32
28
  var _room = require("./room");
33
29
  var _types = require("./types");
@@ -36,25 +32,26 @@ var _logger = require("../../utilities/logger");
36
32
  var _error = require("../../utilities/error");
37
33
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
38
34
  var _schema = require("../../schema");
39
- var _FcrInterpreterControlImpl;
40
- let _initProto, _createRoomControlDecs, _setInterpreterUsersDecs, _ref;
35
+ let _initProto, _createRoomControlDecs, _setInterpreterUsersDecs;
41
36
  function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
42
37
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
43
38
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
44
39
  function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
45
40
  function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
46
- _ref = (_createRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setInterpreterUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrInterpreterUsersParamsArraySchema)], "logger");
47
41
  /**
48
42
  * @internal
49
43
  */
50
44
  class FcrInterpreterControlImpl {
45
+ static {
46
+ [_initProto] = _applyDecs(this, [[_createRoomControlDecs, 2, "createRoomControl"], [_setInterpreterUsersDecs, 2, "setInterpreterUsers"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getState"], [_imports.trace, 2, "getInterpreterRoomList"], [_imports.trace, 2, "getInterpreterLanguageList"]], []).e;
47
+ }
48
+ //@internal
49
+ [(_createRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setInterpreterUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrInterpreterUsersParamsArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
50
+ prefix: 'FcrInterpreterControlImpl'
51
+ }));
52
+ _observable = new _imports.AgoraObservable();
53
+ _interpreterUserList = null;
51
54
  constructor(_api, _scene, _config, _engine, _chatConnection, _sharedCache) {
52
- //@internal
53
- (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
54
- prefix: 'FcrInterpreterControlImpl'
55
- })));
56
- (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
57
- (0, _defineProperty2.default)(this, "_interpreterUserList", null);
58
55
  this._api = _api;
59
56
  this._scene = _scene;
60
57
  this._config = _config;
@@ -75,12 +72,11 @@ class FcrInterpreterControlImpl {
75
72
  await (0, _error.handleRequestError)(() => this._api.openInterpreter({
76
73
  roomId: this._roomId,
77
74
  data: {
78
- interpreters: params.map(_ref2 => {
79
- let {
80
- userId: userUuid,
81
- sourceLanguage,
82
- targetLanguage
83
- } = _ref2;
75
+ interpreters: params.map(({
76
+ userId: userUuid,
77
+ sourceLanguage,
78
+ targetLanguage
79
+ }) => {
84
80
  return {
85
81
  userUuid,
86
82
  languagePair: [sourceLanguage, targetLanguage]
@@ -102,16 +98,13 @@ class FcrInterpreterControlImpl {
102
98
  }
103
99
  getInterpreterRoomList() {
104
100
  const rooms = this._scene.getScenePropertiesByKeyPath('interpreter.rooms') || [];
105
- return rooms.length > 0 ? rooms.map(_ref3 => {
106
- let {
107
- roomUuid,
108
- language
109
- } = _ref3;
110
- return {
111
- roomId: roomUuid,
112
- language
113
- };
114
- }) : null;
101
+ return rooms.length > 0 ? rooms.map(({
102
+ roomUuid,
103
+ language
104
+ }) => ({
105
+ roomId: roomUuid,
106
+ language
107
+ })) : null;
115
108
  }
116
109
  _setInterpreterUserList() {
117
110
  const interpreter = this._scene.getScenePropertiesByKeyPath('interpreter');
@@ -120,19 +113,16 @@ class FcrInterpreterControlImpl {
120
113
  } = interpreter || {
121
114
  translates: []
122
115
  };
123
- const results = translates.map(_ref4 => {
124
- let {
125
- userUuid: userId,
126
- userName,
127
- languagePair: [sourceLanguage, targetLanguage]
128
- } = _ref4;
129
- return {
130
- userId,
131
- userName,
132
- sourceLanguage,
133
- targetLanguage
134
- };
135
- });
116
+ const results = translates.map(({
117
+ userUuid: userId,
118
+ userName,
119
+ languagePair: [sourceLanguage, targetLanguage]
120
+ }) => ({
121
+ userId,
122
+ userName,
123
+ sourceLanguage,
124
+ targetLanguage
125
+ }));
136
126
  this._interpreterUserList = results.length > 0 ? results : null;
137
127
  }
138
128
  getInterpreterUserList() {
@@ -151,8 +141,7 @@ class FcrInterpreterControlImpl {
151
141
  _addInterpreterObservers() {
152
142
  this._scene.addObserver({
153
143
  onScenePropertiesUpdated: (_, event) => {
154
- var _event$cause;
155
- if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 800) {
144
+ if (event.cause?.cmd === 800) {
156
145
  const actionType = (0, _imports.get)(event.cause.data, 'actionType');
157
146
  let operatorUser;
158
147
  if (event.operatorUser) {
@@ -183,6 +172,4 @@ class FcrInterpreterControlImpl {
183
172
  this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onInterpreterStateUpdated', 'onInterpreterUsersUpdated', 'onInterpreterRoomListUpdated']));
184
173
  }
185
174
  }
186
- exports.FcrInterpreterControlImpl = FcrInterpreterControlImpl;
187
- _FcrInterpreterControlImpl = FcrInterpreterControlImpl;
188
- [_initProto] = _applyDecs(_FcrInterpreterControlImpl, [[_createRoomControlDecs, 2, "createRoomControl"], [_setInterpreterUsersDecs, 2, "setInterpreterUsers"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getState"], [_imports.trace, 2, "getInterpreterRoomList"], [_imports.trace, 2, "getInterpreterLanguageList"]], []).e;
175
+ exports.FcrInterpreterControlImpl = FcrInterpreterControlImpl;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.FcrInterpreterRoomControlImpl = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _ = require("..");
10
8
  var _type = require("../type");
11
9
  var _logger = require("../../utilities/logger");
@@ -13,12 +11,12 @@ var _logger = require("../../utilities/logger");
13
11
  * @internal
14
12
  */
15
13
  class FcrInterpreterRoomControlImpl extends _.FcrBaseRoomControlImpl {
14
+ //@internal
15
+ logger = (0, _logger.createLogger)({
16
+ prefix: 'FcrInterpreterRoomControlImpl'
17
+ });
16
18
  constructor(_engine, _scene, _api, _config, _sharedCache, _chatConnection, chatRoomControl) {
17
19
  super(_engine, _scene, _api, _config, _type.FcrRoomType.Interpreterroom, _chatConnection, _sharedCache, chatRoomControl);
18
- //@internal
19
- (0, _defineProperty2.default)(this, "logger", (0, _logger.createLogger)({
20
- prefix: 'FcrInterpreterRoomControlImpl'
21
- }));
22
20
  this._engine = _engine;
23
21
  this._scene = _scene;
24
22
  this._api = _api;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.FcrJoinBeforeHostWaitingRoomControlImpl = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _ = require("..");
10
8
  var _type = require("../type");
11
9
  var _logger = require("../../utilities/logger");
@@ -13,12 +11,12 @@ var _logger = require("../../utilities/logger");
13
11
  * @internal
14
12
  */
15
13
  class FcrJoinBeforeHostWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
14
+ //@internal
15
+ logger = (0, _logger.createLogger)({
16
+ prefix: 'FcrJoinBeforeHostWaitingRoomControlImpl'
17
+ });
16
18
  constructor(engine, scene, api, config, sharedCache, chatConnection, chatRoomControl) {
17
19
  super(engine, scene, api, config, _type.FcrRoomType.JoinBeforeHostWaitingRoom, chatConnection, sharedCache, chatRoomControl);
18
- //@internal
19
- (0, _defineProperty2.default)(this, "logger", (0, _logger.createLogger)({
20
- prefix: 'FcrJoinBeforeHostWaitingRoomControlImpl'
21
- }));
22
20
  this._addLogObserver();
23
21
  }
24
22
  addObserver(observer) {