@azure/communication-react 1.5.1-alpha-202304140012 → 1.5.1-alpha-202304172318

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 (172) hide show
  1. package/dist/communication-react.d.ts +363 -3
  2. package/dist/dist-cjs/communication-react/index.js +1599 -393
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +13 -0
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +36 -0
  8. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.d.ts +49 -0
  10. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js +53 -0
  11. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -0
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +12 -0
  13. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +25 -1
  14. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +3 -1
  16. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +3 -0
  18. package/dist/dist-esm/calling-component-bindings/src/index.js +2 -0
  19. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  20. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +68 -1
  21. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  22. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +8 -0
  23. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +81 -0
  24. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  25. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +57 -0
  26. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  27. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -0
  28. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +19 -0
  29. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  30. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.d.ts +18 -0
  31. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js +38 -0
  32. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js.map +1 -0
  33. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +6 -0
  34. package/dist/dist-esm/calling-stateful-client/src/Converter.js +17 -1
  35. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  36. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +7 -0
  37. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +10 -0
  38. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  39. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  40. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  41. package/dist/dist-esm/communication-react/src/index.d.ts +3 -0
  42. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.d.ts +91 -0
  44. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js +58 -0
  45. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js.map +1 -0
  46. package/dist/dist-esm/react-components/src/components/Caption.js +4 -3
  47. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +1 -0
  49. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +4 -4
  50. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  51. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.d.ts +37 -0
  52. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js +88 -0
  53. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js.map +1 -0
  54. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +6 -0
  55. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +6 -0
  57. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  58. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +2 -0
  59. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  60. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.d.ts +2 -0
  61. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +1 -0
  62. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
  63. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +2 -0
  64. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  65. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +6 -0
  66. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  67. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +6 -0
  68. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  69. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.d.ts +70 -0
  70. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js +52 -0
  71. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js.map +1 -0
  72. package/dist/dist-esm/react-components/src/components/index.d.ts +4 -0
  73. package/dist/dist-esm/react-components/src/components/index.js +8 -0
  74. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  75. package/dist/dist-esm/react-components/src/components/styles/AtMentionFlyout.style.d.ts +31 -0
  76. package/dist/dist-esm/react-components/src/components/styles/AtMentionFlyout.style.js +72 -0
  77. package/dist/dist-esm/react-components/src/components/styles/AtMentionFlyout.style.js.map +1 -0
  78. package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +8 -0
  79. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +17 -2
  80. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  81. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.d.ts +34 -0
  82. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js +85 -0
  83. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js.map +1 -0
  84. package/dist/dist-esm/react-components/src/components/utils.d.ts +4 -0
  85. package/dist/dist-esm/react-components/src/components/utils.js +4 -0
  86. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +4 -0
  88. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +5 -1
  89. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  90. package/dist/dist-esm/react-components/src/index.d.ts +1 -0
  91. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  92. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.d.ts +1 -1
  93. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.js.map +1 -1
  94. package/dist/dist-esm/react-components/src/theming/icons.d.ts +4 -0
  95. package/dist/dist-esm/react-components/src/theming/icons.js +11 -1
  96. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  97. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.d.ts +48 -0
  98. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js +4 -0
  99. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js.map +1 -0
  100. package/dist/dist-esm/react-components/src/types/index.d.ts +1 -0
  101. package/dist/dist-esm/react-components/src/types/index.js +1 -0
  102. package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
  103. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +65 -0
  104. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  105. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +13 -0
  106. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +61 -2
  107. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  108. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +54 -1
  109. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  110. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -0
  111. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  112. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +17 -2
  113. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  114. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
  115. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  116. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +16 -0
  117. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  118. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -0
  119. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  120. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +17 -0
  121. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +41 -0
  122. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  123. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +7 -1
  124. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  125. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +12 -0
  126. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  127. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +10 -0
  128. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +46 -0
  129. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  130. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +26 -1
  131. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  132. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +5 -0
  133. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +24 -0
  134. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  135. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.d.ts +6 -0
  136. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +60 -0
  137. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -0
  138. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.d.ts +12 -0
  139. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js +107 -0
  140. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map +1 -0
  141. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.d.ts +7 -0
  142. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js +38 -0
  143. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js.map +1 -0
  144. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -0
  145. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +19 -1
  146. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  147. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +2 -0
  148. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +113 -6
  149. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  150. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +13 -0
  151. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +103 -0
  152. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  153. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.d.ts +6 -0
  154. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js +24 -0
  155. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js.map +1 -0
  156. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +1 -0
  157. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js +5 -1
  158. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
  159. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.d.ts +20 -0
  160. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.js +55 -0
  161. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.js.map +1 -0
  162. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.d.ts +7 -0
  163. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.js +25 -0
  164. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.js.map +1 -0
  165. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js +1 -1
  166. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js.map +1 -1
  167. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +4 -0
  168. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +4 -0
  169. package/dist/dist-esm/react-composites/src/composites/common/utils.js +4 -0
  170. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  171. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +61 -1
  172. package/package.json +10 -10
