fcr-ui-scene 3.4.1 → 3.4.2

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 (567) hide show
  1. package/lib/base.d.ts +40 -5
  2. package/lib/base.js +237 -22
  3. package/lib/common/device-store.d.ts +14 -23
  4. package/lib/common/device-store.js +252 -361
  5. package/lib/common/device-stream-store.d.ts +14 -8
  6. package/lib/common/device-stream-store.js +116 -254
  7. package/lib/common/event-store.d.ts +10 -35
  8. package/lib/common/event-store.js +13 -64
  9. package/lib/common/security-store.d.ts +39 -47
  10. package/lib/common/security-store.js +379 -335
  11. package/lib/creator.d.ts +1 -1
  12. package/lib/creator.js +4 -9
  13. package/lib/electron/app.js +4 -2
  14. package/lib/electron/bootstrap-dev.js +0 -7
  15. package/lib/electron/bootstrap-sdk.js +10 -0
  16. package/lib/electron/injections.d.ts +2 -0
  17. package/lib/electron/injections.js +17 -2
  18. package/lib/electron/logger.d.ts +0 -4
  19. package/lib/electron/logger.js +2 -5
  20. package/lib/electron/main.js +1 -1
  21. package/lib/electron/plugins/devtool-shortcut.js +10 -1
  22. package/lib/electron/plugins/meeting-state.js +1 -1
  23. package/lib/electron/preload.js +3 -1
  24. package/lib/fragments/control-bar/cloud-recording-buttons.js +1 -1
  25. package/lib/fragments/control-bar/control-bar-store.d.ts +1 -44
  26. package/lib/fragments/control-bar/control-bar-store.js +80 -457
  27. package/lib/fragments/control-bar/device/index.js +3 -5
  28. package/lib/fragments/control-bar/index.css +10 -15
  29. package/lib/fragments/control-bar/index.js +0 -24
  30. package/lib/fragments/control-bar/more-actions/index.css +0 -53
  31. package/lib/fragments/control-bar/more-actions/index.js +38 -73
  32. package/lib/fragments/control-bar/security-content/index.css +0 -75
  33. package/lib/fragments/control-bar/security-content/index.js +19 -105
  34. package/lib/fragments/control-bar/share-state-nav/index.js +1 -1
  35. package/lib/fragments/control-bar/view.js +8 -23
  36. package/lib/fragments/live-streaming/store.d.ts +1 -1
  37. package/lib/fragments/live-streaming/store.js +1 -1
  38. package/lib/fragments/live-streaming/view.js +2 -4
  39. package/lib/fragments/share-screen-selection/selection-store.d.ts +1 -1
  40. package/lib/fragments/share-screen-selection/selection-store.js +1 -1
  41. package/lib/fragments/share-screen-selection/view.js +20 -20
  42. package/lib/fragments/toolbar/components/eraser-picker.js +1 -1
  43. package/lib/fragments/toolbar/components/pen-picker.js +1 -1
  44. package/lib/fragments/toolbar/components/shape-picker.js +1 -1
  45. package/lib/fragments/toolbar/components/wrapper.js +1 -1
  46. package/lib/fragments/toolbar/hooks.js +1 -1
  47. package/lib/fragments/toolbar/store.d.ts +1 -1
  48. package/lib/global.css +5 -0
  49. package/lib/index.d.ts +1 -0
  50. package/lib/index.js +7 -4
  51. package/lib/login-confirm-dialog.d.ts +1 -0
  52. package/lib/login-confirm-dialog.js +7 -2
  53. package/lib/modules/Interpreter/action/delete-btn/index.d.ts +2 -2
  54. package/lib/modules/Interpreter/action/edit-btn/index.js +2 -2
  55. package/lib/modules/Interpreter/action/switch-btn/index.js +5 -5
  56. package/lib/modules/Interpreter/dialog-content/index.d.ts +2 -2
  57. package/lib/modules/Interpreter/dialog-content/index.js +4 -4
  58. package/lib/modules/Interpreter/index.d.ts +11 -4
  59. package/lib/modules/Interpreter/index.js +23 -8
  60. package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.d.ts +2 -2
  61. package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-language/index.js +3 -3
  62. package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.d.ts +2 -2
  63. package/lib/modules/Interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +14 -14
  64. package/lib/modules/Interpreter/interpreter-list/interpreter-item/index.d.ts +2 -2
  65. package/lib/modules/Interpreter/interpreter-list/interpreter-item/index.js +2 -2
  66. package/lib/modules/Interpreter/store.d.ts +23 -84
  67. package/lib/modules/Interpreter/store.js +204 -1216
  68. package/lib/modules/Interpreter/type.d.ts +12 -29
  69. package/lib/modules/Interpreter/type.js +2 -10
  70. package/lib/modules/Interpreter/utils.d.ts +1 -5
  71. package/lib/modules/Interpreter/utils.js +28 -86
  72. package/lib/modules/Interpreter/view.js +19 -3
  73. package/lib/modules/action-bar/action-bar-collapes-items.d.ts +1 -4
  74. package/lib/modules/action-bar/action-bar-collapes-items.js +21 -38
  75. package/lib/modules/action-bar/chat/index.js +8 -8
  76. package/lib/modules/action-bar/components/apps/app-item/index.css +1 -2
  77. package/lib/modules/action-bar/components/apps/app-item/index.d.ts +1 -10
  78. package/lib/modules/action-bar/components/apps/appitems.d.ts +1 -3
  79. package/lib/modules/action-bar/components/apps/index.css +2 -2
  80. package/lib/modules/action-bar/components/apps/index.js +2 -3
  81. package/lib/modules/action-bar/components/collapse/index.d.ts +8 -0
  82. package/lib/modules/action-bar/components/collapse/index.js +222 -0
  83. package/lib/modules/action-bar/components/interpreter/index.d.ts +1 -5
  84. package/lib/modules/action-bar/components/item/index.d.ts +9 -0
  85. package/lib/modules/action-bar/components/item/index.js +164 -0
  86. package/lib/modules/action-bar/components/leave/assign-host.d.ts +1 -8
  87. package/lib/modules/action-bar/components/leave/assign-host.js +1 -1
  88. package/lib/modules/action-bar/components/leave/index.js +9 -24
  89. package/lib/modules/action-bar/components/leave/leave-meeting.d.ts +1 -16
  90. package/lib/modules/action-bar/components/more/index.js +13 -9
  91. package/lib/modules/action-bar/components/more/poppover-content.d.ts +1 -4
  92. package/lib/modules/action-bar/components/more/poppover-content.js +28 -5
  93. package/lib/modules/action-bar/components/notification-bar/assets/dome.png +0 -0
  94. package/lib/modules/action-bar/components/notification-bar/assets/fcr_translateswitch.png +0 -0
  95. package/lib/modules/action-bar/components/notification-bar/components/interpreter/index.css +58 -0
  96. package/lib/modules/action-bar/components/notification-bar/components/interpreter/index.d.ts +8 -0
  97. package/lib/modules/action-bar/components/notification-bar/components/interpreter/index.js +100 -0
  98. package/lib/modules/action-bar/components/notification-bar/components/virtual-image/index.css +56 -0
  99. package/lib/modules/action-bar/components/notification-bar/components/virtual-image/index.d.ts +5 -0
  100. package/lib/modules/action-bar/components/notification-bar/components/virtual-image/index.js +33 -0
  101. package/lib/modules/action-bar/components/notification-bar/index.css +74 -0
  102. package/lib/modules/action-bar/components/notification-bar/index.d.ts +2 -0
  103. package/lib/modules/action-bar/components/notification-bar/index.js +99 -0
  104. package/lib/modules/action-bar/components/participants/index.js +2 -2
  105. package/lib/modules/action-bar/components/placement/index.d.ts +4 -0
  106. package/lib/modules/action-bar/components/placement/index.js +18 -0
  107. package/lib/modules/action-bar/components/record/stop-record-dialog.d.ts +1 -3
  108. package/lib/modules/action-bar/components/screen-share/submenu.js +25 -2
  109. package/lib/modules/action-bar/components/security/index.js +3 -1
  110. package/lib/modules/action-bar/components/smaller/index.d.ts +1 -0
  111. package/lib/modules/action-bar/components/smaller/index.js +52 -0
  112. package/lib/modules/action-bar/components/trigger-input-language-room/fcr_translateswitch.png +0 -0
  113. package/lib/modules/action-bar/components/trigger-input-language-room/index.css +86 -0
  114. package/lib/modules/action-bar/components/trigger-input-language-room/index.d.ts +3 -0
  115. package/lib/modules/action-bar/components/trigger-input-language-room/index.js +215 -0
  116. package/lib/modules/action-bar/components/trigger-output-language/fcr_translateswitch.png +0 -0
  117. package/lib/modules/action-bar/components/trigger-output-language/index.css +86 -0
  118. package/lib/modules/action-bar/components/trigger-output-language/index.d.ts +2 -0
  119. package/lib/modules/action-bar/components/trigger-output-language/index.js +230 -0
  120. package/lib/modules/action-bar/components/trigger-output-language-room/constant.d.ts +10 -0
  121. package/lib/modules/action-bar/components/trigger-output-language-room/constant.js +8 -0
  122. package/lib/modules/action-bar/components/trigger-output-language-room/guide-tooltip/index.css +22 -0
  123. package/lib/modules/action-bar/components/trigger-output-language-room/guide-tooltip/index.d.ts +3 -0
  124. package/lib/modules/action-bar/components/trigger-output-language-room/guide-tooltip/index.js +75 -0
  125. package/lib/modules/action-bar/components/trigger-output-language-room/index.d.ts +8 -0
  126. package/lib/modules/action-bar/components/trigger-output-language-room/index.js +98 -0
  127. package/lib/modules/action-bar/components/trigger-output-language-room/trigger-language-room.d.ts +5 -0
  128. package/lib/modules/action-bar/components/trigger-output-language-room/trigger-language-room.js +66 -0
  129. package/lib/modules/action-bar/components/trigger-output-language-room/trigger-main-room.d.ts +5 -0
  130. package/lib/modules/action-bar/components/trigger-output-language-room/trigger-main-room.js +37 -0
  131. package/lib/modules/action-bar/components/trigger-output-language-room/useChangeOutputRoomTool.d.ts +12 -0
  132. package/lib/modules/action-bar/components/trigger-output-language-room/useChangeOutputRoomTool.js +138 -0
  133. package/lib/modules/action-bar/components/trigger-subscribe-language/guide-tooltip/index.css +22 -0
  134. package/lib/modules/action-bar/components/trigger-subscribe-language/guide-tooltip/index.d.ts +3 -0
  135. package/lib/modules/action-bar/components/trigger-subscribe-language/guide-tooltip/index.js +70 -0
  136. package/lib/modules/action-bar/components/trigger-subscribe-language/index.d.ts +5 -0
  137. package/lib/modules/action-bar/components/trigger-subscribe-language/index.js +209 -0
  138. package/lib/modules/action-bar/device/index.css +2 -7
  139. package/lib/modules/action-bar/device/index.js +24 -22
  140. package/lib/modules/action-bar/enums.d.ts +23 -0
  141. package/lib/modules/action-bar/enums.js +35 -0
  142. package/lib/modules/action-bar/index.d.ts +36 -6
  143. package/lib/modules/action-bar/index.dev.d.ts +0 -1
  144. package/lib/modules/action-bar/index.dev.js +94 -121
  145. package/lib/modules/action-bar/index.js +46 -18
  146. package/lib/modules/action-bar/leave/assign-host.d.ts +0 -3
  147. package/lib/modules/action-bar/leave/assign-host.js +4 -2
  148. package/lib/modules/action-bar/leave/index.css +0 -10
  149. package/lib/modules/action-bar/leave/index.js +34 -84
  150. package/lib/modules/action-bar/leave/leave-meeting.d.ts +1 -13
  151. package/lib/modules/action-bar/leave/leave-meeting.js +19 -37
  152. package/lib/modules/action-bar/live-streaming/index.js +3 -3
  153. package/lib/modules/action-bar/more/index.js +6 -9
  154. package/lib/modules/action-bar/more/poppover-content.js +16 -37
  155. package/lib/modules/action-bar/participants/index.css +0 -12
  156. package/lib/modules/action-bar/participants/index.js +16 -23
  157. package/lib/modules/action-bar/record/index.js +4 -4
  158. package/lib/modules/action-bar/screen-share/index.js +5 -14
  159. package/lib/modules/action-bar/screen-share/submenu.js +26 -20
  160. package/lib/modules/action-bar/security/drop-menu.js +22 -137
  161. package/lib/modules/action-bar/security/index.js +6 -12
  162. package/lib/modules/action-bar/settings/index.js +4 -4
  163. package/lib/modules/action-bar/smaller.js +5 -5
  164. package/lib/modules/action-bar/store.d.ts +84 -98
  165. package/lib/modules/action-bar/store.js +567 -707
  166. package/lib/modules/action-bar/types.d.ts +94 -0
  167. package/lib/modules/action-bar/types.js +6 -0
  168. package/lib/modules/action-bar/view.d.ts +1 -2
  169. package/lib/modules/action-bar/view.js +11 -11
  170. package/lib/modules/audio-stream/index.d.ts +22 -10
  171. package/lib/modules/audio-stream/index.js +78 -82
  172. package/lib/modules/chat/chat-bar/index.css +0 -6
  173. package/lib/modules/chat/chat-bar/index.d.ts +3 -3
  174. package/lib/modules/chat/chat-bar/index.js +39 -51
  175. package/lib/modules/chat/chat-room-store.d.ts +135 -0
  176. package/lib/modules/chat/chat-room-store.js +954 -0
  177. package/lib/modules/chat/chat-select/index.css +7 -27
  178. package/lib/modules/chat/chat-select/index.d.ts +1 -1
  179. package/lib/modules/chat/chat-select/index.js +4 -18
  180. package/lib/modules/chat/chat.d.ts +2 -1
  181. package/lib/modules/chat/chat.js +128 -196
  182. package/lib/modules/chat/components/chat-action/index.d.ts +1 -0
  183. package/lib/modules/chat/components/chat-action/index.js +28 -0
  184. package/lib/modules/chat/components/chat-bar/index.css +85 -0
  185. package/lib/modules/chat/components/chat-bar/index.d.ts +3 -0
  186. package/lib/modules/chat/components/chat-bar/index.js +145 -0
  187. package/lib/modules/chat/components/chat-select/index.css +185 -0
  188. package/lib/modules/chat/components/chat-select/index.d.ts +3 -0
  189. package/lib/modules/chat/components/chat-select/index.js +237 -0
  190. package/lib/modules/chat/components/message-list/index.d.ts +4 -0
  191. package/lib/modules/chat/components/message-list/index.js +650 -0
  192. package/lib/modules/chat/index.d.ts +13 -5
  193. package/lib/modules/chat/index.dev.d.ts +0 -1
  194. package/lib/modules/chat/index.dev.js +71 -72
  195. package/lib/modules/chat/index.js +45 -22
  196. package/lib/modules/chat/message-list.js +51 -68
  197. package/lib/modules/chat/mock.d.ts +1 -1
  198. package/lib/modules/chat/store.d.ts +17 -162
  199. package/lib/modules/chat/store.js +95 -963
  200. package/lib/modules/chat/types.d.ts +70 -0
  201. package/lib/modules/chat/types.js +17 -0
  202. package/lib/modules/chat/view.d.ts +10 -0
  203. package/lib/modules/chat/view.js +372 -0
  204. package/lib/modules/components/device-control/components/audio-menu/index.js +2 -2
  205. package/lib/modules/components/device-control/components/microphone/index.js +7 -7
  206. package/lib/modules/components/device-control/store.d.ts +11 -12
  207. package/lib/modules/components/device-control/store.js +46 -49
  208. package/lib/modules/components/dialog-container/component/body.js +2 -1
  209. package/lib/modules/components/dialog-container/index.d.ts +2 -2
  210. package/lib/modules/components/leave-meeting/components/assign-host.d.ts +3 -0
  211. package/lib/modules/components/leave-meeting/components/assign-host.js +70 -0
  212. package/lib/modules/components/leave-meeting/components/index.css +125 -0
  213. package/lib/modules/components/leave-meeting/index.d.ts +4 -0
  214. package/lib/modules/components/leave-meeting/index.js +147 -0
  215. package/lib/modules/components/leave-meeting/store.d.ts +31 -0
  216. package/lib/modules/components/leave-meeting/store.js +292 -0
  217. package/lib/modules/components/member-window/index.d.ts +1 -1
  218. package/lib/modules/components/member-window/index.js +12 -6
  219. package/lib/modules/components/security-menu/index.d.ts +2 -0
  220. package/lib/modules/components/security-menu/index.js +34 -35
  221. package/lib/modules/components/tab-frame/index.d.ts +2 -2
  222. package/lib/modules/components/tab-frame/index.js +26 -5
  223. package/lib/modules/connection-gateway/components/computer/index.js +4 -4
  224. package/lib/modules/connection-gateway/components/phone/components/callinfo/index.d.ts +1 -1
  225. package/lib/modules/connection-gateway/components/phone/index.js +2 -2
  226. package/lib/modules/connection-gateway/components/tabs/index.js +1 -2
  227. package/lib/modules/connection-gateway/enums.d.ts +4 -0
  228. package/lib/modules/connection-gateway/enums.js +12 -0
  229. package/lib/modules/connection-gateway/index.d.ts +13 -4
  230. package/lib/modules/connection-gateway/index.js +25 -15
  231. package/lib/modules/connection-gateway/store.d.ts +22 -18
  232. package/lib/modules/connection-gateway/store.js +60 -36
  233. package/lib/modules/connection-gateway/types.d.ts +4 -0
  234. package/lib/modules/connection-gateway/types.js +6 -0
  235. package/lib/modules/connection-gateway/view.js +2 -2
  236. package/lib/modules/control-bar/components/meeting-details/index.js +30 -25
  237. package/lib/modules/control-bar/components/more-actions/index.css +18 -0
  238. package/lib/modules/control-bar/components/more-actions/index.d.ts +1 -5
  239. package/lib/modules/control-bar/components/more-actions/index.js +58 -9
  240. package/lib/modules/control-bar/components/share-state-nav/index.d.ts +1 -7
  241. package/lib/modules/control-bar/components/share-state-nav/index.js +2 -1
  242. package/lib/modules/control-bar/components/stop-live-streaming/stop-button.d.ts +1 -1
  243. package/lib/modules/control-bar/components/stop-live-streaming/stop-button.js +2 -2
  244. package/lib/modules/control-bar/components/transfer-position-icon/index.d.ts +1 -10
  245. package/lib/modules/control-bar/components/transfer-position-icon/index.js +7 -12
  246. package/lib/modules/control-bar/enums.d.ts +21 -0
  247. package/lib/modules/control-bar/enums.js +31 -0
  248. package/lib/modules/control-bar/index.d.ts +30 -7
  249. package/lib/modules/control-bar/index.js +46 -27
  250. package/lib/modules/control-bar/store.d.ts +38 -26
  251. package/lib/modules/control-bar/store.js +172 -282
  252. package/lib/modules/control-bar/types.d.ts +20 -0
  253. package/lib/modules/control-bar/types.js +6 -0
  254. package/lib/modules/control-bar/view.js +68 -34
  255. package/lib/modules/device-pretest/index.js +4 -4
  256. package/lib/modules/device-pretest/settings/video-settings-basic.js +1 -1
  257. package/lib/modules/device-pretest/store.d.ts +8 -9
  258. package/lib/modules/device-pretest/store.js +52 -36
  259. package/lib/modules/dialog/components/Interpreter/electron.js +21 -15
  260. package/lib/modules/dialog/components/Interpreter/index.js +2 -2
  261. package/lib/modules/dialog/components/chat/electron.d.ts +1 -1
  262. package/lib/modules/dialog/components/chat/electron.js +19 -10
  263. package/lib/modules/dialog/components/chat/index.js +2 -2
  264. package/lib/modules/dialog/components/confirm/electron.d.ts +1 -1
  265. package/lib/modules/dialog/components/confirm/electron.js +68 -38
  266. package/lib/modules/dialog/components/confirm/index.js +1 -1
  267. package/lib/modules/dialog/components/connection-gateway/electron.d.ts +1 -1
  268. package/lib/modules/dialog/components/connection-gateway/electron.js +8 -10
  269. package/lib/modules/dialog/components/connection-gateway/index.css +2 -0
  270. package/lib/modules/dialog/components/connection-gateway/index.d.ts +3 -1
  271. package/lib/modules/dialog/components/connection-gateway/index.js +20 -7
  272. package/lib/modules/dialog/components/connection-gateway/tabs.d.ts +6 -0
  273. package/lib/modules/dialog/components/connection-gateway/tabs.js +44 -0
  274. package/lib/modules/dialog/components/control-bar/index.d.ts +5 -1
  275. package/lib/modules/dialog/components/control-bar/index.js +122 -9
  276. package/lib/modules/dialog/components/device-setting/electron.js +6 -2
  277. package/lib/modules/dialog/components/device-setting/index.js +2 -2
  278. package/lib/modules/dialog/components/dialog-container/component/body.d.ts +7 -0
  279. package/lib/modules/dialog/components/dialog-container/component/body.js +77 -0
  280. package/lib/modules/dialog/components/dialog-container/index.css +81 -0
  281. package/lib/modules/dialog/components/dialog-container/index.d.ts +16 -0
  282. package/lib/modules/dialog/components/dialog-container/index.js +112 -0
  283. package/lib/modules/dialog/components/invite/index.js +32 -7
  284. package/lib/modules/dialog/components/live-streaming/index.js +9 -5
  285. package/lib/modules/dialog/components/participant/electron.js +11 -5
  286. package/lib/modules/dialog/components/participant/index.js +4 -3
  287. package/lib/modules/dialog/components/share-screen-selection/index.js +9 -5
  288. package/lib/modules/dialog/components/system-preference/electron.js +1 -1
  289. package/lib/modules/dialog/components/toast/index.js +1 -1
  290. package/lib/modules/dialog/components/video-window/index.d.ts +2 -0
  291. package/lib/modules/dialog/components/video-window/index.js +148 -0
  292. package/lib/modules/dialog/components/whiteboard/index.js +2 -2
  293. package/lib/modules/dialog/dialogs.d.ts +2 -5
  294. package/lib/modules/dialog/dialogs.js +2 -157
  295. package/lib/modules/dialog/hooks/useElectron.d.ts +3 -25
  296. package/lib/modules/dialog/hooks/useElectron.js +91 -35
  297. package/lib/modules/dialog/index.d.ts +30 -4
  298. package/lib/modules/dialog/index.js +62 -6
  299. package/lib/modules/dialog/store.d.ts +46 -12
  300. package/lib/modules/dialog/store.js +121 -65
  301. package/lib/modules/dialog/types/index.d.ts +14 -3
  302. package/lib/modules/event-confirm/index.css +1 -1
  303. package/lib/modules/event-confirm/index.d.ts +13 -6
  304. package/lib/modules/event-confirm/index.js +28 -11
  305. package/lib/modules/event-confirm/store.d.ts +9 -3
  306. package/lib/modules/event-confirm/store.js +16 -7
  307. package/lib/modules/event-confirm/view.js +5 -1
  308. package/lib/modules/event-toast/index.d.ts +7 -6
  309. package/lib/modules/event-toast/index.js +19 -8
  310. package/lib/modules/event-toast/store.d.ts +8 -3
  311. package/lib/modules/event-toast/store.js +15 -6
  312. package/lib/modules/invite/components/error-tips.d.ts +4 -0
  313. package/lib/modules/invite/components/error-tips.js +18 -0
  314. package/lib/modules/invite/components/pstn-invite.d.ts +2 -0
  315. package/lib/modules/invite/components/pstn-invite.js +297 -0
  316. package/lib/modules/invite/components/voip-invite.d.ts +1 -0
  317. package/lib/modules/invite/components/voip-invite.js +276 -0
  318. package/lib/modules/invite/enums.d.ts +22 -0
  319. package/lib/modules/invite/enums.js +33 -0
  320. package/lib/modules/invite/index.d.ts +7 -8
  321. package/lib/modules/invite/index.js +17 -15
  322. package/lib/modules/invite/pstn-invite.js +9 -7
  323. package/lib/modules/invite/store.d.ts +11 -26
  324. package/lib/modules/invite/store.js +55 -25
  325. package/lib/modules/invite/types.d.ts +14 -0
  326. package/lib/modules/invite/types.js +6 -0
  327. package/lib/modules/invite/view.d.ts +0 -4
  328. package/lib/modules/invite/view.js +7 -11
  329. package/lib/modules/invite/voip-invite.js +6 -5
  330. package/lib/modules/layout/components/Aside.js +34 -17
  331. package/lib/modules/layout/components/Carousel.js +1 -1
  332. package/lib/modules/layout/components/Gallery.js +1 -1
  333. package/lib/modules/layout/components/index.d.ts +1 -1
  334. package/lib/modules/layout/components/index.js +4 -4
  335. package/lib/modules/layout/components/who-is-speaking.d.ts +2 -0
  336. package/lib/modules/layout/components/who-is-speaking.js +60 -0
  337. package/lib/modules/layout/index.d.ts +26 -4
  338. package/lib/modules/layout/index.dev.d.ts +0 -1
  339. package/lib/modules/layout/index.dev.js +312 -386
  340. package/lib/modules/layout/index.js +25 -10
  341. package/lib/modules/layout/member-window/index.css +18 -116
  342. package/lib/modules/layout/member-window/index.d.ts +3 -10
  343. package/lib/modules/layout/member-window/index.js +115 -227
  344. package/lib/modules/layout/store.d.ts +61 -71
  345. package/lib/modules/layout/store.js +311 -573
  346. package/lib/modules/layout/view.d.ts +2 -0
  347. package/lib/modules/layout/view.js +127 -2
  348. package/lib/modules/live-streaming/index.d.ts +15 -7
  349. package/lib/modules/live-streaming/index.dev.js +13 -13
  350. package/lib/modules/live-streaming/index.js +20 -15
  351. package/lib/modules/live-streaming/store.d.ts +21 -14
  352. package/lib/modules/live-streaming/store.js +84 -144
  353. package/lib/modules/live-streaming/view.js +2 -2
  354. package/lib/modules/notification/index.d.ts +9 -11
  355. package/lib/modules/notification/index.js +21 -14
  356. package/lib/modules/notification/interpreter-status/index.js +1 -2
  357. package/lib/modules/notification/store.d.ts +5 -11
  358. package/lib/modules/notification/store.js +12 -62
  359. package/lib/modules/notification/view.d.ts +5 -3
  360. package/lib/modules/notification/view.js +8 -5
  361. package/lib/modules/offscreen-pulling/index.js +1 -1
  362. package/lib/modules/participant/attendee/index.css +51 -0
  363. package/lib/modules/participant/attendee/index.d.ts +5 -8
  364. package/lib/modules/participant/attendee/index.js +15 -61
  365. package/lib/modules/participant/components/attendee/components/microphone-indicator/index.d.ts +6 -0
  366. package/lib/modules/participant/components/attendee/components/microphone-indicator/index.js +28 -0
  367. package/lib/modules/participant/components/attendee/components/user-avatar/index.d.ts +7 -0
  368. package/lib/modules/participant/components/attendee/components/user-avatar/index.js +39 -0
  369. package/lib/modules/participant/components/attendee/index.css +69 -0
  370. package/lib/modules/participant/components/attendee/index.d.ts +4 -0
  371. package/lib/modules/participant/components/attendee/index.js +337 -0
  372. package/lib/modules/participant/components/can-moveable/index.d.ts +1 -0
  373. package/lib/modules/participant/components/can-moveable/index.js +68 -0
  374. package/lib/modules/participant/components/drop-menu/index.js +8 -8
  375. package/lib/modules/participant/components/footer/buttons.d.ts +2 -3
  376. package/lib/modules/participant/components/footer/buttons.js +2 -3
  377. package/lib/modules/participant/components/footer/index.js +2 -2
  378. package/lib/modules/participant/components/mute-all/index.d.ts +3 -4
  379. package/lib/modules/participant/components/mute-all/index.js +31 -44
  380. package/lib/modules/participant/components/operate-waitingroom-member/index.d.ts +2 -0
  381. package/lib/modules/participant/components/operate-waitingroom-member/index.js +48 -0
  382. package/lib/modules/participant/components/participants/index.js +27 -50
  383. package/lib/modules/participant/components/user-action/index.d.ts +17 -0
  384. package/lib/modules/participant/components/user-action/index.js +169 -0
  385. package/lib/modules/participant/index.d.ts +34 -7
  386. package/lib/modules/participant/index.dev.d.ts +0 -1
  387. package/lib/modules/participant/index.dev.js +87 -116
  388. package/lib/modules/participant/index.js +39 -13
  389. package/lib/modules/participant/member-list-data-source.d.ts +4 -1
  390. package/lib/modules/participant/member-list-data-source.js +58 -31
  391. package/lib/modules/participant/room-control-drop-menu/index.css +0 -37
  392. package/lib/modules/participant/store.d.ts +58 -25
  393. package/lib/modules/participant/store.js +321 -298
  394. package/lib/modules/participant/type.d.ts +45 -1
  395. package/lib/modules/participant/type.js +15 -1
  396. package/lib/modules/pc-audio-connect/index.css +12 -0
  397. package/lib/modules/pc-audio-connect/index.d.ts +22 -0
  398. package/lib/modules/pc-audio-connect/index.js +68 -0
  399. package/lib/modules/pc-audio-connect/store.d.ts +46 -0
  400. package/lib/modules/pc-audio-connect/store.js +301 -0
  401. package/lib/modules/pc-audio-connect/types.d.ts +0 -0
  402. package/lib/modules/pc-audio-connect/types.js +1 -0
  403. package/lib/modules/pc-audio-connect/view.d.ts +3 -0
  404. package/lib/modules/pc-audio-connect/view.js +66 -0
  405. package/lib/modules/phone-audio-connect/components/callinfo/index.css +36 -0
  406. package/lib/modules/phone-audio-connect/components/callinfo/index.d.ts +10 -0
  407. package/lib/modules/phone-audio-connect/components/callinfo/index.js +77 -0
  408. package/lib/modules/phone-audio-connect/components/calling/index.css +72 -0
  409. package/lib/modules/phone-audio-connect/components/calling/index.d.ts +7 -0
  410. package/lib/modules/phone-audio-connect/components/calling/index.js +58 -0
  411. package/lib/modules/phone-audio-connect/components/remeber/index.css +10 -0
  412. package/lib/modules/phone-audio-connect/components/remeber/index.d.ts +5 -0
  413. package/lib/modules/phone-audio-connect/components/remeber/index.js +24 -0
  414. package/lib/modules/phone-audio-connect/components/useing/index.css +46 -0
  415. package/lib/modules/phone-audio-connect/components/useing/index.d.ts +3 -0
  416. package/lib/modules/phone-audio-connect/components/useing/index.js +36 -0
  417. package/lib/modules/phone-audio-connect/enums.d.ts +4 -0
  418. package/lib/modules/phone-audio-connect/enums.js +12 -0
  419. package/lib/modules/phone-audio-connect/index.css +56 -0
  420. package/lib/modules/phone-audio-connect/index.d.ts +16 -0
  421. package/lib/modules/phone-audio-connect/index.js +63 -0
  422. package/lib/modules/phone-audio-connect/store.d.ts +46 -0
  423. package/lib/modules/phone-audio-connect/store.js +320 -0
  424. package/lib/modules/phone-audio-connect/types.d.ts +4 -0
  425. package/lib/modules/phone-audio-connect/types.js +6 -0
  426. package/lib/modules/phone-audio-connect/view.d.ts +3 -0
  427. package/lib/modules/phone-audio-connect/view.js +184 -0
  428. package/lib/modules/setting/audio-settings/audio-settings.js +5 -5
  429. package/lib/modules/setting/index.d.ts +25 -5
  430. package/lib/modules/setting/index.dev.d.ts +0 -1
  431. package/lib/modules/setting/index.dev.js +120 -81
  432. package/lib/modules/setting/index.js +35 -9
  433. package/lib/modules/setting/minutes-settings/minutes-settings.js +1 -1
  434. package/lib/modules/setting/state/index.js +3 -3
  435. package/lib/modules/setting/store.d.ts +48 -14
  436. package/lib/modules/setting/store.js +105 -114
  437. package/lib/modules/setting/translate-settings/translate-settings.js +3 -3
  438. package/lib/modules/setting/video-settings/video-settings-basic.js +19 -22
  439. package/lib/modules/setting/view.js +6 -35
  440. package/lib/modules/share-screen/components/selection/index.css +70 -0
  441. package/lib/modules/share-screen/components/selection/index.d.ts +2 -0
  442. package/lib/modules/share-screen/components/selection/index.js +267 -0
  443. package/lib/modules/share-screen/components/share-state-bar/index.css +76 -0
  444. package/lib/modules/share-screen/components/share-state-bar/index.d.ts +4 -0
  445. package/lib/modules/share-screen/components/share-state-bar/index.js +98 -0
  446. package/lib/modules/share-screen/index.d.ts +15 -18
  447. package/lib/modules/share-screen/index.dev.d.ts +0 -1
  448. package/lib/modules/share-screen/index.dev.js +90 -91
  449. package/lib/modules/share-screen/index.js +22 -22
  450. package/lib/modules/share-screen/selection/index.css +0 -4
  451. package/lib/modules/share-screen/selection/index.js +129 -126
  452. package/lib/modules/share-screen/share-state-bar/index.js +1 -1
  453. package/lib/modules/share-screen/store.d.ts +36 -32
  454. package/lib/modules/share-screen/store.js +250 -219
  455. package/lib/modules/share-screen/types.d.ts +27 -0
  456. package/lib/modules/share-screen/types.js +6 -0
  457. package/lib/modules/share-screen/view.js +1 -1
  458. package/lib/modules/sound-effect/index.d.ts +9 -4
  459. package/lib/modules/sound-effect/index.js +72 -40
  460. package/lib/modules/sound-effect/sound-effect-player.js +1 -1
  461. package/lib/modules/state-bar/index.d.ts +16 -13
  462. package/lib/modules/state-bar/index.dev.d.ts +0 -1
  463. package/lib/modules/state-bar/index.dev.js +78 -83
  464. package/lib/modules/state-bar/index.js +23 -7
  465. package/lib/modules/state-bar/meeting-details.js +24 -12
  466. package/lib/modules/state-bar/meeting-network-state.js +1 -1
  467. package/lib/modules/state-bar/store.d.ts +20 -10
  468. package/lib/modules/state-bar/store.js +84 -87
  469. package/lib/modules/state-bar/view.js +2 -2
  470. package/lib/modules/video-window/deviceState/index.d.ts +2 -2
  471. package/lib/modules/video-window/deviceState/index.js +4 -6
  472. package/lib/modules/video-window/index.css +1 -4
  473. package/lib/modules/video-window/index.d.ts +33 -6
  474. package/lib/modules/video-window/index.js +63 -15
  475. package/lib/modules/video-window/members/index.css +1 -0
  476. package/lib/modules/video-window/members/index.js +25 -11
  477. package/lib/modules/video-window/store.d.ts +58 -27
  478. package/lib/modules/video-window/store.js +166 -161
  479. package/lib/modules/waiting-room-layout/index.d.ts +11 -4
  480. package/lib/modules/waiting-room-layout/index.js +26 -13
  481. package/lib/modules/waiting-room-layout/store.d.ts +6 -3
  482. package/lib/modules/waiting-room-layout/store.js +17 -15
  483. package/lib/modules/whiteboard/components/control-bar/store.d.ts +4 -4
  484. package/lib/modules/whiteboard/components/control-bar/store.js +8 -8
  485. package/lib/modules/whiteboard/index.d.ts +20 -14
  486. package/lib/modules/whiteboard/index.js +250 -223
  487. package/lib/modules/whiteboard/view.d.ts +2 -0
  488. package/lib/modules/whiteboard/view.js +49 -0
  489. package/lib/plugins/browser-runtime-plugin.js +5 -1
  490. package/lib/providers/chat-provider.d.ts +71 -0
  491. package/lib/providers/chat-provider.js +91 -0
  492. package/lib/providers/device-privilege-provider.d.ts +52 -6
  493. package/lib/providers/device-privilege-provider.js +212 -183
  494. package/lib/providers/device-provider.d.ts +203 -45
  495. package/lib/providers/device-provider.js +486 -398
  496. package/lib/providers/device-stream-provider.d.ts +12 -13
  497. package/lib/providers/device-stream-provider.js +86 -193
  498. package/lib/providers/dialog-provider.d.ts +135 -0
  499. package/lib/providers/dialog-provider.js +204 -0
  500. package/lib/providers/event-provider.d.ts +1 -21
  501. package/lib/providers/event-provider.js +19 -57
  502. package/lib/providers/interpreter-provider.d.ts +218 -7
  503. package/lib/providers/interpreter-provider.js +1072 -80
  504. package/lib/providers/local-storage-provider.d.ts +9 -0
  505. package/lib/providers/message-provider.d.ts +69 -0
  506. package/lib/providers/message-provider.js +98 -0
  507. package/lib/providers/monitor-provider.d.ts +5 -0
  508. package/lib/providers/phone-audio-provider.d.ts +131 -0
  509. package/lib/providers/phone-audio-provider.js +515 -0
  510. package/lib/providers/privilege-provider.d.ts +325 -12
  511. package/lib/providers/privilege-provider.js +111 -295
  512. package/lib/providers/renderer-provider.d.ts +46 -4
  513. package/lib/providers/renderer-provider.js +57 -60
  514. package/lib/providers/room-provider.d.ts +113 -6
  515. package/lib/providers/room-provider.js +667 -87
  516. package/lib/providers/screen-share-provider.d.ts +65 -0
  517. package/lib/providers/screen-share-provider.js +238 -0
  518. package/lib/providers/session-provider.d.ts +30 -0
  519. package/lib/runtime.d.ts +2 -0
  520. package/lib/scenes/main-scene.d.ts +41 -3
  521. package/lib/scenes/main-scene.js +407 -246
  522. package/lib/scenes/waiting-scene.d.ts +34 -4
  523. package/lib/scenes/waiting-scene.js +163 -56
  524. package/lib/shared-data-source/chat-data.d.ts +14 -0
  525. package/lib/shared-data-source/chat-data.js +130 -0
  526. package/lib/shared-data-source/device-privilege-data.d.ts +8 -0
  527. package/lib/shared-data-source/device-privilege-data.js +25 -0
  528. package/lib/shared-data-source/interpreter.d.ts +63 -0
  529. package/lib/shared-data-source/interpreter.js +248 -0
  530. package/lib/shared-data-source/layout-data.d.ts +29 -0
  531. package/lib/shared-data-source/layout-data.js +181 -0
  532. package/lib/shared-data-source/pin-data.d.ts +9 -0
  533. package/lib/shared-data-source/pin-data.js +24 -0
  534. package/lib/shared-data-source/setting.d.ts +32 -0
  535. package/lib/shared-data-source/setting.js +153 -0
  536. package/lib/shared-data-source/speaker-spotlight.d.ts +5 -0
  537. package/lib/shared-data-source/speaker-spotlight.js +15 -0
  538. package/lib/shared-data-source/video-window.d.ts +161 -0
  539. package/lib/shared-data-source/video-window.js +1202 -0
  540. package/lib/shared-data-source/waiting-room.d.ts +19 -0
  541. package/lib/shared-data-source/waiting-room.js +158 -0
  542. package/lib/translations/enUS.d.ts +43 -17
  543. package/lib/translations/enUS.js +59 -33
  544. package/lib/translations/zhCN.d.ts +43 -17
  545. package/lib/translations/zhCN.js +57 -31
  546. package/lib/type.d.ts +270 -25
  547. package/lib/type.js +67 -2
  548. package/lib/ui-manager.d.ts +20 -16
  549. package/lib/ui-manager.js +59 -795
  550. package/lib/ui-scene.d.ts +6 -1
  551. package/lib/ui-scene.js +372 -42
  552. package/lib/utilities/constant.d.ts +63 -86
  553. package/lib/utilities/constant.js +151 -175
  554. package/lib/utilities/copyText.js +8 -7
  555. package/lib/utilities/extract.d.ts +1 -1
  556. package/lib/utilities/privilege.d.ts +4 -0
  557. package/lib/utilities/privilege.js +31 -0
  558. package/lib/utilities/setting-config-storage.d.ts +12 -0
  559. package/lib/utilities/setting-config-storage.js +102 -0
  560. package/lib/utilities/tools.d.ts +35 -3
  561. package/lib/utilities/tools.js +104 -2
  562. package/lib/utilities/video-track-render-context.d.ts +3 -4
  563. package/lib/utilities/video-track-render-context.js +1 -1
  564. package/package.json +5 -5
  565. package/public/assets/full-screen-error-boundary-img.png +0 -0
  566. package/public/assets/leave-meeting.png +0 -0
  567. package/public/index.html +24 -14
