fcr-ui-scene 3.9.0-alpha → 3.9.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.
- package/lib/creator/provider-initializer.browser.js +4 -2
- package/lib/creator/provider-initializer.electron.js +13 -5
- package/lib/electron/injections.d.ts +1 -0
- package/lib/electron/injections.js +4 -1
- package/lib/electron/preload.js +1 -0
- package/lib/fragments/annotation/style.css +1 -0
- package/lib/fragments/whiteboard/style.css +4 -0
- package/lib/modules/action-bar/main-scene/store.base.d.ts +1 -0
- package/lib/modules/action-bar/main-scene/store.base.js +5 -0
- package/lib/modules/audio-stream/index.d.ts +2 -0
- package/lib/modules/audio-stream/index.js +33 -1
- package/lib/modules/chat/chat-room-store.js +4 -2
- package/lib/modules/chat/index.js +1 -1
- package/lib/modules/chat/store.d.ts +1 -1
- package/lib/modules/chat/store.js +4 -2
- package/lib/modules/components/device-control/store.base.d.ts +1 -0
- package/lib/modules/components/device-control/store.base.js +22 -3
- package/lib/modules/components/leave-meeting/index.js +3 -2
- package/lib/modules/components/leave-meeting/main-scene/store.d.ts +1 -0
- package/lib/modules/components/leave-meeting/main-scene/store.js +6 -1
- package/lib/modules/components/leave-meeting/store.base.d.ts +1 -0
- package/lib/modules/components/leave-meeting/store.base.js +1 -1
- package/lib/modules/components/leave-meeting/waiting-scene/store.d.ts +1 -0
- package/lib/modules/components/leave-meeting/waiting-scene/store.js +6 -1
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +7 -10
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +2 -2
- package/lib/modules/components/member-window/components/member-actions/index.js +0 -7
- package/lib/modules/components/member-window/components/member-actions/store.js +1 -1
- package/lib/modules/components/member-window/index.js +1 -1
- package/lib/modules/components/tab-frame/index.css +12 -1
- package/lib/modules/components/tab-frame/index.js +4 -1
- package/lib/modules/control-bar/components/share-state-nav/index.js +1 -3
- package/lib/modules/control-bar/mouse-event-bridge.d.ts +23 -0
- package/lib/modules/control-bar/mouse-event-bridge.js +87 -0
- package/lib/modules/control-bar/store.d.ts +3 -2
- package/lib/modules/control-bar/store.js +17 -29
- package/lib/modules/control-bar/type.d.ts +0 -1
- package/lib/modules/control-bar/view.js +21 -17
- package/lib/modules/dialog/dialogs/connection-gateway/tabs.js +3 -2
- package/lib/modules/dialog/dialogs/invite/index.js +6 -24
- package/lib/modules/invite/components/copy-info.css +72 -0
- package/lib/modules/invite/components/copy-info.d.ts +3 -0
- package/lib/modules/invite/components/copy-info.js +144 -0
- package/lib/modules/invite/components/pstn-invite.js +3 -15
- package/lib/modules/invite/components/voip-invite.js +10 -1
- package/lib/modules/invite/enums.d.ts +3 -1
- package/lib/modules/invite/enums.js +2 -0
- package/lib/modules/invite/store.d.ts +4 -1
- package/lib/modules/invite/store.js +37 -13
- package/lib/modules/invite/view.js +41 -20
- package/lib/modules/layout/store.base.d.ts +2 -1
- package/lib/modules/layout/store.base.js +20 -23
- package/lib/modules/participant/components/confirm-input/index.css +67 -1
- package/lib/modules/participant/components/confirm-input/index.js +16 -13
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.css +4 -0
- package/lib/modules/participant/store.base.d.ts +1 -0
- package/lib/modules/participant/store.base.js +34 -7
- package/lib/modules/pc-audio-connect/main-scene/store.d.ts +2 -0
- package/lib/modules/pc-audio-connect/main-scene/store.js +12 -2
- package/lib/modules/pc-audio-connect/view.js +4 -2
- package/lib/modules/phone-audio-connect/store.d.ts +6 -4
- package/lib/modules/phone-audio-connect/store.js +12 -1
- package/lib/modules/phone-audio-connect/view.js +6 -4
- package/lib/modules/secondary-window/index.js +2 -2
- package/lib/modules/secondary-window/store.d.ts +3 -0
- package/lib/modules/secondary-window/store.js +16 -1
- package/lib/modules/secondary-window/view.js +96 -72
- package/lib/modules/toast-manager/type.d.ts +2 -1
- package/lib/modules/toast-manager/type.js +4 -1
- package/lib/plugins/module-dev-plugin.js +4 -4
- package/lib/providers/ability-provider.d.ts +15 -0
- package/lib/providers/ability-provider.js +13 -1
- package/lib/providers/mouse-detect/provider.d.ts +2 -0
- package/lib/providers/mouse-detect/provider.empty.d.ts +14 -0
- package/lib/providers/mouse-detect/provider.empty.js +47 -0
- package/lib/providers/mouse-detect/provider.js +13 -4
- package/lib/providers/mouse-detect/type.d.ts +2 -0
- package/lib/providers/phone-audio-provider.d.ts +31 -5
- package/lib/providers/phone-audio-provider.js +83 -22
- package/lib/providers/user-audio-volume-provider.d.ts +6 -0
- package/lib/providers/user-audio-volume-provider.js +3 -2
- package/lib/runtime.d.ts +1 -0
- package/lib/scenes/main-scene.js +2 -1
- package/lib/shared-data/chat-data.d.ts +19 -0
- package/lib/shared-data/chat-data.js +54 -7
- package/lib/shared-data/member-data.d.ts +9 -1
- package/lib/shared-data/member-data.js +46 -17
- package/lib/shared-data/video-window.js +8 -4
- package/lib/translations/enUS.d.ts +245 -1
- package/lib/translations/enUS.js +247 -3
- package/lib/translations/zhCN.d.ts +245 -1
- package/lib/translations/zhCN.js +246 -2
- package/lib/utilities/os.d.ts +1 -0
- package/lib/utilities/os.js +15 -0
- package/lib/utilities/renderer.d.ts +1 -0
- package/lib/utilities/renderer.js +7 -1
- package/lib-es/creator/provider-initializer.browser.js +4 -2
- package/lib-es/creator/provider-initializer.electron.js +11 -3
- package/lib-es/electron/injections.js +3 -0
- package/lib-es/electron/preload.js +2 -1
- package/lib-es/fragments/annotation/style.css +1 -0
- package/lib-es/fragments/whiteboard/style.css +4 -0
- package/lib-es/modules/action-bar/main-scene/store.base.js +5 -0
- package/lib-es/modules/audio-stream/index.js +33 -1
- package/lib-es/modules/chat/chat-room-store.js +4 -2
- package/lib-es/modules/chat/index.js +1 -1
- package/lib-es/modules/chat/store.js +4 -2
- package/lib-es/modules/components/device-control/store.base.js +22 -3
- package/lib-es/modules/components/leave-meeting/index.js +3 -2
- package/lib-es/modules/components/leave-meeting/main-scene/store.js +6 -1
- package/lib-es/modules/components/leave-meeting/store.base.js +1 -1
- package/lib-es/modules/components/leave-meeting/waiting-scene/store.js +6 -1
- package/lib-es/modules/components/member-window/components/member-actions/components/icon-status.js +7 -10
- package/lib-es/modules/components/member-window/components/member-actions/components/more-actions.js +2 -2
- package/lib-es/modules/components/member-window/components/member-actions/index.js +0 -7
- package/lib-es/modules/components/member-window/components/member-actions/store.js +1 -1
- package/lib-es/modules/components/member-window/index.js +1 -1
- package/lib-es/modules/components/tab-frame/index.css +12 -1
- package/lib-es/modules/components/tab-frame/index.js +4 -1
- package/lib-es/modules/control-bar/components/share-state-nav/index.js +1 -3
- package/lib-es/modules/control-bar/mouse-event-bridge.js +79 -0
- package/lib-es/modules/control-bar/store.js +18 -30
- package/lib-es/modules/control-bar/view.js +21 -17
- package/lib-es/modules/dialog/dialogs/connection-gateway/tabs.js +3 -2
- package/lib-es/modules/dialog/dialogs/invite/index.js +6 -24
- package/lib-es/modules/invite/components/copy-info.css +72 -0
- package/lib-es/modules/invite/components/copy-info.js +137 -0
- package/lib-es/modules/invite/components/pstn-invite.js +3 -15
- package/lib-es/modules/invite/components/voip-invite.js +10 -1
- package/lib-es/modules/invite/enums.js +2 -0
- package/lib-es/modules/invite/store.js +38 -14
- package/lib-es/modules/invite/view.js +43 -22
- package/lib-es/modules/layout/store.base.js +20 -23
- package/lib-es/modules/participant/components/confirm-input/index.css +67 -1
- package/lib-es/modules/participant/components/confirm-input/index.js +16 -13
- package/lib-es/modules/participant/components/participants/components/render-user/components/attendee/index.css +4 -0
- package/lib-es/modules/participant/store.base.js +34 -7
- package/lib-es/modules/pc-audio-connect/main-scene/store.js +12 -2
- package/lib-es/modules/pc-audio-connect/view.js +4 -2
- package/lib-es/modules/phone-audio-connect/store.js +12 -1
- package/lib-es/modules/phone-audio-connect/view.js +6 -4
- package/lib-es/modules/secondary-window/index.js +2 -2
- package/lib-es/modules/secondary-window/store.js +16 -1
- package/lib-es/modules/secondary-window/view.js +97 -73
- package/lib-es/modules/toast-manager/type.js +4 -1
- package/lib-es/plugins/module-dev-plugin.js +4 -4
- package/lib-es/providers/ability-provider.js +13 -1
- package/lib-es/providers/mouse-detect/provider.empty.js +39 -0
- package/lib-es/providers/mouse-detect/provider.js +13 -4
- package/lib-es/providers/phone-audio-provider.js +109 -48
- package/lib-es/providers/user-audio-volume-provider.js +3 -2
- package/lib-es/scenes/main-scene.js +3 -2
- package/lib-es/shared-data/chat-data.js +55 -8
- package/lib-es/shared-data/member-data.js +46 -17
- package/lib-es/shared-data/video-window.js +8 -4
- package/lib-es/translations/enUS.js +247 -3
- package/lib-es/translations/zhCN.js +246 -2
- package/lib-es/utilities/os.js +8 -0
- package/lib-es/utilities/renderer.js +7 -1
- package/lib-es/utilities/shared-storage.js +2 -2
- package/package.json +6 -6
- package/lib/modules/connection-gateway/components/computer/index.css +0 -12
- package/lib/modules/connection-gateway/components/computer/index.d.ts +0 -3
- package/lib/modules/connection-gateway/components/computer/index.js +0 -66
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.css +0 -36
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.d.ts +0 -10
- package/lib/modules/connection-gateway/components/phone/components/callinfo/index.js +0 -78
- package/lib/modules/connection-gateway/components/phone/components/calling/index.css +0 -72
- package/lib/modules/connection-gateway/components/phone/components/calling/index.d.ts +0 -7
- package/lib/modules/connection-gateway/components/phone/components/calling/index.js +0 -58
- package/lib/modules/connection-gateway/components/phone/components/remeber/index.css +0 -10
- package/lib/modules/connection-gateway/components/phone/components/remeber/index.d.ts +0 -5
- package/lib/modules/connection-gateway/components/phone/components/remeber/index.js +0 -24
- package/lib/modules/connection-gateway/components/phone/components/useing/index.css +0 -46
- package/lib/modules/connection-gateway/components/phone/components/useing/index.d.ts +0 -3
- package/lib/modules/connection-gateway/components/phone/components/useing/index.js +0 -36
- package/lib/modules/connection-gateway/components/phone/index.css +0 -49
- package/lib/modules/connection-gateway/components/phone/index.d.ts +0 -3
- package/lib/modules/connection-gateway/components/phone/index.js +0 -185
- package/lib/modules/connection-gateway/enums.d.ts +0 -4
- package/lib/modules/connection-gateway/enums.js +0 -12
- package/lib/modules/connection-gateway/index.css +0 -6
- package/lib/modules/connection-gateway/index.d.ts +0 -10
- package/lib/modules/connection-gateway/index.js +0 -78
- package/lib/modules/connection-gateway/store.d.ts +0 -68
- package/lib/modules/connection-gateway/store.js +0 -713
- package/lib/modules/connection-gateway/types.d.ts +0 -8
- package/lib/modules/connection-gateway/types.js +0 -6
- package/lib/modules/connection-gateway/view.d.ts +0 -1
- package/lib/modules/connection-gateway/view.js +0 -39
- package/lib-es/modules/connection-gateway/components/computer/index.css +0 -12
- package/lib-es/modules/connection-gateway/components/computer/index.js +0 -59
- package/lib-es/modules/connection-gateway/components/phone/components/callinfo/index.css +0 -36
- package/lib-es/modules/connection-gateway/components/phone/components/callinfo/index.js +0 -71
- package/lib-es/modules/connection-gateway/components/phone/components/calling/index.css +0 -72
- package/lib-es/modules/connection-gateway/components/phone/components/calling/index.js +0 -51
- package/lib-es/modules/connection-gateway/components/phone/components/remeber/index.css +0 -10
- package/lib-es/modules/connection-gateway/components/phone/components/remeber/index.js +0 -17
- package/lib-es/modules/connection-gateway/components/phone/components/useing/index.css +0 -46
- package/lib-es/modules/connection-gateway/components/phone/components/useing/index.js +0 -29
- package/lib-es/modules/connection-gateway/components/phone/index.css +0 -49
- package/lib-es/modules/connection-gateway/components/phone/index.js +0 -177
- package/lib-es/modules/connection-gateway/enums.js +0 -5
- package/lib-es/modules/connection-gateway/index.css +0 -6
- package/lib-es/modules/connection-gateway/index.js +0 -60
- package/lib-es/modules/connection-gateway/store.js +0 -707
- package/lib-es/modules/connection-gateway/types.js +0 -1
- package/lib-es/modules/connection-gateway/view.js +0 -31
|
@@ -1,707 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.symbol.js";
|
|
2
|
-
import "core-js/modules/es.symbol.description.js";
|
|
3
|
-
import "core-js/modules/es.symbol.iterator.js";
|
|
4
|
-
import "core-js/modules/es.symbol.to-primitive.js";
|
|
5
|
-
import "core-js/modules/es.error.cause.js";
|
|
6
|
-
import "core-js/modules/es.error.to-string.js";
|
|
7
|
-
import "core-js/modules/es.array.from.js";
|
|
8
|
-
import "core-js/modules/es.array.is-array.js";
|
|
9
|
-
import "core-js/modules/es.array.push.js";
|
|
10
|
-
import "core-js/modules/es.array.slice.js";
|
|
11
|
-
import "core-js/modules/es.date.to-primitive.js";
|
|
12
|
-
import "core-js/modules/es.date.to-string.js";
|
|
13
|
-
import "core-js/modules/es.function.name.js";
|
|
14
|
-
import "core-js/modules/es.map.js";
|
|
15
|
-
import "core-js/modules/es.object.create.js";
|
|
16
|
-
import "core-js/modules/es.object.define-property.js";
|
|
17
|
-
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
|
18
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
19
|
-
import "core-js/modules/es.regexp.test.js";
|
|
20
|
-
import "core-js/modules/es.regexp.to-string.js";
|
|
21
|
-
import "core-js/modules/esnext.function.metadata.js";
|
|
22
|
-
import "core-js/modules/esnext.map.delete-all.js";
|
|
23
|
-
import "core-js/modules/esnext.map.emplace.js";
|
|
24
|
-
import "core-js/modules/esnext.map.every.js";
|
|
25
|
-
import "core-js/modules/esnext.map.filter.js";
|
|
26
|
-
import "core-js/modules/esnext.map.find.js";
|
|
27
|
-
import "core-js/modules/esnext.map.find-key.js";
|
|
28
|
-
import "core-js/modules/esnext.map.includes.js";
|
|
29
|
-
import "core-js/modules/esnext.map.key-of.js";
|
|
30
|
-
import "core-js/modules/esnext.map.map-keys.js";
|
|
31
|
-
import "core-js/modules/esnext.map.map-values.js";
|
|
32
|
-
import "core-js/modules/esnext.map.merge.js";
|
|
33
|
-
import "core-js/modules/esnext.map.reduce.js";
|
|
34
|
-
import "core-js/modules/esnext.map.some.js";
|
|
35
|
-
import "core-js/modules/esnext.map.update.js";
|
|
36
|
-
import "core-js/modules/esnext.symbol.metadata.js";
|
|
37
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
38
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
39
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
40
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
41
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
42
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
43
|
-
var _ConnectionGatewayStore;
|
|
44
|
-
var _initProto, _init_activeTabKey, _init_rememberMe, _init_rememberedNumberList, _init_connectionPhoneInfo, _init_currentRegion, _init_currentCallInfo, _init_connectInfo, _init_phoneCallState, _init_phoneCallReason, _init_connectSession, _init_calling, _init_outgoingCall, _init_isHangup, _init_hasPstnStream, _init_hasNeedMergedStream, _onTabChangeDecs, _onGetConnectInfoDecs, _regionChangeHandlerDecs, _startCallDecs, _stopCallDecs, _setRememberMeDecs, _initRememberedDataDecs, _rememberNumberDecs, _phoneCallUpdatedDecs, _phoneCallReasonDecs, _setStreamStateDecs, _handleStreamsAddedOrUpdatedDecs, _handleStreamsRemovedDecs, _ref;
|
|
45
|
-
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
46
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
47
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
48
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
49
|
-
import "core-js/modules/es.array.filter.js";
|
|
50
|
-
import "core-js/modules/es.array.find.js";
|
|
51
|
-
import "core-js/modules/es.array.find-index.js";
|
|
52
|
-
import "core-js/modules/es.array.for-each.js";
|
|
53
|
-
import "core-js/modules/es.array.iterator.js";
|
|
54
|
-
import "core-js/modules/es.array.some.js";
|
|
55
|
-
import "core-js/modules/es.array.unshift.js";
|
|
56
|
-
import "core-js/modules/es.date.to-json.js";
|
|
57
|
-
import "core-js/modules/es.function.bind.js";
|
|
58
|
-
import "core-js/modules/es.json.stringify.js";
|
|
59
|
-
import "core-js/modules/es.number.constructor.js";
|
|
60
|
-
import "core-js/modules/es.object.keys.js";
|
|
61
|
-
import "core-js/modules/es.object.to-string.js";
|
|
62
|
-
import "core-js/modules/es.string.iterator.js";
|
|
63
|
-
import "core-js/modules/es.weak-map.js";
|
|
64
|
-
import "core-js/modules/esnext.iterator.constructor.js";
|
|
65
|
-
import "core-js/modules/esnext.iterator.filter.js";
|
|
66
|
-
import "core-js/modules/esnext.iterator.find.js";
|
|
67
|
-
import "core-js/modules/esnext.iterator.for-each.js";
|
|
68
|
-
import "core-js/modules/esnext.iterator.some.js";
|
|
69
|
-
import "core-js/modules/esnext.json.parse.js";
|
|
70
|
-
import "core-js/modules/esnext.weak-map.delete-all.js";
|
|
71
|
-
import "core-js/modules/esnext.weak-map.emplace.js";
|
|
72
|
-
import "core-js/modules/web.dom-collections.for-each.js";
|
|
73
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
74
|
-
import "core-js/modules/web.timers.js";
|
|
75
|
-
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
76
|
-
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
77
|
-
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
78
|
-
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
79
|
-
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
80
|
-
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 set(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 k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(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 s(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)]; } }; }
|
|
81
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
82
|
-
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); }
|
|
83
|
-
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; }
|
|
84
|
-
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; }
|
|
85
|
-
import { FcrRoomConnectorType } from 'fcr-core';
|
|
86
|
-
import { action, computed, observable } from 'mobx';
|
|
87
|
-
import { createContext } from 'react';
|
|
88
|
-
import { bound } from 'agora-foundation/lib/decorator';
|
|
89
|
-
import { FcrRoomConnectorSessionReason, FcrRoomConnectorSessionState } from 'fcr-core/lib/room-control/room-connector-control/type';
|
|
90
|
-
import isEqual from 'lodash/isEqual';
|
|
91
|
-
import { storage } from 'agora-foundation/lib/utilities/tools';
|
|
92
|
-
import { FcrUIConnectType } from '../../type';
|
|
93
|
-
import { FcrUIDialogKey, FcrUIHighlightElement } from '../../utilities/constant';
|
|
94
|
-
import { ConnectorRegion } from './enums';
|
|
95
|
-
import { FcrUIObjectKeys } from '../../object-manager';
|
|
96
|
-
import { DeviceSettingTab } from '../setting/type';
|
|
97
|
-
import { FcrUIToastKey } from '../../modules/toast-manager/type';
|
|
98
|
-
var _A = /*#__PURE__*/new WeakMap();
|
|
99
|
-
var _B = /*#__PURE__*/new WeakMap();
|
|
100
|
-
var _C = /*#__PURE__*/new WeakMap();
|
|
101
|
-
var _D = /*#__PURE__*/new WeakMap();
|
|
102
|
-
var _E = /*#__PURE__*/new WeakMap();
|
|
103
|
-
var _F = /*#__PURE__*/new WeakMap();
|
|
104
|
-
var _G = /*#__PURE__*/new WeakMap();
|
|
105
|
-
var _H = /*#__PURE__*/new WeakMap();
|
|
106
|
-
var _I = /*#__PURE__*/new WeakMap();
|
|
107
|
-
var _J = /*#__PURE__*/new WeakMap();
|
|
108
|
-
var _K = /*#__PURE__*/new WeakMap();
|
|
109
|
-
var _L = /*#__PURE__*/new WeakMap();
|
|
110
|
-
var _M = /*#__PURE__*/new WeakMap();
|
|
111
|
-
var _N = /*#__PURE__*/new WeakMap();
|
|
112
|
-
var _O = /*#__PURE__*/new WeakMap();
|
|
113
|
-
_ref = (_onTabChangeDecs = [action, action.bound], _onGetConnectInfoDecs = [action, action.bound], _regionChangeHandlerDecs = [action, action.bound], _startCallDecs = [action, action.bound], _stopCallDecs = [action, action.bound], _setRememberMeDecs = [action, action.bound], _initRememberedDataDecs = [action, action.bound], _rememberNumberDecs = [action, action.bound], _phoneCallUpdatedDecs = [action, action.bound], _phoneCallReasonDecs = [action, action.bound], _setStreamStateDecs = [action, action.bound], _handleStreamsAddedOrUpdatedDecs = [action, action.bound], _handleStreamsRemovedDecs = [action, action.bound], "_roomControl");
|
|
114
|
-
var ConnectionGatewayStore = /*#__PURE__*/function () {
|
|
115
|
-
function ConnectionGatewayStore(_ref2) {
|
|
116
|
-
var _this = this;
|
|
117
|
-
var objectManager = _ref2.objectManager;
|
|
118
|
-
_classCallCheck(this, ConnectionGatewayStore);
|
|
119
|
-
_defineProperty(this, _ref, void _initProto(this));
|
|
120
|
-
_defineProperty(this, "_disposers", []);
|
|
121
|
-
_defineProperty(this, "_roomOberver", {
|
|
122
|
-
onPhoneConnectorSessionStateUpdated: this._phoneCallUpdated.bind(this)
|
|
123
|
-
});
|
|
124
|
-
_defineProperty(this, "_streamObserver", {
|
|
125
|
-
onStreamsAdded: this._handleStreamsAddedOrUpdated,
|
|
126
|
-
onStreamsUpdated: this._handleStreamsAddedOrUpdated,
|
|
127
|
-
onStreamsRemoved: this._handleStreamsRemoved
|
|
128
|
-
});
|
|
129
|
-
_defineProperty(this, "_failureTimer", null);
|
|
130
|
-
_defineProperty(this, "_accepted", false);
|
|
131
|
-
_defineProperty(this, "_sessionId", '');
|
|
132
|
-
_classPrivateFieldInitSpec(this, _A, _init_activeTabKey(this, 'computer'));
|
|
133
|
-
_classPrivateFieldInitSpec(this, _B, _init_rememberMe(this, true));
|
|
134
|
-
_classPrivateFieldInitSpec(this, _C, _init_rememberedNumberList(this, []));
|
|
135
|
-
_classPrivateFieldInitSpec(this, _D, _init_connectionPhoneInfo(this, []));
|
|
136
|
-
_classPrivateFieldInitSpec(this, _E, _init_currentRegion(this, ConnectorRegion.CHINA));
|
|
137
|
-
_classPrivateFieldInitSpec(this, _F, _init_currentCallInfo(this, {
|
|
138
|
-
zone: '+86',
|
|
139
|
-
phone: ''
|
|
140
|
-
}));
|
|
141
|
-
_classPrivateFieldInitSpec(this, _G, _init_connectInfo(this, {}));
|
|
142
|
-
_classPrivateFieldInitSpec(this, _H, _init_phoneCallState(this, FcrRoomConnectorSessionState.CALLING));
|
|
143
|
-
_classPrivateFieldInitSpec(this, _I, _init_phoneCallReason(this, FcrRoomConnectorSessionReason.NONE));
|
|
144
|
-
_classPrivateFieldInitSpec(this, _J, _init_connectSession(this, null));
|
|
145
|
-
_classPrivateFieldInitSpec(this, _K, _init_calling(this, false));
|
|
146
|
-
_classPrivateFieldInitSpec(this, _L, _init_outgoingCall(this, false));
|
|
147
|
-
_classPrivateFieldInitSpec(this, _M, _init_isHangup(this, false));
|
|
148
|
-
_classPrivateFieldInitSpec(this, _N, _init_hasPstnStream(this, false));
|
|
149
|
-
_classPrivateFieldInitSpec(this, _O, _init_hasNeedMergedStream(this, false));
|
|
150
|
-
// Get all required objects from objectManager
|
|
151
|
-
this._eventProvider = objectManager.getObject(FcrUIObjectKeys.P_EVENT_PROVIDER);
|
|
152
|
-
this._messageProvider = objectManager.getObject(FcrUIObjectKeys.P_MESSAGE_PROVIDER);
|
|
153
|
-
this._dialogProvider = objectManager.getObject(FcrUIObjectKeys.P_DIALOG_PROVIDER);
|
|
154
|
-
this._deviceProvider = objectManager.getObject(FcrUIObjectKeys.P_DEVICE_PROVIDER);
|
|
155
|
-
this._sharedMemberDataSource = objectManager.getObject(FcrUIObjectKeys.S_SHARED_MEMBER_DATA_SOURCE);
|
|
156
|
-
var roomProvider = objectManager.getObject(FcrUIObjectKeys.P_ROOM_PROVIDER);
|
|
157
|
-
this._roomControl = roomProvider.currentRoomControl;
|
|
158
|
-
this._streamControl = this._roomControl.getStreamControl();
|
|
159
|
-
|
|
160
|
-
// Optional providers with try-catch
|
|
161
|
-
this._devicePrivilegeProvider = objectManager.getObject(FcrUIObjectKeys.P_DEVICE_PRIVILEGE_PROVIDER);
|
|
162
|
-
this._sharedDevicePrivilegeDataSource = objectManager.getObject(FcrUIObjectKeys.S_SHARED_DEVICE_PRIVILEGE_DATA_SOURCE);
|
|
163
|
-
this._sharedSettingDataSource = objectManager.getObject(FcrUIObjectKeys.S_SHARED_SETTING_DATA_SOURCE);
|
|
164
|
-
this._deviceObserver = {
|
|
165
|
-
onAudioConnected: function onAudioConnected() {
|
|
166
|
-
_this.closeConnectionDialog();
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
this._roomControl.getRoomConnectorControl().addObserver(this._roomOberver);
|
|
170
|
-
this._streamControl.addObserver(this._streamObserver);
|
|
171
|
-
this.initRememberedData();
|
|
172
|
-
this.onGetConnectInfo();
|
|
173
|
-
}
|
|
174
|
-
return _createClass(ConnectionGatewayStore, [{
|
|
175
|
-
key: "activeTabKey",
|
|
176
|
-
get: function get() {
|
|
177
|
-
return _classPrivateFieldGet(_A, this);
|
|
178
|
-
},
|
|
179
|
-
set: function set(v) {
|
|
180
|
-
_classPrivateFieldSet(_A, this, v);
|
|
181
|
-
}
|
|
182
|
-
}, {
|
|
183
|
-
key: "rememberMe",
|
|
184
|
-
get: function get() {
|
|
185
|
-
return _classPrivateFieldGet(_B, this);
|
|
186
|
-
},
|
|
187
|
-
set: function set(v) {
|
|
188
|
-
_classPrivateFieldSet(_B, this, v);
|
|
189
|
-
}
|
|
190
|
-
}, {
|
|
191
|
-
key: "rememberedNumberList",
|
|
192
|
-
get: function get() {
|
|
193
|
-
return _classPrivateFieldGet(_C, this);
|
|
194
|
-
},
|
|
195
|
-
set: function set(v) {
|
|
196
|
-
_classPrivateFieldSet(_C, this, v);
|
|
197
|
-
}
|
|
198
|
-
}, {
|
|
199
|
-
key: "connectionPhoneInfo",
|
|
200
|
-
get: function get() {
|
|
201
|
-
return _classPrivateFieldGet(_D, this);
|
|
202
|
-
},
|
|
203
|
-
set: function set(v) {
|
|
204
|
-
_classPrivateFieldSet(_D, this, v);
|
|
205
|
-
}
|
|
206
|
-
}, {
|
|
207
|
-
key: "currentRegion",
|
|
208
|
-
get: function get() {
|
|
209
|
-
return _classPrivateFieldGet(_E, this);
|
|
210
|
-
},
|
|
211
|
-
set: function set(v) {
|
|
212
|
-
_classPrivateFieldSet(_E, this, v);
|
|
213
|
-
}
|
|
214
|
-
}, {
|
|
215
|
-
key: "currentCallInfo",
|
|
216
|
-
get: function get() {
|
|
217
|
-
return _classPrivateFieldGet(_F, this);
|
|
218
|
-
},
|
|
219
|
-
set: function set(v) {
|
|
220
|
-
_classPrivateFieldSet(_F, this, v);
|
|
221
|
-
}
|
|
222
|
-
}, {
|
|
223
|
-
key: "connectInfo",
|
|
224
|
-
get: function get() {
|
|
225
|
-
return _classPrivateFieldGet(_G, this);
|
|
226
|
-
},
|
|
227
|
-
set: function set(v) {
|
|
228
|
-
_classPrivateFieldSet(_G, this, v);
|
|
229
|
-
}
|
|
230
|
-
}, {
|
|
231
|
-
key: "phoneCallState",
|
|
232
|
-
get: function get() {
|
|
233
|
-
return _classPrivateFieldGet(_H, this);
|
|
234
|
-
},
|
|
235
|
-
set: function set(v) {
|
|
236
|
-
_classPrivateFieldSet(_H, this, v);
|
|
237
|
-
}
|
|
238
|
-
}, {
|
|
239
|
-
key: "phoneCallReason",
|
|
240
|
-
get: function get() {
|
|
241
|
-
return _classPrivateFieldGet(_I, this);
|
|
242
|
-
},
|
|
243
|
-
set: function set(v) {
|
|
244
|
-
_classPrivateFieldSet(_I, this, v);
|
|
245
|
-
}
|
|
246
|
-
}, {
|
|
247
|
-
key: "connectSession",
|
|
248
|
-
get: function get() {
|
|
249
|
-
return _classPrivateFieldGet(_J, this);
|
|
250
|
-
},
|
|
251
|
-
set: function set(v) {
|
|
252
|
-
_classPrivateFieldSet(_J, this, v);
|
|
253
|
-
}
|
|
254
|
-
}, {
|
|
255
|
-
key: "calling",
|
|
256
|
-
get: function get() {
|
|
257
|
-
return _classPrivateFieldGet(_K, this);
|
|
258
|
-
},
|
|
259
|
-
set: function set(v) {
|
|
260
|
-
_classPrivateFieldSet(_K, this, v);
|
|
261
|
-
}
|
|
262
|
-
}, {
|
|
263
|
-
key: "outgoingCall",
|
|
264
|
-
get: function get() {
|
|
265
|
-
return _classPrivateFieldGet(_L, this);
|
|
266
|
-
},
|
|
267
|
-
set: function set(v) {
|
|
268
|
-
_classPrivateFieldSet(_L, this, v);
|
|
269
|
-
}
|
|
270
|
-
}, {
|
|
271
|
-
key: "isHangup",
|
|
272
|
-
get: function get() {
|
|
273
|
-
return _classPrivateFieldGet(_M, this);
|
|
274
|
-
},
|
|
275
|
-
set: function set(v) {
|
|
276
|
-
_classPrivateFieldSet(_M, this, v);
|
|
277
|
-
}
|
|
278
|
-
}, {
|
|
279
|
-
key: "hasPstnStream",
|
|
280
|
-
get: function get() {
|
|
281
|
-
return _classPrivateFieldGet(_N, this);
|
|
282
|
-
},
|
|
283
|
-
set: function set(v) {
|
|
284
|
-
_classPrivateFieldSet(_N, this, v);
|
|
285
|
-
}
|
|
286
|
-
}, {
|
|
287
|
-
key: "hasNeedMergedStream",
|
|
288
|
-
get: function get() {
|
|
289
|
-
return _classPrivateFieldGet(_O, this);
|
|
290
|
-
},
|
|
291
|
-
set: function set(v) {
|
|
292
|
-
_classPrivateFieldSet(_O, this, v);
|
|
293
|
-
}
|
|
294
|
-
}, {
|
|
295
|
-
key: "connectType",
|
|
296
|
-
get: function get() {
|
|
297
|
-
return this._deviceProvider.connectType;
|
|
298
|
-
}
|
|
299
|
-
}, {
|
|
300
|
-
key: "localUser",
|
|
301
|
-
get: function get() {
|
|
302
|
-
return this._sharedMemberDataSource.localUser;
|
|
303
|
-
}
|
|
304
|
-
}, {
|
|
305
|
-
key: "hasOwnPstnStream",
|
|
306
|
-
get: function get() {
|
|
307
|
-
return this._sharedMemberDataSource.hasOwnPstnStream;
|
|
308
|
-
}
|
|
309
|
-
}, {
|
|
310
|
-
key: "openAudioSettings",
|
|
311
|
-
value: function openAudioSettings() {
|
|
312
|
-
this._dialogProvider.openDialog(FcrUIDialogKey.SETTINGS, {
|
|
313
|
-
activeTab: DeviceSettingTab.AUDIO,
|
|
314
|
-
highlightSelector: FcrUIHighlightElement.AUDIO_MICROPHONE
|
|
315
|
-
});
|
|
316
|
-
this._sharedSettingDataSource.setDialogConfig({
|
|
317
|
-
activeTab: DeviceSettingTab.AUDIO,
|
|
318
|
-
highlightSelector: FcrUIHighlightElement.AUDIO_MICROPHONE
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
}, {
|
|
322
|
-
key: "closeConnectionDialog",
|
|
323
|
-
value: function closeConnectionDialog() {
|
|
324
|
-
this._dialogProvider.closeDialog(FcrUIDialogKey.CONNECTION_GATEWAY);
|
|
325
|
-
}
|
|
326
|
-
}, {
|
|
327
|
-
key: "onTabChange",
|
|
328
|
-
value: function onTabChange(key) {
|
|
329
|
-
this.activeTabKey = key;
|
|
330
|
-
if (key === 'phone' && this.connectionPhoneInfo.length === 0) {
|
|
331
|
-
this.onGetConnectInfo();
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}, {
|
|
335
|
-
key: "onGetConnectInfo",
|
|
336
|
-
value: function () {
|
|
337
|
-
var _onGetConnectInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
338
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
339
|
-
while (1) switch (_context.prev = _context.next) {
|
|
340
|
-
case 0:
|
|
341
|
-
_context.next = 1;
|
|
342
|
-
return this._roomControl.getRoomConnectorControl().getRoomConnectorPhoneInfo();
|
|
343
|
-
case 1:
|
|
344
|
-
this.connectionPhoneInfo = _context.sent;
|
|
345
|
-
this.connectInfo = this.connectionPhoneInfo[0];
|
|
346
|
-
case 2:
|
|
347
|
-
case "end":
|
|
348
|
-
return _context.stop();
|
|
349
|
-
}
|
|
350
|
-
}, _callee, this);
|
|
351
|
-
}));
|
|
352
|
-
function onGetConnectInfo() {
|
|
353
|
-
return _onGetConnectInfo.apply(this, arguments);
|
|
354
|
-
}
|
|
355
|
-
return onGetConnectInfo;
|
|
356
|
-
}()
|
|
357
|
-
}, {
|
|
358
|
-
key: "regionChangeHandler",
|
|
359
|
-
value: function regionChangeHandler(region) {
|
|
360
|
-
this.currentRegion = region;
|
|
361
|
-
this.setConnectionInfo(region);
|
|
362
|
-
}
|
|
363
|
-
}, {
|
|
364
|
-
key: "setConnectionInfo",
|
|
365
|
-
value: function setConnectionInfo() {
|
|
366
|
-
var region = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ConnectorRegion.CHINA;
|
|
367
|
-
if (this.connectionPhoneInfo.length > 0) {
|
|
368
|
-
this.connectInfo = this.connectionPhoneInfo.find(function (info) {
|
|
369
|
-
return info.region === Number(region);
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}, {
|
|
374
|
-
key: "setCurrentCallInfo",
|
|
375
|
-
value: function setCurrentCallInfo(data) {
|
|
376
|
-
this.currentCallInfo = data;
|
|
377
|
-
}
|
|
378
|
-
}, {
|
|
379
|
-
key: "startCall",
|
|
380
|
-
value: function () {
|
|
381
|
-
var _startCall = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
382
|
-
var _this$localUser, phoneUserId, userName;
|
|
383
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
384
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
385
|
-
case 0:
|
|
386
|
-
_this$localUser = this.localUser, phoneUserId = _this$localUser.userId, userName = _this$localUser.userName;
|
|
387
|
-
this.calling = true;
|
|
388
|
-
this.outgoingCall = true;
|
|
389
|
-
this.isHangup = false;
|
|
390
|
-
if (this.currentCallInfo.phone) {
|
|
391
|
-
_context2.next = 1;
|
|
392
|
-
break;
|
|
393
|
-
}
|
|
394
|
-
return _context2.abrupt("return");
|
|
395
|
-
case 1:
|
|
396
|
-
_context2.next = 2;
|
|
397
|
-
return this._roomControl.getRoomConnectorControl().startSessionByPhone({
|
|
398
|
-
phoneNumber: this.currentCallInfo.phone,
|
|
399
|
-
userName: userName,
|
|
400
|
-
phoneUserId: phoneUserId
|
|
401
|
-
});
|
|
402
|
-
case 2:
|
|
403
|
-
this._sessionId = _context2.sent;
|
|
404
|
-
case 3:
|
|
405
|
-
case "end":
|
|
406
|
-
return _context2.stop();
|
|
407
|
-
}
|
|
408
|
-
}, _callee2, this);
|
|
409
|
-
}));
|
|
410
|
-
function startCall() {
|
|
411
|
-
return _startCall.apply(this, arguments);
|
|
412
|
-
}
|
|
413
|
-
return startCall;
|
|
414
|
-
}()
|
|
415
|
-
}, {
|
|
416
|
-
key: "stopCall",
|
|
417
|
-
value: function () {
|
|
418
|
-
var _stopCall = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
419
|
-
var _t;
|
|
420
|
-
return _regeneratorRuntime.wrap(function (_context3) {
|
|
421
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
422
|
-
case 0:
|
|
423
|
-
this.isHangup = true;
|
|
424
|
-
_t = this.connectSession;
|
|
425
|
-
if (!_t) {
|
|
426
|
-
_context3.next = 1;
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
_context3.next = 1;
|
|
430
|
-
return this._roomControl.getRoomConnectorControl().stopSession(this.connectSession.sessionId);
|
|
431
|
-
case 1:
|
|
432
|
-
this._messageProvider.showToastByKey({
|
|
433
|
-
key: FcrUIToastKey.FMT_PSTN_STATUS_HUNGUP
|
|
434
|
-
});
|
|
435
|
-
case 2:
|
|
436
|
-
case "end":
|
|
437
|
-
return _context3.stop();
|
|
438
|
-
}
|
|
439
|
-
}, _callee3, this);
|
|
440
|
-
}));
|
|
441
|
-
function stopCall() {
|
|
442
|
-
return _stopCall.apply(this, arguments);
|
|
443
|
-
}
|
|
444
|
-
return stopCall;
|
|
445
|
-
}()
|
|
446
|
-
}, {
|
|
447
|
-
key: "setRememberMe",
|
|
448
|
-
value: function setRememberMe(value) {
|
|
449
|
-
this.rememberMe = value;
|
|
450
|
-
}
|
|
451
|
-
}, {
|
|
452
|
-
key: "initRememberedData",
|
|
453
|
-
value: function initRememberedData() {
|
|
454
|
-
var list = storage.get('connection_list');
|
|
455
|
-
if (!list) {
|
|
456
|
-
this.rememberedNumberList = [];
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
try {
|
|
460
|
-
this.rememberedNumberList = JSON.parse(list);
|
|
461
|
-
var _this$rememberedNumbe = this.rememberedNumberList[0],
|
|
462
|
-
phone = _this$rememberedNumbe.phone,
|
|
463
|
-
zone = _this$rememberedNumbe.zone;
|
|
464
|
-
this.setCurrentCallInfo({
|
|
465
|
-
zone: zone,
|
|
466
|
-
phone: phone
|
|
467
|
-
});
|
|
468
|
-
} catch (_unused) {
|
|
469
|
-
this.rememberedNumberList = [];
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
}, {
|
|
473
|
-
key: "release",
|
|
474
|
-
value: function release() {
|
|
475
|
-
this._disposers.forEach(function (disposer) {
|
|
476
|
-
return disposer();
|
|
477
|
-
});
|
|
478
|
-
this._deviceProvider.removeObserver(this._deviceObserver);
|
|
479
|
-
this._roomControl.getRoomConnectorControl().removeObserver(this._roomOberver);
|
|
480
|
-
this._streamControl.removeObserver(this._streamObserver);
|
|
481
|
-
this._failureTimer && clearTimeout(this._failureTimer);
|
|
482
|
-
this._failureTimer = null;
|
|
483
|
-
}
|
|
484
|
-
}, {
|
|
485
|
-
key: "joinAudioByComputer",
|
|
486
|
-
value: function () {
|
|
487
|
-
var _joinAudioByComputer = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
488
|
-
var shouldIncludeMicrophone, hasOpenMicrophonePrivilege, includeMicrophone;
|
|
489
|
-
return _regeneratorRuntime.wrap(function (_context4) {
|
|
490
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
491
|
-
case 0:
|
|
492
|
-
if (!(this._sharedDevicePrivilegeDataSource && this._devicePrivilegeProvider)) {
|
|
493
|
-
_context4.next = 2;
|
|
494
|
-
break;
|
|
495
|
-
}
|
|
496
|
-
shouldIncludeMicrophone = this._sharedDevicePrivilegeDataSource.shouldIncludeMicrophone;
|
|
497
|
-
_context4.next = 1;
|
|
498
|
-
return this._devicePrivilegeProvider.hasOpenMicrophonePrivilege();
|
|
499
|
-
case 1:
|
|
500
|
-
hasOpenMicrophonePrivilege = _context4.sent;
|
|
501
|
-
includeMicrophone = shouldIncludeMicrophone && hasOpenMicrophonePrivilege;
|
|
502
|
-
this._deviceProvider.connectAudio(includeMicrophone);
|
|
503
|
-
case 2:
|
|
504
|
-
case "end":
|
|
505
|
-
return _context4.stop();
|
|
506
|
-
}
|
|
507
|
-
}, _callee4, this);
|
|
508
|
-
}));
|
|
509
|
-
function joinAudioByComputer() {
|
|
510
|
-
return _joinAudioByComputer.apply(this, arguments);
|
|
511
|
-
}
|
|
512
|
-
return joinAudioByComputer;
|
|
513
|
-
}()
|
|
514
|
-
}, {
|
|
515
|
-
key: "stopAudioByComputer",
|
|
516
|
-
value: function stopAudioByComputer() {
|
|
517
|
-
this._deviceProvider.disconnectAudio();
|
|
518
|
-
}
|
|
519
|
-
}, {
|
|
520
|
-
key: "_setResetTimer",
|
|
521
|
-
value: function _setResetTimer() {
|
|
522
|
-
var _this2 = this;
|
|
523
|
-
var reset = function reset() {
|
|
524
|
-
_this2.outgoingCall = false;
|
|
525
|
-
_this2.phoneCallReason = FcrRoomConnectorSessionReason.NONE;
|
|
526
|
-
_this2.phoneCallState = FcrRoomConnectorSessionState.CALLING;
|
|
527
|
-
};
|
|
528
|
-
if (this.isHangup) return reset();
|
|
529
|
-
this._failureTimer = setTimeout(reset, 1500);
|
|
530
|
-
}
|
|
531
|
-
}, {
|
|
532
|
-
key: "_rememberNumber",
|
|
533
|
-
value: function _rememberNumber(zone, phone) {
|
|
534
|
-
var list = this.rememberedNumberList;
|
|
535
|
-
if (!zone || !phone) return;
|
|
536
|
-
if (list.length < 6) {
|
|
537
|
-
if (!list.some(function (item) {
|
|
538
|
-
return isEqual(item, {
|
|
539
|
-
zone: zone,
|
|
540
|
-
phone: phone
|
|
541
|
-
});
|
|
542
|
-
})) {
|
|
543
|
-
list.unshift({
|
|
544
|
-
zone: zone,
|
|
545
|
-
phone: phone
|
|
546
|
-
});
|
|
547
|
-
this.rememberedNumberList = list;
|
|
548
|
-
storage.set('connection_list', JSON.stringify(list));
|
|
549
|
-
}
|
|
550
|
-
} else {
|
|
551
|
-
var result = list.filter(function (item) {
|
|
552
|
-
return isEqual(item, {
|
|
553
|
-
zone: zone,
|
|
554
|
-
phone: phone
|
|
555
|
-
});
|
|
556
|
-
});
|
|
557
|
-
result.unshift({
|
|
558
|
-
zone: zone,
|
|
559
|
-
phone: phone
|
|
560
|
-
});
|
|
561
|
-
this.rememberedNumberList = result;
|
|
562
|
-
storage.set('connection_list', JSON.stringify(result));
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}, {
|
|
566
|
-
key: "_phoneCallUpdated",
|
|
567
|
-
value: function _phoneCallUpdated(session, state, reason) {
|
|
568
|
-
if (this._sessionId !== session.sessionId) return;
|
|
569
|
-
this.connectSession = session;
|
|
570
|
-
this.calling = false;
|
|
571
|
-
switch (state) {
|
|
572
|
-
case FcrRoomConnectorSessionState.RINGING:
|
|
573
|
-
this.phoneCallState = state;
|
|
574
|
-
this.phoneCallReason = reason;
|
|
575
|
-
break;
|
|
576
|
-
case FcrRoomConnectorSessionState.CALLING:
|
|
577
|
-
this.phoneCallState = state;
|
|
578
|
-
this.phoneCallReason = reason;
|
|
579
|
-
break;
|
|
580
|
-
case FcrRoomConnectorSessionState.END:
|
|
581
|
-
this.phoneCallState = state;
|
|
582
|
-
this.phoneCallReason = reason;
|
|
583
|
-
this._phoneCallReason(reason);
|
|
584
|
-
break;
|
|
585
|
-
default:
|
|
586
|
-
this.phoneCallState = FcrRoomConnectorSessionState.CALLING;
|
|
587
|
-
break;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}, {
|
|
591
|
-
key: "_phoneCallReason",
|
|
592
|
-
value: function _phoneCallReason(reason) {
|
|
593
|
-
switch (reason) {
|
|
594
|
-
case FcrRoomConnectorSessionReason.ACCEPTED:
|
|
595
|
-
// 已接听
|
|
596
|
-
this._messageProvider.showToastByKey({
|
|
597
|
-
key: FcrUIToastKey.FMT_PSTN_STATUS_VOICECONNECTED
|
|
598
|
-
});
|
|
599
|
-
this.closeConnectionDialog();
|
|
600
|
-
this._accepted = true;
|
|
601
|
-
break;
|
|
602
|
-
case FcrRoomConnectorSessionReason.CANCELED:
|
|
603
|
-
case FcrRoomConnectorSessionReason.LINE_BUSY:
|
|
604
|
-
case FcrRoomConnectorSessionReason.NUMBER_ERROR:
|
|
605
|
-
case FcrRoomConnectorSessionReason.REJECT:
|
|
606
|
-
case FcrRoomConnectorSessionReason.SYSTEM_ERROR:
|
|
607
|
-
case FcrRoomConnectorSessionReason.TIMEOUT:
|
|
608
|
-
case FcrRoomConnectorSessionReason.UNREGISTER:
|
|
609
|
-
case FcrRoomConnectorSessionReason.UNSUPPORTED:
|
|
610
|
-
case undefined:
|
|
611
|
-
this._setResetTimer();
|
|
612
|
-
this._accepted && this._rememberNumber(this.currentCallInfo.zone, this.currentCallInfo.phone);
|
|
613
|
-
this._accepted = false;
|
|
614
|
-
break;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
}, {
|
|
618
|
-
key: "_setStreamState",
|
|
619
|
-
value: function _setStreamState() {
|
|
620
|
-
var matchPSTN = function matchPSTN(_ref3) {
|
|
621
|
-
var connectorType = _ref3.connectorType;
|
|
622
|
-
return connectorType === FcrRoomConnectorType.PSTN;
|
|
623
|
-
};
|
|
624
|
-
var userId = this.localUser.userId;
|
|
625
|
-
var myStreams = this._streamControl.getStreamsByUserId(userId);
|
|
626
|
-
var allStreams = this._streamControl.getStreamList();
|
|
627
|
-
this.hasPstnStream = allStreams.some(matchPSTN);
|
|
628
|
-
this.hasNeedMergedStream = allStreams.some(function (stream) {
|
|
629
|
-
return stream.owner.connectorType === FcrRoomConnectorType.PSTN && stream.connectorType === FcrRoomConnectorType.PSTN;
|
|
630
|
-
});
|
|
631
|
-
if (this.hasOwnPstnStream) {
|
|
632
|
-
this._deviceProvider.setConnectType(FcrUIConnectType.PHONE);
|
|
633
|
-
}
|
|
634
|
-
return {
|
|
635
|
-
myStreams: myStreams,
|
|
636
|
-
userId: userId
|
|
637
|
-
};
|
|
638
|
-
}
|
|
639
|
-
}, {
|
|
640
|
-
key: "_handleStreamsAddedOrUpdated",
|
|
641
|
-
value: function _handleStreamsAddedOrUpdated() {
|
|
642
|
-
this._setStreamState();
|
|
643
|
-
}
|
|
644
|
-
}, {
|
|
645
|
-
key: "_handleStreamsRemoved",
|
|
646
|
-
value: function _handleStreamsRemoved(roomId, events) {
|
|
647
|
-
var _this3 = this;
|
|
648
|
-
var _this$_setStreamState = this._setStreamState(),
|
|
649
|
-
myStreams = _this$_setStreamState.myStreams,
|
|
650
|
-
userId = _this$_setStreamState.userId;
|
|
651
|
-
var _iterator = _createForOfIteratorHelper(events),
|
|
652
|
-
_step;
|
|
653
|
-
try {
|
|
654
|
-
var _loop = function _loop() {
|
|
655
|
-
var modifiedStream = _step.value.modifiedStream;
|
|
656
|
-
if (modifiedStream.connectorType !== FcrRoomConnectorType.PSTN) return {
|
|
657
|
-
v: void 0
|
|
658
|
-
};
|
|
659
|
-
if (modifiedStream.owner.userId === userId && _this3._deviceProvider.connectType === FcrUIConnectType.PHONE) {
|
|
660
|
-
if (_this3._deviceProvider.isAudioConnected) {
|
|
661
|
-
_this3._deviceProvider.setConnectType(FcrUIConnectType.COMPUTER);
|
|
662
|
-
} else {
|
|
663
|
-
_this3._deviceProvider.setConnectType(FcrUIConnectType.NONE);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
if (myStreams.findIndex(function (stream) {
|
|
667
|
-
return stream.streamId === modifiedStream.streamId;
|
|
668
|
-
}) === -1 && _this3.connectSession) {
|
|
669
|
-
if (modifiedStream.owner.userId === userId) {
|
|
670
|
-
_this3._phoneCallUpdated(_this3.connectSession, FcrRoomConnectorSessionState.END, FcrRoomConnectorSessionReason.LINE_BUSY);
|
|
671
|
-
_this3.isHangup = true;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
},
|
|
675
|
-
_ret;
|
|
676
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
677
|
-
_ret = _loop();
|
|
678
|
-
if (_ret) return _ret.v;
|
|
679
|
-
}
|
|
680
|
-
} catch (err) {
|
|
681
|
-
_iterator.e(err);
|
|
682
|
-
} finally {
|
|
683
|
-
_iterator.f();
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}]);
|
|
687
|
-
}();
|
|
688
|
-
_ConnectionGatewayStore = ConnectionGatewayStore;
|
|
689
|
-
var _applyDecs$e = _slicedToArray(_applyDecs(_ConnectionGatewayStore, [[observable, 1, "activeTabKey"], [observable, 1, "rememberMe"], [observable, 1, "rememberedNumberList"], [observable, 1, "connectionPhoneInfo"], [observable, 1, "currentRegion"], [observable, 1, "currentCallInfo"], [observable, 1, "connectInfo"], [observable, 1, "phoneCallState"], [observable, 1, "phoneCallReason"], [observable, 1, "connectSession"], [observable, 1, "calling"], [observable, 1, "outgoingCall"], [observable, 1, "isHangup"], [observable, 1, "hasPstnStream"], [observable, 1, "hasNeedMergedStream"], [computed, 3, "connectType"], [bound, 2, "openAudioSettings"], [bound, 2, "closeConnectionDialog"], [_onTabChangeDecs, 18, "onTabChange"], [_onGetConnectInfoDecs, 18, "onGetConnectInfo"], [_regionChangeHandlerDecs, 18, "regionChangeHandler"], [bound, 2, "setConnectionInfo"], [bound, 2, "setCurrentCallInfo"], [_startCallDecs, 18, "startCall"], [_stopCallDecs, 18, "stopCall"], [_setRememberMeDecs, 18, "setRememberMe"], [_initRememberedDataDecs, 18, "initRememberedData"], [bound, 2, "joinAudioByComputer"], [bound, 2, "stopAudioByComputer"], [bound, 2, "_setResetTimer"], [_rememberNumberDecs, 18, "_rememberNumber"], [_phoneCallUpdatedDecs, 18, "_phoneCallUpdated"], [_phoneCallReasonDecs, 18, "_phoneCallReason"], [_setStreamStateDecs, 18, "_setStreamState"], [_handleStreamsAddedOrUpdatedDecs, 18, "_handleStreamsAddedOrUpdated"], [_handleStreamsRemovedDecs, 18, "_handleStreamsRemoved"]], []).e, 16);
|
|
690
|
-
_init_activeTabKey = _applyDecs$e[0];
|
|
691
|
-
_init_rememberMe = _applyDecs$e[1];
|
|
692
|
-
_init_rememberedNumberList = _applyDecs$e[2];
|
|
693
|
-
_init_connectionPhoneInfo = _applyDecs$e[3];
|
|
694
|
-
_init_currentRegion = _applyDecs$e[4];
|
|
695
|
-
_init_currentCallInfo = _applyDecs$e[5];
|
|
696
|
-
_init_connectInfo = _applyDecs$e[6];
|
|
697
|
-
_init_phoneCallState = _applyDecs$e[7];
|
|
698
|
-
_init_phoneCallReason = _applyDecs$e[8];
|
|
699
|
-
_init_connectSession = _applyDecs$e[9];
|
|
700
|
-
_init_calling = _applyDecs$e[10];
|
|
701
|
-
_init_outgoingCall = _applyDecs$e[11];
|
|
702
|
-
_init_isHangup = _applyDecs$e[12];
|
|
703
|
-
_init_hasPstnStream = _applyDecs$e[13];
|
|
704
|
-
_init_hasNeedMergedStream = _applyDecs$e[14];
|
|
705
|
-
_initProto = _applyDecs$e[15];
|
|
706
|
-
export { ConnectionGatewayStore as default };
|
|
707
|
-
export var StoreContext = /*#__PURE__*/createContext(null);
|