@@ -162,7 +162,7 @@ const _toCommunicationIdentifier = (id) => {
162
162
  // Copyright (c) Microsoft Corporation.
163
163
  // Licensed under the MIT license.
164
164
  // GENERATED FILE. DO NOT EDIT MANUALLY.
165
- var telemetryVersion = '1.5.1-alpha-202304140012';
165
+ var telemetryVersion = '1.5.1-alpha-202304172318';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -375,10 +375,40 @@ const getEnvironmentInfo = (state) => {
375
375
  /* @conditional-compile-remove(unsupported-browser) */
376
376
  return state.environmentInfo;
377
377
  };
378
+ /* @conditional-compile-remove(close-captions) */
379
+ /** @private */
380
+ const getCaptions = (state, props) => {
381
+ var _a;
382
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.captions;
383
+ };
384
+ /* @conditional-compile-remove(close-captions) */
385
+ /** @private */
386
+ const getCaptionsStatus = (state, props) => {
387
+ var _a;
388
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.isCaptionsFeatureActive;
389
+ };
390
+ /* @conditional-compile-remove(close-captions) */
391
+ /** @private */
392
+ const getCurrentCaptionLanguage = (state, props) => {
393
+ var _a;
394
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.currentCaptionLanguage;
395
+ };
396
+ /* @conditional-compile-remove(close-captions) */
397
+ /** @private */
398
+ const getCurrentSpokenLanguage = (state, props) => {
399
+ var _a;
400
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.currentSpokenLanguage;
401
+ };
402
+ /* @conditional-compile-remove(close-captions) */
403
+ /** @private */
404
+ const getSupportedSpokenLanguages = (state, props) => {
405
+ var _a;
406
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.supportedSpokenLanguages;
407
+ };
378
408
 
379
409
  // Copyright (c) Microsoft Corporation.
380
410
  // Licensed under the MIT license.
381
- var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
411
+ var __awaiter$J = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
382
412
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
383
413
  return new (P || (P = Promise))(function (resolve, reject) {
384
414
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -416,7 +446,7 @@ const _isPreviewOn = (deviceManager) => {
416
446
  *
417
447
  * @private
418
448
  */
419
- const disposeAllLocalPreviewViews = (callClient) => __awaiter$F(void 0, void 0, void 0, function* () {
449
+ const disposeAllLocalPreviewViews = (callClient) => __awaiter$J(void 0, void 0, void 0, function* () {
420
450
  const unparentedViews = callClient.getState().deviceManager.unparentedViews;
421
451
  for (const view of unparentedViews) {
422
452
  yield callClient.disposeView(undefined, undefined, view);
@@ -455,13 +485,6 @@ const memoizedUpdateDisplayName = memoizeFnAll((participantId, participant) => {
455
485
  const isTeamsCallParticipants = (participants) => {
456
486
  return participants.every((p) => !communicationCommon.isCommunicationUserIdentifier(p));
457
487
  };
458
- /**
459
- * @private
460
- * A type guard to ensure all participants are acceptable type for ACS call
461
- */
462
- const isACSCallParticipants = (participants) => {
463
- return participants.every((p) => !communicationCommon.isMicrosoftTeamsUserIdentifier(p));
464
- };
465
488
  /**
466
489
  * @private
467
490
  * Checks whether the user is a 'Ringing' PSTN user.
@@ -549,7 +572,7 @@ const holdButtonSelector = reselect__namespace.createSelector([getCallState], (c
549
572
 
550
573
  // Copyright (c) Microsoft Corporation.
551
574
  // Licensed under the MIT license.
552
- var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
575
+ var __awaiter$I = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
553
576
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
554
577
  return new (P || (P = Promise))(function (resolve, reject) {
555
578
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -570,7 +593,7 @@ const areStreamsEqual = (prevStream, newStream) => {
570
593
  * @private
571
594
  */
572
595
  const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callClient, deviceManager, call) => {
573
- const onStartLocalVideo = () => __awaiter$E(void 0, void 0, void 0, function* () {
596
+ const onStartLocalVideo = () => __awaiter$I(void 0, void 0, void 0, function* () {
574
597
  // Before the call object creates a stream, dispose of any local preview streams.
575
598
  // @TODO: is there any way to parent the unparented view to the call object instead
576
599
  // of disposing and creating a new stream?
@@ -590,7 +613,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
590
613
  yield call.startVideo(stream);
591
614
  }
592
615
  });
593
- const onStopLocalVideo = (stream) => __awaiter$E(void 0, void 0, void 0, function* () {
616
+ const onStopLocalVideo = (stream) => __awaiter$I(void 0, void 0, void 0, function* () {
594
617
  const callId = call === null || call === void 0 ? void 0 : call.id;
595
618
  if (!callId) {
596
619
  return;
@@ -599,7 +622,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
599
622
  yield call.stopVideo(stream);
600
623
  }
601
624
  });
602
- const onToggleCamera = (options) => __awaiter$E(void 0, void 0, void 0, function* () {
625
+ const onToggleCamera = (options) => __awaiter$I(void 0, void 0, void 0, function* () {
603
626
  const previewOn = _isPreviewOn(callClient.getState().deviceManager);
604
627
  if (previewOn && call && call.state === 'Connecting') {
605
628
  // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.
@@ -647,19 +670,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
647
670
  }
648
671
  }
649
672
  });
650
- const onSelectMicrophone = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
673
+ const onSelectMicrophone = (device) => __awaiter$I(void 0, void 0, void 0, function* () {
651
674
  if (!deviceManager) {
652
675
  return;
653
676
  }
654
677
  return deviceManager.selectMicrophone(device);
655
678
  });
656
- const onSelectSpeaker = (device) => __awaiter$E(void 0, void 0, void 0, function* () {
679
+ const onSelectSpeaker = (device) => __awaiter$I(void 0, void 0, void 0, function* () {
657
680
  if (!deviceManager) {
658
681
  return;
659
682
  }
660
683
  return deviceManager.selectSpeaker(device);
661
684
  });
662
- const onSelectCamera = (device, options) => __awaiter$E(void 0, void 0, void 0, function* () {
685
+ const onSelectCamera = (device, options) => __awaiter$I(void 0, void 0, void 0, function* () {
663
686
  if (!deviceManager) {
664
687
  return;
665
688
  }
@@ -682,19 +705,19 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
682
705
  }, options);
683
706
  }
684
707
  });
685
- const onToggleMicrophone = () => __awaiter$E(void 0, void 0, void 0, function* () {
708
+ const onToggleMicrophone = () => __awaiter$I(void 0, void 0, void 0, function* () {
686
709
  if (!call || !_isInCall(call.state)) {
687
710
  throw new Error(`Please invoke onToggleMicrophone after call is started`);
688
711
  }
689
712
  return call.isMuted ? yield call.unmute() : yield call.mute();
690
713
  });
691
- const onStartScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
692
- const onStopScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
693
- const onToggleScreenShare = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
694
- const onHangUp = (forEveryone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
714
+ const onStartScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.startScreenSharing()); });
715
+ const onStopScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.stopScreenSharing()); });
716
+ const onToggleScreenShare = () => __awaiter$I(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.isScreenSharingOn) ? yield onStopScreenShare() : yield onStartScreenShare(); });
717
+ const onHangUp = (forEveryone) => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.hangUp({ forEveryone: forEveryone === true ? true : false })); });
695
718
  /* @conditional-compile-remove(PSTN-calls) */
696
- const onToggleHold = () => __awaiter$E(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
697
- const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$E(void 0, void 0, void 0, function* () {
719
+ const onToggleHold = () => __awaiter$I(void 0, void 0, void 0, function* () { return (call === null || call === void 0 ? void 0 : call.state) === 'LocalHold' ? yield (call === null || call === void 0 ? void 0 : call.resume()) : yield (call === null || call === void 0 ? void 0 : call.hold()); });
720
+ const onCreateLocalStreamView = (options = { scalingMode: 'Crop', isMirrored: true }) => __awaiter$I(void 0, void 0, void 0, function* () {
698
721
  var _a;
699
722
  if (!call || call.localVideoStreams.length === 0) {
700
723
  return;
@@ -710,7 +733,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
710
733
  const { view } = (_a = (yield callClient.createView(call.id, undefined, localStream, options))) !== null && _a !== void 0 ? _a : {};
711
734
  return view ? { view } : undefined;
712
735
  });
713
- const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$E(void 0, void 0, void 0, function* () {
736
+ const onCreateRemoteStreamView = (userId, options = { scalingMode: 'Crop' }) => __awaiter$I(void 0, void 0, void 0, function* () {
714
737
  if (!call) {
715
738
  return;
716
739
  }
@@ -741,7 +764,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
741
764
  }
742
765
  return (createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view) ? { view: createViewResult === null || createViewResult === void 0 ? void 0 : createViewResult.view } : undefined;
743
766
  });
744
- const onDisposeRemoteStreamView = (userId) => __awaiter$E(void 0, void 0, void 0, function* () {
767
+ const onDisposeRemoteStreamView = (userId) => __awaiter$I(void 0, void 0, void 0, function* () {
745
768
  if (!call) {
746
769
  return;
747
770
  }
@@ -762,7 +785,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
762
785
  callClient.disposeView(call.id, participant.identifier, screenShareStream);
763
786
  }
764
787
  });
765
- const onDisposeLocalStreamView = () => __awaiter$E(void 0, void 0, void 0, function* () {
788
+ const onDisposeLocalStreamView = () => __awaiter$I(void 0, void 0, void 0, function* () {
766
789
  // If the user is currently in a call, dispose of the local stream view attached to that call.
767
790
  const callState = call && callClient.getState().calls[call.id];
768
791
  const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
@@ -775,18 +798,18 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
775
798
  yield disposeAllLocalPreviewViews(callClient);
776
799
  });
777
800
  /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
778
- const onSendDtmfTone = (dtmfTone) => __awaiter$E(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
801
+ const onSendDtmfTone = (dtmfTone) => __awaiter$I(void 0, void 0, void 0, function* () { return yield (call === null || call === void 0 ? void 0 : call.sendDtmf(dtmfTone)); });
779
802
  const notImplemented = () => {
780
803
  throw new Error('Not implemented, cannot call a method from an abstract object');
781
804
  };
782
805
  /* @conditional-compile-remove(call-readiness) */
783
- const askDevicePermission = (constrain) => __awaiter$E(void 0, void 0, void 0, function* () {
806
+ const askDevicePermission = (constrain) => __awaiter$I(void 0, void 0, void 0, function* () {
784
807
  if (deviceManager) {
785
808
  yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
786
809
  }
787
810
  });
788
811
  /* @conditional-compile-remove(video-background-effects) */
789
- const onRemoveVideoBackgroundEffects = () => __awaiter$E(void 0, void 0, void 0, function* () {
812
+ const onRemoveVideoBackgroundEffects = () => __awaiter$I(void 0, void 0, void 0, function* () {
790
813
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
791
814
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
792
815
  if (stream) {
@@ -794,7 +817,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
794
817
  }
795
818
  });
796
819
  /* @conditional-compile-remove(video-background-effects) */
797
- const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
820
+ const onBlurVideoBackground = (backgroundBlurConfig) => __awaiter$I(void 0, void 0, void 0, function* () {
798
821
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
799
822
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
800
823
  if (stream) {
@@ -802,7 +825,7 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
802
825
  }
803
826
  });
804
827
  /* @conditional-compile-remove(video-background-effects) */
805
- const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$E(void 0, void 0, void 0, function* () {
828
+ const onReplaceVideoBackground = (backgroundReplacementConfig) => __awaiter$I(void 0, void 0, void 0, function* () {
806
829
  const stream = (call === null || call === void 0 ? void 0 : call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) ||
807
830
  (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.getUnparentedVideoStreams().find((stream) => stream.mediaStreamType === 'Video'));
808
831
  if (stream) {
@@ -811,6 +834,22 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
811
834
  .startEffects(new communicationCallingEffects.BackgroundReplacementEffect(backgroundReplacementConfig));
812
835
  }
813
836
  });
837
+ /* @conditional-compile-remove(close-captions) */
838
+ const onStartCaptions = (options) => __awaiter$I(void 0, void 0, void 0, function* () {
839
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).startCaptions(options));
840
+ });
841
+ /* @conditional-compile-remove(close-captions) */
842
+ const onStopCaptions = () => __awaiter$I(void 0, void 0, void 0, function* () {
843
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).stopCaptions());
844
+ });
845
+ /* @conditional-compile-remove(close-captions) */
846
+ const onSetSpokenLanguage = (language) => __awaiter$I(void 0, void 0, void 0, function* () {
847
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setSpokenLanguage(language));
848
+ });
849
+ /* @conditional-compile-remove(close-captions) */
850
+ const onSetCaptionLanguage = (language) => __awaiter$I(void 0, void 0, void 0, function* () {
851
+ yield (call === null || call === void 0 ? void 0 : call.feature(communicationCalling.Features.TeamsCaptions).setCaptionLanguage(language));
852
+ });
814
853
  return {
815
854
  onHangUp,
816
855
  /* @conditional-compile-remove(PSTN-calls) */
@@ -840,13 +879,21 @@ const createDefaultCommonCallingHandlers = memoizeOne__default['default']((callC
840
879
  /* @conditional-compile-remove(video-background-effects) */
841
880
  onBlurVideoBackground,
842
881
  /* @conditional-compile-remove(video-background-effects) */
843
- onReplaceVideoBackground
882
+ onReplaceVideoBackground,
883
+ /* @conditional-compile-remove(close-captions) */
884
+ onStartCaptions,
885
+ /* @conditional-compile-remove(close-captions) */
886
+ onStopCaptions,
887
+ /* @conditional-compile-remove(close-captions) */
888
+ onSetCaptionLanguage,
889
+ /* @conditional-compile-remove(close-captions) */
890
+ onSetSpokenLanguage
844
891
  };
845
892
  });
846
893
 
847
894
  // Copyright (c) Microsoft Corporation.
848
895
  // Licensed under the MIT license.
849
- var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
896
+ var __awaiter$H = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
850
897
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
851
898
  return new (P || (P = Promise))(function (resolve, reject) {
852
899
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -867,13 +914,11 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
867
914
  return Object.assign(Object.assign({}, createDefaultCommonCallingHandlers(callClient, deviceManager, call)), {
868
915
  // FIXME: onStartCall API should use string, not the underlying SDK types.
869
916
  onStartCall: (participants, options) => {
870
- if (!isACSCallParticipants(participants)) {
871
- throw new Error('TeamsUserIdentifier in Teams call is not supported!');
872
- }
873
- return callAgent ? callAgent.startCall(participants, options) : undefined;
917
+ /* @conditional-compile-remove(teams-adhoc-call) */
918
+ return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
874
919
  },
875
920
  /* @conditional-compile-remove(PSTN-calls) */
876
- onAddParticipant: (userId, options) => __awaiter$D(void 0, void 0, void 0, function* () {
921
+ onAddParticipant: (userId, options) => __awaiter$H(void 0, void 0, void 0, function* () {
877
922
  const participant = _toCommunicationIdentifier(userId);
878
923
  if (communicationCommon.isPhoneNumberIdentifier(participant)) {
879
924
  call === null || call === void 0 ? void 0 : call.addParticipant(participant, options);
@@ -881,7 +926,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
881
926
  else if (communicationCommon.isCommunicationUserIdentifier(participant) || communicationCommon.isMicrosoftTeamsUserIdentifier(participant)) {
882
927
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
883
928
  }
884
- }), onRemoveParticipant: (userId) => __awaiter$D(void 0, void 0, void 0, function* () {
929
+ }), onRemoveParticipant: (userId) => __awaiter$H(void 0, void 0, void 0, function* () {
885
930
  const participant = _toCommunicationIdentifier(userId);
886
931
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
887
932
  }) });
@@ -889,7 +934,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
889
934
 
890
935
  // Copyright (c) Microsoft Corporation.
891
936
  // Licensed under the MIT license.
892
- var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
937
+ var __awaiter$G = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
893
938
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
894
939
  return new (P || (P = Promise))(function (resolve, reject) {
895
940
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -921,7 +966,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
921
966
  },
922
967
  /* @conditional-compile-remove(teams-identity-support) */
923
968
  /* @conditional-compile-remove(PSTN-calls) */
924
- onAddParticipant: (userId, options) => __awaiter$C(void 0, void 0, void 0, function* () {
969
+ onAddParticipant: (userId, options) => __awaiter$G(void 0, void 0, void 0, function* () {
925
970
  const participant = _toCommunicationIdentifier(userId);
926
971
  /* @conditional-compile-remove(teams-identity-support) */
927
972
  const threadId = options === null || options === void 0 ? void 0 : options.threadId;
@@ -934,7 +979,7 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
934
979
  }
935
980
  /* @conditional-compile-remove(teams-identity-support) */
936
981
  call === null || call === void 0 ? void 0 : call.addParticipant(participant);
937
- }), onRemoveParticipant: (userId) => __awaiter$C(void 0, void 0, void 0, function* () {
982
+ }), onRemoveParticipant: (userId) => __awaiter$G(void 0, void 0, void 0, function* () {
938
983
  const participant = _toCommunicationIdentifier(userId);
939
984
  if (communicationCommon.isCommunicationUserIdentifier(participant)) {
940
985
  throw new Error('CommunicationIdentifier in Teams call is not supported!');
@@ -944,9 +989,57 @@ const createDefaultTeamsCallingHandlers = memoizeOne__default['default']((callCl
944
989
  }) });
945
990
  });
946
991
 
992
+ /* @conditional-compile-remove(close-captions) */
993
+ /* @conditional-compile-remove(close-captions) */
994
+ /**
995
+ * Selector for {@link StartCaptionsButton} component.
996
+ *
997
+ * @internal
998
+ */
999
+ const _startCaptionsButtonSelector = reselect__namespace.createSelector([getCaptionsStatus, getCurrentCaptionLanguage, getCurrentSpokenLanguage], (isCaptionsFeatureActive, currentCaptionLanguage, currentSpokenLanguage) => {
1000
+ return {
1001
+ checked: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false,
1002
+ currentCaptionLanguage: currentCaptionLanguage !== null && currentCaptionLanguage !== void 0 ? currentCaptionLanguage : 'en-us',
1003
+ currentSpokenLanguage: currentSpokenLanguage !== null && currentSpokenLanguage !== void 0 ? currentSpokenLanguage : 'en-us'
1004
+ };
1005
+ });
1006
+ /* @conditional-compile-remove(close-captions) */
1007
+ /**
1008
+ * Selector for {@link ChangeSpokenLanguageButton} component.
1009
+ *
1010
+ * @internal
1011
+ */
1012
+ const _changeSpokenLanguageSelector = reselect__namespace.createSelector([getSupportedSpokenLanguages, getCurrentSpokenLanguage, getCaptionsStatus], (supportedSpokenLanguages, currentSpokenLanguage, isCaptionsFeatureActive) => {
1013
+ return {
1014
+ supportedSpokenLanguages: supportedSpokenLanguages !== null && supportedSpokenLanguages !== void 0 ? supportedSpokenLanguages : ['en-us'],
1015
+ currentSpokenLanguage: currentSpokenLanguage !== null && currentSpokenLanguage !== void 0 ? currentSpokenLanguage : 'en-us',
1016
+ isCaptionsFeatureActive: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false
1017
+ };
1018
+ });
1019
+ /* @conditional-compile-remove(close-captions) */
1020
+ /**
1021
+ * Selector for {@link CaptionsBanner} component.
1022
+ *
1023
+ * @internal
1024
+ */
1025
+ const _captionsBannerSelector = reselect__namespace.createSelector([getCaptions, getCaptionsStatus], (captions, isCaptionsFeatureActive) => {
1026
+ const captionsInfo = captions === null || captions === void 0 ? void 0 : captions.map((c) => {
1027
+ var _a, _b;
1028
+ return {
1029
+ displayName: (_a = c.speaker.displayName) !== null && _a !== void 0 ? _a : 'Unnamed Participant',
1030
+ captionText: (_b = c.captionText) !== null && _b !== void 0 ? _b : '',
1031
+ userId: c.speaker.identifier ? toFlatCommunicationIdentifier(c.speaker.identifier) : ''
1032
+ };
1033
+ });
1034
+ return {
1035
+ captions: captionsInfo !== null && captionsInfo !== void 0 ? captionsInfo : [],
1036
+ isCaptionsOn: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false
1037
+ };
1038
+ });
1039
+
947
1040
  // Copyright (c) Microsoft Corporation.
948
1041
  // Licensed under the MIT license.
949
- var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1042
+ var __awaiter$F = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
950
1043
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
951
1044
  return new (P || (P = Promise))(function (resolve, reject) {
952
1045
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -995,13 +1088,13 @@ class ProxyDeviceManager {
995
1088
  this.selectCamera = (videoDeviceInfo) => {
996
1089
  this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);
997
1090
  };
998
- this.videoDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
1091
+ this.videoDevicesUpdated = () => __awaiter$F(this, void 0, void 0, function* () {
999
1092
  // Device Manager always has a camera with '' name if there are no real camera devices available.
1000
1093
  // We don't want to show that in the UI.
1001
1094
  const realCameras = (yield this._deviceManager.getCameras()).filter((c) => !!c.name);
1002
1095
  this._context.setDeviceManagerCameras(dedupeById(realCameras));
1003
1096
  });
1004
- this.audioDevicesUpdated = () => __awaiter$B(this, void 0, void 0, function* () {
1097
+ this.audioDevicesUpdated = () => __awaiter$F(this, void 0, void 0, function* () {
1005
1098
  this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));
1006
1099
  this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));
1007
1100
  });
@@ -1204,7 +1297,170 @@ class CallIdHistory {
1204
1297
 
1205
1298
  // Copyright (c) Microsoft Corporation.
1206
1299
  // Licensed under the MIT license.
1207
- var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1300
+ /**
1301
+ * @internal
1302
+ */
1303
+ const _isACSCall = (call) => {
1304
+ /* @conditional-compile-remove(teams-identity-support) */
1305
+ return !call.kind || call.kind === 'Call';
1306
+ };
1307
+ /**
1308
+ * @internal
1309
+ */
1310
+ const _isACSCallAgent = (callAgent) => {
1311
+ /* @conditional-compile-remove(teams-identity-support) */
1312
+ return !callAgent.kind || callAgent.kind === 'CallAgent';
1313
+ };
1314
+ /**
1315
+ * @internal
1316
+ */
1317
+ const _isTeamsCall = (call) => {
1318
+ /* @conditional-compile-remove(teams-identity-support) */
1319
+ return call.kind === 'TeamsCall';
1320
+ };
1321
+ /**
1322
+ * @internal
1323
+ */
1324
+ const _isTeamsCallAgent = (callAgent) => {
1325
+ /* @conditional-compile-remove(teams-identity-support) */
1326
+ return callAgent.kind === 'TeamsCallAgent';
1327
+ };
1328
+ /* @conditional-compile-remove(close-captions) */
1329
+ /**
1330
+ * @private
1331
+ * Determine whether a call is:
1332
+ * A TeamsCall
1333
+ * or a ACS Call joining the teams meeting
1334
+ */
1335
+ const _isTeamsMeetingCall = (call) => {
1336
+ return _isTeamsCall(call) || (_isACSCall(call) && !call.info.groupId && !call.info.roomId); // there should be a better way to determine if a call is joining a teams meeting ideally should be a meetingID in the info object
1337
+ };
1338
+
1339
+ // Copyright (c) Microsoft Corporation.
1340
+ /**
1341
+ * @private
1342
+ */
1343
+ function convertSdkLocalStreamToDeclarativeLocalStream(stream) {
1344
+ return {
1345
+ source: stream.source,
1346
+ mediaStreamType: stream.mediaStreamType,
1347
+ view: undefined
1348
+ // TODO [video-background-effects]: Add video effects state when it is added to the SDK
1349
+ };
1350
+ }
1351
+ /**
1352
+ * @private
1353
+ */
1354
+ function convertSdkRemoteStreamToDeclarativeRemoteStream(stream) {
1355
+ return {
1356
+ id: stream.id,
1357
+ mediaStreamType: stream.mediaStreamType,
1358
+ isAvailable: stream.isAvailable,
1359
+ /* @conditional-compile-remove(video-stream-is-receiving-flag) */
1360
+ isReceiving: stream.isReceiving,
1361
+ view: undefined
1362
+ };
1363
+ }
1364
+ /**
1365
+ * @private
1366
+ */
1367
+ function convertSdkParticipantToDeclarativeParticipant(participant) {
1368
+ const declarativeVideoStreams = {};
1369
+ for (const videoStream of participant.videoStreams) {
1370
+ declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);
1371
+ }
1372
+ return {
1373
+ identifier: participant.identifier,
1374
+ displayName: participant.displayName,
1375
+ state: participant.state,
1376
+ callEndReason: participant.callEndReason,
1377
+ videoStreams: declarativeVideoStreams,
1378
+ isMuted: participant.isMuted,
1379
+ isSpeaking: participant.isSpeaking
1380
+ };
1381
+ }
1382
+ /**
1383
+ * @private
1384
+ *
1385
+ * Note at the time of writing only one LocalVideoStream is supported by the SDK.
1386
+ */
1387
+ function convertSdkCallToDeclarativeCall(call) {
1388
+ const declarativeRemoteParticipants = {};
1389
+ call.remoteParticipants.forEach((participant) => {
1390
+ declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =
1391
+ convertSdkParticipantToDeclarativeParticipant(participant);
1392
+ });
1393
+ return {
1394
+ id: call.id,
1395
+ /* @conditional-compile-remove(teams-identity-support) */
1396
+ kind: _isACSCall(call) ? 'Call' : 'TeamsCall',
1397
+ callerInfo: call.callerInfo,
1398
+ state: call.state,
1399
+ callEndReason: call.callEndReason,
1400
+ diagnostics: {
1401
+ network: {
1402
+ latest: {}
1403
+ },
1404
+ media: {
1405
+ latest: {}
1406
+ }
1407
+ },
1408
+ direction: call.direction,
1409
+ isMuted: call.isMuted,
1410
+ isScreenSharingOn: call.isScreenSharingOn,
1411
+ localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),
1412
+ remoteParticipants: declarativeRemoteParticipants,
1413
+ remoteParticipantsEnded: {},
1414
+ recording: { isRecordingActive: false },
1415
+ transcription: { isTranscriptionActive: false },
1416
+ screenShareRemoteParticipant: undefined,
1417
+ startTime: new Date(),
1418
+ endTime: undefined,
1419
+ /* @conditional-compile-remove(rooms) */
1420
+ role: call.role,
1421
+ /* @conditional-compile-remove(close-captions) */
1422
+ captionsFeature: {
1423
+ captions: [],
1424
+ supportedSpokenLanguages: [],
1425
+ supportedCaptionLanguages: [],
1426
+ currentCaptionLanguage: '',
1427
+ currentSpokenLanguage: '',
1428
+ isCaptionsFeatureActive: false
1429
+ }
1430
+ };
1431
+ }
1432
+ /**
1433
+ * @private
1434
+ */
1435
+ function convertSdkIncomingCallToDeclarativeIncomingCall(call) {
1436
+ return {
1437
+ id: call.id,
1438
+ callerInfo: call.callerInfo,
1439
+ startTime: new Date(),
1440
+ endTime: undefined
1441
+ };
1442
+ }
1443
+ /**
1444
+ * @private
1445
+ */
1446
+ function convertFromSDKToDeclarativeVideoStreamRendererView(view) {
1447
+ return {
1448
+ scalingMode: view.scalingMode,
1449
+ isMirrored: view.isMirrored,
1450
+ target: view.target
1451
+ };
1452
+ }
1453
+ /* @conditional-compile-remove(close-captions) */
1454
+ /**
1455
+ * @private
1456
+ */
1457
+ function convertFromSDKToCaptionInfoState(caption) {
1458
+ return Object.assign({}, caption);
1459
+ }
1460
+
1461
+ // Copyright (c) Microsoft Corporation.
1462
+ // Licensed under the MIT license.
1463
+ var __awaiter$E = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
1208
1464
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1209
1465
  return new (P || (P = Promise))(function (resolve, reject) {
1210
1466
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -1322,6 +1578,10 @@ class CallContext$2 {
1322
1578
  /* @conditional-compile-remove(total-participant-count) */
1323
1579
  existingCall.totalParticipantCount = call.totalParticipantCount;
1324
1580
  // We don't update the startTime and endTime if we are updating an existing active call
1581
+ /* @conditional-compile-remove(close-captions) */
1582
+ existingCall.captionsFeature.currentSpokenLanguage = call.captionsFeature.currentSpokenLanguage;
1583
+ /* @conditional-compile-remove(close-captions) */
1584
+ existingCall.captionsFeature.currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;
1325
1585
  }
1326
1586
  else {
1327
1587
  draft.calls[latestCallId] = call;
@@ -1779,6 +2039,81 @@ class CallContext$2 {
1779
2039
  this._atomicId++;
1780
2040
  return id;
1781
2041
  }
2042
+ /* @conditional-compile-remove(close-captions) */
2043
+ processNewCaption(captions, newCaption) {
2044
+ // going through current captions to find the last caption said by the same speaker, remove that caption if it's partial and replace with the new caption
2045
+ for (let index = captions.length - 1; index >= 0; index--) {
2046
+ const currentCaption = captions[index];
2047
+ if (currentCaption &&
2048
+ currentCaption.resultType !== 'Final' &&
2049
+ currentCaption.speaker.identifier &&
2050
+ newCaption.speaker.identifier &&
2051
+ toFlatCommunicationIdentifier(currentCaption.speaker.identifier) ===
2052
+ toFlatCommunicationIdentifier(newCaption.speaker.identifier)) {
2053
+ captions.splice(index, 1);
2054
+ break;
2055
+ }
2056
+ }
2057
+ captions.push(newCaption);
2058
+ // If the array length exceeds 50, remove the oldest caption
2059
+ if (captions.length > 50) {
2060
+ captions.shift();
2061
+ }
2062
+ }
2063
+ /* @conditional-compile-remove(close-captions) */
2064
+ addCaption(callId, caption) {
2065
+ this.modifyState((draft) => {
2066
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2067
+ if (call) {
2068
+ this.processNewCaption(call.captionsFeature.captions, convertFromSDKToCaptionInfoState(caption));
2069
+ }
2070
+ });
2071
+ }
2072
+ /* @conditional-compile-remove(close-captions) */
2073
+ setIsCaptionActive(callId, isCaptionsActive) {
2074
+ this.modifyState((draft) => {
2075
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2076
+ if (call) {
2077
+ call.captionsFeature.isCaptionsFeatureActive = isCaptionsActive;
2078
+ }
2079
+ });
2080
+ }
2081
+ /* @conditional-compile-remove(close-captions) */
2082
+ setSelectedSpokenLanguage(callId, spokenLanguage) {
2083
+ this.modifyState((draft) => {
2084
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2085
+ if (call) {
2086
+ call.captionsFeature.currentSpokenLanguage = spokenLanguage;
2087
+ }
2088
+ });
2089
+ }
2090
+ /* @conditional-compile-remove(close-captions) */
2091
+ setSelectedCaptionLanguage(callId, captionLanguage) {
2092
+ this.modifyState((draft) => {
2093
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2094
+ if (call) {
2095
+ call.captionsFeature.currentCaptionLanguage = captionLanguage;
2096
+ }
2097
+ });
2098
+ }
2099
+ /* @conditional-compile-remove(close-captions) */
2100
+ setAvailableCaptionLanguages(callId, captionLanguages) {
2101
+ this.modifyState((draft) => {
2102
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2103
+ if (call) {
2104
+ call.captionsFeature.supportedCaptionLanguages = captionLanguages;
2105
+ }
2106
+ });
2107
+ }
2108
+ /* @conditional-compile-remove(close-captions) */
2109
+ setAvailableSpokenLanguages(callId, spokenLanguages) {
2110
+ this.modifyState((draft) => {
2111
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
2112
+ if (call) {
2113
+ call.captionsFeature.supportedSpokenLanguages = spokenLanguages;
2114
+ }
2115
+ });
2116
+ }
1782
2117
  /**
1783
2118
  * Tees any errors encountered in an async function to the state.
1784
2119
  *
@@ -1788,7 +2123,7 @@ class CallContext$2 {
1788
2123
  * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.
1789
2124
  */
1790
2125
  withAsyncErrorTeedToState(action, target) {
1791
- return (...args) => __awaiter$A(this, void 0, void 0, function* () {
2126
+ return (...args) => __awaiter$E(this, void 0, void 0, function* () {
1792
2127
  try {
1793
2128
  return yield action(...args);
1794
2129
  }
@@ -1852,139 +2187,40 @@ const findOldestCallEnded = (calls) => {
1852
2187
 
1853
2188
  // Copyright (c) Microsoft Corporation.
1854
2189
  // Licensed under the MIT license.
1855
- /**
1856
- * @internal
1857
- */
1858
- const _isACSCall = (call) => {
1859
- /* @conditional-compile-remove(teams-identity-support) */
1860
- return !call.kind || call.kind === 'Call';
1861
- };
1862
- /**
1863
- * @internal
1864
- */
1865
- const _isACSCallAgent = (callAgent) => {
1866
- /* @conditional-compile-remove(teams-identity-support) */
1867
- return !callAgent.kind || callAgent.kind === 'CallAgent';
1868
- };
1869
- /**
1870
- * @internal
1871
- */
1872
- const _isTeamsCall = (call) => {
1873
- /* @conditional-compile-remove(teams-identity-support) */
1874
- return call.kind === 'TeamsCall';
1875
- };
1876
- /**
1877
- * @internal
1878
- */
1879
- const _isTeamsCallAgent = (callAgent) => {
1880
- /* @conditional-compile-remove(teams-identity-support) */
1881
- return callAgent.kind === 'TeamsCallAgent';
1882
- };
1883
-
1884
- // Copyright (c) Microsoft Corporation.
1885
- /**
1886
- * @private
1887
- */
1888
- function convertSdkLocalStreamToDeclarativeLocalStream(stream) {
1889
- return {
1890
- source: stream.source,
1891
- mediaStreamType: stream.mediaStreamType,
1892
- view: undefined
1893
- // TODO [video-background-effects]: Add video effects state when it is added to the SDK
1894
- };
1895
- }
1896
- /**
1897
- * @private
1898
- */
1899
- function convertSdkRemoteStreamToDeclarativeRemoteStream(stream) {
1900
- return {
1901
- id: stream.id,
1902
- mediaStreamType: stream.mediaStreamType,
1903
- isAvailable: stream.isAvailable,
1904
- /* @conditional-compile-remove(video-stream-is-receiving-flag) */
1905
- isReceiving: stream.isReceiving,
1906
- view: undefined
1907
- };
1908
- }
2190
+ /* @conditional-compile-remove(close-captions) */
1909
2191
  /**
1910
2192
  * @private
1911
2193
  */
1912
- function convertSdkParticipantToDeclarativeParticipant(participant) {
1913
- const declarativeVideoStreams = {};
1914
- for (const videoStream of participant.videoStreams) {
1915
- declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);
2194
+ class CaptionsSubscriber {
2195
+ constructor(callIdRef, context, captions) {
2196
+ this.subscribe = () => {
2197
+ this._captions.on('isCaptionsActiveChanged', this.isCaptionsActiveChanged);
2198
+ this._captions.on('captionsReceived', this.onCaptionsReceived);
2199
+ };
2200
+ this.unsubscribe = () => {
2201
+ this._captions.off('isCaptionsActiveChanged', this.isCaptionsActiveChanged);
2202
+ this._captions.off('captionsReceived', this.onCaptionsReceived);
2203
+ };
2204
+ this.onCaptionsReceived = (caption) => {
2205
+ this._context.addCaption(this._callIdRef.callId, caption);
2206
+ this._context.setSelectedSpokenLanguage(this._callIdRef.callId, caption.spokenLanguage);
2207
+ this._context.setSelectedCaptionLanguage(this._callIdRef.callId, caption.spokenLanguage);
2208
+ };
2209
+ this.isCaptionsActiveChanged = () => {
2210
+ this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);
2211
+ };
2212
+ this._callIdRef = callIdRef;
2213
+ this._context = context;
2214
+ this._captions = captions;
2215
+ if (this._captions.isCaptionsFeatureActive) {
2216
+ this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);
2217
+ }
2218
+ this._context.setAvailableSpokenLanguages(this._callIdRef.callId, this._captions.supportedSpokenLanguages);
2219
+ if ('availableSubtitleLanguages' in this._captions) {
2220
+ this._context.setAvailableCaptionLanguages(this._callIdRef.callId, this._captions.supportedCaptionLanguages);
2221
+ }
2222
+ this.subscribe();
1916
2223
  }
1917
- return {
1918
- identifier: participant.identifier,
1919
- displayName: participant.displayName,
1920
- state: participant.state,
1921
- callEndReason: participant.callEndReason,
1922
- videoStreams: declarativeVideoStreams,
1923
- isMuted: participant.isMuted,
1924
- isSpeaking: participant.isSpeaking
1925
- };
1926
- }
1927
- /**
1928
- * @private
1929
- *
1930
- * Note at the time of writing only one LocalVideoStream is supported by the SDK.
1931
- */
1932
- function convertSdkCallToDeclarativeCall(call) {
1933
- const declarativeRemoteParticipants = {};
1934
- call.remoteParticipants.forEach((participant) => {
1935
- declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =
1936
- convertSdkParticipantToDeclarativeParticipant(participant);
1937
- });
1938
- return {
1939
- id: call.id,
1940
- /* @conditional-compile-remove(teams-identity-support) */
1941
- kind: _isACSCall(call) ? 'Call' : 'TeamsCall',
1942
- callerInfo: call.callerInfo,
1943
- state: call.state,
1944
- callEndReason: call.callEndReason,
1945
- diagnostics: {
1946
- network: {
1947
- latest: {}
1948
- },
1949
- media: {
1950
- latest: {}
1951
- }
1952
- },
1953
- direction: call.direction,
1954
- isMuted: call.isMuted,
1955
- isScreenSharingOn: call.isScreenSharingOn,
1956
- localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),
1957
- remoteParticipants: declarativeRemoteParticipants,
1958
- remoteParticipantsEnded: {},
1959
- recording: { isRecordingActive: false },
1960
- transcription: { isTranscriptionActive: false },
1961
- screenShareRemoteParticipant: undefined,
1962
- startTime: new Date(),
1963
- endTime: undefined,
1964
- /* @conditional-compile-remove(rooms) */
1965
- role: call.role
1966
- };
1967
- }
1968
- /**
1969
- * @private
1970
- */
1971
- function convertSdkIncomingCallToDeclarativeIncomingCall(call) {
1972
- return {
1973
- id: call.id,
1974
- callerInfo: call.callerInfo,
1975
- startTime: new Date(),
1976
- endTime: undefined
1977
- };
1978
- }
1979
- /**
1980
- * @private
1981
- */
1982
- function convertFromSDKToDeclarativeVideoStreamRendererView(view) {
1983
- return {
1984
- scalingMode: view.scalingMode,
1985
- isMirrored: view.isMirrored,
1986
- target: view.target
1987
- };
1988
2224
  }
1989
2225
 
1990
2226
  // Copyright (c) Microsoft Corporation.
@@ -2315,7 +2551,7 @@ function _logStreamEvent(eventName, streamLogInfo, error) {
2315
2551
 
2316
2552
  // Copyright (c) Microsoft Corporation.
2317
2553
  // Licensed under the MIT license.
2318
- var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2554
+ var __awaiter$D = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
2319
2555
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
2320
2556
  return new (P || (P = Promise))(function (resolve, reject) {
2321
2557
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -2325,7 +2561,7 @@ var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments,
2325
2561
  });
2326
2562
  };
2327
2563
  function createViewVideo(context, internalContext, callId, stream, participantId, options) {
2328
- return __awaiter$z(this, void 0, void 0, function* () {
2564
+ return __awaiter$D(this, void 0, void 0, function* () {
2329
2565
  // we can only have 3 types of createView
2330
2566
  let streamEventType;
2331
2567
  // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.
@@ -2447,7 +2683,7 @@ function createViewVideo(context, internalContext, callId, stream, participantId
2447
2683
  });
2448
2684
  }
2449
2685
  function createViewUnparentedVideo(context, internalContext, stream, options) {
2450
- return __awaiter$z(this, void 0, void 0, function* () {
2686
+ return __awaiter$D(this, void 0, void 0, function* () {
2451
2687
  const renderInfo = internalContext.getUnparentedRenderInfo(stream);
2452
2688
  if (renderInfo && renderInfo.status === 'Rendered') {
2453
2689
  console.warn('Unparented LocalVideoStream is already rendered');
@@ -2615,7 +2851,7 @@ function createView(context, internalContext, callId, participantId, stream, opt
2615
2851
  // Render LocalVideoStream that is not part of a Call
2616
2852
  // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).
2617
2853
  // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.
2618
- return context.withAsyncErrorTeedToState(() => __awaiter$z(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2854
+ return context.withAsyncErrorTeedToState(() => __awaiter$D(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();
2619
2855
  }
2620
2856
  else {
2621
2857
  _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });
@@ -2898,6 +3134,8 @@ class CallSubscriber {
2898
3134
  constructor(call, context, internalContext) {
2899
3135
  this.subscribe = () => {
2900
3136
  this._call.on('stateChanged', this.stateChanged);
3137
+ /* @conditional-compile-remove(close-captions) */
3138
+ this._call.on('stateChanged', this.initCaptionSubscriber);
2901
3139
  this._call.on('idChanged', this.idChanged);
2902
3140
  this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);
2903
3141
  this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);
@@ -2920,7 +3158,10 @@ class CallSubscriber {
2920
3158
  }
2921
3159
  };
2922
3160
  this.unsubscribe = () => {
3161
+ var _a;
2923
3162
  this._call.off('stateChanged', this.stateChanged);
3163
+ /* @conditional-compile-remove(close-captions) */
3164
+ this._call.off('stateChanged', this.initCaptionSubscriber);
2924
3165
  this._call.off('idChanged', this.idChanged);
2925
3166
  this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);
2926
3167
  this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);
@@ -2943,10 +3184,20 @@ class CallSubscriber {
2943
3184
  this._diagnosticsSubscriber.unsubscribe();
2944
3185
  this._recordingSubscriber.unsubscribe();
2945
3186
  this._transcriptionSubscriber.unsubscribe();
3187
+ /* @conditional-compile-remove(close-captions) */
3188
+ (_a = this._captionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();
2946
3189
  };
2947
3190
  this.stateChanged = () => {
2948
3191
  this._context.setCallState(this._callIdRef.callId, this._call.state);
2949
3192
  };
3193
+ /* @conditional-compile-remove(close-captions) */
3194
+ this.initCaptionSubscriber = () => {
3195
+ // subscribe to captions here so that we don't call captions when call is not initialized
3196
+ if (_isTeamsMeetingCall(this._call) && this._call.state === 'Connected' && !this._captionsSubscriber) {
3197
+ this._captionsSubscriber = new CaptionsSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.TeamsCaptions));
3198
+ this._call.off('stateChanged', this.initCaptionSubscriber);
3199
+ }
3200
+ };
2950
3201
  this.idChanged = () => {
2951
3202
  this._internalContext.setCallId(this._call.id, this._callIdRef.callId);
2952
3203
  this._context.setCallId(this._call.id, this._callIdRef.callId);
@@ -3049,7 +3300,7 @@ class CallSubscriber {
3049
3300
 
3050
3301
  // Copyright (c) Microsoft Corporation.
3051
3302
  // Licensed under the MIT license.
3052
- var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3303
+ var __awaiter$C = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3053
3304
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3054
3305
  return new (P || (P = Promise))(function (resolve, reject) {
3055
3306
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3069,14 +3320,14 @@ class ProxyIncomingCall {
3069
3320
  switch (prop) {
3070
3321
  case 'accept': {
3071
3322
  return this._context.withAsyncErrorTeedToState(function (...args) {
3072
- return __awaiter$y(this, void 0, void 0, function* () {
3323
+ return __awaiter$C(this, void 0, void 0, function* () {
3073
3324
  return yield target.accept(...args);
3074
3325
  });
3075
3326
  }, 'IncomingCall.accept');
3076
3327
  }
3077
3328
  case 'reject': {
3078
3329
  return this._context.withAsyncErrorTeedToState(function (...args) {
3079
- return __awaiter$y(this, void 0, void 0, function* () {
3330
+ return __awaiter$C(this, void 0, void 0, function* () {
3080
3331
  return yield target.reject(...args);
3081
3332
  });
3082
3333
  }, 'IncomingCall.reject');
@@ -3313,7 +3564,7 @@ const clearCallRelatedState = (context, internalContext) => {
3313
3564
 
3314
3565
  // Copyright (c) Microsoft Corporation.
3315
3566
  // Licensed under the MIT license.
3316
- var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3567
+ var __awaiter$B = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3317
3568
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3318
3569
  return new (P || (P = Promise))(function (resolve, reject) {
3319
3570
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3339,60 +3590,114 @@ class ProxyCallCommon {
3339
3590
  switch (prop) {
3340
3591
  case 'mute': {
3341
3592
  return this._context.withAsyncErrorTeedToState(function (...args) {
3342
- return __awaiter$x(this, void 0, void 0, function* () {
3593
+ return __awaiter$B(this, void 0, void 0, function* () {
3343
3594
  return yield target.mute(...args);
3344
3595
  });
3345
3596
  }, 'Call.mute');
3346
3597
  }
3347
3598
  case 'unmute': {
3348
3599
  return this._context.withAsyncErrorTeedToState(function (...args) {
3349
- return __awaiter$x(this, void 0, void 0, function* () {
3600
+ return __awaiter$B(this, void 0, void 0, function* () {
3350
3601
  return yield target.unmute(...args);
3351
3602
  });
3352
3603
  }, 'Call.unmute');
3353
3604
  }
3354
3605
  case 'startVideo': {
3355
3606
  return this._context.withAsyncErrorTeedToState(function (...args) {
3356
- return __awaiter$x(this, void 0, void 0, function* () {
3607
+ return __awaiter$B(this, void 0, void 0, function* () {
3357
3608
  return yield target.startVideo(...args);
3358
3609
  });
3359
3610
  }, 'Call.startVideo');
3360
3611
  }
3361
3612
  case 'stopVideo': {
3362
3613
  return this._context.withAsyncErrorTeedToState(function (...args) {
3363
- return __awaiter$x(this, void 0, void 0, function* () {
3614
+ return __awaiter$B(this, void 0, void 0, function* () {
3364
3615
  return yield target.stopVideo(...args);
3365
3616
  });
3366
3617
  }, 'Call.stopVideo');
3367
3618
  }
3368
3619
  case 'startScreenSharing': {
3369
3620
  return this._context.withAsyncErrorTeedToState(function (...args) {
3370
- return __awaiter$x(this, void 0, void 0, function* () {
3621
+ return __awaiter$B(this, void 0, void 0, function* () {
3371
3622
  return yield target.startScreenSharing(...args);
3372
3623
  });
3373
3624
  }, 'Call.startScreenSharing');
3374
3625
  }
3375
3626
  case 'stopScreenSharing': {
3376
3627
  return this._context.withAsyncErrorTeedToState(function (...args) {
3377
- return __awaiter$x(this, void 0, void 0, function* () {
3628
+ return __awaiter$B(this, void 0, void 0, function* () {
3378
3629
  return yield target.stopScreenSharing(...args);
3379
3630
  });
3380
3631
  }, 'Call.stopScreenSharing');
3381
3632
  }
3382
3633
  case 'hold': {
3383
3634
  return this._context.withAsyncErrorTeedToState(function (...args) {
3384
- return __awaiter$x(this, void 0, void 0, function* () {
3635
+ return __awaiter$B(this, void 0, void 0, function* () {
3385
3636
  return yield target.hold(...args);
3386
3637
  });
3387
3638
  }, 'Call.hold');
3388
3639
  }
3389
3640
  case 'resume': {
3390
3641
  return this._context.withAsyncErrorTeedToState(function (...args) {
3391
- return __awaiter$x(this, void 0, void 0, function* () {
3642
+ return __awaiter$B(this, void 0, void 0, function* () {
3392
3643
  return yield target.resume(...args);
3393
3644
  });
3394
3645
  }, 'Call.resume');
3395
3646
  }
3647
+ case 'feature': {
3648
+ // these are mini version of Proxy object - if it grows too big, a real Proxy object should be used.
3649
+ return this._context.withErrorTeedToState((...args) => {
3650
+ /* @conditional-compile-remove(close-captions) */
3651
+ if (args[0] === communicationCalling.Features.TeamsCaptions) {
3652
+ const captionsFeature = target.feature(communicationCalling.Features.TeamsCaptions);
3653
+ const proxyFeature = new ProxyTeamsCaptionsFeature(this._context, target);
3654
+ return new Proxy(captionsFeature, proxyFeature);
3655
+ }
3656
+ return target.feature(...args);
3657
+ }, 'Call.feature');
3658
+ }
3659
+ default:
3660
+ return Reflect.get(target, prop);
3661
+ }
3662
+ }
3663
+ }
3664
+ /* @conditional-compile-remove(close-captions) */
3665
+ /**
3666
+ * @private
3667
+ */
3668
+ class ProxyTeamsCaptionsFeature {
3669
+ constructor(context, call) {
3670
+ this._context = context;
3671
+ this._call = call;
3672
+ }
3673
+ get(target, prop) {
3674
+ switch (prop) {
3675
+ case 'startCaptions':
3676
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3677
+ var _a, _b;
3678
+ const ret = yield target.startCaptions(...args);
3679
+ this._context.setIsCaptionActive(this._call.id, true);
3680
+ this._context.setSelectedSpokenLanguage(this._call.id, (_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.spokenLanguage) !== null && _b !== void 0 ? _b : 'en-us');
3681
+ return ret;
3682
+ }), 'Call.feature');
3683
+ case 'stopCaptions':
3684
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3685
+ const ret = yield target.stopCaptions(...args);
3686
+ this._context.setIsCaptionActive(this._call.id, false);
3687
+ return ret;
3688
+ }), 'Call.feature');
3689
+ case 'setSpokenLanguage':
3690
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3691
+ const ret = yield target.setSpokenLanguage(...args);
3692
+ this._context.setSelectedSpokenLanguage(this._call.id, args[0]);
3693
+ return ret;
3694
+ }), 'Call.feature');
3695
+ case 'setCaptionLanguage':
3696
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$B(this, void 0, void 0, function* () {
3697
+ const ret = yield target.setCaptionLanguage(...args);
3698
+ this._context.setSelectedCaptionLanguage(this._call.id, args[0]);
3699
+ return ret;
3700
+ }), 'Call.feature');
3396
3701
  default:
3397
3702
  return Reflect.get(target, prop);
3398
3703
  }
@@ -3401,7 +3706,7 @@ class ProxyCallCommon {
3401
3706
 
3402
3707
  // Copyright (c) Microsoft Corporation.
3403
3708
  // Licensed under the MIT license.
3404
- var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3709
+ var __awaiter$A = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3405
3710
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3406
3711
  return new (P || (P = Promise))(function (resolve, reject) {
3407
3712
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3415,7 +3720,7 @@ class ProxyCall extends ProxyCallCommon {
3415
3720
  switch (prop) {
3416
3721
  case 'addParticipant': {
3417
3722
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3418
- return __awaiter$w(this, void 0, void 0, function* () {
3723
+ return __awaiter$A(this, void 0, void 0, function* () {
3419
3724
  return yield target.addParticipant(...args);
3420
3725
  });
3421
3726
  }, 'Call.addParticipant');
@@ -3636,7 +3941,7 @@ class InternalCallContext {
3636
3941
 
3637
3942
  // Copyright (c) Microsoft Corporation.
3638
3943
  // Licensed under the MIT license.
3639
- var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3944
+ var __awaiter$z = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3640
3945
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3641
3946
  return new (P || (P = Promise))(function (resolve, reject) {
3642
3947
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3651,7 +3956,7 @@ class ProxyTeamsCall extends ProxyCallCommon {
3651
3956
  switch (prop) {
3652
3957
  case 'addParticipant': {
3653
3958
  return this.getContext().withAsyncErrorTeedToState(function (...args) {
3654
- return __awaiter$v(this, void 0, void 0, function* () {
3959
+ return __awaiter$z(this, void 0, void 0, function* () {
3655
3960
  return yield target.addParticipant(...args);
3656
3961
  });
3657
3962
  }, 'TeamsCall.addParticipant');
@@ -3766,7 +4071,7 @@ const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {
3766
4071
 
3767
4072
  // Copyright (c) Microsoft Corporation.
3768
4073
  // Licensed under the MIT license.
3769
- var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4074
+ var __awaiter$y = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3770
4075
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3771
4076
  return new (P || (P = Promise))(function (resolve, reject) {
3772
4077
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3788,7 +4093,7 @@ class ProxyVideoStreamRendererView {
3788
4093
  get(target, prop) {
3789
4094
  switch (prop) {
3790
4095
  case 'updateScalingMode': {
3791
- return (...args) => __awaiter$u(this, void 0, void 0, function* () {
4096
+ return (...args) => __awaiter$y(this, void 0, void 0, function* () {
3792
4097
  yield target.updateScalingMode(...args);
3793
4098
  this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);
3794
4099
  });
@@ -3809,7 +4114,7 @@ const videoStreamRendererViewDeclaratify = (view, context, callId, participantId
3809
4114
 
3810
4115
  // Copyright (c) Microsoft Corporation.
3811
4116
  // Licensed under the MIT license.
3812
- var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
4117
+ var __awaiter$x = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
3813
4118
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3814
4119
  return new (P || (P = Promise))(function (resolve, reject) {
3815
4120
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -3831,7 +4136,7 @@ class ProxyCallClient {
3831
4136
  get(target, prop) {
3832
4137
  switch (prop) {
3833
4138
  case 'createCallAgent': {
3834
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
4139
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$x(this, void 0, void 0, function* () {
3835
4140
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3836
4141
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3837
4142
  // callAgent if the createCallAgent succeeds.
@@ -3844,7 +4149,7 @@ class ProxyCallClient {
3844
4149
  }), 'CallClient.createCallAgent');
3845
4150
  }
3846
4151
  case 'createTeamsCallAgent': {
3847
- /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$t(this, void 0, void 0, function* () {
4152
+ /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$x(this, void 0, void 0, function* () {
3848
4153
  // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous
3849
4154
  // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative
3850
4155
  // callAgent if the createCallAgent succeeds.
@@ -3857,7 +4162,7 @@ class ProxyCallClient {
3857
4162
  }), 'CallClient.createTeamsCallAgent');
3858
4163
  }
3859
4164
  case 'getDeviceManager': {
3860
- return this._context.withAsyncErrorTeedToState(() => __awaiter$t(this, void 0, void 0, function* () {
4165
+ return this._context.withAsyncErrorTeedToState(() => __awaiter$x(this, void 0, void 0, function* () {
3861
4166
  // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of
3862
4167
  // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll
3863
4168
  // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.
@@ -3886,7 +4191,7 @@ class ProxyCallClient {
3886
4191
  /**
3887
4192
  * add to this object if we want to proxy anything else off the DebugInfo feature object.
3888
4193
  */
3889
- return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$t(this, void 0, void 0, function* () {
4194
+ return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter$x(this, void 0, void 0, function* () {
3890
4195
  const environmentInfo = yield feature.getEnvironmentInfo();
3891
4196
  this._context.setEnvironmentInfo(environmentInfo);
3892
4197
  return environmentInfo;
@@ -3939,7 +4244,7 @@ const createStatefulCallClientWithDeps = (callClient, context, internalContext)
3939
4244
  });
3940
4245
  Object.defineProperty(callClient, 'createView', {
3941
4246
  configurable: false,
3942
- value: (callId, participantId, stream, options) => __awaiter$t(void 0, void 0, void 0, function* () {
4247
+ value: (callId, participantId, stream, options) => __awaiter$x(void 0, void 0, void 0, function* () {
3943
4248
  const participantIdKind = participantId ? communicationCommon.getIdentifierKind(participantId) : undefined;
3944
4249
  const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);
3945
4250
  // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.
@@ -4330,7 +4635,11 @@ const defaultIdentifiers = {
4330
4635
  verticalGalleryVideoTile: 'vertical-gallery-video-tile',
4331
4636
  horizontalGalleryVideoTile: 'horizontal-gallery-video-tile',
4332
4637
  /* @conditional-compile-remove(vertical-gallery) */
4333
- verticalGalleryPageCounter: 'vertical-gallery-page-counter'
4638
+ verticalGalleryPageCounter: 'vertical-gallery-page-counter',
4639
+ /* @conditional-compile-remove(at-mention) */
4640
+ atMentionSuggestionList: 'at-mention-suggestion-list',
4641
+ /* @conditional-compile-remove(at-mention) */
4642
+ atMentionSuggestionItem: 'at-mention-suggestion-item'
4334
4643
  };
4335
4644
  /**
4336
4645
  * @private
@@ -4697,6 +5006,10 @@ function chunk(options, itemsPerRow) {
4697
5006
  }
4698
5007
  return rows;
4699
5008
  }
5009
+ /**
5010
+ * @private
5011
+ */
5012
+ const defaultSpokenLanguage$1 = 'en-us';
4700
5013
 
4701
5014
  // Copyright (c) Microsoft Corporation.
4702
5015
  /**
@@ -5362,7 +5675,15 @@ const DEFAULT_COMPONENT_ICONS = {
5362
5675
  /* @conditional-compile-remove(vertical-gallery) */
5363
5676
  VerticalGalleryRightButton: React__default['default'].createElement(reactIcons.ChevronRight20Regular, null),
5364
5677
  /* @conditional-compile-remove(video-background-effects) */
5365
- OptionsVideoBackgroundEffect: React__default['default'].createElement(reactIcons.VideoBackgroundEffect20Regular, null)
5678
+ OptionsVideoBackgroundEffect: React__default['default'].createElement(reactIcons.VideoBackgroundEffect20Regular, null),
5679
+ /* @conditional-compile-remove(close-captions) */
5680
+ CaptionsIcon: React__default['default'].createElement(reactIcons.ClosedCaption20Regular, null),
5681
+ /* @conditional-compile-remove(close-captions) */
5682
+ CaptionsOffIcon: React__default['default'].createElement(reactIcons.ClosedCaptionOff20Regular, null),
5683
+ /* @conditional-compile-remove(close-captions) */
5684
+ CaptionsSettingsIcon: React__default['default'].createElement(reactIcons.Settings20Regular, null),
5685
+ /* @conditional-compile-remove(close-captions) */
5686
+ ChangeSpokenLanguageIcon: React__default['default'].createElement(reactIcons.PersonVoice20Regular, null)
5366
5687
  };
5367
5688
 
5368
5689
  // Copyright (c) Microsoft Corporation.
@@ -5982,6 +6303,22 @@ const activeFileUploadsTrampoline = (props) => {
5982
6303
  return props.activeFileUploads;
5983
6304
  };
5984
6305
 
6306
+ // Copyright (c) Microsoft Corporation.
6307
+ /**
6308
+ * @private
6309
+ */
6310
+ react.mergeStyles({
6311
+ height: '100%',
6312
+ overflowY: 'auto',
6313
+ overflowX: 'hidden'
6314
+ });
6315
+ /**
6316
+ * @private
6317
+ */
6318
+ react.mergeStyles({
6319
+ padding: '0.25rem 0rem 0'
6320
+ });
6321
+
5985
6322
  // Copyright (c) Microsoft Corporation.
5986
6323
  /** @private */
5987
6324
  const MESSAGE_STATUS_INDICATOR_SIZE_REM = 1;
@@ -6941,7 +7278,7 @@ const chatMessageActionMenuProps = (menuProps) => {
6941
7278
  return actionMenuProps;
6942
7279
  };
6943
7280
 
6944
- var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7281
+ var __awaiter$w = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
6945
7282
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6946
7283
  return new (P || (P = Promise))(function (resolve, reject) {
6947
7284
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -6966,7 +7303,7 @@ const _FileDownloadCards = (props) => {
6966
7303
  var _a, _b;
6967
7304
  return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
6968
7305
  }, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
6969
- const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$s(void 0, void 0, void 0, function* () {
7306
+ const fileDownloadHandler = React.useCallback((userId, file) => __awaiter$w(void 0, void 0, void 0, function* () {
6970
7307
  if (!props.downloadHandler) {
6971
7308
  window.open(file.url, '_blank', 'noopener,noreferrer');
6972
7309
  }
@@ -7135,7 +7472,7 @@ const ChatMessageComponentAsMessageBubble = React__default['default'].memo(Messa
7135
7472
 
7136
7473
  // Copyright (c) Microsoft Corporation.
7137
7474
  // Licensed under the MIT license.
7138
- var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7475
+ var __awaiter$v = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7139
7476
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7140
7477
  return new (P || (P = Promise))(function (resolve, reject) {
7141
7478
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7167,7 +7504,7 @@ const ChatMessageComponent = (props) => {
7167
7504
  onSendMessage && onSendMessage(content !== undefined ? content : '');
7168
7505
  }, [clientMessageId, content, onSendMessage, onDeleteMessage]);
7169
7506
  if (isEditing && message.messageType === 'chat') {
7170
- return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$r(void 0, void 0, void 0, function* () {
7507
+ return (React__default['default'].createElement(ChatMessageComponentAsEditBox, { message: message, inlineEditButtons: props.inlineAcceptRejectEditButtons, strings: props.strings, onSubmit: (text, metadata, options) => __awaiter$v(void 0, void 0, void 0, function* () {
7171
7508
  props.onUpdateMessage &&
7172
7509
  message.messageId &&
7173
7510
  (yield props.onUpdateMessage(message.messageId, text, metadata, options));
@@ -7278,7 +7615,7 @@ var getParticipantsWhoHaveReadMessage = (message, readReceiptsBySenderId) => {
7278
7615
 
7279
7616
  // Copyright (c) Microsoft Corporation.
7280
7617
  // Licensed under the MIT license.
7281
- var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7618
+ var __awaiter$u = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
7282
7619
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7283
7620
  return new (P || (P = Promise))(function (resolve, reject) {
7284
7621
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -7498,7 +7835,7 @@ const MessageThread = (props) => {
7498
7835
  /* @conditional-compile-remove(teams-inline-images) */
7499
7836
  const [inlineAttachments, setInlineAttachments] = React.useState({});
7500
7837
  /* @conditional-compile-remove(teams-inline-images) */
7501
- const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$q(void 0, void 0, void 0, function* () {
7838
+ const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$u(void 0, void 0, void 0, function* () {
7502
7839
  if (!onFetchAttachments || attachment.id in inlineAttachments) {
7503
7840
  return;
7504
7841
  }
@@ -7540,7 +7877,7 @@ const MessageThread = (props) => {
7540
7877
  setChatMessagesInitialized(chatMessagesInitialized);
7541
7878
  };
7542
7879
  // we try to only send those message status if user is scrolled to the bottom.
7543
- const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7880
+ const sendMessageStatusIfAtBottom = React.useCallback(() => __awaiter$u(void 0, void 0, void 0, function* () {
7544
7881
  if (!isAtBottomOfScrollRef.current ||
7545
7882
  !document.hasFocus() ||
7546
7883
  !messagesRef.current ||
@@ -7591,7 +7928,7 @@ const MessageThread = (props) => {
7591
7928
  setIsAtBottomOfScrollRef(atBottom);
7592
7929
  }, [scrollToBottom, sendMessageStatusIfAtBottom]);
7593
7930
  // Infinite scrolling + threadInitialize function
7594
- const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
7931
+ const fetchNewMessageWhenAtTop = React.useCallback(() => __awaiter$u(void 0, void 0, void 0, function* () {
7595
7932
  if (!isLoadingChatMessagesRef.current) {
7596
7933
  if (onLoadPreviousChatMessages) {
7597
7934
  isLoadingChatMessagesRef.current = true;
@@ -8309,6 +8646,7 @@ const DrawerMenuItem = (props) => {
8309
8646
  React__default['default'].createElement(react.Text, { styles: {
8310
8647
  root: { color: props.disabled ? theme.palette.neutralTertiaryAlt : theme.palette.neutralSecondary }
8311
8648
  } }, props.secondaryText))),
8649
+ props.secondaryComponent && React__default['default'].createElement(react.Stack.Item, null, props.secondaryComponent),
8312
8650
  secondaryIcon && React__default['default'].createElement(react.Stack.Item, null, secondaryIcon)));
8313
8651
  };
8314
8652
  const MenuItemIcon = (props) => (React__default['default'].createElement(react.FontIcon, Object.assign({ className: react.mergeStyles(iconStyles$1) }, props)));
@@ -11922,7 +12260,7 @@ const DevicesButton = (props) => {
11922
12260
 
11923
12261
  // Copyright (c) Microsoft Corporation.
11924
12262
  // Licensed under the MIT license.
11925
- var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12263
+ var __awaiter$t = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
11926
12264
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
11927
12265
  return new (P || (P = Promise))(function (resolve, reject) {
11928
12266
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -11960,7 +12298,7 @@ const CameraButton = (props) => {
11960
12298
  const toggleAnnouncerString = React.useCallback((isCameraOn) => {
11961
12299
  setAnnouncerString(!isCameraOn ? strings.cameraActionTurnedOffAnnouncement : strings.cameraActionTurnedOnAnnouncement);
11962
12300
  }, [strings.cameraActionTurnedOffAnnouncement, strings.cameraActionTurnedOnAnnouncement]);
11963
- const onToggleClick = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
12301
+ const onToggleClick = React.useCallback(() => __awaiter$t(void 0, void 0, void 0, function* () {
11964
12302
  // Throttle click on camera, need to await onToggleCamera then allow another click
11965
12303
  if (onToggleCamera) {
11966
12304
  setWaitForCamera(true);
@@ -12128,7 +12466,7 @@ const lightThemeCallButtonStyles = {
12128
12466
 
12129
12467
  // Copyright (c) Microsoft Corporation.
12130
12468
  // Licensed under the MIT license.
12131
- var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12469
+ var __awaiter$s = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
12132
12470
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12133
12471
  return new (P || (P = Promise))(function (resolve, reject) {
12134
12472
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -12169,7 +12507,7 @@ const MicrophoneButton = (props) => {
12169
12507
  const toggleAnnouncerString = React.useCallback((isMicOn) => {
12170
12508
  setAnnouncerString(!isMicOn ? strings.microphoneActionTurnedOffAnnouncement : strings.microphoneActionTurnedOnAnnouncement);
12171
12509
  }, [strings.microphoneActionTurnedOffAnnouncement, strings.microphoneActionTurnedOnAnnouncement]);
12172
- const onToggleClick = React.useCallback(() => __awaiter$o(void 0, void 0, void 0, function* () {
12510
+ const onToggleClick = React.useCallback(() => __awaiter$s(void 0, void 0, void 0, function* () {
12173
12511
  if (onToggleMicrophone) {
12174
12512
  try {
12175
12513
  yield onToggleMicrophone();
@@ -12936,7 +13274,7 @@ const containerStyles$3 = (theme) => {
12936
13274
  /**
12937
13275
  * @private
12938
13276
  */
12939
- const buttonStyles = (theme) => ({
13277
+ const buttonStyles$1 = (theme) => ({
12940
13278
  root: {
12941
13279
  background: 'none',
12942
13280
  border: 'none',
@@ -13057,7 +13395,7 @@ const formatPhoneNumber = (phoneNumber) => {
13057
13395
 
13058
13396
  // Copyright (c) Microsoft Corporation.
13059
13397
  // Licensed under the MIT license.
13060
- var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
13398
+ var __awaiter$r = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
13061
13399
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13062
13400
  return new (P || (P = Promise))(function (resolve, reject) {
13063
13401
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -13099,16 +13437,16 @@ const DialpadButton = (props) => {
13099
13437
  const theme = react.useTheme();
13100
13438
  const { digit, index, onClick, onLongPress, isMobile = false } = props;
13101
13439
  const useLongPressProps = React__default['default'].useMemo(() => ({
13102
- onClick: () => __awaiter$n(void 0, void 0, void 0, function* () {
13440
+ onClick: () => __awaiter$r(void 0, void 0, void 0, function* () {
13103
13441
  onClick(digit, index);
13104
13442
  }),
13105
- onLongPress: () => __awaiter$n(void 0, void 0, void 0, function* () {
13443
+ onLongPress: () => __awaiter$r(void 0, void 0, void 0, function* () {
13106
13444
  onLongPress(digit, index);
13107
13445
  }),
13108
13446
  touchEventsOnly: isMobile
13109
13447
  }), [digit, index, isMobile, onClick, onLongPress]);
13110
13448
  const longPressHandlers = useLongPress(useLongPressProps);
13111
- return (React__default['default'].createElement(react.DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: react.concatStyleSets(buttonStyles(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, longPressHandlers),
13449
+ return (React__default['default'].createElement(react.DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: react.concatStyleSets(buttonStyles$1(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, longPressHandlers),
13112
13450
  React__default['default'].createElement(react.Stack, null,
13113
13451
  React__default['default'].createElement(react.Text, { className: react.mergeStyles(digitStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.digit) }, props.digit),
13114
13452
  React__default['default'].createElement(react.Text, { className: react.mergeStyles(letterStyles(theme), (_c = props.styles) === null || _c === void 0 ? void 0 : _c.letter) }, (_d = props.letter) !== null && _d !== void 0 ? _d : ' '))));
@@ -13606,13 +13944,13 @@ const _VideoBackgroundEffectsPicker = (props) => {
13606
13944
  /**
13607
13945
  * @private
13608
13946
  */
13609
- react.mergeStyles({
13947
+ const iconClassName = react.mergeStyles({
13610
13948
  marginRight: _pxToRem(8)
13611
13949
  });
13612
13950
  /**
13613
13951
  * @private
13614
13952
  */
13615
- react.mergeStyles({
13953
+ const displayNameClassName = react.mergeStyles({
13616
13954
  fontWeight: 400,
13617
13955
  fontSize: _pxToRem(12),
13618
13956
  lineHeight: _pxToRem(16)
@@ -13620,7 +13958,7 @@ react.mergeStyles({
13620
13958
  /**
13621
13959
  * @private
13622
13960
  */
13623
- react.mergeStyles({
13961
+ const captionClassName = react.mergeStyles({
13624
13962
  fontWeight: 400,
13625
13963
  fontSize: _pxToRem(16),
13626
13964
  lineHeight: _pxToRem(22)
@@ -13628,17 +13966,278 @@ react.mergeStyles({
13628
13966
  /**
13629
13967
  * @private
13630
13968
  */
13631
- react.mergeStyles({
13969
+ const captionContainerClassName = react.mergeStyles({
13632
13970
  marginTop: _pxToRem(6),
13633
- marginBottom: _pxToRem(6)
13971
+ marginBottom: _pxToRem(6),
13972
+ overflowAnchor: 'none'
13634
13973
  });
13635
13974
  /**
13636
13975
  * @private
13637
13976
  */
13638
- react.mergeStyles({
13977
+ const captionsBannerClassName = react.mergeStyles({
13639
13978
  height: _pxToRem(100),
13640
- overflow: 'scroll'
13979
+ overflowY: 'auto',
13980
+ overflowX: 'hidden'
13981
+ });
13982
+ /**
13983
+ * @private
13984
+ */
13985
+ const captionsContentContainerClassName = react.mergeStyles({
13986
+ minWidth: 0
13987
+ });
13988
+ /**
13989
+ * @private
13990
+ */
13991
+ const displayNameContainerClassName = react.mergeStyles({
13992
+ overflow: 'hidden',
13993
+ textOverflow: 'ellipsis'
13994
+ });
13995
+
13996
+ // Copyright (c) Microsoft Corporation.
13997
+ /**
13998
+ * @internal
13999
+ * A component for displaying a single line of caption
14000
+ */
14001
+ const _Caption = (props) => {
14002
+ const { displayName, userId, captionText, onRenderAvatar } = props;
14003
+ const personaOptions = {
14004
+ hidePersonaDetails: true,
14005
+ size: react.PersonaSize.size32,
14006
+ text: displayName,
14007
+ showOverflowTooltip: false,
14008
+ initialsTextColor: 'white',
14009
+ styles: {
14010
+ root: {
14011
+ margin: '0.25rem'
14012
+ }
14013
+ }
14014
+ };
14015
+ const userIcon = onRenderAvatar ? onRenderAvatar(userId !== null && userId !== void 0 ? userId : '', personaOptions) : React__default['default'].createElement(react.Persona, Object.assign({}, personaOptions));
14016
+ return (React__default['default'].createElement(react.Stack, { horizontal: true, verticalAlign: "start", horizontalAlign: "start" },
14017
+ React__default['default'].createElement(react.Stack.Item, { className: iconClassName }, userIcon),
14018
+ React__default['default'].createElement(react.Stack, { verticalAlign: "start", className: captionsContentContainerClassName },
14019
+ React__default['default'].createElement(react.Stack.Item, { className: displayNameContainerClassName },
14020
+ React__default['default'].createElement(react.Text, { className: displayNameClassName }, displayName)),
14021
+ React__default['default'].createElement(react.Stack.Item, null,
14022
+ React__default['default'].createElement(react.Text, { className: captionClassName }, captionText)))));
14023
+ };
14024
+
14025
+ // Copyright (c) Microsoft Corporation.
14026
+ /**
14027
+ * @internal
14028
+ * A component for displaying a CaptionsBanner with user icon, displayName and captions text.
14029
+ */
14030
+ const _CaptionsBanner = (props) => {
14031
+ const { captions, isCaptionsOn, onRenderAvatar } = props;
14032
+ const captionsScrollDivRef = React.useRef(null);
14033
+ const [isAtBottomOfScroll, setIsAtBottomOfScroll] = React.useState(true);
14034
+ const scrollToBottom = () => {
14035
+ if (captionsScrollDivRef.current) {
14036
+ captionsScrollDivRef.current.scrollTop = captionsScrollDivRef.current.scrollHeight;
14037
+ }
14038
+ };
14039
+ const handleScrollToTheBottom = React.useCallback(() => {
14040
+ if (!captionsScrollDivRef.current) {
14041
+ return;
14042
+ }
14043
+ const atBottom = Math.ceil(captionsScrollDivRef.current.scrollTop) >=
14044
+ captionsScrollDivRef.current.scrollHeight - captionsScrollDivRef.current.clientHeight;
14045
+ setIsAtBottomOfScroll(atBottom);
14046
+ }, []);
14047
+ React.useEffect(() => {
14048
+ const captionsScrollDiv = captionsScrollDivRef.current;
14049
+ captionsScrollDiv === null || captionsScrollDiv === void 0 ? void 0 : captionsScrollDiv.addEventListener('scroll', handleScrollToTheBottom);
14050
+ return () => {
14051
+ captionsScrollDiv === null || captionsScrollDiv === void 0 ? void 0 : captionsScrollDiv.removeEventListener('scroll', handleScrollToTheBottom);
14052
+ };
14053
+ }, [handleScrollToTheBottom]);
14054
+ React.useEffect(() => {
14055
+ // only auto scroll to bottom is already is at bottom of scroll before new caption comes in
14056
+ if (isAtBottomOfScroll) {
14057
+ scrollToBottom();
14058
+ }
14059
+ }, [captions, isAtBottomOfScroll]);
14060
+ return (React__default['default'].createElement(React__default['default'].Fragment, null, isCaptionsOn && (React__default['default'].createElement("div", { "data-is-focusable": true },
14061
+ React__default['default'].createElement(reactNorthstar.Ref, { innerRef: captionsScrollDivRef },
14062
+ React__default['default'].createElement(react.Stack, { verticalAlign: "start", className: captionsBannerClassName }, captions.map((caption, key) => {
14063
+ return (React__default['default'].createElement("div", { key: key, className: captionContainerClassName, tabIndex: 0 },
14064
+ React__default['default'].createElement(_Caption, Object.assign({}, caption, { onRenderAvatar: onRenderAvatar }))));
14065
+ })))))));
14066
+ };
14067
+
14068
+ // Copyright (c) Microsoft Corporation.
14069
+ // Licensed under the MIT license.
14070
+ (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14071
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14072
+ return new (P || (P = Promise))(function (resolve, reject) {
14073
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14074
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14075
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14076
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
14077
+ });
14078
+ };
14079
+
14080
+ // Copyright (c) Microsoft Corporation.
14081
+ /**
14082
+ * @private
14083
+ */
14084
+ const themedCaptionsSettingsModalStyle = (theme) => ({
14085
+ main: {
14086
+ borderRadius: theme.effects.roundedCorner6,
14087
+ padding: _pxToRem(24),
14088
+ width: _pxToRem(440),
14089
+ height: _pxToRem(268),
14090
+ overflow: 'hidden'
14091
+ }
14092
+ });
14093
+ /**
14094
+ * @private
14095
+ */
14096
+ const titleClassName = react.mergeStyles({
14097
+ fontWeight: 600,
14098
+ fontSize: _pxToRem(20),
14099
+ lineHeight: _pxToRem(28)
14100
+ });
14101
+ /**
14102
+ * @private
14103
+ */
14104
+ const titleContainerClassName = react.mergeStyles({
14105
+ paddingBottom: _pxToRem(20)
14106
+ });
14107
+ /**
14108
+ * @private
14109
+ */
14110
+ const dropdownContainerClassName = react.mergeStyles({
14111
+ paddingBottom: _pxToRem(16),
14112
+ paddingTop: _pxToRem(16)
14113
+ });
14114
+ /**
14115
+ * @private
14116
+ */
14117
+ const dropdownInfoTextStyle = (theme) => react.mergeStyles({
14118
+ fontWeight: 400,
14119
+ fontSize: _pxToRem(12),
14120
+ lineHeight: _pxToRem(16),
14121
+ color: theme.palette.neutralSecondary
13641
14122
  });
14123
+ /**
14124
+ * @private
14125
+ */
14126
+ const buttonsContainerClassName = react.mergeStyles({
14127
+ paddingTop: _pxToRem(16)
14128
+ });
14129
+ /**
14130
+ * @private
14131
+ */
14132
+ const buttonStyles = (theme) => {
14133
+ return {
14134
+ root: {
14135
+ borderRadius: _pxToRem(2),
14136
+ margin: _pxToRem(8)
14137
+ },
14138
+ rootHovered: {
14139
+ backgroundColor: theme.palette.themePrimary,
14140
+ borderColor: theme.palette.themePrimary,
14141
+ color: theme.palette.white
14142
+ },
14143
+ rootFocused: {
14144
+ backgroundColor: theme.palette.themePrimary,
14145
+ borderColor: theme.palette.themePrimary,
14146
+ color: theme.palette.white
14147
+ },
14148
+ rootPressed: {
14149
+ backgroundColor: theme.palette.themePrimary,
14150
+ borderColor: theme.palette.themePrimary,
14151
+ color: theme.palette.white
14152
+ }
14153
+ };
14154
+ };
14155
+ /**
14156
+ * @private
14157
+ */
14158
+ const dropdownStyles = {
14159
+ callout: { height: _pxToRem(300), overflow: 'auto' }
14160
+ };
14161
+
14162
+ var __awaiter$q = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14163
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14164
+ return new (P || (P = Promise))(function (resolve, reject) {
14165
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
14166
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
14167
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14168
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
14169
+ });
14170
+ };
14171
+ /**
14172
+ * @internal
14173
+ * a component for setting spoken languages
14174
+ */
14175
+ const _CaptionsSettingsModal = (props) => {
14176
+ const { supportedSpokenLanguages, currentSpokenLanguage, isCaptionsFeatureActive, showModal, onSetSpokenLanguage, onDismissCaptionsSettings, onStartCaptions, strings, captionsAvailableLanguageStrings } = props;
14177
+ const theme = react.useTheme();
14178
+ const [selectedItem, setSelectedItem] = React.useState({
14179
+ key: currentSpokenLanguage !== '' ? currentSpokenLanguage : defaultSpokenLanguage$1,
14180
+ text: currentSpokenLanguage !== '' ? currentSpokenLanguage : defaultSpokenLanguage$1
14181
+ });
14182
+ const onDismiss = React.useCallback(() => {
14183
+ if (onDismissCaptionsSettings) {
14184
+ onDismissCaptionsSettings();
14185
+ }
14186
+ }, [onDismissCaptionsSettings]);
14187
+ const onConfirm = React.useCallback(() => __awaiter$q(void 0, void 0, void 0, function* () {
14188
+ const languageCode = selectedItem.key.toString();
14189
+ if (isCaptionsFeatureActive) {
14190
+ onSetSpokenLanguage(languageCode);
14191
+ }
14192
+ else {
14193
+ yield onStartCaptions({ spokenLanguage: languageCode });
14194
+ // set spoken language when start captions with a spoken language specified.
14195
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
14196
+ onSetSpokenLanguage(languageCode);
14197
+ }
14198
+ onDismiss();
14199
+ }), [onDismiss, isCaptionsFeatureActive, onSetSpokenLanguage, onStartCaptions, selectedItem.key]);
14200
+ const dropdownOptions = React.useMemo(() => {
14201
+ return supportedSpokenLanguages.map((languageCode) => {
14202
+ return {
14203
+ key: languageCode,
14204
+ text: captionsAvailableLanguageStrings ? captionsAvailableLanguageStrings[languageCode] : languageCode
14205
+ };
14206
+ });
14207
+ }, [supportedSpokenLanguages, captionsAvailableLanguageStrings]);
14208
+ const onChange = (event, option) => {
14209
+ if (option) {
14210
+ setSelectedItem(option);
14211
+ }
14212
+ };
14213
+ const calloutProps = React.useMemo(() => ({
14214
+ preventDismissOnEvent: _preventDismissOnEvent
14215
+ }), []);
14216
+ const CaptionsSettingsComponent = React.useCallback(() => {
14217
+ return (React__default['default'].createElement(react.Stack, null,
14218
+ React__default['default'].createElement(react.Dropdown, { label: strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownLabel, selectedKey: selectedItem ? selectedItem.key : undefined, onChange: onChange, calloutProps: calloutProps, placeholder: currentSpokenLanguage !== '' ? currentSpokenLanguage : defaultSpokenLanguage$1, options: dropdownOptions, styles: dropdownStyles }),
14219
+ React__default['default'].createElement(react.Text, { className: dropdownInfoTextStyle(theme) }, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownInfoText)));
14220
+ }, [
14221
+ calloutProps,
14222
+ currentSpokenLanguage,
14223
+ dropdownOptions,
14224
+ selectedItem,
14225
+ strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownInfoText,
14226
+ strings === null || strings === void 0 ? void 0 : strings.captionsSettingsDropdownLabel,
14227
+ theme
14228
+ ]);
14229
+ const CaptionsSettingsModalStyle = React.useMemo(() => themedCaptionsSettingsModalStyle(theme), [theme]);
14230
+ return (React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(react.Modal, { titleAriaId: strings === null || strings === void 0 ? void 0 : strings.captionsSettingsModalAriaLabel, isOpen: showModal, onDismiss: onDismiss, isBlocking: true, styles: CaptionsSettingsModalStyle },
14231
+ React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "space-between", verticalAlign: "center", className: titleContainerClassName },
14232
+ React__default['default'].createElement(react.Text, { className: titleClassName }, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsModalTitle),
14233
+ React__default['default'].createElement(react.IconButton, { iconProps: { iconName: 'Cancel' }, ariaLabel: strings === null || strings === void 0 ? void 0 : strings.captionsSettingsCloseModalButtonAriaLabel, onClick: onDismiss, style: { color: theme.palette.black } })),
14234
+ React__default['default'].createElement(react.Stack, { className: dropdownContainerClassName }, CaptionsSettingsComponent()),
14235
+ React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "end", className: buttonsContainerClassName },
14236
+ React__default['default'].createElement(react.PrimaryButton, { styles: buttonStyles(theme), onClick: onConfirm },
14237
+ React__default['default'].createElement("span", null, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsConfirmButtonLabel)),
14238
+ React__default['default'].createElement(react.DefaultButton, { onClick: onDismiss, styles: buttonStyles(theme) },
14239
+ React__default['default'].createElement("span", null, strings === null || strings === void 0 ? void 0 : strings.captionsSettingsCancelButtonLabel))))));
14240
+ };
13642
14241
 
13643
14242
  // Copyright (c) Microsoft Corporation.
13644
14243
  // Licensed under the MIT license.
@@ -14180,7 +14779,7 @@ const findConditionalCompiledSelector = (component) => {
14180
14779
 
14181
14780
  // Copyright (c) Microsoft Corporation.
14182
14781
  // Licensed under the MIT license.
14183
- var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14782
+ var __awaiter$p = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
14184
14783
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14185
14784
  return new (P || (P = Promise))(function (resolve, reject) {
14186
14785
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -14203,35 +14802,35 @@ const createDefaultChatHandlers = memoizeOne__default['default']((chatClient, ch
14203
14802
  let messageIterator = undefined;
14204
14803
  let readReceiptIterator = undefined;
14205
14804
  return {
14206
- onSendMessage: (content, options) => __awaiter$m(void 0, void 0, void 0, function* () {
14805
+ onSendMessage: (content, options) => __awaiter$p(void 0, void 0, void 0, function* () {
14207
14806
  const sendMessageRequest = {
14208
14807
  content,
14209
14808
  senderDisplayName: chatClient.getState().displayName
14210
14809
  };
14211
14810
  yield chatThreadClient.sendMessage(sendMessageRequest, options);
14212
14811
  }),
14213
- onUpdateMessage: (messageId, content, metadata, options) => __awaiter$m(void 0, void 0, void 0, function* () {
14812
+ onUpdateMessage: (messageId, content, metadata, options) => __awaiter$p(void 0, void 0, void 0, function* () {
14214
14813
  const updatedMetadata = metadata ? Object.assign({}, metadata) : {};
14215
14814
  updatedMetadata['fileSharingMetadata'] = JSON.stringify((options === null || options === void 0 ? void 0 : options.attachedFilesMetadata) || []);
14216
14815
  yield chatThreadClient.updateMessage(messageId, { content, metadata: updatedMetadata });
14217
14816
  }),
14218
- onDeleteMessage: (messageId) => __awaiter$m(void 0, void 0, void 0, function* () {
14817
+ onDeleteMessage: (messageId) => __awaiter$p(void 0, void 0, void 0, function* () {
14219
14818
  yield chatThreadClient.deleteMessage(messageId);
14220
14819
  }),
14221
14820
  // This handler is designed for chatThread to consume
14222
- onMessageSeen: (chatMessageId) => __awaiter$m(void 0, void 0, void 0, function* () {
14821
+ onMessageSeen: (chatMessageId) => __awaiter$p(void 0, void 0, void 0, function* () {
14223
14822
  yield chatThreadClient.sendReadReceipt({ chatMessageId });
14224
14823
  }),
14225
- onTyping: () => __awaiter$m(void 0, void 0, void 0, function* () {
14824
+ onTyping: () => __awaiter$p(void 0, void 0, void 0, function* () {
14226
14825
  yield chatThreadClient.sendTypingNotification();
14227
14826
  }),
14228
- onRemoveParticipant: (userId) => __awaiter$m(void 0, void 0, void 0, function* () {
14827
+ onRemoveParticipant: (userId) => __awaiter$p(void 0, void 0, void 0, function* () {
14229
14828
  yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
14230
14829
  }),
14231
- updateThreadTopicName: (topicName) => __awaiter$m(void 0, void 0, void 0, function* () {
14830
+ updateThreadTopicName: (topicName) => __awaiter$p(void 0, void 0, void 0, function* () {
14232
14831
  yield chatThreadClient.updateTopic(topicName);
14233
14832
  }),
14234
- onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$m(void 0, void 0, void 0, function* () {
14833
+ onLoadPreviousChatMessages: (messagesToLoad) => __awaiter$p(void 0, void 0, void 0, function* () {
14235
14834
  var _a, _b, _c;
14236
14835
  if (messageIterator === undefined) {
14237
14836
  // Lazy definition so that errors in the method call are reported correctly.
@@ -15003,7 +15602,7 @@ const chatStatefulLogger = logger.createClientLogger('communication-react:chat-s
15003
15602
 
15004
15603
  // Copyright (c) Microsoft Corporation.
15005
15604
  // Licensed under the MIT license.
15006
- var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15605
+ var __awaiter$o = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15007
15606
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15008
15607
  return new (P || (P = Promise))(function (resolve, reject) {
15009
15608
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15278,7 +15877,7 @@ class ChatContext$1 {
15278
15877
  * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.
15279
15878
  */
15280
15879
  withAsyncErrorTeedToState(f, target) {
15281
- return (...args) => __awaiter$l(this, void 0, void 0, function* () {
15880
+ return (...args) => __awaiter$o(this, void 0, void 0, function* () {
15282
15881
  try {
15283
15882
  return yield f(...args);
15284
15883
  }
@@ -15390,7 +15989,7 @@ const convertChatMessage = (message, status = 'delivered', clientMessageId) => {
15390
15989
 
15391
15990
  // Copyright (c) Microsoft Corporation.
15392
15991
  // Licensed under the MIT license.
15393
- var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15992
+ var __awaiter$n = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15394
15993
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15395
15994
  return new (P || (P = Promise))(function (resolve, reject) {
15396
15995
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15475,7 +16074,7 @@ class EventSubscriber {
15475
16074
  };
15476
16075
  // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
15477
16076
  // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
15478
- this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$k(this, void 0, void 0, function* () {
16077
+ this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter$n(this, void 0, void 0, function* () {
15479
16078
  var e_1, _a;
15480
16079
  try {
15481
16080
  for (var _b = __asyncValues$1(this.chatClient
@@ -15567,7 +16166,7 @@ class EventSubscriber {
15567
16166
 
15568
16167
  // Copyright (c) Microsoft Corporation.
15569
16168
  // Licensed under the MIT license.
15570
- var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16169
+ var __awaiter$m = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15571
16170
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15572
16171
  return new (P || (P = Promise))(function (resolve, reject) {
15573
16172
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15589,7 +16188,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15589
16188
  const threadsIterator = iteratorCreator(...args);
15590
16189
  return {
15591
16190
  next() {
15592
- return __awaiter$j(this, void 0, void 0, function* () {
16191
+ return __awaiter$m(this, void 0, void 0, function* () {
15593
16192
  const result = yield threadsIterator.next();
15594
16193
  if (!result.done && result.value) {
15595
16194
  decorateFn(result.value, context);
@@ -15604,7 +16203,7 @@ const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {
15604
16203
  const pages = threadsIterator.byPage(settings);
15605
16204
  return {
15606
16205
  next() {
15607
- return __awaiter$j(this, void 0, void 0, function* () {
16206
+ return __awaiter$m(this, void 0, void 0, function* () {
15608
16207
  const result = yield pages.next();
15609
16208
  const page = result.value;
15610
16209
  if (!result.done && result.value) {
@@ -15688,7 +16287,7 @@ const createDecoratedListParticipants = (chatThreadClient, context) => {
15688
16287
 
15689
16288
  // Copyright (c) Microsoft Corporation.
15690
16289
  // Licensed under the MIT license.
15691
- var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16290
+ var __awaiter$l = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15692
16291
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15693
16292
  return new (P || (P = Promise))(function (resolve, reject) {
15694
16293
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15707,14 +16306,14 @@ class ProxyChatThreadClient {
15707
16306
  return createDecoratedListMessages(chatThreadClient, this._context);
15708
16307
  }
15709
16308
  case 'getMessage': {
15710
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16309
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15711
16310
  const message = yield chatThreadClient.getMessage(...args);
15712
16311
  this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));
15713
16312
  return message;
15714
16313
  }), 'ChatThreadClient.getMessage');
15715
16314
  }
15716
16315
  case 'sendMessage': {
15717
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16316
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15718
16317
  // Retry logic?
15719
16318
  const [request, options] = args;
15720
16319
  const { content } = request;
@@ -15754,7 +16353,7 @@ class ProxyChatThreadClient {
15754
16353
  }), 'ChatThreadClient.sendMessage');
15755
16354
  }
15756
16355
  case 'addParticipants': {
15757
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16356
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15758
16357
  const result = yield chatThreadClient.addParticipants(...args);
15759
16358
  const [addRequest] = args;
15760
16359
  const participantsToAdd = addRequest.participants;
@@ -15763,7 +16362,7 @@ class ProxyChatThreadClient {
15763
16362
  }), 'ChatThreadClient.addParticipants');
15764
16363
  }
15765
16364
  case 'deleteMessage': {
15766
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16365
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15767
16366
  // DeleteMessage is able to either delete local one(for failed message) or synced message
15768
16367
  const [messageId] = args;
15769
16368
  if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {
@@ -15781,12 +16380,12 @@ class ProxyChatThreadClient {
15781
16380
  return createDecoratedListReadReceipts(chatThreadClient, this._context);
15782
16381
  }
15783
16382
  case 'sendTypingNotification': {
15784
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16383
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15785
16384
  return yield chatThreadClient.sendTypingNotification(...args);
15786
16385
  }), 'ChatThreadClient.sendTypingNotification');
15787
16386
  }
15788
16387
  case 'removeParticipant': {
15789
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16388
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15790
16389
  const result = yield chatThreadClient.removeParticipant(...args);
15791
16390
  const [removeIdentifier] = args;
15792
16391
  this._context.deleteParticipant(chatThreadClient.threadId, communicationCommon.getIdentifierKind(removeIdentifier));
@@ -15794,7 +16393,7 @@ class ProxyChatThreadClient {
15794
16393
  }), 'ChatThreadClient.removeParticipant');
15795
16394
  }
15796
16395
  case 'updateMessage': {
15797
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16396
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15798
16397
  const result = yield chatThreadClient.updateMessage(...args);
15799
16398
  const [messageId, updateOption] = args;
15800
16399
  this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);
@@ -15802,7 +16401,7 @@ class ProxyChatThreadClient {
15802
16401
  }), 'ChatThreadClient.updateMessage');
15803
16402
  }
15804
16403
  case 'updateTopic': {
15805
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16404
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15806
16405
  const result = yield chatThreadClient.updateTopic(...args);
15807
16406
  const [topic] = args;
15808
16407
  this._context.updateThreadTopic(chatThreadClient.threadId, topic);
@@ -15810,7 +16409,7 @@ class ProxyChatThreadClient {
15810
16409
  }), 'ChatThreadClient.updateTopic');
15811
16410
  }
15812
16411
  case 'getProperties': {
15813
- return this._context.withAsyncErrorTeedToState((...args) => __awaiter$i(this, void 0, void 0, function* () {
16412
+ return this._context.withAsyncErrorTeedToState((...args) => __awaiter$l(this, void 0, void 0, function* () {
15814
16413
  const result = yield chatThreadClient.getProperties(...args);
15815
16414
  this._context.updateThread(chatThreadClient.threadId, result);
15816
16415
  return result;
@@ -15847,7 +16446,7 @@ const createDecoratedListThreads = (chatClient, context) => {
15847
16446
 
15848
16447
  // Copyright (c) Microsoft Corporation.
15849
16448
  // Licensed under the MIT license.
15850
- var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16449
+ var __awaiter$k = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
15851
16450
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15852
16451
  return new (P || (P = Promise))(function (resolve, reject) {
15853
16452
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -15866,7 +16465,7 @@ const proxyChatClient = {
15866
16465
  switch (prop) {
15867
16466
  case 'createChatThread': {
15868
16467
  return context.withAsyncErrorTeedToState(function (...args) {
15869
- return __awaiter$h(this, void 0, void 0, function* () {
16468
+ return __awaiter$k(this, void 0, void 0, function* () {
15870
16469
  const result = yield chatClient.createChatThread(...args);
15871
16470
  const thread = result.chatThread;
15872
16471
  if (thread) {
@@ -15879,7 +16478,7 @@ const proxyChatClient = {
15879
16478
  }
15880
16479
  case 'deleteChatThread': {
15881
16480
  return context.withAsyncErrorTeedToState(function (...args) {
15882
- return __awaiter$h(this, void 0, void 0, function* () {
16481
+ return __awaiter$k(this, void 0, void 0, function* () {
15883
16482
  const result = yield chatClient.deleteChatThread(...args);
15884
16483
  context.deleteThread(args[0]);
15885
16484
  return result;
@@ -15899,7 +16498,7 @@ const proxyChatClient = {
15899
16498
  }
15900
16499
  case 'startRealtimeNotifications': {
15901
16500
  return context.withAsyncErrorTeedToState(function (...args) {
15902
- return __awaiter$h(this, void 0, void 0, function* () {
16501
+ return __awaiter$k(this, void 0, void 0, function* () {
15903
16502
  const ret = yield chatClient.startRealtimeNotifications(...args);
15904
16503
  if (!receiver.eventSubscriber) {
15905
16504
  receiver.eventSubscriber = new EventSubscriber(chatClient, context);
@@ -15910,7 +16509,7 @@ const proxyChatClient = {
15910
16509
  }
15911
16510
  case 'stopRealtimeNotifications': {
15912
16511
  return context.withAsyncErrorTeedToState(function (...args) {
15913
- return __awaiter$h(this, void 0, void 0, function* () {
16512
+ return __awaiter$k(this, void 0, void 0, function* () {
15914
16513
  const ret = yield chatClient.stopRealtimeNotifications(...args);
15915
16514
  if (receiver.eventSubscriber) {
15916
16515
  receiver.eventSubscriber.unsubscribe();
@@ -16097,7 +16696,7 @@ const CallCompositeIcon = (props) => (React__default['default'].createElement(re
16097
16696
  */
16098
16697
  const CallWithChatCompositeIcon = (props) => (React__default['default'].createElement(react.FontIcon, Object.assign({}, props)));
16099
16698
 
16100
- var call$d={cameraLabel:"Camera",noCamerasLabel:"No cameras found",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",effects:"Effects",blurBackgroundEffectButtonLabel:"Blur",blurBackgroundTooltip:"Blur Background",removeBackgroundEffectButtonLabel:"None",removeBackgroundTooltip:"Remove Background",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",noMicrophonesLabel:"No microphones found",noSpeakersLabel:"No speakers found",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number",outboundCallingNoticeString:"Calling...",participantJoinedNoticeString:"{displayName} joined",twoParticipantJoinedNoticeString:"{displayName1} and {displayName2} have joined",threeParticipantJoinedNoticeString:"{displayName1}, {displayName2} and {displayName3} have joined",participantLeftNoticeString:"{displayName} left",twoParticipantLeftNoticeString:"{displayName1} and {displayName2} have left",threeParticipantLeftNoticeString:"{displayName1}, {displayName2} and {displayName3} have left",unnamedParticipantString:"unnamed participant",manyUnnamedParticipantsJoined:"unnamed participant and {numOfParticipants} other participants joined",manyUnnamedParticipantsLeft:"unnamed participant and {numOfParticipants} other participants left",manyParticipantsJoined:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants joined",manyParticipantsLeft:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants left"};var chat$d={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$d={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number"};var en_US = {call:call$d,chat:chat$d,callWithChat:callWithChat$d};
16699
+ var call$d={cameraLabel:"Camera",noCamerasLabel:"No cameras found",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",effects:"Effects",blurBackgroundEffectButtonLabel:"Blur",blurBackgroundTooltip:"Blur Background",removeBackgroundEffectButtonLabel:"None",removeBackgroundTooltip:"Remove Background",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",noMicrophonesLabel:"No microphones found",noSpeakersLabel:"No speakers found",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number",outboundCallingNoticeString:"Calling...",participantJoinedNoticeString:"{displayName} joined",twoParticipantJoinedNoticeString:"{displayName1} and {displayName2} have joined",threeParticipantJoinedNoticeString:"{displayName1}, {displayName2} and {displayName3} have joined",participantLeftNoticeString:"{displayName} left",twoParticipantLeftNoticeString:"{displayName1} and {displayName2} have left",threeParticipantLeftNoticeString:"{displayName1}, {displayName2} and {displayName3} have left",unnamedParticipantString:"unnamed participant",manyUnnamedParticipantsJoined:"unnamed participant and {numOfParticipants} other participants joined",manyUnnamedParticipantsLeft:"unnamed participant and {numOfParticipants} other participants left",manyParticipantsJoined:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants joined",manyParticipantsLeft:"{displayName1}, {displayName2}, {displayName3} and {numOfParticipants} other participants left",liveCaptionsLabel:"Live captions",captionsSettingsLabel:"Caption settings",startCaptionsButtonOnLabel:"Turn on captions",startCaptionsButtonOffLabel:"Turn off captions",startCaptionsButtonTooltipOnContent:"Turn off captions",startCaptionsButtonTooltipOffContent:"Turn on captions",captionsSettingsModalTitle:"What language is being spoken?",captionsSettingsDropdownLabel:"Spoken language",captionsSettingsDropdownInfoText:"Language that everyone on this call is speaking.",captionsSettingsConfirmButtonLabel:"Confirm",captionsSettingsCancelButtonLabel:"Cancel",captionsSettingsModalAriaLabel:"Captions Setting Modal",captionsSettingsCloseModalButtonAriaLabel:"Close Captions Setting",captionsBannerMoreButtonCallingLabel:"More",captionsBannerMoreButtonTooltip:"More options",captionsAvailableLanguageStrings:{"ar-ae":"Arabic - U.A.E.","ar-sa":"Arabic - Saudi Arabia","da-dk":"Danish","de-de":"German - Germany","en-au":"English - Australia","en-ca":"English - Canada","en-gb":"English - United Kingdom","en-in":"English - India","en-nz":"English - New Zealand","en-us":"English - United States","es-es":"Spanish - Spain (Modern Sort)","es-mx":"Spanish - Mexico","fi-fi":"Finnish","fr-ca":"French - Canada","fr-fr":"French - France","hi-in":"Hindi","it-it":"Italian - Italy","ja-jp":"Japanese","ko-kr":"Korean","nb-no":"Norwegian (Bokmål)","nl-be":"Dutch - Belgium","nl-nl":"Dutch - Netherlands","pl-pl":"Polish","pt-br":"Portuguese - Brazil","ru-ru":"Russian","sv-se":"Swedish","zh-cn":"Chinese - People's Republic of China","zh-hk":"Chinese - Hong Kong SAR","cs-cz":"Czech","pt-pt":"Portuguese - Portugal","tr-tr":"Turkish","vi-vn":"Vietnamese","th-th":"Thai","he-il":"Hebrew","cy-gb":"Welsh","uk-ua":"Ukrainian","el-gr":"Greek","hu-hu":"Hungarian","ro-ro":"Romanian","sk-sk":"Slovak","zh-tw":"Chinese - Taiwan"}};var chat$d={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$d={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",moreDrawerCaptionsMenuTitle:"Live captions",moreDrawerSpokenLanguageMenuTitle:"Spoken language",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceholderText:"Enter number"};var en_US = {call:call$d,chat:chat$d,callWithChat:callWithChat$d};
16101
16700
 
16102
16701
  var call$c={cameraLabel:"Camera",cameraPermissionDenied:"Your browser is blocking access to your camera",cameraTurnedOff:"Your camera is turned off",chatButtonLabel:"Chat",close:"Close",complianceBannerNowOnlyRecording:"You are now only recording this meeting.",complianceBannerNowOnlyTranscription:"You are now only transcribing this meeting.",complianceBannerRecordingAndTranscriptionSaved:"Recording and transcription are being saved.",complianceBannerRecordingAndTranscriptionStarted:"Recording and transcription have started.",complianceBannerRecordingAndTranscriptionStopped:"Recording and transcription have stopped.",complianceBannerRecordingSaving:"Recording is being saved.",complianceBannerRecordingStarted:"Recording has started.",complianceBannerRecordingStopped:"Recording has stopped.",complianceBannerTranscriptionStarted:"Transcription has started.",complianceBannerTranscriptionConsent:"By joining, you are giving consent for this meeting to be transcribed.",complianceBannerTranscriptionSaving:"Transcription is being saved.",complianceBannerTranscriptionStopped:"Transcription has stopped.",configurationPageTitle:"Start a call",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",defaultPlaceHolder:"Select an option",dismissSidePaneButtonLabel:"Close",failedToJoinCallDueToNoNetworkMoreDetails:"Call was disconnected due to a network issue. Check your connection and join again.",failedToJoinCallDueToNoNetworkTitle:"Call disconnected",failedToJoinTeamsMeetingReasonAccessDeniedMoreDetails:"You were not granted entry in the call. If this was a mistake, re-join the call.",failedToJoinTeamsMeetingReasonAccessDeniedTitle:"Dismissed from lobby",learnMore:"Learn more",leftCallMoreDetails:"If this was a mistake, re-join the call.",leftCallTitle:"You left the call",lobbyScreenConnectingToCallTitle:"Joining call",lobbyScreenWaitingToBeAdmittedTitle:"Waiting to be admitted",microphonePermissionDenied:"Your browser is blocking access to your microphone",microphoneToggleInLobbyNotAllowed:"Cannot mute or unmute while in lobby.",mutedMessage:"You're muted",networkReconnectMoreDetails:"Looks like something went wrong. We're trying to get back into the call.",networkReconnectTitle:"Hold on",deniedPermissionToRoomDetails:"You do not have permission to join this room.",deniedPermissionToRoomTitle:"Permission denied to room",peopleButtonLabel:"People",peoplePaneTitle:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",privacyPolicy:"Privacy policy",rejoinCallButtonLabel:"Re-join call",removedFromCallMoreDetails:"Another participant removed you from the call.",removedFromCallTitle:"You were removed",removeMenuLabel:"Remove",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",roomNotFoundDetails:"Room ID provided is not valid.",roomNotFoundTitle:"Room not found",soundLabel:"Sound",startCallButtonLabel:"Start call",openDialpadButtonLabel:"Dial phone number",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",moreButtonCallingLabel:"More",resumeCallButtonLabel:"Resume",resumingCallButtonLabel:"Resuming...",resumeCallButtonAriaLabel:"Resume call",resumingCallButtonAriaLabel:"Resume call",holdScreenLabel:"You're on hold",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceHolderText:"Enter number",outboundCallingNoticeString:"Calling..."};var chat$c={chatListHeader:"In this chat",uploadFile:"Upload File"};var callWithChat$c={chatButtonLabel:"Chat",chatButtonNewMessageNotificationLabel:"New Message",chatButtonTooltipClosedWithMessageCount:"Show chat ({unreadMessagesCount} unread)",chatButtonTooltipClose:"Hide chat",chatButtonTooltipOpen:"Show chat",chatPaneTitle:"Chat",copyInviteLinkButtonLabel:"Copy invite link",copyInviteLinkActionedAriaLabel:"Invite link copied",dismissSidePaneButtonLabel:"Close",moreDrawerAudioDeviceMenuTitle:"Audio Device",moreDrawerButtonLabel:"More options",moreDrawerButtonTooltip:"More options",moreDrawerMicrophoneMenuTitle:"Microphone",moreDrawerSpeakerMenuTitle:"Speaker",peopleButtonLabel:"People",peopleButtonTooltipOpen:"Show participants",peopleButtonTooltipClose:"Hide participants",peoplePaneSubTitle:"In this call",peoplePaneTitle:"People",pictureInPictureTileAriaLabel:"Video Feeds. Click to return to call screen.",removeMenuLabel:"Remove",openDialpadButtonLabel:"Dial phone number",returnToCallButtonAriaDescription:"Return to Call",returnToCallButtonAriaLabel:"Back",peoplePaneAddPeopleButtonLabel:"Add People",dialpadStartCallButtonLabel:"Call",dialpadModalTitle:"Dial Phone Number",dialpadModalAriaLabel:"Dialpad",dialpadCloseModalButtonAriaLabel:"Close dialpad",openDtmfDialpadLabel:"Show dialpad",dtmfDialpadPlaceHolderText:"Enter number"};var en_GB = {call:call$c,chat:chat$c,callWithChat:callWithChat$c};
16103
16702
 
@@ -16515,7 +17114,7 @@ const END_CALL_PAGES = [
16515
17114
 
16516
17115
  // Copyright (c) Microsoft Corporation.
16517
17116
  // Licensed under the MIT license.
16518
- var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17117
+ var __awaiter$j = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16519
17118
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16520
17119
  return new (P || (P = Promise))(function (resolve, reject) {
16521
17120
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -16551,7 +17150,7 @@ const isCameraOn = (state) => {
16551
17150
  /**
16552
17151
  * @private
16553
17152
  */
16554
- const startSelectedVideoEffect = (adapter) => __awaiter$g(void 0, void 0, void 0, function* () {
17153
+ const startSelectedVideoEffect = (adapter) => __awaiter$j(void 0, void 0, void 0, function* () {
16555
17154
  if (adapter.getState().selectedVideoBackgroundEffect) {
16556
17155
  const selectedVideoBackgroundEffect = adapter.getState().selectedVideoBackgroundEffect;
16557
17156
  if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'blur') {
@@ -16756,7 +17355,7 @@ const isDisabled$2 = (option) => {
16756
17355
  /**
16757
17356
  * @returns Permissions state for the camera.
16758
17357
  */
16759
- const queryCameraPermissionFromPermissionsAPI = () => __awaiter$g(void 0, void 0, void 0, function* () {
17358
+ const queryCameraPermissionFromPermissionsAPI = () => __awaiter$j(void 0, void 0, void 0, function* () {
16760
17359
  try {
16761
17360
  return (yield navigator.permissions.query({ name: 'camera' })).state;
16762
17361
  }
@@ -16769,7 +17368,7 @@ const queryCameraPermissionFromPermissionsAPI = () => __awaiter$g(void 0, void 0
16769
17368
  /**
16770
17369
  * @returns Permissions state for the microphone.
16771
17370
  */
16772
- const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$g(void 0, void 0, void 0, function* () {
17371
+ const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$j(void 0, void 0, void 0, function* () {
16773
17372
  try {
16774
17373
  return (yield navigator.permissions.query({ name: 'microphone' })).state;
16775
17374
  }
@@ -16786,7 +17385,7 @@ const queryMicrophonePermissionFromPermissionsAPI = () => __awaiter$g(void 0, vo
16786
17385
  * If permission API is not supported on this browser, permission state is set to unsupported.
16787
17386
  * @private
16788
17387
  */
16789
- const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$g(void 0, void 0, void 0, function* () {
17388
+ const getDevicePermissionState = (setVideoState, setAudioState) => __awaiter$j(void 0, void 0, void 0, function* () {
16790
17389
  const [cameraResult, microphoneResult] = yield Promise.all([
16791
17390
  queryCameraPermissionFromPermissionsAPI(),
16792
17391
  queryMicrophonePermissionFromPermissionsAPI()
@@ -16863,7 +17462,7 @@ const createParticipantModifier = (createModifiedParticipant) => {
16863
17462
 
16864
17463
  // Copyright (c) Microsoft Corporation.
16865
17464
  // Licensed under the MIT license.
16866
- var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17465
+ var __awaiter$i = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
16867
17466
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16868
17467
  return new (P || (P = Promise))(function (resolve, reject) {
16869
17468
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -16998,9 +17597,9 @@ class AzureCommunicationChatAdapter {
16998
17597
  this.unsubscribeAllEvents();
16999
17598
  }
17000
17599
  fetchInitialData() {
17001
- return __awaiter$f(this, void 0, void 0, function* () {
17600
+ return __awaiter$i(this, void 0, void 0, function* () {
17002
17601
  // If get properties fails we dont want to try to get the participants after.
17003
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17602
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17004
17603
  var e_1, _a;
17005
17604
  yield this.chatThreadClient.getProperties();
17006
17605
  try {
@@ -17034,8 +17633,8 @@ class AzureCommunicationChatAdapter {
17034
17633
  this.context.offStateChange(handler);
17035
17634
  }
17036
17635
  sendMessage(content, options = {}) {
17037
- return __awaiter$f(this, void 0, void 0, function* () {
17038
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17636
+ return __awaiter$i(this, void 0, void 0, function* () {
17637
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17039
17638
  /* @conditional-compile-remove(file-sharing) */
17040
17639
  options.metadata = Object.assign(Object.assign({}, options.metadata), convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads));
17041
17640
  /* @conditional-compile-remove(file-sharing) */
@@ -17052,51 +17651,51 @@ class AzureCommunicationChatAdapter {
17052
17651
  });
17053
17652
  }
17054
17653
  sendReadReceipt(chatMessageId) {
17055
- return __awaiter$f(this, void 0, void 0, function* () {
17056
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17654
+ return __awaiter$i(this, void 0, void 0, function* () {
17655
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17057
17656
  yield this.handlers.onMessageSeen(chatMessageId);
17058
17657
  }));
17059
17658
  });
17060
17659
  }
17061
17660
  sendTypingIndicator() {
17062
- return __awaiter$f(this, void 0, void 0, function* () {
17063
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17661
+ return __awaiter$i(this, void 0, void 0, function* () {
17662
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17064
17663
  yield this.handlers.onTyping();
17065
17664
  }));
17066
17665
  });
17067
17666
  }
17068
17667
  removeParticipant(userId) {
17069
- return __awaiter$f(this, void 0, void 0, function* () {
17070
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17668
+ return __awaiter$i(this, void 0, void 0, function* () {
17669
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17071
17670
  yield this.handlers.onRemoveParticipant(userId);
17072
17671
  }));
17073
17672
  });
17074
17673
  }
17075
17674
  setTopic(topicName) {
17076
- return __awaiter$f(this, void 0, void 0, function* () {
17077
- yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17675
+ return __awaiter$i(this, void 0, void 0, function* () {
17676
+ yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17078
17677
  yield this.handlers.updateThreadTopicName(topicName);
17079
17678
  }));
17080
17679
  });
17081
17680
  }
17082
17681
  loadPreviousChatMessages(messagesToLoad) {
17083
- return __awaiter$f(this, void 0, void 0, function* () {
17084
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17682
+ return __awaiter$i(this, void 0, void 0, function* () {
17683
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17085
17684
  return yield this.handlers.onLoadPreviousChatMessages(messagesToLoad);
17086
17685
  }));
17087
17686
  });
17088
17687
  }
17089
17688
  updateMessage(messageId, content, metadata, options) {
17090
- return __awaiter$f(this, void 0, void 0, function* () {
17091
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17689
+ return __awaiter$i(this, void 0, void 0, function* () {
17690
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17092
17691
  /* @conditional-compile-remove(file-sharing) */
17093
17692
  return yield this.handlers.onUpdateMessage(messageId, content, metadata, options);
17094
17693
  }));
17095
17694
  });
17096
17695
  }
17097
17696
  deleteMessage(messageId) {
17098
- return __awaiter$f(this, void 0, void 0, function* () {
17099
- return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17697
+ return __awaiter$i(this, void 0, void 0, function* () {
17698
+ return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17100
17699
  return yield this.handlers.onDeleteMessage(messageId);
17101
17700
  }));
17102
17701
  });
@@ -17131,8 +17730,8 @@ class AzureCommunicationChatAdapter {
17131
17730
  }
17132
17731
  /* @conditional-compile-remove(teams-inline-images) */
17133
17732
  downloadAuthenticatedAttachment(attachmentUrl) {
17134
- return __awaiter$f(this, void 0, void 0, function* () {
17135
- return this.asyncTeeErrorToEventEmitter(() => __awaiter$f(this, void 0, void 0, function* () {
17733
+ return __awaiter$i(this, void 0, void 0, function* () {
17734
+ return this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17136
17735
  if (this.credential === undefined) {
17137
17736
  const e = new Error();
17138
17737
  e['target'] = 'ChatThreadClient.getMessage';
@@ -17147,7 +17746,7 @@ class AzureCommunicationChatAdapter {
17147
17746
  throw e;
17148
17747
  }
17149
17748
  function fetchWithAuthentication(url, token) {
17150
- return __awaiter$f(this, void 0, void 0, function* () {
17749
+ return __awaiter$i(this, void 0, void 0, function* () {
17151
17750
  const headers = new Headers();
17152
17751
  headers.append('Authorization', `Bearer ${token}`);
17153
17752
  try {
@@ -17215,7 +17814,7 @@ class AzureCommunicationChatAdapter {
17215
17814
  this.emitter.off(event, listener);
17216
17815
  }
17217
17816
  asyncTeeErrorToEventEmitter(f) {
17218
- return __awaiter$f(this, void 0, void 0, function* () {
17817
+ return __awaiter$i(this, void 0, void 0, function* () {
17219
17818
  try {
17220
17819
  return yield f();
17221
17820
  }
@@ -17257,7 +17856,7 @@ const convertEventType = (type) => {
17257
17856
  *
17258
17857
  * @public
17259
17858
  */
17260
- const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$f(void 0, void 0, void 0, function* () {
17859
+ const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter$i(void 0, void 0, void 0, function* () {
17261
17860
  if (!isValidIdentifier(userId)) {
17262
17861
  throw new Error('Provided userId is invalid. Please provide valid identifier object.');
17263
17862
  }
@@ -17326,7 +17925,7 @@ beforeDispose) => {
17326
17925
  if (!credential || !displayName || !endpoint || !threadId || !userId) {
17327
17926
  return;
17328
17927
  }
17329
- (() => __awaiter$f(void 0, void 0, void 0, function* () {
17928
+ (() => __awaiter$i(void 0, void 0, void 0, function* () {
17330
17929
  if (adapterRef.current) {
17331
17930
  // Dispose the old adapter when a new one is created.
17332
17931
  //
@@ -17358,7 +17957,7 @@ beforeDispose) => {
17358
17957
  // Dispose any existing adapter when the component unmounts.
17359
17958
  React.useEffect(() => {
17360
17959
  return () => {
17361
- (() => __awaiter$f(void 0, void 0, void 0, function* () {
17960
+ (() => __awaiter$i(void 0, void 0, void 0, function* () {
17362
17961
  if (adapterRef.current) {
17363
17962
  if (beforeDisposeRef.current) {
17364
17963
  yield beforeDisposeRef.current(adapterRef.current);
@@ -17382,7 +17981,7 @@ beforeDispose) => {
17382
17981
  function createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient,
17383
17982
  /* @conditional-compile-remove(teams-inline-images) */
17384
17983
  options) {
17385
- return __awaiter$f(this, void 0, void 0, function* () {
17984
+ return __awaiter$i(this, void 0, void 0, function* () {
17386
17985
  return new AzureCommunicationChatAdapter(chatClient, chatThreadClient,
17387
17986
  /* @conditional-compile-remove(teams-inline-images) */ options);
17388
17987
  });
@@ -17595,7 +18194,7 @@ const sendboxContainerStyles = {
17595
18194
 
17596
18195
  // Copyright (c) Microsoft Corporation.
17597
18196
  // Licensed under the MIT license.
17598
- var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18197
+ var __awaiter$h = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17599
18198
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17600
18199
  return new (P || (P = Promise))(function (resolve, reject) {
17601
18200
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -17616,7 +18215,7 @@ const AvatarPersona = (props) => {
17616
18215
  const { userId, dataProvider, text, imageUrl, imageInitials, initialsColor, initialsTextColor, showOverflowTooltip } = props;
17617
18216
  const [data, setData] = React.useState();
17618
18217
  React.useEffect(() => {
17619
- (() => __awaiter$e(void 0, void 0, void 0, function* () {
18218
+ (() => __awaiter$h(void 0, void 0, void 0, function* () {
17620
18219
  if (dataProvider && userId) {
17621
18220
  const newData = yield dataProvider(userId);
17622
18221
  if (avatarDeepDifferenceCheck(data, newData)) {
@@ -17980,7 +18579,7 @@ const FileDownloadErrorBar = (props) => {
17980
18579
 
17981
18580
  // Copyright (c) Microsoft Corporation.
17982
18581
  // Licensed under the MIT license.
17983
- var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18582
+ var __awaiter$g = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
17984
18583
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17985
18584
  return new (P || (P = Promise))(function (resolve, reject) {
17986
18585
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -18001,7 +18600,7 @@ const ChatScreen = (props) => {
18001
18600
  const theme = useTheme();
18002
18601
  React.useEffect(() => {
18003
18602
  // Initial data should be always fetched by the composite(or external caller) instead of the adapter
18004
- const fetchData = () => __awaiter$d(void 0, void 0, void 0, function* () {
18603
+ const fetchData = () => __awaiter$g(void 0, void 0, void 0, function* () {
18005
18604
  // Fetch initial data for adapter
18006
18605
  yield adapter.fetchInitialData();
18007
18606
  // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.
@@ -18116,20 +18715,6 @@ const useAdapter = () => {
18116
18715
  return adapter;
18117
18716
  };
18118
18717
 
18119
- // Copyright (c) Microsoft Corporation.
18120
- // Licensed under the MIT license.
18121
- /** @private */
18122
- const containerDivStyles = { position: 'relative', width: '100%', height: '100%' };
18123
-
18124
- // Copyright (c) Microsoft Corporation.
18125
- // Licensed under the MIT license.
18126
- /**
18127
- * This minimum width is to make sure the side pane does not overlap with the composite when the screen is narrow.
18128
- *
18129
- * @private
18130
- */
18131
- const compositeMinWidthRem = 30;
18132
-
18133
18718
  // Copyright (c) Microsoft Corporation.
18134
18719
  /**
18135
18720
  * @private
@@ -18215,7 +18800,7 @@ const adaptCompositeState = (compositeState) => {
18215
18800
 
18216
18801
  // Copyright (c) Microsoft Corporation.
18217
18802
  // Licensed under the MIT license.
18218
- var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18803
+ var __awaiter$f = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
18219
18804
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18220
18805
  return new (P || (P = Promise))(function (resolve, reject) {
18221
18806
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -18234,103 +18819,131 @@ _component) => {
18234
18819
  return createCompositeHandlers(useAdapter());
18235
18820
  };
18236
18821
  const createCompositeHandlers = memoizeOne__default['default']((adapter) => ({
18237
- onCreateLocalStreamView: (options) => __awaiter$c(void 0, void 0, void 0, function* () {
18822
+ onCreateLocalStreamView: (options) => __awaiter$f(void 0, void 0, void 0, function* () {
18238
18823
  return yield adapter.createStreamView(undefined, options);
18239
18824
  }),
18240
- onCreateRemoteStreamView: (userId, options) => __awaiter$c(void 0, void 0, void 0, function* () {
18825
+ onCreateRemoteStreamView: (userId, options) => __awaiter$f(void 0, void 0, void 0, function* () {
18241
18826
  return yield adapter.createStreamView(userId, options);
18242
18827
  }),
18243
- onHangUp: (forEveryone) => __awaiter$c(void 0, void 0, void 0, function* () {
18828
+ onHangUp: (forEveryone) => __awaiter$f(void 0, void 0, void 0, function* () {
18244
18829
  yield adapter.leaveCall(forEveryone);
18245
18830
  }),
18246
18831
  /* @conditional-compile-remove(PSTN-calls) */
18247
- onToggleHold: () => __awaiter$c(void 0, void 0, void 0, function* () {
18832
+ onToggleHold: () => __awaiter$f(void 0, void 0, void 0, function* () {
18248
18833
  var _a;
18249
18834
  return ((_a = adapter.getState().call) === null || _a === void 0 ? void 0 : _a.state) === 'LocalHold' ? yield adapter.resumeCall() : yield adapter.holdCall();
18250
18835
  }),
18251
18836
  /* @conditional-compile-remove(PSTN-calls) */
18252
- onAddParticipant: (participant, options) => __awaiter$c(void 0, void 0, void 0, function* () {
18837
+ onAddParticipant: (participant, options) => __awaiter$f(void 0, void 0, void 0, function* () {
18253
18838
  return yield adapter.addParticipant(participant, options);
18254
18839
  }),
18255
18840
  /* @conditional-compile-remove(PSTN-calls) */
18256
- onSendDtmfTone: (dtmfTone) => __awaiter$c(void 0, void 0, void 0, function* () {
18841
+ onSendDtmfTone: (dtmfTone) => __awaiter$f(void 0, void 0, void 0, function* () {
18257
18842
  yield adapter.sendDtmfTone(dtmfTone);
18258
18843
  }),
18259
- onRemoveParticipant: (userId) => __awaiter$c(void 0, void 0, void 0, function* () {
18844
+ onRemoveParticipant: (userId) => __awaiter$f(void 0, void 0, void 0, function* () {
18260
18845
  yield adapter.removeParticipant(userId);
18261
18846
  }),
18262
- onSelectCamera: (deviceInfo, options) => __awaiter$c(void 0, void 0, void 0, function* () {
18847
+ onSelectCamera: (deviceInfo, options) => __awaiter$f(void 0, void 0, void 0, function* () {
18263
18848
  yield adapter.setCamera(deviceInfo, options);
18264
18849
  }),
18265
- onSelectMicrophone: (deviceInfo) => __awaiter$c(void 0, void 0, void 0, function* () {
18850
+ onSelectMicrophone: (deviceInfo) => __awaiter$f(void 0, void 0, void 0, function* () {
18266
18851
  yield adapter.setMicrophone(deviceInfo);
18267
18852
  }),
18268
- onSelectSpeaker: (deviceInfo) => __awaiter$c(void 0, void 0, void 0, function* () {
18853
+ onSelectSpeaker: (deviceInfo) => __awaiter$f(void 0, void 0, void 0, function* () {
18269
18854
  yield adapter.setSpeaker(deviceInfo);
18270
18855
  }),
18271
18856
  onStartCall: (participants, options) => {
18272
18857
  const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));
18273
18858
  return adapter.startCall(rawIds, options);
18274
18859
  },
18275
- onStartScreenShare: () => __awaiter$c(void 0, void 0, void 0, function* () {
18860
+ onStartScreenShare: () => __awaiter$f(void 0, void 0, void 0, function* () {
18276
18861
  yield adapter.startScreenShare();
18277
18862
  }),
18278
- onStopScreenShare: () => __awaiter$c(void 0, void 0, void 0, function* () {
18863
+ onStopScreenShare: () => __awaiter$f(void 0, void 0, void 0, function* () {
18279
18864
  yield adapter.stopScreenShare();
18280
18865
  }),
18281
- onToggleCamera: (options) => __awaiter$c(void 0, void 0, void 0, function* () {
18866
+ onToggleCamera: (options) => __awaiter$f(void 0, void 0, void 0, function* () {
18282
18867
  isCameraOn(adapter.getState()) ? yield adapter.stopCamera() : yield adapter.startCamera(options);
18283
18868
  }),
18284
- onToggleMicrophone: () => __awaiter$c(void 0, void 0, void 0, function* () {
18869
+ onToggleMicrophone: () => __awaiter$f(void 0, void 0, void 0, function* () {
18285
18870
  var _b;
18286
18871
  return ((_b = adapter.getState().call) === null || _b === void 0 ? void 0 : _b.isMuted) ? yield adapter.unmute() : yield adapter.mute();
18287
18872
  }),
18288
- onToggleScreenShare: () => __awaiter$c(void 0, void 0, void 0, function* () {
18873
+ onToggleScreenShare: () => __awaiter$f(void 0, void 0, void 0, function* () {
18289
18874
  var _c;
18290
18875
  return ((_c = adapter.getState().call) === null || _c === void 0 ? void 0 : _c.isScreenSharingOn)
18291
18876
  ? yield adapter.stopScreenShare()
18292
18877
  : yield adapter.startScreenShare();
18293
18878
  }),
18294
- onStartLocalVideo: () => __awaiter$c(void 0, void 0, void 0, function* () {
18879
+ onStartLocalVideo: () => __awaiter$f(void 0, void 0, void 0, function* () {
18295
18880
  if (adapter.getState().call) {
18296
18881
  return adapter.startCamera();
18297
18882
  }
18298
18883
  }),
18299
- onDisposeLocalStreamView: () => __awaiter$c(void 0, void 0, void 0, function* () {
18884
+ onDisposeLocalStreamView: () => __awaiter$f(void 0, void 0, void 0, function* () {
18300
18885
  return adapter.disposeStreamView();
18301
18886
  }),
18302
- onDisposeRemoteStreamView: (userId) => __awaiter$c(void 0, void 0, void 0, function* () {
18887
+ onDisposeRemoteStreamView: (userId) => __awaiter$f(void 0, void 0, void 0, function* () {
18303
18888
  return adapter.disposeStreamView(userId);
18304
18889
  }),
18305
18890
  /* @conditional-compile-remove(call-readiness) */
18306
- askDevicePermission: (constrain) => __awaiter$c(void 0, void 0, void 0, function* () {
18891
+ askDevicePermission: (constrain) => __awaiter$f(void 0, void 0, void 0, function* () {
18307
18892
  return adapter.askDevicePermission(constrain);
18308
18893
  }),
18309
18894
  /* @conditional-compile-remove(video-background-effects) */
18310
- onRemoveVideoBackgroundEffects: () => __awaiter$c(void 0, void 0, void 0, function* () {
18895
+ onRemoveVideoBackgroundEffects: () => __awaiter$f(void 0, void 0, void 0, function* () {
18311
18896
  return yield adapter.stopVideoBackgroundEffect();
18312
18897
  }),
18313
18898
  /* @conditional-compile-remove(video-background-effects) */
18314
- onBlurVideoBackground: (backgroundBlurConfig) => __awaiter$c(void 0, void 0, void 0, function* () {
18899
+ onBlurVideoBackground: (backgroundBlurConfig) => __awaiter$f(void 0, void 0, void 0, function* () {
18315
18900
  return yield adapter.blurVideoBackground(backgroundBlurConfig);
18316
18901
  }),
18317
18902
  /* @conditional-compile-remove(video-background-effects) */
18318
- onReplaceVideoBackground: (backgroundReplacementConfig) => __awaiter$c(void 0, void 0, void 0, function* () {
18903
+ onReplaceVideoBackground: (backgroundReplacementConfig) => __awaiter$f(void 0, void 0, void 0, function* () {
18319
18904
  return yield adapter.replaceVideoBackground(backgroundReplacementConfig);
18905
+ }),
18906
+ /* @conditional-compile-remove(close-captions) */
18907
+ onStartCaptions: (options) => __awaiter$f(void 0, void 0, void 0, function* () {
18908
+ yield adapter.startCaptions(options);
18909
+ }),
18910
+ /* @conditional-compile-remove(close-captions) */
18911
+ onStopCaptions: () => __awaiter$f(void 0, void 0, void 0, function* () {
18912
+ yield adapter.stopCaptions();
18913
+ }),
18914
+ /* @conditional-compile-remove(close-captions) */
18915
+ onSetSpokenLanguage: (language) => __awaiter$f(void 0, void 0, void 0, function* () {
18916
+ yield adapter.setSpokenLanguage(language);
18917
+ }),
18918
+ /* @conditional-compile-remove(close-captions) */
18919
+ onSetCaptionLanguage: (language) => __awaiter$f(void 0, void 0, void 0, function* () {
18920
+ yield adapter.setCaptionLanguage(language);
18320
18921
  })
18321
18922
  }));
18322
18923
 
18323
18924
  // Copyright (c) Microsoft Corporation.
18324
- /**
18325
- * @private
18326
- */
18327
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
18328
- const usePropsFor$1 = (component) => {
18329
- const selector = getSelector$1(component);
18330
- if (!selector) {
18331
- throw new Error("Can't find the selector for component, please check supported component list");
18332
- }
18333
- return Object.assign(Object.assign({}, useAdaptedSelector(selector)), useHandlers());
18925
+ /** @private */
18926
+ const CaptionsSettingsModal = (props) => {
18927
+ /* @conditional-compile-remove(close-captions) */
18928
+ const CaptionsSettingsModalProps = useAdaptedSelector(_changeSpokenLanguageSelector);
18929
+ /* @conditional-compile-remove(close-captions) */
18930
+ const handlers = useHandlers();
18931
+ /* @conditional-compile-remove(close-captions) */
18932
+ const strings = useLocale().strings.call;
18933
+ /* @conditional-compile-remove(close-captions) */
18934
+ const modalStrings = {
18935
+ captionsSettingsModalTitle: strings.captionsSettingsModalTitle,
18936
+ captionsSettingsDropdownLabel: strings.captionsSettingsDropdownLabel,
18937
+ captionsSettingsDropdownInfoText: strings.captionsSettingsDropdownInfoText,
18938
+ captionsSettingsConfirmButtonLabel: strings.captionsSettingsConfirmButtonLabel,
18939
+ captionsSettingsCancelButtonLabel: strings.captionsSettingsCancelButtonLabel,
18940
+ captionsSettingsModalAriaLabel: strings.captionsSettingsModalAriaLabel,
18941
+ captionsSettingsCloseModalButtonAriaLabel: strings.captionsSettingsCloseModalButtonAriaLabel
18942
+ };
18943
+ /* @conditional-compile-remove(close-captions) */
18944
+ const captionsAvailableLanguageStrings = strings.captionsAvailableLanguageStrings;
18945
+ /* @conditional-compile-remove(close-captions) */
18946
+ return (React__default['default'].createElement(_CaptionsSettingsModal, Object.assign({}, CaptionsSettingsModalProps, handlers, { strings: modalStrings, captionsAvailableLanguageStrings: captionsAvailableLanguageStrings, showModal: props.showCaptionsSettingsModal, onDismissCaptionsSettings: props.onDismissCaptionsSettings })));
18334
18947
  };
18335
18948
 
18336
18949
  // Copyright (c) Microsoft Corporation.
@@ -18398,31 +19011,192 @@ const participantButtonWithIncreasedTouchTargets = {
18398
19011
  }
18399
19012
  }
18400
19013
  };
18401
- /**
18402
- * @private
18403
- */
18404
- const devicesButtonWithIncreasedTouchTargets = {
18405
- menuStyles: {
18406
- menuItemStyles: buttonFlyoutIncreasedSizeStyles
18407
- }
19014
+ /**
19015
+ * @private
19016
+ */
19017
+ const devicesButtonWithIncreasedTouchTargets = {
19018
+ menuStyles: {
19019
+ menuItemStyles: buttonFlyoutIncreasedSizeStyles
19020
+ }
19021
+ };
19022
+ /**
19023
+ * @private
19024
+ */
19025
+ const controlButtonBaseStyle = {
19026
+ label: {
19027
+ minWidth: '2.25rem'
19028
+ }
19029
+ };
19030
+ /**
19031
+ * @private
19032
+ */
19033
+ const concatButtonBaseStyles = (...styles) => {
19034
+ let result = controlButtonBaseStyle;
19035
+ styles.forEach((style) => {
19036
+ result = react.concatStyleSets(result, style);
19037
+ });
19038
+ return result;
19039
+ };
19040
+
19041
+ // Copyright (c) Microsoft Corporation.
19042
+ const icon$2 = () => React__default['default'].createElement(reactIcons.MoreHorizontal20Filled, { key: 'chatOnIconKey', primaryFill: "currentColor" });
19043
+ /**
19044
+ * @private
19045
+ */
19046
+ const MoreButton = (props) => {
19047
+ return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { labelKey: 'optionsButtonLabelKey', showLabel: props.showLabel, onRenderOnIcon: icon$2, onRenderOffIcon: icon$2, onClick: props.onClick, "data-ui-id": props['data-ui-id'] })));
19048
+ };
19049
+
19050
+ var __awaiter$e = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
19051
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19052
+ return new (P || (P = Promise))(function (resolve, reject) {
19053
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19054
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19055
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19056
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19057
+ });
19058
+ };
19059
+ /**
19060
+ *
19061
+ * @private
19062
+ */
19063
+ const CaptionsBannerMoreButton = (props) => {
19064
+ /* @conditional-compile-remove(close-captions) */
19065
+ const localeStrings = useLocale();
19066
+ /* @conditional-compile-remove(close-captions) */
19067
+ const startCaptionsButtonProps = useAdaptedSelector(_startCaptionsButtonSelector);
19068
+ /* @conditional-compile-remove(close-captions) */
19069
+ const startCaptionsButtonHandlers = useHandlers();
19070
+ /* @conditional-compile-remove(close-captions) */
19071
+ const moreButtonStrings = React.useMemo(() => ({
19072
+ label: localeStrings.strings.call.captionsBannerMoreButtonCallingLabel,
19073
+ tooltipOffContent: localeStrings.strings.call.captionsBannerMoreButtonTooltip
19074
+ }), [localeStrings]);
19075
+ /* @conditional-compile-remove(close-captions) */
19076
+ const moreButtonContextualMenuItems = [];
19077
+ /* @conditional-compile-remove(close-captions) */
19078
+ const startCaptions = React.useCallback(() => __awaiter$e(void 0, void 0, void 0, function* () {
19079
+ yield startCaptionsButtonHandlers.onStartCaptions({
19080
+ spokenLanguage: startCaptionsButtonProps.currentSpokenLanguage
19081
+ });
19082
+ // set spoken language when start captions with a spoken language specified.
19083
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
19084
+ startCaptionsButtonHandlers.onSetSpokenLanguage(startCaptionsButtonProps.currentSpokenLanguage);
19085
+ }), [startCaptionsButtonHandlers, startCaptionsButtonProps.currentSpokenLanguage]);
19086
+ /* @conditional-compile-remove(close-captions) */
19087
+ moreButtonContextualMenuItems.push({
19088
+ key: 'ToggleCaptionsKey',
19089
+ text: startCaptionsButtonProps.checked
19090
+ ? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
19091
+ : localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
19092
+ onClick: () => {
19093
+ startCaptionsButtonProps.checked
19094
+ ? startCaptionsButtonHandlers.onStopCaptions()
19095
+ : startCaptionsButtonProps.currentSpokenLanguage !== ''
19096
+ ? startCaptions()
19097
+ : props.onCaptionsSettingsClick && props.onCaptionsSettingsClick();
19098
+ },
19099
+ iconProps: {
19100
+ iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
19101
+ styles: { root: { lineHeight: 0 } }
19102
+ },
19103
+ itemProps: {
19104
+ styles: buttonFlyoutIncreasedSizeStyles
19105
+ }
19106
+ });
19107
+ /* @conditional-compile-remove(close-captions) */
19108
+ if (props.onCaptionsSettingsClick) {
19109
+ moreButtonContextualMenuItems.push({
19110
+ key: 'openCaptionsSettingsKey',
19111
+ id: 'common-call-composite-captions-settings-button',
19112
+ text: localeStrings.strings.call.captionsSettingsLabel,
19113
+ onClick: props.onCaptionsSettingsClick,
19114
+ iconProps: {
19115
+ iconName: 'CaptionsSettingsIcon',
19116
+ styles: { root: { lineHeight: 0 } }
19117
+ },
19118
+ itemProps: {
19119
+ styles: buttonFlyoutIncreasedSizeStyles
19120
+ },
19121
+ disabled: !startCaptionsButtonProps.checked
19122
+ });
19123
+ }
19124
+ /* @conditional-compile-remove(close-captions) */
19125
+ return (React__default['default'].createElement(MoreButton, Object.assign({}, props, { "data-ui-id": "captions-banner-more-button", strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: {
19126
+ items: moreButtonContextualMenuItems,
19127
+ calloutProps: {
19128
+ preventDismissOnEvent: _preventDismissOnEvent
19129
+ }
19130
+ } })));
19131
+ };
19132
+
19133
+ // Copyright (c) Microsoft Corporation.
19134
+ /* @conditional-compile-remove(close-captions) */
19135
+ const mobileViewBannerWidth = '90%';
19136
+ /* @conditional-compile-remove(close-captions) */
19137
+ const desktopViewBannerWidth = '50%';
19138
+ /** @private */
19139
+ const CaptionsBanner = (props) => {
19140
+ /* @conditional-compile-remove(close-captions) */
19141
+ const captionsBannerProps = useAdaptedSelector(_captionsBannerSelector);
19142
+ /* @conditional-compile-remove(close-captions) */
19143
+ const handlers = useHandlers();
19144
+ /* @conditional-compile-remove(close-captions) */
19145
+ const [isCaptionsSettingsOpen, setIsCaptionsSettingsOpen] = React.useState(false);
19146
+ /* @conditional-compile-remove(close-captions) */
19147
+ const onClickCaptionsSettings = () => {
19148
+ setIsCaptionsSettingsOpen(true);
19149
+ };
19150
+ /* @conditional-compile-remove(close-captions) */
19151
+ const onDismissCaptionsSettings = () => {
19152
+ setIsCaptionsSettingsOpen(false);
19153
+ };
19154
+ /* @conditional-compile-remove(close-captions) */
19155
+ const containerClassName = react.mergeStyles({
19156
+ position: 'relative'
19157
+ });
19158
+ /* @conditional-compile-remove(close-captions) */
19159
+ const floatingChildClassName = react.mergeStyles({
19160
+ position: 'absolute',
19161
+ right: 0,
19162
+ top: 0
19163
+ });
19164
+ return (React__default['default'].createElement(React__default['default'].Fragment, null,
19165
+ /* @conditional-compile-remove(close-captions) */ isCaptionsSettingsOpen && (React__default['default'].createElement(CaptionsSettingsModal, { showCaptionsSettingsModal: isCaptionsSettingsOpen, onDismissCaptionsSettings: onDismissCaptionsSettings })),
19166
+ /* @conditional-compile-remove(close-captions) */ captionsBannerProps.captions.length > 0 &&
19167
+ captionsBannerProps.isCaptionsOn && (React__default['default'].createElement("div", { className: containerClassName },
19168
+ React__default['default'].createElement(react.Stack, { horizontalAlign: "center" },
19169
+ React__default['default'].createElement(react.Stack.Item, { style: { width: props.isMobile ? mobileViewBannerWidth : desktopViewBannerWidth } },
19170
+ React__default['default'].createElement(_CaptionsBanner, Object.assign({}, captionsBannerProps, handlers)))),
19171
+ !props.isMobile && (React__default['default'].createElement("div", { className: floatingChildClassName },
19172
+ React__default['default'].createElement(CaptionsBannerMoreButton, { onCaptionsSettingsClick: onClickCaptionsSettings })))))));
18408
19173
  };
19174
+
19175
+ // Copyright (c) Microsoft Corporation.
19176
+ // Licensed under the MIT license.
19177
+ /** @private */
19178
+ const containerDivStyles = { position: 'relative', width: '100%', height: '100%' };
19179
+
19180
+ // Copyright (c) Microsoft Corporation.
19181
+ // Licensed under the MIT license.
18409
19182
  /**
19183
+ * This minimum width is to make sure the side pane does not overlap with the composite when the screen is narrow.
19184
+ *
18410
19185
  * @private
18411
19186
  */
18412
- const controlButtonBaseStyle = {
18413
- label: {
18414
- minWidth: '2.25rem'
18415
- }
18416
- };
19187
+ const compositeMinWidthRem = 30;
19188
+
19189
+ // Copyright (c) Microsoft Corporation.
18417
19190
  /**
18418
19191
  * @private
18419
19192
  */
18420
- const concatButtonBaseStyles = (...styles) => {
18421
- let result = controlButtonBaseStyle;
18422
- styles.forEach((style) => {
18423
- result = react.concatStyleSets(result, style);
18424
- });
18425
- return result;
19193
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
19194
+ const usePropsFor$1 = (component) => {
19195
+ const selector = getSelector$1(component);
19196
+ if (!selector) {
19197
+ throw new Error("Can't find the selector for component, please check supported component list");
19198
+ }
19199
+ return Object.assign(Object.assign({}, useAdaptedSelector(selector)), useHandlers());
18426
19200
  };
18427
19201
 
18428
19202
  // Copyright (c) Microsoft Corporation.
@@ -18591,6 +19365,11 @@ const getDominantSpeakerInfo = (state) => { var _a; return (_a = state.call) ===
18591
19365
  * @private
18592
19366
  */
18593
19367
  const getRemoteParticipants = (state) => { var _a; return (_a = state.call) === null || _a === void 0 ? void 0 : _a.remoteParticipants; };
19368
+ /* @conditional-compile-remove(close-captions) */
19369
+ /**
19370
+ * @private
19371
+ */
19372
+ const getIsTeamsCall = (state) => state.isTeamsCall;
18594
19373
 
18595
19374
  // Copyright (c) Microsoft Corporation.
18596
19375
  /**
@@ -18660,7 +19439,7 @@ const isDisabled = (option) => {
18660
19439
  };
18661
19440
 
18662
19441
  // Copyright (c) Microsoft Corporation.
18663
- const icon$2 = () => React__default['default'].createElement(CallCompositeIcon, { iconName: 'ControlButtonParticipants' });
19442
+ const icon$1 = () => React__default['default'].createElement(CallCompositeIcon, { iconName: 'ControlButtonParticipants' });
18664
19443
  /**
18665
19444
  * @private
18666
19445
  */
@@ -18676,16 +19455,7 @@ const People = (props) => {
18676
19455
  }
18677
19456
  }, (_a = props.styles) !== null && _a !== void 0 ? _a : {}, controlButtonBaseStyle);
18678
19457
  }, [props.styles, theme.palette.neutralLight]);
18679
- return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { "data-ui-id": "call-composite-participants-button", strings: strings, labelKey: 'peopleButtonLabelKey', onRenderOnIcon: onRenderOnIcon !== null && onRenderOnIcon !== void 0 ? onRenderOnIcon : icon$2, onRenderOffIcon: onRenderOffIcon !== null && onRenderOffIcon !== void 0 ? onRenderOffIcon : icon$2, onClick: onClick, styles: styles })));
18680
- };
18681
-
18682
- // Copyright (c) Microsoft Corporation.
18683
- const icon$1 = () => React__default['default'].createElement(reactIcons.MoreHorizontal20Filled, { key: 'chatOnIconKey', primaryFill: "currentColor" });
18684
- /**
18685
- * @private
18686
- */
18687
- const MoreButton = (props) => {
18688
- return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { labelKey: 'optionsButtonLabelKey', showLabel: props.showLabel, onRenderOnIcon: icon$1, onRenderOffIcon: icon$1, onClick: props.onClick, "data-ui-id": 'common-call-composite-more-button' })));
19458
+ return (React__default['default'].createElement(ControlBarButton, Object.assign({}, props, { "data-ui-id": "call-composite-participants-button", strings: strings, labelKey: 'peopleButtonLabelKey', onRenderOnIcon: onRenderOnIcon !== null && onRenderOnIcon !== void 0 ? onRenderOnIcon : icon$1, onRenderOffIcon: onRenderOffIcon !== null && onRenderOffIcon !== void 0 ? onRenderOffIcon : icon$1, onClick: onClick, styles: styles })));
18689
19459
  };
18690
19460
 
18691
19461
  // Copyright (c) Microsoft Corporation.
@@ -18917,7 +19687,7 @@ const CallControls = (props) => {
18917
19687
  React__default['default'].createElement(People, { checked: props.peopleButtonChecked, ariaLabel: peopleButtonStrings === null || peopleButtonStrings === void 0 ? void 0 : peopleButtonStrings.label, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact', onClick: props.onPeopleButtonClicked, "data-ui-id": "call-composite-people-button", strings: peopleButtonStrings, disabled: isDisabled$2(options === null || options === void 0 ? void 0 : options.participantsButton) })),
18918
19688
  isEnabled$2(options === null || options === void 0 ? void 0 : options.devicesButton) && (React__default['default'].createElement(Devices, { displayType: options === null || options === void 0 ? void 0 : options.displayType, increaseFlyoutItemSize: props.increaseFlyoutItemSize, disabled: isDisabled$2(options === null || options === void 0 ? void 0 : options.devicesButton) })),
18919
19689
  /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */
18920
- isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton) && moreButtonContextualMenuItems().length > 0 && (React__default['default'].createElement(MoreButton, { strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonContextualMenuItems() }, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact' })),
19690
+ isEnabled$2(options === null || options === void 0 ? void 0 : options.moreButton) && moreButtonContextualMenuItems().length > 0 && (React__default['default'].createElement(MoreButton, { "data-ui-id": "common-call-composite-more-button", strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonContextualMenuItems() }, showLabel: (options === null || options === void 0 ? void 0 : options.displayType) !== 'compact' })),
18921
19691
  customButtons['primary'],
18922
19692
  isEnabled$2(options === null || options === void 0 ? void 0 : options.endCallButton) && React__default['default'].createElement(EndCall, { displayType: options === null || options === void 0 ? void 0 : options.displayType })))));
18923
19693
  };
@@ -19248,16 +20018,39 @@ const onFetchCustomButtonPropsTrampoline = (options) => {
19248
20018
  };
19249
20019
 
19250
20020
  // Copyright (c) Microsoft Corporation.
20021
+ // Licensed under the MIT license.
20022
+ var __awaiter$d = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
20023
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20024
+ return new (P || (P = Promise))(function (resolve, reject) {
20025
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20026
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20027
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20028
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20029
+ });
20030
+ };
19251
20031
  /**
19252
20032
  *
19253
20033
  * @private
19254
20034
  */
19255
20035
  const DesktopMoreButton = (props) => {
19256
- /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
20036
+ /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
19257
20037
  const localeStrings = useLocale();
19258
20038
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
19259
20039
  const holdButtonProps = usePropsFor$1(HoldButton);
19260
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
20040
+ /* @conditional-compile-remove(close-captions) */
20041
+ const startCaptionsButtonProps = useAdaptedSelector(_startCaptionsButtonSelector);
20042
+ /* @conditional-compile-remove(close-captions) */
20043
+ const startCaptionsButtonHandlers = useHandlers();
20044
+ /* @conditional-compile-remove(close-captions) */
20045
+ const startCaptions = React.useCallback(() => __awaiter$d(void 0, void 0, void 0, function* () {
20046
+ yield startCaptionsButtonHandlers.onStartCaptions({
20047
+ spokenLanguage: startCaptionsButtonProps.currentSpokenLanguage
20048
+ });
20049
+ // set spoken language when start captions with a spoken language specified.
20050
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
20051
+ startCaptionsButtonHandlers.onSetSpokenLanguage(startCaptionsButtonProps.currentSpokenLanguage);
20052
+ }), [startCaptionsButtonHandlers, startCaptionsButtonProps.currentSpokenLanguage]);
20053
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
19261
20054
  const moreButtonStrings = React.useMemo(() => ({
19262
20055
  label: localeStrings.strings.call.moreButtonCallingLabel,
19263
20056
  tooltipOffContent: localeStrings.strings.callWithChat.moreDrawerButtonTooltip
@@ -19276,6 +20069,77 @@ const DesktopMoreButton = (props) => {
19276
20069
  },
19277
20070
  disabled: props.disableButtonsForHoldScreen
19278
20071
  });
20072
+ // is captions feature is active
20073
+ /* @conditional-compile-remove(close-captions) */
20074
+ if (props.isCaptionsSupported) {
20075
+ const captionsContextualMenuItems = [];
20076
+ const menuSubIconStyleSet = {
20077
+ root: {
20078
+ height: 'unset',
20079
+ lineHeight: '100%',
20080
+ width: '1.25rem'
20081
+ }
20082
+ };
20083
+ moreButtonContextualMenuItems.push({
20084
+ key: 'liveCaptionsKey',
20085
+ id: 'common-call-composite-captions-button',
20086
+ text: localeStrings.strings.call.liveCaptionsLabel,
20087
+ iconProps: { iconName: 'CaptionsIcon', styles: { root: { lineHeight: 0 } } },
20088
+ itemProps: {
20089
+ styles: buttonFlyoutIncreasedSizeStyles
20090
+ },
20091
+ disabled: props.disableButtonsForHoldScreen,
20092
+ subMenuProps: {
20093
+ id: 'captions-contextual-menu',
20094
+ items: captionsContextualMenuItems,
20095
+ calloutProps: {
20096
+ preventDismissOnEvent: _preventDismissOnEvent
20097
+ }
20098
+ },
20099
+ submenuIconProps: {
20100
+ iconName: 'HorizontalGalleryRightButton',
20101
+ styles: menuSubIconStyleSet
20102
+ }
20103
+ });
20104
+ captionsContextualMenuItems.push({
20105
+ key: 'ToggleCaptionsKey',
20106
+ id: 'common-call-composite-captions-toggle-button',
20107
+ text: startCaptionsButtonProps.checked
20108
+ ? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
20109
+ : localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
20110
+ onClick: () => {
20111
+ startCaptionsButtonProps.checked
20112
+ ? startCaptionsButtonHandlers.onStopCaptions()
20113
+ : startCaptionsButtonProps.currentSpokenLanguage !== ''
20114
+ ? startCaptions()
20115
+ : props.onCaptionsSettingsClick && props.onCaptionsSettingsClick();
20116
+ },
20117
+ iconProps: {
20118
+ iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
20119
+ styles: { root: { lineHeight: 0 } }
20120
+ },
20121
+ itemProps: {
20122
+ styles: buttonFlyoutIncreasedSizeStyles
20123
+ },
20124
+ disabled: props.disableButtonsForHoldScreen
20125
+ });
20126
+ if (props.onCaptionsSettingsClick) {
20127
+ captionsContextualMenuItems.push({
20128
+ key: 'openCaptionsSettingsKey',
20129
+ id: 'common-call-composite-captions-settings-button',
20130
+ text: localeStrings.strings.call.captionsSettingsLabel,
20131
+ onClick: props.onCaptionsSettingsClick,
20132
+ iconProps: {
20133
+ iconName: 'CaptionsSettingsIcon',
20134
+ styles: { root: { lineHeight: 0 } }
20135
+ },
20136
+ itemProps: {
20137
+ styles: buttonFlyoutIncreasedSizeStyles
20138
+ },
20139
+ disabled: props.disableButtonsForHoldScreen || !startCaptionsButtonProps.checked
20140
+ });
20141
+ }
20142
+ }
19279
20143
  /*@conditional-compile-remove(PSTN-calls) */
19280
20144
  if (props.onClickShowDialpad) {
19281
20145
  moreButtonContextualMenuItems.push({
@@ -19314,8 +20178,13 @@ const DesktopMoreButton = (props) => {
19314
20178
  } }, element));
19315
20179
  });
19316
20180
  return (React__default['default'].createElement(MoreButton, Object.assign({}, props, { "data-ui-id": "common-call-composite-more-button",
19317
- /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
19318
- strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: { items: moreButtonContextualMenuItems } })));
20181
+ /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
20182
+ strings: moreButtonStrings, menuIconProps: { hidden: true }, menuProps: {
20183
+ items: moreButtonContextualMenuItems,
20184
+ calloutProps: {
20185
+ preventDismissOnEvent: _preventDismissOnEvent
20186
+ }
20187
+ } })));
19319
20188
  };
19320
20189
 
19321
20190
  // Copyright (c) Microsoft Corporation.
@@ -19387,6 +20256,8 @@ const CommonCallControlBar = (props) => {
19387
20256
  const [isOutOfSpace, setIsOutOfSpace] = React.useState(false);
19388
20257
  const callWithChatStrings = useCallWithChatCompositeStrings();
19389
20258
  const options = inferCommonCallControlOptions(props.mobileView, props.callControls);
20259
+ /* @conditional-compile-remove(close-captions) */
20260
+ const [showCaptionsSettingsModal, setShowCaptionsSettingsModal] = React.useState(false);
19390
20261
  const handleResize = React.useCallback(() => {
19391
20262
  setControlBarButtonsWidth(controlBarContainerRef.current ? controlBarContainerRef.current.offsetWidth : 0);
19392
20263
  setPanelsButtonsWidth(sidepaneControlsRef.current ? sidepaneControlsRef.current.offsetWidth : 0);
@@ -19413,6 +20284,14 @@ const CommonCallControlBar = (props) => {
19413
20284
  React.useEffect(() => {
19414
20285
  setIsOutOfSpace(totalButtonsWidth > controlBarContainerWidth);
19415
20286
  }, [totalButtonsWidth, controlBarContainerWidth]);
20287
+ /* @conditional-compile-remove(close-captions) */
20288
+ const openCaptionsSettingsModal = React.useCallback(() => {
20289
+ setShowCaptionsSettingsModal(true);
20290
+ }, []);
20291
+ /* @conditional-compile-remove(close-captions) */
20292
+ const onDismissCaptionsSettings = React.useCallback(() => {
20293
+ setShowCaptionsSettingsModal(false);
20294
+ }, []);
19416
20295
  const chatButtonStrings = React.useMemo(() => ({
19417
20296
  label: callWithChatStrings.chatButtonLabel,
19418
20297
  tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,
@@ -19452,6 +20331,8 @@ const CommonCallControlBar = (props) => {
19452
20331
  }
19453
20332
  const chatButton = props.chatAdapter ? (React__default['default'].createElement(ChatButtonWithUnreadMessagesBadge, { chatAdapter: props.chatAdapter, checked: props.chatButtonChecked, showLabel: options.displayType !== 'compact', isChatPaneVisible: (_a = props.chatButtonChecked) !== null && _a !== void 0 ? _a : false, onClick: props.onChatButtonClicked, disabled: props.disableButtonsForLobbyPage || isDisabled$2(options.chatButton), strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel })) : (React__default['default'].createElement(React__default['default'].Fragment, null));
19454
20333
  return (React__default['default'].createElement("div", { ref: controlBarSizeRef },
20334
+ React__default['default'].createElement(CallAdapterProvider, { adapter: props.callAdapter },
20335
+ /* @conditional-compile-remove(close-captions) */ showCaptionsSettingsModal && (React__default['default'].createElement(CaptionsSettingsModal, { showCaptionsSettingsModal: showCaptionsSettingsModal, onDismissCaptionsSettings: onDismissCaptionsSettings }))),
19455
20336
  React__default['default'].createElement(react.Stack, { horizontal: true, reversed: !props.mobileView && !isOutOfSpace, horizontalAlign: "space-between", className: react.mergeStyles(callControlsContainerStyles, controlBarContainerStyles$1, controlBarDesktopContainerStyles) },
19456
20337
  React__default['default'].createElement(react.Stack.Item, { grow: true, className: react.mergeStyles(controlBarWrapperDesktopStyles) },
19457
20338
  React__default['default'].createElement(CallAdapterProvider, { adapter: props.callAdapter },
@@ -19484,7 +20365,11 @@ const CommonCallControlBar = (props) => {
19484
20365
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled$1(options === null || options === void 0 ? void 0 : options.holdButton) &&
19485
20366
  !props.mobileView && (React__default['default'].createElement(DesktopMoreButton, { disableButtonsForHoldScreen: props.disableButtonsForHoldScreen, styles: commonButtonStyles, onClickShowDialpad: props.onClickShowDialpad,
19486
20367
  /* @conditional-compile-remove(control-bar-button-injection) */
19487
- callControls: props.callControls })),
20368
+ callControls: props.callControls,
20369
+ /* @conditional-compile-remove(close-captions) */
20370
+ isCaptionsSupported: props.isCaptionsSupported,
20371
+ /* @conditional-compile-remove(close-captions) */
20372
+ onCaptionsSettingsClick: openCaptionsSettingsModal })),
19488
20373
  React__default['default'].createElement(EndCall, { displayType: "compact", styles: endCallButtonStyles }))))))),
19489
20374
  !props.mobileView && (React__default['default'].createElement(react.Stack.Item, null,
19490
20375
  React__default['default'].createElement("div", { ref: sidepaneControlsRef },
@@ -20230,7 +21115,7 @@ const AddPeopleButton = (props) => {
20230
21115
 
20231
21116
  // Copyright (c) Microsoft Corporation.
20232
21117
  // Licensed under the MIT license.
20233
- var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21118
+ var __awaiter$c = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
20234
21119
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20235
21120
  return new (P || (P = Promise))(function (resolve, reject) {
20236
21121
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -20266,7 +21151,7 @@ const PeoplePaneContent = (props) => {
20266
21151
  setDrawerMenuItems
20267
21152
  ]);
20268
21153
  const participantListProps = React.useMemo(() => {
20269
- const onRemoveAParticipant = (participantId) => __awaiter$b(void 0, void 0, void 0, function* () { return onRemoveParticipant(participantId); });
21154
+ const onRemoveAParticipant = (participantId) => __awaiter$c(void 0, void 0, void 0, function* () { return onRemoveParticipant(participantId); });
20270
21155
  return Object.assign(Object.assign({}, participantListDefaultProps), {
20271
21156
  // Passing undefined callback for mobile to avoid context menus for participants in ParticipantList are clicked
20272
21157
  onRemoveParticipant: props.mobileView ? undefined : onRemoveAParticipant,
@@ -20464,8 +21349,12 @@ const useMinMaxDragPosition = (modalLayerHostId, rtl) => {
20464
21349
  }, [modalHostHeight, modalHostWidth, rtl]);
20465
21350
  return { minDragPosition: minDragPosition, maxDragPosition: maxDragPosition };
20466
21351
  };
21352
+ /**
21353
+ * @private
21354
+ */
21355
+ const defaultSpokenLanguage = 'en-us';
20467
21356
 
20468
- var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21357
+ var __awaiter$b = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
20469
21358
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20470
21359
  return new (P || (P = Promise))(function (resolve, reject) {
20471
21360
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -20495,11 +21384,11 @@ const CallPane = (props) => {
20495
21384
  /**
20496
21385
  * In a Call Composite when a participant is removed, we must remove them from the call.
20497
21386
  */
20498
- const removeParticipantFromCall = (participantId) => __awaiter$a(void 0, void 0, void 0, function* () {
21387
+ const removeParticipantFromCall = (participantId) => __awaiter$b(void 0, void 0, void 0, function* () {
20499
21388
  yield props.callAdapter.removeParticipant(participantId);
20500
21389
  });
20501
21390
  /* @conditional-compile-remove(PSTN-calls) */
20502
- const addParticipantToCall = (participant, options) => __awaiter$a(void 0, void 0, void 0, function* () {
21391
+ const addParticipantToCall = (participant, options) => __awaiter$b(void 0, void 0, void 0, function* () {
20503
21392
  yield props.callAdapter.addParticipant(participant, options);
20504
21393
  });
20505
21394
  const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId, props.rtl);
@@ -20563,6 +21452,99 @@ const isSpeakingAndMutedAnimationStyles = Object.assign({}, react.AnimationStyle
20563
21452
  const isNotSpeakingAndMutedAnimationStyles = Object.assign(Object.assign({}, react.AnimationStyles.fadeOut200), { display: 'none' });
20564
21453
 
20565
21454
  // Copyright (c) Microsoft Corporation.
21455
+ /**
21456
+ * @private
21457
+ */
21458
+ const spokenLanguageDrawerStyles = (theme) => ({
21459
+ root: {
21460
+ height: _pxToRem(300),
21461
+ overflow: 'auto'
21462
+ },
21463
+ drawerSurfaceStyles: {
21464
+ drawerContentContainer: {
21465
+ root: {
21466
+ span: {
21467
+ fontWeight: 600,
21468
+ fontSize: _pxToRem(17),
21469
+ lineHeight: _pxToRem(22),
21470
+ color: theme.palette.neutralDark
21471
+ }
21472
+ }
21473
+ }
21474
+ }
21475
+ });
21476
+
21477
+ // Copyright (c) Microsoft Corporation.
21478
+ /** @private */
21479
+ const SpokenLanguageDrawer = (props) => {
21480
+ var _a;
21481
+ /* @conditional-compile-remove(close-captions) */
21482
+ const theme = useTheme();
21483
+ /* @conditional-compile-remove(close-captions) */
21484
+ const changeSpokenLanguageProps = useAdaptedSelector(_changeSpokenLanguageSelector);
21485
+ /* @conditional-compile-remove(close-captions) */
21486
+ const changeSpokenLanguageHandlers = useHandlers();
21487
+ /* @conditional-compile-remove(close-captions) */
21488
+ const onSpokenLanguageDrawerItemClick = React.useCallback((languageCode) => {
21489
+ props.setCurrentSpokenLanguage(languageCode);
21490
+ }, [props]);
21491
+ /* @conditional-compile-remove(close-captions) */
21492
+ const spokenLanguageDrawerItems = React.useMemo(() => {
21493
+ var _a;
21494
+ return (_a = changeSpokenLanguageProps === null || changeSpokenLanguageProps === void 0 ? void 0 : changeSpokenLanguageProps.supportedSpokenLanguages) === null || _a === void 0 ? void 0 : _a.map((languageCode) => ({
21495
+ itemKey: languageCode,
21496
+ text: props.supportedLanguageStrings ? props.supportedLanguageStrings[languageCode] : languageCode,
21497
+ onItemClick: () => onSpokenLanguageDrawerItemClick(languageCode),
21498
+ secondaryIconProps: props.currentSpokenLanguage === languageCode ? { iconName: 'Accept' } : undefined
21499
+ }));
21500
+ }, [
21501
+ changeSpokenLanguageProps === null || changeSpokenLanguageProps === void 0 ? void 0 : changeSpokenLanguageProps.supportedSpokenLanguages,
21502
+ props.currentSpokenLanguage,
21503
+ props.supportedLanguageStrings,
21504
+ onSpokenLanguageDrawerItemClick
21505
+ ]);
21506
+ /* @conditional-compile-remove(close-captions) */
21507
+ return (React__default['default'].createElement(_DrawerMenu, { heading: (_a = props.strings) === null || _a === void 0 ? void 0 : _a.spokenLanguageMenuTitle, items: spokenLanguageDrawerItems !== null && spokenLanguageDrawerItems !== void 0 ? spokenLanguageDrawerItems : [], onLightDismiss: () => {
21508
+ changeSpokenLanguageHandlers.onSetSpokenLanguage(props.currentSpokenLanguage);
21509
+ props.onLightDismiss();
21510
+ }, styles: spokenLanguageDrawerStyles(theme) }));
21511
+ };
21512
+
21513
+ /**
21514
+ * @private
21515
+ */
21516
+ const themedToggleButtonStyle = (theme, checked) => {
21517
+ if (checked) {
21518
+ return {
21519
+ root: {
21520
+ margin: 0
21521
+ },
21522
+ pill: {
21523
+ backgroundColor: `${theme.palette.themePrimary} !important`
21524
+ },
21525
+ thumb: {
21526
+ backgroundColor: `${theme.palette.white} !important`
21527
+ }
21528
+ };
21529
+ }
21530
+ return {
21531
+ root: {
21532
+ margin: 0
21533
+ }
21534
+ };
21535
+ };
21536
+
21537
+ // Copyright (c) Microsoft Corporation.
21538
+ // Licensed under the MIT license.
21539
+ var __awaiter$a = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21540
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21541
+ return new (P || (P = Promise))(function (resolve, reject) {
21542
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21543
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21544
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21545
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21546
+ });
21547
+ };
20566
21548
  const inferCallWithChatControlOptions = (callWithChatControls) => {
20567
21549
  if (callWithChatControls === false) {
20568
21550
  return false;
@@ -20573,6 +21555,8 @@ const inferCallWithChatControlOptions = (callWithChatControls) => {
20573
21555
  /** @private */
20574
21556
  const MoreDrawer = (props) => {
20575
21557
  var _a, _b;
21558
+ /* @conditional-compile-remove(close-captions) */
21559
+ const theme = react.useTheme();
20576
21560
  const drawerMenuItems = [];
20577
21561
  const { speakers, onSelectSpeaker, onLightDismiss } = props;
20578
21562
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
@@ -20680,6 +21664,76 @@ const MoreDrawer = (props) => {
20680
21664
  iconProps: { iconName: 'Dialpad', styles: { root: { lineHeight: 0 } } }
20681
21665
  });
20682
21666
  }
21667
+ /* @conditional-compile-remove(close-captions) */
21668
+ //Captions drawer menu
21669
+ const supportedLanguageStrings = useLocale().strings.call.captionsAvailableLanguageStrings;
21670
+ /* @conditional-compile-remove(close-captions) */
21671
+ const startCaptionsButtonProps = useAdaptedSelector(_startCaptionsButtonSelector);
21672
+ /* @conditional-compile-remove(close-captions) */
21673
+ const startCaptionsButtonHandlers = useHandlers();
21674
+ /* @conditional-compile-remove(close-captions) */
21675
+ const [isSpokenLanguageDrawerOpen, setIsSpokenLanguageDrawerOpen] = React.useState(false);
21676
+ /* @conditional-compile-remove(close-captions) */
21677
+ const [currentSpokenLanguage, setCurrentSpokenLanguage] = React.useState(startCaptionsButtonProps.currentSpokenLanguage === ''
21678
+ ? defaultSpokenLanguage
21679
+ : startCaptionsButtonProps.currentSpokenLanguage);
21680
+ /* @conditional-compile-remove(close-captions) */
21681
+ const onToggleChange = React.useCallback(() => __awaiter$a(void 0, void 0, void 0, function* () {
21682
+ if (!startCaptionsButtonProps.checked) {
21683
+ yield startCaptionsButtonHandlers.onStartCaptions({
21684
+ spokenLanguage: currentSpokenLanguage
21685
+ });
21686
+ // set spoken language when start captions with a spoken language specified.
21687
+ // this is to fix the bug when a second user starts captions with a new spoken language, captions bot ignore that spoken language
21688
+ startCaptionsButtonHandlers.onSetSpokenLanguage(currentSpokenLanguage);
21689
+ }
21690
+ else {
21691
+ startCaptionsButtonHandlers.onStopCaptions();
21692
+ }
21693
+ }), [startCaptionsButtonProps.checked, startCaptionsButtonHandlers, currentSpokenLanguage]);
21694
+ /* @conditional-compile-remove(close-captions) */
21695
+ if (props.isCaptionsSupported) {
21696
+ const captionsDrawerItems = [];
21697
+ drawerMenuItems.push({
21698
+ itemKey: 'captions',
21699
+ id: 'common-call-composite-captions-button',
21700
+ disabled: props.disableButtonsForHoldScreen,
21701
+ text: props.strings.captionsMenuTitle,
21702
+ iconProps: { iconName: 'CaptionsIcon' },
21703
+ subMenuProps: captionsDrawerItems
21704
+ });
21705
+ captionsDrawerItems.push({
21706
+ itemKey: 'ToggleCaptionsKey',
21707
+ text: startCaptionsButtonProps.checked
21708
+ ? localeStrings.strings.call.startCaptionsButtonTooltipOnContent
21709
+ : localeStrings.strings.call.startCaptionsButtonTooltipOffContent,
21710
+ iconProps: {
21711
+ iconName: startCaptionsButtonProps.checked ? 'CaptionsOffIcon' : 'CaptionsIcon',
21712
+ styles: { root: { lineHeight: 0 } }
21713
+ },
21714
+ disabled: props.disableButtonsForHoldScreen,
21715
+ secondaryComponent: (React__default['default'].createElement(react.Stack, { verticalFill: true, verticalAlign: "center" },
21716
+ React__default['default'].createElement(react.Toggle, { id: "common-call-composite-captions-toggle-button", checked: startCaptionsButtonProps.checked, styles: themedToggleButtonStyle(theme, startCaptionsButtonProps.checked), onChange: onToggleChange })))
21717
+ });
21718
+ captionsDrawerItems.push({
21719
+ itemKey: 'ChangeSpokenLanguage',
21720
+ text: props.strings.spokenLanguageMenuTitle,
21721
+ id: 'common-call-composite-captions-settings-button',
21722
+ secondaryText: supportedLanguageStrings ? supportedLanguageStrings[currentSpokenLanguage] : currentSpokenLanguage,
21723
+ iconProps: {
21724
+ iconName: 'ChangeSpokenLanguageIcon',
21725
+ styles: { root: { lineHeight: 0 } }
21726
+ },
21727
+ disabled: props.disableButtonsForHoldScreen || !startCaptionsButtonProps.checked,
21728
+ onItemClick: () => {
21729
+ setIsSpokenLanguageDrawerOpen(true);
21730
+ },
21731
+ secondaryIconProps: {
21732
+ iconName: 'ChevronRight',
21733
+ styles: { root: { lineHeight: 0 } }
21734
+ }
21735
+ });
21736
+ }
20683
21737
  /* @conditional-compile-remove(control-bar-button-injection) */
20684
21738
  const customDrawerButtons = React.useMemo(() => generateCustomCallDrawerButtons(onFetchCustomButtonPropsTrampoline(drawerSelectionOptions !== false ? drawerSelectionOptions : undefined), drawerSelectionOptions !== false ? drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.displayType : undefined), [drawerSelectionOptions]);
20685
21739
  /* @conditional-compile-remove(control-bar-button-injection) */
@@ -20694,7 +21748,10 @@ const MoreDrawer = (props) => {
20694
21748
  customDrawerButtons['overflow'].forEach((element) => {
20695
21749
  drawerMenuItems.push(element);
20696
21750
  });
20697
- return React__default['default'].createElement(_DrawerMenu, { items: drawerMenuItems, onLightDismiss: props.onLightDismiss });
21751
+ /* @conditional-compile-remove(close-captions) */
21752
+ return (React__default['default'].createElement(React__default['default'].Fragment, null,
21753
+ isSpokenLanguageDrawerOpen && props.isCaptionsSupported && (React__default['default'].createElement(SpokenLanguageDrawer, { onLightDismiss: props.onLightDismiss, setCurrentSpokenLanguage: setCurrentSpokenLanguage, currentSpokenLanguage: currentSpokenLanguage, strings: props.strings, supportedLanguageStrings: supportedLanguageStrings })),
21754
+ !isSpokenLanguageDrawerOpen && React__default['default'].createElement(_DrawerMenu, { items: drawerMenuItems, onLightDismiss: props.onLightDismiss })));
20698
21755
  };
20699
21756
  const isDeviceSelected = (speaker, selectedSpeaker) => !!selectedSpeaker && speaker.id === selectedSpeaker.id;
20700
21757
  const isEnabled = (option) => option !== false;
@@ -20720,7 +21777,11 @@ const PreparedMoreDrawer = (props) => {
20720
21777
  peopleButtonLabel: strings.peopleButtonLabel,
20721
21778
  audioDeviceMenuTitle: strings.moreDrawerAudioDeviceMenuTitle,
20722
21779
  microphoneMenuTitle: strings.moreDrawerMicrophoneMenuTitle,
20723
- speakerMenuTitle: strings.moreDrawerSpeakerMenuTitle
21780
+ speakerMenuTitle: strings.moreDrawerSpeakerMenuTitle,
21781
+ /* @conditional-compile-remove(close-captions) */
21782
+ captionsMenuTitle: strings.moreDrawerCaptionsMenuTitle,
21783
+ /* @conditional-compile-remove(close-captions) */
21784
+ spokenLanguageMenuTitle: strings.moreDrawerSpokenLanguageMenuTitle
20724
21785
  }), [strings]);
20725
21786
  const deviceProps = useSelector$1(moreDrawerSelector);
20726
21787
  const callHandlers = useHandlers();
@@ -20939,6 +22000,10 @@ const CallArrangement = (props) => {
20939
22000
  if (!rolePermissions.cameraButton && props.errorBarProps) {
20940
22001
  errorBarProps = Object.assign(Object.assign({}, props.errorBarProps), { activeErrorMessages: props.errorBarProps.activeErrorMessages.filter((e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari') });
20941
22002
  }
22003
+ /* @conditional-compile-remove(close-captions) */
22004
+ const isTeamsCall = useSelector$1(getIsTeamsCall);
22005
+ /* @conditional-compile-remove(close-captions) */
22006
+ const hasJoinedCall = useSelector$1(getCallStatus) === 'Connected';
20942
22007
  return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(containerDivStyles), id: props.id },
20943
22008
  React__default['default'].createElement(react.Stack, { verticalFill: true, horizontalAlign: "stretch", className: containerClassName, "data-ui-id": props.dataUiId },
20944
22009
  React__default['default'].createElement(react.Stack, { grow: true, styles: callArrangementContainerStyles },
@@ -20949,6 +22014,8 @@ const CallArrangement = (props) => {
20949
22014
  peopleButtonChecked: activePane === 'people',
20950
22015
  /* @conditional-compile-remove(one-to-n-calling) */
20951
22016
  onPeopleButtonClicked: togglePeoplePane }))) : (React__default['default'].createElement(CommonCallControlBar, Object.assign({}, props.callControlProps, { callControls: props.callControlProps.options, callAdapter: adapter, mobileView: props.mobileView, disableButtonsForLobbyPage: isInLobby, peopleButtonChecked: activePane === 'people', onPeopleButtonClicked: togglePeoplePane, onMoreButtonClicked: onMoreButtonClicked,
22017
+ /* @conditional-compile-remove(close-captions) */
22018
+ isCaptionsSupported: isTeamsCall && hasJoinedCall,
20952
22019
  /* @conditional-compile-remove(video-background-effects) */
20953
22020
  onShowVideoEffectsPicker: setShowVideoEffectsPane }))))),
20954
22021
  ((_d = props.callControlProps) === null || _d === void 0 ? void 0 : _d.options) !== false && showDrawer && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
@@ -20956,7 +22023,9 @@ const CallArrangement = (props) => {
20956
22023
  /* @conditional-compile-remove(PSTN-calls) */
20957
22024
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
20958
22025
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
20959
- disableButtonsForHoldScreen: isInLocalHold }))),
22026
+ disableButtonsForHoldScreen: isInLocalHold,
22027
+ /* @conditional-compile-remove(close-captions) */
22028
+ isCaptionsSupported: isTeamsCall && hasJoinedCall }))),
20960
22029
  /* @conditional-compile-remove(PSTN-calls) */
20961
22030
  ((_e = props.callControlProps) === null || _e === void 0 ? void 0 : _e.options) !== false && showDtmfDialpad && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStylesValue },
20962
22031
  React__default['default'].createElement(SendDtmfDialpad, { isMobile: props.mobileView, strings: dialpadStrings, showDialpad: showDtmfDialpad, onDismissDialpad: onDismissDtmfDialpad }))),
@@ -20970,7 +22039,9 @@ const CallArrangement = (props) => {
20970
22039
  errorBarProps !== false && (React__default['default'].createElement(react.Stack, { styles: bannerNotificationStyles },
20971
22040
  React__default['default'].createElement(ErrorBar, Object.assign({}, errorBarProps)))),
20972
22041
  canUnmute && !!props.mutedNotificationProps && (React__default['default'].createElement(MutedNotification, Object.assign({}, props.mutedNotificationProps)))),
20973
- props.onRenderGalleryContent && props.onRenderGalleryContent()))),
22042
+ props.onRenderGalleryContent && props.onRenderGalleryContent(),
22043
+ /* @conditional-compile-remove(close-captions) */
22044
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !isInLocalHold && (React__default['default'].createElement(CaptionsBanner, { isMobile: props.mobileView }))))),
20974
22045
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
20975
22046
  callPaneContent()),
20976
22047
  /* @conditional-compile-remove(video-background-effects) */
@@ -23242,6 +24313,13 @@ class AzureCommunicationCallAdapter {
23242
24313
  this.sendDtmfTone.bind(this);
23243
24314
  /* @conditional-compile-remove(unsupported-browser) */
23244
24315
  this.allowUnsupportedBrowserVersion.bind(this);
24316
+ /* @conditional-compile-remove(close-captions) */
24317
+ {
24318
+ this.startCaptions.bind(this);
24319
+ this.stopCaptions.bind(this);
24320
+ this.setSpokenLanguage.bind(this);
24321
+ this.setCaptionLanguage.bind(this);
24322
+ }
23245
24323
  /* @conditional-compile-remove(video-background-effects) */
23246
24324
  this.blurVideoBackground.bind(this);
23247
24325
  /* @conditional-compile-remove(video-background-effects) */
@@ -23564,6 +24642,30 @@ class AzureCommunicationCallAdapter {
23564
24642
  this.handlers.onSendDtmfTone(dtmfTone);
23565
24643
  });
23566
24644
  }
24645
+ /* @conditional-compile-remove(close-captions) */
24646
+ startCaptions(options) {
24647
+ return __awaiter$4(this, void 0, void 0, function* () {
24648
+ this.handlers.onStartCaptions(options);
24649
+ });
24650
+ }
24651
+ /* @conditional-compile-remove(close-captions) */
24652
+ stopCaptions() {
24653
+ return __awaiter$4(this, void 0, void 0, function* () {
24654
+ this.handlers.onStopCaptions();
24655
+ });
24656
+ }
24657
+ /* @conditional-compile-remove(close-captions) */
24658
+ setCaptionLanguage(language) {
24659
+ return __awaiter$4(this, void 0, void 0, function* () {
24660
+ this.handlers.onSetCaptionLanguage(language);
24661
+ });
24662
+ }
24663
+ /* @conditional-compile-remove(close-captions) */
24664
+ setSpokenLanguage(language) {
24665
+ return __awaiter$4(this, void 0, void 0, function* () {
24666
+ this.handlers.onSetSpokenLanguage(language);
24667
+ });
24668
+ }
23567
24669
  getState() {
23568
24670
  return this.context.getState();
23569
24671
  }
@@ -23577,15 +24679,26 @@ class AzureCommunicationCallAdapter {
23577
24679
  on(event, listener) {
23578
24680
  this.emitter.on(event, listener);
23579
24681
  }
23580
- subscribeCallEvents() {
24682
+ /* @conditional-compile-remove(close-captions) */
24683
+ subscribeToCaptionEvents() {
23581
24684
  var _a, _b, _c, _d;
24685
+ if (((_a = this.call) === null || _a === void 0 ? void 0 : _a.state) === 'Connected') {
24686
+ (_b = this.call) === null || _b === void 0 ? void 0 : _b.feature(communicationCalling.Features.TeamsCaptions).on('captionsReceived', this.captionsReceived.bind(this));
24687
+ (_c = this.call) === null || _c === void 0 ? void 0 : _c.feature(communicationCalling.Features.TeamsCaptions).on('isCaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
24688
+ (_d = this.call) === null || _d === void 0 ? void 0 : _d.off('stateChanged', this.subscribeToCaptionEvents.bind(this));
24689
+ }
24690
+ }
24691
+ subscribeCallEvents() {
24692
+ var _a, _b, _c, _d, _e;
23582
24693
  (_a = this.call) === null || _a === void 0 ? void 0 : _a.on('remoteParticipantsUpdated', this.onRemoteParticipantsUpdated.bind(this));
23583
24694
  (_b = this.call) === null || _b === void 0 ? void 0 : _b.on('isMutedChanged', this.isMyMutedChanged.bind(this));
23584
24695
  (_c = this.call) === null || _c === void 0 ? void 0 : _c.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));
23585
24696
  (_d = this.call) === null || _d === void 0 ? void 0 : _d.on('idChanged', this.callIdChanged.bind(this));
24697
+ /* @conditional-compile-remove(close-captions) */
24698
+ (_e = this.call) === null || _e === void 0 ? void 0 : _e.on('stateChanged', this.subscribeToCaptionEvents.bind(this));
23586
24699
  }
23587
24700
  unsubscribeCallEvents() {
23588
- var _a, _b, _c, _d;
24701
+ var _a, _b, _c, _d, _e, _f, _g;
23589
24702
  for (const subscriber of this.participantSubscribers.values()) {
23590
24703
  subscriber.unsubscribeAll();
23591
24704
  }
@@ -23594,6 +24707,12 @@ class AzureCommunicationCallAdapter {
23594
24707
  (_b = this.call) === null || _b === void 0 ? void 0 : _b.off('isMutedChanged', this.isMyMutedChanged.bind(this));
23595
24708
  (_c = this.call) === null || _c === void 0 ? void 0 : _c.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));
23596
24709
  (_d = this.call) === null || _d === void 0 ? void 0 : _d.off('idChanged', this.callIdChanged.bind(this));
24710
+ /* @conditional-compile-remove(close-captions) */
24711
+ (_e = this._call) === null || _e === void 0 ? void 0 : _e.feature(communicationCalling.Features.TeamsCaptions).off('captionsReceived', this.captionsReceived.bind(this));
24712
+ /* @conditional-compile-remove(close-captions) */
24713
+ (_f = this._call) === null || _f === void 0 ? void 0 : _f.feature(communicationCalling.Features.TeamsCaptions).off('isCaptionsActiveChanged', this.isCaptionsActiveChanged.bind(this));
24714
+ /* @conditional-compile-remove(close-captions) */
24715
+ (_g = this.call) === null || _g === void 0 ? void 0 : _g.off('stateChanged', this.subscribeToCaptionEvents.bind(this));
23597
24716
  }
23598
24717
  onRemoteParticipantsUpdated({ added, removed }) {
23599
24718
  if (added && added.length > 0) {
@@ -23615,6 +24734,17 @@ class AzureCommunicationCallAdapter {
23615
24734
  var _a;
23616
24735
  this.emitter.emit('isLocalScreenSharingActiveChanged', { isScreenSharingOn: (_a = this.call) === null || _a === void 0 ? void 0 : _a.isScreenSharingOn });
23617
24736
  }
24737
+ /* @conditional-compile-remove(close-captions) */
24738
+ captionsReceived(captionsInfo) {
24739
+ this.emitter.emit('captionsReceived', { captionsInfo });
24740
+ }
24741
+ /* @conditional-compile-remove(close-captions) */
24742
+ isCaptionsActiveChanged() {
24743
+ var _a;
24744
+ this.emitter.emit('isCaptionsActiveChanged', {
24745
+ isActive: (_a = this.call) === null || _a === void 0 ? void 0 : _a.feature(communicationCalling.Features.TeamsCaptions).isCaptionsFeatureActive
24746
+ });
24747
+ }
23618
24748
  callIdChanged() {
23619
24749
  var _a;
23620
24750
  ((_a = this.call) === null || _a === void 0 ? void 0 : _a.id) && this.emitter.emit('callIdChanged', { callId: this.call.id });
@@ -24079,6 +25209,30 @@ class CallWithChatBackedCallAdapter {
24079
25209
  allowUnsupportedBrowserVersion() {
24080
25210
  return this.callWithChatAdapter.allowUnsupportedBrowserVersion();
24081
25211
  }
25212
+ /* @conditional-compile-remove(close-captions) */
25213
+ startCaptions(options) {
25214
+ return __awaiter$3(this, void 0, void 0, function* () {
25215
+ this.callWithChatAdapter.startCaptions(options);
25216
+ });
25217
+ }
25218
+ /* @conditional-compile-remove(close-captions) */
25219
+ stopCaptions() {
25220
+ return __awaiter$3(this, void 0, void 0, function* () {
25221
+ this.callWithChatAdapter.stopCaptions();
25222
+ });
25223
+ }
25224
+ /* @conditional-compile-remove(close-captions) */
25225
+ setCaptionLanguage(language) {
25226
+ return __awaiter$3(this, void 0, void 0, function* () {
25227
+ this.callWithChatAdapter.setCaptionLanguage(language);
25228
+ });
25229
+ }
25230
+ /* @conditional-compile-remove(close-captions) */
25231
+ setSpokenLanguage(language) {
25232
+ return __awaiter$3(this, void 0, void 0, function* () {
25233
+ this.callWithChatAdapter.setSpokenLanguage(language);
25234
+ });
25235
+ }
24082
25236
  /* @conditional-compile-remove(video-background-effects) */
24083
25237
  blurVideoBackground(backgroundBlurConfig) {
24084
25238
  return __awaiter$3(this, void 0, void 0, function* () {
@@ -24444,6 +25598,8 @@ const CallWithChatScreen = (props) => {
24444
25598
  }), [callWithChatStrings]);
24445
25599
  /* @conditional-compile-remove(PSTN-calls) */
24446
25600
  const alternateCallerId = callAdapter.getState().alternateCallerId;
25601
+ /* @conditional-compile-remove(close-captions) */
25602
+ const isTeamsCall = callAdapter.getState().isTeamsCall;
24447
25603
  const callCompositeOptions = React.useMemo(() => ({
24448
25604
  callControls: false,
24449
25605
  /* @conditional-compile-remove(call-readiness) */
@@ -24483,6 +25639,8 @@ const CallWithChatScreen = (props) => {
24483
25639
  disableButtonsForHoldScreen: isInLocalHold, callControls: props.callControls, containerHeight: containerHeight, containerWidth: containerWidth,
24484
25640
  /* @conditional-compile-remove(PSTN-calls) */
24485
25641
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
25642
+ /* @conditional-compile-remove(close-captions) */
25643
+ isCaptionsSupported: isTeamsCall && hasJoinedCall,
24486
25644
  /* @conditional-compile-remove(video-background-effects) */
24487
25645
  onShowVideoEffectsPicker: setShowVideoEffectsPane, rtl: props.rtl })))),
24488
25646
  showControlBar && showDrawer && (React__default['default'].createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
@@ -24492,7 +25650,9 @@ const CallWithChatScreen = (props) => {
24492
25650
  /* @conditional-compile-remove(PSTN-calls) */
24493
25651
  onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
24494
25652
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
24495
- disableButtonsForHoldScreen: isInLocalHold }))))),
25653
+ disableButtonsForHoldScreen: isInLocalHold,
25654
+ /* @conditional-compile-remove(close-captions) */
25655
+ isCaptionsSupported: isTeamsCall && hasJoinedCall }))))),
24496
25656
  /* @conditional-compile-remove(PSTN-calls) */
24497
25657
  showControlBar && showDtmfDialpad && (React__default['default'].createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
24498
25658
  React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
@@ -24769,6 +25929,12 @@ class AzureCommunicationCallWithChatAdapter {
24769
25929
  this.sendDtmfTone.bind(this);
24770
25930
  /* @conditional-compile-remove(unsupported-browser) */
24771
25931
  this.allowUnsupportedBrowserVersion.bind(this);
25932
+ /* @conditional-compile-remove(close-captions) */ {
25933
+ this.startCaptions.bind(this);
25934
+ this.stopCaptions.bind(this);
25935
+ this.setSpokenLanguage.bind(this);
25936
+ this.setCaptionLanguage.bind(this);
25937
+ }
24772
25938
  /* @conditional-compile-remove(video-background-effects) */
24773
25939
  this.blurVideoBackground.bind(this);
24774
25940
  /* @conditional-compile-remove(video-background-effects) */
@@ -24993,6 +26159,30 @@ class AzureCommunicationCallWithChatAdapter {
24993
26159
  allowUnsupportedBrowserVersion() {
24994
26160
  return this.callAdapter.allowUnsupportedBrowserVersion();
24995
26161
  }
26162
+ /* @conditional-compile-remove(close-captions) */
26163
+ startCaptions(options) {
26164
+ return __awaiter(this, void 0, void 0, function* () {
26165
+ yield this.callAdapter.startCaptions(options);
26166
+ });
26167
+ }
26168
+ /* @conditional-compile-remove(close-captions) */
26169
+ stopCaptions() {
26170
+ return __awaiter(this, void 0, void 0, function* () {
26171
+ yield this.callAdapter.stopCaptions();
26172
+ });
26173
+ }
26174
+ /* @conditional-compile-remove(close-captions) */
26175
+ setCaptionLanguage(language) {
26176
+ return __awaiter(this, void 0, void 0, function* () {
26177
+ yield this.callAdapter.setCaptionLanguage(language);
26178
+ });
26179
+ }
26180
+ /* @conditional-compile-remove(close-captions) */
26181
+ setSpokenLanguage(language) {
26182
+ return __awaiter(this, void 0, void 0, function* () {
26183
+ yield this.callAdapter.setSpokenLanguage(language);
26184
+ });
26185
+ }
24996
26186
  /* @conditional-compile-remove(video-background-effects) */
24997
26187
  blurVideoBackground(backgroundBlurConfig) {
24998
26188
  return __awaiter(this, void 0, void 0, function* () {
@@ -25052,6 +26242,14 @@ class AzureCommunicationCallWithChatAdapter {
25052
26242
  case 'selectedSpeakerChanged':
25053
26243
  this.callAdapter.on('selectedSpeakerChanged', listener);
25054
26244
  break;
26245
+ /* @conditional-compile-remove(close-captions) */
26246
+ case 'captionsReceived':
26247
+ this.callAdapter.on('captionsReceived', listener);
26248
+ break;
26249
+ /* @conditional-compile-remove(close-captions) */
26250
+ case 'isCaptionsActiveChanged':
26251
+ this.callAdapter.on('isCaptionsActiveChanged', listener);
26252
+ break;
25055
26253
  case 'messageReceived':
25056
26254
  this.chatAdapter.on('messageReceived', listener);
25057
26255
  break;
@@ -25110,6 +26308,14 @@ class AzureCommunicationCallWithChatAdapter {
25110
26308
  case 'selectedSpeakerChanged':
25111
26309
  this.callAdapter.off('selectedSpeakerChanged', listener);
25112
26310
  break;
26311
+ /* @conditional-compile-remove(close-captions) */
26312
+ case 'captionsReceived':
26313
+ this.callAdapter.off('captionsReceived', listener);
26314
+ break;
26315
+ /* @conditional-compile-remove(close-captions) */
26316
+ case 'isCaptionsActiveChanged':
26317
+ this.callAdapter.off('isCaptionsActiveChanged', listener);
26318
+ break;
25113
26319
  case 'messageReceived':
25114
26320
  this.chatAdapter.off('messageReceived', listener);
25115
26321
  break;