@@ -0,0 +1,1202 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.js");
4
+ require("core-js/modules/es.symbol.description.js");
5
+ require("core-js/modules/es.symbol.iterator.js");
6
+ require("core-js/modules/es.symbol.to-primitive.js");
7
+ require("core-js/modules/es.error.cause.js");
8
+ require("core-js/modules/es.error.to-string.js");
9
+ require("core-js/modules/es.array.from.js");
10
+ require("core-js/modules/es.array.is-array.js");
11
+ require("core-js/modules/es.array.slice.js");
12
+ require("core-js/modules/es.date.to-primitive.js");
13
+ require("core-js/modules/es.date.to-string.js");
14
+ require("core-js/modules/es.function.name.js");
15
+ require("core-js/modules/es.number.constructor.js");
16
+ require("core-js/modules/es.object.create.js");
17
+ require("core-js/modules/es.object.define-property.js");
18
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
19
+ require("core-js/modules/es.regexp.exec.js");
20
+ require("core-js/modules/es.regexp.test.js");
21
+ require("core-js/modules/es.regexp.to-string.js");
22
+ require("core-js/modules/esnext.function.metadata.js");
23
+ require("core-js/modules/esnext.symbol.metadata.js");
24
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
25
+ var _typeof = require("@babel/runtime/helpers/typeof");
26
+ Object.defineProperty(exports, "__esModule", {
27
+ value: true
28
+ });
29
+ exports.FcrUIVideoWindowDataSourceImpl = exports.FcrUIVideoWindowDataImpl = exports.FcrUISpeakerSpotlightPool = void 0;
30
+ require("core-js/modules/es.array.filter.js");
31
+ require("core-js/modules/es.array.find.js");
32
+ require("core-js/modules/es.array.find-index.js");
33
+ require("core-js/modules/es.array.find-last-index.js");
34
+ require("core-js/modules/es.array.for-each.js");
35
+ require("core-js/modules/es.array.iterator.js");
36
+ require("core-js/modules/es.array.push.js");
37
+ require("core-js/modules/es.array.some.js");
38
+ require("core-js/modules/es.array.sort.js");
39
+ require("core-js/modules/es.array.splice.js");
40
+ require("core-js/modules/es.array.unshift.js");
41
+ require("core-js/modules/es.date.now.js");
42
+ require("core-js/modules/es.function.bind.js");
43
+ require("core-js/modules/es.map.js");
44
+ require("core-js/modules/es.object.assign.js");
45
+ require("core-js/modules/es.object.to-string.js");
46
+ require("core-js/modules/es.string.iterator.js");
47
+ require("core-js/modules/es.weak-map.js");
48
+ require("core-js/modules/esnext.async-iterator.filter.js");
49
+ require("core-js/modules/esnext.async-iterator.find.js");
50
+ require("core-js/modules/esnext.async-iterator.for-each.js");
51
+ require("core-js/modules/esnext.async-iterator.some.js");
52
+ require("core-js/modules/esnext.iterator.constructor.js");
53
+ require("core-js/modules/esnext.iterator.filter.js");
54
+ require("core-js/modules/esnext.iterator.find.js");
55
+ require("core-js/modules/esnext.iterator.for-each.js");
56
+ require("core-js/modules/esnext.iterator.some.js");
57
+ require("core-js/modules/esnext.map.delete-all.js");
58
+ require("core-js/modules/esnext.map.emplace.js");
59
+ require("core-js/modules/esnext.map.every.js");
60
+ require("core-js/modules/esnext.map.filter.js");
61
+ require("core-js/modules/esnext.map.find.js");
62
+ require("core-js/modules/esnext.map.find-key.js");
63
+ require("core-js/modules/esnext.map.includes.js");
64
+ require("core-js/modules/esnext.map.key-of.js");
65
+ require("core-js/modules/esnext.map.map-keys.js");
66
+ require("core-js/modules/esnext.map.map-values.js");
67
+ require("core-js/modules/esnext.map.merge.js");
68
+ require("core-js/modules/esnext.map.reduce.js");
69
+ require("core-js/modules/esnext.map.some.js");
70
+ require("core-js/modules/esnext.map.update.js");
71
+ require("core-js/modules/esnext.weak-map.delete-all.js");
72
+ require("core-js/modules/esnext.weak-map.emplace.js");
73
+ require("core-js/modules/web.dom-collections.for-each.js");
74
+ require("core-js/modules/web.dom-collections.iterator.js");
75
+ require("core-js/modules/web.timers.js");
76
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
77
+ var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
78
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
79
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
80
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
81
+ var _observable = require("agora-foundation/lib/utilities/observable");
82
+ var _type = require("./../type");
83
+ var _mobx = require("mobx");
84
+ var _type2 = require("fcr-core/lib/type");
85
+ var _fcrCore = require("fcr-core");
86
+ var _base = require("../base");
87
+ var _i18n = require("agora-ui-foundation/lib/i18n");
88
+ var _FcrUIVideoWindowDataImpl, _FcrUIVideoWindowDataSourceImpl;
89
+ var _initProto, _init__videoStream, _init__audioStream, _init__spotlightEnabled, _init__isSpeakerSpotlight, _init__boardCanEdit, _init_isPin, _init_hasScreenSharing, _setVideoStreamDecs, _setVideoStreamOwnerInfoDecs, _setAudioStreamDecs, _setAudioStreamOwnerInfoDecs, _setPinDecs, _setSpotlightEnabledDecs, _setSpeakerSpotlightDecs, _setHasScreenSharingDecs, _setBoardCanEditDecs, _ref, _initProto2, _init_spotlightEnabled, _init_layoutType, _init_manualLayout, _init_pinLimitedCount, _init_mainListLimitedCount, _init_foldListLimitedCount, _init_mainList, _init_foldList, _init_spotlightStreamId, _setSpotlightEnabledDecs2, _setLayoutDecs, _onSpotlightRemovedDecs, _resetListDecs, _addBoardDecs, _updateBoardDecs, _removeBoardDecs, _mergePstnStreamOrInsertNewDataDecs, _addDecs, _updateDecs, _deleteDecs, _addPinDecs, _addPinToastDecs, _removePinToastDecs, _updateSpeakerSpotlightPositionDecs, _removePinDecs, _setSpeakerSpotlightDecs2, _toggleMainStreamDecs, _insertBeginningByPriorityDecs, _insertEndByPriorityDecs, _findInsertBeginningIndexDecs, _findInsertEndIndexDecs, _insertBoardDecs, _insertNewDataDecs, _ref3;
90
+ 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; } } }; }
91
+ 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; } }
92
+ 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; }
93
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
94
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
95
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
96
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
97
+ 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"); }
98
+ 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)]; } }; }
99
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
100
+ 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); }
101
+ 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; }
102
+ 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; }
103
+ var _A = /*#__PURE__*/new WeakMap();
104
+ var _B = /*#__PURE__*/new WeakMap();
105
+ var _C = /*#__PURE__*/new WeakMap();
106
+ var _D = /*#__PURE__*/new WeakMap();
107
+ var _E = /*#__PURE__*/new WeakMap();
108
+ var _F = /*#__PURE__*/new WeakMap();
109
+ var _G = /*#__PURE__*/new WeakMap();
110
+ _ref = (_setVideoStreamDecs = [_mobx.action, _mobx.action.bound], _setVideoStreamOwnerInfoDecs = [_mobx.action, _mobx.action.bound], _setAudioStreamDecs = [_mobx.action, _mobx.action.bound], _setAudioStreamOwnerInfoDecs = [_mobx.action, _mobx.action.bound], _setPinDecs = [_mobx.action, _mobx.action.bound], _setSpotlightEnabledDecs = [_mobx.action, _mobx.action.bound], _setSpeakerSpotlightDecs = [_mobx.action, _mobx.action.bound], _setHasScreenSharingDecs = [_mobx.action, _mobx.action.bound], _setBoardCanEditDecs = [_mobx.action, _mobx.action.bound], "_boardUserInfo");
111
+ var FcrUIVideoWindowDataImpl = exports.FcrUIVideoWindowDataImpl = /*#__PURE__*/function () {
112
+ function FcrUIVideoWindowDataImpl(type, _ref2, _placement, _isMySelf) {
113
+ var videoStream = _ref2.videoStream,
114
+ audioStream = _ref2.audioStream,
115
+ boardUserInfo = _ref2.boardUserInfo;
116
+ var layoutType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _type.FcrUIVideoWindowLayoutType.Gallery;
117
+ var spotlightEnabled = arguments.length > 5 ? arguments[5] : undefined;
118
+ var canEdit = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
119
+ (0, _classCallCheck2["default"])(this, FcrUIVideoWindowDataImpl);
120
+ (0, _defineProperty2["default"])(this, _ref, void _initProto(this));
121
+ (0, _defineProperty2["default"])(this, "_layoutType", _type.FcrUIVideoWindowLayoutType.Gallery);
122
+ _classPrivateFieldInitSpec(this, _A, _init__videoStream(this));
123
+ _classPrivateFieldInitSpec(this, _B, _init__audioStream(this));
124
+ _classPrivateFieldInitSpec(this, _C, _init__spotlightEnabled(this, true));
125
+ _classPrivateFieldInitSpec(this, _D, _init__isSpeakerSpotlight(this, false));
126
+ _classPrivateFieldInitSpec(this, _E, _init__boardCanEdit(this, false));
127
+ (0, _defineProperty2["default"])(this, "needToSort", false);
128
+ _classPrivateFieldInitSpec(this, _F, _init_isPin(this, false));
129
+ _classPrivateFieldInitSpec(this, _G, _init_hasScreenSharing(this, false));
130
+ this._placement = _placement;
131
+ this._isMySelf = _isMySelf;
132
+ this.type = type;
133
+ this.setVideoStream(videoStream);
134
+ this.setAudioStream(audioStream);
135
+ this.setLayoutType(layoutType);
136
+ this.setSpotlightEnabled(spotlightEnabled);
137
+ this._boardUserInfo = boardUserInfo;
138
+ this._boardCanEdit = canEdit;
139
+ }
140
+ return (0, _createClass2["default"])(FcrUIVideoWindowDataImpl, [{
141
+ key: "_videoStream",
142
+ get: function get() {
143
+ return _classPrivateFieldGet(_A, this);
144
+ },
145
+ set: function set(v) {
146
+ _classPrivateFieldSet(_A, this, v);
147
+ }
148
+ }, {
149
+ key: "_audioStream",
150
+ get: function get() {
151
+ return _classPrivateFieldGet(_B, this);
152
+ },
153
+ set: function set(v) {
154
+ _classPrivateFieldSet(_B, this, v);
155
+ }
156
+ }, {
157
+ key: "_spotlightEnabled",
158
+ get: function get() {
159
+ return _classPrivateFieldGet(_C, this);
160
+ },
161
+ set: function set(v) {
162
+ _classPrivateFieldSet(_C, this, v);
163
+ }
164
+ }, {
165
+ key: "_isSpeakerSpotlight",
166
+ get: function get() {
167
+ return _classPrivateFieldGet(_D, this);
168
+ },
169
+ set: function set(v) {
170
+ _classPrivateFieldSet(_D, this, v);
171
+ }
172
+ }, {
173
+ key: "_boardCanEdit",
174
+ get: function get() {
175
+ return _classPrivateFieldGet(_E, this);
176
+ },
177
+ set: function set(v) {
178
+ _classPrivateFieldSet(_E, this, v);
179
+ }
180
+ }, {
181
+ key: "isPin",
182
+ get: function get() {
183
+ return _classPrivateFieldGet(_F, this);
184
+ },
185
+ set: function set(v) {
186
+ _classPrivateFieldSet(_F, this, v);
187
+ }
188
+ }, {
189
+ key: "hasScreenSharing",
190
+ get: function get() {
191
+ return _classPrivateFieldGet(_G, this);
192
+ },
193
+ set: function set(v) {
194
+ _classPrivateFieldSet(_G, this, v);
195
+ }
196
+ }, {
197
+ key: "isSpeakerSpotlight",
198
+ get: function get() {
199
+ return this._isSpeakerSpotlight && this._spotlightEnabled;
200
+ }
201
+ }, {
202
+ key: "windowId",
203
+ get: function get() {
204
+ return this.type === _type.FcrUIWindowType.BOARD ? 'boardId' : this.videoStreamId || this.audioStreamId || '';
205
+ }
206
+ }, {
207
+ key: "videoStreamId",
208
+ get: function get() {
209
+ var _this$_videoStream;
210
+ return (_this$_videoStream = this._videoStream) === null || _this$_videoStream === void 0 ? void 0 : _this$_videoStream.streamId;
211
+ }
212
+ }, {
213
+ key: "audioStreamId",
214
+ get: function get() {
215
+ var _this$_audioStream;
216
+ return (_this$_audioStream = this._audioStream) === null || _this$_audioStream === void 0 ? void 0 : _this$_audioStream.streamId;
217
+ }
218
+ }, {
219
+ key: "audioStreamConnectorType",
220
+ get: function get() {
221
+ var _this$_audioStream2;
222
+ return ((_this$_audioStream2 = this._audioStream) === null || _this$_audioStream2 === void 0 ? void 0 : _this$_audioStream2.connectorType) || _fcrCore.FcrRoomConnectorType.NONE;
223
+ }
224
+ }, {
225
+ key: "videoStreamConnectorType",
226
+ get: function get() {
227
+ var _this$_videoStream2;
228
+ return ((_this$_videoStream2 = this._videoStream) === null || _this$_videoStream2 === void 0 ? void 0 : _this$_videoStream2.connectorType) || _fcrCore.FcrRoomConnectorType.NONE;
229
+ }
230
+
231
+ // @computed
232
+ // get hasMicrophoneAudioStream() {
233
+ // if (this.audioStreamConnectorType === FcrRoomConnectorType.NONE) {
234
+ // return (
235
+ // this._videoStream?.audioSourceState === FcrMediaSourceState.OPEN &&
236
+ // (this._videoStream.streamType === FcrStreamType.BOTH ||
237
+ // this._videoStream.streamType === FcrStreamType.AUDIO)
238
+ // );
239
+ // } else {
240
+ // return true;
241
+ // }
242
+ // }
243
+ }, {
244
+ key: "hasMicrophoneAudioStream",
245
+ get: function get() {
246
+ if (this.audioStreamConnectorType === _fcrCore.FcrRoomConnectorType.NONE) {
247
+ var _this$_videoStream3;
248
+ return ((_this$_videoStream3 = this._videoStream) === null || _this$_videoStream3 === void 0 ? void 0 : _this$_videoStream3.audioSourceState) === _fcrCore.FcrMediaSourceState.OPEN;
249
+ } else {
250
+ return true;
251
+ }
252
+ }
253
+ }, {
254
+ key: "phoneMicEnabled",
255
+ get: function get() {
256
+ if (this.audioStreamConnectorType === _fcrCore.FcrRoomConnectorType.PSTN) {
257
+ var _this$_audioStream3, _this$_videoStream4;
258
+ return ((_this$_audioStream3 = this._audioStream) === null || _this$_audioStream3 === void 0 ? void 0 : _this$_audioStream3.audioSourceState) === _fcrCore.FcrMediaSourceState.OPEN || ((_this$_videoStream4 = this._videoStream) === null || _this$_videoStream4 === void 0 ? void 0 : _this$_videoStream4.streamType) === _fcrCore.FcrStreamType.BOTH;
259
+ } else {
260
+ return false;
261
+ }
262
+ }
263
+ }, {
264
+ key: "hasVideoStream",
265
+ get: function get() {
266
+ var _this$_videoStream5, _this$_videoStream6, _this$_videoStream7;
267
+ return ((_this$_videoStream5 = this._videoStream) === null || _this$_videoStream5 === void 0 ? void 0 : _this$_videoStream5.videoSourceState) === _fcrCore.FcrMediaSourceState.OPEN && (((_this$_videoStream6 = this._videoStream) === null || _this$_videoStream6 === void 0 ? void 0 : _this$_videoStream6.streamType) === _fcrCore.FcrStreamType.BOTH || ((_this$_videoStream7 = this._videoStream) === null || _this$_videoStream7 === void 0 ? void 0 : _this$_videoStream7.streamType) === _fcrCore.FcrStreamType.VIDEO);
268
+ }
269
+ }, {
270
+ key: "hasLoopbackAudioStream",
271
+ get: function get() {
272
+ var _this$_videoStream8;
273
+ return ((_this$_videoStream8 = this._videoStream) === null || _this$_videoStream8 === void 0 ? void 0 : _this$_videoStream8.audioSourceType) === _fcrCore.FcrAudioSourceType.LOOPBACK;
274
+ }
275
+ }, {
276
+ key: "userId",
277
+ get: function get() {
278
+ var _this$_videoStream9, _this$_audioStream4, _this$_boardUserInfo;
279
+ return ((_this$_videoStream9 = this._videoStream) === null || _this$_videoStream9 === void 0 ? void 0 : _this$_videoStream9.owner.userId) || ((_this$_audioStream4 = this._audioStream) === null || _this$_audioStream4 === void 0 ? void 0 : _this$_audioStream4.owner.userId) || ((_this$_boardUserInfo = this._boardUserInfo) === null || _this$_boardUserInfo === void 0 ? void 0 : _this$_boardUserInfo.userId) || '';
280
+ }
281
+ }, {
282
+ key: "userName",
283
+ get: function get() {
284
+ var _this$_videoStream10, _this$_audioStream5, _this$_boardUserInfo2;
285
+ return ((_this$_videoStream10 = this._videoStream) === null || _this$_videoStream10 === void 0 ? void 0 : _this$_videoStream10.owner.userName) || ((_this$_audioStream5 = this._audioStream) === null || _this$_audioStream5 === void 0 ? void 0 : _this$_audioStream5.owner.userName) || ((_this$_boardUserInfo2 = this._boardUserInfo) === null || _this$_boardUserInfo2 === void 0 ? void 0 : _this$_boardUserInfo2.userName) || '';
286
+ }
287
+ }, {
288
+ key: "ownerRoleType",
289
+ get: function get() {
290
+ var _this$_videoStream11, _this$_audioStream6, _this$_boardUserInfo3;
291
+ return ((_this$_videoStream11 = this._videoStream) === null || _this$_videoStream11 === void 0 ? void 0 : _this$_videoStream11.owner.userRole) || ((_this$_audioStream6 = this._audioStream) === null || _this$_audioStream6 === void 0 ? void 0 : _this$_audioStream6.owner.userRole) || ((_this$_boardUserInfo3 = this._boardUserInfo) === null || _this$_boardUserInfo3 === void 0 ? void 0 : _this$_boardUserInfo3.userRole) || _type2.FcrUserRole.AUDIENCE;
292
+ }
293
+ }, {
294
+ key: "videoSourceType",
295
+ get: function get() {
296
+ var _this$_videoStream12;
297
+ return ((_this$_videoStream12 = this._videoStream) === null || _this$_videoStream12 === void 0 ? void 0 : _this$_videoStream12.videoSourceType) || _fcrCore.FcrVideoSourceType.CAMERA;
298
+ }
299
+ }, {
300
+ key: "isMySelf",
301
+ get: function get() {
302
+ return this._isMySelf;
303
+ }
304
+ }, {
305
+ key: "sortingPriority",
306
+ get: function get() {
307
+ if (this._placement === 'main-list') {
308
+ var _this$_videoStream13;
309
+ if (this.type === _type.FcrUIWindowType.BOARD && this._boardCanEdit) {
310
+ return _type.FcrUIVideoWindowMainSortingPriority.HIGHEST;
311
+ }
312
+ if (this.isPin || ((_this$_videoStream13 = this._videoStream) === null || _this$_videoStream13 === void 0 ? void 0 : _this$_videoStream13.videoSourceType) === _fcrCore.FcrVideoSourceType.SCREEN || this.type === _type.FcrUIWindowType.BOARD) {
313
+ return _type.FcrUIVideoWindowMainSortingPriority.FOCUS;
314
+ }
315
+ if (this.isSpeakerSpotlight && this._layoutType === _type.FcrUIVideoWindowLayoutType.Speaker) {
316
+ return _type.FcrUIVideoWindowMainSortingPriority.SPEAKER_SPOTLIGHT;
317
+ }
318
+ if (this.hasScreenSharing) {
319
+ return _type.FcrUIVideoWindowMainSortingPriority.SCREEN_SHARING_OWNER;
320
+ }
321
+ if (this.ownerRoleType === _type2.FcrUserRole.HOST) {
322
+ return _type.FcrUIVideoWindowMainSortingPriority.HOST;
323
+ }
324
+ if (this.isMySelf) {
325
+ return _type.FcrUIVideoWindowMainSortingPriority.MYSELF;
326
+ }
327
+ if (this.ownerRoleType === _type2.FcrUserRole.COHOST) {
328
+ return _type.FcrUIVideoWindowMainSortingPriority.CO_HOST;
329
+ }
330
+ if (this.hasMicrophoneAudioStream && this.hasVideoStream) {
331
+ return _type.FcrUIVideoWindowMainSortingPriority.BOTH_OPEN;
332
+ }
333
+ if (this.hasVideoStream) {
334
+ return _type.FcrUIVideoWindowMainSortingPriority.CAMERA_OPEN;
335
+ }
336
+ if (this.hasMicrophoneAudioStream) {
337
+ return _type.FcrUIVideoWindowMainSortingPriority.MICROPHONE_OPEN;
338
+ }
339
+ } else {
340
+ var _this$_videoStream14;
341
+ if (this.isSpeakerSpotlight) {
342
+ return _type.FcrUIVideoWindowFoldSortingPriority.FOCUS;
343
+ }
344
+ if (this.isPin) {
345
+ return _type.FcrUIVideoWindowFoldSortingPriority.PIN;
346
+ }
347
+ if (((_this$_videoStream14 = this._videoStream) === null || _this$_videoStream14 === void 0 ? void 0 : _this$_videoStream14.videoSourceType) === _fcrCore.FcrVideoSourceType.SCREEN) {
348
+ return _type.FcrUIVideoWindowFoldSortingPriority.SCREEN_SHARING_STREAM;
349
+ }
350
+ if (this.hasScreenSharing) {
351
+ return _type.FcrUIVideoWindowFoldSortingPriority.SCREEN_SHARING_OWNER;
352
+ }
353
+ if (this.ownerRoleType === _type2.FcrUserRole.HOST) {
354
+ return _type.FcrUIVideoWindowFoldSortingPriority.HOST;
355
+ }
356
+ if (this.isMySelf) {
357
+ return _type.FcrUIVideoWindowFoldSortingPriority.MYSELF;
358
+ }
359
+ if (this.ownerRoleType === _type2.FcrUserRole.COHOST) {
360
+ return _type.FcrUIVideoWindowFoldSortingPriority.CO_HOST;
361
+ }
362
+ if (this.hasMicrophoneAudioStream && this.hasVideoStream) {
363
+ return _type.FcrUIVideoWindowFoldSortingPriority.BOTH_OPEN;
364
+ }
365
+ if (this.hasVideoStream) {
366
+ return _type.FcrUIVideoWindowFoldSortingPriority.CAMERA_OPEN;
367
+ }
368
+ if (this.hasMicrophoneAudioStream) {
369
+ return _type.FcrUIVideoWindowFoldSortingPriority.MICROPHONE_OPEN;
370
+ }
371
+ }
372
+ return _type.FcrUIVideoWindowMainSortingPriority.NONE;
373
+ }
374
+ }, {
375
+ key: "setLayoutType",
376
+ value: function setLayoutType(layoutType) {
377
+ this._layoutType = layoutType;
378
+ }
379
+ }, {
380
+ key: "setVideoStream",
381
+ value: function setVideoStream(videoStream) {
382
+ this._videoStream = videoStream;
383
+ }
384
+ }, {
385
+ key: "setVideoStreamOwnerInfo",
386
+ value: function setVideoStreamOwnerInfo(userInfo) {
387
+ if (this._videoStream) {
388
+ this._videoStream.owner = userInfo;
389
+ }
390
+ }
391
+ }, {
392
+ key: "setAudioStream",
393
+ value: function setAudioStream(audioStream) {
394
+ this._audioStream = audioStream;
395
+ }
396
+ }, {
397
+ key: "setAudioStreamOwnerInfo",
398
+ value: function setAudioStreamOwnerInfo(userInfo) {
399
+ if (this._audioStream) {
400
+ this._audioStream.owner = userInfo;
401
+ }
402
+ }
403
+ }, {
404
+ key: "setPin",
405
+ value: function setPin(pin) {
406
+ this.isPin = pin;
407
+ }
408
+ }, {
409
+ key: "setSpotlightEnabled",
410
+ value: function setSpotlightEnabled(enabled) {
411
+ this._spotlightEnabled = enabled;
412
+ }
413
+ }, {
414
+ key: "setSpeakerSpotlight",
415
+ value: function setSpeakerSpotlight(speakerSpotlight) {
416
+ this._isSpeakerSpotlight = speakerSpotlight;
417
+ }
418
+ }, {
419
+ key: "setHasScreenSharing",
420
+ value: function setHasScreenSharing(screenSharing) {
421
+ this.hasScreenSharing = screenSharing;
422
+ }
423
+ }, {
424
+ key: "setBoardCanEdit",
425
+ value: function setBoardCanEdit(canEdit) {
426
+ this._boardCanEdit = canEdit;
427
+ }
428
+ }]);
429
+ }();
430
+ _FcrUIVideoWindowDataImpl = FcrUIVideoWindowDataImpl;
431
+ var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIVideoWindowDataImpl, [[_mobx.observable, 1, "_videoStream"], [_mobx.observable, 1, "_audioStream"], [_mobx.observable, 1, "_spotlightEnabled"], [_mobx.observable, 1, "_isSpeakerSpotlight"], [_mobx.observable, 1, "_boardCanEdit"], [_mobx.observable, 1, "isPin"], [_mobx.observable, 1, "hasScreenSharing"], [_mobx.computed, 3, "isSpeakerSpotlight"], [_mobx.computed, 3, "windowId"], [_mobx.computed, 3, "videoStreamId"], [_mobx.computed, 3, "audioStreamId"], [_mobx.computed, 3, "audioStreamConnectorType"], [_mobx.computed, 3, "videoStreamConnectorType"], [_mobx.computed, 3, "hasMicrophoneAudioStream"], [_mobx.computed, 3, "phoneMicEnabled"], [_mobx.computed, 3, "hasVideoStream"], [_mobx.computed, 3, "hasLoopbackAudioStream"], [_mobx.computed, 3, "userId"], [_mobx.computed, 3, "userName"], [_mobx.computed, 3, "ownerRoleType"], [_mobx.computed, 3, "videoSourceType"], [_mobx.computed, 3, "sortingPriority"], [_setVideoStreamDecs, 18, "setVideoStream"], [_setVideoStreamOwnerInfoDecs, 18, "setVideoStreamOwnerInfo"], [_setAudioStreamDecs, 18, "setAudioStream"], [_setAudioStreamOwnerInfoDecs, 18, "setAudioStreamOwnerInfo"], [_setPinDecs, 18, "setPin"], [_setSpotlightEnabledDecs, 18, "setSpotlightEnabled"], [_setSpeakerSpotlightDecs, 18, "setSpeakerSpotlight"], [_setHasScreenSharingDecs, 18, "setHasScreenSharing"], [_setBoardCanEditDecs, 18, "setBoardCanEdit"]], []).e, 8);
432
+ _init__videoStream = _applyDecs$e[0];
433
+ _init__audioStream = _applyDecs$e[1];
434
+ _init__spotlightEnabled = _applyDecs$e[2];
435
+ _init__isSpeakerSpotlight = _applyDecs$e[3];
436
+ _init__boardCanEdit = _applyDecs$e[4];
437
+ _init_isPin = _applyDecs$e[5];
438
+ _init_hasScreenSharing = _applyDecs$e[6];
439
+ _initProto = _applyDecs$e[7];
440
+ var _A2 = /*#__PURE__*/new WeakMap();
441
+ var _B2 = /*#__PURE__*/new WeakMap();
442
+ var _C2 = /*#__PURE__*/new WeakMap();
443
+ var _D2 = /*#__PURE__*/new WeakMap();
444
+ var _E2 = /*#__PURE__*/new WeakMap();
445
+ var _F2 = /*#__PURE__*/new WeakMap();
446
+ var _G2 = /*#__PURE__*/new WeakMap();
447
+ var _H = /*#__PURE__*/new WeakMap();
448
+ var _I = /*#__PURE__*/new WeakMap();
449
+ _ref3 = (_setSpotlightEnabledDecs2 = [_mobx.action, _mobx.action.bound], _setLayoutDecs = [_mobx.action, _mobx.action.bound], _onSpotlightRemovedDecs = [_mobx.action, _mobx.action.bound], _resetListDecs = [_mobx.action, _mobx.action.bound], _addBoardDecs = [_mobx.action, _mobx.action.bound], _updateBoardDecs = [_mobx.action, _mobx.action.bound], _removeBoardDecs = [_mobx.action, _mobx.action.bound], _mergePstnStreamOrInsertNewDataDecs = [_mobx.action, _mobx.action.bound], _addDecs = [_mobx.action, _mobx.action.bound], _updateDecs = [_mobx.action, _mobx.action.bound], _deleteDecs = [_mobx.action, _mobx.action.bound], _addPinDecs = [_mobx.action, _mobx.action.bound], _addPinToastDecs = [_mobx.action, _mobx.action.bound], _removePinToastDecs = [_mobx.action, _mobx.action.bound], _updateSpeakerSpotlightPositionDecs = [_mobx.action, _mobx.action.bound], _removePinDecs = [_mobx.action, _mobx.action.bound], _setSpeakerSpotlightDecs2 = [_mobx.action, _mobx.action.bound], _toggleMainStreamDecs = [_mobx.action, _mobx.action.bound], _insertBeginningByPriorityDecs = [_mobx.action, _mobx.action.bound], _insertEndByPriorityDecs = [_mobx.action, _mobx.action.bound], _findInsertBeginningIndexDecs = [_mobx.action, _mobx.action.bound], _findInsertEndIndexDecs = [_mobx.action, _mobx.action.bound], _insertBoardDecs = [_mobx.action, _mobx.action.bound], _insertNewDataDecs = [_mobx.action, _mobx.action.bound], "_observer");
450
+ var FcrUIVideoWindowDataSourceImpl = exports.FcrUIVideoWindowDataSourceImpl = /*#__PURE__*/function () {
451
+ function FcrUIVideoWindowDataSourceImpl(_sharedSettingDataSource, _eventProvider) {
452
+ (0, _classCallCheck2["default"])(this, FcrUIVideoWindowDataSourceImpl);
453
+ (0, _defineProperty2["default"])(this, _ref3, (_initProto2(this), new _observable.AgoraObservable()));
454
+ (0, _defineProperty2["default"])(this, "_spotlightPool", new FcrUISpeakerSpotlightPool());
455
+ _classPrivateFieldInitSpec(this, _A2, _init_spotlightEnabled(this, true));
456
+ _classPrivateFieldInitSpec(this, _B2, _init_layoutType(this, _type.FcrUIVideoWindowLayoutType.Gallery));
457
+ _classPrivateFieldInitSpec(this, _C2, _init_manualLayout(this, undefined));
458
+ _classPrivateFieldInitSpec(this, _D2, _init_pinLimitedCount(this, 1));
459
+ _classPrivateFieldInitSpec(this, _E2, _init_mainListLimitedCount(this, 255));
460
+ _classPrivateFieldInitSpec(this, _F2, _init_foldListLimitedCount(this, 255));
461
+ _classPrivateFieldInitSpec(this, _G2, _init_mainList(this, []));
462
+ _classPrivateFieldInitSpec(this, _H, _init_foldList(this, []));
463
+ _classPrivateFieldInitSpec(this, _I, _init_spotlightStreamId(this, ''));
464
+ this._sharedSettingDataSource = _sharedSettingDataSource;
465
+ this._eventProvider = _eventProvider;
466
+ this._spotlightPool.addObserver({
467
+ onRemoved: this.onSpotlightRemoved
468
+ });
469
+ }
470
+ return (0, _createClass2["default"])(FcrUIVideoWindowDataSourceImpl, [{
471
+ key: "spotlightEnabled",
472
+ get: function get() {
473
+ return _classPrivateFieldGet(_A2, this);
474
+ },
475
+ set: function set(v) {
476
+ _classPrivateFieldSet(_A2, this, v);
477
+ }
478
+ }, {
479
+ key: "layoutType",
480
+ get: function get() {
481
+ return _classPrivateFieldGet(_B2, this);
482
+ },
483
+ set: function set(v) {
484
+ _classPrivateFieldSet(_B2, this, v);
485
+ }
486
+ }, {
487
+ key: "manualLayout",
488
+ get: function get() {
489
+ return _classPrivateFieldGet(_C2, this);
490
+ },
491
+ set: function set(v) {
492
+ _classPrivateFieldSet(_C2, this, v);
493
+ }
494
+ }, {
495
+ key: "pinLimitedCount",
496
+ get: function get() {
497
+ return _classPrivateFieldGet(_D2, this);
498
+ },
499
+ set: function set(v) {
500
+ _classPrivateFieldSet(_D2, this, v);
501
+ }
502
+ }, {
503
+ key: "mainListLimitedCount",
504
+ get: function get() {
505
+ return _classPrivateFieldGet(_E2, this);
506
+ },
507
+ set: function set(v) {
508
+ _classPrivateFieldSet(_E2, this, v);
509
+ }
510
+ }, {
511
+ key: "foldListLimitedCount",
512
+ get: function get() {
513
+ return _classPrivateFieldGet(_F2, this);
514
+ },
515
+ set: function set(v) {
516
+ _classPrivateFieldSet(_F2, this, v);
517
+ }
518
+ }, {
519
+ key: "mainList",
520
+ get: function get() {
521
+ return _classPrivateFieldGet(_G2, this);
522
+ },
523
+ set: function set(v) {
524
+ _classPrivateFieldSet(_G2, this, v);
525
+ }
526
+ }, {
527
+ key: "foldList",
528
+ get: function get() {
529
+ return _classPrivateFieldGet(_H, this);
530
+ },
531
+ set: function set(v) {
532
+ _classPrivateFieldSet(_H, this, v);
533
+ }
534
+ }, {
535
+ key: "spotlightStreamId",
536
+ get: function get() {
537
+ return _classPrivateFieldGet(_I, this);
538
+ },
539
+ set: function set(v) {
540
+ _classPrivateFieldSet(_I, this, v);
541
+ }
542
+ }, {
543
+ key: "shouldHideNonVideoParticipants",
544
+ get: function get() {
545
+ return this._sharedSettingDataSource.setting.shouldHideNonVideoParticipants || false;
546
+ }
547
+ }, {
548
+ key: "layoutMainList",
549
+ get: function get() {
550
+ var _this = this;
551
+ var sourceList = this.mainList.filter(function (i) {
552
+ return !i.isMySelf || i.videoSourceType !== _fcrCore.FcrVideoSourceType.SCREEN;
553
+ });
554
+ var existHasVideoStreamUser = sourceList.some(function (i) {
555
+ return i.hasVideoStream;
556
+ });
557
+ return this.shouldHideNonVideoParticipants ? sourceList.filter(function (i) {
558
+ var visible = i.isMySelf && !existHasVideoStreamUser || i.hasVideoStream || i.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN || i.type === _type.FcrUIWindowType.BOARD;
559
+ if (!visible && i.isPin) {
560
+ _this.removePinToast(i.windowId, (0, _i18n.transI18n)('fmt_internalsetting_other_hide_no_video_pin_cancelled'));
561
+ }
562
+ return visible;
563
+ }) : sourceList;
564
+ }
565
+ }, {
566
+ key: "setSpotlightEnabled",
567
+ value: function setSpotlightEnabled(enabled) {
568
+ var _this2 = this;
569
+ var currentSpeakerSpotlightIndex_mainList = this._findCurrentSpeakerSpotlight(this.mainList);
570
+ var currentSpeakerSpotlightIndex_foldList = this._findCurrentSpeakerSpotlight(this.foldList);
571
+ this.spotlightEnabled = enabled;
572
+ this.mainList.forEach(function (item) {
573
+ item.setSpotlightEnabled(enabled);
574
+ });
575
+ this.foldList.forEach(function (item) {
576
+ item.setSpotlightEnabled(enabled);
577
+ });
578
+ this._spotlightPool.streams.forEach(function (_ts, streamId) {
579
+ _this2.setSpeakerSpotlight(streamId);
580
+ });
581
+ // update speaker spotlight position
582
+ this._updateSpeakerSpotlightPosition(currentSpeakerSpotlightIndex_mainList, this.mainList, this.mainListLimitedCount, 'main-list');
583
+ this._updateSpeakerSpotlightPosition(currentSpeakerSpotlightIndex_foldList, this.foldList, this.foldListLimitedCount, 'fold-list');
584
+ }
585
+ }, {
586
+ key: "setLayout",
587
+ value: function setLayout(layout, manual) {
588
+ if (manual) {
589
+ this.manualLayout = layout;
590
+ }
591
+ if (this.layoutType === _type.FcrUIVideoWindowLayoutType.Gallery && layout === _type.FcrUIVideoWindowLayoutType.Speaker && this.mainList.length < 2 || this.layoutType === layout) {
592
+ return;
593
+ }
594
+ this.layoutType = layout;
595
+ this._observer.notifyObservers('onLayoutUpdated', layout);
596
+ this.mainList.forEach(function (item) {
597
+ item.setLayoutType(layout);
598
+ });
599
+ this.foldList.forEach(function (item) {
600
+ item.setLayoutType(layout);
601
+ });
602
+ if (layout === _type.FcrUIVideoWindowLayoutType.Gallery) {
603
+ this.resetList();
604
+ }
605
+ }
606
+ }, {
607
+ key: "onSpotlightRemoved",
608
+ value: function onSpotlightRemoved(streamId) {
609
+ var _this3 = this;
610
+ var removeSpotlight = function removeSpotlight(streamId, list, limitCount) {
611
+ var index = _this3._findItemIndexWithWindowId(streamId, list);
612
+ if (index !== -1) {
613
+ var item = list[index];
614
+ if (item) {
615
+ item.setSpeakerSpotlight(false);
616
+ if (_this3.layoutType === _type.FcrUIVideoWindowLayoutType.Speaker) {
617
+ item.needToSort = true;
618
+ }
619
+ }
620
+ }
621
+ };
622
+ removeSpotlight(streamId, this.mainList, this.mainListLimitedCount);
623
+ removeSpotlight(streamId, this.foldList, this.foldListLimitedCount);
624
+ this.spotlightStreamId = '';
625
+ this._observer.notifyObservers('onSpotlightRemoved', streamId);
626
+ }
627
+ }, {
628
+ key: "resetList",
629
+ value: function resetList() {
630
+ this.mainList = this.mainList.sort(function (a, b) {
631
+ return b.sortingPriority - a.sortingPriority;
632
+ });
633
+ this.foldList = this.foldList.sort(function (a, b) {
634
+ return b.sortingPriority - a.sortingPriority;
635
+ });
636
+ this._observer.notifyObservers('onMainListUpdated', -1);
637
+ this._observer.notifyObservers('onFoldListUpdated', -1);
638
+ }
639
+ }, {
640
+ key: "addBoard",
641
+ value: function addBoard(userInfo, isMySelf, canEdit) {
642
+ this._insertBoard(userInfo, this.mainList, this.mainListLimitedCount, isMySelf, 'main-list', canEdit);
643
+ this._syncHasScreenSharing(true, userInfo.userId, this.mainList, this.mainListLimitedCount, 'main-list');
644
+ this._syncHasScreenSharing(true, userInfo.userId, this.foldList, this.foldListLimitedCount, 'fold-list');
645
+ }
646
+ }, {
647
+ key: "updateBoard",
648
+ value: function updateBoard(canEdit) {
649
+ var windowData = this.mainList.find(function (item) {
650
+ return item.type === _type.FcrUIWindowType.BOARD;
651
+ });
652
+ windowData === null || windowData === void 0 || windowData.setBoardCanEdit(canEdit);
653
+ var insertIndex = this._insertByPriority(windowData, this.mainList, this.mainListLimitedCount);
654
+ this._observer.notifyObservers('onMainListUpdated', insertIndex);
655
+ }
656
+ }, {
657
+ key: "removeBoard",
658
+ value: function removeBoard() {
659
+ var boardIndex = this.mainList.findIndex(function (i) {
660
+ return i.type === _type.FcrUIWindowType.BOARD;
661
+ });
662
+ if (boardIndex !== -1) {
663
+ var board = this.mainList[boardIndex];
664
+ this.mainList.splice(boardIndex, 1);
665
+ this._syncHasScreenSharing(false, board.userId, this.mainList, this.mainListLimitedCount, 'main-list');
666
+ this._syncHasScreenSharing(false, board.userId, this.foldList, this.foldListLimitedCount, 'fold-list');
667
+ }
668
+ }
669
+ }, {
670
+ key: "_mergePstnStreamOrInsertNewData",
671
+ value: function _mergePstnStreamOrInsertNewData(stream, list, limitCount, isMySelf, placement) {
672
+ var existedUserPstnStream = list.find(function (item) {
673
+ return item.userId === stream.owner.userId && item.audioStreamConnectorType === _fcrCore.FcrRoomConnectorType.PSTN;
674
+ });
675
+ if (existedUserPstnStream) {
676
+ existedUserPstnStream.setVideoStream(stream);
677
+ } else {
678
+ this._insertNewData(stream, list, limitCount, isMySelf, placement);
679
+ }
680
+ }
681
+ }, {
682
+ key: "add",
683
+ value: function add(stream, isMySelf) {
684
+ var _this4 = this;
685
+ var streamCopy = this.copyStreamInfo(stream);
686
+ if (streamCopy.connectorType === _fcrCore.FcrRoomConnectorType.PSTN) {
687
+ var handlePSTNStreamAdded = function handlePSTNStreamAdded(stream, list, limitCount, isMySelf, placement) {
688
+ var existedUserStream = list.find(function (item) {
689
+ return item.userId === stream.owner.userId && item.videoSourceType === _fcrCore.FcrVideoSourceType.CAMERA;
690
+ });
691
+ if (existedUserStream) {
692
+ existedUserStream.setAudioStream(stream);
693
+ } else {
694
+ _this4._insertNewData(stream, list, limitCount, isMySelf, placement);
695
+ }
696
+ };
697
+ handlePSTNStreamAdded(streamCopy, this.mainList, this.mainListLimitedCount, isMySelf, 'main-list');
698
+ handlePSTNStreamAdded(streamCopy, this.foldList, this.foldListLimitedCount, isMySelf, 'fold-list');
699
+ } else {
700
+ this._mergePstnStreamOrInsertNewData(streamCopy, this.mainList, this.mainListLimitedCount, isMySelf, 'main-list');
701
+ this._mergePstnStreamOrInsertNewData(streamCopy, this.foldList, this.foldListLimitedCount, isMySelf, 'fold-list');
702
+ }
703
+ if (streamCopy.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN) {
704
+ this._syncHasScreenSharing(true, streamCopy.owner.userId, this.mainList, this.mainListLimitedCount, 'main-list');
705
+ this._syncHasScreenSharing(true, streamCopy.owner.userId, this.foldList, this.foldListLimitedCount, 'fold-list');
706
+ }
707
+ }
708
+ }, {
709
+ key: "update",
710
+ value: function update(param) {
711
+ var _this5 = this;
712
+ var handleStreamInfoUpdated = function handleStreamInfoUpdated(stream, list, limitCount, placement) {
713
+ var existedUserStream = list[_this5._findItemIndexWithWindowId(stream.streamId, list)];
714
+ if (existedUserStream) {
715
+ var oldSortingPriority = existedUserStream.sortingPriority;
716
+ if (param.connectorType === _fcrCore.FcrRoomConnectorType.PSTN) {
717
+ existedUserStream.setAudioStream(stream);
718
+ } else {
719
+ existedUserStream.setVideoStream(stream);
720
+ }
721
+ var newSortingPriority = existedUserStream.sortingPriority;
722
+ if (oldSortingPriority !== newSortingPriority) {
723
+ var index = _this5._insertByPriority(existedUserStream, list, limitCount);
724
+ _this5._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', index);
725
+ }
726
+ }
727
+ };
728
+ var handleUserInfoUpdated = function handleUserInfoUpdated(user, list, limitCount, placement) {
729
+ var modifiedItems = [];
730
+ list.forEach(function (item) {
731
+ if (item.userId === user.userId) {
732
+ var oldSortingPriority = item.sortingPriority;
733
+ item.setVideoStreamOwnerInfo(user);
734
+ item.setAudioStreamOwnerInfo(user);
735
+ var newSortingPriority = item.sortingPriority;
736
+ if (oldSortingPriority !== newSortingPriority) {
737
+ modifiedItems.push(item);
738
+ }
739
+ }
740
+ });
741
+ modifiedItems.forEach(function (item) {
742
+ var index = _this5._insertByPriority(item, list, limitCount);
743
+ _this5._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', index);
744
+ });
745
+ };
746
+ if ('streamId' in param) {
747
+ var streamCopy = this.copyStreamInfo(param);
748
+ handleStreamInfoUpdated(streamCopy, this.mainList, this.mainListLimitedCount, 'main-list');
749
+ handleStreamInfoUpdated(streamCopy, this.foldList, this.foldListLimitedCount, 'fold-list');
750
+ } else {
751
+ handleUserInfoUpdated(param, this.mainList, this.mainListLimitedCount, 'main-list');
752
+ handleUserInfoUpdated(param, this.foldList, this.foldListLimitedCount, 'fold-list');
753
+ }
754
+ }
755
+ }, {
756
+ key: "delete",
757
+ value: function _delete(stream) {
758
+ var _this6 = this;
759
+ var streamCopy = this.copyStreamInfo(stream);
760
+ var handlePSTNStreamDeleted = function handlePSTNStreamDeleted(stream, list, placement) {
761
+ var index = _this6._findItemIndexWithAudioStreamId(stream.streamId, list);
762
+ var existedUserStream = list[index];
763
+ if (existedUserStream) {
764
+ if (existedUserStream.videoStreamId) {
765
+ existedUserStream.setAudioStream(undefined);
766
+ _this6._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', index);
767
+ } else {
768
+ list.splice(index, 1);
769
+ _this6._observer.notifyObservers(placement === 'main-list' ? 'onMainListRemoved' : 'onFoldListRemoved', index);
770
+ }
771
+ }
772
+ };
773
+ if (stream.connectorType === _fcrCore.FcrRoomConnectorType.PSTN) {
774
+ handlePSTNStreamDeleted(streamCopy, this.mainList, 'main-list');
775
+ handlePSTNStreamDeleted(streamCopy, this.foldList, 'fold-list');
776
+ } else {
777
+ var handleVideoStreamDeleted = function handleVideoStreamDeleted(streamId, list, placement) {
778
+ var existStreamIndex = list.findIndex(function (item) {
779
+ return item.videoStreamId === streamId;
780
+ });
781
+ if (existStreamIndex === -1) {
782
+ return;
783
+ }
784
+ list.splice(existStreamIndex, 1);
785
+ _this6._observer.notifyObservers(placement === 'main-list' ? 'onMainListRemoved' : 'onFoldListRemoved', existStreamIndex);
786
+ };
787
+ handleVideoStreamDeleted(streamCopy.streamId, this.mainList, 'main-list');
788
+ handleVideoStreamDeleted(streamCopy.streamId, this.foldList, 'fold-list');
789
+ }
790
+ // if it is the last screen share stream of the user, remove the screen sharing flag
791
+
792
+ if (stream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN) {
793
+ this._syncHasScreenSharing(false, streamCopy.owner.userId, this.mainList, this.mainListLimitedCount, 'main-list');
794
+ this._syncHasScreenSharing(false, streamCopy.owner.userId, this.foldList, this.foldListLimitedCount, 'fold-list');
795
+ }
796
+ }
797
+ }, {
798
+ key: "addPin",
799
+ value: function addPin(streamId) {
800
+ var _this7 = this;
801
+ var handlePin = function handlePin(streamId, list, limitCount, placement) {
802
+ var existedUserStreamIndex = _this7._findItemIndexWithWindowId(streamId, list);
803
+ var existedUserStream = list[existedUserStreamIndex];
804
+ if (!existedUserStream || existedUserStream !== null && existedUserStream !== void 0 && existedUserStream.isPin) {
805
+ return false;
806
+ }
807
+ var currentPinStreams = list.filter(function (item) {
808
+ return item.isPin;
809
+ });
810
+ if (currentPinStreams.length >= _this7.pinLimitedCount) {
811
+ var lastPinStream = currentPinStreams[currentPinStreams.length - 1];
812
+ var _streamId = lastPinStream.videoStreamId || lastPinStream.audioStreamId;
813
+ if (_streamId) {
814
+ _this7.removePin(_streamId);
815
+ }
816
+ }
817
+ existedUserStream.setPin(true);
818
+ _this7._insertBeginningByPriority(existedUserStream, list, limitCount);
819
+ _this7._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', existedUserStreamIndex);
820
+ return true;
821
+ };
822
+ var success = handlePin(streamId, this.mainList, this.mainListLimitedCount, 'main-list');
823
+ handlePin(streamId, this.foldList, this.foldListLimitedCount, 'fold-list');
824
+ return success;
825
+ }
826
+ }, {
827
+ key: "addPinToast",
828
+ value: function addPinToast(streamId) {
829
+ if (this.shouldHideNonVideoParticipants) {
830
+ var _stream = this.layoutMainList.find(function (u) {
831
+ return u.windowId === streamId;
832
+ });
833
+ if (!(_stream !== null && _stream !== void 0 && _stream.hasVideoStream)) {
834
+ this._eventProvider.showToast({
835
+ type: 'error',
836
+ message: (0, _i18n.transI18n)('fmt_internalsetting_other_hide_no_video_pin_cancelled')
837
+ });
838
+ return;
839
+ }
840
+ }
841
+ var success = this.addPin(streamId);
842
+ if (success) {
843
+ this._eventProvider.showToast({
844
+ type: 'normal',
845
+ message: (0, _i18n.transI18n)('fmt_settings_tips_screenlocked')
846
+ });
847
+ if (this.layoutType === _type.FcrUIVideoWindowLayoutType.Gallery) {
848
+ this.setLayout(_type.FcrUIVideoWindowLayoutType.Speaker);
849
+ }
850
+ }
851
+ }
852
+ }, {
853
+ key: "removePinToast",
854
+ value: function removePinToast(streamId) {
855
+ var toastText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _i18n.transI18n)('fmt_settings_tips_screenunlock');
856
+ this.removePin(streamId);
857
+ this._eventProvider.showToast({
858
+ type: 'normal',
859
+ message: toastText
860
+ });
861
+ }
862
+ }, {
863
+ key: "_updateSpeakerSpotlightPosition",
864
+ value: function _updateSpeakerSpotlightPosition(index, list, limitCount, placement) {
865
+ var existedUserStream = list[index];
866
+ if (!existedUserStream) {
867
+ return;
868
+ }
869
+ this._insertByPriority(existedUserStream, list, limitCount);
870
+ this._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', index);
871
+ }
872
+ }, {
873
+ key: "removePin",
874
+ value: function removePin(streamId) {
875
+ var _this8 = this;
876
+ var handleRemovePin = function handleRemovePin(streamId, list, limitCount, placement) {
877
+ var existedUserStreamIndex = _this8._findItemIndexWithWindowId(streamId, list);
878
+ var existedUserStream = list[existedUserStreamIndex];
879
+ if (!(existedUserStream !== null && existedUserStream !== void 0 && existedUserStream.isPin)) {
880
+ return;
881
+ }
882
+ existedUserStream.setPin(false);
883
+ _this8._insertByPriority(existedUserStream, list, limitCount);
884
+ _this8._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', existedUserStreamIndex);
885
+ return true;
886
+ };
887
+ var removePinMainRes = handleRemovePin(streamId, this.mainList, this.mainListLimitedCount, 'main-list');
888
+ var removePinFoldRes = handleRemovePin(streamId, this.foldList, this.foldListLimitedCount, 'fold-list');
889
+ return removePinMainRes && removePinFoldRes;
890
+ }
891
+ }, {
892
+ key: "setSpeakerSpotlight",
893
+ value: function setSpeakerSpotlight(streamId) {
894
+ var _this9 = this;
895
+ var checkStreamExist = function checkStreamExist(streamId) {
896
+ return _this9._findItemIndexWithWindowId(streamId, _this9.mainList) !== -1 && _this9._findItemIndexWithWindowId(streamId, _this9.foldList) !== -1;
897
+ };
898
+ if (!checkStreamExist(streamId)) return;
899
+ var isRefreshSpotlight = this._spotlightPool.streams.has(streamId);
900
+ var success = this._spotlightPool.add(streamId);
901
+ if (!success || isRefreshSpotlight) {
902
+ return;
903
+ }
904
+ var setSpeakerSpotlight = function setSpeakerSpotlight(streamId, list, limitCount, placement) {
905
+ var existedUserStreamIndex = _this9._findItemIndexWithWindowId(streamId, list);
906
+ var existedUserStream = list[existedUserStreamIndex];
907
+ if (existedUserStream) {
908
+ existedUserStream.setSpeakerSpotlight(true);
909
+ }
910
+ if (_this9.layoutType === _type.FcrUIVideoWindowLayoutType.Speaker || list === _this9.foldList) {
911
+ var isSpeakerSpotlightSortingPriority = existedUserStream.sortingPriority === (placement === 'main-list' ? _type.FcrUIVideoWindowMainSortingPriority.SPEAKER_SPOTLIGHT : _type.FcrUIVideoWindowFoldSortingPriority.FOCUS);
912
+ if (isSpeakerSpotlightSortingPriority) {
913
+ _this9._insertBeginningByPriority(existedUserStream, list, limitCount);
914
+ }
915
+ }
916
+ list.forEach(function (item) {
917
+ if (item.needToSort) {
918
+ _this9._insertByPriority(item, list, limitCount);
919
+ }
920
+ });
921
+ _this9._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', existedUserStreamIndex);
922
+ };
923
+ setSpeakerSpotlight(streamId, this.mainList, this.mainListLimitedCount, 'main-list');
924
+ setSpeakerSpotlight(streamId, this.foldList, this.foldListLimitedCount, 'fold-list');
925
+ this._observer.notifyObservers('onSpotlightAdded', streamId);
926
+ this.spotlightStreamId = streamId;
927
+ }
928
+ }, {
929
+ key: "toggleMainStream",
930
+ value: function toggleMainStream(windowId) {
931
+ var streamIndex = this._findItemIndexWithWindowId(windowId, this.mainList);
932
+ if (streamIndex === -1) {
933
+ return false;
934
+ }
935
+ var streamData = this.mainList[streamIndex];
936
+ // bring the stream to the start of the list
937
+ this.mainList.splice(streamIndex, 1);
938
+ this.mainList.unshift(streamData);
939
+ this._observer.notifyObservers('onMainListUpdated', streamIndex);
940
+ return true;
941
+ }
942
+ }, {
943
+ key: "clearSpeakerSpotlight",
944
+ value: function clearSpeakerSpotlight() {
945
+ this._spotlightPool.clear();
946
+ }
947
+ }, {
948
+ key: "addObserver",
949
+ value: function addObserver(observer) {
950
+ this._observer.addObserver(observer);
951
+ }
952
+ }, {
953
+ key: "removeObserver",
954
+ value: function removeObserver(observer) {
955
+ this._observer.removeObserver(observer);
956
+ }
957
+ }, {
958
+ key: "copyStreamInfo",
959
+ value: function copyStreamInfo(stream) {
960
+ var streamCopy = Object.assign({}, stream);
961
+ return streamCopy;
962
+ }
963
+ }, {
964
+ key: "_syncHasScreenSharing",
965
+ value: function _syncHasScreenSharing(enable, userId, list, limitCount, placement) {
966
+ var _this10 = this;
967
+ if (enable) {
968
+ list.forEach(function (item, index) {
969
+ if (item.userId === userId) {
970
+ var itemIndex = index;
971
+ var originalPriority = item.sortingPriority;
972
+ item.setHasScreenSharing(enable);
973
+ if (item.sortingPriority !== originalPriority) {
974
+ itemIndex = _this10._insertByPriority(item, list, limitCount);
975
+ }
976
+ _this10._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', itemIndex);
977
+ }
978
+ });
979
+ } else {
980
+ var remainingShare = list.some(function (item) {
981
+ return item.userId === userId && (item.type === _type.FcrUIWindowType.BOARD || item.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN);
982
+ });
983
+ if (!remainingShare) {
984
+ list.forEach(function (item) {
985
+ if (item.userId === userId) {
986
+ item.setHasScreenSharing(enable);
987
+ var index = _this10._insertByPriority(item, list, limitCount);
988
+ _this10._observer.notifyObservers(placement === 'main-list' ? 'onMainListUpdated' : 'onFoldListUpdated', index);
989
+ }
990
+ });
991
+ }
992
+ }
993
+ }
994
+ }, {
995
+ key: "_insertByPriority",
996
+ value: function _insertByPriority(data, list, limitCount) {
997
+ var insertIndex = -1;
998
+ if (data.sortingPriority >= _type.FcrUIVideoWindowMainSortingPriority.FOCUS) {
999
+ insertIndex = this._insertBeginningByPriority(data, list, limitCount);
1000
+ } else {
1001
+ insertIndex = this._insertEndByPriority(data, list, limitCount);
1002
+ }
1003
+ return insertIndex;
1004
+ }
1005
+ }, {
1006
+ key: "_insertBeginningByPriority",
1007
+ value: function _insertBeginningByPriority(data, list, limitedCount) {
1008
+ var currentIndex = this._findItemIndexWithWindowId(data.windowId, list);
1009
+ if (currentIndex !== -1) {
1010
+ list.splice(currentIndex, 1);
1011
+ }
1012
+ var index = this._findInsertBeginningIndex(data.sortingPriority, list);
1013
+ list.splice(index, 0, data);
1014
+ if (list.length > limitedCount) {
1015
+ list.splice(limitedCount);
1016
+ }
1017
+ data.needToSort = false;
1018
+ return index;
1019
+ }
1020
+ }, {
1021
+ key: "_insertEndByPriority",
1022
+ value: function _insertEndByPriority(data, list, limitedCount) {
1023
+ var currentIndex = this._findItemIndexWithWindowId(data.windowId, list);
1024
+ if (currentIndex !== -1) {
1025
+ list.splice(currentIndex, 1);
1026
+ }
1027
+ var index = this._findInsertEndIndex(data.sortingPriority, list);
1028
+ list.splice(index, 0, data);
1029
+ if (list.length > limitedCount) {
1030
+ list.splice(limitedCount);
1031
+ }
1032
+ data.needToSort = false;
1033
+ return index;
1034
+ }
1035
+ }, {
1036
+ key: "_findInsertBeginningIndex",
1037
+ value: function _findInsertBeginningIndex(priority, list) {
1038
+ // list is sorted by priority
1039
+ var index = list.findIndex(function (item) {
1040
+ return item.sortingPriority <= priority;
1041
+ });
1042
+ if (index === -1) {
1043
+ return list.length;
1044
+ } else {
1045
+ return index;
1046
+ }
1047
+ }
1048
+ }, {
1049
+ key: "_findInsertEndIndex",
1050
+ value: function _findInsertEndIndex(priority, list) {
1051
+ // list is sorted by priority
1052
+ var index = list.findLastIndex(function (item) {
1053
+ return item.sortingPriority >= priority;
1054
+ });
1055
+ if (index === -1) {
1056
+ return 0;
1057
+ } else {
1058
+ return index + 1;
1059
+ }
1060
+ }
1061
+ }, {
1062
+ key: "_findCurrentSpeakerSpotlight",
1063
+ value: function _findCurrentSpeakerSpotlight(list) {
1064
+ return list.findIndex(function (item) {
1065
+ return item.isSpeakerSpotlight;
1066
+ });
1067
+ }
1068
+ }, {
1069
+ key: "_findItemIndexWithWindowId",
1070
+ value: function _findItemIndexWithWindowId(windowId, list) {
1071
+ return list.findIndex(function (item) {
1072
+ return item.windowId === windowId;
1073
+ });
1074
+ }
1075
+ }, {
1076
+ key: "_findItemIndexWithUserId",
1077
+ value: function _findItemIndexWithUserId(userId, list) {
1078
+ return list.findIndex(function (item) {
1079
+ return item.userId === userId;
1080
+ });
1081
+ }
1082
+ }, {
1083
+ key: "_findItemIndexWithAudioStreamId",
1084
+ value: function _findItemIndexWithAudioStreamId(audioStreamId, list) {
1085
+ return list.findIndex(function (item) {
1086
+ return item.audioStreamId === audioStreamId;
1087
+ });
1088
+ }
1089
+ }, {
1090
+ key: "_insertBoard",
1091
+ value: function _insertBoard(userInfo, list, limitCount, isMySelf, placement) {
1092
+ var canEdit = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
1093
+ var windowData = new FcrUIVideoWindowDataImpl(_type.FcrUIWindowType.BOARD, {
1094
+ boardUserInfo: userInfo
1095
+ }, placement, isMySelf, this.layoutType, this.spotlightEnabled, canEdit);
1096
+ var insertIndex = this._insertByPriority(windowData, list, limitCount);
1097
+ this._observer.notifyObservers(placement === 'main-list' ? 'onMainListAdded' : 'onFoldListAdded', insertIndex);
1098
+ }
1099
+ }, {
1100
+ key: "_insertNewData",
1101
+ value: function _insertNewData(stream, list, limitCount, isMySelf, placement) {
1102
+ var videoWindowData = new FcrUIVideoWindowDataImpl(_type.FcrUIWindowType.VIDEO, stream.connectorType === _fcrCore.FcrRoomConnectorType.PSTN ? {
1103
+ audioStream: stream
1104
+ } : {
1105
+ videoStream: stream
1106
+ }, placement, isMySelf, this.layoutType, this.spotlightEnabled);
1107
+ var insertIndex = this._insertByPriority(videoWindowData, list, limitCount);
1108
+ this._observer.notifyObservers(placement === 'main-list' ? 'onMainListAdded' : 'onFoldListAdded', insertIndex);
1109
+ }
1110
+ }]);
1111
+ }();
1112
+ _FcrUIVideoWindowDataSourceImpl = FcrUIVideoWindowDataSourceImpl;
1113
+ var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIVideoWindowDataSourceImpl, [[_mobx.observable, 1, "spotlightEnabled"], [_mobx.observable, 1, "layoutType"], [_mobx.observable, 1, "manualLayout"], [_mobx.observable, 1, "pinLimitedCount"], [_mobx.observable, 1, "mainListLimitedCount"], [_mobx.observable, 1, "foldListLimitedCount"], [_mobx.observable, 1, "mainList"], [_mobx.observable, 1, "foldList"], [_mobx.observable, 1, "spotlightStreamId"], [_mobx.computed, 3, "shouldHideNonVideoParticipants"], [_mobx.computed, 3, "layoutMainList"], [_setSpotlightEnabledDecs2, 18, "setSpotlightEnabled"], [_setLayoutDecs, 18, "setLayout"], [_onSpotlightRemovedDecs, 18, "onSpotlightRemoved"], [_resetListDecs, 18, "resetList"], [_addBoardDecs, 18, "addBoard"], [_updateBoardDecs, 18, "updateBoard"], [_removeBoardDecs, 18, "removeBoard"], [_mergePstnStreamOrInsertNewDataDecs, 18, "_mergePstnStreamOrInsertNewData"], [_addDecs, 18, "add"], [_updateDecs, 18, "update"], [_deleteDecs, 18, "delete"], [_addPinDecs, 18, "addPin"], [_addPinToastDecs, 18, "addPinToast"], [_removePinToastDecs, 18, "removePinToast"], [_updateSpeakerSpotlightPositionDecs, 18, "_updateSpeakerSpotlightPosition"], [_removePinDecs, 18, "removePin"], [_setSpeakerSpotlightDecs2, 18, "setSpeakerSpotlight"], [_toggleMainStreamDecs, 18, "toggleMainStream"], [_insertBeginningByPriorityDecs, 18, "_insertBeginningByPriority"], [_insertEndByPriorityDecs, 18, "_insertEndByPriority"], [_findInsertBeginningIndexDecs, 18, "_findInsertBeginningIndex"], [_findInsertEndIndexDecs, 18, "_findInsertEndIndex"], [_insertBoardDecs, 18, "_insertBoard"], [_insertNewDataDecs, 18, "_insertNewData"]], []).e, 10);
1114
+ _init_spotlightEnabled = _applyDecs$e2[0];
1115
+ _init_layoutType = _applyDecs$e2[1];
1116
+ _init_manualLayout = _applyDecs$e2[2];
1117
+ _init_pinLimitedCount = _applyDecs$e2[3];
1118
+ _init_mainListLimitedCount = _applyDecs$e2[4];
1119
+ _init_foldListLimitedCount = _applyDecs$e2[5];
1120
+ _init_mainList = _applyDecs$e2[6];
1121
+ _init_foldList = _applyDecs$e2[7];
1122
+ _init_spotlightStreamId = _applyDecs$e2[8];
1123
+ _initProto2 = _applyDecs$e2[9];
1124
+ var FcrUISpeakerSpotlightPool = exports.FcrUISpeakerSpotlightPool = /*#__PURE__*/function () {
1125
+ function FcrUISpeakerSpotlightPool() {
1126
+ (0, _classCallCheck2["default"])(this, FcrUISpeakerSpotlightPool);
1127
+ (0, _defineProperty2["default"])(this, "streams", new Map());
1128
+ (0, _defineProperty2["default"])(this, "limitCount", 1);
1129
+ (0, _defineProperty2["default"])(this, "duration", 2);
1130
+ (0, _defineProperty2["default"])(this, "_timer", null);
1131
+ (0, _defineProperty2["default"])(this, "_observer", new _observable.AgoraObservable());
1132
+ this._scan = this._scan.bind(this);
1133
+ }
1134
+ return (0, _createClass2["default"])(FcrUISpeakerSpotlightPool, [{
1135
+ key: "add",
1136
+ value: function add(streamId) {
1137
+ if (this.streams.size >= this.limitCount && !this.streams.has(streamId)) {
1138
+ return false;
1139
+ }
1140
+ this.streams.set(streamId, Date.now());
1141
+ this._scan();
1142
+ return true;
1143
+ }
1144
+ }, {
1145
+ key: "_scan",
1146
+ value: function _scan() {
1147
+ var _this11 = this;
1148
+ if (this._timer) {
1149
+ window.clearInterval(this._timer);
1150
+ this._timer = null;
1151
+ }
1152
+ this._timer = window.setInterval(function () {
1153
+ var now = Date.now();
1154
+ var _iterator = _createForOfIteratorHelper(_this11.streams),
1155
+ _step;
1156
+ try {
1157
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1158
+ var _step$value = (0, _slicedToArray2["default"])(_step.value, 2),
1159
+ _streamId2 = _step$value[0],
1160
+ time = _step$value[1];
1161
+ if (now - time - _this11.duration * 1000 >= 0) {
1162
+ _this11.streams["delete"](_streamId2);
1163
+ _this11._observer.notifyObservers('onRemoved', _streamId2);
1164
+ }
1165
+ }
1166
+ } catch (err) {
1167
+ _iterator.e(err);
1168
+ } finally {
1169
+ _iterator.f();
1170
+ }
1171
+ if (_this11.streams.size === 0) {
1172
+ _this11._timer && window.clearInterval(_this11._timer);
1173
+ _this11._timer = null;
1174
+ }
1175
+ }, 1000);
1176
+ }
1177
+ }, {
1178
+ key: "clear",
1179
+ value: function clear() {
1180
+ var _this12 = this;
1181
+ this.streams.forEach(function (_, streamId) {
1182
+ _this12._observer.notifyObservers('onRemoved', streamId);
1183
+ });
1184
+ this.streams.clear();
1185
+ if (this._timer) {
1186
+ window.clearInterval(this._timer);
1187
+ this._timer = null;
1188
+ }
1189
+ }
1190
+ }, {
1191
+ key: "addObserver",
1192
+ value: function addObserver(observer) {
1193
+ this._observer.addObserver(observer);
1194
+ }
1195
+ }, {
1196
+ key: "removeObserver",
1197
+ value: function removeObserver(observer) {
1198
+ this._observer.removeObserver(observer);
1199
+ }
1200
+ }]);
1201
+ }();
1202
+ (0, _base.registerDependency)('sharedVideoWindowDataSource');